From d338a5613a80cd66719984cda50aa1f5b8747a6b Mon Sep 17 00:00:00 2001 From: Seth Horsley <git-public.ch12j@seth4242.com> Date: Tue, 24 Sep 2024 18:44:22 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=8D=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 2 +- Gemfile.lock | 5 +- app/components/rbui/index.js | 8 +++ app/javascript/application.js | 3 +- app/views/application_view.rb | 61 +++++++++++++++---- app/views/components/docs/components_table.rb | 12 ++-- .../components/docs/visual_code_example.rb | 11 ++++ app/views/docs/accordion_view.rb | 26 ++------ app/views/docs/alert_dialog_view.rb | 20 +----- app/views/docs/alert_view.rb | 11 +--- app/views/docs/aspect_ratio_view.rb | 11 +--- app/views/docs/avatar_view.rb | 15 +---- app/views/docs/badge_view.rb | 10 +-- app/views/docs/button_view.rb | 10 +-- app/views/docs/calendar_view.rb | 19 +----- app/views/docs/card_view.rb | 16 +---- app/views/docs/checkbox_view.rb | 11 +--- app/views/docs/clipboard_view.rb | 15 +---- app/views/docs/codeblock_view.rb | 12 +--- app/views/docs/collapsible_view.rb | 12 +--- app/views/docs/combobox_view.rb | 5 +- app/views/docs/command_view.rb | 18 +----- app/views/docs/context_menu_view.rb | 17 +----- app/views/docs/date_picker_view.rb | 24 +------- app/views/docs/dialog_view.rb | 21 +------ app/views/docs/dropdown_menu_view.rb | 17 +----- app/views/docs/form_view.rb | 7 +-- app/views/docs/hover_card_view.rb | 20 +++--- app/views/docs/input_view.rb | 13 +--- app/views/docs/link_view.rb | 10 +-- app/views/docs/pagination_view.rb | 13 +--- app/views/docs/popover_view.rb | 15 +---- app/views/docs/select_view.rb | 22 +------ app/views/docs/sheet_view.rb | 20 +----- app/views/docs/shortcut_key_view.rb | 12 +--- app/views/docs/table_view.rb | 17 +----- app/views/docs/tabs_view.rb | 14 +---- app/views/docs/theme_toggle_view.rb | 13 +--- app/views/docs/tooltip_view.rb | 13 +--- app/views/docs/typography_view.rb | 24 +------- lib/docs/component_struct.rb | 1 + package.json | 3 +- yarn.lock | 25 ++++---- 43 files changed, 189 insertions(+), 445 deletions(-) create mode 100644 app/components/rbui/index.js diff --git a/Gemfile b/Gemfile index d6525bc..36c6a17 100644 --- a/Gemfile +++ b/Gemfile @@ -75,7 +75,7 @@ end gem "phlex-rails" -gem "rbui", github: "rbui-labs/rbui" +gem "rbui", github: "rbui-labs/rbui", branch: "main" # gem "rbui", path: "../rbui" gem "pry" diff --git a/Gemfile.lock b/Gemfile.lock index 0d570a9..fb727b7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,8 +1,9 @@ GIT remote: https://github.com/rbui-labs/rbui.git - revision: 19a1b5df2db0e000a21b9b2c5a573179c07506be + revision: abb3ec1e5971413d4930ce4a56f688b7acb66a5e + branch: main specs: - rbui (0.2.0) + rbui (1.0.0.pre.alpha.3) phlex (~> 1.10) rouge (~> 4.2.0) tailwind_merge (>= 0.12) diff --git a/app/components/rbui/index.js b/app/components/rbui/index.js new file mode 100644 index 0000000..d7cc4ef --- /dev/null +++ b/app/components/rbui/index.js @@ -0,0 +1,8 @@ +import { application } from "../../../app/javascript/controllers/application"; + +// Import all controller files + +// Register all controllers + +import RBUI from "rbui-js"; +RBUI.initialize(application); diff --git a/app/javascript/application.js b/app/javascript/application.js index a37ff7f..1533532 100644 --- a/app/javascript/application.js +++ b/app/javascript/application.js @@ -1,4 +1,5 @@ // Entry point for the build script in your package.json import "@hotwired/turbo-rails"; -import "rbui-js"; import "./controllers"; + +import "../components/rbui"; diff --git a/app/views/application_view.rb b/app/views/application_view.rb index 06be49f..d7e4d9c 100644 --- a/app/views/application_view.rb +++ b/app/views/application_view.rb @@ -1,5 +1,18 @@ # frozen_string_literal: true +class MethodCallFinder < Prism::Visitor + attr_reader :calls + + def initialize(calls) + @calls = calls + end + + def visit_call_node(node) + super + calls << node.name + end +end + class ApplicationView < ApplicationComponent include RBUI # The ApplicationView is an abstract class for all your views. @@ -8,24 +21,35 @@ class ApplicationView < ApplicationComponent # can change that to `Phlex::HTML` if you want to keep views and # components independent. - def components(component, code_example = nil, use_component_files = false) + GITHUB_REPO_URL = "https://github.com/rbui-labs/rbui/" + GITHUB_FILE_URL = "#{GITHUB_REPO_URL}blob/main/" + + def component_references(component, code_example = nil, use_component_files = false) return [] unless code_example - component_names = code_example.scan(/(?<=^|\s)Combobox\w*/).uniq + calls = [] + Prism.parse(code_example).value.accept(MethodCallFinder.new(calls)) + calls_set = Set.new(calls.map(&:to_s)) + descendants = Phlex::HTML.descendants.map { |d| d.to_s.gsub(/^RBUI::/, "") } + component_names = descendants.select { |d| calls_set.include?(d) } + + # component_names = code_example.scan(/(?<=^|\s)#{component}\w*/).uniq component_names.map do |name| Docs::ComponentStruct.new( name: name, - source: "https://github.com/PhlexUI/phlex_ui/blob/v1/lib/rbui/#{component.downcase}/#{name.underscore}.rb", + source: "lib/rbui/#{camel_to_snake(component)}/#{camel_to_snake(name)}.rb", built_using: :phlex ) - end.push( - Docs::ComponentStruct.new( - name: "ComboboxController", - source: "https://github.com/PhlexUI/phlex_ui_stimulus/blob/main/controllers/command_controller.js", - built_using: :stimulus - ) - ) + end + + # component_names.push( + # Docs::ComponentStruct.new( + # name: "ComboboxController", + # source: "https://github.com/PhlexUI/phlex_ui_stimulus/blob/main/controllers/command_controller.js", + # built_using: :stimulus + # ) + # ) end require "rubygems" @@ -36,7 +60,7 @@ def component_files(component, gem_name = "rbui") return [] unless gem_spec # Construct the path to the component files within the gem - component_dir = File.join(gem_spec.gem_dir, "lib", "rbui", component.to_s.downcase) + component_dir = File.join(gem_spec.gem_dir, "lib", "rbui", camel_to_snake(component)) return [] unless Dir.exist?(component_dir) @@ -50,7 +74,8 @@ def component_files(component, gem_name = "rbui") basename = File.basename(file, ext) name = basename.camelize - source = "https://github.com/PhlexUI/phlex_ui/blob/v1/lib/rbui/#{component.to_s.downcase}/#{File.basename(file)}" + # source = "https://github.com/PhlexUI/phlex_ui/blob/v1/lib/rbui/#{component.to_s.downcase}/#{File.basename(file)}" + source = "lib/rbui/#{camel_to_snake(component)}/#{File.basename(file)}" built_using = if ext == ".rb" :phlex else # ".js" @@ -64,4 +89,16 @@ def component_files(component, gem_name = "rbui") ) end end + + def camel_to_snake(string) + string.gsub("::", "/") + .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2') + .gsub(/([a-z\d])([A-Z])/, '\1_\2') + .tr("-", "_") + .downcase + end + + def snake_to_camel(string) + string.split("_").map(&:capitalize).join + end end diff --git a/app/views/components/docs/components_table.rb b/app/views/components/docs/components_table.rb index ae71a41..bf64b36 100644 --- a/app/views/components/docs/components_table.rb +++ b/app/views/components/docs/components_table.rb @@ -11,8 +11,8 @@ def view_template Tabs(default_value: "account", class: "") do TabsList do - TabsTrigger(value: "components") { "Components shown above" } - TabsTrigger(value: "file-components") { "File Components" } if @file_components + TabsTrigger(value: "components") { "Components Referenced" } + TabsTrigger(value: "file-components") { "Component files" } end TabsContent(value: "components") do div(class: "rounded-lg border p-6 space-y-4 bg-background text-foreground") do @@ -25,7 +25,11 @@ def view_template TabsContent(value: "file-components") do div(class: "rounded-lg border p-6 space-y-4 bg-background text-foreground") do div do - component_table_view(@file_components) + if @file_components.present? + component_table_view(@file_components) + else + TypographyP { "No components for this page" } + end end end end @@ -65,7 +69,7 @@ def component_table_view(components) end TableCell do div(class: "flex justify-end") do - Link(href: component.source, variant: :outline, size: :sm) do + Link(href: component.source, variant: :outline, size: :sm, target: "_blank") do github_icon span(class: "ml-2") { "See source" } end diff --git a/app/views/components/docs/visual_code_example.rb b/app/views/components/docs/visual_code_example.rb index f8f3823..7cf6c7a 100644 --- a/app/views/components/docs/visual_code_example.rb +++ b/app/views/components/docs/visual_code_example.rb @@ -1,6 +1,16 @@ # frozen_string_literal: true class Docs::VisualCodeExample < ApplicationComponent + @@collected_code = [] + + def self.collected_code + @@collected_code.join("\n") + end + + def self.reset_collected_code + @@collected_code = [] + end + def initialize(title: nil, description: nil, context: nil) @title = title @description = description @@ -10,6 +20,7 @@ def initialize(title: nil, description: nil, context: nil) # standard:disable Style/ArgumentsForwarding def view_template(&block) @display_code = CGI.unescapeHTML(capture(&block)) + @@collected_code << @display_code div(id: @title) do div(class: "relative") do diff --git a/app/views/docs/accordion_view.rb b/app/views/docs/accordion_view.rb index 4158c27..1d363b9 100644 --- a/app/views/docs/accordion_view.rb +++ b/app/views/docs/accordion_view.rb @@ -3,13 +3,14 @@ class Docs::AccordionView < ApplicationView def view_template div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do - render Docs::Header.new(title: "Accordion", + component = "Accordion" + render Docs::Header.new(title: component, description: "A vertically stacked set of interactive headings that each reveal a section of content.") TypographyH2 { "Usage" } render Docs::VisualCodeExample.new(title: "Example", context: self) do - <<~RUBY + @@code = <<~RUBY div(class: "w-full") do Accordion do AccordionItem do @@ -44,26 +45,7 @@ def view_template RUBY end - render Docs::ComponentsTable.new(components) + render Docs::ComponentsTable.new(component_references(component, @@code), component_files(component)) end end - - private - - def components - [ - Docs::ComponentStruct.new(name: "AccordionController", - source: "https://github.com/PhlexUI/phlex_ui/blob/v1/lib/rbui/accordion/accordion_controller.js", built_using: :stimulus), - Docs::ComponentStruct.new(name: "Accordion", - source: "https://github.com/PhlexUI/phlex_ui/blob/v1/lib/rbui/accordion/accordion.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "AccordionItem", - source: "https://github.com/PhlexUI/phlex_ui/blob/v1/lib/rbui/accordion/accordion_item.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "AccordionTrigger", - source: "https://github.com/PhlexUI/phlex_ui/blob/v1/lib/rbui/accordion/accordion_trigger.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "AccordionContent", - source: "https://github.com/PhlexUI/phlex_ui/blob/v1/lib/rbui/accordion/accordion_content.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "AccordionIcon", - source: "https://github.com/PhlexUI/phlex_ui/blob/v1/lib/rbui/accordion/accordion_icon.rb", built_using: :phlex) - ] - end end diff --git a/app/views/docs/alert_dialog_view.rb b/app/views/docs/alert_dialog_view.rb index 373ee64..bd6dff2 100644 --- a/app/views/docs/alert_dialog_view.rb +++ b/app/views/docs/alert_dialog_view.rb @@ -2,6 +2,7 @@ class Docs::AlertDialogView < ApplicationView def view_template + component = "AlertDialog" div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do render Docs::Header.new(title: "Alert Dialog", description: "A modal dialog that interrupts the user with important content and expects a response.") @@ -26,24 +27,7 @@ def view_template RUBY end - render Docs::ComponentsTable.new(components) + render Docs::ComponentsTable.new(component_references(component, Docs::VisualCodeExample.collected_code), component_files(component)) end end - - private - - def components - [ - Docs::ComponentStruct.new(name: "AlertDialogController", source: "https://github.com/PhlexUI/phlex_ui_stimulus/blob/main/controllers/alert_dialog_controller.js", built_using: :stimulus), - Docs::ComponentStruct.new(name: "AlertDialog", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/alert_dialog.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "AlertDialogTrigger", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/alert_dialog/trigger.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "AlertDialogContent", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/alert_dialog/content.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "AlertDialogHeader", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/alert_dialog/header.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "AlertDialogTitle", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/alert_dialog/title.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "AlertDialogDescription", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/alert_dialog/description.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "AlertDialogFooter", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/alert_dialog/footer.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "AlertDialogCancel", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/alert_dialog/cancel.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "AlertDialogAction", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/alert_dialog/action.rb", built_using: :phlex) - ] - end end diff --git a/app/views/docs/alert_view.rb b/app/views/docs/alert_view.rb index 3da53af..e878bd1 100644 --- a/app/views/docs/alert_view.rb +++ b/app/views/docs/alert_view.rb @@ -2,6 +2,7 @@ class Docs::AlertView < ApplicationView def view_template + component = "Alert" div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do render Docs::Header.new(title: "Alert", description: "Displays a callout for user attention.") @@ -56,20 +57,12 @@ def view_template RUBY end - render Docs::ComponentsTable.new(components) + render Docs::ComponentsTable.new(component_references(component, Docs::VisualCodeExample.collected_code), component_files(component)) end end private - def components - [ - Docs::ComponentStruct.new(name: "Alert", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/alert.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "AlertTitle", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/alert/title.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "AlertDescription", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/alert/description.rb", built_using: :phlex) - ] - end - def rocket_icon svg( xmlns: "http://www.w3.org/2000/svg", diff --git a/app/views/docs/aspect_ratio_view.rb b/app/views/docs/aspect_ratio_view.rb index 9bf2eb2..d8d0fdd 100644 --- a/app/views/docs/aspect_ratio_view.rb +++ b/app/views/docs/aspect_ratio_view.rb @@ -2,6 +2,7 @@ class Docs::AspectRatioView < ApplicationView def view_template + component = "AspectRatio" div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do render Docs::Header.new(title: "Aspect Ratio", description: "Displays content within a desired ratio.") @@ -59,15 +60,7 @@ def view_template RUBY end - render Docs::ComponentsTable.new(components) + render Docs::ComponentsTable.new(component_references(component, Docs::VisualCodeExample.collected_code), component_files(component)) end end - - private - - def components - [ - Docs::ComponentStruct.new(name: "AspectRatio", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/aspect_ratio.rb", built_using: :phlex) - ] - end end diff --git a/app/views/docs/avatar_view.rb b/app/views/docs/avatar_view.rb index 2ee13ce..2f5f31f 100644 --- a/app/views/docs/avatar_view.rb +++ b/app/views/docs/avatar_view.rb @@ -2,6 +2,7 @@ class Docs::AvatarView < ApplicationView def view_template + component = "Avatar" div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do render Docs::Header.new(title: "Avatar", description: "An image element with a fallback for representing the user.") @@ -57,7 +58,7 @@ def view_template end render Docs::VisualCodeExample.new(title: "Sizes (only fallback)", context: self) do - <<~RUBY + @@code = <<~RUBY div(class: 'flex items-center space-x-2') do # size: :xs Avatar(size: :xs) do @@ -83,17 +84,7 @@ def view_template RUBY end - render Docs::ComponentsTable.new(components) + render Docs::ComponentsTable.new(component_references(component, Docs::VisualCodeExample.collected_code), component_files(component)) end end - - private - - def components - [ - Docs::ComponentStruct.new(name: "Avatar", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/avatar.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "AvatarImage", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/avatar/image.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "AvatarFallback", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/avatar/fallback.rb", built_using: :phlex) - ] - end end diff --git a/app/views/docs/badge_view.rb b/app/views/docs/badge_view.rb index 9af392f..de54269 100644 --- a/app/views/docs/badge_view.rb +++ b/app/views/docs/badge_view.rb @@ -70,15 +70,7 @@ def view_template end # components - render Docs::ComponentsTable.new(components) + render Docs::ComponentsTable.new(component_references("Badge", Docs::VisualCodeExample.collected_code), component_files("Badge")) end end - - private - - def components - [ - Docs::ComponentStruct.new(name: "Badge", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/badge.rb", built_using: :phlex) - ] - end end diff --git a/app/views/docs/button_view.rb b/app/views/docs/button_view.rb index 1efeccf..343141f 100644 --- a/app/views/docs/button_view.rb +++ b/app/views/docs/button_view.rb @@ -121,15 +121,7 @@ def view_template RUBY end - render Docs::ComponentsTable.new(components) + render Docs::ComponentsTable.new(component_references("Button", Docs::VisualCodeExample.collected_code), component_files("Button")) end end - - private - - def components - [ - Docs::ComponentStruct.new(name: "Button", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/button.rb", built_using: :phlex) - ] - end end diff --git a/app/views/docs/calendar_view.rb b/app/views/docs/calendar_view.rb index a422c37..f10b85e 100644 --- a/app/views/docs/calendar_view.rb +++ b/app/views/docs/calendar_view.rb @@ -2,6 +2,7 @@ class Docs::CalendarView < ApplicationView def view_template + component = "Calendar" div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do render Docs::Header.new(title: "Calendar", description: "A date field component that allows users to enter and edit date.") @@ -25,23 +26,7 @@ def view_template RUBY end - render Docs::ComponentsTable.new(components) + render Docs::ComponentsTable.new(component_references(component, Docs::VisualCodeExample.collected_code), component_files(component)) end end - - private - - def components - [ - Docs::ComponentStruct.new(name: "CalendarController", source: "https://github.com/PhlexUI/phlex_ui_stimulus_pro/blob/main/controllers/calendar_controller.js", built_using: :stimulus), - Docs::ComponentStruct.new(name: "Calendar", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/calendar.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "CalendarBody", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/calendar/body.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "CalendarDays", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/calendar/days.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "CalendarHeader", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/calendar/header.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "CalendarNext", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/calendar/next.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "CalendarPrev", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/calendar/prev.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "CalendarTitle", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/calendar/title.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "CalendarWeekdays", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/calendar/weekdays.rb", built_using: :phlex) - ] - end end diff --git a/app/views/docs/card_view.rb b/app/views/docs/card_view.rb index a95f266..4d94a77 100644 --- a/app/views/docs/card_view.rb +++ b/app/views/docs/card_view.rb @@ -2,6 +2,7 @@ class Docs::CardView < ApplicationView def view_template + component = "Card" div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do render Docs::Header.new(title: "Card", description: "Displays a card with header, content, and footer.") @@ -73,23 +74,10 @@ def view_template RUBY end - render Docs::ComponentsTable.new(components) + render Docs::ComponentsTable.new(component_references(component, Docs::VisualCodeExample.collected_code), component_files(component)) end end - private - - def components - [ - Docs::ComponentStruct.new(name: "Card", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/card.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "CardHeader", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/card/header.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "CardContent", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/card/content.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "CardFooter", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/card/footer.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "CardTitle", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/card/title.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "CardDescription", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/card/description.rb", built_using: :phlex) - ] - end - def arrow_icon(classes: nil) svg( xmlns: "http://www.w3.org/2000/svg", diff --git a/app/views/docs/checkbox_view.rb b/app/views/docs/checkbox_view.rb index 9b0fba9..4a3b375 100644 --- a/app/views/docs/checkbox_view.rb +++ b/app/views/docs/checkbox_view.rb @@ -2,6 +2,7 @@ class Docs::CheckboxView < ApplicationView def view_template + component = "Checkbox" div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do render Docs::Header.new(title: "Checkbox", description: "A control that allows the user to toggle between checked and not checked.") @@ -32,15 +33,7 @@ def view_template RUBY end - render Docs::ComponentsTable.new(components) + render Docs::ComponentsTable.new(component_references(component, Docs::VisualCodeExample.collected_code), component_files(component)) end end - - private - - def components - [ - Docs::ComponentStruct.new(name: "Checkbox", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/checkbox.rb", built_using: :phlex) - ] - end end diff --git a/app/views/docs/clipboard_view.rb b/app/views/docs/clipboard_view.rb index 5a7dbb0..ad98d6f 100644 --- a/app/views/docs/clipboard_view.rb +++ b/app/views/docs/clipboard_view.rb @@ -2,6 +2,7 @@ class Docs::ClipboardView < ApplicationView def view_template + component = "Clipboard" div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do render Docs::Header.new(title: "Clipboard", description: "A control to allow you to copy content to the clipboard.") @@ -21,19 +22,7 @@ def view_template RUBY end - render Docs::ComponentsTable.new(components) + render Docs::ComponentsTable.new(component_references(component, Docs::VisualCodeExample.collected_code), component_files(component)) end end - - private - - def components - [ - Docs::ComponentStruct.new(name: "ClipboarController", source: "https://github.com/PhlexUI/phlex_ui_stimulus/blob/main/controllers/clipboard_controller.js", built_using: :stimulus), - Docs::ComponentStruct.new(name: "ClipboardPopover", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/clipboard_popover.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "ClipboardSource", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/clipboard_source.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "ClipboardTrigger", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/clipboard_trigger.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "Clipboard", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/clipboard.rb", built_using: :phlex) - ] - end end diff --git a/app/views/docs/codeblock_view.rb b/app/views/docs/codeblock_view.rb index e30be41..60a8e3b 100644 --- a/app/views/docs/codeblock_view.rb +++ b/app/views/docs/codeblock_view.rb @@ -2,6 +2,7 @@ class Docs::CodeblockView < ApplicationView def view_template + component = "Codeblock" div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do render Docs::Header.new(title: "Codeblock", description: "A component for displaying highlighted code.") @@ -46,16 +47,7 @@ def hello_world RUBY end - render Docs::ComponentsTable.new(components) + render Docs::ComponentsTable.new(component_references(component, Docs::VisualCodeExample.collected_code), component_files(component)) end end - - private - - def components - [ - Docs::ComponentStruct.new(name: "ClipboardController", source: "https://github.com/PhlexUI/phlex_ui_stimulus/blob/main/controllers/clipboard_controller.js", built_using: :stimulus), - Docs::ComponentStruct.new(name: "Codeblock", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/codeblock.rb", built_using: :phlex) - ] - end end diff --git a/app/views/docs/collapsible_view.rb b/app/views/docs/collapsible_view.rb index bc10a96..2ebeb36 100644 --- a/app/views/docs/collapsible_view.rb +++ b/app/views/docs/collapsible_view.rb @@ -2,6 +2,7 @@ class Docs::CollapsibleView < ApplicationView def view_template + component = "Collapsible" div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do render Docs::Header.new(title: "Collapsible", description: "An interactive component which expands/collapses a panel.") @@ -69,21 +70,12 @@ def view_template RUBY end - render Docs::ComponentsTable.new(components) + render Docs::ComponentsTable.new(component_references(component, Docs::VisualCodeExample.collected_code), component_files(component)) end end private - def components - [ - Docs::ComponentStruct.new(name: "CollapsibleController", source: "https://github.com/PhlexUI/phlex_ui_stimulus/blob/main/controllers/collapsible_controller.js", built_using: :stimulus), - Docs::ComponentStruct.new(name: "Collapsible", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/collapsible.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "CollapsibleTrigger", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/collapsible/trigger.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "CollapsibleContent", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/collapsible/content.rb", built_using: :phlex) - ] - end - def chevron_icon svg( xmlns: "http://www.w3.org/2000/svg", diff --git a/app/views/docs/combobox_view.rb b/app/views/docs/combobox_view.rb index 441c514..4ef0f52 100644 --- a/app/views/docs/combobox_view.rb +++ b/app/views/docs/combobox_view.rb @@ -4,8 +4,9 @@ class Docs::ComboboxView < ApplicationView @@code_example = nil def view_template + component = "Combobox" div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do - render Docs::Header.new(title: "Combobox", description: "Autocomplete input and command palette with a list of suggestions.") + render Docs::Header.new(title: component, description: "Autocomplete input and command palette with a list of suggestions.") TypographyH2 { "Usage" } @@ -52,7 +53,7 @@ def view_template end RUBY end - render Docs::ComponentsTable.new(components("Combobox", @@code_example), component_files("Combobox")) + render Docs::ComponentsTable.new(component_references(component, @@code_example), component_files("Combobox")) end end end diff --git a/app/views/docs/command_view.rb b/app/views/docs/command_view.rb index 731b602..ebd2c3f 100644 --- a/app/views/docs/command_view.rb +++ b/app/views/docs/command_view.rb @@ -2,6 +2,7 @@ class Docs::CommandView < ApplicationView def view_template + component = "Command" div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do render Docs::Header.new(title: "Command", description: "Fast, composable, unstyled command menu for Phlex.") @@ -92,27 +93,12 @@ def view_template RUBY end - render Docs::ComponentsTable.new(components) + render Docs::ComponentsTable.new(component_references(component, Docs::VisualCodeExample.collected_code), component_files(component)) end end private - def components - [ - Docs::ComponentStruct.new(name: "CommandController", source: "https://github.com/PhlexUI/phlex_ui_stimulus_pro/blob/main/controllers/command_controller.js", built_using: :stimulus), - Docs::ComponentStruct.new(name: "CommandDialog", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/command/dialog.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "CommandDialogTrigger", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/command/dialog_trigger.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "CommandDialogContent", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/command/dialog_content.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "Command", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/command.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "CommandInput", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/command/input.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "CommandEmpty", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/command/empty.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "CommandList", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/command/list.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "CommandGroup", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/command/group.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "CommandItem", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/command/item.rb", built_using: :phlex) - ] - end - def search_icon svg( xmlns: "http://www.w3.org/2000/svg", diff --git a/app/views/docs/context_menu_view.rb b/app/views/docs/context_menu_view.rb index e3f66d9..12faf70 100644 --- a/app/views/docs/context_menu_view.rb +++ b/app/views/docs/context_menu_view.rb @@ -2,6 +2,7 @@ class Docs::ContextMenuView < ApplicationView def view_template + component = "ContextMenu" div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do render Docs::Header.new(title: "Context Menu", description: "Displays a menu to the user — such as a set of actions or functions — triggered by a right click.") @@ -76,21 +77,7 @@ def view_template RUBY end - render Docs::ComponentsTable.new(components) + render Docs::ComponentsTable.new(component_references(component, Docs::VisualCodeExample.collected_code), component_files(component)) end end - - private - - def components - [ - Docs::ComponentStruct.new(name: "PopoverController", source: "https://github.com/PhlexUI/phlex_ui_stimulus/blob/main/controllers/popover_controller.js", built_using: :stimulus), - Docs::ComponentStruct.new(name: "ContextMenu", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/context_menu.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "ContextMenuTrigger", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/context_menu/trigger.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "ContextMenuContent", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/context_menu/content.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "ContextMenuItem", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/context_menu/item.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "ContextMenuSeparator", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/context_menu/separator.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "ContextMenuLabel", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/context_menu/label.rb", built_using: :phlex) - ] - end end diff --git a/app/views/docs/date_picker_view.rb b/app/views/docs/date_picker_view.rb index d0fcfb7..160066a 100644 --- a/app/views/docs/date_picker_view.rb +++ b/app/views/docs/date_picker_view.rb @@ -2,6 +2,8 @@ class Docs::DatePickerView < ApplicationView def view_template + component = "Date Picker" + div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do render Docs::Header.new(title: "Date Picker", description: "A date picker component with input.") @@ -25,27 +27,7 @@ def view_template RUBY end - render Docs::ComponentsTable.new(components) + render Docs::ComponentsTable.new(component_references(component, Docs::VisualCodeExample.collected_code), component_files(component)) end end - - private - - def components - [ - Docs::ComponentStruct.new(name: "CalendarController", source: "https://github.com/PhlexUI/phlex_ui_stimulus_pro/blob/main/controllers/calendar_controller.js", built_using: :stimulus), - Docs::ComponentStruct.new(name: "PopoverController", source: "https://github.com/PhlexUI/phlex_ui_stimulus/blob/main/controllers/popover_controller.js", built_using: :stimulus), - Docs::ComponentStruct.new(name: "Calendar", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/calendar.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "CalendarBody", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/calendar/body.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "CalendarDays", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/calendar/days.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "CalendarHeader", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/calendar/header.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "CalendarNext", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/calendar/next.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "CalendarPrev", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/calendar/prev.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "CalendarTitle", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/calendar/title.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "CalendarWeekdays", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/calendar/weekdays.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "Popover", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/popover.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "PopoverTrigger", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/popover/trigger.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "PopoverContent", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/popover/content.rb", built_using: :phlex) - ] - end end diff --git a/app/views/docs/dialog_view.rb b/app/views/docs/dialog_view.rb index bca2e8a..6abf206 100644 --- a/app/views/docs/dialog_view.rb +++ b/app/views/docs/dialog_view.rb @@ -2,6 +2,8 @@ class Docs::DialogView < ApplicationView def view_template + component = "Dialog" + div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do render Docs::Header.new(title: "Dialog", description: "A window overlaid on either the primary window or another dialog window, rendering the content underneath inert.") @@ -95,24 +97,7 @@ def view_template RUBY end - render Docs::ComponentsTable.new(components) + render Docs::ComponentsTable.new(component_references(component, Docs::VisualCodeExample.collected_code), component_files(component)) end end - - private - - def components - [ - Docs::ComponentStruct.new(name: "DialogController", source: "https://github.com/PhlexUI/phlex_ui_stimulus/blob/main/controllers/dialog_controller.js", built_using: :stimulus), - Docs::ComponentStruct.new(name: "DismissableController", source: "https://github.com/PhlexUI/phlex_ui_stimulus/blob/main/controllers/dismissable_controller.js", built_using: :stimulus), - Docs::ComponentStruct.new(name: "Dialog", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/dialog.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "Trigger", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/dialog/trigger.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "Content", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/dialog/content.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "Header", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/dialog/header.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "Title", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/dialog/title.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "Description", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/dialog/description.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "Middle", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/dialog/middle.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "Footer", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/dialog/footer.rb", built_using: :phlex) - ] - end end diff --git a/app/views/docs/dropdown_menu_view.rb b/app/views/docs/dropdown_menu_view.rb index 01d7f52..c38c105 100644 --- a/app/views/docs/dropdown_menu_view.rb +++ b/app/views/docs/dropdown_menu_view.rb @@ -2,6 +2,7 @@ class Docs::DropdownMenuView < ApplicationView def view_template + component = "DropdownMenu" div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do render Docs::Header.new(title: "Dropdown Menu", description: "Displays a menu to the user — such as a set of actions or functions — triggered by a button.") @@ -221,21 +222,7 @@ def view_template RUBY end - render Docs::ComponentsTable.new(components) + render Docs::ComponentsTable.new(component_references(component, Docs::VisualCodeExample.collected_code), component_files(component)) end end - - private - - def components - [ - Docs::ComponentStruct.new(name: "PopoverController", source: "https://github.com/PhlexUI/phlex_ui_stimulus/blob/main/controllers/popover_controller.js", built_using: :stimulus), - Docs::ComponentStruct.new(name: "DropdownMenu", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/dropdown_menu.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "DropdownMenuTrigger", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/dropdown_menu/trigger.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "DropdownMenuContent", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/dropdown_menu/content.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "DropdownMenuLabel", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/dropdown_menu/label.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "DropdownMenuItem", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/dropdown_menu/item.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "DropdownMenuSeparator", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/dropdown_menu/separator.rb", built_using: :phlex) - ] - end end diff --git a/app/views/docs/form_view.rb b/app/views/docs/form_view.rb index f3598b0..4249e2e 100644 --- a/app/views/docs/form_view.rb +++ b/app/views/docs/form_view.rb @@ -1,16 +1,15 @@ # frozen_string_literal: true class Docs::FormView < ApplicationView - @@code_example = nil - def view_template + component = "Form" div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do render Docs::Header.new(title: "Form", description: "Building forms with built-in client-side validations.") TypographyH2 { "Usage" } render Docs::VisualCodeExample.new(title: "Example", context: self) do - @@code_example = <<~RUBY + <<~RUBY Form(class: "w-2/3 space-y-6") do FormField do FormFieldLabel { "Default error" } @@ -141,7 +140,7 @@ def view_template RUBY end - render Docs::ComponentsTable.new(components("Form", @@code_example), component_files("Form")) + render Docs::ComponentsTable.new(component_references(component, Docs::VisualCodeExample.collected_code), component_files(component)) end end end diff --git a/app/views/docs/hover_card_view.rb b/app/views/docs/hover_card_view.rb index 234265d..502d208 100644 --- a/app/views/docs/hover_card_view.rb +++ b/app/views/docs/hover_card_view.rb @@ -2,6 +2,8 @@ class Docs::HoverCardView < ApplicationView def view_template + component = "HoverCard" + div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do render Docs::Header.new(title: "Hover Card", description: "For sighted users to preview content available behind a link.") @@ -50,18 +52,18 @@ def view_template RUBY end - render Docs::ComponentsTable.new(components) + render Docs::ComponentsTable.new(component_references(component, Docs::VisualCodeExample.collected_code), component_files(component)) end end private - def components - [ - Docs::ComponentStruct.new(name: "PopoverController", source: "https://github.com/PhlexUI/phlex_ui_stimulus/blob/main/controllers/popover_controller.js", built_using: :stimulus), - Docs::ComponentStruct.new(name: "HoverCard", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/hover_card.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "HoverCardTrigger", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/hover_card/trigger.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "HoverCardContent", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/hover_card/content.rb", built_using: :phlex) - ] - end + # def components + # [ + # Docs::ComponentStruct.new(name: "PopoverController", source: "https://github.com/PhlexUI/phlex_ui_stimulus/blob/main/controllers/popover_controller.js", built_using: :stimulus), + # Docs::ComponentStruct.new(name: "HoverCard", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/hover_card.rb", built_using: :phlex), + # Docs::ComponentStruct.new(name: "HoverCardTrigger", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/hover_card/trigger.rb", built_using: :phlex), + # Docs::ComponentStruct.new(name: "HoverCardContent", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/hover_card/content.rb", built_using: :phlex) + # ] + # end end diff --git a/app/views/docs/input_view.rb b/app/views/docs/input_view.rb index fd01412..fbaf9f0 100644 --- a/app/views/docs/input_view.rb +++ b/app/views/docs/input_view.rb @@ -2,6 +2,8 @@ class Docs::InputView < ApplicationView def view_template + component = "Input" + div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do render Docs::Header.new(title: "Input", description: "Displays a form input field or a component that looks like an input field.") @@ -50,16 +52,7 @@ def view_template RUBY end - render Docs::ComponentsTable.new(components) + render Docs::ComponentsTable.new(component_references(component, Docs::VisualCodeExample.collected_code), component_files(component)) end end - - private - - def components - [ - Docs::ComponentStruct.new(name: "InputController", source: "https://github.com/PhlexUI/phlex_ui_stimulus/blob/main/controllers/input_controller.js", built_using: :stimulus), - Docs::ComponentStruct.new(name: "Input", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/input.rb", built_using: :phlex) - ] - end end diff --git a/app/views/docs/link_view.rb b/app/views/docs/link_view.rb index 8f919f5..4faa10d 100644 --- a/app/views/docs/link_view.rb +++ b/app/views/docs/link_view.rb @@ -2,6 +2,8 @@ class Docs::LinkView < ApplicationView def view_template + component = "Link" + div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do render Docs::Header.new(title: "Link", description: "Displays a link that looks like a button or underline link.") @@ -54,18 +56,12 @@ def view_template RUBY end - render Docs::ComponentsTable.new(components) + render Docs::ComponentsTable.new(component_references(component, Docs::VisualCodeExample.collected_code), component_files(component)) end end private - def components - [ - Docs::ComponentStruct.new(name: "Link", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/link.rb", built_using: :phlex) - ] - end - def chevron_icon svg( xmlns: "http://www.w3.org/2000/svg", diff --git a/app/views/docs/pagination_view.rb b/app/views/docs/pagination_view.rb index aacc627..d28b616 100644 --- a/app/views/docs/pagination_view.rb +++ b/app/views/docs/pagination_view.rb @@ -2,6 +2,8 @@ class Docs::PaginationView < ApplicationView def view_template + component = "Pagination" + div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do render Docs::Header.new(title: "Pagination", description: "Pagination with page navigation, next and previous links.") @@ -41,21 +43,12 @@ def view_template RUBY end - render Docs::ComponentsTable.new(components) + render Docs::ComponentsTable.new(component_references(component, Docs::VisualCodeExample.collected_code), component_files(component)) end end private - def components - [ - Docs::ComponentStruct.new(name: "Pagination", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/pagination.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "PaginationContent", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/pagination/content.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "PaginationEllipsis", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/pagination/ellipsis.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "PaginationItem", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/pagination/item.rb", built_using: :phlex) - ] - end - def chevrons_left_icon svg( xmlns: "http://www.w3.org/2000/svg", diff --git a/app/views/docs/popover_view.rb b/app/views/docs/popover_view.rb index cba75da..37dcb85 100644 --- a/app/views/docs/popover_view.rb +++ b/app/views/docs/popover_view.rb @@ -2,6 +2,8 @@ class Docs::PopoverView < ApplicationView def view_template + component = "Popover" + div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do render Docs::Header.new(title: "Popover", description: "Displays rich content in a portal, triggered by a button.") @@ -961,18 +963,7 @@ def view_template RUBY end - render Docs::ComponentsTable.new(components) + render Docs::ComponentsTable.new(component_references(component, Docs::VisualCodeExample.collected_code), component_files(component)) end end - - private - - def components - [ - Docs::ComponentStruct.new(name: "PopoverController", source: "https://github.com/PhlexUI/phlex_ui_stimulus/blob/main/controllers/popover_controller.js", built_using: :stimulus), - Docs::ComponentStruct.new(name: "Popover", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/popover.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "PopoverTrigger", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/popover/trigger.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "PopoverContent", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/popover/content.rb", built_using: :phlex) - ] - end end diff --git a/app/views/docs/select_view.rb b/app/views/docs/select_view.rb index 49950ed..d2a2c72 100644 --- a/app/views/docs/select_view.rb +++ b/app/views/docs/select_view.rb @@ -2,6 +2,8 @@ class Docs::SelectView < ApplicationView def view_template + component = "Select" + div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do render Docs::Header.new(title: "Select", description: "Displays a list of options for the user to pick from—triggered by a button.") @@ -29,25 +31,7 @@ def view_template RUBY end - render Docs::ComponentsTable.new(components) + render Docs::ComponentsTable.new(component_references(component, Docs::VisualCodeExample.collected_code), component_files(component)) end end - - private - - def components - [ - Docs::ComponentStruct.new(name: "SelectController", source: "https://github.com/PhlexUI/phlex_ui_stimulus/blob/main/controllers/select_controller.js", built_using: :stimulus), - Docs::ComponentStruct.new(name: "TextController", source: "https://github.com/PhlexUI/phlex_ui_stimulus/blob/main/controllers/text_controller.js", built_using: :stimulus), - Docs::ComponentStruct.new(name: "InputController", source: "https://github.com/PhlexUI/phlex_ui_stimulus/blob/main/controllers/input_controller.js", built_using: :stimulus), - Docs::ComponentStruct.new(name: "Select", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/select.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "SelectTrigger", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/select/trigger.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "SelectContent", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/select/content.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "SelectLabel", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/select/label.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "SelectItem", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/select/item.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "SelectGroup", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/select/group.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "SelectInput", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/select/input.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "SelectValue", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/select/value.rb", built_using: :phlex) - ] - end end diff --git a/app/views/docs/sheet_view.rb b/app/views/docs/sheet_view.rb index c959f06..d22ea45 100644 --- a/app/views/docs/sheet_view.rb +++ b/app/views/docs/sheet_view.rb @@ -2,6 +2,8 @@ class Docs::SheetView < ApplicationView def view_template + component = "Sheet" + div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do render Docs::Header.new(title: "Sheet", description: "Extends the Sheet component to display content that complements the main content of the screen.") @@ -66,23 +68,7 @@ def view_template RUBY end - render Docs::ComponentsTable.new(components) + render Docs::ComponentsTable.new(component_references(component, Docs::VisualCodeExample.collected_code), component_files(component)) end end - - private - - def components - [ - Docs::ComponentStruct.new(name: "SheetController", source: "https://github.com/PhlexUI/phlex_ui_stimulus_pro/blob/main/controllers/sheet_controller.js", built_using: :stimulus), - Docs::ComponentStruct.new(name: "Sheet", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/sheet.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "SheetTrigger", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/sheet/trigger.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "SheetContent", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/sheet/content.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "SheetHeader", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/sheet/header.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "SheetTitle", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/sheet/title.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "SheetDescription", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/sheet/description.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "SheetMiddle", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/sheet/middle.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "SheetFooter", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/sheet/footer.rb", built_using: :phlex) - ] - end end diff --git a/app/views/docs/shortcut_key_view.rb b/app/views/docs/shortcut_key_view.rb index e94e645..002d71d 100644 --- a/app/views/docs/shortcut_key_view.rb +++ b/app/views/docs/shortcut_key_view.rb @@ -2,6 +2,8 @@ class Docs::ShortcutKeyView < ApplicationView def view_template + component = "ShortcutKey" + div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do render Docs::Header.new(title: "Shortcut Key", description: "A component for displaying keyboard shortcuts.") @@ -19,15 +21,7 @@ def view_template RUBY end - render Docs::ComponentsTable.new(components) + render Docs::ComponentsTable.new(component_references(component, Docs::VisualCodeExample.collected_code), component_files(component)) end end - - private - - def components - [ - Docs::ComponentStruct.new(name: "ShortcutKey", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/shortcut_key.rb", built_using: :phlex) - ] - end end diff --git a/app/views/docs/table_view.rb b/app/views/docs/table_view.rb index a2ff26d..5442ba6 100644 --- a/app/views/docs/table_view.rb +++ b/app/views/docs/table_view.rb @@ -5,6 +5,8 @@ class Docs::TableView < ApplicationView User = Struct.new(:avatar_url, :name, :username, :commits, :github_url, keyword_init: true) def view_template + component = "Table" + div(class: "max-w-2xl mx-auto w-full py-10 space-y-8") do render Docs::Header.new(title: "Table", description: "A responsive table component.") @@ -42,25 +44,12 @@ def view_template RUBY end - render Docs::ComponentsTable.new(components) + render Docs::ComponentsTable.new(component_references(component, Docs::VisualCodeExample.collected_code), component_files(component)) end end private - def components - [ - Docs::ComponentStruct.new(name: "Table", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/table.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "TableCaption", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/table/caption.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "TableHeader", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/table/header.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "TableBody", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/table/body.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "TableFooter", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/table/footer.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "TableRow", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/table/row.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "TableHead", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/table/head.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "TableCell", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/table/cell.rb", built_using: :phlex) - ] - end - def invoices [ Invoice.new(identifier: "INV-0001", status: "Active", method: "Credit Card", amount: 100), diff --git a/app/views/docs/tabs_view.rb b/app/views/docs/tabs_view.rb index ffaee46..40368e5 100644 --- a/app/views/docs/tabs_view.rb +++ b/app/views/docs/tabs_view.rb @@ -4,6 +4,8 @@ class Docs::TabsView < ApplicationView Repo = Struct.new(:github_url, :name, :stars, :version, keyword_init: true) def view_template + component = "Tabs" + div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do render Docs::Header.new(title: "Tabs", description: "A set of layered sections of content—known as tab panels—that are displayed one at a time.") @@ -105,22 +107,12 @@ def view_template RUBY end - render Docs::ComponentsTable.new(components) + render Docs::ComponentsTable.new(component_references(component, Docs::VisualCodeExample.collected_code), component_files(component)) end end private - def components - [ - Docs::ComponentStruct.new(name: "TabsController", source: "https://github.com/PhlexUI/phlex_ui_stimulus/blob/main/controllers/tabs_controller.js", built_using: :stimulus), - Docs::ComponentStruct.new(name: "Tabs", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/tabs.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "TabsList", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/tabs/list.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "TabsTrigger", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/tabs/trigger.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "TabsContent", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/tabs/content.rb", built_using: :phlex) - ] - end - def book_icon svg( xmlns: "http://www.w3.org/2000/svg", diff --git a/app/views/docs/theme_toggle_view.rb b/app/views/docs/theme_toggle_view.rb index d20fb1c..ea1dfea 100644 --- a/app/views/docs/theme_toggle_view.rb +++ b/app/views/docs/theme_toggle_view.rb @@ -2,6 +2,8 @@ class Docs::ThemeToggleView < ApplicationView def view_template + component = "ThemeToggle" + div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do render Docs::Header.new(title: "Theme Toggle", description: "Toggle between dark/light theme.") @@ -61,16 +63,7 @@ def view_template RUBY end - render Docs::ComponentsTable.new(components) + render Docs::ComponentsTable.new(component_references(component, Docs::VisualCodeExample.collected_code), component_files(component)) end end - - private - - def components - [ - Docs::ComponentStruct.new(name: "ThemeToggle", source: "https://github.com/PhlexUI/phlex_ui/blob/v1/lib/rbui/toggle_theme/theme_toggle.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "ToggleThemeController", source: "https://github.com/PhlexUI/phlex_ui/blob/v1/lib/rbui/toggle_theme/toggle_theme_controller.js", built_using: :stimulus) - ] - end end diff --git a/app/views/docs/tooltip_view.rb b/app/views/docs/tooltip_view.rb index 144cc3c..5b2d10c 100644 --- a/app/views/docs/tooltip_view.rb +++ b/app/views/docs/tooltip_view.rb @@ -2,6 +2,8 @@ class Docs::TooltipView < ApplicationView def view_template + component = "Tooltip" + div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do render Docs::Header.new(title: "Tooltip", description: "A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.") @@ -22,21 +24,12 @@ def view_template RUBY end - render Docs::ComponentsTable.new(components) + render Docs::ComponentsTable.new(component_references(component, Docs::VisualCodeExample.collected_code), component_files(component)) end end private - def components - [ - Docs::ComponentStruct.new(name: "Tooltip", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/tooltip.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "TooltipTrigger", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/tooltip/trigger.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "TooltipContent", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/tooltip/content.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "TooltipController", source: "https://github.com/PhlexUI/phlex_ui_stimulus/blob/main/controllers/popover_controller.js", built_using: :stimulus) - ] - end - def bookmark_icon svg( xmlns: "http://www.w3.org/2000/svg", diff --git a/app/views/docs/typography_view.rb b/app/views/docs/typography_view.rb index 26ba3f3..a61a715 100644 --- a/app/views/docs/typography_view.rb +++ b/app/views/docs/typography_view.rb @@ -2,6 +2,8 @@ class Docs::TypographyView < ApplicationView def view_template + component = "Typography" + div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do render Docs::Header.new(title: "Typography", description: "Sensible defaults to use for text.") @@ -97,27 +99,7 @@ def view_template RUBY end - render Docs::ComponentsTable.new(components) + render Docs::ComponentsTable.new(component_references(component, Docs::VisualCodeExample.collected_code), component_files(component)) end end - - private - - def components - [ - Docs::ComponentStruct.new(name: "TypographyH1", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/typography/h1.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "TypographyH2", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/typography/h2.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "TypographyH3", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/typography/h3.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "TypographyH4", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/typography/h4.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "TypographyP", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/typography/p.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "TypographyInlineLink", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/typography/inline_link.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "TypographyList", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/typography/list.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "TypographyListItem", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/typography/list_item.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "TypographyInlineCode", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/typography/inline_code.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "TypographyLead", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/typography/lead.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "TypographyLarge", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/typography/large.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "TypographySmall", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/typography/small.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "TypographyMuted", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/typography/muted.rb", built_using: :phlex) - ] - end end diff --git a/lib/docs/component_struct.rb b/lib/docs/component_struct.rb index 773b4f9..6a24b26 100644 --- a/lib/docs/component_struct.rb +++ b/lib/docs/component_struct.rb @@ -6,6 +6,7 @@ Docs::ComponentStruct = Struct.new(:name, :source, :builder, :built_using) do def initialize(name:, source:, builder: false, built_using: :phlex) + source = ApplicationView::GITHUB_FILE_URL + source super(name, source, builder, built_using) end end diff --git a/package.json b/package.json index bf8d250..8aeaca8 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,8 @@ "clsx": "2.1.1", "esbuild": "0.23.0", "lottie-web": "5.12.2", - "phlex_ui": "https://github.com/PhlexUI/phlex_ui_stimulus.git", "postcss": "8.4.40", - "rbui-js": "^1.0.0-alpha.2", + "rbui-js": "rbui-labs/rbui#main", "tailwindcss": "3.4.7", "tailwindcss-animate": "1.0.7" }, diff --git a/yarn.lock b/yarn.lock index d9ed9bf..5b3be82 100644 --- a/yarn.lock +++ b/yarn.lock @@ -727,18 +727,6 @@ path-parse@^1.0.7: resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== -"phlex_ui@https://github.com/PhlexUI/phlex_ui_stimulus.git": - version "0.1.5" - resolved "https://github.com/PhlexUI/phlex_ui_stimulus.git#d08e1cd62dcf1456ee22e94a67a0c33b93882134" - dependencies: - "@hotwired/stimulus" "^3.2.2" - chart.js "^4.4.1" - date-fns "^2.30.0" - fuse.js "^7.0.0" - motion "^10.16.4" - mustache "^4.2.0" - tippy.js "^6.3.7" - picocolors@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz" @@ -845,6 +833,19 @@ rbui-js@^1.0.0-alpha.2: mustache "^4.2.0" tippy.js "^6.3.7" +rbui-js@rbui-labs/rbui#main: + version "1.0.0-alpha.3" + resolved "https://codeload.github.com/rbui-labs/rbui/tar.gz/abb3ec1e5971413d4930ce4a56f688b7acb66a5e" + dependencies: + "@floating-ui/dom" "^1.6.8" + "@hotwired/stimulus" "^3.2.2" + chart.js "^4.4.1" + date-fns "^2.30.0" + fuse.js "^7.0.0" + motion "^10.16.4" + mustache "^4.2.0" + tippy.js "^6.3.7" + read-cache@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz" From 8431fdf1ff0feb45c0aa1643c6175f79d7944caa Mon Sep 17 00:00:00 2001 From: Seth Horsley <git-public.ch12j@seth4242.com> Date: Tue, 24 Sep 2024 18:49:09 +0200 Subject: [PATCH 2/2] update rbui package --- package.json | 2 +- yarn.lock | 21 ++++----------------- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 8aeaca8..ff89960 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "esbuild": "0.23.0", "lottie-web": "5.12.2", "postcss": "8.4.40", - "rbui-js": "rbui-labs/rbui#main", + "rbui-js": "^1.0.0-alpha.4", "tailwindcss": "3.4.7", "tailwindcss-animate": "1.0.7" }, diff --git a/yarn.lock b/yarn.lock index 5b3be82..e26e544 100644 --- a/yarn.lock +++ b/yarn.lock @@ -819,23 +819,10 @@ queue-microtask@^1.2.2: resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== -rbui-js@^1.0.0-alpha.2: - version "1.0.0-alpha.2" - resolved "https://registry.yarnpkg.com/rbui-js/-/rbui-js-1.0.0-alpha.2.tgz#b35e2e943fd016a53853c028196aec1be06fc635" - integrity sha512-HqUB37pRVoXWGUqcWWNEi3FH9S29QELmVIpJKX8U5q/DUxCxg9rD0HOt5JdP9ql5NKXnFy1/yW0p5hRrvNX3FQ== - dependencies: - "@floating-ui/dom" "^1.6.8" - "@hotwired/stimulus" "^3.2.2" - chart.js "^4.4.1" - date-fns "^2.30.0" - fuse.js "^7.0.0" - motion "^10.16.4" - mustache "^4.2.0" - tippy.js "^6.3.7" - -rbui-js@rbui-labs/rbui#main: - version "1.0.0-alpha.3" - resolved "https://codeload.github.com/rbui-labs/rbui/tar.gz/abb3ec1e5971413d4930ce4a56f688b7acb66a5e" +rbui-js@^1.0.0-alpha.4: + version "1.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/rbui-js/-/rbui-js-1.0.0-alpha.4.tgz#f8cb252609217869692d15b6e662a31f3ec6342b" + integrity sha512-C1wRwuw6LjY0SEopvdi/sONBreehTzJla1ZH/E0t1TEne7Rx/R8RwPj+xhuxS/BOj/jwIc9goFKLro+3kbSo2w== dependencies: "@floating-ui/dom" "^1.6.8" "@hotwired/stimulus" "^3.2.2"