uikit_rails 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +301 -0
- data/Rakefile +12 -0
- data/app/controllers/uikit_rails/styleguide_controller.rb +72 -0
- data/app/views/layouts/uikit_rails/application.html.erb +412 -0
- data/app/views/uikit_rails/styleguide/index.html.erb +27 -0
- data/app/views/uikit_rails/styleguide/show.html.erb +56 -0
- data/config/routes.rb +6 -0
- data/lib/uikit_rails/engine.rb +13 -0
- data/lib/uikit_rails/generators/add_generator.rb +110 -0
- data/lib/uikit_rails/generators/install_generator.rb +62 -0
- data/lib/uikit_rails/generators/templates/base_component.rb.tt +32 -0
- data/lib/uikit_rails/generators/templates/uikit_rails.css.tt +69 -0
- data/lib/uikit_rails/templates/components/accordion/USAGE +30 -0
- data/lib/uikit_rails/templates/components/accordion/accordion.css +74 -0
- data/lib/uikit_rails/templates/components/accordion/component.html.erb +13 -0
- data/lib/uikit_rails/templates/components/accordion/component.rb +35 -0
- data/lib/uikit_rails/templates/components/accordion/preview.yml +81 -0
- data/lib/uikit_rails/templates/components/alert/USAGE +25 -0
- data/lib/uikit_rails/templates/components/alert/alert.css +60 -0
- data/lib/uikit_rails/templates/components/alert/component.html.erb +9 -0
- data/lib/uikit_rails/templates/components/alert/component.rb +27 -0
- data/lib/uikit_rails/templates/components/alert/preview.yml +53 -0
- data/lib/uikit_rails/templates/components/alert_dialog/USAGE +38 -0
- data/lib/uikit_rails/templates/components/alert_dialog/alert_dialog.css +108 -0
- data/lib/uikit_rails/templates/components/alert_dialog/component.html.erb +27 -0
- data/lib/uikit_rails/templates/components/alert_dialog/component.rb +23 -0
- data/lib/uikit_rails/templates/components/alert_dialog/preview.yml +94 -0
- data/lib/uikit_rails/templates/components/avatar/USAGE +20 -0
- data/lib/uikit_rails/templates/components/avatar/avatar.css +53 -0
- data/lib/uikit_rails/templates/components/avatar/component.html.erb +7 -0
- data/lib/uikit_rails/templates/components/avatar/component.rb +31 -0
- data/lib/uikit_rails/templates/components/avatar/preview.yml +42 -0
- data/lib/uikit_rails/templates/components/badge/USAGE +13 -0
- data/lib/uikit_rails/templates/components/badge/badge.css +61 -0
- data/lib/uikit_rails/templates/components/badge/component.rb +28 -0
- data/lib/uikit_rails/templates/components/badge/preview.yml +38 -0
- data/lib/uikit_rails/templates/components/breadcrumb/USAGE +23 -0
- data/lib/uikit_rails/templates/components/breadcrumb/breadcrumb.css +55 -0
- data/lib/uikit_rails/templates/components/breadcrumb/component.html.erb +14 -0
- data/lib/uikit_rails/templates/components/breadcrumb/component.rb +40 -0
- data/lib/uikit_rails/templates/components/breadcrumb/preview.yml +42 -0
- data/lib/uikit_rails/templates/components/button/USAGE +21 -0
- data/lib/uikit_rails/templates/components/button/button.css +125 -0
- data/lib/uikit_rails/templates/components/button/component.rb +44 -0
- data/lib/uikit_rails/templates/components/button/preview.yml +106 -0
- data/lib/uikit_rails/templates/components/card/USAGE +33 -0
- data/lib/uikit_rails/templates/components/card/card.css +63 -0
- data/lib/uikit_rails/templates/components/card/component.html.erb +16 -0
- data/lib/uikit_rails/templates/components/card/component.rb +26 -0
- data/lib/uikit_rails/templates/components/card/preview.yml +57 -0
- data/lib/uikit_rails/templates/components/checkbox/USAGE +19 -0
- data/lib/uikit_rails/templates/components/checkbox/checkbox.css +67 -0
- data/lib/uikit_rails/templates/components/checkbox/component.html.erb +6 -0
- data/lib/uikit_rails/templates/components/checkbox/component.rb +26 -0
- data/lib/uikit_rails/templates/components/checkbox/preview.yml +43 -0
- data/lib/uikit_rails/templates/components/collapsible/USAGE +31 -0
- data/lib/uikit_rails/templates/components/collapsible/collapsible.css +55 -0
- data/lib/uikit_rails/templates/components/collapsible/component.html.erb +8 -0
- data/lib/uikit_rails/templates/components/collapsible/component.rb +18 -0
- data/lib/uikit_rails/templates/components/collapsible/preview.yml +65 -0
- data/lib/uikit_rails/templates/components/dialog/USAGE +41 -0
- data/lib/uikit_rails/templates/components/dialog/component.html.erb +23 -0
- data/lib/uikit_rails/templates/components/dialog/component.rb +20 -0
- data/lib/uikit_rails/templates/components/dialog/dialog.css +133 -0
- data/lib/uikit_rails/templates/components/dialog/preview.yml +77 -0
- data/lib/uikit_rails/templates/components/dropdown/USAGE +40 -0
- data/lib/uikit_rails/templates/components/dropdown/component.html.erb +14 -0
- data/lib/uikit_rails/templates/components/dropdown/component.rb +62 -0
- data/lib/uikit_rails/templates/components/dropdown/dropdown.css +104 -0
- data/lib/uikit_rails/templates/components/dropdown/preview.yml +75 -0
- data/lib/uikit_rails/templates/components/form/USAGE +51 -0
- data/lib/uikit_rails/templates/components/form/builder.rb +233 -0
- data/lib/uikit_rails/templates/components/form/form.css +48 -0
- data/lib/uikit_rails/templates/components/form/preview.yml +95 -0
- data/lib/uikit_rails/templates/components/input/USAGE +21 -0
- data/lib/uikit_rails/templates/components/input/component.rb +25 -0
- data/lib/uikit_rails/templates/components/input/input.css +43 -0
- data/lib/uikit_rails/templates/components/input/preview.yml +58 -0
- data/lib/uikit_rails/templates/components/label/USAGE +16 -0
- data/lib/uikit_rails/templates/components/label/component.rb +25 -0
- data/lib/uikit_rails/templates/components/label/label.css +25 -0
- data/lib/uikit_rails/templates/components/label/preview.yml +34 -0
- data/lib/uikit_rails/templates/components/pagination/USAGE +45 -0
- data/lib/uikit_rails/templates/components/pagination/component.html.erb +7 -0
- data/lib/uikit_rails/templates/components/pagination/component.rb +90 -0
- data/lib/uikit_rails/templates/components/pagination/pagination.css +89 -0
- data/lib/uikit_rails/templates/components/pagination/preview.yml +61 -0
- data/lib/uikit_rails/templates/components/popover/USAGE +44 -0
- data/lib/uikit_rails/templates/components/popover/component.html.erb +8 -0
- data/lib/uikit_rails/templates/components/popover/component.rb +19 -0
- data/lib/uikit_rails/templates/components/popover/popover.css +94 -0
- data/lib/uikit_rails/templates/components/popover/preview.yml +102 -0
- data/lib/uikit_rails/templates/components/progress/USAGE +15 -0
- data/lib/uikit_rails/templates/components/progress/component.html.erb +3 -0
- data/lib/uikit_rails/templates/components/progress/component.rb +38 -0
- data/lib/uikit_rails/templates/components/progress/preview.yml +44 -0
- data/lib/uikit_rails/templates/components/progress/progress.css +20 -0
- data/lib/uikit_rails/templates/components/select/USAGE +19 -0
- data/lib/uikit_rails/templates/components/select/component.rb +38 -0
- data/lib/uikit_rails/templates/components/select/preview.yml +61 -0
- data/lib/uikit_rails/templates/components/select/select.css +46 -0
- data/lib/uikit_rails/templates/components/separator/USAGE +15 -0
- data/lib/uikit_rails/templates/components/separator/component.rb +34 -0
- data/lib/uikit_rails/templates/components/separator/preview.yml +32 -0
- data/lib/uikit_rails/templates/components/separator/separator.css +21 -0
- data/lib/uikit_rails/templates/components/sheet/USAGE +44 -0
- data/lib/uikit_rails/templates/components/sheet/component.html.erb +23 -0
- data/lib/uikit_rails/templates/components/sheet/component.rb +23 -0
- data/lib/uikit_rails/templates/components/sheet/preview.yml +105 -0
- data/lib/uikit_rails/templates/components/sheet/sheet.css +193 -0
- data/lib/uikit_rails/templates/components/skeleton/USAGE +19 -0
- data/lib/uikit_rails/templates/components/skeleton/component.rb +38 -0
- data/lib/uikit_rails/templates/components/skeleton/preview.yml +44 -0
- data/lib/uikit_rails/templates/components/skeleton/skeleton.css +25 -0
- data/lib/uikit_rails/templates/components/switch/USAGE +19 -0
- data/lib/uikit_rails/templates/components/switch/component.html.erb +19 -0
- data/lib/uikit_rails/templates/components/switch/component.rb +23 -0
- data/lib/uikit_rails/templates/components/switch/preview.yml +43 -0
- data/lib/uikit_rails/templates/components/switch/switch.css +81 -0
- data/lib/uikit_rails/templates/components/table/USAGE +40 -0
- data/lib/uikit_rails/templates/components/table/component.html.erb +14 -0
- data/lib/uikit_rails/templates/components/table/component.rb +25 -0
- data/lib/uikit_rails/templates/components/table/preview.yml +109 -0
- data/lib/uikit_rails/templates/components/table/table.css +86 -0
- data/lib/uikit_rails/templates/components/tabs/USAGE +24 -0
- data/lib/uikit_rails/templates/components/tabs/component.html.erb +10 -0
- data/lib/uikit_rails/templates/components/tabs/component.rb +35 -0
- data/lib/uikit_rails/templates/components/tabs/preview.yml +60 -0
- data/lib/uikit_rails/templates/components/tabs/tabs.css +72 -0
- data/lib/uikit_rails/templates/components/textarea/USAGE +19 -0
- data/lib/uikit_rails/templates/components/textarea/component.rb +25 -0
- data/lib/uikit_rails/templates/components/textarea/preview.yml +47 -0
- data/lib/uikit_rails/templates/components/textarea/textarea.css +39 -0
- data/lib/uikit_rails/templates/components/toggle/USAGE +25 -0
- data/lib/uikit_rails/templates/components/toggle/component.rb +39 -0
- data/lib/uikit_rails/templates/components/toggle/preview.yml +81 -0
- data/lib/uikit_rails/templates/components/toggle/toggle.css +89 -0
- data/lib/uikit_rails/templates/components/tooltip/USAGE +23 -0
- data/lib/uikit_rails/templates/components/tooltip/component.html.erb +8 -0
- data/lib/uikit_rails/templates/components/tooltip/component.rb +19 -0
- data/lib/uikit_rails/templates/components/tooltip/preview.yml +52 -0
- data/lib/uikit_rails/templates/components/tooltip/tooltip.css +78 -0
- data/lib/uikit_rails/templates/stimulus/accordion_controller.js +19 -0
- data/lib/uikit_rails/templates/stimulus/alert_dialog_controller.js +25 -0
- data/lib/uikit_rails/templates/stimulus/collapsible_controller.js +9 -0
- data/lib/uikit_rails/templates/stimulus/dialog_controller.js +19 -0
- data/lib/uikit_rails/templates/stimulus/dropdown_controller.js +47 -0
- data/lib/uikit_rails/templates/stimulus/popover_controller.js +47 -0
- data/lib/uikit_rails/templates/stimulus/sheet_controller.js +19 -0
- data/lib/uikit_rails/templates/stimulus/tabs_controller.js +24 -0
- data/lib/uikit_rails/templates/stimulus/tooltip_controller.js +13 -0
- data/lib/uikit_rails/version.rb +5 -0
- data/lib/uikit_rails.rb +59 -0
- data/sig/uikit_rails.rbs +4 -0
- data/test_app/.dockerignore +51 -0
- data/test_app/.gitattributes +9 -0
- data/test_app/.github/dependabot.yml +12 -0
- data/test_app/.github/workflows/ci.yml +124 -0
- data/test_app/.gitignore +35 -0
- data/test_app/.kamal/hooks/docker-setup.sample +3 -0
- data/test_app/.kamal/hooks/post-app-boot.sample +3 -0
- data/test_app/.kamal/hooks/post-deploy.sample +14 -0
- data/test_app/.kamal/hooks/post-proxy-reboot.sample +3 -0
- data/test_app/.kamal/hooks/pre-app-boot.sample +3 -0
- data/test_app/.kamal/hooks/pre-build.sample +51 -0
- data/test_app/.kamal/hooks/pre-connect.sample +47 -0
- data/test_app/.kamal/hooks/pre-deploy.sample +122 -0
- data/test_app/.kamal/hooks/pre-proxy-reboot.sample +3 -0
- data/test_app/.kamal/secrets +20 -0
- data/test_app/.rubocop.yml +8 -0
- data/test_app/.ruby-version +1 -0
- data/test_app/Dockerfile +77 -0
- data/test_app/Gemfile +68 -0
- data/test_app/Gemfile.lock +587 -0
- data/test_app/README.md +24 -0
- data/test_app/Rakefile +6 -0
- data/test_app/app/assets/images/.keep +0 -0
- data/test_app/app/assets/stylesheets/application.css +10 -0
- data/test_app/app/assets/stylesheets/ui/accordion.css +74 -0
- data/test_app/app/assets/stylesheets/ui/alert.css +60 -0
- data/test_app/app/assets/stylesheets/ui/alert_dialog.css +108 -0
- data/test_app/app/assets/stylesheets/ui/avatar.css +53 -0
- data/test_app/app/assets/stylesheets/ui/badge.css +61 -0
- data/test_app/app/assets/stylesheets/ui/breadcrumb.css +55 -0
- data/test_app/app/assets/stylesheets/ui/button.css +125 -0
- data/test_app/app/assets/stylesheets/ui/card.css +63 -0
- data/test_app/app/assets/stylesheets/ui/checkbox.css +67 -0
- data/test_app/app/assets/stylesheets/ui/collapsible.css +55 -0
- data/test_app/app/assets/stylesheets/ui/dialog.css +133 -0
- data/test_app/app/assets/stylesheets/ui/dropdown.css +104 -0
- data/test_app/app/assets/stylesheets/ui/form.css +48 -0
- data/test_app/app/assets/stylesheets/ui/input.css +43 -0
- data/test_app/app/assets/stylesheets/ui/label.css +25 -0
- data/test_app/app/assets/stylesheets/ui/pagination.css +89 -0
- data/test_app/app/assets/stylesheets/ui/popover.css +94 -0
- data/test_app/app/assets/stylesheets/ui/progress.css +20 -0
- data/test_app/app/assets/stylesheets/ui/select.css +46 -0
- data/test_app/app/assets/stylesheets/ui/separator.css +21 -0
- data/test_app/app/assets/stylesheets/ui/sheet.css +193 -0
- data/test_app/app/assets/stylesheets/ui/skeleton.css +25 -0
- data/test_app/app/assets/stylesheets/ui/switch.css +81 -0
- data/test_app/app/assets/stylesheets/ui/table.css +86 -0
- data/test_app/app/assets/stylesheets/ui/tabs.css +72 -0
- data/test_app/app/assets/stylesheets/ui/textarea.css +39 -0
- data/test_app/app/assets/stylesheets/ui/toggle.css +89 -0
- data/test_app/app/assets/stylesheets/ui/tooltip.css +78 -0
- data/test_app/app/assets/stylesheets/uikit_rails.css +69 -0
- data/test_app/app/components/ui/accordion/component.html.erb +13 -0
- data/test_app/app/components/ui/accordion/component.rb +35 -0
- data/test_app/app/components/ui/accordion/preview.yml +81 -0
- data/test_app/app/components/ui/alert/component.html.erb +9 -0
- data/test_app/app/components/ui/alert/component.rb +27 -0
- data/test_app/app/components/ui/alert/preview.yml +53 -0
- data/test_app/app/components/ui/alert_dialog/component.html.erb +27 -0
- data/test_app/app/components/ui/alert_dialog/component.rb +23 -0
- data/test_app/app/components/ui/alert_dialog/preview.yml +94 -0
- data/test_app/app/components/ui/avatar/component.html.erb +7 -0
- data/test_app/app/components/ui/avatar/component.rb +31 -0
- data/test_app/app/components/ui/avatar/preview.yml +42 -0
- data/test_app/app/components/ui/badge/component.rb +28 -0
- data/test_app/app/components/ui/badge/preview.yml +38 -0
- data/test_app/app/components/ui/base_component.rb +32 -0
- data/test_app/app/components/ui/breadcrumb/component.html.erb +14 -0
- data/test_app/app/components/ui/breadcrumb/component.rb +40 -0
- data/test_app/app/components/ui/breadcrumb/preview.yml +42 -0
- data/test_app/app/components/ui/button/component.rb +44 -0
- data/test_app/app/components/ui/button/preview.yml +106 -0
- data/test_app/app/components/ui/card/component.html.erb +16 -0
- data/test_app/app/components/ui/card/component.rb +26 -0
- data/test_app/app/components/ui/card/preview.yml +57 -0
- data/test_app/app/components/ui/checkbox/component.html.erb +6 -0
- data/test_app/app/components/ui/checkbox/component.rb +26 -0
- data/test_app/app/components/ui/checkbox/preview.yml +43 -0
- data/test_app/app/components/ui/collapsible/component.html.erb +8 -0
- data/test_app/app/components/ui/collapsible/component.rb +18 -0
- data/test_app/app/components/ui/collapsible/preview.yml +65 -0
- data/test_app/app/components/ui/dialog/component.html.erb +23 -0
- data/test_app/app/components/ui/dialog/component.rb +20 -0
- data/test_app/app/components/ui/dialog/preview.yml +77 -0
- data/test_app/app/components/ui/dropdown/component.html.erb +14 -0
- data/test_app/app/components/ui/dropdown/component.rb +62 -0
- data/test_app/app/components/ui/dropdown/preview.yml +75 -0
- data/test_app/app/components/ui/form/USAGE +51 -0
- data/test_app/app/components/ui/form/builder.rb +233 -0
- data/test_app/app/components/ui/form/component.rb +258 -0
- data/test_app/app/components/ui/form/form.css +48 -0
- data/test_app/app/components/ui/form/preview.yml +95 -0
- data/test_app/app/components/ui/input/component.rb +25 -0
- data/test_app/app/components/ui/input/preview.yml +58 -0
- data/test_app/app/components/ui/label/component.rb +25 -0
- data/test_app/app/components/ui/label/preview.yml +34 -0
- data/test_app/app/components/ui/pagination/component.html.erb +7 -0
- data/test_app/app/components/ui/pagination/component.rb +90 -0
- data/test_app/app/components/ui/pagination/preview.yml +61 -0
- data/test_app/app/components/ui/popover/component.html.erb +8 -0
- data/test_app/app/components/ui/popover/component.rb +19 -0
- data/test_app/app/components/ui/popover/preview.yml +102 -0
- data/test_app/app/components/ui/progress/component.html.erb +3 -0
- data/test_app/app/components/ui/progress/component.rb +38 -0
- data/test_app/app/components/ui/progress/preview.yml +44 -0
- data/test_app/app/components/ui/select/component.rb +38 -0
- data/test_app/app/components/ui/select/preview.yml +61 -0
- data/test_app/app/components/ui/separator/component.rb +34 -0
- data/test_app/app/components/ui/separator/preview.yml +32 -0
- data/test_app/app/components/ui/sheet/component.html.erb +23 -0
- data/test_app/app/components/ui/sheet/component.rb +23 -0
- data/test_app/app/components/ui/sheet/preview.yml +105 -0
- data/test_app/app/components/ui/skeleton/component.rb +38 -0
- data/test_app/app/components/ui/skeleton/preview.yml +44 -0
- data/test_app/app/components/ui/switch/component.html.erb +19 -0
- data/test_app/app/components/ui/switch/component.rb +23 -0
- data/test_app/app/components/ui/switch/preview.yml +43 -0
- data/test_app/app/components/ui/table/component.html.erb +14 -0
- data/test_app/app/components/ui/table/component.rb +25 -0
- data/test_app/app/components/ui/table/preview.yml +109 -0
- data/test_app/app/components/ui/tabs/component.html.erb +10 -0
- data/test_app/app/components/ui/tabs/component.rb +35 -0
- data/test_app/app/components/ui/tabs/preview.yml +60 -0
- data/test_app/app/components/ui/textarea/component.rb +25 -0
- data/test_app/app/components/ui/textarea/preview.yml +47 -0
- data/test_app/app/components/ui/toggle/component.rb +39 -0
- data/test_app/app/components/ui/toggle/preview.yml +81 -0
- data/test_app/app/components/ui/tooltip/component.html.erb +8 -0
- data/test_app/app/components/ui/tooltip/component.rb +19 -0
- data/test_app/app/components/ui/tooltip/preview.yml +52 -0
- data/test_app/app/controllers/application_controller.rb +7 -0
- data/test_app/app/controllers/concerns/.keep +0 -0
- data/test_app/app/helpers/application_helper.rb +2 -0
- data/test_app/app/javascript/application.js +3 -0
- data/test_app/app/javascript/controllers/application.js +9 -0
- data/test_app/app/javascript/controllers/hello_controller.js +7 -0
- data/test_app/app/javascript/controllers/index.js +4 -0
- data/test_app/app/javascript/controllers/ui/accordion_controller.js +19 -0
- data/test_app/app/javascript/controllers/ui/alert_dialog_controller.js +25 -0
- data/test_app/app/javascript/controllers/ui/collapsible_controller.js +9 -0
- data/test_app/app/javascript/controllers/ui/dialog_controller.js +19 -0
- data/test_app/app/javascript/controllers/ui/dropdown_controller.js +47 -0
- data/test_app/app/javascript/controllers/ui/popover_controller.js +47 -0
- data/test_app/app/javascript/controllers/ui/sheet_controller.js +19 -0
- data/test_app/app/javascript/controllers/ui/tabs_controller.js +24 -0
- data/test_app/app/javascript/controllers/ui/tooltip_controller.js +13 -0
- data/test_app/app/jobs/application_job.rb +7 -0
- data/test_app/app/mailers/application_mailer.rb +4 -0
- data/test_app/app/models/application_record.rb +3 -0
- data/test_app/app/models/concerns/.keep +0 -0
- data/test_app/app/views/layouts/application.html.erb +29 -0
- data/test_app/app/views/layouts/mailer.html.erb +13 -0
- data/test_app/app/views/layouts/mailer.text.erb +1 -0
- data/test_app/app/views/pwa/manifest.json.erb +22 -0
- data/test_app/app/views/pwa/service-worker.js +26 -0
- data/test_app/bin/brakeman +7 -0
- data/test_app/bin/bundler-audit +6 -0
- data/test_app/bin/ci +6 -0
- data/test_app/bin/dev +2 -0
- data/test_app/bin/docker-entrypoint +8 -0
- data/test_app/bin/importmap +4 -0
- data/test_app/bin/jobs +6 -0
- data/test_app/bin/kamal +16 -0
- data/test_app/bin/rails +4 -0
- data/test_app/bin/rake +4 -0
- data/test_app/bin/rubocop +8 -0
- data/test_app/bin/setup +35 -0
- data/test_app/bin/thrust +5 -0
- data/test_app/config/application.rb +27 -0
- data/test_app/config/boot.rb +4 -0
- data/test_app/config/bundler-audit.yml +5 -0
- data/test_app/config/cable.yml +17 -0
- data/test_app/config/cache.yml +16 -0
- data/test_app/config/ci.rb +24 -0
- data/test_app/config/credentials.yml.enc +1 -0
- data/test_app/config/database.yml +40 -0
- data/test_app/config/deploy.yml +119 -0
- data/test_app/config/environment.rb +5 -0
- data/test_app/config/environments/development.rb +78 -0
- data/test_app/config/environments/production.rb +90 -0
- data/test_app/config/environments/test.rb +53 -0
- data/test_app/config/importmap.rb +7 -0
- data/test_app/config/initializers/assets.rb +7 -0
- data/test_app/config/initializers/content_security_policy.rb +29 -0
- data/test_app/config/initializers/filter_parameter_logging.rb +8 -0
- data/test_app/config/initializers/inflections.rb +16 -0
- data/test_app/config/locales/en.yml +31 -0
- data/test_app/config/puma.rb +42 -0
- data/test_app/config/queue.yml +18 -0
- data/test_app/config/recurring.yml +15 -0
- data/test_app/config/routes.rb +13 -0
- data/test_app/config/storage.yml +27 -0
- data/test_app/config.ru +6 -0
- data/test_app/db/cable_schema.rb +11 -0
- data/test_app/db/cache_schema.rb +12 -0
- data/test_app/db/queue_schema.rb +129 -0
- data/test_app/db/seeds.rb +9 -0
- data/test_app/lib/tasks/.keep +0 -0
- data/test_app/log/.keep +0 -0
- data/test_app/public/400.html +135 -0
- data/test_app/public/404.html +135 -0
- data/test_app/public/406-unsupported-browser.html +135 -0
- data/test_app/public/422.html +135 -0
- data/test_app/public/500.html +135 -0
- data/test_app/public/icon.png +0 -0
- data/test_app/public/icon.svg +3 -0
- data/test_app/public/robots.txt +1 -0
- data/test_app/script/.keep +0 -0
- data/test_app/storage/.keep +0 -0
- data/test_app/test/controllers/.keep +0 -0
- data/test_app/test/fixtures/files/.keep +0 -0
- data/test_app/test/helpers/.keep +0 -0
- data/test_app/test/integration/.keep +0 -0
- data/test_app/test/mailers/.keep +0 -0
- data/test_app/test/models/.keep +0 -0
- data/test_app/test/test_helper.rb +15 -0
- data/test_app/tmp/.keep +0 -0
- data/test_app/tmp/pids/.keep +0 -0
- data/test_app/tmp/storage/.keep +0 -0
- data/test_app/vendor/.keep +0 -0
- data/test_app/vendor/javascript/.keep +0 -0
- metadata +448 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/* ============================================
|
|
2
|
+
* UikitRails — Toggle
|
|
3
|
+
*
|
|
4
|
+
* Pressable toggle button.
|
|
5
|
+
* Variants: default, outline
|
|
6
|
+
* Sizes: sm, md, lg
|
|
7
|
+
* ============================================ */
|
|
8
|
+
|
|
9
|
+
.ui-toggle {
|
|
10
|
+
display: inline-flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
gap: 0.5rem;
|
|
14
|
+
font-family: var(--ui-font-family);
|
|
15
|
+
font-weight: 500;
|
|
16
|
+
border: 1px solid transparent;
|
|
17
|
+
border-radius: var(--ui-radius);
|
|
18
|
+
background-color: transparent;
|
|
19
|
+
color: var(--ui-muted-foreground);
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
transition:
|
|
22
|
+
background-color var(--ui-transition-speed) ease,
|
|
23
|
+
color var(--ui-transition-speed) ease,
|
|
24
|
+
border-color var(--ui-transition-speed) ease;
|
|
25
|
+
line-height: 1;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.ui-toggle:hover {
|
|
29
|
+
background-color: var(--ui-muted);
|
|
30
|
+
color: var(--ui-muted-foreground);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.ui-toggle:focus-visible {
|
|
34
|
+
outline: 2px solid var(--ui-ring);
|
|
35
|
+
outline-offset: 2px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.ui-toggle:disabled {
|
|
39
|
+
opacity: 0.5;
|
|
40
|
+
pointer-events: none;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* --- Pressed state --- */
|
|
44
|
+
|
|
45
|
+
.ui-toggle--pressed {
|
|
46
|
+
background-color: var(--ui-accent);
|
|
47
|
+
color: var(--ui-accent-foreground);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.ui-toggle--pressed:hover {
|
|
51
|
+
background-color: color-mix(in srgb, var(--ui-accent) 80%, transparent);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* --- Variants --- */
|
|
55
|
+
|
|
56
|
+
.ui-toggle--outline {
|
|
57
|
+
border-color: var(--ui-border);
|
|
58
|
+
background-color: transparent;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.ui-toggle--outline:hover {
|
|
62
|
+
background-color: var(--ui-accent);
|
|
63
|
+
color: var(--ui-accent-foreground);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.ui-toggle--outline.ui-toggle--pressed {
|
|
67
|
+
background-color: var(--ui-accent);
|
|
68
|
+
color: var(--ui-accent-foreground);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* --- Sizes --- */
|
|
72
|
+
|
|
73
|
+
.ui-toggle--sm {
|
|
74
|
+
height: 2.25rem;
|
|
75
|
+
padding: 0 0.625rem;
|
|
76
|
+
font-size: var(--ui-font-size-xs);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.ui-toggle--md {
|
|
80
|
+
height: 2.5rem;
|
|
81
|
+
padding: 0 0.75rem;
|
|
82
|
+
font-size: var(--ui-font-size-sm);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.ui-toggle--lg {
|
|
86
|
+
height: 2.75rem;
|
|
87
|
+
padding: 0 1.25rem;
|
|
88
|
+
font-size: var(--ui-font-size-base);
|
|
89
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Basic tooltip (top position):
|
|
2
|
+
|
|
3
|
+
<%= render Ui::Tooltip::Component.new(text: "Tooltip text") do %>
|
|
4
|
+
<span>Hover me</span>
|
|
5
|
+
<% end %>
|
|
6
|
+
|
|
7
|
+
Positions (top, bottom, left, right):
|
|
8
|
+
|
|
9
|
+
<%= render Ui::Tooltip::Component.new(text: "Bottom tip", position: :bottom) do %>
|
|
10
|
+
<span>Hover me</span>
|
|
11
|
+
<% end %>
|
|
12
|
+
|
|
13
|
+
With a button trigger:
|
|
14
|
+
|
|
15
|
+
<%= render Ui::Tooltip::Component.new(text: "Save your changes") do %>
|
|
16
|
+
<%= render Ui::Button::Component.new do %>Save<% end %>
|
|
17
|
+
<% end %>
|
|
18
|
+
|
|
19
|
+
With custom attributes:
|
|
20
|
+
|
|
21
|
+
<%= render Ui::Tooltip::Component.new(text: "Info", class: "extra", data: { turbo: false }) do %>
|
|
22
|
+
<span>Hover</span>
|
|
23
|
+
<% end %>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<div class="ui-tooltip" data-controller="ui--tooltip" <%= tag.attributes(html_attrs) %>>
|
|
2
|
+
<div class="ui-tooltip__trigger" data-action="mouseenter->ui--tooltip#show mouseleave->ui--tooltip#hide focusin->ui--tooltip#show focusout->ui--tooltip#hide">
|
|
3
|
+
<%= content %>
|
|
4
|
+
</div>
|
|
5
|
+
<div class="ui-tooltip__content ui-tooltip__content--<%= position %>" role="tooltip" data-ui--tooltip-target="content" hidden>
|
|
6
|
+
<%= text %>
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Ui
|
|
4
|
+
module Tooltip
|
|
5
|
+
# Hover/focus tooltip popup.
|
|
6
|
+
class Component < Ui::BaseComponent
|
|
7
|
+
POSITIONS = %i[top bottom left right].freeze
|
|
8
|
+
|
|
9
|
+
attr_reader :text, :position, :html_attrs
|
|
10
|
+
|
|
11
|
+
def initialize(text:, position: :top, **html_attrs)
|
|
12
|
+
@text = text
|
|
13
|
+
@position = position.to_sym
|
|
14
|
+
@html_attrs = html_attrs
|
|
15
|
+
super()
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
description: A hover/focus tooltip that displays additional information. Supports four positions (top, bottom, left, right) and works with any trigger content.
|
|
2
|
+
|
|
3
|
+
sections:
|
|
4
|
+
- title: Positions
|
|
5
|
+
examples:
|
|
6
|
+
- title: Top (default)
|
|
7
|
+
code: |
|
|
8
|
+
<%= render Ui::Tooltip::Component.new(text: "This is a tooltip") do %>
|
|
9
|
+
<%= render Ui::Button::Component.new(variant: :outline) do %>Hover me<% end %>
|
|
10
|
+
<% end %>
|
|
11
|
+
|
|
12
|
+
- title: Bottom
|
|
13
|
+
code: |
|
|
14
|
+
<%= render Ui::Tooltip::Component.new(text: "Bottom tooltip", position: :bottom) do %>
|
|
15
|
+
<%= render Ui::Button::Component.new(variant: :outline) do %>Bottom<% end %>
|
|
16
|
+
<% end %>
|
|
17
|
+
|
|
18
|
+
- title: Left
|
|
19
|
+
code: |
|
|
20
|
+
<div style="padding-left: 10rem;">
|
|
21
|
+
<%= render Ui::Tooltip::Component.new(text: "Left tooltip", position: :left) do %>
|
|
22
|
+
<%= render Ui::Button::Component.new(variant: :outline) do %>Left<% end %>
|
|
23
|
+
<% end %>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
- title: Right
|
|
27
|
+
code: |
|
|
28
|
+
<%= render Ui::Tooltip::Component.new(text: "Right tooltip", position: :right) do %>
|
|
29
|
+
<%= render Ui::Button::Component.new(variant: :outline) do %>Right<% end %>
|
|
30
|
+
<% end %>
|
|
31
|
+
|
|
32
|
+
- title: With Different Triggers
|
|
33
|
+
examples:
|
|
34
|
+
- title: Text trigger
|
|
35
|
+
code: |
|
|
36
|
+
<%= render Ui::Tooltip::Component.new(text: "More information about this item") do %>
|
|
37
|
+
<span style="border-bottom: 1px dashed; cursor: help;">What is this?</span>
|
|
38
|
+
<% end %>
|
|
39
|
+
|
|
40
|
+
- title: Icon trigger
|
|
41
|
+
code: |
|
|
42
|
+
<%= render Ui::Tooltip::Component.new(text: "Settings") do %>
|
|
43
|
+
<%= render Ui::Button::Component.new(variant: :ghost, size: :icon) do %>⚙<% end %>
|
|
44
|
+
<% end %>
|
|
45
|
+
|
|
46
|
+
- title: Custom Attributes
|
|
47
|
+
examples:
|
|
48
|
+
- title: With custom class
|
|
49
|
+
code: |
|
|
50
|
+
<%= render Ui::Tooltip::Component.new(text: "Custom tooltip", class: "my-tooltip") do %>
|
|
51
|
+
<%= render Ui::Button::Component.new do %>Custom<% end %>
|
|
52
|
+
<% end %>
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/* ============================================
|
|
2
|
+
* UikitRails — Tooltip
|
|
3
|
+
*
|
|
4
|
+
* Hover/focus tooltip popup with four placement
|
|
5
|
+
* options: top, bottom, left, right.
|
|
6
|
+
* ============================================ */
|
|
7
|
+
|
|
8
|
+
.ui-tooltip {
|
|
9
|
+
position: relative;
|
|
10
|
+
display: inline-flex;
|
|
11
|
+
font-family: var(--ui-font-family);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.ui-tooltip__trigger {
|
|
15
|
+
display: inline-flex;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* --- Tooltip Content --- */
|
|
19
|
+
|
|
20
|
+
.ui-tooltip__content {
|
|
21
|
+
position: absolute;
|
|
22
|
+
z-index: 50;
|
|
23
|
+
background-color: var(--ui-foreground);
|
|
24
|
+
color: var(--ui-background);
|
|
25
|
+
font-size: var(--ui-font-size-xs);
|
|
26
|
+
line-height: 1.4;
|
|
27
|
+
padding: 0.375rem 0.75rem;
|
|
28
|
+
border-radius: var(--ui-radius);
|
|
29
|
+
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
|
|
30
|
+
white-space: nowrap;
|
|
31
|
+
pointer-events: none;
|
|
32
|
+
opacity: 0;
|
|
33
|
+
transition: opacity var(--ui-transition-speed) ease;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.ui-tooltip__content[hidden] {
|
|
37
|
+
display: none;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.ui-tooltip__content:not([hidden]) {
|
|
41
|
+
opacity: 1;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* --- Position: Top (default) --- */
|
|
45
|
+
|
|
46
|
+
.ui-tooltip__content--top {
|
|
47
|
+
bottom: 100%;
|
|
48
|
+
left: 50%;
|
|
49
|
+
transform: translateX(-50%);
|
|
50
|
+
margin-bottom: 0.5rem;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* --- Position: Bottom --- */
|
|
54
|
+
|
|
55
|
+
.ui-tooltip__content--bottom {
|
|
56
|
+
top: 100%;
|
|
57
|
+
left: 50%;
|
|
58
|
+
transform: translateX(-50%);
|
|
59
|
+
margin-top: 0.5rem;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* --- Position: Left --- */
|
|
63
|
+
|
|
64
|
+
.ui-tooltip__content--left {
|
|
65
|
+
right: 100%;
|
|
66
|
+
top: 50%;
|
|
67
|
+
transform: translateY(-50%);
|
|
68
|
+
margin-right: 0.5rem;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* --- Position: Right --- */
|
|
72
|
+
|
|
73
|
+
.ui-tooltip__content--right {
|
|
74
|
+
left: 100%;
|
|
75
|
+
top: 50%;
|
|
76
|
+
transform: translateY(-50%);
|
|
77
|
+
margin-left: 0.5rem;
|
|
78
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Controller } from "@hotwired/stimulus"
|
|
2
|
+
|
|
3
|
+
export default class extends Controller {
|
|
4
|
+
static targets = ["item"]
|
|
5
|
+
static values = { multiple: { type: Boolean, default: false } }
|
|
6
|
+
|
|
7
|
+
toggle(event) {
|
|
8
|
+
if (this.multipleValue) return
|
|
9
|
+
|
|
10
|
+
const toggled = event.currentTarget
|
|
11
|
+
if (!toggled.open) return
|
|
12
|
+
|
|
13
|
+
this.itemTargets.forEach(item => {
|
|
14
|
+
if (item !== toggled && item.open) {
|
|
15
|
+
item.open = false
|
|
16
|
+
}
|
|
17
|
+
})
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Controller } from "@hotwired/stimulus"
|
|
2
|
+
|
|
3
|
+
export default class extends Controller {
|
|
4
|
+
static targets = ["dialog"]
|
|
5
|
+
|
|
6
|
+
open() {
|
|
7
|
+
this.dialogTarget.showModal()
|
|
8
|
+
document.body.style.overflow = "hidden"
|
|
9
|
+
this.dialogTarget.addEventListener("cancel", this.preventCancel)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
close() {
|
|
13
|
+
this.dialogTarget.removeEventListener("cancel", this.preventCancel)
|
|
14
|
+
this.dialogTarget.close()
|
|
15
|
+
document.body.style.overflow = ""
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
preventCancel(event) {
|
|
19
|
+
event.preventDefault()
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
disconnect() {
|
|
23
|
+
document.body.style.overflow = ""
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Controller } from "@hotwired/stimulus"
|
|
2
|
+
|
|
3
|
+
export default class extends Controller {
|
|
4
|
+
static targets = ["dialog"]
|
|
5
|
+
|
|
6
|
+
open() {
|
|
7
|
+
this.dialogTarget.showModal()
|
|
8
|
+
document.body.style.overflow = "hidden"
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
close() {
|
|
12
|
+
this.dialogTarget.close()
|
|
13
|
+
document.body.style.overflow = ""
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
disconnect() {
|
|
17
|
+
document.body.style.overflow = ""
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Controller } from "@hotwired/stimulus"
|
|
2
|
+
|
|
3
|
+
export default class extends Controller {
|
|
4
|
+
static targets = ["menu"]
|
|
5
|
+
|
|
6
|
+
connect() {
|
|
7
|
+
this.boundClose = this.closeOnOutsideClick.bind(this)
|
|
8
|
+
this.boundEscape = this.closeOnEscape.bind(this)
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
toggle() {
|
|
12
|
+
if (this.menuTarget.hidden) {
|
|
13
|
+
this.open()
|
|
14
|
+
} else {
|
|
15
|
+
this.close()
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
open() {
|
|
20
|
+
this.menuTarget.hidden = false
|
|
21
|
+
document.addEventListener("click", this.boundClose)
|
|
22
|
+
document.addEventListener("keydown", this.boundEscape)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
close() {
|
|
26
|
+
this.menuTarget.hidden = true
|
|
27
|
+
document.removeEventListener("click", this.boundClose)
|
|
28
|
+
document.removeEventListener("keydown", this.boundEscape)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
closeOnOutsideClick(event) {
|
|
32
|
+
if (!this.element.contains(event.target)) {
|
|
33
|
+
this.close()
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
closeOnEscape(event) {
|
|
38
|
+
if (event.key === "Escape") {
|
|
39
|
+
this.close()
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
disconnect() {
|
|
44
|
+
document.removeEventListener("click", this.boundClose)
|
|
45
|
+
document.removeEventListener("keydown", this.boundEscape)
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Controller } from "@hotwired/stimulus"
|
|
2
|
+
|
|
3
|
+
export default class extends Controller {
|
|
4
|
+
static targets = ["content"]
|
|
5
|
+
|
|
6
|
+
connect() {
|
|
7
|
+
this._onOutsideClick = this._onOutsideClick.bind(this)
|
|
8
|
+
this._onKeydown = this._onKeydown.bind(this)
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
toggle() {
|
|
12
|
+
if (this.contentTarget.classList.contains("ui-popover__content--open")) {
|
|
13
|
+
this.close()
|
|
14
|
+
} else {
|
|
15
|
+
this.open()
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
open() {
|
|
20
|
+
this.contentTarget.classList.add("ui-popover__content--open")
|
|
21
|
+
document.addEventListener("click", this._onOutsideClick)
|
|
22
|
+
document.addEventListener("keydown", this._onKeydown)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
close() {
|
|
26
|
+
this.contentTarget.classList.remove("ui-popover__content--open")
|
|
27
|
+
document.removeEventListener("click", this._onOutsideClick)
|
|
28
|
+
document.removeEventListener("keydown", this._onKeydown)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
_onOutsideClick(event) {
|
|
32
|
+
if (!this.element.contains(event.target)) {
|
|
33
|
+
this.close()
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
_onKeydown(event) {
|
|
38
|
+
if (event.key === "Escape") {
|
|
39
|
+
this.close()
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
disconnect() {
|
|
44
|
+
document.removeEventListener("click", this._onOutsideClick)
|
|
45
|
+
document.removeEventListener("keydown", this._onKeydown)
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Controller } from "@hotwired/stimulus"
|
|
2
|
+
|
|
3
|
+
export default class extends Controller {
|
|
4
|
+
static targets = ["dialog"]
|
|
5
|
+
|
|
6
|
+
open() {
|
|
7
|
+
this.dialogTarget.showModal()
|
|
8
|
+
document.body.style.overflow = "hidden"
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
close() {
|
|
12
|
+
this.dialogTarget.close()
|
|
13
|
+
document.body.style.overflow = ""
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
disconnect() {
|
|
17
|
+
document.body.style.overflow = ""
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Controller } from "@hotwired/stimulus"
|
|
2
|
+
|
|
3
|
+
export default class extends Controller {
|
|
4
|
+
static targets = ["trigger", "panel"]
|
|
5
|
+
static values = { default: String }
|
|
6
|
+
|
|
7
|
+
connect() {
|
|
8
|
+
this.select({ params: { id: this.defaultValue } })
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
select({ params: { id } }) {
|
|
12
|
+
this.triggerTargets.forEach(trigger => {
|
|
13
|
+
const isActive = trigger.dataset.uiTabsIdParam === id
|
|
14
|
+
trigger.classList.toggle("ui-tabs__trigger--active", isActive)
|
|
15
|
+
trigger.setAttribute("aria-selected", isActive)
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
this.panelTargets.forEach(panel => {
|
|
19
|
+
const isActive = panel.dataset.tabId === id
|
|
20
|
+
panel.classList.toggle("ui-tabs__panel--active", isActive)
|
|
21
|
+
panel.hidden = !isActive
|
|
22
|
+
})
|
|
23
|
+
}
|
|
24
|
+
}
|
data/lib/uikit_rails.rb
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "uikit_rails/version"
|
|
4
|
+
|
|
5
|
+
# Copy-paste UI components for Rails, inspired by shadcn/ui.
|
|
6
|
+
module UikitRails
|
|
7
|
+
class Error < StandardError; end
|
|
8
|
+
|
|
9
|
+
COMPONENTS = %w[
|
|
10
|
+
accordion
|
|
11
|
+
alert
|
|
12
|
+
alert_dialog
|
|
13
|
+
avatar
|
|
14
|
+
badge
|
|
15
|
+
breadcrumb
|
|
16
|
+
button
|
|
17
|
+
card
|
|
18
|
+
checkbox
|
|
19
|
+
collapsible
|
|
20
|
+
dialog
|
|
21
|
+
dropdown
|
|
22
|
+
form
|
|
23
|
+
input
|
|
24
|
+
label
|
|
25
|
+
pagination
|
|
26
|
+
popover
|
|
27
|
+
progress
|
|
28
|
+
select
|
|
29
|
+
separator
|
|
30
|
+
sheet
|
|
31
|
+
skeleton
|
|
32
|
+
switch
|
|
33
|
+
table
|
|
34
|
+
tabs
|
|
35
|
+
textarea
|
|
36
|
+
toggle
|
|
37
|
+
tooltip
|
|
38
|
+
].freeze
|
|
39
|
+
|
|
40
|
+
class << self
|
|
41
|
+
def component_path(name)
|
|
42
|
+
File.join(templates_root, "components", name)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def templates_root
|
|
46
|
+
File.expand_path("uikit_rails/templates", __dir__)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def component_exists?(name)
|
|
50
|
+
COMPONENTS.include?(name) && Dir.exist?(component_path(name))
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def available_components
|
|
54
|
+
COMPONENTS.select { |name| Dir.exist?(component_path(name)) }
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
require_relative "uikit_rails/engine" if defined?(Rails::Railtie)
|
data/sig/uikit_rails.rbs
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# See https://docs.docker.com/engine/reference/builder/#dockerignore-file for more about ignoring files.
|
|
2
|
+
|
|
3
|
+
# Ignore git directory.
|
|
4
|
+
/.git/
|
|
5
|
+
/.gitignore
|
|
6
|
+
|
|
7
|
+
# Ignore bundler config.
|
|
8
|
+
/.bundle
|
|
9
|
+
|
|
10
|
+
# Ignore all environment files.
|
|
11
|
+
/.env*
|
|
12
|
+
|
|
13
|
+
# Ignore all default key files.
|
|
14
|
+
/config/master.key
|
|
15
|
+
/config/credentials/*.key
|
|
16
|
+
|
|
17
|
+
# Ignore all logfiles and tempfiles.
|
|
18
|
+
/log/*
|
|
19
|
+
/tmp/*
|
|
20
|
+
!/log/.keep
|
|
21
|
+
!/tmp/.keep
|
|
22
|
+
|
|
23
|
+
# Ignore pidfiles, but keep the directory.
|
|
24
|
+
/tmp/pids/*
|
|
25
|
+
!/tmp/pids/.keep
|
|
26
|
+
|
|
27
|
+
# Ignore storage (uploaded files in development and any SQLite databases).
|
|
28
|
+
/storage/*
|
|
29
|
+
!/storage/.keep
|
|
30
|
+
/tmp/storage/*
|
|
31
|
+
!/tmp/storage/.keep
|
|
32
|
+
|
|
33
|
+
# Ignore assets.
|
|
34
|
+
/node_modules/
|
|
35
|
+
/app/assets/builds/*
|
|
36
|
+
!/app/assets/builds/.keep
|
|
37
|
+
/public/assets
|
|
38
|
+
|
|
39
|
+
# Ignore CI service files.
|
|
40
|
+
/.github
|
|
41
|
+
|
|
42
|
+
# Ignore Kamal files.
|
|
43
|
+
/config/deploy*.yml
|
|
44
|
+
/.kamal
|
|
45
|
+
|
|
46
|
+
# Ignore development files
|
|
47
|
+
/.devcontainer
|
|
48
|
+
|
|
49
|
+
# Ignore Docker-related files
|
|
50
|
+
/.dockerignore
|
|
51
|
+
/Dockerfile*
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# See https://git-scm.com/docs/gitattributes for more about git attribute files.
|
|
2
|
+
|
|
3
|
+
# Mark the database schema as having been generated.
|
|
4
|
+
db/schema.rb linguist-generated
|
|
5
|
+
|
|
6
|
+
# Mark any vendored files as having been vendored.
|
|
7
|
+
vendor/* linguist-vendored
|
|
8
|
+
config/credentials/*.yml.enc diff=rails_credentials
|
|
9
|
+
config/credentials.yml.enc diff=rails_credentials
|