From 1c63bd72d7ede3eaea7b3973d19461221f135878 Mon Sep 17 00:00:00 2001 From: Seth Horsley Date: Mon, 5 Aug 2024 04:36:27 -0400 Subject: [PATCH 01/36] add combobox and v1 of rbui --- Gemfile | 2 +- Gemfile.lock | 11 ++- app/controllers/docs_controller.rb | 4 + app/javascript/application.js | 7 +- app/views/application_view.rb | 1 + app/views/docs/combobox_view.rb | 67 ++++++++++++++ config/routes.rb | 1 + package.json | 5 +- yarn.lock | 138 +++++++++++++++-------------- 9 files changed, 159 insertions(+), 77 deletions(-) create mode 100644 app/views/docs/combobox_view.rb diff --git a/Gemfile b/Gemfile index bb3d24c..11ea6f8 100644 --- a/Gemfile +++ b/Gemfile @@ -73,7 +73,7 @@ group :test do end gem "phlex-rails" -gem "phlex_ui", github: "PhlexUI/phlex_ui", branch: "main" +gem "phlex_ui", github: "PhlexUI/phlex_ui", branch: "v1" # gem "phlex_ui", path: "../phlex_ui" gem "dockerfile-rails", ">= 1.6", group: :development diff --git a/Gemfile.lock b/Gemfile.lock index e5dd074..0ae38b0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,12 +1,12 @@ GIT remote: https://github.com/PhlexUI/phlex_ui.git - revision: ba2cc503725ea8a9dd25648201dbd79a27a44691 - branch: main + revision: ade1fb28ff5695fb70e28dd1453ad2106f479eff + branch: v1 specs: phlex_ui (0.1.10) - activesupport (>= 6.0) - phlex (~> 1.11) + phlex (~> 1.10) rouge (~> 4.2.0) + tailwind_merge (>= 0.12) zeitwerk (~> 2.6) GEM @@ -145,6 +145,7 @@ GEM view_component (>= 2.0) yard (~> 0.9) zeitwerk (~> 2.5) + lru_redux (1.1.0) lucide-rails (0.4.0) railties (>= 4.1.0) mail (2.8.1) @@ -294,6 +295,8 @@ GEM railties (>= 6.0.0) stringio (3.1.1) strscan (3.1.0) + tailwind_merge (0.12.0) + lru_redux (~> 1.1) thor (1.3.1) timeout (0.4.1) turbo-rails (2.0.6) diff --git a/app/controllers/docs_controller.rb b/app/controllers/docs_controller.rb index 3e36716..4eabe33 100644 --- a/app/controllers/docs_controller.rb +++ b/app/controllers/docs_controller.rb @@ -86,6 +86,10 @@ def collapsible render Docs::CollapsibleView.new end + def combobox + render Docs::ComboboxView.new + end + def command render Docs::CommandView.new end diff --git a/app/javascript/application.js b/app/javascript/application.js index 7985fa1..64a1700 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 "phlex_ui" -import "./controllers" +import "@hotwired/turbo-rails"; +import "rbui-js"; +import "phlex_ui"; +import "./controllers"; diff --git a/app/views/application_view.rb b/app/views/application_view.rb index d55b3fb..b43ff02 100644 --- a/app/views/application_view.rb +++ b/app/views/application_view.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true class ApplicationView < ApplicationComponent + include RBUI # The ApplicationView is an abstract class for all your views. # By default, it inherits from `ApplicationComponent`, but you diff --git a/app/views/docs/combobox_view.rb b/app/views/docs/combobox_view.rb new file mode 100644 index 0000000..f04a6af --- /dev/null +++ b/app/views/docs/combobox_view.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +class Docs::ComboboxView < ApplicationView + def view_template + 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.", premium: @premium) + + TypographyH2 { "Usage" } + + render Docs::VisualCodeExample.new(title: "Example", context: self, premium: @premium) do + <<~RUBY + Combobox do + ComboboxTrigger(placeholder: "Select event...", aria_controls: "list") + ComboboxContent(id: "list") do + ComboboxSearchInput(placeholder: "Search event...") + ComboboxList do + ComboboxEmpty { "No results found." } + ComboboxGroup(heading: "Suggestions") do + ComboboxItem(value: "railsworld") do + span { "Rails World" } + end + ComboboxItem(value: "tropicalrb") do + span { "Tropical.rb" } + end + ComboboxItem(value: "friendly.rb") do + span { "Friendly.rb" } + end + end + + ComboboxSeparator() + + ComboboxGroup(heading: "Others") do + ComboboxItem(value: "railsconf") do + span { "RailsConf" } + end + ComboboxItem(value: "euruko") do + span { "Euruko" } + end + ComboboxItem(value: "rubykaigi") do + span { "RubyKaigi" } + end + end + end + end + end + RUBY + end + render Docs::ComponentsTable.new(components) + end + end + + private + + def components + [ + Docs::ComponentStruct.new(name: "ComboboxController", source: "https://github.com/PhlexUI/phlex_ui_stimulus_pro/blob/main/controllers/command_controller.js", built_using: :stimulus), + Docs::ComponentStruct.new(name: "ComboboxSeparator", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/command/dialog.rb", built_using: :phlex), + Docs::ComponentStruct.new(name: "ComboboxTrigger", 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: "ComboboxContent", 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: "Combobox", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/command.rb", built_using: :phlex), + Docs::ComponentStruct.new(name: "ComboboxSearchInput", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/command/input.rb", built_using: :phlex), + Docs::ComponentStruct.new(name: "ComboboxList", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/command/list.rb", built_using: :phlex), + Docs::ComponentStruct.new(name: "ComboboxGroup", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/command/group.rb", built_using: :phlex), + Docs::ComponentStruct.new(name: "ComboboxItem", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/command/item.rb", built_using: :phlex) + ] + end +end diff --git a/config/routes.rb b/config/routes.rb index 015a47f..998833d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -29,6 +29,7 @@ get "checkbox", to: "docs#checkbox", as: :docs_checkbox get "codeblock", to: "docs#codeblock", as: :docs_codeblock get "collapsible", to: "docs#collapsible", as: :docs_collapsible + get "combobox", to: "docs#combobox", as: :docs_combobox get "command", to: "docs#command", as: :docs_command get "context_menu", to: "docs#context_menu", as: :docs_context_menu get "date_picker", to: "docs#date_picker", as: :docs_date_picker diff --git a/package.json b/package.json index 495b678..b01d7ae 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,9 @@ "clsx": "2.1.1", "esbuild": "0.23.0", "lottie-web": "5.12.2", - "phlex_ui": "0.1.5", + "phlex_ui": "https://github.com/PhlexUI/phlex_ui_stimulus.git", "postcss": "8.4.40", + "rbui-js": "https://github.com/PhlexUI/phlex_ui.git#v1", "tailwindcss": "3.4.7", "tailwindcss-animate": "1.0.7" }, @@ -20,4 +21,4 @@ "build:css": "tailwindcss -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css --minify" }, "packageManager": "yarn@1.22.19" -} \ No newline at end of file +} diff --git a/yarn.lock b/yarn.lock index 736d0ca..390dbcb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8,9 +8,9 @@ integrity sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw== "@babel/runtime@^7.21.0": - version "7.23.9" - resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.9.tgz#47791a15e4603bb5f905bc0753801cf21d6345f7" - integrity sha512-0CX6F+BI2s9dkUqr08KFrAIZgNFj75rdBU/DjCyYLIaV/quFjkk6T+EJ2LkZHyZTbEV4L5p97mNkUsHl2wLFAw== + version "7.25.0" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.25.0.tgz#3af9a91c1b739c569d5d80cc917280919c544ecb" + integrity sha512-7dRy4DwXwtzBrPbZflqxnvfxLF8kdZXPkhymtDeFoFqE6ldzjQFgYTtYIFARcLEYDrqfBfYcZt1WqFxRoyC9Rw== dependencies: regenerator-runtime "^0.14.0" @@ -189,56 +189,56 @@ resolved "https://registry.npmjs.org/@kurkle/color/-/color-0.3.2.tgz" integrity sha512-fuscdXJ9G1qb7W8VdHi+IwRqij3lBkosAm4ydQtEmbY58OzHXqQhvlxqEkoz0yssNVn38bcpRWgA9PP+OGoisw== -"@motionone/animation@^10.17.0": - version "10.17.0" - resolved "https://registry.npmjs.org/@motionone/animation/-/animation-10.17.0.tgz#7633c6f684b5fee2b61c405881b8c24662c68fca" - integrity sha512-ANfIN9+iq1kGgsZxs+Nz96uiNcPLGTXwfNo2Xz/fcJXniPYpaz/Uyrfa+7I5BPLxCP82sh7quVDudf1GABqHbg== +"@motionone/animation@^10.18.0": + version "10.18.0" + resolved "https://registry.yarnpkg.com/@motionone/animation/-/animation-10.18.0.tgz#868d00b447191816d5d5cf24b1cafa144017922b" + integrity sha512-9z2p5GFGCm0gBsZbi8rVMOAJCtw1WqBTIPw3ozk06gDvZInBPIsQcHgYogEJ4yuHJ+akuW8g1SEIOpTOvYs8hw== dependencies: - "@motionone/easing" "^10.17.0" - "@motionone/types" "^10.17.0" - "@motionone/utils" "^10.17.0" + "@motionone/easing" "^10.18.0" + "@motionone/types" "^10.17.1" + "@motionone/utils" "^10.18.0" tslib "^2.3.1" -"@motionone/dom@^10.17.0": - version "10.17.0" - resolved "https://registry.npmjs.org/@motionone/dom/-/dom-10.17.0.tgz#519dd78aab0750a94614c69a82da5290cd617383" - integrity sha512-cMm33swRlCX/qOPHWGbIlCl0K9Uwi6X5RiL8Ma6OrlJ/TP7Q+Np5GE4xcZkFptysFjMTi4zcZzpnNQGQ5D6M0Q== +"@motionone/dom@^10.18.0": + version "10.18.0" + resolved "https://registry.yarnpkg.com/@motionone/dom/-/dom-10.18.0.tgz#7fd25dac04cab72def6d2b92b8e0cdc091576527" + integrity sha512-bKLP7E0eyO4B2UaHBBN55tnppwRnaE3KFfh3Ps9HhnAkar3Cb69kUCJY9as8LrccVYKgHA+JY5dOQqJLOPhF5A== dependencies: - "@motionone/animation" "^10.17.0" - "@motionone/generators" "^10.17.0" - "@motionone/types" "^10.17.0" - "@motionone/utils" "^10.17.0" + "@motionone/animation" "^10.18.0" + "@motionone/generators" "^10.18.0" + "@motionone/types" "^10.17.1" + "@motionone/utils" "^10.18.0" hey-listen "^1.0.8" tslib "^2.3.1" -"@motionone/easing@^10.17.0": - version "10.17.0" - resolved "https://registry.npmjs.org/@motionone/easing/-/easing-10.17.0.tgz#d66cecf7e3ee30104ad00389fb3f0b2282d81aa9" - integrity sha512-Bxe2wSuLu/qxqW4rBFS5m9tMLOw+QBh8v5A7Z5k4Ul4sTj5jAOfZG5R0bn5ywmk+Fs92Ij1feZ5pmC4TeXA8Tg== +"@motionone/easing@^10.18.0": + version "10.18.0" + resolved "https://registry.yarnpkg.com/@motionone/easing/-/easing-10.18.0.tgz#7b82f6010dfee3a1bb0ee83abfbaff6edae0c708" + integrity sha512-VcjByo7XpdLS4o9T8t99JtgxkdMcNWD3yHU/n6CLEz3bkmKDRZyYQ/wmSf6daum8ZXqfUAgFeCZSpJZIMxaCzg== dependencies: - "@motionone/utils" "^10.17.0" + "@motionone/utils" "^10.18.0" tslib "^2.3.1" -"@motionone/generators@^10.17.0": - version "10.17.0" - resolved "https://registry.npmjs.org/@motionone/generators/-/generators-10.17.0.tgz#878d292539c41434c13310d5f863a87a94e6e689" - integrity sha512-T6Uo5bDHrZWhIfxG/2Aut7qyWQyJIWehk6OB4qNvr/jwA/SRmixwbd7SOrxZi1z5rH3LIeFFBKK1xHnSbGPZSQ== +"@motionone/generators@^10.18.0": + version "10.18.0" + resolved "https://registry.yarnpkg.com/@motionone/generators/-/generators-10.18.0.tgz#fe09ab5cfa0fb9a8884097feb7eb60abeb600762" + integrity sha512-+qfkC2DtkDj4tHPu+AFKVfR/C30O1vYdvsGYaR13W/1cczPrrcjdvYCj0VLFuRMN+lP1xvpNZHCRNM4fBzn1jg== dependencies: - "@motionone/types" "^10.17.0" - "@motionone/utils" "^10.17.0" + "@motionone/types" "^10.17.1" + "@motionone/utils" "^10.18.0" tslib "^2.3.1" -"@motionone/types@^10.17.0": - version "10.17.0" - resolved "https://registry.npmjs.org/@motionone/types/-/types-10.17.0.tgz#179571ce98851bac78e19a1c3974767227f08ba3" - integrity sha512-EgeeqOZVdRUTEHq95Z3t8Rsirc7chN5xFAPMYFobx8TPubkEfRSm5xihmMUkbaR2ErKJTUw3347QDPTHIW12IA== +"@motionone/types@^10.17.1": + version "10.17.1" + resolved "https://registry.yarnpkg.com/@motionone/types/-/types-10.17.1.tgz#cf487badbbdc9da0c2cb86ffc1e5d11147c6e6fb" + integrity sha512-KaC4kgiODDz8hswCrS0btrVrzyU2CSQKO7Ps90ibBVSQmjkrt2teqta6/sOG59v7+dPnKMAg13jyqtMKV2yJ7A== -"@motionone/utils@^10.17.0": - version "10.17.0" - resolved "https://registry.npmjs.org/@motionone/utils/-/utils-10.17.0.tgz#cc0ba8acdc6848ff48d8c1f2d0d3e7602f4f942e" - integrity sha512-bGwrki4896apMWIj9yp5rAS2m0xyhxblg6gTB/leWDPt+pb410W8lYWsxyurX+DH+gO1zsQsfx2su/c1/LtTpg== +"@motionone/utils@^10.18.0": + version "10.18.0" + resolved "https://registry.yarnpkg.com/@motionone/utils/-/utils-10.18.0.tgz#a59ff8932ed9009624bca07c56b28ef2bb2f885e" + integrity sha512-3XVF7sgyTSI2KWvTf6uLlBJ5iAgRgmvp3bpuOiQJvInd4nZ19ET8lX5unn30SlmRH7hXbBbH+Gxd0m0klJ3Xtw== dependencies: - "@motionone/types" "^10.17.0" + "@motionone/types" "^10.17.1" hey-listen "^1.0.8" tslib "^2.3.1" @@ -265,7 +265,7 @@ "@popperjs/core@^2.9.0": version "2.11.8" - resolved "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz#6b79032e760a0899cd4204710beede972a3a185f" + resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.8.tgz#6b79032e760a0899cd4204710beede972a3a185f" integrity sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A== "@rails/actioncable@^7.0": @@ -348,20 +348,13 @@ caniuse-lite@^1.0.30001599, caniuse-lite@^1.0.30001640: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001643.tgz#9c004caef315de9452ab970c3da71085f8241dbd" integrity sha512-ERgWGNleEilSrHM6iUz/zJNSQTP8Mr21wDWpdgvRwcTXGAq6jMtOUPP4dqFPTdKqZ2wKTdtB+uucZ3MRpAUSmg== -chart.js@4.4.3: +chart.js@4.4.3, chart.js@^4.4.1: version "4.4.3" resolved "https://registry.yarnpkg.com/chart.js/-/chart.js-4.4.3.tgz#3b2e11e7010fefa99b07d0349236f5098e5226ad" integrity sha512-qK1gkGSRYcJzqrrzdR6a+I0vQ4/R+SoODXyAjscQ/4mzuNzySaMCd+hyVxitSY1+L2fjPD1Gbn+ibNqRmwQeLw== dependencies: "@kurkle/color" "^0.3.0" -chart.js@^4.4.1: - version "4.4.1" - resolved "https://registry.npmjs.org/chart.js/-/chart.js-4.4.1.tgz" - integrity sha512-C74QN1bxwV1v2PEujhmKjOZ7iUM4w6BWs23Md/6aOZZSlwMzeCIDGuZay++rBgChYru7/+QFeoQW0fQoP534Dg== - dependencies: - "@kurkle/color" "^0.3.0" - chokidar@^3.5.3: version "3.5.3" resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz" @@ -411,7 +404,7 @@ cssesc@^3.0.0: date-fns@^2.30.0: version "2.30.0" - resolved "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz#f367e644839ff57894ec6ac480de40cae4b0f4d0" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.30.0.tgz#f367e644839ff57894ec6ac480de40cae4b0f4d0" integrity sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw== dependencies: "@babel/runtime" "^7.21.0" @@ -468,7 +461,7 @@ escalade@^3.1.2: fast-glob@^3.3.0: version "3.3.2" - resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow== dependencies: "@nodelib/fs.stat" "^2.0.2" @@ -513,7 +506,7 @@ function-bind@^1.1.2: fuse.js@^7.0.0: version "7.0.0" - resolved "https://registry.npmjs.org/fuse.js/-/fuse.js-7.0.0.tgz#6573c9fcd4c8268e403b4fc7d7131ffcf99a9eb2" + resolved "https://registry.yarnpkg.com/fuse.js/-/fuse.js-7.0.0.tgz#6573c9fcd4c8268e403b4fc7d7131ffcf99a9eb2" integrity sha512-14F4hBIxqKvD4Zz/XjDc3y94mNZN6pRv3U13Udo0lNLCWRBUsrMv2xwcF/y/Z5sV6+FQW+/ow68cHpm4sunt8Q== glob-parent@^5.1.2, glob-parent@~5.1.2: @@ -551,7 +544,7 @@ hasown@^2.0.0: hey-listen@^1.0.8: version "1.0.8" - resolved "https://registry.npmjs.org/hey-listen/-/hey-listen-1.0.8.tgz#8e59561ff724908de1aa924ed6ecc84a56a9aa68" + resolved "https://registry.yarnpkg.com/hey-listen/-/hey-listen-1.0.8.tgz#8e59561ff724908de1aa924ed6ecc84a56a9aa68" integrity sha512-COpmrF2NOg4TBWUJ5UVyaCU2A88wEMkUPK4hNqyCkqHbxT92BbvfjoSozkAIIm6XhicGlJHhFdullInrdhwU8Q== inflight@^1.0.4: @@ -644,18 +637,18 @@ minimatch@^3.0.4: brace-expansion "^1.1.7" motion@^10.16.4: - version "10.17.0" - resolved "https://registry.npmjs.org/motion/-/motion-10.17.0.tgz#d7ad56f5e8164c0bf097c481311d263961a393fd" - integrity sha512-yBHYkrnJRiomuo88YQzG/v+nzFXKNlKw/Hh7uy8AV7nrYHnE07O6PEECShGbFmZvLrAOGc9qKzEDYmspDYjNWw== + version "10.18.0" + resolved "https://registry.yarnpkg.com/motion/-/motion-10.18.0.tgz#8fd035cc3a668800fe7e2479568eeb98af484ab3" + integrity sha512-MVAZZmwM/cp77BrNe1TxTMldxRPjwBNHheU5aPToqT4rJdZxLiADk58H+a0al5jKLxkB0OdgNq6DiVn11cjvIQ== dependencies: - "@motionone/animation" "^10.17.0" - "@motionone/dom" "^10.17.0" - "@motionone/types" "^10.17.0" - "@motionone/utils" "^10.17.0" + "@motionone/animation" "^10.18.0" + "@motionone/dom" "^10.18.0" + "@motionone/types" "^10.17.1" + "@motionone/utils" "^10.18.0" mustache@^4.2.0: version "4.2.0" - resolved "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz#e5892324d60a12ec9c2a73359edca52972bf6f64" + resolved "https://registry.yarnpkg.com/mustache/-/mustache-4.2.0.tgz#e5892324d60a12ec9c2a73359edca52972bf6f64" integrity sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ== mz@^2.7.0: @@ -714,10 +707,9 @@ 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@0.1.5: +"phlex_ui@https://github.com/PhlexUI/phlex_ui_stimulus.git": version "0.1.5" - resolved "https://registry.yarnpkg.com/phlex_ui/-/phlex_ui-0.1.5.tgz#004b838849cc2433229e0e7a46fc0ce6e7cdae47" - integrity sha512-9Ea2mH/ukg8D8K6toAe9oMmgJvUss2wPawa+roz1y/5eHeVD3+Mqg8qGif0RWt4PWQnT79iONNLXetwiQ3zOxA== + resolved "https://github.com/PhlexUI/phlex_ui_stimulus.git#d08e1cd62dcf1456ee22e94a67a0c33b93882134" dependencies: "@hotwired/stimulus" "^3.2.2" chart.js "^4.4.1" @@ -819,6 +811,18 @@ queue-microtask@^1.2.2: resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== +"rbui-js@https://github.com/PhlexUI/phlex_ui.git#v1": + version "0.0.1-alpha.0" + resolved "https://github.com/PhlexUI/phlex_ui.git#ade1fb28ff5695fb70e28dd1453ad2106f479eff" + 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" + read-cache@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz" @@ -835,7 +839,7 @@ readdirp@~3.6.0: regenerator-runtime@^0.14.0: version "0.14.1" - resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== resolve@^1.1.7, resolve@^1.22.2: @@ -936,7 +940,7 @@ thenify-all@^1.0.0: tippy.js@^6.3.7: version "6.3.7" - resolved "https://registry.npmjs.org/tippy.js/-/tippy.js-6.3.7.tgz#8ccfb651d642010ed9a32ff29b0e9e19c5b8c61c" + resolved "https://registry.yarnpkg.com/tippy.js/-/tippy.js-6.3.7.tgz#8ccfb651d642010ed9a32ff29b0e9e19c5b8c61c" integrity sha512-E1d3oP2emgJ9dRQZdf3Kkn0qJgI6ZLpyS5z6ZkY1DF3kaQaBsGZsndEpHwx+eC+tYM41HaSNvNtLx8tU57FzTQ== dependencies: "@popperjs/core" "^2.9.0" @@ -954,9 +958,9 @@ ts-interface-checker@^0.1.9: integrity sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA== tslib@^2.3.1: - version "2.6.2" - resolved "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" - integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== + version "2.6.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.3.tgz#0438f810ad7a9edcde7a241c3d80db693c8cbfe0" + integrity sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ== update-browserslist-db@^1.1.0: version "1.1.0" From 86ccdd351493302a8ae692854c218d3fcc685a85 Mon Sep 17 00:00:00 2001 From: Seth Horsley Date: Mon, 5 Aug 2024 18:52:40 -0400 Subject: [PATCH 02/36] make component view component dynamic --- Gemfile | 1 + Gemfile.lock | 5 ++ app/views/application_view.rb | 59 +++++++++++++++++++ app/views/components/docs/components_table.rb | 33 +++++++++-- app/views/docs/combobox_view.rb | 22 ++----- 5 files changed, 98 insertions(+), 22 deletions(-) diff --git a/Gemfile b/Gemfile index 11ea6f8..0450ffa 100644 --- a/Gemfile +++ b/Gemfile @@ -77,3 +77,4 @@ gem "phlex_ui", github: "PhlexUI/phlex_ui", branch: "v1" # gem "phlex_ui", path: "../phlex_ui" gem "dockerfile-rails", ">= 1.6", group: :development +gem "pry" diff --git a/Gemfile.lock b/Gemfile.lock index 0ae38b0..ac152c9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -99,6 +99,7 @@ GEM rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) + coderay (1.1.3) concurrent-ruby (1.3.3) connection_pool (2.4.1) crass (1.0.6) @@ -195,6 +196,9 @@ GEM activesupport (>= 7.0.0) rack railties (>= 7.0.0) + pry (0.14.2) + coderay (~> 1.1) + method_source (~> 1.0) psych (5.1.2) stringio public_suffix (6.0.1) @@ -346,6 +350,7 @@ DEPENDENCIES phlex-rails phlex_ui! propshaft (= 0.9.0) + pry puma (= 6.4.2) rails (~> 7.2.0.beta3) selenium-webdriver diff --git a/app/views/application_view.rb b/app/views/application_view.rb index b43ff02..2fcdc99 100644 --- a/app/views/application_view.rb +++ b/app/views/application_view.rb @@ -7,4 +7,63 @@ class ApplicationView < ApplicationComponent # By default, it inherits from `ApplicationComponent`, but you # 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) + return [] unless code_example + + component_names = code_example.scan(/(?<=^|\s)Combobox\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", + 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 + + require "rubygems" + + def component_files(component, gem_name = "phlex_ui") + # Find the gem specification + gem_spec = Gem::Specification.find_by_name(gem_name) + 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) + + return [] unless Dir.exist?(component_dir) + + # Get all Ruby and JavaScript files + rb_files = Dir.glob(File.join(component_dir, "*.rb")) + js_files = Dir.glob(File.join(component_dir, "*_controller.js")) + + # Combine and process all files + (rb_files + js_files).map do |file| + ext = File.extname(file) + basename = File.basename(file, ext) + + if ext == ".rb" + name = basename.camelize + source = "https://github.com/PhlexUI/phlex_ui/blob/v1/lib/rbui/#{component.to_s.downcase}/#{File.basename(file)}" + built_using = :phlex + else # ".js" + name = basename.camelize + source = "https://github.com/PhlexUI/phlex_ui/blob/v1/lib/rbui/#{component.to_s.downcase}/#{File.basename(file)}" + built_using = :stimulus + end + + Docs::ComponentStruct.new( + name: name, + source: source, + built_using: built_using + ) + end + end end diff --git a/app/views/components/docs/components_table.rb b/app/views/components/docs/components_table.rb index 358dddb..d2b26e1 100644 --- a/app/views/components/docs/components_table.rb +++ b/app/views/components/docs/components_table.rb @@ -1,12 +1,39 @@ # frozen_string_literal: true class Docs::ComponentsTable < ApplicationComponent - def initialize(components) + def initialize(components, file_components) @components = components.sort_by { |component| [component.built_using, component.name] } + @file_components = file_components.sort_by { |component| [component.built_using, component.name] } end def view_template TypographyH2 { "Components" } + + Tabs(default_value: "account", class: "") do + TabsList do + TabsTrigger(value: "components") { "Components shown above" } + TabsTrigger(value: "file-components") { "File Components" } + end + TabsContent(value: "components") do + div(class: "rounded-lg border p-6 space-y-4 bg-background text-foreground") do + div(class: "space-y-0") do + component_table_view(@components) + end + end + end + 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) + end + end + end + end + end + + private + + def component_table_view(components) div(class: "border rounded-lg overflow-hidden") do Table do TableHeader do @@ -20,7 +47,7 @@ def view_template end TableBody do - @components.each do |component| + components.each do |component| TableRow do TableCell do TypographyInlineCode { component.name } @@ -49,8 +76,6 @@ def view_template end end - private - def github_icon svg(viewbox: "0 0 438.549 438.549", class: "h-4 w-4") do |s| s.path( diff --git a/app/views/docs/combobox_view.rb b/app/views/docs/combobox_view.rb index f04a6af..c52d9a7 100644 --- a/app/views/docs/combobox_view.rb +++ b/app/views/docs/combobox_view.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class Docs::ComboboxView < ApplicationView + @@code_example = nil + def view_template 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.", premium: @premium) @@ -8,7 +10,7 @@ def view_template TypographyH2 { "Usage" } render Docs::VisualCodeExample.new(title: "Example", context: self, premium: @premium) do - <<~RUBY + @@code_example = <<~RUBY Combobox do ComboboxTrigger(placeholder: "Select event...", aria_controls: "list") ComboboxContent(id: "list") do @@ -45,23 +47,7 @@ def view_template end RUBY end - render Docs::ComponentsTable.new(components) + render Docs::ComponentsTable.new(components("Combobox", @@code_example), component_files("Combobox")) end end - - private - - def components - [ - Docs::ComponentStruct.new(name: "ComboboxController", source: "https://github.com/PhlexUI/phlex_ui_stimulus_pro/blob/main/controllers/command_controller.js", built_using: :stimulus), - Docs::ComponentStruct.new(name: "ComboboxSeparator", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/command/dialog.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "ComboboxTrigger", 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: "ComboboxContent", 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: "Combobox", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/command.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "ComboboxSearchInput", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/command/input.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "ComboboxList", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/command/list.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "ComboboxGroup", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/command/group.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "ComboboxItem", source: "https://github.com/PhlexUI/phlex_ui_pro/blob/main/lib/phlex_ui_pro/command/item.rb", built_using: :phlex) - ] - end end From 4375150e4bcd64ef77125c78eb18ab5bff55d317 Mon Sep 17 00:00:00 2001 From: Seth Horsley Date: Mon, 5 Aug 2024 18:53:37 -0400 Subject: [PATCH 03/36] fix rbui js package --- yarn.lock | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/yarn.lock b/yarn.lock index 390dbcb..646b301 100644 --- a/yarn.lock +++ b/yarn.lock @@ -134,6 +134,26 @@ resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.23.0.tgz#db44a6a08520b5f25bbe409f34a59f2d4bcc7ced" integrity sha512-Arm+WgUFLUATuoxCJcahGuk6Yj9Pzxd6l11Zb/2aAuv5kWWvvfhLFo2fni4uSK5vzlUdCGZ/BdV5tH8klj8p8g== +"@floating-ui/core@^1.6.0": + version "1.6.6" + resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-1.6.6.tgz#f6edf703c8acb73e3802cf558c88ddb7cddc4f67" + integrity sha512-Vkvsw6EcpMHjvZZdMkSY+djMGFbt7CRssW99Ne8tar2WLnZ/l3dbxeTShbLQj+/s35h+Qb4cmnob+EzwtjrXGQ== + dependencies: + "@floating-ui/utils" "^0.2.6" + +"@floating-ui/dom@^1.6.8": + version "1.6.9" + resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-1.6.9.tgz#7240f4fea0ff929a9d642f7572331d33dd2ee809" + integrity sha512-zB1PcI350t4tkm3rvUhSRKa9sT7vH5CrAbQxW+VaPYJXKAO0gsg4CTueL+6Ajp7XzAQC8CW4Jj1Wgqc0sB6oUQ== + dependencies: + "@floating-ui/core" "^1.6.0" + "@floating-ui/utils" "^0.2.6" + +"@floating-ui/utils@^0.2.6": + version "0.2.6" + resolved "https://registry.yarnpkg.com/@floating-ui/utils/-/utils-0.2.6.tgz#1898a31c7e17a50384147a02a4e6264b1b1a0291" + integrity sha512-0KI3zGxIUs1KDR/pjQPdJH4Z8nGBm0yJ5WRoRfdw1Kzeh45jkIfA0rmD0kBF6fKHH+xaH7g8y4jIXyAV5MGK3g== + "@hotwired/stimulus@3.2.2", "@hotwired/stimulus@^3.2.2": version "3.2.2" resolved "https://registry.yarnpkg.com/@hotwired/stimulus/-/stimulus-3.2.2.tgz#071aab59c600fed95b97939e605ff261a4251608" @@ -707,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" @@ -813,8 +821,9 @@ queue-microtask@^1.2.2: "rbui-js@https://github.com/PhlexUI/phlex_ui.git#v1": version "0.0.1-alpha.0" - resolved "https://github.com/PhlexUI/phlex_ui.git#ade1fb28ff5695fb70e28dd1453ad2106f479eff" + resolved "https://github.com/PhlexUI/phlex_ui.git#939341791f34174983adc2290c6dad6c3f20fb5b" dependencies: + "@floating-ui/dom" "^1.6.8" "@hotwired/stimulus" "^3.2.2" chart.js "^4.4.1" date-fns "^2.30.0" From c869b36421e7665164240aba34c91aa17e3b50a1 Mon Sep 17 00:00:00 2001 From: Seth Horsley Date: Mon, 5 Aug 2024 18:57:02 -0400 Subject: [PATCH 04/36] fix linter and hopefully tests --- app/views/application_view.rb | 12 +++++------- yarn.lock | 12 ++++++++++++ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/app/views/application_view.rb b/app/views/application_view.rb index 2fcdc99..96796ae 100644 --- a/app/views/application_view.rb +++ b/app/views/application_view.rb @@ -49,14 +49,12 @@ def component_files(component, gem_name = "phlex_ui") ext = File.extname(file) basename = File.basename(file, ext) - if ext == ".rb" - name = basename.camelize - source = "https://github.com/PhlexUI/phlex_ui/blob/v1/lib/rbui/#{component.to_s.downcase}/#{File.basename(file)}" - built_using = :phlex + name = basename.camelize + source = "https://github.com/PhlexUI/phlex_ui/blob/v1/lib/rbui/#{component.to_s.downcase}/#{File.basename(file)}" + built_using = if ext == ".rb" + :phlex else # ".js" - name = basename.camelize - source = "https://github.com/PhlexUI/phlex_ui/blob/v1/lib/rbui/#{component.to_s.downcase}/#{File.basename(file)}" - built_using = :stimulus + :stimulus end Docs::ComponentStruct.new( diff --git a/yarn.lock b/yarn.lock index 646b301..46c5987 100644 --- a/yarn.lock +++ b/yarn.lock @@ -727,6 +727,18 @@ 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" From be7e44fd60ad68c1b16d0d900c190a33d2f4b496 Mon Sep 17 00:00:00 2001 From: Seth Horsley Date: Mon, 5 Aug 2024 19:14:04 -0400 Subject: [PATCH 05/36] fix tests --- app/views/components/docs/components_table.rb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/app/views/components/docs/components_table.rb b/app/views/components/docs/components_table.rb index d2b26e1..ae71a41 100644 --- a/app/views/components/docs/components_table.rb +++ b/app/views/components/docs/components_table.rb @@ -1,9 +1,9 @@ # frozen_string_literal: true class Docs::ComponentsTable < ApplicationComponent - def initialize(components, file_components) + def initialize(components, file_components = nil) @components = components.sort_by { |component| [component.built_using, component.name] } - @file_components = file_components.sort_by { |component| [component.built_using, component.name] } + @file_components = file_components.sort_by { |component| [component.built_using, component.name] } if file_components end def view_template @@ -12,7 +12,7 @@ def view_template Tabs(default_value: "account", class: "") do TabsList do TabsTrigger(value: "components") { "Components shown above" } - TabsTrigger(value: "file-components") { "File Components" } + TabsTrigger(value: "file-components") { "File Components" } if @file_components end TabsContent(value: "components") do div(class: "rounded-lg border p-6 space-y-4 bg-background text-foreground") do @@ -21,10 +21,12 @@ def view_template end end end - 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 + 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) + end end end end From e472ee24584fe6ef6d55ea30f0a65cef42ed5afb Mon Sep 17 00:00:00 2001 From: Cirdes Date: Thu, 8 Aug 2024 13:01:48 +0000 Subject: [PATCH 06/36] Add vi branch as CI trigger to deploy to fly.io --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 13885b8..62be134 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,6 +7,7 @@ on: push: branches: - main + - v1 jobs: scan: From e02bd1caa220146c0c71d15c7b0313443a23b7dc Mon Sep 17 00:00:00 2001 From: Cirdes Date: Thu, 8 Aug 2024 13:08:23 +0000 Subject: [PATCH 07/36] Fix fly deploy reference --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 62be134..bb3c574 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -86,7 +86,7 @@ jobs: heroku_email: "seth@statecert.com" fly-deploy: - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/v1' }} needs: [lint, test] name: Deploy app runs-on: ubuntu-latest From ee93649e78b2db7337be8e6906fdcfd0a691722f Mon Sep 17 00:00:00 2001 From: Cirdes Date: Thu, 8 Aug 2024 13:23:19 +0000 Subject: [PATCH 08/36] Adding Combobox to the menu --- app/views/components/shared/menu.rb | 75 +---------------------------- 1 file changed, 1 insertion(+), 74 deletions(-) diff --git a/app/views/components/shared/menu.rb b/app/views/components/shared/menu.rb index bbc1b07..fde2fdf 100644 --- a/app/views/components/shared/menu.rb +++ b/app/views/components/shared/menu.rb @@ -39,31 +39,6 @@ def view_template menu_link(component) end end - - # COMPONENTS COMING SOON - h4(class: "mb-1 mt-4 rounded-md px-2 py-1 text-sm font-semibold flex items-center gap-x-2") do - plain "Coming Soon" - Badge(variant: :primary, size: :sm) { components_coming_soon.count.to_s } - svg( - xmlns: "http://www.w3.org/2000/svg", - viewbox: "0 0 24 24", - fill: "currentColor", - class: "w-4 h-4 text-amber-400" - ) do |s| - s.path( - fill_rule: "evenodd", - d: - "M9 4.5a.75.75 0 01.721.544l.813 2.846a3.75 3.75 0 002.576 2.576l2.846.813a.75.75 0 010 1.442l-2.846.813a3.75 3.75 0 00-2.576 2.576l-.813 2.846a.75.75 0 01-1.442 0l-.813-2.846a3.75 3.75 0 00-2.576-2.576l-2.846-.813a.75.75 0 010-1.442l2.846-.813A3.75 3.75 0 007.466 7.89l.813-2.846A.75.75 0 019 4.5zM18 1.5a.75.75 0 01.728.568l.258 1.036c.236.94.97 1.674 1.91 1.91l1.036.258a.75.75 0 010 1.456l-1.036.258c-.94.236-1.674.97-1.91 1.91l-.258 1.036a.75.75 0 01-1.456 0l-.258-1.036a2.625 2.625 0 00-1.91-1.91l-1.036-.258a.75.75 0 010-1.456l1.036-.258a2.625 2.625 0 001.91-1.91l.258-1.036A.75.75 0 0118 1.5zM16.5 15a.75.75 0 01.712.513l.394 1.183c.15.447.5.799.948.948l1.183.395a.75.75 0 010 1.422l-1.183.395c-.447.15-.799.5-.948.948l-.395 1.183a.75.75 0 01-1.422 0l-.395-1.183a1.5 1.5 0 00-.948-.948l-1.183-.395a.75.75 0 010-1.422l1.183-.395c.447-.15.799-.5.948-.948l.395-1.183A.75.75 0 0116.5 15z", - clip_rule: "evenodd" - ) - end - end - - div(class: "grid grid-flow-row auto-rows-max text-sm") do - components_coming_soon.each do |component| - menu_link(component) - end - end end end @@ -99,6 +74,7 @@ def components {name: "Checkbox", path: helpers.docs_checkbox_path}, {name: "Codeblock", path: helpers.docs_codeblock_path}, {name: "Collapsible", path: helpers.docs_collapsible_path}, + {name: "Combobox", path: helpers.docs_combobox_path}, {name: "Command", path: helpers.docs_command_path}, {name: "Context Menu", path: helpers.docs_context_menu_path}, {name: "Date Picker", path: helpers.docs_date_picker_path}, @@ -120,37 +96,6 @@ def components ] end - def components_coming_soon - [ - {name: "Autosave", path: "#"}, - {name: "Carousel", path: "#"}, - {name: "Chart", path: "#"}, - {name: "Clipboard", path: "#"}, - {name: "Color Picker", path: "#"}, - {name: "Combobox", path: "#"}, - {name: "Data Table", path: "#"}, - {name: "Form", path: "#"}, - {name: "Menu Bar", path: "#"}, - {name: "Multi Select", path: "#"}, - {name: "Navigation Menu", path: "#"}, - {name: "Progress", path: "#"}, - {name: "Radio Group", path: "#"}, - {name: "Read more", path: "#"}, - {name: "Rich text editor", path: "#"}, - {name: "Scroll Area", path: "#"}, - {name: "Select", path: "#"}, - {name: "Separator", path: "#"}, - {name: "Skeleton Loader", path: "#"}, - {name: "Slider", path: "#"}, - {name: "Switch", path: "#"}, - {name: "Textarea (Autogrow)", path: "#"}, - {name: "Toast (Swipe to dismiss)", path: "#"}, - {name: "Toggle", path: "#"}, - {name: "Turbo Dialog / Modal", path: "#"}, - {name: "Video Player", path: "#"} - ] - end - def menu_link(component) component[:premium] ||= false current_path = component[:path] == helpers.request.path @@ -168,22 +113,4 @@ def main_link(name, path) name end end - - def premium_status(component) - if component[:premium] - svg( - xmlns: "http://www.w3.org/2000/svg", - viewbox: "0 0 24 24", - fill: "currentColor", - class: "w-3 h-3 text-violet-500 ml-2" - ) do |s| - s.path( - fill_rule: "evenodd", - d: - "M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z", - clip_rule: "evenodd" - ) - end - end - end end From 38238c51928e5108f32f630bbddb759d731e62df Mon Sep 17 00:00:00 2001 From: Cirdes Date: Fri, 9 Aug 2024 20:57:10 +0000 Subject: [PATCH 09/36] Migrate theme toggle to RBUI --- Gemfile.lock | 2 +- app/views/components/shared/navbar.rb | 2 +- app/views/components/test_view.rb | 1 + app/views/docs/theme_toggle_view.rb | 4 ++-- yarn.lock | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index ac152c9..bcc1c78 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/PhlexUI/phlex_ui.git - revision: ade1fb28ff5695fb70e28dd1453ad2106f479eff + revision: faf332ff68cfccd40c0b55aff1697bb270db7d89 branch: v1 specs: phlex_ui (0.1.10) diff --git a/app/views/components/shared/navbar.rb b/app/views/components/shared/navbar.rb index 964d281..6c5caa0 100644 --- a/app/views/components/shared/navbar.rb +++ b/app/views/components/shared/navbar.rb @@ -25,7 +25,7 @@ def view_template end def dark_mode_toggle - ThemeToggle do |toggle| + RBUI.ThemeToggle do |toggle| toggle.light_mode do Button(variant: :ghost, icon: true) do svg( diff --git a/app/views/components/test_view.rb b/app/views/components/test_view.rb index 4091b96..540e359 100644 --- a/app/views/components/test_view.rb +++ b/app/views/components/test_view.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true class TestView < Phlex::HTML + include RBUI include PhlexUI def view_template(&) diff --git a/app/views/docs/theme_toggle_view.rb b/app/views/docs/theme_toggle_view.rb index 13a0032..d20fb1c 100644 --- a/app/views/docs/theme_toggle_view.rb +++ b/app/views/docs/theme_toggle_view.rb @@ -69,8 +69,8 @@ def view_template def components [ - Docs::ComponentStruct.new(name: "ToggleThemeController", source: "https://github.com/PhlexUI/phlex_ui_stimulus/blob/main/controllers/toggle_theme_controller.js", built_using: :stimulus), - Docs::ComponentStruct.new(name: "ThemeToggle", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/theme_toggle.rb", built_using: :phlex) + 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/yarn.lock b/yarn.lock index 46c5987..31c32da 100644 --- a/yarn.lock +++ b/yarn.lock @@ -833,7 +833,7 @@ queue-microtask@^1.2.2: "rbui-js@https://github.com/PhlexUI/phlex_ui.git#v1": version "0.0.1-alpha.0" - resolved "https://github.com/PhlexUI/phlex_ui.git#939341791f34174983adc2290c6dad6c3f20fb5b" + resolved "https://github.com/PhlexUI/phlex_ui.git#faf332ff68cfccd40c0b55aff1697bb270db7d89" dependencies: "@floating-ui/dom" "^1.6.8" "@hotwired/stimulus" "^3.2.2" From 8bedfa5af88493666c1c05f5b7cb1df289e60563 Mon Sep 17 00:00:00 2001 From: Cirdes Date: Sun, 11 Aug 2024 18:58:37 +0000 Subject: [PATCH 10/36] Migrate tooltip --- Gemfile.lock | 2 +- app/views/docs/tooltip_view.rb | 4 ++-- yarn.lock | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index bcc1c78..145cd94 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/PhlexUI/phlex_ui.git - revision: faf332ff68cfccd40c0b55aff1697bb270db7d89 + revision: 7cc2e5c3551971a191e7200865339808f230585f branch: v1 specs: phlex_ui (0.1.10) diff --git a/app/views/docs/tooltip_view.rb b/app/views/docs/tooltip_view.rb index 6679c27..144cc3c 100644 --- a/app/views/docs/tooltip_view.rb +++ b/app/views/docs/tooltip_view.rb @@ -30,10 +30,10 @@ def view_template 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: "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: "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 diff --git a/yarn.lock b/yarn.lock index 31c32da..7b27b53 100644 --- a/yarn.lock +++ b/yarn.lock @@ -833,7 +833,7 @@ queue-microtask@^1.2.2: "rbui-js@https://github.com/PhlexUI/phlex_ui.git#v1": version "0.0.1-alpha.0" - resolved "https://github.com/PhlexUI/phlex_ui.git#faf332ff68cfccd40c0b55aff1697bb270db7d89" + resolved "https://github.com/PhlexUI/phlex_ui.git#7cc2e5c3551971a191e7200865339808f230585f" dependencies: "@floating-ui/dom" "^1.6.8" "@hotwired/stimulus" "^3.2.2" From 54eeff7fe50ee314822470187b00b778b6cde784 Mon Sep 17 00:00:00 2001 From: Cirdes Date: Sun, 11 Aug 2024 19:38:07 +0000 Subject: [PATCH 11/36] fix ci --- app/views/components/application_component.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/components/application_component.rb b/app/views/components/application_component.rb index 3da8475..d0cc74d 100644 --- a/app/views/components/application_component.rb +++ b/app/views/components/application_component.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true class ApplicationComponent < Phlex::HTML + include RBUI include PhlexUI include Phlex::Rails::Helpers::Routes From 8f4724c48f39158b433e6beca663272b48462223 Mon Sep 17 00:00:00 2001 From: Cirdes Henrique Date: Sun, 11 Aug 2024 19:26:42 -0300 Subject: [PATCH 12/36] Migrate select --- .gitignore | 4 +++- Gemfile.lock | 2 +- yarn.lock | 26 +++++++++++++------------- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 6e44386..d354604 100644 --- a/.gitignore +++ b/.gitignore @@ -35,4 +35,6 @@ /node_modules -.env* \ No newline at end of file +.env* + +.tool-versions \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index 145cd94..a2a3e13 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/PhlexUI/phlex_ui.git - revision: 7cc2e5c3551971a191e7200865339808f230585f + revision: c0b011e9c5db8fbbad561298a4560edc8518b958 branch: v1 specs: phlex_ui (0.1.10) diff --git a/yarn.lock b/yarn.lock index 7b27b53..7a7fa2d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -135,24 +135,24 @@ integrity sha512-Arm+WgUFLUATuoxCJcahGuk6Yj9Pzxd6l11Zb/2aAuv5kWWvvfhLFo2fni4uSK5vzlUdCGZ/BdV5tH8klj8p8g== "@floating-ui/core@^1.6.0": - version "1.6.6" - resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-1.6.6.tgz#f6edf703c8acb73e3802cf558c88ddb7cddc4f67" - integrity sha512-Vkvsw6EcpMHjvZZdMkSY+djMGFbt7CRssW99Ne8tar2WLnZ/l3dbxeTShbLQj+/s35h+Qb4cmnob+EzwtjrXGQ== + version "1.6.7" + resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-1.6.7.tgz#7602367795a390ff0662efd1c7ae8ca74e75fb12" + integrity sha512-yDzVT/Lm101nQ5TCVeK65LtdN7Tj4Qpr9RTXJ2vPFLqtLxwOrpoxAHAJI8J3yYWUc40J0BDBheaitK5SJmno2g== dependencies: - "@floating-ui/utils" "^0.2.6" + "@floating-ui/utils" "^0.2.7" "@floating-ui/dom@^1.6.8": - version "1.6.9" - resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-1.6.9.tgz#7240f4fea0ff929a9d642f7572331d33dd2ee809" - integrity sha512-zB1PcI350t4tkm3rvUhSRKa9sT7vH5CrAbQxW+VaPYJXKAO0gsg4CTueL+6Ajp7XzAQC8CW4Jj1Wgqc0sB6oUQ== + version "1.6.10" + resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-1.6.10.tgz#b74c32f34a50336c86dcf1f1c845cf3a39e26d6f" + integrity sha512-fskgCFv8J8OamCmyun8MfjB1Olfn+uZKjOKZ0vhYF3gRmEUXcGOjxWL8bBr7i4kIuPZ2KD2S3EUIOxnjC8kl2A== dependencies: "@floating-ui/core" "^1.6.0" - "@floating-ui/utils" "^0.2.6" + "@floating-ui/utils" "^0.2.7" -"@floating-ui/utils@^0.2.6": - version "0.2.6" - resolved "https://registry.yarnpkg.com/@floating-ui/utils/-/utils-0.2.6.tgz#1898a31c7e17a50384147a02a4e6264b1b1a0291" - integrity sha512-0KI3zGxIUs1KDR/pjQPdJH4Z8nGBm0yJ5WRoRfdw1Kzeh45jkIfA0rmD0kBF6fKHH+xaH7g8y4jIXyAV5MGK3g== +"@floating-ui/utils@^0.2.7": + version "0.2.7" + resolved "https://registry.yarnpkg.com/@floating-ui/utils/-/utils-0.2.7.tgz#d0ece53ce99ab5a8e37ebdfe5e32452a2bfc073e" + integrity sha512-X8R8Oj771YRl/w+c1HqAC1szL8zWQRwFvgDwT129k9ACdBoud/+/rX9V0qiMl6LWUdP9voC2nDVZYPMQQsb6eA== "@hotwired/stimulus@3.2.2", "@hotwired/stimulus@^3.2.2": version "3.2.2" @@ -833,7 +833,7 @@ queue-microtask@^1.2.2: "rbui-js@https://github.com/PhlexUI/phlex_ui.git#v1": version "0.0.1-alpha.0" - resolved "https://github.com/PhlexUI/phlex_ui.git#7cc2e5c3551971a191e7200865339808f230585f" + resolved "https://github.com/PhlexUI/phlex_ui.git#c0b011e9c5db8fbbad561298a4560edc8518b958" dependencies: "@floating-ui/dom" "^1.6.8" "@hotwired/stimulus" "^3.2.2" From 816aeca2101cf1d918b37953f59da7bd87a3a8c5 Mon Sep 17 00:00:00 2001 From: Cirdes Date: Tue, 20 Aug 2024 19:02:47 +0000 Subject: [PATCH 13/36] Update CSS Variables and Remove Unused Components This PR includes the following changes: CSS Updates: Modified the CSS variables in application.tailwind.css to update color values and add new variables for card and popover. Component Cleanup: Removed unused components installation_instructions_coming_soon.rb and premium_badge.rb. New Components: Added new components tailwind_config.rb and tailwind_css.rb. Documentation Updates: Updated rails_bundler_view.rb and rails_importmaps_view.rb in the installation documentation. Configuration Update: Modified tailwind.config.js to reflect the new changes. --- .../stylesheets/application.tailwind.css | 77 +++-- .../installation_instructions_coming_soon.rb | 43 --- app/views/components/docs/premium_badge.rb | 22 -- app/views/components/docs/tailwind_config.rb | 105 ++++++ app/views/components/docs/tailwind_css.rb | 90 +++++ .../docs/installation/rails_bundler_view.rb | 294 +--------------- .../installation/rails_importmaps_view.rb | 318 +----------------- tailwind.config.js | 33 +- 8 files changed, 274 insertions(+), 708 deletions(-) delete mode 100644 app/views/components/docs/installation_instructions_coming_soon.rb delete mode 100644 app/views/components/docs/premium_badge.rb create mode 100644 app/views/components/docs/tailwind_config.rb create mode 100644 app/views/components/docs/tailwind_css.rb diff --git a/app/assets/stylesheets/application.tailwind.css b/app/assets/stylesheets/application.tailwind.css index a3943fe..cd8d457 100644 --- a/app/assets/stylesheets/application.tailwind.css +++ b/app/assets/stylesheets/application.tailwind.css @@ -2,53 +2,62 @@ @tailwind components; @tailwind utilities; - @layer base { :root { --background: 0 0% 100%; - --foreground: 0 0% 3.9%; - --primary: 0 0% 9%; + --foreground: 240 10% 3.9%; + --card: 0 0% 100%; + --card-foreground: 240 10% 3.9%; + --popover: 0 0% 100%; + --popover-foreground: 240 10% 3.9%; + --primary: 240 5.9% 10%; --primary-foreground: 0 0% 98%; - --secondary: 0 0% 96.1%; - --secondary-foreground: 0 0% 9%; - --muted: 0 0% 96.1%; - --muted-foreground: 0 0% 45.1%; - --accent: 0 0% 96.1%; - --accent-foreground: 0 0% 9%; - --destructive: 350 89% 60%; - --destructive-foreground: 0 0% 100%; + --secondary: 240 4.8% 95.9%; + --secondary-foreground: 240 5.9% 10%; + --muted: 240 4.8% 95.9%; + --muted-foreground: 240 3.8% 46.1%; + --accent: 240 4.8% 95.9%; + --accent-foreground: 240 5.9% 10%; + --destructive: 0 84.2% 60.2%; + --destructive-foreground: 0 0% 98%; + --border: 240 5.9% 90%; + --input: 240 5.9% 90%; + --ring: 240 5.9% 10%; + --radius: 0.5rem; + + /* rbui especific */ --warning: 38 92% 50%; --warning-foreground: 0 0% 100%; --success: 87 100% 37%; --success-foreground: 0 0% 100%; - --border: 0 0% 89.8%; - --input: 0 0% 89.8%; - --ring: 0 0% 3.9%; - --radius: 0.5rem; - --font-sans: 'General Sans'; - /* --font-sans: system-ui; */ } .dark { - --background: 0 0% 3.9%; + --background: 240 10% 3.9%; --foreground: 0 0% 98%; + --card: 240 10% 3.9%; + --card-foreground: 0 0% 98%; + --popover: 240 10% 3.9%; + --popover-foreground: 0 0% 98%; --primary: 0 0% 98%; - --primary-foreground: 0 0% 9%; - --secondary: 0 0% 18%; + --primary-foreground: 240 5.9% 10%; + --secondary: 240 3.7% 15.9%; --secondary-foreground: 0 0% 98%; - --muted: 0 0% 18%; - --muted-foreground: 0 0% 63.9%; - --accent: 0 0% 18%; + --muted: 240 3.7% 15.9%; + --muted-foreground: 240 5% 64.9%; + --accent: 240 3.7% 15.9%; --accent-foreground: 0 0% 98%; - --destructive: 350 89% 60%; - --destructive-foreground: 0 0% 100%; + --destructive: 0 62.8% 30.6%; + --destructive-foreground: 0 0% 98%; + --border: 240 3.7% 15.9%; + --input: 240 3.7% 15.9%; + --ring: 240 4.9% 83.9%; + + /* rbui especific */ --warning: 38 92% 50%; --warning-foreground: 0 0% 100%; --success: 84 81% 44%; --success-foreground: 0 0% 100%; - --border: 0 0% 18%; - --input: 0 0% 18%; - --ring: 0 0% 83.1%; } } @@ -59,15 +68,9 @@ body { @apply bg-background text-foreground; font-feature-settings: "rlig" 1, "calt" 1; - } -} - -@layer utilities { - .font-bold { - font-weight: 620; - } - .font-semibold { - font-weight: 580; + /* docs specific */ + /* https://css-tricks.com/snippets/css/system-font-stack/ */ + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; } } \ No newline at end of file diff --git a/app/views/components/docs/installation_instructions_coming_soon.rb b/app/views/components/docs/installation_instructions_coming_soon.rb deleted file mode 100644 index d236fbd..0000000 --- a/app/views/components/docs/installation_instructions_coming_soon.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true - -class Docs::InstallationInstructionsComingSoon < ApplicationComponent - def initialize(title: "Installation", description: "Everything you need to know to get started with this component.") - @title = title - @description = description - end - - def view_template(&block) - render_header if @title || @description - end - - def render_header - div do - div(class: "space-y-1 mb-4") do - TypographyH4 { @title } if @title - TypographyP { @description } if @description - end - div(class: "ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 relative rounded-md border") do - div(class: "preview flex min-h-[350px] w-full justify-center p-10 items-center") do - TypographyP(class: "text-muted-foreground text-center flex flex-col sm:flex-row items-center gap-y-2 gap-x-2") do - svg( - xmlns: "http://www.w3.org/2000/svg", - fill: "none", - viewbox: "0 0 24 24", - stroke_width: "1.5", - stroke: "currentColor", - class: "w-4 h-4" - ) do |s| - s.path( - stroke_linecap: "round", - stroke_linejoin: "round", - d: - "M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 00-2.456 2.456zM16.894 20.567L16.5 21.75l-.394-1.183a2.25 2.25 0 00-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 001.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 001.423 1.423l1.183.394-1.183.394a2.25 2.25 0 00-1.423 1.423z" - ) - end - plain "Installation instructions coming soon!" - end - end - end - end - end -end diff --git a/app/views/components/docs/premium_badge.rb b/app/views/components/docs/premium_badge.rb deleted file mode 100644 index e1d805d..0000000 --- a/app/views/components/docs/premium_badge.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class Docs::PremiumBadge < ApplicationComponent - def view_template - Badge(variant: :violet) do - svg( - xmlns: "http://www.w3.org/2000/svg", - viewbox: "0 0 24 24", - fill: "currentColor", - class: "w-3 h-3 mr-1" - ) do |s| - s.path( - fill_rule: "evenodd", - d: - "M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z", - clip_rule: "evenodd" - ) - end - plain "Premium" - end - end -end diff --git a/app/views/components/docs/tailwind_config.rb b/app/views/components/docs/tailwind_config.rb new file mode 100644 index 0000000..0c58050 --- /dev/null +++ b/app/views/components/docs/tailwind_config.rb @@ -0,0 +1,105 @@ +# frozen_string_literal: true + +class Docs::TailwindConfig < ApplicationComponent + def view_template + TypographyLarge { "Update Tailwind Configuration" } + TypographyP do + plain "Add the following to your " + TypographyInlineCode(class: "whitespace-nowrap") { "tailwind.config.js" } + plain " file" + end + Codeblock(tailwind_config, syntax: :javascript) + end + + private + + def tailwind_config + <<~CODE + // For importing tailwind styles from rbui gem + const execSync = require('child_process').execSync; + + // Import rbui gem path (To make sure Tailwind loads classes used by rbui gem) + const outputRBUI = execSync('bundle show phlex_ui', { encoding: 'utf-8' }); + const rbui_path = outputRBUI.trim() + '/**/*.rb'; + + const defaultTheme = require('tailwindcss/defaultTheme') + + module.exports = { + darkMode: ["class"], + content: [ + './app/views/**/*.{erb,haml,html,slim,rb}', + './app/helpers/**/*.rb', + './app/assets/stylesheets/**/*.css', + './app/javascript/**/*.js', + rbui_path + ], + theme: { + container: { + center: true, + padding: "2rem", + screens: { + "2xl": "1400px", + }, + }, + extend: { + colors: { + border: "hsl(var(--border))", + input: "hsl(var(--input))", + ring: "hsl(var(--ring))", + background: "hsl(var(--background))", + foreground: "hsl(var(--foreground))", + primary: { + DEFAULT: "hsl(var(--primary))", + foreground: "hsl(var(--primary-foreground))", + }, + secondary: { + DEFAULT: "hsl(var(--secondary))", + foreground: "hsl(var(--secondary-foreground))", + }, + destructive: { + DEFAULT: "hsl(var(--destructive))", + foreground: "hsl(var(--destructive-foreground))", + }, + muted: { + DEFAULT: "hsl(var(--muted))", + foreground: "hsl(var(--muted-foreground))", + }, + accent: { + DEFAULT: "hsl(var(--accent))", + foreground: "hsl(var(--accent-foreground))", + }, + popover: { + DEFAULT: "hsl(var(--popover))", + foreground: "hsl(var(--popover-foreground))", + }, + card: { + DEFAULT: "hsl(var(--card))", + foreground: "hsl(var(--card-foreground))", + }, + warning: { + DEFAULT: "hsl(var(--warning))", + foreground: "hsl(var(--warning-foreground))", + }, + success: { + DEFAULT: "hsl(var(--success))", + foreground: "hsl(var(--success-foreground))", + }, + }, + borderRadius: { + lg: `var(--radius)`, + md: `calc(var(--radius) - 2px)`, + sm: "calc(var(--radius) - 4px)", + }, + fontFamily: { + sans: ["var(--font-sans)", ...defaultTheme.fontFamily.sans], + }, + }, + }, + # Not compatible with importmaps + plugins: [ + require("tailwindcss-animate"), + ], + } + CODE + end +end diff --git a/app/views/components/docs/tailwind_css.rb b/app/views/components/docs/tailwind_css.rb new file mode 100644 index 0000000..02ead93 --- /dev/null +++ b/app/views/components/docs/tailwind_css.rb @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +class Docs::TailwindCss < ApplicationComponent + def view_template + TypographyLarge { "Add CSS variables" } + TypographyP do + plain "Add the following to your " + TypographyInlineCode { "app/assets/stylesheets/application.tailwind.css" } + plain " file" + end + code = css_variables + Codeblock(code, syntax: :css) + end + + private + + def css_variables + <<~CODE + @tailwind base; + @tailwind components; + @tailwind utilities; + + + @layer base { + :root { + --background: 0 0% 100%; + --foreground: 240 10% 3.9%; + --card: 0 0% 100%; + --card-foreground: 240 10% 3.9%; + --popover: 0 0% 100%; + --popover-foreground: 240 10% 3.9%; + --primary: 240 5.9% 10%; + --primary-foreground: 0 0% 98%; + --secondary: 240 4.8% 95.9%; + --secondary-foreground: 240 5.9% 10%; + --muted: 240 4.8% 95.9%; + --muted-foreground: 240 3.8% 46.1%; + --accent: 240 4.8% 95.9%; + --accent-foreground: 240 5.9% 10%; + --destructive: 0 84.2% 60.2%; + --destructive-foreground: 0 0% 98%; + --border: 240 5.9% 90%; + --input: 240 5.9% 90%; + --ring: 240 5.9% 10%; + --radius: 0.5rem; + --warning: 38 92% 50%; + --warning-foreground: 0 0% 100%; + --success: 87 100% 37%; + --success-foreground: 0 0% 100%; + } + + .dark { + --background: 240 10% 3.9%; + --foreground: 0 0% 98%; + --card: 240 10% 3.9%; + --card-foreground: 0 0% 98%; + --popover: 240 10% 3.9%; + --popover-foreground: 0 0% 98%; + --primary: 0 0% 98%; + --primary-foreground: 240 5.9% 10%; + --secondary: 240 3.7% 15.9%; + --secondary-foreground: 0 0% 98%; + --muted: 240 3.7% 15.9%; + --muted-foreground: 240 5% 64.9%; + --accent: 240 3.7% 15.9%; + --accent-foreground: 0 0% 98%; + --destructive: 0 62.8% 30.6%; + --destructive-foreground: 0 0% 98%; + --border: 240 3.7% 15.9%; + --input: 240 3.7% 15.9%; + --ring: 240 4.9% 83.9%; + --warning: 38 92% 50%; + --warning-foreground: 0 0% 100%; + --success: 84 81% 44%; + --success-foreground: 0 0% 100%; + } + } + + @layer base { + * { + @apply border-border; + } + body { + @apply bg-background text-foreground; + font-feature-settings: "rlig" 1, "calt" 1; + } + } + CODE + end +end diff --git a/app/views/docs/installation/rails_bundler_view.rb b/app/views/docs/installation/rails_bundler_view.rb index 952a39b..0c9b14a 100644 --- a/app/views/docs/installation/rails_bundler_view.rb +++ b/app/views/docs/installation/rails_bundler_view.rb @@ -67,7 +67,11 @@ def view_template steps.add_step do step_container do TypographyLarge { "Install PhlexUI gem" } - phlex_ui_installation("free") + TypographyP { "Run the following in the terminal to install the PhlexUI Component Library" } + code = <<~CODE + bundle add phlex_ui + CODE + Codeblock(code, syntax: :javascript) end end # STEP 3 @@ -131,28 +135,14 @@ class ApplicationComponent < Phlex::HTML # STEP 3 steps.add_step do step_container do - TypographyLarge { "Update Tailwind Configuration" } - TypographyP do - plain "Add the following to your " - TypographyInlineCode(class: "whitespace-nowrap") { "tailwind.config.js" } - plain " file" - end - - Codeblock(tailwind_config, syntax: :javascript) + render Docs::TailwindConfig.new end end # STEP 4 steps.add_step do step_container do - TypographyLarge { "Add CSS variables" } - TypographyP do - plain "Add the following to your " - TypographyInlineCode { "app/assets/stylesheets/application.tailwind.css" } - plain " file" - end - code = css_variables - Codeblock(code, syntax: :css) + render Docs::TailwindCss.new end end end @@ -165,39 +155,6 @@ def step_container(&) div(class: "space-y-4", &) end - def phlex_ui_installation(plan) - case plan - when "free" - TypographyP { "Run the following in the terminal to install the PhlexUI Component Library" } - code = <<~CODE - bundle add phlex_ui - CODE - Codeblock(code, syntax: :javascript) - when "pro" - TypographyP do - plain "Your license key is " - TypographyInlineCode(class: "whitespace-nowrap") { @phlex_ui_pro_private_key } - end - TypographyP { "Use it to set your license key in development" } - code = <<~CODE - export BUNDLE_PHLEXUI__FURY__SITE=#{@phlex_ui_pro_private_key} - CODE - Codeblock(code, syntax: :javascript) - TypographyP { "Check that the key is set" } - code = <<~CODE - echo $BUNDLE_PHLEXUI__FURY__SITE - CODE - Codeblock(code, syntax: :javascript) - TypographyP { "If you see your key printed in the terminal, you're good to continue" } - - TypographyP { "Now you can install the Pro version of PhlexUI" } - code = <<~CODE - bundle add phlex_ui - CODE - Codeblock(code, syntax: :javascript) - end - end - def js_installation render Steps::Builder.new do |steps| # STEP 1 @@ -206,7 +163,7 @@ def js_installation TypographyLarge { "Install package" } TypographyP { "Run the following in the terminal to install PhlexUI JS package" } code = <<~CODE - yarn add phlex_ui + yarn add rbui-js CODE Codeblock(code, syntax: :javascript) end @@ -221,246 +178,13 @@ def js_installation plain " file" end code = <<~CODE - import 'phlex_ui'; + import 'rbui-js'; CODE Codeblock(code, syntax: :javascript) end end end - def tailwind_config - <<~CODE - // For importing tailwind styles from phlex_ui/phlex_ui_pro gem - const execSync = require('child_process').execSync; - - // Import phlex_ui gem path (To make sure Tailwind loads classes used by phlex_ui gem) - const outputPhlexUI = execSync('bundle show phlex_ui', { encoding: 'utf-8' }); - const phlex_ui_path = outputPhlexUI.trim() + '/**/*.rb'; - - const defaultTheme = require('tailwindcss/defaultTheme') - - module.exports = { - darkMode: ["class"], - content: [ - './app/views/**/*.{erb,haml,html,slim,rb}', - './app/helpers/**/*.rb', - './app/assets/stylesheets/**/*.css', - './app/javascript/**/*.js', - phlex_ui_path - ], - theme: { - container: { - center: true, - padding: "2rem", - screens: { - "2xl": "1400px", - }, - }, - extend: { - colors: { - border: "hsl(var(--border))", - input: "hsl(var(--input))", - ring: "hsl(var(--ring))", - background: "hsl(var(--background))", - foreground: "hsl(var(--foreground))", - primary: { - DEFAULT: "hsl(var(--primary))", - foreground: "hsl(var(--primary-foreground))", - }, - secondary: { - DEFAULT: "hsl(var(--secondary))", - foreground: "hsl(var(--secondary-foreground))", - }, - destructive: { - DEFAULT: "hsl(var(--destructive))", - foreground: "hsl(var(--destructive-foreground))", - }, - warning: { - DEFAULT: "hsl(var(--warning))", - foreground: "hsl(var(--warning-foreground))", - }, - success: { - DEFAULT: "hsl(var(--success))", - foreground: "hsl(var(--success-foreground))", - }, - muted: { - DEFAULT: "hsl(var(--muted))", - foreground: "hsl(var(--muted-foreground))", - }, - accent: { - DEFAULT: "hsl(var(--accent))", - foreground: "hsl(var(--accent-foreground))", - }, - }, - borderRadius: { - lg: `var(--radius)`, - md: `calc(var(--radius) - 2px)`, - sm: "calc(var(--radius) - 4px)", - }, - fontFamily: { - sans: defaultTheme.fontFamily.sans, - }, - }, - }, - plugins: [ - require("tailwindcss-animate"), - ], - } - CODE - end - - def tailwind_config_pro - <<~CODE - // For importing tailwind styles from phlex_ui/phlex_ui_pro gem - const execSync = require('child_process').execSync; - - // Import phlex_ui gem path (To make sure Tailwind loads classes used by phlex_ui gem) - const outputPhlexUI = execSync('bundle show phlex_ui', { encoding: 'utf-8' }); - const phlex_ui_path = outputPhlexUI.trim() + '/**/*.rb'; - - // Import phlex_ui_pro gem path (To make sure Tailwind loads classes used by phlex_ui_pro gem) - const outputPhlexUIPro = execSync('bundle show phlex_ui_pro', { encoding: 'utf-8' }); - const phlex_ui_pro_path = outputPhlexUIPro.trim() + '/**/*.rb'; - - const defaultTheme = require('tailwindcss/defaultTheme') - - module.exports = { - darkMode: ["class"], - content: [ - './app/views/**/*.{erb,haml,html,slim,rb}', - './app/helpers/**/*.rb', - './app/assets/stylesheets/**/*.css', - './app/javascript/**/*.js', - phlex_ui_path, - phlex_ui_pro_path - ], - theme: { - container: { - center: true, - padding: "2rem", - screens: { - "2xl": "1400px", - }, - }, - extend: { - colors: { - border: "hsl(var(--border))", - input: "hsl(var(--input))", - ring: "hsl(var(--ring))", - background: "hsl(var(--background))", - foreground: "hsl(var(--foreground))", - primary: { - DEFAULT: "hsl(var(--primary))", - foreground: "hsl(var(--primary-foreground))", - }, - secondary: { - DEFAULT: "hsl(var(--secondary))", - foreground: "hsl(var(--secondary-foreground))", - }, - destructive: { - DEFAULT: "hsl(var(--destructive))", - foreground: "hsl(var(--destructive-foreground))", - }, - warning: { - DEFAULT: "hsl(var(--warning))", - foreground: "hsl(var(--warning-foreground))", - }, - success: { - DEFAULT: "hsl(var(--success))", - foreground: "hsl(var(--success-foreground))", - }, - muted: { - DEFAULT: "hsl(var(--muted))", - foreground: "hsl(var(--muted-foreground))", - }, - accent: { - DEFAULT: "hsl(var(--accent))", - foreground: "hsl(var(--accent-foreground))", - }, - }, - borderRadius: { - lg: `var(--radius)`, - md: `calc(var(--radius) - 2px)`, - sm: "calc(var(--radius) - 4px)", - }, - fontFamily: { - sans: defaultTheme.fontFamily.sans, - }, - }, - }, - plugins: [ - require("tailwindcss-animate"), - ], - } - CODE - end - - def css_variables - <<~CODE - @tailwind base; - @tailwind components; - @tailwind utilities; - - - @layer base { - :root { - --background: 0 0% 100%; - --foreground: 0 0% 3.9%; - --primary: 0 0% 9%; - --primary-foreground: 0 0% 98%; - --secondary: 0 0% 96.1%; - --secondary-foreground: 0 0% 9%; - --muted: 0 0% 96.1%; - --muted-foreground: 0 0% 45.1%; - --accent: 0 0% 96.1%; - --accent-foreground: 0 0% 9%; - --destructive: 350 89% 60%; - --destructive-foreground: 0 0% 100%; - --warning: 38 92% 50%; - --warning-foreground: 0 0% 100%; - --success: 87 100% 37%; - --success-foreground: 0 0% 100%; - --border: 0 0% 89.8%; - --input: 0 0% 89.8%; - --ring: 0 0% 3.9%; - --radius: 0.5rem; - } - - .dark { - --background: 0 0% 3.9%; - --foreground: 0 0% 98%; - --primary: 0 0% 98%; - --primary-foreground: 0 0% 9%; - --secondary: 0 0% 14.9%; - --secondary-foreground: 0 0% 98%; - --muted: 0 0% 14.9%; - --muted-foreground: 0 0% 63.9%; - --accent: 0 0% 14.9%; - --accent-foreground: 0 0% 98%; - --destructive: 350 89% 60%; - --destructive-foreground: 0 0% 100%; - --warning: 38 92% 50%; - --warning-foreground: 0 0% 100%; - --success: 84 81% 44%; - --success-foreground: 0 0% 100%; - --border: 0 0% 14.9%; - --input: 0 0% 14.9%; - --ring: 0 0% 83.1%; - } - } - - @layer base { - * { - @apply border-border; - } - body { - @apply bg-background text-foreground; - font-feature-settings: "rlig" 1, "calt" 1; - } - } - CODE - end - def info_icon svg( xmlns: "http://www.w3.org/2000/svg", diff --git a/app/views/docs/installation/rails_importmaps_view.rb b/app/views/docs/installation/rails_importmaps_view.rb index a0d9e16..f1cdbfc 100644 --- a/app/views/docs/installation/rails_importmaps_view.rb +++ b/app/views/docs/installation/rails_importmaps_view.rb @@ -73,7 +73,11 @@ def view_template steps.add_step do step_container do TypographyLarge { "Install PhlexUI gem" } - phlex_ui_installation("free") + TypographyP { "Run the following in the terminal to install the PhlexUI Component Library" } + code = <<~CODE + bundle add phlex_ui + CODE + Codeblock(code, syntax: :javascript) end end # STEP 3 @@ -116,28 +120,14 @@ class ApplicationComponent < Phlex::HTML # STEP 2 steps.add_step do step_container do - TypographyLarge { "Update Tailwind Configuration" } - TypographyP do - plain "Add the following to your " - TypographyInlineCode(class: "whitespace-nowrap") { "tailwind.config.js" } - plain " file" - end - - Codeblock(tailwind_config, syntax: :javascript) + render Docs::TailwindConfig.new end end # STEP 3 steps.add_step do step_container do - TypographyLarge { "Add CSS variables" } - TypographyP do - plain "Add the following to your " - TypographyInlineCode { "app/assets/stylesheets/application.tailwind.css" } - plain " file" - end - code = css_variables - Codeblock(code, syntax: :css) + render Docs::TailwindCss.new end end end @@ -150,39 +140,6 @@ def step_container(&) div(class: "space-y-4", &) end - def phlex_ui_installation(plan) - case plan - when "free" - TypographyP { "Run the following in the terminal to install the PhlexUI Component Library" } - code = <<~CODE - bundle add phlex_ui - CODE - Codeblock(code, syntax: :javascript) - when "pro" - TypographyP do - plain "Your license key is " - TypographyInlineCode(class: "whitespace-nowrap") { @phlex_ui_pro_private_key } - end - TypographyP { "Use it to set your license key in development" } - code = <<~CODE - export BUNDLE_PHLEXUI__FURY__SITE=#{@phlex_ui_pro_private_key} - CODE - Codeblock(code, syntax: :javascript) - TypographyP { "Check that the key is set" } - code = <<~CODE - echo $BUNDLE_PHLEXUI__FURY__SITE - CODE - Codeblock(code, syntax: :javascript) - TypographyP { "If you see your key printed in the terminal, you're good to continue" } - - TypographyP { "Now you can install the Pro version of PhlexUI" } - code = <<~CODE - bundle add phlex_ui - CODE - Codeblock(code, syntax: :javascript) - end - end - def js_installation render Steps::Builder.new do |steps| # STEP 1 @@ -191,7 +148,7 @@ def js_installation TypographyLarge { "Install package" } TypographyP { "Run the following in the terminal to install PhlexUI JS package" } code = <<~CODE - bin/importmap pin phlex_ui + bin/importmap pin rbui-js CODE Codeblock(code, syntax: :javascript) end @@ -206,270 +163,13 @@ def js_installation plain " file" end code = <<~CODE - import 'phlex_ui'; + import 'rbui-js'; CODE Codeblock(code, syntax: :javascript) end end end - def upgrade_to_pro - div(class: "overflow-hidden rounded-lg") do - AspectRatio(aspect_ratio: "3/2") do - img( - alt: "Placeholder", - loading: "lazy", - src: - helpers.image_path("installation_blur.jpg"), - class: "opacity-20 blur-xl" - ) - div(class: "absolute inset-0 p-6 flex flex-col items-center justify-center") do - Card(class: "max-w-md mx-auto") do - CardHeader do - CardTitle { "Upgrade to PhlexUI Pro" } - CardDescription do - "Get access to all components, boost your productivity and take your projects to the next level." - end - end - CardFooter(class: "flex justify-end gap-x-2") do - Link(href: helpers.root_path(anchor: :pricing), variant: :primary) do - plain "Get all access" - arrow_icon - end - end - end - end - end - end - end - - def tailwind_config - <<~CODE - // For importing tailwind styles from phlex_ui/phlex_ui_pro gem - const execSync = require('child_process').execSync; - - // Import phlex_ui gem path (To make sure Tailwind loads classes used by phlex_ui gem) - const outputPhlexUI = execSync('bundle show phlex_ui', { encoding: 'utf-8' }); - const phlex_ui_path = outputPhlexUI.trim() + '/**/*.rb'; - - const defaultTheme = require('tailwindcss/defaultTheme') - - module.exports = { - darkMode: ["class"], - content: [ - './app/views/**/*.{erb,haml,html,slim,rb}', - './app/helpers/**/*.rb', - './app/assets/stylesheets/**/*.css', - './app/javascript/**/*.js', - phlex_ui_path - ], - theme: { - container: { - center: true, - padding: "2rem", - screens: { - "2xl": "1400px", - }, - }, - extend: { - colors: { - border: "hsl(var(--border))", - input: "hsl(var(--input))", - ring: "hsl(var(--ring))", - background: "hsl(var(--background))", - foreground: "hsl(var(--foreground))", - primary: { - DEFAULT: "hsl(var(--primary))", - foreground: "hsl(var(--primary-foreground))", - }, - secondary: { - DEFAULT: "hsl(var(--secondary))", - foreground: "hsl(var(--secondary-foreground))", - }, - destructive: { - DEFAULT: "hsl(var(--destructive))", - foreground: "hsl(var(--destructive-foreground))", - }, - warning: { - DEFAULT: "hsl(var(--warning))", - foreground: "hsl(var(--warning-foreground))", - }, - success: { - DEFAULT: "hsl(var(--success))", - foreground: "hsl(var(--success-foreground))", - }, - muted: { - DEFAULT: "hsl(var(--muted))", - foreground: "hsl(var(--muted-foreground))", - }, - accent: { - DEFAULT: "hsl(var(--accent))", - foreground: "hsl(var(--accent-foreground))", - }, - }, - borderRadius: { - lg: `var(--radius)`, - md: `calc(var(--radius) - 2px)`, - sm: "calc(var(--radius) - 4px)", - }, - fontFamily: { - sans: defaultTheme.fontFamily.sans, - }, - }, - }, - } - CODE - end - - def tailwind_config_pro - <<~CODE - // For importing tailwind styles from phlex_ui/phlex_ui_pro gem - const execSync = require('child_process').execSync; - - // Import phlex_ui gem path (To make sure Tailwind loads classes used by phlex_ui gem) - const outputPhlexUI = execSync('bundle show phlex_ui', { encoding: 'utf-8' }); - const phlex_ui_path = outputPhlexUI.trim() + '/**/*.rb'; - - // Import phlex_ui_pro gem path (To make sure Tailwind loads classes used by phlex_ui_pro gem) - const outputPhlexUIPro = execSync('bundle show phlex_ui_pro', { encoding: 'utf-8' }); - const phlex_ui_pro_path = outputPhlexUIPro.trim() + '/**/*.rb'; - - const defaultTheme = require('tailwindcss/defaultTheme') - - module.exports = { - darkMode: ["class"], - content: [ - './app/views/**/*.{erb,haml,html,slim,rb}', - './app/helpers/**/*.rb', - './app/assets/stylesheets/**/*.css', - './app/javascript/**/*.js', - phlex_ui_path, - phlex_ui_pro_path - ], - theme: { - container: { - center: true, - padding: "2rem", - screens: { - "2xl": "1400px", - }, - }, - extend: { - colors: { - border: "hsl(var(--border))", - input: "hsl(var(--input))", - ring: "hsl(var(--ring))", - background: "hsl(var(--background))", - foreground: "hsl(var(--foreground))", - primary: { - DEFAULT: "hsl(var(--primary))", - foreground: "hsl(var(--primary-foreground))", - }, - secondary: { - DEFAULT: "hsl(var(--secondary))", - foreground: "hsl(var(--secondary-foreground))", - }, - destructive: { - DEFAULT: "hsl(var(--destructive))", - foreground: "hsl(var(--destructive-foreground))", - }, - warning: { - DEFAULT: "hsl(var(--warning))", - foreground: "hsl(var(--warning-foreground))", - }, - success: { - DEFAULT: "hsl(var(--success))", - foreground: "hsl(var(--success-foreground))", - }, - muted: { - DEFAULT: "hsl(var(--muted))", - foreground: "hsl(var(--muted-foreground))", - }, - accent: { - DEFAULT: "hsl(var(--accent))", - foreground: "hsl(var(--accent-foreground))", - }, - }, - borderRadius: { - lg: `var(--radius)`, - md: `calc(var(--radius) - 2px)`, - sm: "calc(var(--radius) - 4px)", - }, - fontFamily: { - sans: defaultTheme.fontFamily.sans, - }, - }, - }, - } - CODE - end - - def css_variables - <<~CODE - @tailwind base; - @tailwind components; - @tailwind utilities; - - - @layer base { - :root { - --background: 0 0% 100%; - --foreground: 0 0% 3.9%; - --primary: 0 0% 9%; - --primary-foreground: 0 0% 98%; - --secondary: 0 0% 96.1%; - --secondary-foreground: 0 0% 9%; - --muted: 0 0% 96.1%; - --muted-foreground: 0 0% 45.1%; - --accent: 0 0% 96.1%; - --accent-foreground: 0 0% 9%; - --destructive: 350 89% 60%; - --destructive-foreground: 0 0% 100%; - --warning: 38 92% 50%; - --warning-foreground: 0 0% 100%; - --success: 87 100% 37%; - --success-foreground: 0 0% 100%; - --border: 0 0% 89.8%; - --input: 0 0% 89.8%; - --ring: 0 0% 3.9%; - --radius: 0.5rem; - } - - .dark { - --background: 0 0% 3.9%; - --foreground: 0 0% 98%; - --primary: 0 0% 98%; - --primary-foreground: 0 0% 9%; - --secondary: 0 0% 14.9%; - --secondary-foreground: 0 0% 98%; - --muted: 0 0% 14.9%; - --muted-foreground: 0 0% 63.9%; - --accent: 0 0% 14.9%; - --accent-foreground: 0 0% 98%; - --destructive: 350 89% 60%; - --destructive-foreground: 0 0% 100%; - --warning: 38 92% 50%; - --warning-foreground: 0 0% 100%; - --success: 84 81% 44%; - --success-foreground: 0 0% 100%; - --border: 0 0% 14.9%; - --input: 0 0% 14.9%; - --ring: 0 0% 83.1%; - } - } - - @layer base { - * { - @apply border-border; - } - body { - @apply bg-background text-foreground; - font-feature-settings: "rlig" 1, "calt" 1; - } - } - CODE - end - def info_icon svg( xmlns: "http://www.w3.org/2000/svg", diff --git a/tailwind.config.js b/tailwind.config.js index 672c2f6..fd21d7b 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,9 +1,9 @@ // For importing tailwind styles from phlex_ui/phlex_ui_pro gem const execSync = require('child_process').execSync; -// Import phlex_ui gem path -const outputPhlexUI = execSync('bundle show phlex_ui', { encoding: 'utf-8' }); -const phlex_ui_path = outputPhlexUI.trim() + '/**/*.rb'; +// Import rbui gem path +const outputRBUI = execSync('bundle show phlex_ui', { encoding: 'utf-8' }); +const rbui_path = outputRBUI.trim() + '/**/*.rb'; const defaultTheme = require('tailwindcss/defaultTheme') @@ -14,7 +14,7 @@ module.exports = { './app/helpers/**/*.rb', './app/assets/stylesheets/**/*.css', './app/javascript/**/*.js', - phlex_ui_path + rbui_path ], theme: { container: { @@ -43,14 +43,6 @@ module.exports = { DEFAULT: "hsl(var(--destructive))", foreground: "hsl(var(--destructive-foreground))", }, - warning: { - DEFAULT: "hsl(var(--warning))", - foreground: "hsl(var(--warning-foreground))", - }, - success: { - DEFAULT: "hsl(var(--success))", - foreground: "hsl(var(--success-foreground))", - }, muted: { DEFAULT: "hsl(var(--muted))", foreground: "hsl(var(--muted-foreground))", @@ -59,6 +51,23 @@ module.exports = { DEFAULT: "hsl(var(--accent))", foreground: "hsl(var(--accent-foreground))", }, + popover: { + DEFAULT: "hsl(var(--popover))", + foreground: "hsl(var(--popover-foreground))", + }, + card: { + DEFAULT: "hsl(var(--card))", + foreground: "hsl(var(--card-foreground))", + }, + /* rbui especific */ + warning: { + DEFAULT: "hsl(var(--warning))", + foreground: "hsl(var(--warning-foreground))", + }, + success: { + DEFAULT: "hsl(var(--success))", + foreground: "hsl(var(--success-foreground))", + }, }, borderRadius: { lg: `var(--radius)`, From 368afeadc356810b37b987fb3d1082b2d4479af9 Mon Sep 17 00:00:00 2001 From: Cirdes Date: Sat, 24 Aug 2024 14:57:23 +0000 Subject: [PATCH 14/36] Adding FormComponent --- Gemfile | 2 +- Gemfile.lock | 7 +- app/controllers/docs_controller.rb | 4 + app/views/components/shared/menu.rb | 1 + app/views/docs/combobox_view.rb | 61 +++++----- app/views/docs/date_picker_view.rb | 2 +- app/views/docs/form_view.rb | 44 ++++++++ app/views/docs/input_view.rb | 45 +------- app/views/docs/sheet_view.rb | 167 +++------------------------- config/routes.rb | 3 +- package.json | 2 +- yarn.lock | 4 +- 12 files changed, 111 insertions(+), 231 deletions(-) create mode 100644 app/views/docs/form_view.rb diff --git a/Gemfile b/Gemfile index 0450ffa..201bb44 100644 --- a/Gemfile +++ b/Gemfile @@ -73,7 +73,7 @@ group :test do end gem "phlex-rails" -gem "phlex_ui", github: "PhlexUI/phlex_ui", branch: "v1" +gem "phlex_ui", github: "PhlexUI/phlex_ui", branch: "ch/add-form-component" # gem "phlex_ui", path: "../phlex_ui" gem "dockerfile-rails", ">= 1.6", group: :development diff --git a/Gemfile.lock b/Gemfile.lock index a2a3e13..fb0bdb7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,13 +1,12 @@ GIT remote: https://github.com/PhlexUI/phlex_ui.git - revision: c0b011e9c5db8fbbad561298a4560edc8518b958 - branch: v1 + revision: 8197c46331678d969b071ce0c0ded83d24ae73cb + branch: ch/add-form-component specs: phlex_ui (0.1.10) phlex (~> 1.10) rouge (~> 4.2.0) tailwind_merge (>= 0.12) - zeitwerk (~> 2.6) GEM remote: https://rubygems.org/ @@ -299,7 +298,7 @@ GEM railties (>= 6.0.0) stringio (3.1.1) strscan (3.1.0) - tailwind_merge (0.12.0) + tailwind_merge (0.12.2) lru_redux (~> 1.1) thor (1.3.1) timeout (0.4.1) diff --git a/app/controllers/docs_controller.rb b/app/controllers/docs_controller.rb index 4eabe33..c1757e8 100644 --- a/app/controllers/docs_controller.rb +++ b/app/controllers/docs_controller.rb @@ -110,6 +110,10 @@ def dropdown_menu render Docs::DropdownMenuView.new end + def form + render Docs::FormView.new + end + def hover_card render Docs::HoverCardView.new end diff --git a/app/views/components/shared/menu.rb b/app/views/components/shared/menu.rb index fde2fdf..ff50dd9 100644 --- a/app/views/components/shared/menu.rb +++ b/app/views/components/shared/menu.rb @@ -80,6 +80,7 @@ def components {name: "Date Picker", path: helpers.docs_date_picker_path}, {name: "Dialog / Modal", path: helpers.docs_dialog_path}, {name: "Dropdown Menu", path: helpers.docs_dropdown_menu_path}, + {name: "Form", path: helpers.docs_form_path}, {name: "Input", path: helpers.docs_input_path}, {name: "Hover Card", path: helpers.docs_hover_card_path}, {name: "Link", path: helpers.docs_link_path}, diff --git a/app/views/docs/combobox_view.rb b/app/views/docs/combobox_view.rb index c52d9a7..441c514 100644 --- a/app/views/docs/combobox_view.rb +++ b/app/views/docs/combobox_view.rb @@ -5,41 +5,46 @@ class Docs::ComboboxView < ApplicationView def view_template 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.", premium: @premium) + render Docs::Header.new(title: "Combobox", description: "Autocomplete input and command palette with a list of suggestions.") TypographyH2 { "Usage" } - render Docs::VisualCodeExample.new(title: "Example", context: self, premium: @premium) do + render Docs::VisualCodeExample.new(title: "Example", context: self) do @@code_example = <<~RUBY - Combobox do - ComboboxTrigger(placeholder: "Select event...", aria_controls: "list") - ComboboxContent(id: "list") do - ComboboxSearchInput(placeholder: "Search event...") - ComboboxList do - ComboboxEmpty { "No results found." } - ComboboxGroup(heading: "Suggestions") do - ComboboxItem(value: "railsworld") do - span { "Rails World" } - end - ComboboxItem(value: "tropicalrb") do - span { "Tropical.rb" } - end - ComboboxItem(value: "friendly.rb") do - span { "Friendly.rb" } + div(class: "w-96") do + Combobox do + ComboboxInput() + ComboboxTrigger do + ComboboxValue(placeholder: "Select event...") + end + ComboboxContent do + ComboboxSearchInput(placeholder: "Search event...") + ComboboxList do + ComboboxEmpty { "No results found." } + ComboboxGroup(heading: "Suggestions") do + ComboboxItem(value: "railsworld") do + span { "Rails World" } + end + ComboboxItem(value: "tropicalrb") do + span { "Tropical.rb" } + end + ComboboxItem(value: "friendly.rb") do + span { "Friendly.rb" } + end end - end - ComboboxSeparator() + ComboboxSeparator() - ComboboxGroup(heading: "Others") do - ComboboxItem(value: "railsconf") do - span { "RailsConf" } - end - ComboboxItem(value: "euruko") do - span { "Euruko" } - end - ComboboxItem(value: "rubykaigi") do - span { "RubyKaigi" } + ComboboxGroup(heading: "Others") do + ComboboxItem(value: "railsconf") do + span { "RailsConf" } + end + ComboboxItem(value: "euruko") do + span { "Euruko" } + end + ComboboxItem(value: "rubykaigi") do + span { "RubyKaigi" } + end end end end diff --git a/app/views/docs/date_picker_view.rb b/app/views/docs/date_picker_view.rb index 1f1effe..efa0a75 100644 --- a/app/views/docs/date_picker_view.rb +++ b/app/views/docs/date_picker_view.rb @@ -17,7 +17,7 @@ def view_template Popover(options: { trigger: 'focusin' }) do PopoverTrigger(class: 'w-full') do div(class: 'grid w-full max-w-sm items-center gap-1.5') do - Label(for: "date") { "Select a date" } + label(for: "date") { "Select a date" } Input(type: 'string', placeholder: "Select a date", class: 'rounded-md border shadow', id: 'date', data_controller: 'input') end end diff --git a/app/views/docs/form_view.rb b/app/views/docs/form_view.rb new file mode 100644 index 0000000..9dc345a --- /dev/null +++ b/app/views/docs/form_view.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +class Docs::FormView < ApplicationView + def view_template + 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 + <<~RUBY + Form(class: "w-2/3 space-y-6") do + FormField do + FormFieldLabel { "Default error" } + Input(placeholder: "Joel Drapper", required: true, minlength: "3") { "Joel Drapper" } + FormFieldHint() + FormFieldError() + end + Button(type: "submit") { "Save" } + end + RUBY + end + + render Docs::ComponentsTable.new(components) + 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/input_view.rb b/app/views/docs/input_view.rb index a372fa7..fd01412 100644 --- a/app/views/docs/input_view.rb +++ b/app/views/docs/input_view.rb @@ -18,10 +18,8 @@ def view_template render Docs::VisualCodeExample.new(title: "File", context: self) do <<~RUBY div(class: "grid w-full max-w-sm items-center gap-1.5") do - FormItem do - Label(for: "picture") { "Picture" } - Input(type: "file", id: "picture") - end + label(for: "picture") { "Picture" } + Input(type: "file", id: "picture") end RUBY end @@ -37,21 +35,8 @@ def view_template render Docs::VisualCodeExample.new(title: "With label", context: self) do <<~RUBY div(class: 'grid w-full max-w-sm items-center gap-1.5') do - FormItem do - Label(for: "email1") { "Email" } - Input(type: "email", placeholder: "Email", id: "email1") - end - end - RUBY - end - - render Docs::VisualCodeExample.new(title: "With error", context: self) do - <<~RUBY - div(class: 'grid w-full max-w-sm items-center gap-1.5') do - FormItem do - Label(for: "email1") { "Email" } - Input(type: "email", placeholder: "Email", id: "email1", value: "joel@mail", error: "Invalid email address") - end + label(for: "email1") { "Email" } + Input(type: "email", placeholder: "Email", id: "email1") end RUBY end @@ -65,21 +50,6 @@ def view_template RUBY end - render Docs::VisualCodeExample.new(title: "Form (Deconstructed)", context: self) do - <<~RUBY - Form(class: 'w-full max-w-sm') do - FormSpacer do - FormItem do - Label(for: "username") { "Username" } - Input(type: "string", placeholder: "Username", id: "username") - Hint { "Can only contain letters, numbers, and underscores." } - end - Button(type: "submit") { "Submit" } - end - end - RUBY - end - render Docs::ComponentsTable.new(components) end end @@ -89,12 +59,7 @@ def view_template 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), - Docs::ComponentStruct.new(name: "Label", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/label.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "Hint", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/hint.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "Form", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/form.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "FormSpacer", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/form/spacer.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "FormItem", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/form/item.rb", built_using: :phlex) + 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/sheet_view.rb b/app/views/docs/sheet_view.rb index 68cf396..1e6f135 100644 --- a/app/views/docs/sheet_view.rb +++ b/app/views/docs/sheet_view.rb @@ -22,23 +22,16 @@ def view_template SheetTitle { "Edit profile" } SheetDescription { "Make changes to your profile here. Click save when you're done." } end - Form do - SheetMiddle do - FormSpacer do - FormItem do - Label { "Name" } - Input(placeholder: "Joel Drapper") { "Joel Drapper" } - end - FormItem do - Label { "Email" } - Input(placeholder: "joel@drapper.me") - end - end - end - SheetFooter do - Button(variant: :outline, data: { action: 'click->dismissable#dismiss' }) { "Cancel" } - Button(type: "submit") { "Save" } - end + + SheetMiddle do + label { "Name" } + Input(placeholder: "Joel Drapper") { "Joel Drapper" } + label { "Email" } + Input(placeholder: "joel@drapper.me") + end + SheetFooter do + Button(variant: :outline, data: { action: 'click->dismissable#dismiss' }) { "Cancel" } + Button(type: "submit") { "Save" } end end end @@ -60,109 +53,11 @@ def view_template end Form do SheetMiddle do - FormSpacer do - FormItem do - Label { "Name" } - Input(placeholder: "Joel Drapper") { "Joel Drapper" } - end - FormItem do - Label { "Email" } - Input(placeholder: "joel@drapper.me") - end - end - end - SheetFooter do - Button(variant: :outline, data: { action: 'click->dismissable#dismiss' }) { "Cancel" } - Button(type: "submit") { "Save" } - end - end - end - end - - # -- BOTTOM -- - Sheet do - SheetTrigger do - Button(variant: :outline, class: 'w-full justify-center') { :bottom } - end - SheetContent(side: :bottom, class: tokens(-> { [:left, :right].include?(:bottom) } => "sm:max-w-sm")) do - SheetHeader do - SheetTitle { "Edit profile" } - SheetDescription { "Make changes to your profile here. Click save when you're done." } - end - Form do - SheetMiddle do - FormSpacer do - FormItem do - Label { "Name" } - Input(placeholder: "Joel Drapper") { "Joel Drapper" } - end - FormItem do - Label { "Email" } - Input(placeholder: "joel@drapper.me") - end - end - end - SheetFooter do - Button(variant: :outline, data: { action: 'click->dismissable#dismiss' }) { "Cancel" } - Button(type: "submit") { "Save" } - end - end - end - end - - # -- LEFT -- - Sheet do - SheetTrigger do - Button(variant: :outline, class: 'w-full justify-center') { :left } - end - SheetContent(side: :left, class: tokens(-> { [:left, :right].include?(:left) } => "sm:max-w-sm")) do - SheetHeader do - SheetTitle { "Edit profile" } - SheetDescription { "Make changes to your profile here. Click save when you're done." } - end - Form do - SheetMiddle do - FormSpacer do - FormItem do - Label { "Name" } - Input(placeholder: "Joel Drapper") { "Joel Drapper" } - end - FormItem do - Label { "Email" } - Input(placeholder: "joel@drapper.me") - end - end - end - SheetFooter do - Button(variant: :outline, data: { action: 'click->dismissable#dismiss' }) { "Cancel" } - Button(type: "submit") { "Save" } - end - end - end - end + label { "Name" } + Input(placeholder: "Joel Drapper") { "Joel Drapper" } - # -- RIGHT -- - Sheet do - SheetTrigger do - Button(variant: :outline, class: 'w-full justify-center') { :right } - end - SheetContent(side: :right, class: tokens(-> { [:left, :right].include?(:right) } => "sm:max-w-sm")) do - SheetHeader do - SheetTitle { "Edit profile" } - SheetDescription { "Make changes to your profile here. Click save when you're done." } - end - Form do - SheetMiddle do - FormSpacer do - FormItem do - Label { "Name" } - Input(placeholder: "Joel Drapper") { "Joel Drapper" } - end - FormItem do - Label { "Email" } - Input(placeholder: "joel@drapper.me") - end - end + label { "Email" } + Input(placeholder: "joel@drapper.me") end SheetFooter do Button(variant: :outline, data: { action: 'click->dismissable#dismiss' }) { "Cancel" } @@ -175,40 +70,6 @@ def view_template RUBY end - render Docs::VisualCodeExample.new(title: "Custom size", context: self, premium: @premium) do - <<~RUBY - Sheet do - SheetTrigger do - Button(variant: :outline) { "Open Sheet" } - end - SheetContent(class: 'w-3/4') do - SheetHeader do - SheetTitle { "Edit profile" } - SheetDescription { "Make changes to your profile here. Click save when you're done." } - end - Form do - SheetMiddle do - FormSpacer do - FormItem do - Label { "Name" } - Input(placeholder: "Joel Drapper") { "Joel Drapper" } - end - FormItem do - Label { "Email" } - Input(placeholder: "joel@drapper.me") - end - end - end - SheetFooter do - Button(variant: :outline, data: { action: 'click->dismissable#dismiss' }) { "Cancel" } - Button(type: "submit") { "Save" } - end - end - end - end - RUBY - end - render Docs::ComponentsTable.new(components) end end diff --git a/config/routes.rb b/config/routes.rb index 998833d..dc56b3b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -33,8 +33,9 @@ get "command", to: "docs#command", as: :docs_command get "context_menu", to: "docs#context_menu", as: :docs_context_menu get "date_picker", to: "docs#date_picker", as: :docs_date_picker - get "dropdown_menu", to: "docs#dropdown_menu", as: :docs_dropdown_menu get "dialog", to: "docs#dialog", as: :docs_dialog + get "dropdown_menu", to: "docs#dropdown_menu", as: :docs_dropdown_menu + get "form", to: "docs#form", as: :docs_form get "hover_card", to: "docs#hover_card", as: :docs_hover_card get "input", to: "docs#input", as: :docs_input get "link", to: "docs#link", as: :docs_link diff --git a/package.json b/package.json index b01d7ae..7be5349 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "lottie-web": "5.12.2", "phlex_ui": "https://github.com/PhlexUI/phlex_ui_stimulus.git", "postcss": "8.4.40", - "rbui-js": "https://github.com/PhlexUI/phlex_ui.git#v1", + "rbui-js": "https://github.com/PhlexUI/phlex_ui.git#ch/add-form-component", "tailwindcss": "3.4.7", "tailwindcss-animate": "1.0.7" }, diff --git a/yarn.lock b/yarn.lock index 7a7fa2d..edeb7e7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -831,9 +831,9 @@ queue-microtask@^1.2.2: resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== -"rbui-js@https://github.com/PhlexUI/phlex_ui.git#v1": +"rbui-js@https://github.com/PhlexUI/phlex_ui.git#ch/add-form-component": version "0.0.1-alpha.0" - resolved "https://github.com/PhlexUI/phlex_ui.git#c0b011e9c5db8fbbad561298a4560edc8518b958" + resolved "https://github.com/PhlexUI/phlex_ui.git#8197c46331678d969b071ce0c0ded83d24ae73cb" dependencies: "@floating-ui/dom" "^1.6.8" "@hotwired/stimulus" "^3.2.2" From 14bb0645314080a7cda6bbd28dc1df805cb53003 Mon Sep 17 00:00:00 2001 From: Cirdes Henrique Date: Sat, 24 Aug 2024 17:10:27 -0300 Subject: [PATCH 15/36] Adding form component --- Gemfile | 2 +- Gemfile.lock | 4 +- app/views/docs/form_view.rb | 141 +++- package.json | 2 +- .../previews/phlex_ui/date_picker_preview.rb | 2 +- .../previews/phlex_ui/input_preview.rb | 73 -- .../previews/phlex_ui/popover_preview.rb | 4 +- .../previews/phlex_ui/sheet_preview.rb | 14 +- .../{phlex_ui => rbui}/accordion_preview.rb | 2 +- .../{phlex_ui => rbui}/checkbox_preview.rb | 2 +- .../previews/rbui/combobox_preview.rb | 51 ++ test/components/previews/rbui/form_preview.rb | 148 ++++ .../components/previews/rbui/input_preview.rb | 40 + .../{phlex_ui => rbui}/select_preview.rb | 2 +- .../theme_toggle_preview.rb | 2 +- .../{phlex_ui => rbui}/tooltip_preview.rb | 2 +- yarn-error.log | 691 ++++++++++-------- yarn.lock | 3 +- 18 files changed, 748 insertions(+), 437 deletions(-) delete mode 100644 test/components/previews/phlex_ui/input_preview.rb rename test/components/previews/{phlex_ui => rbui}/accordion_preview.rb (97%) rename test/components/previews/{phlex_ui => rbui}/checkbox_preview.rb (93%) create mode 100644 test/components/previews/rbui/combobox_preview.rb create mode 100644 test/components/previews/rbui/form_preview.rb create mode 100644 test/components/previews/rbui/input_preview.rb rename test/components/previews/{phlex_ui => rbui}/select_preview.rb (98%) rename test/components/previews/{phlex_ui => rbui}/theme_toggle_preview.rb (97%) rename test/components/previews/{phlex_ui => rbui}/tooltip_preview.rb (97%) diff --git a/Gemfile b/Gemfile index 201bb44..0450ffa 100644 --- a/Gemfile +++ b/Gemfile @@ -73,7 +73,7 @@ group :test do end gem "phlex-rails" -gem "phlex_ui", github: "PhlexUI/phlex_ui", branch: "ch/add-form-component" +gem "phlex_ui", github: "PhlexUI/phlex_ui", branch: "v1" # gem "phlex_ui", path: "../phlex_ui" gem "dockerfile-rails", ">= 1.6", group: :development diff --git a/Gemfile.lock b/Gemfile.lock index fb0bdb7..d3004f9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ GIT remote: https://github.com/PhlexUI/phlex_ui.git - revision: 8197c46331678d969b071ce0c0ded83d24ae73cb - branch: ch/add-form-component + revision: 9fdaf51c734dc357cdf031ea664dca3af6fdcfda + branch: v1 specs: phlex_ui (0.1.10) phlex (~> 1.10) diff --git a/app/views/docs/form_view.rb b/app/views/docs/form_view.rb index 9dc345a..f3598b0 100644 --- a/app/views/docs/form_view.rb +++ b/app/views/docs/form_view.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class Docs::FormView < ApplicationView + @@code_example = nil + def view_template 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.") @@ -8,7 +10,7 @@ def view_template TypographyH2 { "Usage" } render Docs::VisualCodeExample.new(title: "Example", context: self) do - <<~RUBY + @@code_example = <<~RUBY Form(class: "w-2/3 space-y-6") do FormField do FormFieldLabel { "Default error" } @@ -21,24 +23,125 @@ def view_template RUBY end - render Docs::ComponentsTable.new(components) - end - end + render Docs::VisualCodeExample.new(title: "Custom error message", context: self) do + <<~RUBY + Form(class: "w-2/3 space-y-6") do + FormField do + FormFieldLabel { "Custom error message" } + Input(placeholder: "joel@drapper.me", required: true, data_value_missing: "Custom error message") + FormFieldError() + end + Button(type: "submit") { "Save" } + end + RUBY + end + + render Docs::VisualCodeExample.new(title: "Backend error", context: self) do + <<~RUBY + Form(class: "w-2/3 space-y-6") do + FormField do + FormFieldLabel { "Backend error" } + Input(placeholder: "Joel Drapper", required: true) + FormFieldError { "Error from backend" } + end + Button(type: "submit") { "Save" } + end + RUBY + 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) - ] + render Docs::VisualCodeExample.new(title: "Checkbox", context: self) do + <<~RUBY + Form(class: "w-2/3 space-y-6") do + FormField do + Checkbox(required: true) + label( + class: + "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" + ) { " Accept terms and conditions " } + FormFieldError() + end + Button(type: "submit") { "Save" } + end + RUBY + end + + render Docs::VisualCodeExample.new(title: "Select", context: self) do + <<~RUBY + Form(class: "w-2/3 space-y-6") do + FormField do + FormFieldLabel { "Select" } + Select do + SelectInput(required: true) + SelectTrigger do + SelectValue(placeholder: "Select a fruit") + end + SelectContent() do + SelectGroup do + SelectLabel { "Fruits" } + SelectItem(value: "apple") { "Apple" } + SelectItem(value: "orange") { "Orange" } + SelectItem(value: "banana") { "Banana" } + SelectItem(value: "watermelon") { "Watermelon" } + end + end + end + FormFieldError() + end + Button(type: "submit") { "Save" } + end + RUBY + end + + render Docs::VisualCodeExample.new(title: "Combobox", context: self) do + <<~RUBY + Form(class: "w-2/3 space-y-6") do + FormField do + FormFieldLabel { "Combobox" } + Combobox do + ComboboxInput(required: true) + ComboboxTrigger do + ComboboxValue(placeholder: "Select event...") + end + ComboboxContent do + ComboboxSearchInput(placeholder: "Search event...") + ComboboxList do + ComboboxEmpty { "No results found." } + ComboboxGroup(heading: "Suggestions") do + ComboboxItem(value: "railsworld") do + span { "Rails World" } + end + ComboboxItem(value: "tropicalrb") do + span { "Tropical.rb" } + end + ComboboxItem(value: "friendly.rb") do + span { "Friendly.rb" } + end + end + + ComboboxSeparator() + + ComboboxGroup(heading: "Others") do + ComboboxItem(value: "railsconf") do + span { "RailsConf" } + end + ComboboxItem(value: "euruko") do + span { "Euruko" } + end + ComboboxItem(value: "rubykaigi") do + span { "RubyKaigi" } + end + end + end + end + end + FormFieldError() + end + Button(type: "submit") { "Save" } + end + RUBY + end + + render Docs::ComponentsTable.new(components("Form", @@code_example), component_files("Form")) + end end end diff --git a/package.json b/package.json index 7be5349..b01d7ae 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "lottie-web": "5.12.2", "phlex_ui": "https://github.com/PhlexUI/phlex_ui_stimulus.git", "postcss": "8.4.40", - "rbui-js": "https://github.com/PhlexUI/phlex_ui.git#ch/add-form-component", + "rbui-js": "https://github.com/PhlexUI/phlex_ui.git#v1", "tailwindcss": "3.4.7", "tailwindcss-animate": "1.0.7" }, diff --git a/test/components/previews/phlex_ui/date_picker_preview.rb b/test/components/previews/phlex_ui/date_picker_preview.rb index 9d84c09..f6d16e7 100644 --- a/test/components/previews/phlex_ui/date_picker_preview.rb +++ b/test/components/previews/phlex_ui/date_picker_preview.rb @@ -10,7 +10,7 @@ def default Popover(options: {trigger: "focusin"}) do PopoverTrigger(class: "w-full") do div(class: "grid w-full max-w-sm items-center gap-1.5") do - Label(for: "date") { "Select a date" } + label(for: "date") { "Select a date" } Input(type: "string", placeholder: "Select a date", class: "rounded-md border shadow", id: "date", data_controller: "input") end end diff --git a/test/components/previews/phlex_ui/input_preview.rb b/test/components/previews/phlex_ui/input_preview.rb deleted file mode 100644 index 4f91c7d..0000000 --- a/test/components/previews/phlex_ui/input_preview.rb +++ /dev/null @@ -1,73 +0,0 @@ -# frozen_string_literal: true - -module PhlexUi - class InputPreview < Lookbook::Preview - # Email Input - # --------------- - def email - render(TestView.new) do - Input(type: "email", placeholder: "Email", class: "max-w-sm") - end - end - - # File input - def file - render(TestView.new) do - FormItem do - Label(for: "picture") { "Picture" } - Input(type: "file", id: "picture") - end - end - end - - # Disabled input - def disabled - render(TestView.new) do - Input(disabled: true, type: "email", placeholder: "Email", class: "max-w-sm") - end - end - - # with label - def with_label - render(TestView.new) do - FormItem do - Label(for: "email1") { "Email" } - Input(type: "email", placeholder: "Email", id: "email1") - end - end - end - - # with error - def with_error - render(TestView.new) do - FormItem do - Label(for: "email1") { "Email" } - Input( - type: "email", - placeholder: "Email", - id: "email1", - value: "joel@mail", - error: "Invalid email address" - ) - end - end - end - - # with button - def with_button - render(TestView.new) do - Form(class: "w-full max-w-sm") do - FormSpacer do - FormItem do - Label(for: "username") { "Username" } - Input(type: "string", placeholder: "Username", id: "username") - Hint { "Can only contain letters, numbers, and underscores." } - end - - Button(type: "submit") { "Submit" } - end - end - end - end - end -end diff --git a/test/components/previews/phlex_ui/popover_preview.rb b/test/components/previews/phlex_ui/popover_preview.rb index a914815..0dd9c92 100644 --- a/test/components/previews/phlex_ui/popover_preview.rb +++ b/test/components/previews/phlex_ui/popover_preview.rb @@ -55,8 +55,8 @@ def trigger end Link(href: "#", variant: :ghost, class: "block w-full justify-start pl-2") do - link.plain(helpers.lucide_icon("log-out", class: "w-4 h-4 mr-2")) - link.plain("Logout") + plain(helpers.lucide_icon("log-out", class: "w-4 h-4 mr-2")) + plain("Logout") end end end diff --git a/test/components/previews/phlex_ui/sheet_preview.rb b/test/components/previews/phlex_ui/sheet_preview.rb index f81ba2d..70f16f3 100644 --- a/test/components/previews/phlex_ui/sheet_preview.rb +++ b/test/components/previews/phlex_ui/sheet_preview.rb @@ -18,17 +18,11 @@ def default(side: :top, size: "") Form do SheetMiddle do - FormSpacer do - FormItem do - Label { "Name" } - Input(placeholder: "Joel Drapper") { "Joel Drapper" } - end + label { "Name" } + Input(placeholder: "Joel Drapper") { "Joel Drapper" } - FormItem do - Label { "Email" } - Input(placeholder: "joel@drapper.me") - end - end + label { "Email" } + Input(placeholder: "joel@drapper.me") end SheetFooter do diff --git a/test/components/previews/phlex_ui/accordion_preview.rb b/test/components/previews/rbui/accordion_preview.rb similarity index 97% rename from test/components/previews/phlex_ui/accordion_preview.rb rename to test/components/previews/rbui/accordion_preview.rb index e08b2b2..39ace09 100644 --- a/test/components/previews/phlex_ui/accordion_preview.rb +++ b/test/components/previews/rbui/accordion_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module PhlexUi +module Rbui class AccordionPreview < Lookbook::Preview ITEMS = [ {title: "Item 1", content: "Content 1"}, diff --git a/test/components/previews/phlex_ui/checkbox_preview.rb b/test/components/previews/rbui/checkbox_preview.rb similarity index 93% rename from test/components/previews/phlex_ui/checkbox_preview.rb rename to test/components/previews/rbui/checkbox_preview.rb index 259a410..736ba17 100644 --- a/test/components/previews/phlex_ui/checkbox_preview.rb +++ b/test/components/previews/rbui/checkbox_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module PhlexUi +module Rbui class CheckboxPreview < Lookbook::Preview # Default Checkbox # --------------- diff --git a/test/components/previews/rbui/combobox_preview.rb b/test/components/previews/rbui/combobox_preview.rb new file mode 100644 index 0000000..c2c5ef8 --- /dev/null +++ b/test/components/previews/rbui/combobox_preview.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +module Rbui + class ComboboxPreview < Lookbook::Preview + # Default Combobox + # --------------- + def default + render(TestView.new) do + div(class: "w-96") do + Combobox do + ComboboxInput() + ComboboxTrigger do + ComboboxValue(placeholder: "Select event...") + end + ComboboxContent do + ComboboxSearchInput(placeholder: "Search event...") + ComboboxList do + ComboboxEmpty { "No results found." } + ComboboxGroup(heading: "Suggestions") do + ComboboxItem(value: "railsworld") do + span { "Rails World" } + end + ComboboxItem(value: "tropicalrb") do + span { "Tropical.rb" } + end + ComboboxItem(value: "friendly.rb") do + span { "Friendly.rb" } + end + end + + ComboboxSeparator() + + ComboboxGroup(heading: "Others") do + ComboboxItem(value: "railsconf") do + span { "RailsConf" } + end + ComboboxItem(value: "euruko") do + span { "Euruko" } + end + ComboboxItem(value: "rubykaigi") do + span { "RubyKaigi" } + end + end + end + end + end + end + end + end + end +end diff --git a/test/components/previews/rbui/form_preview.rb b/test/components/previews/rbui/form_preview.rb new file mode 100644 index 0000000..5013321 --- /dev/null +++ b/test/components/previews/rbui/form_preview.rb @@ -0,0 +1,148 @@ +# frozen_string_literal: true + +module Rbui + class FormPreview < Lookbook::Preview + # Default Form + # --------------- + def default + render(TestView.new) do + Form(class: "w-2/3 space-y-6 w-64") do + FormField do + FormFieldLabel { "Default error" } + Input(placeholder: "Joel Drapper", required: true, minlength: "3") { "Joel Drapper" } + FormFieldHint() + FormFieldError() + end + Button(type: "submit") { "Save" } + end + end + end + + # Custom error message + # --------------- + def custom_error_message + render(TestView.new) do + Form(class: "w-2/3 space-y-6 w-64") do + FormField do + FormFieldLabel { "Custom error message" } + Input(placeholder: "joel@drapper.me", required: true, data_value_missing: "Custom error message") + FormFieldError() + end + Button(type: "submit") { "Save" } + end + end + end + + # Error from backend + # --------------- + def error_from_backend + render(TestView.new) do + Form(class: "w-2/3 space-y-6 w-64") do + FormField do + FormFieldLabel { "Backend error" } + Input(placeholder: "Joel Drapper", required: true) + FormFieldError { "Error from backend" } + end + Button(type: "submit") { "Save" } + end + end + end + + # Checkbox + # --------------- + def checkbox + render(TestView.new) do + Form(class: "w-2/3 space-y-6 w-64") do + FormField do + Checkbox(required: true) + label(class: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70") do + "Accept terms and conditions" + end + FormFieldError() + end + Button(type: "submit") { "Save" } + end + end + end + + # Select + # --------------- + def select + render(TestView.new) do + Form(class: "w-2/3 space-y-6 w-64") do + FormField do + FormFieldLabel { "Select" } + Select do + SelectInput(required: true) + SelectTrigger do + SelectValue(placeholder: "Select a fruit") + end + SelectContent() do + SelectGroup do + SelectLabel { "Fruits" } + SelectItem(value: "apple") { "Apple" } + SelectItem(value: "orange") { "Orange" } + SelectItem(value: "banana") { "Banana" } + SelectItem(value: "watermelon") { "Watermelon" } + end + end + end + FormFieldError() + end + Button(type: "submit") { "Save" } + end + end + end + + # Combobox + # --------------- + def combobox + render(TestView.new) do + Form(class: "w-2/3 space-y-6") do + FormField do + FormFieldLabel { "Combobox" } + Combobox do + ComboboxInput(required: true) + ComboboxTrigger do + ComboboxValue(placeholder: "Select event...") + end + ComboboxContent do + ComboboxSearchInput(placeholder: "Search event...") + ComboboxList do + ComboboxEmpty { "No results found." } + ComboboxGroup(heading: "Suggestions") do + ComboboxItem(value: "railsworld") do + span { "Rails World" } + end + ComboboxItem(value: "tropicalrb") do + span { "Tropical.rb" } + end + ComboboxItem(value: "friendly.rb") do + span { "Friendly.rb" } + end + end + + ComboboxSeparator() + + ComboboxGroup(heading: "Others") do + ComboboxItem(value: "railsconf") do + span { "RailsConf" } + end + ComboboxItem(value: "euruko") do + span { "Euruko" } + end + ComboboxItem(value: "rubykaigi") do + span { "RubyKaigi" } + end + end + end + end + end + FormFieldError() + end + Button(type: "submit") { "Save" } + end + end + end + end +end diff --git a/test/components/previews/rbui/input_preview.rb b/test/components/previews/rbui/input_preview.rb new file mode 100644 index 0000000..8cb4763 --- /dev/null +++ b/test/components/previews/rbui/input_preview.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module Rbui + class InputPreview < Lookbook::Preview + # Email Input + # --------------- + def email + render(TestView.new) do + Input(type: "email", placeholder: "Email", class: "max-w-sm") + end + end + + # File input + def file + render(TestView.new) do + Input(type: "file", id: "picture") + end + end + + # Disabled input + def disabled + render(TestView.new) do + Input(disabled: true, type: "email", placeholder: "Email", class: "max-w-sm") + end + end + + # with error + def with_error + render(TestView.new) do + Input( + type: "email", + placeholder: "Email", + id: "email1", + value: "joel@mail", + error: "Invalid email address" + ) + end + end + end +end diff --git a/test/components/previews/phlex_ui/select_preview.rb b/test/components/previews/rbui/select_preview.rb similarity index 98% rename from test/components/previews/phlex_ui/select_preview.rb rename to test/components/previews/rbui/select_preview.rb index 831ac25..cdf63f1 100644 --- a/test/components/previews/phlex_ui/select_preview.rb +++ b/test/components/previews/rbui/select_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module PhlexUi +module Rbui class SelectPreview < Lookbook::Preview def default render(TestView.new) do diff --git a/test/components/previews/phlex_ui/theme_toggle_preview.rb b/test/components/previews/rbui/theme_toggle_preview.rb similarity index 97% rename from test/components/previews/phlex_ui/theme_toggle_preview.rb rename to test/components/previews/rbui/theme_toggle_preview.rb index 9587dc9..8328bd2 100644 --- a/test/components/previews/phlex_ui/theme_toggle_preview.rb +++ b/test/components/previews/rbui/theme_toggle_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module PhlexUi +module Rbui class ThemeTogglePreview < Lookbook::Preview def default render(TestView.new) do diff --git a/test/components/previews/phlex_ui/tooltip_preview.rb b/test/components/previews/rbui/tooltip_preview.rb similarity index 97% rename from test/components/previews/phlex_ui/tooltip_preview.rb rename to test/components/previews/rbui/tooltip_preview.rb index 3431069..4e03ec1 100644 --- a/test/components/previews/phlex_ui/tooltip_preview.rb +++ b/test/components/previews/rbui/tooltip_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module PhlexUi +module Rbui class TooltipPreview < Lookbook::Preview # Default TooltipPreview # --------------- diff --git a/yarn-error.log b/yarn-error.log index 1490095..3e3343b 100644 --- a/yarn-error.log +++ b/yarn-error.log @@ -1,53 +1,51 @@ Arguments: - /Users/georgekettle/.nvm/versions/node/v16.15.1/bin/node /Users/georgekettle/.nvm/versions/node/v16.15.1/bin/yarn add chroma.js + /Users/cirdes/.asdf/installs/nodejs/20.9.0/bin/node /Users/cirdes/Workspace/phlex/web/.yarn/releases/yarn-1.22.19.cjs PATH: - /Users/georgekettle/.nvm/versions/node/v16.15.1/bin:./bin:./node_modules/.bin:/Users/georgekettle/.pyenv/plugins/pyenv-virtualenv/shims:/Users/georgekettle/.pyenv/shims:/Users/georgekettle/.pyenv/bin:/Users/georgekettle/.rbenv/shims:/Users/georgekettle/.rbenv/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/usr/local/sbin + /Users/cirdes/.asdf/plugins/nodejs/shims:/Users/cirdes/.asdf/installs/nodejs/20.9.0/bin:/Users/cirdes/.asdf/shims:/Users/cirdes/.asdf/bin:/Users/cirdes/.jenv/shims:/Users/cirdes/.jenv/bin:/Users/cirdes/.pyenv/bin:/usr/local/sbin:/usr/local/opt/openjdk/bin:/Users/cirdes/.yarn/bin:/Users/cirdes/.config/yarn/global/node_modules/.bin:/usr/local/share/google-cloud-sdk/bin:/Applications/Postgres.app/Contents/Versions/latest/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Users/cirdes/.jenv/shims:/Users/cirdes/.jenv/bin:/Users/cirdes/.pyenv/bin:/usr/local/sbin:/usr/local/opt/openjdk/bin:/Users/cirdes/.yarn/bin:/Users/cirdes/.config/yarn/global/node_modules/.bin:/usr/local/share/google-cloud-sdk/bin:/Applications/Postgres.app/Contents/Versions/latest/bin:/Users/cirdes/.cargo/bin:/Applications/iTerm.app/Contents/Resources/utilities Yarn version: 1.22.19 Node version: - 16.15.1 + 20.9.0 Platform: - darwin arm64 + darwin x64 Trace: - Error: https://registry.npmjs.org/chroma.js: Not found - at Request.params.callback [as _callback] (/Users/georgekettle/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:66145:18) - at Request.self.callback (/Users/georgekettle/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:140890:22) - at Request.emit (node:events:527:28) - at Request. (/Users/georgekettle/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:141862:10) - at Request.emit (node:events:527:28) - at IncomingMessage. (/Users/georgekettle/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:141784:12) - at Object.onceWrapper (node:events:641:28) - at IncomingMessage.emit (node:events:539:35) - at endReadableNT (node:internal/streams/readable:1345:12) - at processTicksAndRejections (node:internal/process/task_queues:83:21) + SyntaxError: /Users/cirdes/Workspace/phlex/web/package.json: Expected double-quoted property name in JSON at position 401 + at JSON.parse () + at /Users/cirdes/Workspace/phlex/web/.yarn/releases/yarn-1.22.19.cjs:1104:57 + at Generator.next () + at step (/Users/cirdes/Workspace/phlex/web/.yarn/releases/yarn-1.22.19.cjs:310:30) + at /Users/cirdes/Workspace/phlex/web/.yarn/releases/yarn-1.22.19.cjs:321:13 npm manifest: { "name": "app", "private": "true", "dependencies": { - "@hotwired/stimulus": "^3.2.2", - "@hotwired/turbo-rails": "^7.3.0", - "autoprefixer": "^10.4.16", - "chart.js": "^4.4.1", - "class-variance-authority": "^0.7.0", - "clsx": "^2.0.0", - "esbuild": "^0.19.4", - "lottie-web": "^5.12.2", - "phlex_ui": "^0.1.1", - "postcss": "^8.4.31", - "tailwindcss": "^3.3.3", - "tailwindcss-animate": "^1.0.7" + "@hotwired/stimulus": "3.2.2", + "@hotwired/turbo-rails": "8.0.5", + "autoprefixer": "10.4.19", + "chart.js": "4.4.3", + "class-variance-authority": "0.7.0", + "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": "https://github.com/PhlexUI/phlex_ui.git#ch/add-form-component", + "rbui-js": "../web", + "tailwindcss": "3.4.7", + "tailwindcss-animate": "1.0.7" }, "scripts": { - "build": "esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=/assets", + "build": "esbuild app/javascript/*.* --bundle --sourcemap --format=esm --outdir=app/assets/builds --public-path=/assets", "build:css": "tailwindcss -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css --minify" - } + }, + "packageManager": "yarn@1.22.19" } yarn manifest: @@ -64,139 +62,169 @@ Lockfile: integrity sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw== "@babel/runtime@^7.21.0": - version "7.23.5" - resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.5.tgz#11edb98f8aeec529b82b211028177679144242db" - integrity sha512-NdUTHcPe4C99WxPub+K9l9tK5/lV4UXIoaHSYgzco9BCyjKAAwzdBI+wWtYqHt7LJdbo74ZjRPJgzVweq1sz0w== + version "7.25.0" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.25.0.tgz#3af9a91c1b739c569d5d80cc917280919c544ecb" + integrity sha512-7dRy4DwXwtzBrPbZflqxnvfxLF8kdZXPkhymtDeFoFqE6ldzjQFgYTtYIFARcLEYDrqfBfYcZt1WqFxRoyC9Rw== dependencies: regenerator-runtime "^0.14.0" - "@esbuild/android-arm64@0.19.7": - version "0.19.7" - resolved "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.7.tgz#646156aea43e8e6723de6e94a4ac07c5aed41be1" - integrity sha512-YEDcw5IT7hW3sFKZBkCAQaOCJQLONVcD4bOyTXMZz5fr66pTHnAet46XAtbXAkJRfIn2YVhdC6R9g4xa27jQ1w== - - "@esbuild/android-arm@0.19.7": - version "0.19.7" - resolved "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.7.tgz#0827b49aed813c33ea18ee257c1728cdc4a01030" - integrity sha512-YGSPnndkcLo4PmVl2tKatEn+0mlVMr3yEpOOT0BeMria87PhvoJb5dg5f5Ft9fbCVgtAz4pWMzZVgSEGpDAlww== - - "@esbuild/android-x64@0.19.7": - version "0.19.7" - resolved "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.7.tgz#fa294ed5214d88219d519e0ab1bbb0253a89b864" - integrity sha512-jhINx8DEjz68cChFvM72YzrqfwJuFbfvSxZAk4bebpngGfNNRm+zRl4rtT9oAX6N9b6gBcFaJHFew5Blf6CvUw== - - "@esbuild/darwin-arm64@0.19.7": - version "0.19.7" - resolved "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.7.tgz" - integrity sha512-dr81gbmWN//3ZnBIm6YNCl4p3pjnabg1/ZVOgz2fJoUO1a3mq9WQ/1iuEluMs7mCL+Zwv7AY5e3g1hjXqQZ9Iw== - - "@esbuild/darwin-x64@0.19.7": - version "0.19.7" - resolved "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.7.tgz#02d1f8a572874c90d8f55dde8a859e5145bd06f6" - integrity sha512-Lc0q5HouGlzQEwLkgEKnWcSazqr9l9OdV2HhVasWJzLKeOt0PLhHaUHuzb8s/UIya38DJDoUm74GToZ6Wc7NGQ== - - "@esbuild/freebsd-arm64@0.19.7": - version "0.19.7" - resolved "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.7.tgz#bc6a69b9a7915da278f0a5ebaec069c813982c22" - integrity sha512-+y2YsUr0CxDFF7GWiegWjGtTUF6gac2zFasfFkRJPkMAuMy9O7+2EH550VlqVdpEEchWMynkdhC9ZjtnMiHImQ== - - "@esbuild/freebsd-x64@0.19.7": - version "0.19.7" - resolved "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.7.tgz#ec3708488625d70e565968ceea1355e7c8613865" - integrity sha512-CdXOxIbIzPJmJhrpmJTLx+o35NoiKBIgOvmvT+jeSadYiWJn0vFKsl+0bSG/5lwjNHoIDEyMYc/GAPR9jxusTA== - - "@esbuild/linux-arm64@0.19.7": - version "0.19.7" - resolved "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.7.tgz#8e04b66c306858f92d4f90f8222775270755e88a" - integrity sha512-inHqdOVCkUhHNvuQPT1oCB7cWz9qQ/Cz46xmVe0b7UXcuIJU3166aqSunsqkgSGMtUCWOZw3+KMwI6otINuC9g== - - "@esbuild/linux-arm@0.19.7": - version "0.19.7" - resolved "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.7.tgz#12d5b65e089029ee1fe4c591b60969c9b1a85355" - integrity sha512-Y+SCmWxsJOdQtjcBxoacn/pGW9HDZpwsoof0ttL+2vGcHokFlfqV666JpfLCSP2xLxFpF1lj7T3Ox3sr95YXww== - - "@esbuild/linux-ia32@0.19.7": - version "0.19.7" - resolved "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.7.tgz#01eabc2a3ad9039e115db650268e4f48f910dbe2" - integrity sha512-2BbiL7nLS5ZO96bxTQkdO0euGZIUQEUXMTrqLxKUmk/Y5pmrWU84f+CMJpM8+EHaBPfFSPnomEaQiG/+Gmh61g== - - "@esbuild/linux-loong64@0.19.7": - version "0.19.7" - resolved "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.7.tgz#70681113632970e6a5766607bbdb98aa18cf4d5f" - integrity sha512-BVFQla72KXv3yyTFCQXF7MORvpTo4uTA8FVFgmwVrqbB/4DsBFWilUm1i2Oq6zN36DOZKSVUTb16jbjedhfSHw== - - "@esbuild/linux-mips64el@0.19.7": - version "0.19.7" - resolved "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.7.tgz#f63c022a71a3d70c482d1943a27cb8997021e230" - integrity sha512-DzAYckIaK+pS31Q/rGpvUKu7M+5/t+jI+cdleDgUwbU7KdG2eC3SUbZHlo6Q4P1CfVKZ1lUERRFP8+q0ob9i2w== - - "@esbuild/linux-ppc64@0.19.7": - version "0.19.7" - resolved "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.7.tgz#614eafd08b0c50212f287b948b3c08d6e60f221f" - integrity sha512-JQ1p0SmUteNdUaaiRtyS59GkkfTW0Edo+e0O2sihnY4FoZLz5glpWUQEKMSzMhA430ctkylkS7+vn8ziuhUugQ== - - "@esbuild/linux-riscv64@0.19.7": - version "0.19.7" - resolved "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.7.tgz#31d3b63f92f65968268a8e61ba59872538e80e88" - integrity sha512-xGwVJ7eGhkprY/nB7L7MXysHduqjpzUl40+XoYDGC4UPLbnG+gsyS1wQPJ9lFPcxYAaDXbdRXd1ACs9AE9lxuw== - - "@esbuild/linux-s390x@0.19.7": - version "0.19.7" - resolved "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.7.tgz#be94974e0caa0783ae05f9477fd7170b9ac29cb0" - integrity sha512-U8Rhki5PVU0L0nvk+E8FjkV8r4Lh4hVEb9duR6Zl21eIEYEwXz8RScj4LZWA2i3V70V4UHVgiqMpszXvG0Yqhg== - - "@esbuild/linux-x64@0.19.7": - version "0.19.7" - resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.7.tgz#84e8018a913dd4ecee954623e395984aef3d0007" - integrity sha512-ZYZopyLhm4mcoZXjFt25itRlocKlcazDVkB4AhioiL9hOWhDldU9n38g62fhOI4Pth6vp+Mrd5rFKxD0/S+7aQ== - - "@esbuild/netbsd-x64@0.19.7": - version "0.19.7" - resolved "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.7.tgz#98898ba8800374c9df9bb182ca4f69fcecaf4411" - integrity sha512-/yfjlsYmT1O3cum3J6cmGG16Fd5tqKMcg5D+sBYLaOQExheAJhqr8xOAEIuLo8JYkevmjM5zFD9rVs3VBcsjtQ== - - "@esbuild/openbsd-x64@0.19.7": - version "0.19.7" - resolved "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.7.tgz#46dc4eda2adb51f16361b1ad10e9b3f4938c4573" - integrity sha512-MYDFyV0EW1cTP46IgUJ38OnEY5TaXxjoDmwiTXPjezahQgZd+j3T55Ht8/Q9YXBM0+T9HJygrSRGV5QNF/YVDQ== - - "@esbuild/sunos-x64@0.19.7": - version "0.19.7" - resolved "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.7.tgz#1650d40dd88412ecc11490119cd23cbaf661a591" - integrity sha512-JcPvgzf2NN/y6X3UUSqP6jSS06V0DZAV/8q0PjsZyGSXsIGcG110XsdmuWiHM+pno7/mJF6fjH5/vhUz/vA9fw== - - "@esbuild/win32-arm64@0.19.7": - version "0.19.7" - resolved "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.7.tgz#e61de6c4eb204d83fd912f3ae6812cc8c7d32d25" - integrity sha512-ZA0KSYti5w5toax5FpmfcAgu3ZNJxYSRm0AW/Dao5up0YV1hDVof1NvwLomjEN+3/GMtaWDI+CIyJOMTRSTdMw== - - "@esbuild/win32-ia32@0.19.7": - version "0.19.7" - resolved "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.7.tgz#3d9c159d42c67e37a433e44ef8217c661cb6f6d0" - integrity sha512-CTOnijBKc5Jpk6/W9hQMMvJnsSYRYgveN6O75DTACCY18RA2nqka8dTZR+x/JqXCRiKk84+5+bRKXUSbbwsS0A== - - "@esbuild/win32-x64@0.19.7": - version "0.19.7" - resolved "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.7.tgz#02c4446f802706098d8e6ee70cf2b7aba96ded0b" - integrity sha512-gRaP2sk6hc98N734luX4VpF318l3w+ofrtTu9j5L8EQXF+FzQKV6alCOHMVoJJHvVK/mGbwBXfOL1HETQu9IGQ== - - "@hotwired/stimulus@^3.2.2": + "@esbuild/aix-ppc64@0.23.0": + version "0.23.0" + resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.23.0.tgz#145b74d5e4a5223489cabdc238d8dad902df5259" + integrity sha512-3sG8Zwa5fMcA9bgqB8AfWPQ+HFke6uD3h1s3RIwUNK8EG7a4buxvuFTs3j1IMs2NXAk9F30C/FF4vxRgQCcmoQ== + + "@esbuild/android-arm64@0.23.0": + version "0.23.0" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.23.0.tgz#453bbe079fc8d364d4c5545069e8260228559832" + integrity sha512-EuHFUYkAVfU4qBdyivULuu03FhJO4IJN9PGuABGrFy4vUuzk91P2d+npxHcFdpUnfYKy0PuV+n6bKIpHOB3prQ== + + "@esbuild/android-arm@0.23.0": + version "0.23.0" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.23.0.tgz#26c806853aa4a4f7e683e519cd9d68e201ebcf99" + integrity sha512-+KuOHTKKyIKgEEqKbGTK8W7mPp+hKinbMBeEnNzjJGyFcWsfrXjSTNluJHCY1RqhxFurdD8uNXQDei7qDlR6+g== + + "@esbuild/android-x64@0.23.0": + version "0.23.0" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.23.0.tgz#1e51af9a6ac1f7143769f7ee58df5b274ed202e6" + integrity sha512-WRrmKidLoKDl56LsbBMhzTTBxrsVwTKdNbKDalbEZr0tcsBgCLbEtoNthOW6PX942YiYq8HzEnb4yWQMLQuipQ== + + "@esbuild/darwin-arm64@0.23.0": + version "0.23.0" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.23.0.tgz#d996187a606c9534173ebd78c58098a44dd7ef9e" + integrity sha512-YLntie/IdS31H54Ogdn+v50NuoWF5BDkEUFpiOChVa9UnKpftgwzZRrI4J132ETIi+D8n6xh9IviFV3eXdxfow== + + "@esbuild/darwin-x64@0.23.0": + version "0.23.0" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.23.0.tgz#30c8f28a7ef4e32fe46501434ebe6b0912e9e86c" + integrity sha512-IMQ6eme4AfznElesHUPDZ+teuGwoRmVuuixu7sv92ZkdQcPbsNHzutd+rAfaBKo8YK3IrBEi9SLLKWJdEvJniQ== + + "@esbuild/freebsd-arm64@0.23.0": + version "0.23.0" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.23.0.tgz#30f4fcec8167c08a6e8af9fc14b66152232e7fb4" + integrity sha512-0muYWCng5vqaxobq6LB3YNtevDFSAZGlgtLoAc81PjUfiFz36n4KMpwhtAd4he8ToSI3TGyuhyx5xmiWNYZFyw== + + "@esbuild/freebsd-x64@0.23.0": + version "0.23.0" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.23.0.tgz#1003a6668fe1f5d4439e6813e5b09a92981bc79d" + integrity sha512-XKDVu8IsD0/q3foBzsXGt/KjD/yTKBCIwOHE1XwiXmrRwrX6Hbnd5Eqn/WvDekddK21tfszBSrE/WMaZh+1buQ== + + "@esbuild/linux-arm64@0.23.0": + version "0.23.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.23.0.tgz#3b9a56abfb1410bb6c9138790f062587df3e6e3a" + integrity sha512-j1t5iG8jE7BhonbsEg5d9qOYcVZv/Rv6tghaXM/Ug9xahM0nX/H2gfu6X6z11QRTMT6+aywOMA8TDkhPo8aCGw== + + "@esbuild/linux-arm@0.23.0": + version "0.23.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.23.0.tgz#237a8548e3da2c48cd79ae339a588f03d1889aad" + integrity sha512-SEELSTEtOFu5LPykzA395Mc+54RMg1EUgXP+iw2SJ72+ooMwVsgfuwXo5Fn0wXNgWZsTVHwY2cg4Vi/bOD88qw== + + "@esbuild/linux-ia32@0.23.0": + version "0.23.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.23.0.tgz#4269cd19cb2de5de03a7ccfc8855dde3d284a238" + integrity sha512-P7O5Tkh2NbgIm2R6x1zGJJsnacDzTFcRWZyTTMgFdVit6E98LTxO+v8LCCLWRvPrjdzXHx9FEOA8oAZPyApWUA== + + "@esbuild/linux-loong64@0.23.0": + version "0.23.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.23.0.tgz#82b568f5658a52580827cc891cb69d2cb4f86280" + integrity sha512-InQwepswq6urikQiIC/kkx412fqUZudBO4SYKu0N+tGhXRWUqAx+Q+341tFV6QdBifpjYgUndV1hhMq3WeJi7A== + + "@esbuild/linux-mips64el@0.23.0": + version "0.23.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.23.0.tgz#9a57386c926262ae9861c929a6023ed9d43f73e5" + integrity sha512-J9rflLtqdYrxHv2FqXE2i1ELgNjT+JFURt/uDMoPQLcjWQA5wDKgQA4t/dTqGa88ZVECKaD0TctwsUfHbVoi4w== + + "@esbuild/linux-ppc64@0.23.0": + version "0.23.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.23.0.tgz#f3a79fd636ba0c82285d227eb20ed8e31b4444f6" + integrity sha512-cShCXtEOVc5GxU0fM+dsFD10qZ5UpcQ8AM22bYj0u/yaAykWnqXJDpd77ublcX6vdDsWLuweeuSNZk4yUxZwtw== + + "@esbuild/linux-riscv64@0.23.0": + version "0.23.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.23.0.tgz#f9d2ef8356ce6ce140f76029680558126b74c780" + integrity sha512-HEtaN7Y5UB4tZPeQmgz/UhzoEyYftbMXrBCUjINGjh3uil+rB/QzzpMshz3cNUxqXN7Vr93zzVtpIDL99t9aRw== + + "@esbuild/linux-s390x@0.23.0": + version "0.23.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.23.0.tgz#45390f12e802201f38a0229e216a6aed4351dfe8" + integrity sha512-WDi3+NVAuyjg/Wxi+o5KPqRbZY0QhI9TjrEEm+8dmpY9Xir8+HE/HNx2JoLckhKbFopW0RdO2D72w8trZOV+Wg== + + "@esbuild/linux-x64@0.23.0": + version "0.23.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.23.0.tgz#c8409761996e3f6db29abcf9b05bee8d7d80e910" + integrity sha512-a3pMQhUEJkITgAw6e0bWA+F+vFtCciMjW/LPtoj99MhVt+Mfb6bbL9hu2wmTZgNd994qTAEw+U/r6k3qHWWaOQ== + + "@esbuild/netbsd-x64@0.23.0": + version "0.23.0" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.23.0.tgz#ba70db0114380d5f6cfb9003f1d378ce989cd65c" + integrity sha512-cRK+YDem7lFTs2Q5nEv/HHc4LnrfBCbH5+JHu6wm2eP+d8OZNoSMYgPZJq78vqQ9g+9+nMuIsAO7skzphRXHyw== + + "@esbuild/openbsd-arm64@0.23.0": + version "0.23.0" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-arm64/-/openbsd-arm64-0.23.0.tgz#72fc55f0b189f7a882e3cf23f332370d69dfd5db" + integrity sha512-suXjq53gERueVWu0OKxzWqk7NxiUWSUlrxoZK7usiF50C6ipColGR5qie2496iKGYNLhDZkPxBI3erbnYkU0rQ== + + "@esbuild/openbsd-x64@0.23.0": + version "0.23.0" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.23.0.tgz#b6ae7a0911c18fe30da3db1d6d17a497a550e5d8" + integrity sha512-6p3nHpby0DM/v15IFKMjAaayFhqnXV52aEmv1whZHX56pdkK+MEaLoQWj+H42ssFarP1PcomVhbsR4pkz09qBg== + + "@esbuild/sunos-x64@0.23.0": + version "0.23.0" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.23.0.tgz#58f0d5e55b9b21a086bfafaa29f62a3eb3470ad8" + integrity sha512-BFelBGfrBwk6LVrmFzCq1u1dZbG4zy/Kp93w2+y83Q5UGYF1d8sCzeLI9NXjKyujjBBniQa8R8PzLFAUrSM9OA== + + "@esbuild/win32-arm64@0.23.0": + version "0.23.0" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.23.0.tgz#b858b2432edfad62e945d5c7c9e5ddd0f528ca6d" + integrity sha512-lY6AC8p4Cnb7xYHuIxQ6iYPe6MfO2CC43XXKo9nBXDb35krYt7KGhQnOkRGar5psxYkircpCqfbNDB4uJbS2jQ== + + "@esbuild/win32-ia32@0.23.0": + version "0.23.0" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.23.0.tgz#167ef6ca22a476c6c0c014a58b4f43ae4b80dec7" + integrity sha512-7L1bHlOTcO4ByvI7OXVI5pNN6HSu6pUQq9yodga8izeuB1KcT2UkHaH6118QJwopExPn0rMHIseCTx1CRo/uNA== + + "@esbuild/win32-x64@0.23.0": + version "0.23.0" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.23.0.tgz#db44a6a08520b5f25bbe409f34a59f2d4bcc7ced" + integrity sha512-Arm+WgUFLUATuoxCJcahGuk6Yj9Pzxd6l11Zb/2aAuv5kWWvvfhLFo2fni4uSK5vzlUdCGZ/BdV5tH8klj8p8g== + + "@floating-ui/core@^1.6.0": + version "1.6.7" + resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-1.6.7.tgz#7602367795a390ff0662efd1c7ae8ca74e75fb12" + integrity sha512-yDzVT/Lm101nQ5TCVeK65LtdN7Tj4Qpr9RTXJ2vPFLqtLxwOrpoxAHAJI8J3yYWUc40J0BDBheaitK5SJmno2g== + dependencies: + "@floating-ui/utils" "^0.2.7" + + "@floating-ui/dom@^1.6.8": + version "1.6.10" + resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-1.6.10.tgz#b74c32f34a50336c86dcf1f1c845cf3a39e26d6f" + integrity sha512-fskgCFv8J8OamCmyun8MfjB1Olfn+uZKjOKZ0vhYF3gRmEUXcGOjxWL8bBr7i4kIuPZ2KD2S3EUIOxnjC8kl2A== + dependencies: + "@floating-ui/core" "^1.6.0" + "@floating-ui/utils" "^0.2.7" + + "@floating-ui/utils@^0.2.7": + version "0.2.7" + resolved "https://registry.yarnpkg.com/@floating-ui/utils/-/utils-0.2.7.tgz#d0ece53ce99ab5a8e37ebdfe5e32452a2bfc073e" + integrity sha512-X8R8Oj771YRl/w+c1HqAC1szL8zWQRwFvgDwT129k9ACdBoud/+/rX9V0qiMl6LWUdP9voC2nDVZYPMQQsb6eA== + + "@hotwired/stimulus@3.2.2", "@hotwired/stimulus@^3.2.2": version "3.2.2" - resolved "https://registry.npmjs.org/@hotwired/stimulus/-/stimulus-3.2.2.tgz" + resolved "https://registry.yarnpkg.com/@hotwired/stimulus/-/stimulus-3.2.2.tgz#071aab59c600fed95b97939e605ff261a4251608" integrity sha512-eGeIqNOQpXoPAIP7tC1+1Yc1yl1xnwYqg+3mzqxyrbE5pg5YFBZcA6YoTiByJB6DKAEsiWtl6tjTJS4IYtbB7A== - "@hotwired/turbo-rails@^7.3.0": - version "7.3.0" - resolved "https://registry.npmjs.org/@hotwired/turbo-rails/-/turbo-rails-7.3.0.tgz" - integrity sha512-fvhO64vp/a2UVQ3jue9WTc2JisMv9XilIC7ViZmXAREVwiQ2S4UC7Go8f9A1j4Xu7DBI6SbFdqILk5ImqVoqyA== + "@hotwired/turbo-rails@8.0.5": + version "8.0.5" + resolved "https://registry.yarnpkg.com/@hotwired/turbo-rails/-/turbo-rails-8.0.5.tgz#18c2f0e4f7f952307650308590edf5eb9544b0d3" + integrity sha512-1A9G9u28IRAl0C57z8Ka3AhNPyJdwfOrbjr+ABZk2ZEUw2QO7cJ0pgs77asUj2E/tzn1PgrxrSVu24W+1Q5uBA== dependencies: - "@hotwired/turbo" "^7.3.0" + "@hotwired/turbo" "^8.0.5" "@rails/actioncable" "^7.0" - "@hotwired/turbo@^7.3.0": - version "7.3.0" - resolved "https://registry.npmjs.org/@hotwired/turbo/-/turbo-7.3.0.tgz" - integrity sha512-Dcu+NaSvHLT7EjrDrkEmH4qET2ZJZ5IcCWmNXxNQTBwlnE5tBZfN6WxZ842n5cHV52DH/AKNirbPBtcEXDLW4g== + "@hotwired/turbo@^8.0.5": + version "8.0.5" + resolved "https://registry.yarnpkg.com/@hotwired/turbo/-/turbo-8.0.5.tgz#abae6dad018a891e4286e87fa0959217e3866d5a" + integrity sha512-TdZDA7fxVQ2ZycygvpnzjGPmFq4sO/E2QVg+2em/sJ3YTSsIWVEis8HmWlumz+c9DjWcUkcCuB+muF08TInpAQ== "@jridgewell/gen-mapping@^0.3.2": version "0.3.3" @@ -232,78 +260,62 @@ Lockfile: "@kurkle/color@^0.3.0": version "0.3.2" - resolved "https://registry.npmjs.org/@kurkle/color/-/color-0.3.2.tgz#5acd38242e8bde4f9986e7913c8fdf49d3aa199f" + resolved "https://registry.npmjs.org/@kurkle/color/-/color-0.3.2.tgz" integrity sha512-fuscdXJ9G1qb7W8VdHi+IwRqij3lBkosAm4ydQtEmbY58OzHXqQhvlxqEkoz0yssNVn38bcpRWgA9PP+OGoisw== - "@motionone/animation@^10.16.3": - version "10.16.3" - resolved "https://registry.npmjs.org/@motionone/animation/-/animation-10.16.3.tgz#f5b71e27fd8b88b61f983adb0ed6c8e3e89281f9" - integrity sha512-QUGWpLbMFLhyqKlngjZhjtxM8IqiJQjLK0DF+XOF6od9nhSvlaeEpOY/UMCRVcZn/9Tr2rZO22EkuCIjYdI74g== + "@motionone/animation@^10.18.0": + version "10.18.0" + resolved "https://registry.yarnpkg.com/@motionone/animation/-/animation-10.18.0.tgz#868d00b447191816d5d5cf24b1cafa144017922b" + integrity sha512-9z2p5GFGCm0gBsZbi8rVMOAJCtw1WqBTIPw3ozk06gDvZInBPIsQcHgYogEJ4yuHJ+akuW8g1SEIOpTOvYs8hw== dependencies: - "@motionone/easing" "^10.16.3" - "@motionone/types" "^10.16.3" - "@motionone/utils" "^10.16.3" + "@motionone/easing" "^10.18.0" + "@motionone/types" "^10.17.1" + "@motionone/utils" "^10.18.0" tslib "^2.3.1" - "@motionone/dom@^10.16.4": - version "10.16.4" - resolved "https://registry.npmjs.org/@motionone/dom/-/dom-10.16.4.tgz#9385716928cc2d5b3208a7dcaf504b69b47fd1ae" - integrity sha512-HPHlVo/030qpRj9R8fgY50KTN4Ko30moWRTA3L3imrsRBmob93cTYmodln49HYFbQm01lFF7X523OkKY0DX6UA== + "@motionone/dom@^10.18.0": + version "10.18.0" + resolved "https://registry.yarnpkg.com/@motionone/dom/-/dom-10.18.0.tgz#7fd25dac04cab72def6d2b92b8e0cdc091576527" + integrity sha512-bKLP7E0eyO4B2UaHBBN55tnppwRnaE3KFfh3Ps9HhnAkar3Cb69kUCJY9as8LrccVYKgHA+JY5dOQqJLOPhF5A== dependencies: - "@motionone/animation" "^10.16.3" - "@motionone/generators" "^10.16.4" - "@motionone/types" "^10.16.3" - "@motionone/utils" "^10.16.3" + "@motionone/animation" "^10.18.0" + "@motionone/generators" "^10.18.0" + "@motionone/types" "^10.17.1" + "@motionone/utils" "^10.18.0" hey-listen "^1.0.8" tslib "^2.3.1" - "@motionone/easing@^10.16.3": - version "10.16.3" - resolved "https://registry.npmjs.org/@motionone/easing/-/easing-10.16.3.tgz#a62abe0ba2841861f167f286782e287eab8d7466" - integrity sha512-HWTMZbTmZojzwEuKT/xCdvoMPXjYSyQvuVM6jmM0yoGU6BWzsmYMeB4bn38UFf618fJCNtP9XeC/zxtKWfbr0w== - dependencies: - "@motionone/utils" "^10.16.3" - tslib "^2.3.1" - - "@motionone/generators@^10.16.4": - version "10.16.4" - resolved "https://registry.npmjs.org/@motionone/generators/-/generators-10.16.4.tgz#4a38708244bce733bfcebd4a26d19f4bbabd36af" - integrity sha512-geFZ3w0Rm0ZXXpctWsSf3REGywmLLujEjxPYpBR0j+ymYwof0xbV6S5kGqqsDKgyWKVWpUInqQYvQfL6fRbXeg== + "@motionone/easing@^10.18.0": + version "10.18.0" + resolved "https://registry.yarnpkg.com/@motionone/easing/-/easing-10.18.0.tgz#7b82f6010dfee3a1bb0ee83abfbaff6edae0c708" + integrity sha512-VcjByo7XpdLS4o9T8t99JtgxkdMcNWD3yHU/n6CLEz3bkmKDRZyYQ/wmSf6daum8ZXqfUAgFeCZSpJZIMxaCzg== dependencies: - "@motionone/types" "^10.16.3" - "@motionone/utils" "^10.16.3" + "@motionone/utils" "^10.18.0" tslib "^2.3.1" - "@motionone/svelte@^10.16.4": - version "10.16.4" - resolved "https://registry.npmjs.org/@motionone/svelte/-/svelte-10.16.4.tgz#5daf117cf5b2576fc6dd487c5e0500938a742470" - integrity sha512-zRVqk20lD1xqe+yEDZhMYgftsuHc25+9JSo+r0a0OWUJFocjSV9D/+UGhX4xgJsuwB9acPzXLr20w40VnY2PQA== + "@motionone/generators@^10.18.0": + version "10.18.0" + resolved "https://registry.yarnpkg.com/@motionone/generators/-/generators-10.18.0.tgz#fe09ab5cfa0fb9a8884097feb7eb60abeb600762" + integrity sha512-+qfkC2DtkDj4tHPu+AFKVfR/C30O1vYdvsGYaR13W/1cczPrrcjdvYCj0VLFuRMN+lP1xvpNZHCRNM4fBzn1jg== dependencies: - "@motionone/dom" "^10.16.4" + "@motionone/types" "^10.17.1" + "@motionone/utils" "^10.18.0" tslib "^2.3.1" - "@motionone/types@^10.16.3": - version "10.16.3" - resolved "https://registry.npmjs.org/@motionone/types/-/types-10.16.3.tgz#9284ea8a52f6b32c51c54b617214f20e43ac6c59" - integrity sha512-W4jkEGFifDq73DlaZs3HUfamV2t1wM35zN/zX7Q79LfZ2sc6C0R1baUHZmqc/K5F3vSw3PavgQ6HyHLd/MXcWg== + "@motionone/types@^10.17.1": + version "10.17.1" + resolved "https://registry.yarnpkg.com/@motionone/types/-/types-10.17.1.tgz#cf487badbbdc9da0c2cb86ffc1e5d11147c6e6fb" + integrity sha512-KaC4kgiODDz8hswCrS0btrVrzyU2CSQKO7Ps90ibBVSQmjkrt2teqta6/sOG59v7+dPnKMAg13jyqtMKV2yJ7A== - "@motionone/utils@^10.16.3": - version "10.16.3" - resolved "https://registry.npmjs.org/@motionone/utils/-/utils-10.16.3.tgz#ddf07ab6cf3000d89e3bcbdc9a8c3e1fd64f8520" - integrity sha512-WNWDksJIxQkaI9p9Z9z0+K27xdqISGNFy1SsWVGaiedTHq0iaT6iZujby8fT/ZnZxj1EOaxJtSfUPCFNU5CRoA== + "@motionone/utils@^10.18.0": + version "10.18.0" + resolved "https://registry.yarnpkg.com/@motionone/utils/-/utils-10.18.0.tgz#a59ff8932ed9009624bca07c56b28ef2bb2f885e" + integrity sha512-3XVF7sgyTSI2KWvTf6uLlBJ5iAgRgmvp3bpuOiQJvInd4nZ19ET8lX5unn30SlmRH7hXbBbH+Gxd0m0klJ3Xtw== dependencies: - "@motionone/types" "^10.16.3" + "@motionone/types" "^10.17.1" hey-listen "^1.0.8" tslib "^2.3.1" - "@motionone/vue@^10.16.4": - version "10.16.4" - resolved "https://registry.npmjs.org/@motionone/vue/-/vue-10.16.4.tgz#07d09e3aa5115ca0bcc0076cb9e5322775277c09" - integrity sha512-z10PF9JV6SbjFq+/rYabM+8CVlMokgl8RFGvieSGNTmrkQanfHn+15XBrhG3BgUfvmTeSeyShfOHpG0i9zEdcg== - dependencies: - "@motionone/dom" "^10.16.4" - tslib "^2.3.1" - "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz" @@ -327,7 +339,7 @@ Lockfile: "@popperjs/core@^2.9.0": version "2.11.8" - resolved "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz#6b79032e760a0899cd4204710beede972a3a185f" + resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.8.tgz#6b79032e760a0899cd4204710beede972a3a185f" integrity sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A== "@rails/actioncable@^7.0": @@ -353,14 +365,14 @@ Lockfile: resolved "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz" integrity sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg== - autoprefixer@^10.4.16: - version "10.4.16" - resolved "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.16.tgz" - integrity sha512-7vd3UC6xKp0HLfua5IjZlcXvGAGy7cBAXTg2lyQ/8WpNhd6SiZ8Be+xm3FyBSYJx5GKcpRCzBh7RH4/0dnY+uQ== + autoprefixer@10.4.19: + version "10.4.19" + resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.19.tgz#ad25a856e82ee9d7898c59583c1afeb3fa65f89f" + integrity sha512-BaENR2+zBZ8xXhM4pUaKUxlVdxZ0EZhjvbopwnXmxRUfqDmwSpC2lAi/QXvx7NRdPCo1WKEcEF6mV64si1z4Ew== dependencies: - browserslist "^4.21.10" - caniuse-lite "^1.0.30001538" - fraction.js "^4.3.6" + browserslist "^4.23.0" + caniuse-lite "^1.0.30001599" + fraction.js "^4.3.7" normalize-range "^0.1.2" picocolors "^1.0.0" postcss-value-parser "^4.2.0" @@ -390,30 +402,30 @@ Lockfile: dependencies: fill-range "^7.0.1" - browserslist@^4.21.10: - version "4.22.1" - resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.22.1.tgz" - integrity sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ== + browserslist@^4.23.0: + version "4.23.2" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.23.2.tgz#244fe803641f1c19c28c48c4b6ec9736eb3d32ed" + integrity sha512-qkqSyistMYdxAcw+CzbZwlBy8AGmS/eEWs+sEV5TnLRGDOL+C5M2EnH6tlZyg0YoAxGJAFKh61En9BR941GnHA== dependencies: - caniuse-lite "^1.0.30001541" - electron-to-chromium "^1.4.535" - node-releases "^2.0.13" - update-browserslist-db "^1.0.13" + caniuse-lite "^1.0.30001640" + electron-to-chromium "^1.4.820" + node-releases "^2.0.14" + update-browserslist-db "^1.1.0" camelcase-css@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz" integrity sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA== - caniuse-lite@^1.0.30001538, caniuse-lite@^1.0.30001541: - version "1.0.30001564" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001564.tgz" - integrity sha512-DqAOf+rhof+6GVx1y+xzbFPeOumfQnhYzVnZD6LAXijR77yPtm9mfOcqOnT3mpnJiZVT+kwLAFnRlZcIz+c6bg== + caniuse-lite@^1.0.30001599, caniuse-lite@^1.0.30001640: + version "1.0.30001643" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001643.tgz#9c004caef315de9452ab970c3da71085f8241dbd" + integrity sha512-ERgWGNleEilSrHM6iUz/zJNSQTP8Mr21wDWpdgvRwcTXGAq6jMtOUPP4dqFPTdKqZ2wKTdtB+uucZ3MRpAUSmg== - chart.js@^4.4.1: - version "4.4.1" - resolved "https://registry.npmjs.org/chart.js/-/chart.js-4.4.1.tgz#ac5dc0e69a7758909158a96fe80ce43b3bb96a9f" - integrity sha512-C74QN1bxwV1v2PEujhmKjOZ7iUM4w6BWs23Md/6aOZZSlwMzeCIDGuZay++rBgChYru7/+QFeoQW0fQoP534Dg== + chart.js@4.4.3, chart.js@^4.4.1: + version "4.4.3" + resolved "https://registry.yarnpkg.com/chart.js/-/chart.js-4.4.3.tgz#3b2e11e7010fefa99b07d0349236f5098e5226ad" + integrity sha512-qK1gkGSRYcJzqrrzdR6a+I0vQ4/R+SoODXyAjscQ/4mzuNzySaMCd+hyVxitSY1+L2fjPD1Gbn+ibNqRmwQeLw== dependencies: "@kurkle/color" "^0.3.0" @@ -432,18 +444,23 @@ Lockfile: optionalDependencies: fsevents "~2.3.2" - class-variance-authority@^0.7.0: + class-variance-authority@0.7.0: version "0.7.0" - resolved "https://registry.npmjs.org/class-variance-authority/-/class-variance-authority-0.7.0.tgz" + resolved "https://registry.yarnpkg.com/class-variance-authority/-/class-variance-authority-0.7.0.tgz#1c3134d634d80271b1837452b06d821915954522" integrity sha512-jFI8IQw4hczaL4ALINxqLEXQbWcNjoSkloa4IaufXCJr6QawJyw7tuRysRsrE8w2p/4gGaxKIt/hX3qz/IbD1A== dependencies: clsx "2.0.0" - clsx@2.0.0, clsx@^2.0.0: + clsx@2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/clsx/-/clsx-2.0.0.tgz" integrity sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q== + clsx@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/clsx/-/clsx-2.1.1.tgz#eed397c9fd8bd882bfb18deab7102049a2f32999" + integrity sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA== + commander@^4.0.0: version "4.1.1" resolved "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz" @@ -461,7 +478,7 @@ Lockfile: date-fns@^2.30.0: version "2.30.0" - resolved "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz#f367e644839ff57894ec6ac480de40cae4b0f4d0" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.30.0.tgz#f367e644839ff57894ec6ac480de40cae4b0f4d0" integrity sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw== dependencies: "@babel/runtime" "^7.21.0" @@ -476,47 +493,49 @@ Lockfile: resolved "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz" integrity sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA== - electron-to-chromium@^1.4.535: - version "1.4.590" - resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.590.tgz" - integrity sha512-hohItzsQcG7/FBsviCYMtQwUSWvVF7NVqPOnJCErWsAshsP/CR2LAXdmq276RbESNdhxiAq5/vRo1g2pxGXVww== + electron-to-chromium@^1.4.820: + version "1.5.2" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.2.tgz#6126ad229ce45e781ec54ca40db0504787f23d19" + integrity sha512-kc4r3U3V3WLaaZqThjYz/Y6z8tJe+7K0bbjUVo3i+LWIypVdMx5nXCkwRe6SWbY6ILqLdc1rKcKmr3HoH7wjSQ== - esbuild@^0.19.4: - version "0.19.7" - resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.19.7.tgz" - integrity sha512-6brbTZVqxhqgbpqBR5MzErImcpA0SQdoKOkcWK/U30HtQxnokIpG3TX2r0IJqbFUzqLjhU/zC1S5ndgakObVCQ== + esbuild@0.23.0: + version "0.23.0" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.23.0.tgz#de06002d48424d9fdb7eb52dbe8e95927f852599" + integrity sha512-1lvV17H2bMYda/WaFb2jLPeHU3zml2k4/yagNMG8Q/YtfMjCwEUZa2eXXMgZTVSL5q1n4H7sQ0X6CdJDqqeCFA== optionalDependencies: - "@esbuild/android-arm" "0.19.7" - "@esbuild/android-arm64" "0.19.7" - "@esbuild/android-x64" "0.19.7" - "@esbuild/darwin-arm64" "0.19.7" - "@esbuild/darwin-x64" "0.19.7" - "@esbuild/freebsd-arm64" "0.19.7" - "@esbuild/freebsd-x64" "0.19.7" - "@esbuild/linux-arm" "0.19.7" - "@esbuild/linux-arm64" "0.19.7" - "@esbuild/linux-ia32" "0.19.7" - "@esbuild/linux-loong64" "0.19.7" - "@esbuild/linux-mips64el" "0.19.7" - "@esbuild/linux-ppc64" "0.19.7" - "@esbuild/linux-riscv64" "0.19.7" - "@esbuild/linux-s390x" "0.19.7" - "@esbuild/linux-x64" "0.19.7" - "@esbuild/netbsd-x64" "0.19.7" - "@esbuild/openbsd-x64" "0.19.7" - "@esbuild/sunos-x64" "0.19.7" - "@esbuild/win32-arm64" "0.19.7" - "@esbuild/win32-ia32" "0.19.7" - "@esbuild/win32-x64" "0.19.7" - - escalade@^3.1.1: - version "3.1.1" - resolved "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz" - integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + "@esbuild/aix-ppc64" "0.23.0" + "@esbuild/android-arm" "0.23.0" + "@esbuild/android-arm64" "0.23.0" + "@esbuild/android-x64" "0.23.0" + "@esbuild/darwin-arm64" "0.23.0" + "@esbuild/darwin-x64" "0.23.0" + "@esbuild/freebsd-arm64" "0.23.0" + "@esbuild/freebsd-x64" "0.23.0" + "@esbuild/linux-arm" "0.23.0" + "@esbuild/linux-arm64" "0.23.0" + "@esbuild/linux-ia32" "0.23.0" + "@esbuild/linux-loong64" "0.23.0" + "@esbuild/linux-mips64el" "0.23.0" + "@esbuild/linux-ppc64" "0.23.0" + "@esbuild/linux-riscv64" "0.23.0" + "@esbuild/linux-s390x" "0.23.0" + "@esbuild/linux-x64" "0.23.0" + "@esbuild/netbsd-x64" "0.23.0" + "@esbuild/openbsd-arm64" "0.23.0" + "@esbuild/openbsd-x64" "0.23.0" + "@esbuild/sunos-x64" "0.23.0" + "@esbuild/win32-arm64" "0.23.0" + "@esbuild/win32-ia32" "0.23.0" + "@esbuild/win32-x64" "0.23.0" + + escalade@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.2.tgz#54076e9ab29ea5bf3d8f1ed62acffbb88272df27" + integrity sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA== fast-glob@^3.3.0: version "3.3.2" - resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow== dependencies: "@nodelib/fs.stat" "^2.0.2" @@ -539,9 +558,9 @@ Lockfile: dependencies: to-regex-range "^5.0.1" - fraction.js@^4.3.6: + fraction.js@^4.3.7: version "4.3.7" - resolved "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz" + resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.3.7.tgz#06ca0085157e42fda7f9e726e79fefc4068840f7" integrity sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew== fs.realpath@^1.0.0: @@ -561,7 +580,7 @@ Lockfile: fuse.js@^7.0.0: version "7.0.0" - resolved "https://registry.npmjs.org/fuse.js/-/fuse.js-7.0.0.tgz#6573c9fcd4c8268e403b4fc7d7131ffcf99a9eb2" + resolved "https://registry.yarnpkg.com/fuse.js/-/fuse.js-7.0.0.tgz#6573c9fcd4c8268e403b4fc7d7131ffcf99a9eb2" integrity sha512-14F4hBIxqKvD4Zz/XjDc3y94mNZN6pRv3U13Udo0lNLCWRBUsrMv2xwcF/y/Z5sV6+FQW+/ow68cHpm4sunt8Q== glob-parent@^5.1.2, glob-parent@~5.1.2: @@ -599,7 +618,7 @@ Lockfile: hey-listen@^1.0.8: version "1.0.8" - resolved "https://registry.npmjs.org/hey-listen/-/hey-listen-1.0.8.tgz#8e59561ff724908de1aa924ed6ecc84a56a9aa68" + resolved "https://registry.yarnpkg.com/hey-listen/-/hey-listen-1.0.8.tgz#8e59561ff724908de1aa924ed6ecc84a56a9aa68" integrity sha512-COpmrF2NOg4TBWUJ5UVyaCU2A88wEMkUPK4hNqyCkqHbxT92BbvfjoSozkAIIm6XhicGlJHhFdullInrdhwU8Q== inflight@^1.0.4: @@ -646,10 +665,10 @@ Lockfile: resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - jiti@^1.19.1: - version "1.21.0" - resolved "https://registry.npmjs.org/jiti/-/jiti-1.21.0.tgz" - integrity sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q== + jiti@^1.21.0: + version "1.21.6" + resolved "https://registry.yarnpkg.com/jiti/-/jiti-1.21.6.tgz#6c7f7398dd4b3142767f9a168af2f317a428d268" + integrity sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w== lilconfig@^2.1.0: version "2.1.0" @@ -666,9 +685,9 @@ Lockfile: resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz" integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== - lottie-web@^5.12.2: + lottie-web@5.12.2: version "5.12.2" - resolved "https://registry.npmjs.org/lottie-web/-/lottie-web-5.12.2.tgz#579ca9fe6d3fd9e352571edd3c0be162492f68e5" + resolved "https://registry.yarnpkg.com/lottie-web/-/lottie-web-5.12.2.tgz#579ca9fe6d3fd9e352571edd3c0be162492f68e5" integrity sha512-uvhvYPC8kGPjXT3MyKMrL3JitEAmDMp30lVkuq/590Mw9ok6pWcFCwXJveo0t5uqYw1UREQHofD+jVpdjBv8wg== merge2@^1.3.0: @@ -692,20 +711,18 @@ Lockfile: brace-expansion "^1.1.7" motion@^10.16.4: - version "10.16.4" - resolved "https://registry.npmjs.org/motion/-/motion-10.16.4.tgz#247cba1072db546c788130b5e15b5e62a95e8b10" - integrity sha512-wvBeT0sZNgU6Od1aimjywBikqzm5yE97+L9eM/AoLy01AXNPdcnSDVHB3CoR0dGdHMbp/S0A/PjsJfWg0+k8Mg== + version "10.18.0" + resolved "https://registry.yarnpkg.com/motion/-/motion-10.18.0.tgz#8fd035cc3a668800fe7e2479568eeb98af484ab3" + integrity sha512-MVAZZmwM/cp77BrNe1TxTMldxRPjwBNHheU5aPToqT4rJdZxLiADk58H+a0al5jKLxkB0OdgNq6DiVn11cjvIQ== dependencies: - "@motionone/animation" "^10.16.3" - "@motionone/dom" "^10.16.4" - "@motionone/svelte" "^10.16.4" - "@motionone/types" "^10.16.3" - "@motionone/utils" "^10.16.3" - "@motionone/vue" "^10.16.4" + "@motionone/animation" "^10.18.0" + "@motionone/dom" "^10.18.0" + "@motionone/types" "^10.17.1" + "@motionone/utils" "^10.18.0" mustache@^4.2.0: version "4.2.0" - resolved "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz#e5892324d60a12ec9c2a73359edca52972bf6f64" + resolved "https://registry.yarnpkg.com/mustache/-/mustache-4.2.0.tgz#e5892324d60a12ec9c2a73359edca52972bf6f64" integrity sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ== mz@^2.7.0: @@ -717,15 +734,15 @@ Lockfile: object-assign "^4.0.1" thenify-all "^1.0.0" - nanoid@^3.3.6: + nanoid@^3.3.6, nanoid@^3.3.7: version "3.3.7" - resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8" integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g== - node-releases@^2.0.13: - version "2.0.13" - resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz" - integrity sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ== + node-releases@^2.0.14: + version "2.0.18" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.18.tgz#f010e8d35e2fe8d6b2944f03f70213ecedc4ca3f" + integrity sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g== normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" @@ -764,12 +781,12 @@ Lockfile: resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== - phlex_ui@^0.1.1: - version "0.1.1" - resolved "https://registry.npmjs.org/phlex_ui/-/phlex_ui-0.1.1.tgz#f7cebf4381be0cf02614aa09f11012ce4643bcfb" - integrity sha512-5DnZjt/LCt54RNre1GE05UhykddryEWTGM9/aFsaDYOeiQ1iPmhwKIfvSp/NmDlkINNM5j9f016DwB4kfqscsQ== + "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" @@ -781,6 +798,11 @@ Lockfile: resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== + picocolors@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.1.tgz#a8ad579b571952f0e5d25892de5445bcfe25aaa1" + integrity sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew== + picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz" @@ -840,7 +862,16 @@ Lockfile: resolved "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz" integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== - postcss@^8.4.23, postcss@^8.4.31: + postcss@8.4.40: + version "8.4.40" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.40.tgz#eb81f2a4dd7668ed869a6db25999e02e9ad909d8" + integrity sha512-YF2kKIUzAofPMpfH6hOi2cGnv/HrUlfucspc7pDyvv7kGdqXrfj8SCl/t8owkEgKEuu8ZcRjSOxFxVLqwChZ2Q== + dependencies: + nanoid "^3.3.7" + picocolors "^1.0.1" + source-map-js "^1.2.0" + + postcss@^8.4.23: version "8.4.31" resolved "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz" integrity sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ== @@ -854,6 +885,19 @@ Lockfile: resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== + "rbui-js@https://github.com/PhlexUI/phlex_ui.git#ch/add-form-component": + version "0.0.1-alpha.0" + resolved "https://github.com/PhlexUI/phlex_ui.git#8197c46331678d969b071ce0c0ded83d24ae73cb" + 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" @@ -869,9 +913,9 @@ Lockfile: picomatch "^2.2.1" regenerator-runtime@^0.14.0: - version "0.14.0" - resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz#5e19d68eb12d486f797e15a3c6a918f7cec5eb45" - integrity sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA== + version "0.14.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" + integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== resolve@^1.1.7, resolve@^1.22.2: version "1.22.8" @@ -899,6 +943,11 @@ Lockfile: resolved "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz" integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== + source-map-js@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.0.tgz#16b809c162517b5b8c3e7dcd315a2a5c2612b2af" + integrity sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg== + sucrase@^3.32.0: version "3.34.0" resolved "https://registry.npmjs.org/sucrase/-/sucrase-3.34.0.tgz" @@ -917,15 +966,15 @@ Lockfile: resolved "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== - tailwindcss-animate@^1.0.7: + tailwindcss-animate@1.0.7: version "1.0.7" - resolved "https://registry.npmjs.org/tailwindcss-animate/-/tailwindcss-animate-1.0.7.tgz" + resolved "https://registry.yarnpkg.com/tailwindcss-animate/-/tailwindcss-animate-1.0.7.tgz#318b692c4c42676cc9e67b19b78775742388bef4" integrity sha512-bl6mpH3T7I3UFxuvDEXLxy/VuFxBk5bbzplh7tXI68mwMokNYd1t9qPBHlnyTwfa4JGC4zP516I1hYYtQ/vspA== - tailwindcss@^3.3.3: - version "3.3.5" - resolved "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.3.5.tgz" - integrity sha512-5SEZU4J7pxZgSkv7FP1zY8i2TIAOooNZ1e/OGtxIEv6GltpoiXUqWvLy89+a10qYTB1N5Ifkuw9lqQkN9sscvA== + tailwindcss@3.4.7: + version "3.4.7" + resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.4.7.tgz#6092f18767f5933f59375b9afe558e592fc77201" + integrity sha512-rxWZbe87YJb4OcSopb7up2Ba4U82BoiSGUdoDr3Ydrg9ckxFS/YWsvhN323GMcddgU65QRy7JndC7ahhInhvlQ== dependencies: "@alloc/quick-lru" "^5.2.0" arg "^5.0.2" @@ -935,7 +984,7 @@ Lockfile: fast-glob "^3.3.0" glob-parent "^6.0.2" is-glob "^4.0.3" - jiti "^1.19.1" + jiti "^1.21.0" lilconfig "^2.1.0" micromatch "^4.0.5" normalize-path "^3.0.0" @@ -966,7 +1015,7 @@ Lockfile: tippy.js@^6.3.7: version "6.3.7" - resolved "https://registry.npmjs.org/tippy.js/-/tippy.js-6.3.7.tgz#8ccfb651d642010ed9a32ff29b0e9e19c5b8c61c" + resolved "https://registry.yarnpkg.com/tippy.js/-/tippy.js-6.3.7.tgz#8ccfb651d642010ed9a32ff29b0e9e19c5b8c61c" integrity sha512-E1d3oP2emgJ9dRQZdf3Kkn0qJgI6ZLpyS5z6ZkY1DF3kaQaBsGZsndEpHwx+eC+tYM41HaSNvNtLx8tU57FzTQ== dependencies: "@popperjs/core" "^2.9.0" @@ -984,17 +1033,17 @@ Lockfile: integrity sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA== tslib@^2.3.1: - version "2.6.2" - resolved "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" - integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== - - update-browserslist-db@^1.0.13: - version "1.0.13" - resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz" - integrity sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg== + version "2.6.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.3.tgz#0438f810ad7a9edcde7a241c3d80db693c8cbfe0" + integrity sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ== + + update-browserslist-db@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz#7ca61c0d8650766090728046e416a8cde682859e" + integrity sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ== dependencies: - escalade "^3.1.1" - picocolors "^1.0.0" + escalade "^3.1.2" + picocolors "^1.0.1" util-deprecate@^1.0.2: version "1.0.2" diff --git a/yarn.lock b/yarn.lock index edeb7e7..0ac6aba 100644 --- a/yarn.lock +++ b/yarn.lock @@ -831,9 +831,8 @@ queue-microtask@^1.2.2: resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== -"rbui-js@https://github.com/PhlexUI/phlex_ui.git#ch/add-form-component": +"rbui-js@file:../gem": version "0.0.1-alpha.0" - resolved "https://github.com/PhlexUI/phlex_ui.git#8197c46331678d969b071ce0c0ded83d24ae73cb" dependencies: "@floating-ui/dom" "^1.6.8" "@hotwired/stimulus" "^3.2.2" From 60cde6c345a299e39c150ad46325f76447c3a2b4 Mon Sep 17 00:00:00 2001 From: Cirdes Henrique Date: Sat, 24 Aug 2024 17:13:21 -0300 Subject: [PATCH 16/36] fix linter --- test/components/previews/rbui/form_preview.rb | 2 +- yarn.lock | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/components/previews/rbui/form_preview.rb b/test/components/previews/rbui/form_preview.rb index 5013321..b89f8e1 100644 --- a/test/components/previews/rbui/form_preview.rb +++ b/test/components/previews/rbui/form_preview.rb @@ -55,7 +55,7 @@ def checkbox Form(class: "w-2/3 space-y-6 w-64") do FormField do Checkbox(required: true) - label(class: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70") do + label(class: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70") do "Accept terms and conditions" end FormFieldError() diff --git a/yarn.lock b/yarn.lock index 0ac6aba..8e4c99b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -831,8 +831,9 @@ queue-microtask@^1.2.2: resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== -"rbui-js@file:../gem": +"rbui-js@https://github.com/PhlexUI/phlex_ui.git#v1": version "0.0.1-alpha.0" + resolved "https://github.com/PhlexUI/phlex_ui.git#9fdaf51c734dc357cdf031ea664dca3af6fdcfda" dependencies: "@floating-ui/dom" "^1.6.8" "@hotwired/stimulus" "^3.2.2" From 8413f7fd97707fb018f2d21f6a89194136592963 Mon Sep 17 00:00:00 2001 From: Cirdes Henrique Date: Sun, 25 Aug 2024 09:48:00 -0300 Subject: [PATCH 17/36] fix ci --- Gemfile | 2 +- Gemfile.lock | 2 +- app/views/themes/grid/create_event.rb | 30 +++++++++++++-------------- yarn.lock | 2 +- 4 files changed, 17 insertions(+), 19 deletions(-) diff --git a/Gemfile b/Gemfile index 0450ffa..9e859d1 100644 --- a/Gemfile +++ b/Gemfile @@ -64,6 +64,7 @@ group :development do # Speed up commands on slow machines / big apps [https://github.com/rails/spring] # gem "spring" gem "standard" + gem "dockerfile-rails", ">= 1.6" end group :test do @@ -76,5 +77,4 @@ gem "phlex-rails" gem "phlex_ui", github: "PhlexUI/phlex_ui", branch: "v1" # gem "phlex_ui", path: "../phlex_ui" -gem "dockerfile-rails", ">= 1.6", group: :development gem "pry" diff --git a/Gemfile.lock b/Gemfile.lock index d3004f9..6698b09 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/PhlexUI/phlex_ui.git - revision: 9fdaf51c734dc357cdf031ea664dca3af6fdcfda + revision: 2bfac725d3a97324297a6c8460946e11ff71db45 branch: v1 specs: phlex_ui (0.1.10) diff --git a/app/views/themes/grid/create_event.rb b/app/views/themes/grid/create_event.rb index 51c75f9..a68332f 100644 --- a/app/views/themes/grid/create_event.rb +++ b/app/views/themes/grid/create_event.rb @@ -17,26 +17,24 @@ def view_template def event_form Form(class: "w-full") do - FormSpacer do - FormItem do - Label(for: "name") { "Name" } - Input(type: "string", value: "RuSki conf. Japan", id: "name") - end - FormItem do - Popover(options: {trigger: "focusin"}) do - PopoverTrigger(class: "w-full") do - div(class: "grid w-full max-w-sm items-center gap-1.5") do - Label(for: "date") { "Select a date" } - Input(type: "string", placeholder: "Select a date", class: "rounded-md border shadow", id: "date", data_controller: "input") - end - end - PopoverContent do - Calendar(input_id: "#date") + FormField do + FormFieldLabel(for: "name") { "Name" } + Input(type: "string", value: "RuSki conf. Japan", id: "name") + end + FormField do + Popover(options: {trigger: "focusin"}) do + PopoverTrigger(class: "w-full") do + div(class: "grid w-full max-w-sm items-center gap-1.5") do + FormFieldLabel(for: "date") { "Select a date" } + Input(type: "string", placeholder: "Select a date", class: "rounded-md border shadow", id: "date", data_controller: "input") end end + PopoverContent do + Calendar(input_id: "#date") + end end - Button(type: "submit", class: "w-full") { "Create Event" } end + Button(type: "submit", class: "w-full") { "Create Event" } end end end diff --git a/yarn.lock b/yarn.lock index 8e4c99b..389abc0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -833,7 +833,7 @@ queue-microtask@^1.2.2: "rbui-js@https://github.com/PhlexUI/phlex_ui.git#v1": version "0.0.1-alpha.0" - resolved "https://github.com/PhlexUI/phlex_ui.git#9fdaf51c734dc357cdf031ea664dca3af6fdcfda" + resolved "https://github.com/PhlexUI/phlex_ui.git#2bfac725d3a97324297a6c8460946e11ff71db45" dependencies: "@floating-ui/dom" "^1.6.8" "@hotwired/stimulus" "^3.2.2" From d9da481dd1c797cb2dbbc12bb5136a040bbd1482 Mon Sep 17 00:00:00 2001 From: Cirdes Henrique Date: Sun, 25 Aug 2024 10:34:13 -0300 Subject: [PATCH 18/36] Rails 7.2 upgrade --- Gemfile | 2 +- Gemfile.lock | 112 +++++++++--------- app/assets/images/logo.svg | 29 ++++- app/assets/images/logo_dark.svg | 29 ++++- app/assets/images/logo_dark_phlexui.svg | 3 + app/assets/images/logotest.svg | 28 +++++ app/assets/images/phlexui.svg | 3 + app/mailers/user_mailer.rb | 13 +- app/views/components/docs/header.rb | 3 +- .../components/docs/visual_code_example.rb | 3 +- app/views/components/shared/head.rb | 2 +- app/views/components/shared/logo.rb | 2 +- app/views/components/shared/menu.rb | 1 - app/views/docs/accordion_view.rb | 6 +- app/views/docs/alert_view.rb | 4 +- app/views/docs/calendar_view.rb | 10 +- app/views/docs/card_view.rb | 4 +- app/views/docs/chart_view.rb | 2 +- app/views/docs/collapsible_view.rb | 4 +- app/views/docs/command_view.rb | 10 +- app/views/docs/date_picker_view.rb | 8 +- app/views/docs/dialog_view.rb | 12 +- .../customizing_components_view.rb | 17 +-- .../docs/getting_started/dark_mode_view.rb | 4 +- .../docs/getting_started/introduction_view.rb | 16 +-- .../docs/getting_started/theming_view.rb | 2 +- .../docs/installation/rails_bundler_view.rb | 14 +-- .../installation/rails_importmaps_view.rb | 14 +-- app/views/docs/sheet_view.rb | 10 +- app/views/pages/home_view.rb | 4 +- app/views/themes/grid/card.rb | 2 +- app/views/themes/grid/chat.rb | 9 +- .../previews/phlex_ui/alert_preview.rb | 2 +- .../previews/phlex_ui/collapsible_preview.rb | 2 +- .../previews/phlex_ui/dialog_preview.rb | 4 +- 35 files changed, 214 insertions(+), 176 deletions(-) create mode 100644 app/assets/images/logo_dark_phlexui.svg create mode 100644 app/assets/images/logotest.svg create mode 100644 app/assets/images/phlexui.svg diff --git a/Gemfile b/Gemfile index 9e859d1..8743076 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby "3.3.4" # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" -gem "rails", "~> 7.2.0.beta3" +gem "rails", "7.2.0" # The modern asset pipeline for Rails [https://github.com/rails/propshaft] gem "propshaft", "0.9.0" # Use sqlite3 as the database for Active Record diff --git a/Gemfile.lock b/Gemfile.lock index 6698b09..274be6f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,66 +11,66 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (7.2.0.beta3) - actionpack (= 7.2.0.beta3) - activesupport (= 7.2.0.beta3) + actioncable (7.2.0) + actionpack (= 7.2.0) + activesupport (= 7.2.0) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.2.0.beta3) - actionpack (= 7.2.0.beta3) - activejob (= 7.2.0.beta3) - activerecord (= 7.2.0.beta3) - activestorage (= 7.2.0.beta3) - activesupport (= 7.2.0.beta3) + actionmailbox (7.2.0) + actionpack (= 7.2.0) + activejob (= 7.2.0) + activerecord (= 7.2.0) + activestorage (= 7.2.0) + activesupport (= 7.2.0) mail (>= 2.8.0) - actionmailer (7.2.0.beta3) - actionpack (= 7.2.0.beta3) - actionview (= 7.2.0.beta3) - activejob (= 7.2.0.beta3) - activesupport (= 7.2.0.beta3) + actionmailer (7.2.0) + actionpack (= 7.2.0) + actionview (= 7.2.0) + activejob (= 7.2.0) + activesupport (= 7.2.0) mail (>= 2.8.0) rails-dom-testing (~> 2.2) - actionpack (7.2.0.beta3) - actionview (= 7.2.0.beta3) - activesupport (= 7.2.0.beta3) + actionpack (7.2.0) + actionview (= 7.2.0) + activesupport (= 7.2.0) nokogiri (>= 1.8.5) racc - rack (>= 2.2.4) + rack (>= 2.2.4, < 3.2) rack-session (>= 1.0.1) rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) useragent (~> 0.16) - actiontext (7.2.0.beta3) - actionpack (= 7.2.0.beta3) - activerecord (= 7.2.0.beta3) - activestorage (= 7.2.0.beta3) - activesupport (= 7.2.0.beta3) + actiontext (7.2.0) + actionpack (= 7.2.0) + activerecord (= 7.2.0) + activestorage (= 7.2.0) + activesupport (= 7.2.0) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.2.0.beta3) - activesupport (= 7.2.0.beta3) + actionview (7.2.0) + activesupport (= 7.2.0) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (7.2.0.beta3) - activesupport (= 7.2.0.beta3) + activejob (7.2.0) + activesupport (= 7.2.0) globalid (>= 0.3.6) - activemodel (7.2.0.beta3) - activesupport (= 7.2.0.beta3) - activerecord (7.2.0.beta3) - activemodel (= 7.2.0.beta3) - activesupport (= 7.2.0.beta3) + activemodel (7.2.0) + activesupport (= 7.2.0) + activerecord (7.2.0) + activemodel (= 7.2.0) + activesupport (= 7.2.0) timeout (>= 0.4.0) - activestorage (7.2.0.beta3) - actionpack (= 7.2.0.beta3) - activejob (= 7.2.0.beta3) - activerecord (= 7.2.0.beta3) - activesupport (= 7.2.0.beta3) + activestorage (7.2.0) + actionpack (= 7.2.0) + activejob (= 7.2.0) + activerecord (= 7.2.0) + activesupport (= 7.2.0) marcel (~> 1.0) - activesupport (7.2.0.beta3) + activesupport (7.2.0) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.3.1) @@ -79,6 +79,7 @@ GEM i18n (>= 1.6, < 2) logger (>= 1.4.2) minitest (>= 5.1) + securerandom (>= 0.3) tzinfo (~> 2.0, >= 2.0.5) addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) @@ -212,20 +213,20 @@ GEM rackup (2.1.0) rack (>= 3) webrick (~> 1.8) - rails (7.2.0.beta3) - actioncable (= 7.2.0.beta3) - actionmailbox (= 7.2.0.beta3) - actionmailer (= 7.2.0.beta3) - actionpack (= 7.2.0.beta3) - actiontext (= 7.2.0.beta3) - actionview (= 7.2.0.beta3) - activejob (= 7.2.0.beta3) - activemodel (= 7.2.0.beta3) - activerecord (= 7.2.0.beta3) - activestorage (= 7.2.0.beta3) - activesupport (= 7.2.0.beta3) + rails (7.2.0) + actioncable (= 7.2.0) + actionmailbox (= 7.2.0) + actionmailer (= 7.2.0) + actionpack (= 7.2.0) + actiontext (= 7.2.0) + actionview (= 7.2.0) + activejob (= 7.2.0) + activemodel (= 7.2.0) + activerecord (= 7.2.0) + activestorage (= 7.2.0) + activesupport (= 7.2.0) bundler (>= 1.15.0) - railties (= 7.2.0.beta3) + railties (= 7.2.0) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -233,9 +234,9 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.2.0.beta3) - actionpack (= 7.2.0.beta3) - activesupport (= 7.2.0.beta3) + railties (7.2.0) + actionpack (= 7.2.0) + activesupport (= 7.2.0) irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) @@ -270,6 +271,7 @@ GEM rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (1.13.0) rubyzip (2.3.2) + securerandom (0.3.1) selenium-webdriver (4.23.0) base64 (~> 0.2) logger (~> 1.4) @@ -351,7 +353,7 @@ DEPENDENCIES propshaft (= 0.9.0) pry puma (= 6.4.2) - rails (~> 7.2.0.beta3) + rails (= 7.2.0) selenium-webdriver sqlite3 (>= 1.4) standard diff --git a/app/assets/images/logo.svg b/app/assets/images/logo.svg index 7347ce2..9208468 100644 --- a/app/assets/images/logo.svg +++ b/app/assets/images/logo.svg @@ -1,3 +1,28 @@ - - + + + + + + + RBUI + diff --git a/app/assets/images/logo_dark.svg b/app/assets/images/logo_dark.svg index 5677122..24e22a3 100644 --- a/app/assets/images/logo_dark.svg +++ b/app/assets/images/logo_dark.svg @@ -1,3 +1,28 @@ - - + + + + + + + RBUI + diff --git a/app/assets/images/logo_dark_phlexui.svg b/app/assets/images/logo_dark_phlexui.svg new file mode 100644 index 0000000..5677122 --- /dev/null +++ b/app/assets/images/logo_dark_phlexui.svg @@ -0,0 +1,3 @@ + + + diff --git a/app/assets/images/logotest.svg b/app/assets/images/logotest.svg new file mode 100644 index 0000000..ef3bf1d --- /dev/null +++ b/app/assets/images/logotest.svg @@ -0,0 +1,28 @@ + + + + + + + RBUI + + diff --git a/app/assets/images/phlexui.svg b/app/assets/images/phlexui.svg new file mode 100644 index 0000000..7347ce2 --- /dev/null +++ b/app/assets/images/phlexui.svg @@ -0,0 +1,3 @@ + + + diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index cff73f9..e857f2d 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -4,20 +4,9 @@ def welcome mail( to: @user.email, - subject: "Welcome to PhlexUI" + subject: "Welcome to RBUI" ) do |format| format.html { render Mailers::UserMailer::Welcome.new(user: @user) } end end - - def future_of_phlexui - @user = params[:user] - - mail( - to: @user.email, - subject: "Open Source and the Future of PhlexUI (Retry)" - ) do |format| - format.html { render Mailers::UserMailer::FutureOfPhlexui.new(user: @user) } - end - end end diff --git a/app/views/components/docs/header.rb b/app/views/components/docs/header.rb index 9551140..89961ce 100644 --- a/app/views/components/docs/header.rb +++ b/app/views/components/docs/header.rb @@ -1,10 +1,9 @@ # frozen_string_literal: true class Docs::Header < ApplicationComponent - def initialize(title: nil, description: nil, premium: false) + def initialize(title: nil, description: nil) @title = title @description = description - @premium = premium end def view_template diff --git a/app/views/components/docs/visual_code_example.rb b/app/views/components/docs/visual_code_example.rb index 384b0fa..f8f3823 100644 --- a/app/views/components/docs/visual_code_example.rb +++ b/app/views/components/docs/visual_code_example.rb @@ -1,10 +1,9 @@ # frozen_string_literal: true class Docs::VisualCodeExample < ApplicationComponent - def initialize(title: nil, description: nil, context: nil, premium: false) + def initialize(title: nil, description: nil, context: nil) @title = title @description = description - @premium = premium @context = context end diff --git a/app/views/components/shared/head.rb b/app/views/components/shared/head.rb index c82968a..da90851 100644 --- a/app/views/components/shared/head.rb +++ b/app/views/components/shared/head.rb @@ -5,7 +5,7 @@ class Shared::Head < ApplicationComponent def view_template head do - title { "PhlexUI - Component Library" } + title { "RBUI - Component Library" } meta name: "viewport", content: "width=device-width,initial-scale=1" meta name: "turbo-refresh-method", content: "morph" meta name: "turbo-refresh-scroll", content: "preserve" diff --git a/app/views/components/shared/logo.rb b/app/views/components/shared/logo.rb index a5257bb..89344bf 100644 --- a/app/views/components/shared/logo.rb +++ b/app/views/components/shared/logo.rb @@ -6,7 +6,7 @@ def view_template TypographyH4(class: "flex items-center") { img(src: helpers.image_url("logo.svg"), class: "h-4 block dark:hidden") img(src: helpers.image_url("logo_dark.svg"), class: "h-4 hidden dark:block") - span(class: "sr-only") { "PhlexUI" } + span(class: "sr-only") { "RBUI" } Badge(variant: :amber, size: :sm, class: "ml-2 whitespace-nowrap") { "Pre Release" } } end diff --git a/app/views/components/shared/menu.rb b/app/views/components/shared/menu.rb index ff50dd9..bbe5220 100644 --- a/app/views/components/shared/menu.rb +++ b/app/views/components/shared/menu.rb @@ -98,7 +98,6 @@ def components end def menu_link(component) - component[:premium] ||= false current_path = component[:path] == helpers.request.path a(href: component[:path], class: tokens("group flex w-full items-center rounded-md border border-transparent px-2 py-1 hover:underline", -> { current_path } => "text-foreground font-medium", -> { !current_path } => "text-muted-foreground")) do span(class: "flex items-center gap-x-1") do diff --git a/app/views/docs/accordion_view.rb b/app/views/docs/accordion_view.rb index 377592f..554c542 100644 --- a/app/views/docs/accordion_view.rb +++ b/app/views/docs/accordion_view.rb @@ -33,13 +33,13 @@ def view_template ) end end - p(class: "font-medium") { "What is PhlexUI?" } + p(class: "font-medium") { "What is RBUI?" } end end AccordionContent do p(class: "pl-16 pr-4 pb-4 text-muted-foreground") do - "PhlexUI is a UI component library for Ruby devs who want to build better, faster." + "RBUI is a UI component library for Ruby devs who want to build better, faster." end end end @@ -73,7 +73,7 @@ def view_template AccordionContent do p(class: "pl-16 pr-4 pb-4 text-muted-foreground") do - "Yes, PhlexUI is pure Ruby and works great with Rails. It's a Ruby gem that you can install into your Rails app." + "Yes, RBUI is pure Ruby and works great with Rails. It's a Ruby gem that you can install into your Rails app." end end end diff --git a/app/views/docs/alert_view.rb b/app/views/docs/alert_view.rb index 9469234..3da53af 100644 --- a/app/views/docs/alert_view.rb +++ b/app/views/docs/alert_view.rb @@ -12,7 +12,7 @@ def view_template Alert do rocket_icon AlertTitle { "Pro tip" } - AlertDescription { "With PhlexUI you'll ship faster." } + AlertDescription { "With RBUI you'll ship faster." } end RUBY end @@ -51,7 +51,7 @@ def view_template Alert(variant: :success) do check_icon AlertTitle { "Installation successful" } - AlertDescription { "You're all set to start using PhlexUI in your application." } + AlertDescription { "You're all set to start using RBUI in your application." } end RUBY end diff --git a/app/views/docs/calendar_view.rb b/app/views/docs/calendar_view.rb index aba14d6..dc67513 100644 --- a/app/views/docs/calendar_view.rb +++ b/app/views/docs/calendar_view.rb @@ -1,17 +1,13 @@ # frozen_string_literal: true class Docs::CalendarView < ApplicationView - def initialize - @premium = true - end - def view_template 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.", premium: @premium) + render Docs::Header.new(title: "Calendar", description: "A date field component that allows users to enter and edit date.") TypographyH2.new { "Usage" } - render Docs::VisualCodeExample.new(title: "Connect to input", context: self, premium: @premium) do + render Docs::VisualCodeExample.new(title: "Connect to input", context: self) do <<~RUBY div(class: 'space-y-4') do Input(type: 'string', placeholder: "Select a date", class: 'rounded-md border shadow', id: 'date', data_controller: 'input') @@ -20,7 +16,7 @@ def view_template RUBY end - render Docs::VisualCodeExample.new(title: "Format date", description: "Format dates with date-fns", context: self, premium: @premium) do + render Docs::VisualCodeExample.new(title: "Format date", description: "Format dates with date-fns", context: self) do <<~RUBY div(class: 'space-y-4') do Input(type: 'string', placeholder: "Select a date", class: 'rounded-md border shadow', id: 'formatted-date', data_controller: 'input') diff --git a/app/views/docs/card_view.rb b/app/views/docs/card_view.rb index 3992192..a95f266 100644 --- a/app/views/docs/card_view.rb +++ b/app/views/docs/card_view.rb @@ -11,7 +11,7 @@ def view_template <<~RUBY Card(class: 'w-96') do CardHeader do - CardTitle { 'You might like "PhlexUI"' } + CardTitle { 'You might like "RBUI"' } CardDescription { "@joeldrapper" } end CardContent do @@ -44,7 +44,7 @@ def view_template ) end CardHeader do - CardTitle { 'Introducing PhlexUI' } + CardTitle { 'Introducing RBUI' } CardDescription { "Kickstart your project today!" } end CardFooter(class: 'flex justify-end') do diff --git a/app/views/docs/chart_view.rb b/app/views/docs/chart_view.rb index 7632804..fab8b74 100644 --- a/app/views/docs/chart_view.rb +++ b/app/views/docs/chart_view.rb @@ -8,7 +8,7 @@ def view_template TypographyH2 { "Introduction" } TypographyP do - plain "PhlexUI uses " + plain "RBUI uses " TypographyInlineLink(href: "https://www.chartjs.org/") { "Chart.js" } plain " to render charts. Chart.js is a free open-source JavaScript library for data visualization, which supports 8 chart types: bar, line, area, pie, bubble, radar, polar, and scatter. If you're unfamiliar with Chart.js. We recommend the " TypographyInlineLink(href: "https://www.chartjs.org/docs/latest/getting-started/") { "Getting Started guide" } diff --git a/app/views/docs/collapsible_view.rb b/app/views/docs/collapsible_view.rb index 6ca7b37..bc10a96 100644 --- a/app/views/docs/collapsible_view.rb +++ b/app/views/docs/collapsible_view.rb @@ -30,7 +30,7 @@ def view_template "phlex-ruby/phlex-rails" end div(class: "rounded-md border px-4 py-2 font-mono text-sm shadow-sm") do - "PhlexUI/phlex_ui" + "RBUI/rbui" end end end @@ -61,7 +61,7 @@ def view_template "phlex-ruby/phlex-rails" end div(class: "rounded-md border px-4 py-2 font-mono text-sm shadow-sm") do - "PhlexUI/phlex_ui" + "RBUI/rbui" end end end diff --git a/app/views/docs/command_view.rb b/app/views/docs/command_view.rb index 6e49b33..731b602 100644 --- a/app/views/docs/command_view.rb +++ b/app/views/docs/command_view.rb @@ -1,17 +1,13 @@ # frozen_string_literal: true class Docs::CommandView < ApplicationView - def initialize - @premium = true - end - def view_template 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.", premium: @premium) + render Docs::Header.new(title: "Command", description: "Fast, composable, unstyled command menu for Phlex.") TypographyH2 { "Usage" } - render Docs::VisualCodeExample.new(title: "Example", context: self, premium: @premium) do + render Docs::VisualCodeExample.new(title: "Example", context: self) do <<~RUBY CommandDialog do CommandDialogTrigger do @@ -56,7 +52,7 @@ def view_template RUBY end - render Docs::VisualCodeExample.new(title: "With keybinding", context: self, premium: @premium) do + render Docs::VisualCodeExample.new(title: "With keybinding", context: self) do <<~RUBY CommandDialog do CommandDialogTrigger(keybindings: ['keydown.ctrl+j@window', 'keydown.meta+j@window']) do diff --git a/app/views/docs/date_picker_view.rb b/app/views/docs/date_picker_view.rb index efa0a75..d0fcfb7 100644 --- a/app/views/docs/date_picker_view.rb +++ b/app/views/docs/date_picker_view.rb @@ -1,17 +1,13 @@ # frozen_string_literal: true class Docs::DatePickerView < ApplicationView - def initialize - @premium = true - end - def view_template 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.", premium: @premium) + render Docs::Header.new(title: "Date Picker", description: "A date picker component with input.") TypographyH2 { "Usage" } - render Docs::VisualCodeExample.new(title: "Single Date", context: self, premium: @premium) do + render Docs::VisualCodeExample.new(title: "Single Date", context: self) do <<~RUBY div(class: 'space-y-4 w-[260px]') do Popover(options: { trigger: 'focusin' }) do diff --git a/app/views/docs/dialog_view.rb b/app/views/docs/dialog_view.rb index 4f27bab..61ca03f 100644 --- a/app/views/docs/dialog_view.rb +++ b/app/views/docs/dialog_view.rb @@ -15,8 +15,8 @@ def view_template end DialogContent do DialogHeader do - DialogTitle { "PhlexUI to the rescue" } - DialogDescription { "PhlexUI helps you build accessible standard compliant web apps with ease" } + DialogTitle { "RBUI to the rescue" } + DialogDescription { "RBUI helps you build accessible standard compliant web apps with ease" } end DialogMiddle do AspectRatio(aspect_ratio: "16/9", class: 'rounded-md overflow-hidden border') do @@ -46,8 +46,8 @@ def view_template end DialogContent(size: :sm) do DialogHeader do - DialogTitle { "PhlexUI to the rescue" } - DialogDescription { "PhlexUI helps you build accessible standard compliant web apps with ease" } + DialogTitle { "RBUI to the rescue" } + DialogDescription { "RBUI helps you build accessible standard compliant web apps with ease" } end DialogMiddle do AspectRatio(aspect_ratio: "16/9", class: 'rounded-md overflow-hidden border') do @@ -72,8 +72,8 @@ def view_template end DialogContent(size: :lg) do DialogHeader do - DialogTitle { "PhlexUI to the rescue" } - DialogDescription { "PhlexUI helps you build accessible standard compliant web apps with ease" } + DialogTitle { "RBUI to the rescue" } + DialogDescription { "RBUI helps you build accessible standard compliant web apps with ease" } end DialogMiddle do AspectRatio(aspect_ratio: "16/9", class: 'rounded-md overflow-hidden border') do diff --git a/app/views/docs/getting_started/customizing_components_view.rb b/app/views/docs/getting_started/customizing_components_view.rb index 1be93a1..c614cd5 100644 --- a/app/views/docs/getting_started/customizing_components_view.rb +++ b/app/views/docs/getting_started/customizing_components_view.rb @@ -3,11 +3,11 @@ class Docs::GettingStarted::CustomizingComponentsView < ApplicationView def view_template div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do - render Docs::Header.new(title: "Customizing components", description: "When theming doesn't suffice, PhlexUI allows you to tailor the components to your specific needs.") + render Docs::Header.new(title: "Customizing components", description: "When theming doesn't suffice, RBUI allows you to tailor the components to your specific needs.") div(class: "space-y-4") do TypographyH2 { "Introduction" } - TypographyP { "While theming provides a powerful tool for modifying aspects such as fonts, brand colors, and border attributes, there may be instances where you need to directly customize the components. PhlexUI is designed to facilitate this process with ease." } + TypographyP { "While theming provides a powerful tool for modifying aspects such as fonts, brand colors, and border attributes, there may be instances where you need to directly customize the components. RBUI is designed to facilitate this process with ease." } end div(class: "space-y-4") do @@ -15,19 +15,6 @@ def view_template TypographyP do plain "All components accept any HTML attribute, and will pass it through to the underlying HTML element. This is great for quick changes, or when you need to add a custom class for a one off situation." end - Alert do - puzzle_icon - AlertTitle { "How it works" } - AlertDescription do - plain "When you pass an attribute to a PhlexUI component, it will be processed by the" - TypographyInlineCode { "PhlexUI::AttributeMerger" } - plain " class. You can read more about the " - TypographyInlineLink(href: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/base.rb") { "PhlexUI::Base" } - plain " and the " - TypographyInlineLink(href: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/attribute_merger.rb") { "PhlexUI::AttributeMerger" } - plain " classes on Github." - end - end TypographyLarge { "Adding attributes" } TypographyP do plain "By default, attribute values are added to the existing values of the component. For instance, if you want to make a button span the full width of its container, you can do it like this: " diff --git a/app/views/docs/getting_started/dark_mode_view.rb b/app/views/docs/getting_started/dark_mode_view.rb index b1f11c4..3a20770 100644 --- a/app/views/docs/getting_started/dark_mode_view.rb +++ b/app/views/docs/getting_started/dark_mode_view.rb @@ -7,9 +7,9 @@ def view_template div(class: "space-y-4") do heading2 { "How it works" } - TypographyP { "PhlexUI seamlessly integrates dark mode, a crucial feature for modern applications, enhancing user experience and catering to diverse user preferences." } + TypographyP { "RBUI seamlessly integrates dark mode, a crucial feature for modern applications, enhancing user experience and catering to diverse user preferences." } TypographyP do - plain "PhlexUI is setup to use the " + plain "RBUI is setup to use the " TypographyInlineLink(href: "https://tailwindcss.com/docs/dark-mode#toggling-dark-mode-manually") { "TailwindCSS 'class' strategy" } plain ". This means that you can toggle dark mode by adding or removing the " TypographyInlineCode { "dark" } diff --git a/app/views/docs/getting_started/introduction_view.rb b/app/views/docs/getting_started/introduction_view.rb index 64fef54..fbb6829 100644 --- a/app/views/docs/getting_started/introduction_view.rb +++ b/app/views/docs/getting_started/introduction_view.rb @@ -8,7 +8,7 @@ def view_template div(class: "space-y-4") do TypographyH2 { "About" } TypographyP do - plain "PhlexUI is a UI framework for Ruby developers, built on top of " + plain "RBUI is a UI framework for Ruby developers, built on top of " TypographyInlineLink(href: "http://phlex.fun") { "Phlex" } plain ", " TypographyInlineLink(href: "https://tailwindcss.com") { "TailwindCSS" } @@ -20,7 +20,7 @@ def view_template div(class: "space-y-4") do TypographyH2 { "Core ingredients" } - TypographyP { "PhlexUI is built on top of 3 core ingredients: " } + TypographyP { "RBUI is built on top of 3 core ingredients: " } TypographyList do TypographyListItem(class: "space-y-2") do span(class: "font-bold") { "Phlex" } @@ -38,16 +38,16 @@ def view_template end div(class: "space-y-4") do - TypographyH2 { "Why I built PhlexUI" } + TypographyH2 { "Why I built RBUI" } TypographyP do plain "Many Ruby developers are familiar with " TypographyInlineLink(href: "https://rubyonrails.org") { "Rails" } plain ", and the " TypographyInlineLink(href: "https://guides.rubyonrails.org/layouts_and_rendering.html") { "convention over configuration" } - plain " approach it takes. PhlexUI is built on the same principles, providing a set of components that are easy to use, and easy to customize." + plain " approach it takes. RBUI is built on the same principles, providing a set of components that are easy to use, and easy to customize." end TypographyP do - plain "PhlexUI was born out of a desire for a comprehensive UI framework designed with Ruby developers in mind. While I've previously utilized TailwindUI and other solutions, none seemed to fit just right. The plethora of UI component libraries available for JavaScript frameworks highlighted a gap in the Ruby ecosystem, which PhlexUI aims to fill." + plain "RBUI was born out of a desire for a comprehensive UI framework designed with Ruby developers in mind. While I've previously utilized TailwindUI and other solutions, none seemed to fit just right. The plethora of UI component libraries available for JavaScript frameworks highlighted a gap in the Ruby ecosystem, which RBUI aims to fill." end TypographyP do plain "Upon discovering Phlex, it became clear that it was the ideal foundation for such a library. It offered the potential for a powerful, easy-to-use, and customizable component library when paired with StimulusJS. The goal was to create a tool that leverages the strengths of TailwindCSS and StimulusJS, providing Ruby developers with a comprehensive UI solution that is stylable at the HTML level." @@ -55,7 +55,7 @@ def view_template end div(class: "space-y-4") do - TypographyH2 { "Goals of PhlexUI" } + TypographyH2 { "Goals of RBUI" } TypographyList(numbered: true) do TypographyListItem { "Create a reusable UI component library specifically for Ruby devs" } TypographyListItem { "Enable Ruby devs to create custom and complex UIs without needing to write CSS or JS" } @@ -91,7 +91,7 @@ def view_template div(class: "space-y-4") do TypographyH2 { "Acknowledgments" } - TypographyP { "I'd like to thank the following projects and people for helping me build PhlexUI" } + TypographyP { "I'd like to thank the following projects and people for helping me build RBUI" } TypographyList do TypographyListItem do TypographyInlineLink(href: "https://github.com/joeldrapper") { "Joel Drapper" } @@ -99,7 +99,7 @@ def view_template end TypographyListItem do TypographyInlineLink(href: "https://phlex.fun") { "Phlex" } - plain " - The foundation of PhlexUI." + plain " - The foundation of RBUI." end TypographyListItem do TypographyInlineLink(href: "https://stimulus.hotwired.dev") { "Stimulus JS" } diff --git a/app/views/docs/getting_started/theming_view.rb b/app/views/docs/getting_started/theming_view.rb index 9a1bae2..c7eaadd 100644 --- a/app/views/docs/getting_started/theming_view.rb +++ b/app/views/docs/getting_started/theming_view.rb @@ -23,7 +23,7 @@ def view_template TypographyList do TypographyListItem do span(class: "font-medium") { "Easily customisable design " } - plain "by updating CSS variables, without having to update the PhlexUI component." + plain "by updating CSS variables, without having to update the RBUI component." end TypographyListItem do span(class: "font-medium") { "Simpler implementation " } diff --git a/app/views/docs/installation/rails_bundler_view.rb b/app/views/docs/installation/rails_bundler_view.rb index 0c9b14a..773c2a0 100644 --- a/app/views/docs/installation/rails_bundler_view.rb +++ b/app/views/docs/installation/rails_bundler_view.rb @@ -8,7 +8,7 @@ def initialize def view_template div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do - render Docs::Header.new(title: "Rails - JS Bundler", description: "How to install PhlexUI within a Rails app that employs JS bundling.") + render Docs::Header.new(title: "Rails - JS Bundler", description: "How to install RBUI within a Rails app that employs JS bundling.") TypographyH2(class: "!text-2xl pb-4 border-b") { "Creating a Rails app" } render Steps::Builder.new do |steps| @@ -66,8 +66,8 @@ def view_template # STEP 2 steps.add_step do step_container do - TypographyLarge { "Install PhlexUI gem" } - TypographyP { "Run the following in the terminal to install the PhlexUI Component Library" } + TypographyLarge { "Install RBUI gem" } + TypographyP { "Run the following in the terminal to install the RBUI Component Library" } code = <<~CODE bundle add phlex_ui CODE @@ -77,15 +77,15 @@ def view_template # STEP 3 steps.add_step do step_container do - TypographyLarge { "Include PhlexUI module" } + TypographyLarge { "Include RBUI module" } TypographyP do - plain "Include PhlexUI module in your " + plain "Include RBUI module in your " TypographyInlineCode(class: "whitespace-nowrap") { "application_component.rb" } plain " file" end code = <<~CODE class ApplicationComponent < Phlex::HTML - include PhlexUI + include RBUI end CODE Codeblock(code, syntax: :ruby) @@ -161,7 +161,7 @@ def js_installation steps.add_step do step_container do TypographyLarge { "Install package" } - TypographyP { "Run the following in the terminal to install PhlexUI JS package" } + TypographyP { "Run the following in the terminal to install RBUI JS package" } code = <<~CODE yarn add rbui-js CODE diff --git a/app/views/docs/installation/rails_importmaps_view.rb b/app/views/docs/installation/rails_importmaps_view.rb index f1cdbfc..7052681 100644 --- a/app/views/docs/installation/rails_importmaps_view.rb +++ b/app/views/docs/installation/rails_importmaps_view.rb @@ -8,7 +8,7 @@ def initialize def view_template div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do - render Docs::Header.new(title: "Rails - Importmaps", description: "How to install PhlexUI within a Rails app that uses Importmaps.") + render Docs::Header.new(title: "Rails - Importmaps", description: "How to install RBUI within a Rails app that uses Importmaps.") Alert(variant: :warning) do alert_icon @@ -72,8 +72,8 @@ def view_template # STEP 2 steps.add_step do step_container do - TypographyLarge { "Install PhlexUI gem" } - TypographyP { "Run the following in the terminal to install the PhlexUI Component Library" } + TypographyLarge { "Install RBUI gem" } + TypographyP { "Run the following in the terminal to install the RBUI Component Library" } code = <<~CODE bundle add phlex_ui CODE @@ -83,15 +83,15 @@ def view_template # STEP 3 steps.add_step do step_container do - TypographyLarge { "Include PhlexUI module" } + TypographyLarge { "Include RBUI module" } TypographyP do - plain "Include PhlexUI module in your " + plain "Include RBUI module in your " TypographyInlineCode(class: "whitespace-nowrap") { "application_component.rb" } plain " file" end code = <<~CODE class ApplicationComponent < Phlex::HTML - include PhlexUI + include RBUI end CODE Codeblock(code, syntax: :ruby) @@ -146,7 +146,7 @@ def js_installation steps.add_step do step_container do TypographyLarge { "Install package" } - TypographyP { "Run the following in the terminal to install PhlexUI JS package" } + TypographyP { "Run the following in the terminal to install RBUI JS package" } code = <<~CODE bin/importmap pin rbui-js CODE diff --git a/app/views/docs/sheet_view.rb b/app/views/docs/sheet_view.rb index 1e6f135..315257d 100644 --- a/app/views/docs/sheet_view.rb +++ b/app/views/docs/sheet_view.rb @@ -1,17 +1,13 @@ # frozen_string_literal: true class Docs::SheetView < ApplicationView - def initialize - @premium = true - end - def view_template 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.", premium: @premium) + render Docs::Header.new(title: "Sheet", description: "Extends the Sheet component to display content that complements the main content of the screen.") TypographyH2 { "Usage" } - render Docs::VisualCodeExample.new(title: "Example", context: self, premium: @premium) do + render Docs::VisualCodeExample.new(title: "Example", context: self) do <<~RUBY Sheet do SheetTrigger do @@ -38,7 +34,7 @@ def view_template RUBY end - render Docs::VisualCodeExample.new(title: "Side", description: "Use the side property to indicate the edge of the screen where the component will appear.", context: self, premium: @premium) do + render Docs::VisualCodeExample.new(title: "Side", description: "Use the side property to indicate the edge of the screen where the component will appear.", context: self) do <<~RUBY div(class: 'grid grid-cols-2 gap-4') do # -- TOP -- diff --git a/app/views/pages/home_view.rb b/app/views/pages/home_view.rb index 760a26a..8e7fce6 100644 --- a/app/views/pages/home_view.rb +++ b/app/views/pages/home_view.rb @@ -120,7 +120,7 @@ def view_template render HomeView::Steps.new(steps: steps) end end - render HomeView::Card.new(class: "col-span-6 md:col-span-4", title: "Customer-Centric UX", subtitle: "Create an app experience your users will rave about. PhlexUI ensures that your user's journey is nothing less than memorable.", color: :pink) do |card| + render HomeView::Card.new(class: "col-span-6 md:col-span-4", title: "Customer-Centric UX", subtitle: "Create an app experience your users will rave about. RBUI ensures that your user's journey is nothing less than memorable.", color: :pink) do |card| card.icon do svg( xmlns: "http://www.w3.org/2000/svg", @@ -152,7 +152,7 @@ def view_template end end end - render HomeView::Card.new(class: "col-span-6 sm:col-span-3", title: "Minimal Dependencies", subtitle: "Keep your app lean and mean. With PhlexUI, we use custom built Stimulus.js controllers wherever possible - less package dependencies to worry about.", color: :secondary) do |card| + render HomeView::Card.new(class: "col-span-6 sm:col-span-3", title: "Minimal Dependencies", subtitle: "Keep your app lean and mean. With RBUI, we use custom built Stimulus.js controllers wherever possible - less package dependencies to worry about.", color: :secondary) do |card| card.icon do svg( xmlns: "http://www.w3.org/2000/svg", diff --git a/app/views/themes/grid/card.rb b/app/views/themes/grid/card.rb index 8c5a54c..0d23d27 100644 --- a/app/views/themes/grid/card.rb +++ b/app/views/themes/grid/card.rb @@ -4,7 +4,7 @@ class Card < ApplicationComponent def view_template Card(class: "w-full") do CardHeader do - CardTitle { 'You might like "PhlexUI"' } + CardTitle { 'You might like "RBUI"' } CardDescription { "@joeldrapper" } end CardContent do diff --git a/app/views/themes/grid/chat.rb b/app/views/themes/grid/chat.rb index ef9401c..713877b 100644 --- a/app/views/themes/grid/chat.rb +++ b/app/views/themes/grid/chat.rb @@ -4,8 +4,8 @@ module Themes module Grid class Chat < ApplicationComponent MESSAGES = [ - "You should checkout PhlexUI's new release, it makes life sooo much easier", - "What's PhlexUI?", + "You should checkout RBUI's new release, it makes life sooo much easier", + "What's RBUI?", "Don't ask questions, just get on that ASAP and thank me later", "Alright, alright, I'll check it out" ] @@ -23,7 +23,6 @@ def view_template def header div(class: "flex items-center justify-between") do div(class: "flex items-center space-x-4") do - # render PhlexUI::Avatar::Builder.new(src: "https://avatars.githubusercontent.com/u/246692?v=4") div do TypographyP(class: "font-medium") { "Joel Drapper" } TypographyMuted { "joel@drapper.me" } @@ -39,10 +38,6 @@ def header TypographyP { "Save contact" } end end - - # render PhlexUI::Button.new(variant: :outline, icon: true, class: '!rounded-full') do - # plus_icon - # end end end diff --git a/test/components/previews/phlex_ui/alert_preview.rb b/test/components/previews/phlex_ui/alert_preview.rb index f62ee1b..945a80b 100644 --- a/test/components/previews/phlex_ui/alert_preview.rb +++ b/test/components/previews/phlex_ui/alert_preview.rb @@ -9,7 +9,7 @@ def variants(variant: nil) render(TestView.new) do Alert(variant:) do AlertTitle { "Pro tip" } - AlertDescription { "With PhlexUI you'll ship faster." } + AlertDescription { "With RBUI you'll ship faster." } end end end diff --git a/test/components/previews/phlex_ui/collapsible_preview.rb b/test/components/previews/phlex_ui/collapsible_preview.rb index aee20a0..c641c3e 100644 --- a/test/components/previews/phlex_ui/collapsible_preview.rb +++ b/test/components/previews/phlex_ui/collapsible_preview.rb @@ -27,7 +27,7 @@ def default "phlex-ruby/phlex-rails" end div(class: "rounded-md border px-4 py-2 font-mono text-sm shadow-sm") do - "PhlexUI/phlex_ui" + "RBUI/rbui" end end end diff --git a/test/components/previews/phlex_ui/dialog_preview.rb b/test/components/previews/phlex_ui/dialog_preview.rb index 8cd68ce..741e0e6 100644 --- a/test/components/previews/phlex_ui/dialog_preview.rb +++ b/test/components/previews/phlex_ui/dialog_preview.rb @@ -11,9 +11,9 @@ def default(size: :md) DialogTrigger { Button { "Open Dialog" } } DialogContent(size:) do DialogHeader do - DialogTitle { "PhlexUI to the rescue" } + DialogTitle { "RBUI to the rescue" } DialogDescription do - "PhlexUI helps you build accessible standard compliant web apps with ease" + "RBUI helps you build accessible standard compliant web apps with ease" end end DialogMiddle do From 3a7c52655a669c17c7ac9246f7e1d55dbbc611ae Mon Sep 17 00:00:00 2001 From: Cirdes Henrique Date: Sun, 25 Aug 2024 10:38:05 -0300 Subject: [PATCH 19/36] remove old logos --- app/assets/images/logo_dark_phlexui.svg | 3 --- app/assets/images/logotest.svg | 28 ------------------------- app/assets/images/phlexui.svg | 3 --- 3 files changed, 34 deletions(-) delete mode 100644 app/assets/images/logo_dark_phlexui.svg delete mode 100644 app/assets/images/logotest.svg delete mode 100644 app/assets/images/phlexui.svg diff --git a/app/assets/images/logo_dark_phlexui.svg b/app/assets/images/logo_dark_phlexui.svg deleted file mode 100644 index 5677122..0000000 --- a/app/assets/images/logo_dark_phlexui.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/app/assets/images/logotest.svg b/app/assets/images/logotest.svg deleted file mode 100644 index ef3bf1d..0000000 --- a/app/assets/images/logotest.svg +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - RBUI - - diff --git a/app/assets/images/phlexui.svg b/app/assets/images/phlexui.svg deleted file mode 100644 index 7347ce2..0000000 --- a/app/assets/images/phlexui.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - From 6552de7ce8c11283d367bc5b4e9c9469ba1480e9 Mon Sep 17 00:00:00 2001 From: Cirdes Henrique Date: Sun, 25 Aug 2024 11:02:30 -0300 Subject: [PATCH 20/36] migrate tpography --- Gemfile | 2 +- Gemfile.lock | 4 ++-- package.json | 2 +- .../previews/{phlex_ui => rbui}/typography_preview.rb | 2 +- yarn.lock | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) rename test/components/previews/{phlex_ui => rbui}/typography_preview.rb (99%) diff --git a/Gemfile b/Gemfile index 8743076..f08d998 100644 --- a/Gemfile +++ b/Gemfile @@ -74,7 +74,7 @@ group :test do end gem "phlex-rails" -gem "phlex_ui", github: "PhlexUI/phlex_ui", branch: "v1" +gem "phlex_ui", github: "PhlexUI/phlex_ui", branch: "ch/migrate-typography" # gem "phlex_ui", path: "../phlex_ui" gem "pry" diff --git a/Gemfile.lock b/Gemfile.lock index 274be6f..ce7593d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ GIT remote: https://github.com/PhlexUI/phlex_ui.git - revision: 2bfac725d3a97324297a6c8460946e11ff71db45 - branch: v1 + revision: 99830935a1af73d6bc8fe9fe2fc1148fa3e4c581 + branch: ch/migrate-typography specs: phlex_ui (0.1.10) phlex (~> 1.10) diff --git a/package.json b/package.json index b01d7ae..ada6eb0 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "lottie-web": "5.12.2", "phlex_ui": "https://github.com/PhlexUI/phlex_ui_stimulus.git", "postcss": "8.4.40", - "rbui-js": "https://github.com/PhlexUI/phlex_ui.git#v1", + "rbui-js": "https://github.com/PhlexUI/phlex_ui.git#ch/migrate-typography", "tailwindcss": "3.4.7", "tailwindcss-animate": "1.0.7" }, diff --git a/test/components/previews/phlex_ui/typography_preview.rb b/test/components/previews/rbui/typography_preview.rb similarity index 99% rename from test/components/previews/phlex_ui/typography_preview.rb rename to test/components/previews/rbui/typography_preview.rb index a5b02cd..2335e65 100644 --- a/test/components/previews/phlex_ui/typography_preview.rb +++ b/test/components/previews/rbui/typography_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module PhlexUi +module Rbui class TypographyPreview < Lookbook::Preview # H1 # --------------- diff --git a/yarn.lock b/yarn.lock index 389abc0..9bd518b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -831,9 +831,9 @@ queue-microtask@^1.2.2: resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== -"rbui-js@https://github.com/PhlexUI/phlex_ui.git#v1": +"rbui-js@https://github.com/PhlexUI/phlex_ui.git#ch/migrate-typography": version "0.0.1-alpha.0" - resolved "https://github.com/PhlexUI/phlex_ui.git#2bfac725d3a97324297a6c8460946e11ff71db45" + resolved "https://github.com/PhlexUI/phlex_ui.git#99830935a1af73d6bc8fe9fe2fc1148fa3e4c581" dependencies: "@floating-ui/dom" "^1.6.8" "@hotwired/stimulus" "^3.2.2" From 052737ed4ca944a96c3e1d240bd19a975cac084f Mon Sep 17 00:00:00 2001 From: Cirdes Henrique Date: Sun, 25 Aug 2024 11:05:52 -0300 Subject: [PATCH 21/36] revert to v1 --- Gemfile | 2 +- Gemfile.lock | 4 ++-- package.json | 2 +- yarn.lock | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index f08d998..8743076 100644 --- a/Gemfile +++ b/Gemfile @@ -74,7 +74,7 @@ group :test do end gem "phlex-rails" -gem "phlex_ui", github: "PhlexUI/phlex_ui", branch: "ch/migrate-typography" +gem "phlex_ui", github: "PhlexUI/phlex_ui", branch: "v1" # gem "phlex_ui", path: "../phlex_ui" gem "pry" diff --git a/Gemfile.lock b/Gemfile.lock index ce7593d..e48176c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ GIT remote: https://github.com/PhlexUI/phlex_ui.git - revision: 99830935a1af73d6bc8fe9fe2fc1148fa3e4c581 - branch: ch/migrate-typography + revision: e85541ea5cdddd9890486ad1a54ef8e7ad2e49fb + branch: v1 specs: phlex_ui (0.1.10) phlex (~> 1.10) diff --git a/package.json b/package.json index ada6eb0..b01d7ae 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "lottie-web": "5.12.2", "phlex_ui": "https://github.com/PhlexUI/phlex_ui_stimulus.git", "postcss": "8.4.40", - "rbui-js": "https://github.com/PhlexUI/phlex_ui.git#ch/migrate-typography", + "rbui-js": "https://github.com/PhlexUI/phlex_ui.git#v1", "tailwindcss": "3.4.7", "tailwindcss-animate": "1.0.7" }, diff --git a/yarn.lock b/yarn.lock index 9bd518b..27efd77 100644 --- a/yarn.lock +++ b/yarn.lock @@ -831,9 +831,9 @@ queue-microtask@^1.2.2: resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== -"rbui-js@https://github.com/PhlexUI/phlex_ui.git#ch/migrate-typography": +"rbui-js@https://github.com/PhlexUI/phlex_ui.git#v1": version "0.0.1-alpha.0" - resolved "https://github.com/PhlexUI/phlex_ui.git#99830935a1af73d6bc8fe9fe2fc1148fa3e4c581" + resolved "https://github.com/PhlexUI/phlex_ui.git#e85541ea5cdddd9890486ad1a54ef8e7ad2e49fb" dependencies: "@floating-ui/dom" "^1.6.8" "@hotwired/stimulus" "^3.2.2" From f01a62dd3f8ef3a97516ca93456cace4ae823c83 Mon Sep 17 00:00:00 2001 From: Cirdes Henrique Date: Sun, 25 Aug 2024 11:14:59 -0300 Subject: [PATCH 22/36] Migrate table --- Gemfile.lock | 2 +- test/components/previews/{phlex_ui => rbui}/table_preview.rb | 2 +- yarn.lock | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename test/components/previews/{phlex_ui => rbui}/table_preview.rb (99%) diff --git a/Gemfile.lock b/Gemfile.lock index e48176c..f2ff71c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/PhlexUI/phlex_ui.git - revision: e85541ea5cdddd9890486ad1a54ef8e7ad2e49fb + revision: 4d7f8c7ea5c974540f0139d40a128530112f68f2 branch: v1 specs: phlex_ui (0.1.10) diff --git a/test/components/previews/phlex_ui/table_preview.rb b/test/components/previews/rbui/table_preview.rb similarity index 99% rename from test/components/previews/phlex_ui/table_preview.rb rename to test/components/previews/rbui/table_preview.rb index b33720e..01963bc 100644 --- a/test/components/previews/phlex_ui/table_preview.rb +++ b/test/components/previews/rbui/table_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module PhlexUi +module Rbui class TablePreview < Lookbook::Preview # Default TablePreview # --------------- diff --git a/yarn.lock b/yarn.lock index 27efd77..dcb895b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -833,7 +833,7 @@ queue-microtask@^1.2.2: "rbui-js@https://github.com/PhlexUI/phlex_ui.git#v1": version "0.0.1-alpha.0" - resolved "https://github.com/PhlexUI/phlex_ui.git#e85541ea5cdddd9890486ad1a54ef8e7ad2e49fb" + resolved "https://github.com/PhlexUI/phlex_ui.git#4d7f8c7ea5c974540f0139d40a128530112f68f2" dependencies: "@floating-ui/dom" "^1.6.8" "@hotwired/stimulus" "^3.2.2" From 9c6801541c5b2c640e921a74178179225c60d512 Mon Sep 17 00:00:00 2001 From: Cirdes Henrique Date: Sun, 25 Aug 2024 11:41:18 -0300 Subject: [PATCH 23/36] Migrate standalone components - AspectRatio - Badge - Button - Codeblock - Link - Shortcut --- Gemfile.lock | 2 +- .../previews/{phlex_ui => rbui}/aspect_ratio_preview.rb | 2 +- test/components/previews/{phlex_ui => rbui}/badge_preview.rb | 2 +- test/components/previews/{phlex_ui => rbui}/button_preview.rb | 2 +- .../components/previews/{phlex_ui => rbui}/codeblock_preview.rb | 2 +- test/components/previews/{phlex_ui => rbui}/link_preview.rb | 2 +- .../previews/{phlex_ui => rbui}/shortcut_key_preview.rb | 2 +- yarn.lock | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) rename test/components/previews/{phlex_ui => rbui}/aspect_ratio_preview.rb (98%) rename test/components/previews/{phlex_ui => rbui}/badge_preview.rb (97%) rename test/components/previews/{phlex_ui => rbui}/button_preview.rb (98%) rename test/components/previews/{phlex_ui => rbui}/codeblock_preview.rb (95%) rename test/components/previews/{phlex_ui => rbui}/link_preview.rb (98%) rename test/components/previews/{phlex_ui => rbui}/shortcut_key_preview.rb (96%) diff --git a/Gemfile.lock b/Gemfile.lock index f2ff71c..feb1324 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/PhlexUI/phlex_ui.git - revision: 4d7f8c7ea5c974540f0139d40a128530112f68f2 + revision: c2b5b37964e5255df7caf55002bd0964734d6111 branch: v1 specs: phlex_ui (0.1.10) diff --git a/test/components/previews/phlex_ui/aspect_ratio_preview.rb b/test/components/previews/rbui/aspect_ratio_preview.rb similarity index 98% rename from test/components/previews/phlex_ui/aspect_ratio_preview.rb rename to test/components/previews/rbui/aspect_ratio_preview.rb index 1413ddf..c8e40c3 100644 --- a/test/components/previews/phlex_ui/aspect_ratio_preview.rb +++ b/test/components/previews/rbui/aspect_ratio_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module PhlexUi +module Rbui class AspectRatioPreview < Lookbook::Preview # AspectRatio 16/9 # --------------- diff --git a/test/components/previews/phlex_ui/badge_preview.rb b/test/components/previews/rbui/badge_preview.rb similarity index 97% rename from test/components/previews/phlex_ui/badge_preview.rb rename to test/components/previews/rbui/badge_preview.rb index afc5531..fbb8c8f 100644 --- a/test/components/previews/phlex_ui/badge_preview.rb +++ b/test/components/previews/rbui/badge_preview.rb @@ -2,7 +2,7 @@ # rubocop:disable Layout/LineLength -module PhlexUi +module Rbui class BadgePreview < Lookbook::Preview # Default Badge # --------------- diff --git a/test/components/previews/phlex_ui/button_preview.rb b/test/components/previews/rbui/button_preview.rb similarity index 98% rename from test/components/previews/phlex_ui/button_preview.rb rename to test/components/previews/rbui/button_preview.rb index 92d9230..398d2fd 100644 --- a/test/components/previews/phlex_ui/button_preview.rb +++ b/test/components/previews/rbui/button_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module PhlexUi +module Rbui class ButtonPreview < Lookbook::Preview # Primary Button # --------------- diff --git a/test/components/previews/phlex_ui/codeblock_preview.rb b/test/components/previews/rbui/codeblock_preview.rb similarity index 95% rename from test/components/previews/phlex_ui/codeblock_preview.rb rename to test/components/previews/rbui/codeblock_preview.rb index 46ba92e..f96c8d2 100644 --- a/test/components/previews/phlex_ui/codeblock_preview.rb +++ b/test/components/previews/rbui/codeblock_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module PhlexUi +module Rbui class CodeblockPreview < Lookbook::Preview # Default Codeblock # --------------- diff --git a/test/components/previews/phlex_ui/link_preview.rb b/test/components/previews/rbui/link_preview.rb similarity index 98% rename from test/components/previews/phlex_ui/link_preview.rb rename to test/components/previews/rbui/link_preview.rb index 059eb64..6510677 100644 --- a/test/components/previews/phlex_ui/link_preview.rb +++ b/test/components/previews/rbui/link_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module PhlexUi +module Rbui class LinkPreview < Lookbook::Preview # Default Link # --------------- diff --git a/test/components/previews/phlex_ui/shortcut_key_preview.rb b/test/components/previews/rbui/shortcut_key_preview.rb similarity index 96% rename from test/components/previews/phlex_ui/shortcut_key_preview.rb rename to test/components/previews/rbui/shortcut_key_preview.rb index 12e596e..45a5273 100644 --- a/test/components/previews/phlex_ui/shortcut_key_preview.rb +++ b/test/components/previews/rbui/shortcut_key_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module PhlexUi +module Rbui class ShortcutKeyPreview < Lookbook::Preview def default render(TestView.new) do diff --git a/yarn.lock b/yarn.lock index dcb895b..47e9ddb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -833,7 +833,7 @@ queue-microtask@^1.2.2: "rbui-js@https://github.com/PhlexUI/phlex_ui.git#v1": version "0.0.1-alpha.0" - resolved "https://github.com/PhlexUI/phlex_ui.git#4d7f8c7ea5c974540f0139d40a128530112f68f2" + resolved "https://github.com/PhlexUI/phlex_ui.git#c2b5b37964e5255df7caf55002bd0964734d6111" dependencies: "@floating-ui/dom" "^1.6.8" "@hotwired/stimulus" "^3.2.2" From c70765904e56afee0d033d52d19a5e7b45c07e76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean=20Pierry=20de=20Souza=20Mendon=C3=A7a?= Date: Thu, 29 Aug 2024 17:32:31 -0300 Subject: [PATCH 24/36] Migrate Sheet from PhlexUI to RBUI (#107) --- Gemfile.lock | 4 ++-- app/views/docs/sheet_view.rb | 4 ++-- test/components/previews/{phlex_ui => rbui}/sheet_preview.rb | 4 ++-- yarn.lock | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) rename test/components/previews/{phlex_ui => rbui}/sheet_preview.rb (95%) diff --git a/Gemfile.lock b/Gemfile.lock index feb1324..5856667 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/PhlexUI/phlex_ui.git - revision: c2b5b37964e5255df7caf55002bd0964734d6111 + revision: bccfd09c75126620a65cae0560ef35ded715d1b5 branch: v1 specs: phlex_ui (0.1.10) @@ -300,7 +300,7 @@ GEM railties (>= 6.0.0) stringio (3.1.1) strscan (3.1.0) - tailwind_merge (0.12.2) + tailwind_merge (0.13.0) lru_redux (~> 1.1) thor (1.3.1) timeout (0.4.1) diff --git a/app/views/docs/sheet_view.rb b/app/views/docs/sheet_view.rb index 315257d..c959f06 100644 --- a/app/views/docs/sheet_view.rb +++ b/app/views/docs/sheet_view.rb @@ -26,7 +26,7 @@ def view_template Input(placeholder: "joel@drapper.me") end SheetFooter do - Button(variant: :outline, data: { action: 'click->dismissable#dismiss' }) { "Cancel" } + Button(variant: :outline, data: { action: 'click->rbui--sheet-content#close' }) { "Cancel" } Button(type: "submit") { "Save" } end end @@ -56,7 +56,7 @@ def view_template Input(placeholder: "joel@drapper.me") end SheetFooter do - Button(variant: :outline, data: { action: 'click->dismissable#dismiss' }) { "Cancel" } + Button(variant: :outline, data: { action: 'click->rbui--sheet-content#close' }) { "Cancel" } Button(type: "submit") { "Save" } end end diff --git a/test/components/previews/phlex_ui/sheet_preview.rb b/test/components/previews/rbui/sheet_preview.rb similarity index 95% rename from test/components/previews/phlex_ui/sheet_preview.rb rename to test/components/previews/rbui/sheet_preview.rb index 70f16f3..af1575c 100644 --- a/test/components/previews/phlex_ui/sheet_preview.rb +++ b/test/components/previews/rbui/sheet_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module PhlexUi +module Rbui class SheetPreview < Lookbook::Preview # Default Sheet # --------------- @@ -26,7 +26,7 @@ def default(side: :top, size: "") end SheetFooter do - Button(variant: :outline, data: {action: "click->dismissable#dismiss"}) { "Cancel" } + Button(variant: :outline, data: {action: "click->rbui--sheet-content#close"}) { "Cancel" } Button(type: "submit") { "Save" } end end diff --git a/yarn.lock b/yarn.lock index 47e9ddb..9654820 100644 --- a/yarn.lock +++ b/yarn.lock @@ -833,7 +833,7 @@ queue-microtask@^1.2.2: "rbui-js@https://github.com/PhlexUI/phlex_ui.git#v1": version "0.0.1-alpha.0" - resolved "https://github.com/PhlexUI/phlex_ui.git#c2b5b37964e5255df7caf55002bd0964734d6111" + resolved "https://github.com/PhlexUI/phlex_ui.git#bccfd09c75126620a65cae0560ef35ded715d1b5" dependencies: "@floating-ui/dom" "^1.6.8" "@hotwired/stimulus" "^3.2.2" From 14d5b3019c655798cfe5c3326ef20443183a69da Mon Sep 17 00:00:00 2001 From: Jackson Pires Date: Sun, 1 Sep 2024 12:23:34 -0300 Subject: [PATCH 25/36] adjust accordion to use rbui (#108) --- app/views/docs/accordion_view.rb | 101 ++++++------------ .../previews/rbui/accordion_preview.rb | 20 +++- 2 files changed, 50 insertions(+), 71 deletions(-) diff --git a/app/views/docs/accordion_view.rb b/app/views/docs/accordion_view.rb index 554c542..4158c27 100644 --- a/app/views/docs/accordion_view.rb +++ b/app/views/docs/accordion_view.rb @@ -3,81 +3,44 @@ 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", description: "A vertically stacked set of interactive headings that each reveal a section of content.") + render Docs::Header.new(title: "Accordion", + description: "A vertically stacked set of interactive headings that each reveal a section of content.") TypographyH2 { "Usage" } - render Docs::VisualCodeExample.new(title: "Custom Design", context: self) do + render Docs::VisualCodeExample.new(title: "Example", context: self) do <<~RUBY - Accordion(class: 'space-y-1') do - AccordionItem( - class!: - "data-[accordion-open-value=true]:bg-muted hover:bg-muted rounded-lg pb-3", - rotate_icon: 135 - ) do - AccordionTrigger(class!: "w-full rounded-lg") do - div(class: "p-6 pb-3 pl-16 relative text-left") do - AccordionIcon(class: "absolute left-6 top-6") do - svg( - xmlns: "http://www.w3.org/2000/svg", - fill: "none", - viewbox: "0 0 24 24", - stroke_width: "1.5", - stroke: "currentColor", - class: "w-6 h-6" - ) do |s| - s.path( - stroke_linecap: "round", - stroke_linejoin: "round", - d: "M12 9v6m3-3H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z" - ) + div(class: "w-full") do + Accordion do + AccordionItem do + AccordionTrigger do + p(class: "font-medium") { "What is PhlexUI?" } + AccordionIcon() + end + + AccordionContent do + p(class: "text-sm pb-4") do + "PhlexUI is a UI component library for Ruby devs who want to build better, faster." end end - p(class: "font-medium") { "What is RBUI?" } end end - AccordionContent do - p(class: "pl-16 pr-4 pb-4 text-muted-foreground") do - "RBUI is a UI component library for Ruby devs who want to build better, faster." - end - end - end + Accordion do + AccordionItem do + AccordionTrigger do + p(class: "font-medium") { "Can I use it with Rils?" } + AccordionIcon() + end - AccordionItem( - class!: - "data-[accordion-open-value=true]:bg-muted hover:bg-muted rounded-lg pb-3", - rotate_icon: 135 - ) do - AccordionTrigger(class!: "w-full rounded-lg") do - div(class: "p-6 pb-3 pl-16 relative text-left") do - AccordionIcon(class: "absolute left-6 top-6") do - svg( - xmlns: "http://www.w3.org/2000/svg", - fill: "none", - viewbox: "0 0 24 24", - stroke_width: "1.5", - stroke: "currentColor", - class: "w-6 h-6" - ) do |s| - s.path( - stroke_linecap: "round", - stroke_linejoin: "round", - d: "M12 9v6m3-3H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z" - ) + AccordionContent do + p(class: "text-sm pb-4") do + "Yes, PhlexUI is pure Ruby and works great with Rails. It's a Ruby gem that you can install into your Rails app." end end - p(class: "font-medium") { "Can I use it with Rails?" } - end - end - - AccordionContent do - p(class: "pl-16 pr-4 pb-4 text-muted-foreground") do - "Yes, RBUI is pure Ruby and works great with Rails. It's a Ruby gem that you can install into your Rails app." end end end - end RUBY end @@ -89,12 +52,18 @@ def view_template def components [ - Docs::ComponentStruct.new(name: "AccordionController", source: "https://github.com/PhlexUI/phlex_ui_stimulus/blob/main/controllers/accordion_controller.js", built_using: :stimulus), - Docs::ComponentStruct.new(name: "Accordion", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/accordion.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "AccordionItem", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/accordion/item.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "AccordionTrigger", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/accordion/item.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "AccordionContent", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/accordion/content.rb", built_using: :phlex), - Docs::ComponentStruct.new(name: "AccordionIcon", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/accordion/icon.rb", built_using: :phlex) + 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/test/components/previews/rbui/accordion_preview.rb b/test/components/previews/rbui/accordion_preview.rb index 39ace09..ec95c99 100644 --- a/test/components/previews/rbui/accordion_preview.rb +++ b/test/components/previews/rbui/accordion_preview.rb @@ -12,11 +12,21 @@ class AccordionPreview < Lookbook::Preview # --------------- def default render(TestView.new) do - Accordion do - ITEMS.each do |it| - AccordionItem do - AccordionTrigger { AccordionDefaultTrigger { AccordionIcon { it[:title] } } } - AccordionContent { AccordionDefaultContent { it[:content] } } + div(class: "w-96") do + Accordion do + ITEMS.each do |it| + AccordionItem do + AccordionTrigger do + p(class: "font-medium") { it[:title] } + AccordionIcon() + end + + AccordionContent do + p(class: "text-sm pb-4") do + it[:content] + end + end + end end end end From 00f6838beb97bbe7b972aa0ac2cabc7db74c30e8 Mon Sep 17 00:00:00 2001 From: Jackson Pires Date: Fri, 13 Sep 2024 09:44:59 -0300 Subject: [PATCH 26/36] adjust calendar doc (#109) --- app/views/docs/calendar_view.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/docs/calendar_view.rb b/app/views/docs/calendar_view.rb index dc67513..a422c37 100644 --- a/app/views/docs/calendar_view.rb +++ b/app/views/docs/calendar_view.rb @@ -10,7 +10,7 @@ def view_template render Docs::VisualCodeExample.new(title: "Connect to input", context: self) do <<~RUBY div(class: 'space-y-4') do - Input(type: 'string', placeholder: "Select a date", class: 'rounded-md border shadow', id: 'date', data_controller: 'input') + Input(type: 'string', placeholder: "Select a date", class: 'rounded-md border shadow', id: 'date', data_controller: 'rbui--calendar-input') Calendar(input_id: '#date', class: 'rounded-md border shadow') end RUBY @@ -19,7 +19,7 @@ def view_template render Docs::VisualCodeExample.new(title: "Format date", description: "Format dates with date-fns", context: self) do <<~RUBY div(class: 'space-y-4') do - Input(type: 'string', placeholder: "Select a date", class: 'rounded-md border shadow', id: 'formatted-date', data_controller: 'input') + Input(type: 'string', placeholder: "Select a date", class: 'rounded-md border shadow', id: 'formatted-date', data_controller: 'rbui--calendar-input') Calendar(input_id: '#formatted-date', date_format: 'PPPP', class: 'rounded-md border shadow') end RUBY From 808c604bf6d72469bd9028da1625c9b940595664 Mon Sep 17 00:00:00 2001 From: Jackson Pires Date: Fri, 13 Sep 2024 09:45:20 -0300 Subject: [PATCH 27/36] adjust dialog doc (#110) --- app/views/docs/dialog_view.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/docs/dialog_view.rb b/app/views/docs/dialog_view.rb index 61ca03f..bca2e8a 100644 --- a/app/views/docs/dialog_view.rb +++ b/app/views/docs/dialog_view.rb @@ -29,7 +29,7 @@ def view_template end end DialogFooter do - Button(variant: :outline, data: { action: 'click->dismissable#dismiss' }) { "Cancel" } + Button(variant: :outline, data: { action: 'click->rbui--dialog#dismiss' }) { "Cancel" } Button { "Save" } end end @@ -60,7 +60,7 @@ def view_template end end DialogFooter do - Button(variant: :outline, data: { action: 'click->dismissable#dismiss' }) { "Cancel" } + Button(variant: :outline, data: { action: 'click->rbui--dialog#dismiss' }) { "Cancel" } Button { "Save" } end end @@ -86,7 +86,7 @@ def view_template end end DialogFooter do - Button(variant: :outline, data: { action: 'click->dismissable#dismiss' }) { "Cancel" } + Button(variant: :outline, data: { action: 'click->rbui--dialog#dismiss' }) { "Cancel" } Button { "Save" } end end From a2574bb627a35fee2f7ba44f4e1c8b1b39601821 Mon Sep 17 00:00:00 2001 From: Jackson Pires Date: Fri, 13 Sep 2024 14:39:29 -0300 Subject: [PATCH 28/36] adjust docs to clipboard component --- app/controllers/docs_controller.rb | 4 +++ app/views/components/shared/menu.rb | 1 + app/views/docs/clipboard_view.rb | 33 +++++++++++++++++++ config/routes.rb | 1 + .../{phlex_ui => rbui}/clipboard_preview.rb | 8 ++--- 5 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 app/views/docs/clipboard_view.rb rename test/components/previews/{phlex_ui => rbui}/clipboard_preview.rb (62%) diff --git a/app/controllers/docs_controller.rb b/app/controllers/docs_controller.rb index c1757e8..6348b60 100644 --- a/app/controllers/docs_controller.rb +++ b/app/controllers/docs_controller.rb @@ -78,6 +78,10 @@ def checkbox render Docs::CheckboxView.new end + def clipboard + render Docs::ClipboardView.new + end + def codeblock render Docs::CodeblockView.new end diff --git a/app/views/components/shared/menu.rb b/app/views/components/shared/menu.rb index bbe5220..62c8643 100644 --- a/app/views/components/shared/menu.rb +++ b/app/views/components/shared/menu.rb @@ -72,6 +72,7 @@ def components {name: "Calendar", path: helpers.docs_calendar_path}, # { name: "Chart", path: helpers.docs_chart_path, badge: "New" }, {name: "Checkbox", path: helpers.docs_checkbox_path}, + {name: "Clipboard", path: helpers.docs_clipboard_path}, {name: "Codeblock", path: helpers.docs_codeblock_path}, {name: "Collapsible", path: helpers.docs_collapsible_path}, {name: "Combobox", path: helpers.docs_combobox_path}, diff --git a/app/views/docs/clipboard_view.rb b/app/views/docs/clipboard_view.rb new file mode 100644 index 0000000..37736de --- /dev/null +++ b/app/views/docs/clipboard_view.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +class Docs::ClipboardView < ApplicationView + def view_template + 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.") + + TypographyH2 { "Usage" } + + render Docs::VisualCodeExample.new(title: "Example", context: self) do + <<~RUBY + Clipboard(success: "Copied!", error: "Copy failed!", class: "relative", options: {placement: "top"}) do + ClipboardSource(class: "hidden") { span { "Born rich!!!" } } + + ClipboardTrigger do + Link(href: "#", class: "gap-1") do + TypographyP(size: :small, class: "text-primary") { "Copy the secret of success!!!" } + end + end + end + RUBY + end + 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/config/routes.rb b/config/routes.rb index dc56b3b..eed62a4 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -27,6 +27,7 @@ get "calendar", to: "docs#calendar", as: :docs_calendar get "chart", to: "docs#chart", as: :docs_chart get "checkbox", to: "docs#checkbox", as: :docs_checkbox + get "clipboard", to: "docs#clipboard", as: :docs_clipboard get "codeblock", to: "docs#codeblock", as: :docs_codeblock get "collapsible", to: "docs#collapsible", as: :docs_collapsible get "combobox", to: "docs#combobox", as: :docs_combobox diff --git a/test/components/previews/phlex_ui/clipboard_preview.rb b/test/components/previews/rbui/clipboard_preview.rb similarity index 62% rename from test/components/previews/phlex_ui/clipboard_preview.rb rename to test/components/previews/rbui/clipboard_preview.rb index 49ebe5a..2076b4b 100644 --- a/test/components/previews/phlex_ui/clipboard_preview.rb +++ b/test/components/previews/rbui/clipboard_preview.rb @@ -1,17 +1,17 @@ # frozen_string_literal: true -module PhlexUi +module Rbui class ClipboardPreview < Lookbook::Preview # Default Clipboard # --------------- def default render(TestView.new) do - Clipboard(success: "Copiado!", error: "Falha ao copiar!", class: "relative") do - ClipboardSource(class: "hidden") { span { "Nascer herdeiro!!!" } } + Clipboard(success: "Copied!", error: "Copy failed!", class: "relative", options: {placement: "top"}) do + ClipboardSource(class: "hidden") { span { "Born rich!!!" } } ClipboardTrigger do Link(href: "#", class: "gap-1") do - TypographyP(size: :small, class: "text-primary") { "Copiar segredo do sucesso!!!" } + TypographyP(size: :small, class: "text-primary") { "Copy the secret of success!!!" } end end end From 30476a48f4cec84f0bf64a1fc14a0c0ae2af3ba2 Mon Sep 17 00:00:00 2001 From: Jackson Pires Date: Fri, 13 Sep 2024 14:44:59 -0300 Subject: [PATCH 29/36] adjust component files table --- app/views/docs/clipboard_view.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/views/docs/clipboard_view.rb b/app/views/docs/clipboard_view.rb index 37736de..5a7dbb0 100644 --- a/app/views/docs/clipboard_view.rb +++ b/app/views/docs/clipboard_view.rb @@ -20,6 +20,8 @@ def view_template end RUBY end + + render Docs::ComponentsTable.new(components) end end @@ -27,7 +29,11 @@ def view_template def components [ - Docs::ComponentStruct.new(name: "Button", source: "https://github.com/PhlexUI/phlex_ui/blob/main/lib/phlex_ui/button.rb", built_using: :phlex) + 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 From 375441f720d8bf3316ce45633a6bd6d04f76aa28 Mon Sep 17 00:00:00 2001 From: Jackson Pires Date: Fri, 13 Sep 2024 15:17:46 -0300 Subject: [PATCH 30/36] move all lookbook test to rbui namespace --- Gemfile | 4 ++-- Gemfile.lock | 6 ++---- package.json | 2 +- .../previews/{phlex_ui => rbui}/alert_dialog_preview.rb | 2 +- .../components/previews/{phlex_ui => rbui}/alert_preview.rb | 2 +- .../previews/{phlex_ui => rbui}/avatar_preview.rb | 2 +- .../previews/{phlex_ui => rbui}/calendar_preview.rb | 2 +- test/components/previews/{phlex_ui => rbui}/card_preview.rb | 2 +- .../previews/{phlex_ui => rbui}/clipboard_preview.rb | 2 +- .../previews/{phlex_ui => rbui}/collapsible_preview.rb | 2 +- .../previews/{phlex_ui => rbui}/command_preview.rb | 2 +- .../previews/{phlex_ui => rbui}/context_menu_preview.rb | 2 +- .../previews/{phlex_ui => rbui}/date_picker_preview.rb | 2 +- .../previews/{phlex_ui => rbui}/dialog_preview.rb | 2 +- .../previews/{phlex_ui => rbui}/dropdown_menu_preview.rb | 2 +- .../previews/{phlex_ui => rbui}/hover_card_preview.rb | 2 +- .../previews/{phlex_ui => rbui}/pagination_preview.rb | 2 +- .../previews/{phlex_ui => rbui}/popover_preview.rb | 2 +- test/components/previews/{phlex_ui => rbui}/tabs_preview.rb | 2 +- yarn.lock | 3 +-- 20 files changed, 22 insertions(+), 25 deletions(-) rename test/components/previews/{phlex_ui => rbui}/alert_dialog_preview.rb (98%) rename test/components/previews/{phlex_ui => rbui}/alert_preview.rb (96%) rename test/components/previews/{phlex_ui => rbui}/avatar_preview.rb (98%) rename test/components/previews/{phlex_ui => rbui}/calendar_preview.rb (96%) rename test/components/previews/{phlex_ui => rbui}/card_preview.rb (98%) rename test/components/previews/{phlex_ui => rbui}/clipboard_preview.rb (97%) rename test/components/previews/{phlex_ui => rbui}/collapsible_preview.rb (98%) rename test/components/previews/{phlex_ui => rbui}/command_preview.rb (99%) rename test/components/previews/{phlex_ui => rbui}/context_menu_preview.rb (98%) rename test/components/previews/{phlex_ui => rbui}/date_picker_preview.rb (98%) rename test/components/previews/{phlex_ui => rbui}/dialog_preview.rb (98%) rename test/components/previews/{phlex_ui => rbui}/dropdown_menu_preview.rb (98%) rename test/components/previews/{phlex_ui => rbui}/hover_card_preview.rb (98%) rename test/components/previews/{phlex_ui => rbui}/pagination_preview.rb (98%) rename test/components/previews/{phlex_ui => rbui}/popover_preview.rb (99%) rename test/components/previews/{phlex_ui => rbui}/tabs_preview.rb (98%) diff --git a/Gemfile b/Gemfile index 8743076..b614d84 100644 --- a/Gemfile +++ b/Gemfile @@ -74,7 +74,7 @@ group :test do end gem "phlex-rails" -gem "phlex_ui", github: "PhlexUI/phlex_ui", branch: "v1" -# gem "phlex_ui", path: "../phlex_ui" +# gem "phlex_ui", github: "PhlexUI/phlex_ui", branch: "v1" +gem "phlex_ui", path: "../phlex_ui" gem "pry" diff --git a/Gemfile.lock b/Gemfile.lock index 5856667..8d26bac 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,5 @@ -GIT - remote: https://github.com/PhlexUI/phlex_ui.git - revision: bccfd09c75126620a65cae0560ef35ded715d1b5 - branch: v1 +PATH + remote: ../phlex_ui specs: phlex_ui (0.1.10) phlex (~> 1.10) diff --git a/package.json b/package.json index b01d7ae..5376d44 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "lottie-web": "5.12.2", "phlex_ui": "https://github.com/PhlexUI/phlex_ui_stimulus.git", "postcss": "8.4.40", - "rbui-js": "https://github.com/PhlexUI/phlex_ui.git#v1", + "rbui-js": "file:./../phlex_ui", "tailwindcss": "3.4.7", "tailwindcss-animate": "1.0.7" }, diff --git a/test/components/previews/phlex_ui/alert_dialog_preview.rb b/test/components/previews/rbui/alert_dialog_preview.rb similarity index 98% rename from test/components/previews/phlex_ui/alert_dialog_preview.rb rename to test/components/previews/rbui/alert_dialog_preview.rb index e402720..545f448 100644 --- a/test/components/previews/phlex_ui/alert_dialog_preview.rb +++ b/test/components/previews/rbui/alert_dialog_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module PhlexUi +module Rbui class AlertDialogPreview < Lookbook::Preview # Default AlertDialog # --------------- diff --git a/test/components/previews/phlex_ui/alert_preview.rb b/test/components/previews/rbui/alert_preview.rb similarity index 96% rename from test/components/previews/phlex_ui/alert_preview.rb rename to test/components/previews/rbui/alert_preview.rb index 945a80b..5212f29 100644 --- a/test/components/previews/phlex_ui/alert_preview.rb +++ b/test/components/previews/rbui/alert_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module PhlexUi +module Rbui class AlertPreview < Lookbook::Preview # Default Alert # --------------- diff --git a/test/components/previews/phlex_ui/avatar_preview.rb b/test/components/previews/rbui/avatar_preview.rb similarity index 98% rename from test/components/previews/phlex_ui/avatar_preview.rb rename to test/components/previews/rbui/avatar_preview.rb index 0c22d61..7769f3c 100644 --- a/test/components/previews/phlex_ui/avatar_preview.rb +++ b/test/components/previews/rbui/avatar_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module PhlexUi +module Rbui class AvatarPreview < Lookbook::Preview # Avatar sizes # --------------- diff --git a/test/components/previews/phlex_ui/calendar_preview.rb b/test/components/previews/rbui/calendar_preview.rb similarity index 96% rename from test/components/previews/phlex_ui/calendar_preview.rb rename to test/components/previews/rbui/calendar_preview.rb index a1a7b95..24d6d12 100644 --- a/test/components/previews/phlex_ui/calendar_preview.rb +++ b/test/components/previews/rbui/calendar_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module PhlexUi +module Rbui class CalendarPreview < Lookbook::Preview def default render(TestView.new) do diff --git a/test/components/previews/phlex_ui/card_preview.rb b/test/components/previews/rbui/card_preview.rb similarity index 98% rename from test/components/previews/phlex_ui/card_preview.rb rename to test/components/previews/rbui/card_preview.rb index 8c4e6e4..eac10c3 100644 --- a/test/components/previews/phlex_ui/card_preview.rb +++ b/test/components/previews/rbui/card_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module PhlexUi +module Rbui class CardPreview < Lookbook::Preview # Default CardPreview # --------------- diff --git a/test/components/previews/phlex_ui/clipboard_preview.rb b/test/components/previews/rbui/clipboard_preview.rb similarity index 97% rename from test/components/previews/phlex_ui/clipboard_preview.rb rename to test/components/previews/rbui/clipboard_preview.rb index 49ebe5a..c8ad950 100644 --- a/test/components/previews/phlex_ui/clipboard_preview.rb +++ b/test/components/previews/rbui/clipboard_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module PhlexUi +module Rbui class ClipboardPreview < Lookbook::Preview # Default Clipboard # --------------- diff --git a/test/components/previews/phlex_ui/collapsible_preview.rb b/test/components/previews/rbui/collapsible_preview.rb similarity index 98% rename from test/components/previews/phlex_ui/collapsible_preview.rb rename to test/components/previews/rbui/collapsible_preview.rb index c641c3e..9ab4442 100644 --- a/test/components/previews/phlex_ui/collapsible_preview.rb +++ b/test/components/previews/rbui/collapsible_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module PhlexUi +module Rbui class CollapsiblePreview < Lookbook::Preview # Default Collapsible # --------------- diff --git a/test/components/previews/phlex_ui/command_preview.rb b/test/components/previews/rbui/command_preview.rb similarity index 99% rename from test/components/previews/phlex_ui/command_preview.rb rename to test/components/previews/rbui/command_preview.rb index 590bdc4..c65d68f 100644 --- a/test/components/previews/phlex_ui/command_preview.rb +++ b/test/components/previews/rbui/command_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module PhlexUi +module Rbui class CommandPreview < Lookbook::Preview # Default Command # --------------- diff --git a/test/components/previews/phlex_ui/context_menu_preview.rb b/test/components/previews/rbui/context_menu_preview.rb similarity index 98% rename from test/components/previews/phlex_ui/context_menu_preview.rb rename to test/components/previews/rbui/context_menu_preview.rb index 9b3d9a7..0cf431d 100644 --- a/test/components/previews/phlex_ui/context_menu_preview.rb +++ b/test/components/previews/rbui/context_menu_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module PhlexUi +module Rbui class ContextMenuPreview < Lookbook::Preview # Default ContextMenu # --------------- diff --git a/test/components/previews/phlex_ui/date_picker_preview.rb b/test/components/previews/rbui/date_picker_preview.rb similarity index 98% rename from test/components/previews/phlex_ui/date_picker_preview.rb rename to test/components/previews/rbui/date_picker_preview.rb index f6d16e7..a5b2a04 100644 --- a/test/components/previews/phlex_ui/date_picker_preview.rb +++ b/test/components/previews/rbui/date_picker_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module PhlexUi +module Rbui class DatePickerPreview < Lookbook::Preview # Default DatePicker # --------------- diff --git a/test/components/previews/phlex_ui/dialog_preview.rb b/test/components/previews/rbui/dialog_preview.rb similarity index 98% rename from test/components/previews/phlex_ui/dialog_preview.rb rename to test/components/previews/rbui/dialog_preview.rb index 741e0e6..5185d8a 100644 --- a/test/components/previews/phlex_ui/dialog_preview.rb +++ b/test/components/previews/rbui/dialog_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module PhlexUi +module Rbui class DialogPreview < Lookbook::Preview # Default Dialog # --------------- diff --git a/test/components/previews/phlex_ui/dropdown_menu_preview.rb b/test/components/previews/rbui/dropdown_menu_preview.rb similarity index 98% rename from test/components/previews/phlex_ui/dropdown_menu_preview.rb rename to test/components/previews/rbui/dropdown_menu_preview.rb index 0541b42..e07bdcb 100644 --- a/test/components/previews/phlex_ui/dropdown_menu_preview.rb +++ b/test/components/previews/rbui/dropdown_menu_preview.rb @@ -2,7 +2,7 @@ # rubocop:disable Layout/LineLength -module PhlexUi +module Rbui class DropdownMenuPreview < Lookbook::Preview # Default DropdownMenu # --------------- diff --git a/test/components/previews/phlex_ui/hover_card_preview.rb b/test/components/previews/rbui/hover_card_preview.rb similarity index 98% rename from test/components/previews/phlex_ui/hover_card_preview.rb rename to test/components/previews/rbui/hover_card_preview.rb index 175662f..0b59c1a 100644 --- a/test/components/previews/phlex_ui/hover_card_preview.rb +++ b/test/components/previews/rbui/hover_card_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module PhlexUi +module Rbui class HoverCardPreview < Lookbook::Preview # Default HoverCard # --------------- diff --git a/test/components/previews/phlex_ui/pagination_preview.rb b/test/components/previews/rbui/pagination_preview.rb similarity index 98% rename from test/components/previews/phlex_ui/pagination_preview.rb rename to test/components/previews/rbui/pagination_preview.rb index 9d4b8a1..848ee08 100644 --- a/test/components/previews/phlex_ui/pagination_preview.rb +++ b/test/components/previews/rbui/pagination_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module PhlexUi +module Rbui class PaginationPreview < Lookbook::Preview # Default Pagination # --------------- diff --git a/test/components/previews/phlex_ui/popover_preview.rb b/test/components/previews/rbui/popover_preview.rb similarity index 99% rename from test/components/previews/phlex_ui/popover_preview.rb rename to test/components/previews/rbui/popover_preview.rb index 0dd9c92..643b477 100644 --- a/test/components/previews/phlex_ui/popover_preview.rb +++ b/test/components/previews/rbui/popover_preview.rb @@ -2,7 +2,7 @@ # rubocop:disable Layout/LineLength -module PhlexUi +module Rbui class PopoverPreview < Lookbook::Preview # Default Popover # --------------- diff --git a/test/components/previews/phlex_ui/tabs_preview.rb b/test/components/previews/rbui/tabs_preview.rb similarity index 98% rename from test/components/previews/phlex_ui/tabs_preview.rb rename to test/components/previews/rbui/tabs_preview.rb index b9f0967..0de6215 100644 --- a/test/components/previews/phlex_ui/tabs_preview.rb +++ b/test/components/previews/rbui/tabs_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module PhlexUi +module Rbui class TabsPreview < Lookbook::Preview # Default TabsPreview # --------------- diff --git a/yarn.lock b/yarn.lock index 9654820..a98c292 100644 --- a/yarn.lock +++ b/yarn.lock @@ -831,9 +831,8 @@ queue-microtask@^1.2.2: resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== -"rbui-js@https://github.com/PhlexUI/phlex_ui.git#v1": +"rbui-js@file:../phlex_ui": version "0.0.1-alpha.0" - resolved "https://github.com/PhlexUI/phlex_ui.git#bccfd09c75126620a65cae0560ef35ded715d1b5" dependencies: "@floating-ui/dom" "^1.6.8" "@hotwired/stimulus" "^3.2.2" From 35823eb8b64dce3d1e67f24ec633c501169eb468 Mon Sep 17 00:00:00 2001 From: Jackson Pires Date: Fri, 13 Sep 2024 15:19:51 -0300 Subject: [PATCH 31/36] restore v1 files --- Gemfile | 4 ++-- Gemfile.lock | 6 ++++-- package.json | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index b614d84..8743076 100644 --- a/Gemfile +++ b/Gemfile @@ -74,7 +74,7 @@ group :test do end gem "phlex-rails" -# gem "phlex_ui", github: "PhlexUI/phlex_ui", branch: "v1" -gem "phlex_ui", path: "../phlex_ui" +gem "phlex_ui", github: "PhlexUI/phlex_ui", branch: "v1" +# gem "phlex_ui", path: "../phlex_ui" gem "pry" diff --git a/Gemfile.lock b/Gemfile.lock index 8d26bac..5856667 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,5 +1,7 @@ -PATH - remote: ../phlex_ui +GIT + remote: https://github.com/PhlexUI/phlex_ui.git + revision: bccfd09c75126620a65cae0560ef35ded715d1b5 + branch: v1 specs: phlex_ui (0.1.10) phlex (~> 1.10) diff --git a/package.json b/package.json index 5376d44..b01d7ae 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "lottie-web": "5.12.2", "phlex_ui": "https://github.com/PhlexUI/phlex_ui_stimulus.git", "postcss": "8.4.40", - "rbui-js": "file:./../phlex_ui", + "rbui-js": "https://github.com/PhlexUI/phlex_ui.git#v1", "tailwindcss": "3.4.7", "tailwindcss-animate": "1.0.7" }, From 018545c81d6ee564a6f0651034917a323f9e66c8 Mon Sep 17 00:00:00 2001 From: Jackson Pires Date: Fri, 13 Sep 2024 15:20:27 -0300 Subject: [PATCH 32/36] restore v1 files --- yarn.lock | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index a98c292..9654820 100644 --- a/yarn.lock +++ b/yarn.lock @@ -831,8 +831,9 @@ queue-microtask@^1.2.2: resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== -"rbui-js@file:../phlex_ui": +"rbui-js@https://github.com/PhlexUI/phlex_ui.git#v1": version "0.0.1-alpha.0" + resolved "https://github.com/PhlexUI/phlex_ui.git#bccfd09c75126620a65cae0560ef35ded715d1b5" dependencies: "@floating-ui/dom" "^1.6.8" "@hotwired/stimulus" "^3.2.2" From 49bc489b28f86462152073e42dcbaa22a5d7171c Mon Sep 17 00:00:00 2001 From: Jackson Pires Date: Sun, 15 Sep 2024 20:59:09 -0300 Subject: [PATCH 33/36] move popover from tippyjs to floating ui --- app/views/docs/popover_view.rb | 84 +++++++++++++++++----------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/app/views/docs/popover_view.rb b/app/views/docs/popover_view.rb index 958df43..cba75da 100644 --- a/app/views/docs/popover_view.rb +++ b/app/views/docs/popover_view.rb @@ -12,7 +12,7 @@ def view_template Button(variant: :outline) { "Open Popover" } end PopoverContent(class: 'w-40') do - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -30,7 +30,7 @@ def view_template end plain "Profile" end - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -53,7 +53,7 @@ def view_template end plain "Settings" end - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -85,7 +85,7 @@ def view_template Button(variant: :outline, class: 'w-full justify-center') { 'top' } end PopoverContent(class: 'w-40') do - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -103,7 +103,7 @@ def view_template end plain "Profile" end - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -126,7 +126,7 @@ def view_template end plain "Settings" end - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -152,7 +152,7 @@ def view_template Button(variant: :outline, class: 'w-full justify-center') { 'top-start' } end PopoverContent(class: 'w-40') do - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -170,7 +170,7 @@ def view_template end plain "Profile" end - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -193,7 +193,7 @@ def view_template end plain "Settings" end - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -219,7 +219,7 @@ def view_template Button(variant: :outline, class: 'w-full justify-center') { 'top-end' } end PopoverContent(class: 'w-40') do - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -237,7 +237,7 @@ def view_template end plain "Profile" end - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -260,7 +260,7 @@ def view_template end plain "Settings" end - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -287,7 +287,7 @@ def view_template Button(variant: :outline, class: 'w-full justify-center') { 'right' } end PopoverContent(class: 'w-40') do - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -305,7 +305,7 @@ def view_template end plain "Profile" end - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -328,7 +328,7 @@ def view_template end plain "Settings" end - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -354,7 +354,7 @@ def view_template Button(variant: :outline, class: 'w-full justify-center') { 'right-start' } end PopoverContent(class: 'w-40') do - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -372,7 +372,7 @@ def view_template end plain "Profile" end - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -395,7 +395,7 @@ def view_template end plain "Settings" end - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -421,7 +421,7 @@ def view_template Button(variant: :outline, class: 'w-full justify-center') { 'right-end' } end PopoverContent(class: 'w-40') do - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -439,7 +439,7 @@ def view_template end plain "Profile" end - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -462,7 +462,7 @@ def view_template end plain "Settings" end - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -489,7 +489,7 @@ def view_template Button(variant: :outline, class: 'w-full justify-center') { 'left' } end PopoverContent(class: 'w-40') do - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -507,7 +507,7 @@ def view_template end plain "Profile" end - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -530,7 +530,7 @@ def view_template end plain "Settings" end - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -556,7 +556,7 @@ def view_template Button(variant: :outline, class: 'w-full justify-center') { 'left-start' } end PopoverContent(class: 'w-40') do - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -574,7 +574,7 @@ def view_template end plain "Profile" end - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -597,7 +597,7 @@ def view_template end plain "Settings" end - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -623,7 +623,7 @@ def view_template Button(variant: :outline, class: 'w-full justify-center') { 'left-end' } end PopoverContent(class: 'w-40') do - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -641,7 +641,7 @@ def view_template end plain "Profile" end - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -664,7 +664,7 @@ def view_template end plain "Settings" end - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -691,7 +691,7 @@ def view_template Button(variant: :outline, class: 'w-full justify-center') { 'bottom' } end PopoverContent(class: 'w-40') do - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -709,7 +709,7 @@ def view_template end plain "Profile" end - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -732,7 +732,7 @@ def view_template end plain "Settings" end - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -758,7 +758,7 @@ def view_template Button(variant: :outline, class: 'w-full justify-center') { 'bottom-start' } end PopoverContent(class: 'w-40') do - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -776,7 +776,7 @@ def view_template end plain "Profile" end - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -799,7 +799,7 @@ def view_template end plain "Settings" end - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -825,7 +825,7 @@ def view_template Button(variant: :outline, class: 'w-full justify-center') { 'bottom-end' } end PopoverContent(class: 'w-40') do - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -843,7 +843,7 @@ def view_template end plain "Profile" end - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -866,7 +866,7 @@ def view_template end plain "Settings" end - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -897,7 +897,7 @@ def view_template Button(variant: :outline) { "Click" } end PopoverContent(class: 'w-40') do - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -915,7 +915,7 @@ def view_template end plain "Profile" end - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -938,7 +938,7 @@ def view_template end plain "Settings" end - Link(href: "#", variant: :ghost, class: 'block w-full justify-start pl-2') do + Link(href: "#", variant: :ghost, class: 'w-full justify-start pl-2') do svg( xmlns: "http://www.w3.org/2000/svg", fill: "none", From 17a686d344fb5e00cece1d541c18ba34b41e170f Mon Sep 17 00:00:00 2001 From: Jackson Pires Date: Sun, 15 Sep 2024 21:06:36 -0300 Subject: [PATCH 34/36] lookbook file --- .../previews/{phlex_ui => rbui}/popover_preview.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) rename test/components/previews/{phlex_ui => rbui}/popover_preview.rb (76%) diff --git a/test/components/previews/phlex_ui/popover_preview.rb b/test/components/previews/rbui/popover_preview.rb similarity index 76% rename from test/components/previews/phlex_ui/popover_preview.rb rename to test/components/previews/rbui/popover_preview.rb index 0dd9c92..75492f3 100644 --- a/test/components/previews/phlex_ui/popover_preview.rb +++ b/test/components/previews/rbui/popover_preview.rb @@ -2,7 +2,7 @@ # rubocop:disable Layout/LineLength -module PhlexUi +module Rbui class PopoverPreview < Lookbook::Preview # Default Popover # --------------- @@ -15,17 +15,17 @@ def default(placement: "top") end PopoverContent(class: "w-40") do - Link(href: "#", variant: :ghost, class: "block w-full justify-start pl-2") do + Link(href: "#", variant: :ghost, class: "w-full justify-start pl-2") do plain(helpers.lucide_icon("circle-user", class: "w-4 h-4 mr-2")) plain("Profile") end - Link(href: "#", variant: :ghost, class: "block w-full justify-start pl-2") do + Link(href: "#", variant: :ghost, class: "w-full justify-start pl-2") do plain(helpers.lucide_icon("cog", class: "w-4 h-4 mr-2")) plain("Settings") end - Link(href: "#", variant: :ghost, class: "block w-full justify-start pl-2") do + Link(href: "#", variant: :ghost, class: "w-full justify-start pl-2") do plain(helpers.lucide_icon("log-out", class: "w-4 h-4 mr-2")) plain("Logout") end @@ -44,17 +44,17 @@ def trigger end PopoverContent(class: "w-40") do - Link(href: "#", variant: :ghost, class: "block w-full justify-start pl-2") do + Link(href: "#", variant: :ghost, class: "w-full justify-start pl-2") do plain(helpers.lucide_icon("circle-user", class: "w-4 h-4 mr-2")) plain("Profile") end - Link(href: "#", variant: :ghost, class: "block w-full justify-start pl-2") do + Link(href: "#", variant: :ghost, class: "w-full justify-start pl-2") do plain(helpers.lucide_icon("cog", class: "w-4 h-4 mr-2")) plain("Settings") end - Link(href: "#", variant: :ghost, class: "block w-full justify-start pl-2") do + Link(href: "#", variant: :ghost, class: "w-full justify-start pl-2") do plain(helpers.lucide_icon("log-out", class: "w-4 h-4 mr-2")) plain("Logout") end From 3302ced3dc4bc66d90e0fe4b6ebb1c5319daec60 Mon Sep 17 00:00:00 2001 From: Jackson Pires Date: Mon, 16 Sep 2024 13:19:05 -0300 Subject: [PATCH 35/36] change namespace Rbui to RBUI --- test/components/previews/rbui/accordion_preview.rb | 2 +- test/components/previews/rbui/alert_dialog_preview.rb | 2 +- test/components/previews/rbui/alert_preview.rb | 2 +- test/components/previews/rbui/aspect_ratio_preview.rb | 2 +- test/components/previews/rbui/avatar_preview.rb | 2 +- test/components/previews/rbui/badge_preview.rb | 2 +- test/components/previews/rbui/button_preview.rb | 2 +- test/components/previews/rbui/calendar_preview.rb | 2 +- test/components/previews/rbui/card_preview.rb | 2 +- test/components/previews/rbui/checkbox_preview.rb | 2 +- test/components/previews/rbui/clipboard_preview.rb | 2 +- test/components/previews/rbui/codeblock_preview.rb | 2 +- test/components/previews/rbui/collapsible_preview.rb | 2 +- test/components/previews/rbui/combobox_preview.rb | 2 +- test/components/previews/rbui/command_preview.rb | 2 +- test/components/previews/rbui/context_menu_preview.rb | 2 +- test/components/previews/rbui/date_picker_preview.rb | 2 +- test/components/previews/rbui/dialog_preview.rb | 2 +- test/components/previews/rbui/dropdown_menu_preview.rb | 2 +- test/components/previews/rbui/form_preview.rb | 2 +- test/components/previews/rbui/hover_card_preview.rb | 2 +- test/components/previews/rbui/input_preview.rb | 2 +- test/components/previews/rbui/link_preview.rb | 2 +- test/components/previews/rbui/pagination_preview.rb | 2 +- test/components/previews/rbui/popover_preview.rb | 2 +- test/components/previews/rbui/select_preview.rb | 2 +- test/components/previews/rbui/sheet_preview.rb | 2 +- test/components/previews/rbui/shortcut_key_preview.rb | 2 +- test/components/previews/rbui/table_preview.rb | 2 +- test/components/previews/rbui/tabs_preview.rb | 2 +- test/components/previews/rbui/theme_toggle_preview.rb | 2 +- test/components/previews/rbui/tooltip_preview.rb | 2 +- test/components/previews/rbui/typography_preview.rb | 2 +- 33 files changed, 33 insertions(+), 33 deletions(-) diff --git a/test/components/previews/rbui/accordion_preview.rb b/test/components/previews/rbui/accordion_preview.rb index ec95c99..b181877 100644 --- a/test/components/previews/rbui/accordion_preview.rb +++ b/test/components/previews/rbui/accordion_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Rbui +module RBUI class AccordionPreview < Lookbook::Preview ITEMS = [ {title: "Item 1", content: "Content 1"}, diff --git a/test/components/previews/rbui/alert_dialog_preview.rb b/test/components/previews/rbui/alert_dialog_preview.rb index 545f448..de6157c 100644 --- a/test/components/previews/rbui/alert_dialog_preview.rb +++ b/test/components/previews/rbui/alert_dialog_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Rbui +module RBUI class AlertDialogPreview < Lookbook::Preview # Default AlertDialog # --------------- diff --git a/test/components/previews/rbui/alert_preview.rb b/test/components/previews/rbui/alert_preview.rb index 5212f29..787cab4 100644 --- a/test/components/previews/rbui/alert_preview.rb +++ b/test/components/previews/rbui/alert_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Rbui +module RBUI class AlertPreview < Lookbook::Preview # Default Alert # --------------- diff --git a/test/components/previews/rbui/aspect_ratio_preview.rb b/test/components/previews/rbui/aspect_ratio_preview.rb index c8e40c3..0abd26b 100644 --- a/test/components/previews/rbui/aspect_ratio_preview.rb +++ b/test/components/previews/rbui/aspect_ratio_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Rbui +module RBUI class AspectRatioPreview < Lookbook::Preview # AspectRatio 16/9 # --------------- diff --git a/test/components/previews/rbui/avatar_preview.rb b/test/components/previews/rbui/avatar_preview.rb index 7769f3c..68f598b 100644 --- a/test/components/previews/rbui/avatar_preview.rb +++ b/test/components/previews/rbui/avatar_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Rbui +module RBUI class AvatarPreview < Lookbook::Preview # Avatar sizes # --------------- diff --git a/test/components/previews/rbui/badge_preview.rb b/test/components/previews/rbui/badge_preview.rb index fbb8c8f..06a864e 100644 --- a/test/components/previews/rbui/badge_preview.rb +++ b/test/components/previews/rbui/badge_preview.rb @@ -2,7 +2,7 @@ # rubocop:disable Layout/LineLength -module Rbui +module RBUI class BadgePreview < Lookbook::Preview # Default Badge # --------------- diff --git a/test/components/previews/rbui/button_preview.rb b/test/components/previews/rbui/button_preview.rb index 398d2fd..5089656 100644 --- a/test/components/previews/rbui/button_preview.rb +++ b/test/components/previews/rbui/button_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Rbui +module RBUI class ButtonPreview < Lookbook::Preview # Primary Button # --------------- diff --git a/test/components/previews/rbui/calendar_preview.rb b/test/components/previews/rbui/calendar_preview.rb index 24d6d12..e9611a4 100644 --- a/test/components/previews/rbui/calendar_preview.rb +++ b/test/components/previews/rbui/calendar_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Rbui +module RBUI class CalendarPreview < Lookbook::Preview def default render(TestView.new) do diff --git a/test/components/previews/rbui/card_preview.rb b/test/components/previews/rbui/card_preview.rb index eac10c3..58557dd 100644 --- a/test/components/previews/rbui/card_preview.rb +++ b/test/components/previews/rbui/card_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Rbui +module RBUI class CardPreview < Lookbook::Preview # Default CardPreview # --------------- diff --git a/test/components/previews/rbui/checkbox_preview.rb b/test/components/previews/rbui/checkbox_preview.rb index 736ba17..e12effb 100644 --- a/test/components/previews/rbui/checkbox_preview.rb +++ b/test/components/previews/rbui/checkbox_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Rbui +module RBUI class CheckboxPreview < Lookbook::Preview # Default Checkbox # --------------- diff --git a/test/components/previews/rbui/clipboard_preview.rb b/test/components/previews/rbui/clipboard_preview.rb index c8ad950..057737c 100644 --- a/test/components/previews/rbui/clipboard_preview.rb +++ b/test/components/previews/rbui/clipboard_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Rbui +module RBUI class ClipboardPreview < Lookbook::Preview # Default Clipboard # --------------- diff --git a/test/components/previews/rbui/codeblock_preview.rb b/test/components/previews/rbui/codeblock_preview.rb index f96c8d2..00b0ff1 100644 --- a/test/components/previews/rbui/codeblock_preview.rb +++ b/test/components/previews/rbui/codeblock_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Rbui +module RBUI class CodeblockPreview < Lookbook::Preview # Default Codeblock # --------------- diff --git a/test/components/previews/rbui/collapsible_preview.rb b/test/components/previews/rbui/collapsible_preview.rb index 9ab4442..484fd0a 100644 --- a/test/components/previews/rbui/collapsible_preview.rb +++ b/test/components/previews/rbui/collapsible_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Rbui +module RBUI class CollapsiblePreview < Lookbook::Preview # Default Collapsible # --------------- diff --git a/test/components/previews/rbui/combobox_preview.rb b/test/components/previews/rbui/combobox_preview.rb index c2c5ef8..a002344 100644 --- a/test/components/previews/rbui/combobox_preview.rb +++ b/test/components/previews/rbui/combobox_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Rbui +module RBUI class ComboboxPreview < Lookbook::Preview # Default Combobox # --------------- diff --git a/test/components/previews/rbui/command_preview.rb b/test/components/previews/rbui/command_preview.rb index c65d68f..51013b5 100644 --- a/test/components/previews/rbui/command_preview.rb +++ b/test/components/previews/rbui/command_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Rbui +module RBUI class CommandPreview < Lookbook::Preview # Default Command # --------------- diff --git a/test/components/previews/rbui/context_menu_preview.rb b/test/components/previews/rbui/context_menu_preview.rb index 0cf431d..d644a65 100644 --- a/test/components/previews/rbui/context_menu_preview.rb +++ b/test/components/previews/rbui/context_menu_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Rbui +module RBUI class ContextMenuPreview < Lookbook::Preview # Default ContextMenu # --------------- diff --git a/test/components/previews/rbui/date_picker_preview.rb b/test/components/previews/rbui/date_picker_preview.rb index a5b2a04..2f8ed44 100644 --- a/test/components/previews/rbui/date_picker_preview.rb +++ b/test/components/previews/rbui/date_picker_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Rbui +module RBUI class DatePickerPreview < Lookbook::Preview # Default DatePicker # --------------- diff --git a/test/components/previews/rbui/dialog_preview.rb b/test/components/previews/rbui/dialog_preview.rb index 5185d8a..9ec3d76 100644 --- a/test/components/previews/rbui/dialog_preview.rb +++ b/test/components/previews/rbui/dialog_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Rbui +module RBUI class DialogPreview < Lookbook::Preview # Default Dialog # --------------- diff --git a/test/components/previews/rbui/dropdown_menu_preview.rb b/test/components/previews/rbui/dropdown_menu_preview.rb index e07bdcb..1fe85f3 100644 --- a/test/components/previews/rbui/dropdown_menu_preview.rb +++ b/test/components/previews/rbui/dropdown_menu_preview.rb @@ -2,7 +2,7 @@ # rubocop:disable Layout/LineLength -module Rbui +module RBUI class DropdownMenuPreview < Lookbook::Preview # Default DropdownMenu # --------------- diff --git a/test/components/previews/rbui/form_preview.rb b/test/components/previews/rbui/form_preview.rb index b89f8e1..3b7c12b 100644 --- a/test/components/previews/rbui/form_preview.rb +++ b/test/components/previews/rbui/form_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Rbui +module RBUI class FormPreview < Lookbook::Preview # Default Form # --------------- diff --git a/test/components/previews/rbui/hover_card_preview.rb b/test/components/previews/rbui/hover_card_preview.rb index 0b59c1a..2538ebd 100644 --- a/test/components/previews/rbui/hover_card_preview.rb +++ b/test/components/previews/rbui/hover_card_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Rbui +module RBUI class HoverCardPreview < Lookbook::Preview # Default HoverCard # --------------- diff --git a/test/components/previews/rbui/input_preview.rb b/test/components/previews/rbui/input_preview.rb index 8cb4763..7aa4d5f 100644 --- a/test/components/previews/rbui/input_preview.rb +++ b/test/components/previews/rbui/input_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Rbui +module RBUI class InputPreview < Lookbook::Preview # Email Input # --------------- diff --git a/test/components/previews/rbui/link_preview.rb b/test/components/previews/rbui/link_preview.rb index 6510677..b03cc0f 100644 --- a/test/components/previews/rbui/link_preview.rb +++ b/test/components/previews/rbui/link_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Rbui +module RBUI class LinkPreview < Lookbook::Preview # Default Link # --------------- diff --git a/test/components/previews/rbui/pagination_preview.rb b/test/components/previews/rbui/pagination_preview.rb index 848ee08..30cdba0 100644 --- a/test/components/previews/rbui/pagination_preview.rb +++ b/test/components/previews/rbui/pagination_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Rbui +module RBUI class PaginationPreview < Lookbook::Preview # Default Pagination # --------------- diff --git a/test/components/previews/rbui/popover_preview.rb b/test/components/previews/rbui/popover_preview.rb index 643b477..c9515cb 100644 --- a/test/components/previews/rbui/popover_preview.rb +++ b/test/components/previews/rbui/popover_preview.rb @@ -2,7 +2,7 @@ # rubocop:disable Layout/LineLength -module Rbui +module RBUI class PopoverPreview < Lookbook::Preview # Default Popover # --------------- diff --git a/test/components/previews/rbui/select_preview.rb b/test/components/previews/rbui/select_preview.rb index cdf63f1..f75383a 100644 --- a/test/components/previews/rbui/select_preview.rb +++ b/test/components/previews/rbui/select_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Rbui +module RBUI class SelectPreview < Lookbook::Preview def default render(TestView.new) do diff --git a/test/components/previews/rbui/sheet_preview.rb b/test/components/previews/rbui/sheet_preview.rb index af1575c..d5a1d08 100644 --- a/test/components/previews/rbui/sheet_preview.rb +++ b/test/components/previews/rbui/sheet_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Rbui +module RBUI class SheetPreview < Lookbook::Preview # Default Sheet # --------------- diff --git a/test/components/previews/rbui/shortcut_key_preview.rb b/test/components/previews/rbui/shortcut_key_preview.rb index 45a5273..d43f05e 100644 --- a/test/components/previews/rbui/shortcut_key_preview.rb +++ b/test/components/previews/rbui/shortcut_key_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Rbui +module RBUI class ShortcutKeyPreview < Lookbook::Preview def default render(TestView.new) do diff --git a/test/components/previews/rbui/table_preview.rb b/test/components/previews/rbui/table_preview.rb index 01963bc..a919d4d 100644 --- a/test/components/previews/rbui/table_preview.rb +++ b/test/components/previews/rbui/table_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Rbui +module RBUI class TablePreview < Lookbook::Preview # Default TablePreview # --------------- diff --git a/test/components/previews/rbui/tabs_preview.rb b/test/components/previews/rbui/tabs_preview.rb index 0de6215..efac9aa 100644 --- a/test/components/previews/rbui/tabs_preview.rb +++ b/test/components/previews/rbui/tabs_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Rbui +module RBUI class TabsPreview < Lookbook::Preview # Default TabsPreview # --------------- diff --git a/test/components/previews/rbui/theme_toggle_preview.rb b/test/components/previews/rbui/theme_toggle_preview.rb index 8328bd2..059d1d8 100644 --- a/test/components/previews/rbui/theme_toggle_preview.rb +++ b/test/components/previews/rbui/theme_toggle_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Rbui +module RBUI class ThemeTogglePreview < Lookbook::Preview def default render(TestView.new) do diff --git a/test/components/previews/rbui/tooltip_preview.rb b/test/components/previews/rbui/tooltip_preview.rb index 4e03ec1..8048c43 100644 --- a/test/components/previews/rbui/tooltip_preview.rb +++ b/test/components/previews/rbui/tooltip_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Rbui +module RBUI class TooltipPreview < Lookbook::Preview # Default TooltipPreview # --------------- diff --git a/test/components/previews/rbui/typography_preview.rb b/test/components/previews/rbui/typography_preview.rb index 2335e65..2c87f1a 100644 --- a/test/components/previews/rbui/typography_preview.rb +++ b/test/components/previews/rbui/typography_preview.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Rbui +module RBUI class TypographyPreview < Lookbook::Preview # H1 # --------------- From c95df698232f312ed2195725ec3cb54e33c5f48e Mon Sep 17 00:00:00 2001 From: Seth Horsley Date: Mon, 16 Sep 2024 22:14:00 +0200 Subject: [PATCH 36/36] to rbui --- Gemfile | 5 ++-- Gemfile.lock | 9 +++---- app/javascript/application.js | 1 - app/views/application_view.rb | 2 +- app/views/components/application_component.rb | 1 - package.json | 2 +- tailwind.config.js | 27 +++++++++---------- yarn.lock | 7 ++--- 8 files changed, 26 insertions(+), 28 deletions(-) diff --git a/Gemfile b/Gemfile index 8743076..d6525bc 100644 --- a/Gemfile +++ b/Gemfile @@ -74,7 +74,8 @@ group :test do end gem "phlex-rails" -gem "phlex_ui", github: "PhlexUI/phlex_ui", branch: "v1" -# gem "phlex_ui", path: "../phlex_ui" + +gem "rbui", github: "rbui-labs/rbui" +# gem "rbui", path: "../rbui" gem "pry" diff --git a/Gemfile.lock b/Gemfile.lock index 5856667..0d570a9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,9 +1,8 @@ GIT - remote: https://github.com/PhlexUI/phlex_ui.git - revision: bccfd09c75126620a65cae0560ef35ded715d1b5 - branch: v1 + remote: https://github.com/rbui-labs/rbui.git + revision: 19a1b5df2db0e000a21b9b2c5a573179c07506be specs: - phlex_ui (0.1.10) + rbui (0.2.0) phlex (~> 1.10) rouge (~> 4.2.0) tailwind_merge (>= 0.12) @@ -349,11 +348,11 @@ DEPENDENCIES lookbook (= 2.3.2) lucide-rails (= 0.4.0) phlex-rails - phlex_ui! propshaft (= 0.9.0) pry puma (= 6.4.2) rails (= 7.2.0) + rbui! selenium-webdriver sqlite3 (>= 1.4) standard diff --git a/app/javascript/application.js b/app/javascript/application.js index 64a1700..a37ff7f 100644 --- a/app/javascript/application.js +++ b/app/javascript/application.js @@ -1,5 +1,4 @@ // Entry point for the build script in your package.json import "@hotwired/turbo-rails"; import "rbui-js"; -import "phlex_ui"; import "./controllers"; diff --git a/app/views/application_view.rb b/app/views/application_view.rb index 96796ae..06be49f 100644 --- a/app/views/application_view.rb +++ b/app/views/application_view.rb @@ -30,7 +30,7 @@ def components(component, code_example = nil, use_component_files = false) require "rubygems" - def component_files(component, gem_name = "phlex_ui") + def component_files(component, gem_name = "rbui") # Find the gem specification gem_spec = Gem::Specification.find_by_name(gem_name) return [] unless gem_spec diff --git a/app/views/components/application_component.rb b/app/views/components/application_component.rb index d0cc74d..b2c77bd 100644 --- a/app/views/components/application_component.rb +++ b/app/views/components/application_component.rb @@ -2,7 +2,6 @@ class ApplicationComponent < Phlex::HTML include RBUI - include PhlexUI include Phlex::Rails::Helpers::Routes if Rails.env.development? diff --git a/package.json b/package.json index b01d7ae..bf8d250 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "lottie-web": "5.12.2", "phlex_ui": "https://github.com/PhlexUI/phlex_ui_stimulus.git", "postcss": "8.4.40", - "rbui-js": "https://github.com/PhlexUI/phlex_ui.git#v1", + "rbui-js": "^1.0.0-alpha.2", "tailwindcss": "3.4.7", "tailwindcss-animate": "1.0.7" }, diff --git a/tailwind.config.js b/tailwind.config.js index fd21d7b..c0ff205 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,20 +1,21 @@ -// For importing tailwind styles from phlex_ui/phlex_ui_pro gem -const execSync = require('child_process').execSync; +// For importing tailwind styles from rbui gem +const execSync = require("child_process").execSync; // Import rbui gem path -const outputRBUI = execSync('bundle show phlex_ui', { encoding: 'utf-8' }); -const rbui_path = outputRBUI.trim() + '/**/*.rb'; +const outputRBUI = execSync("bundle show rbui", { encoding: "utf-8" }); +const rbui_path = outputRBUI.trim() + "/**/*.rb"; -const defaultTheme = require('tailwindcss/defaultTheme') +const defaultTheme = require("tailwindcss/defaultTheme"); module.exports = { darkMode: ["class"], content: [ - './app/views/**/*.{erb,haml,html,slim,rb}', - './app/helpers/**/*.rb', - './app/assets/stylesheets/**/*.css', - './app/javascript/**/*.js', - rbui_path + "./app/views/**/*.{erb,haml,html,slim,rb}", + "./app/helpers/**/*.rb", + "./app/assets/stylesheets/**/*.css", + "./app/javascript/**/*.js", + rbui_path, + "./app/components/**/*.{erb,haml,html,slim,rb}", ], theme: { container: { @@ -79,7 +80,5 @@ module.exports = { }, }, }, - plugins: [ - require("tailwindcss-animate"), - ], -} \ No newline at end of file + plugins: [require("tailwindcss-animate")], +}; diff --git a/yarn.lock b/yarn.lock index 9654820..d9ed9bf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -831,9 +831,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@https://github.com/PhlexUI/phlex_ui.git#v1": - version "0.0.1-alpha.0" - resolved "https://github.com/PhlexUI/phlex_ui.git#bccfd09c75126620a65cae0560ef35ded715d1b5" +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"