shoelace-rails-ui 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.DS_Store +0 -0
- data/CHANGELOG.md +5 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/Gemfile +12 -0
- data/Gemfile.lock +42 -0
- data/LICENSE.txt +21 -0
- data/README-real.md +24 -0
- data/README.md +43 -0
- data/Rakefile +16 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/lib/shoelace/rails/ui/version.rb +9 -0
- data/lib/shoelace/rails/ui.rb +12 -0
- data/regenerate.rb +48 -0
- data/remote-src/.DS_Store +0 -0
- data/remote-src/2.0.0.beta64/.DS_Store +0 -0
- data/remote-src/2.0.0.beta64/shoelace-next/.editorconfig +15 -0
- data/remote-src/2.0.0.beta64/shoelace-next/.github/CODE_OF_CONDUCT.md +44 -0
- data/remote-src/2.0.0.beta64/shoelace-next/.github/FUNDING.yml +1 -0
- data/remote-src/2.0.0.beta64/shoelace-next/.github/ISSUE_TEMPLATE/bug_report.md +36 -0
- data/remote-src/2.0.0.beta64/shoelace-next/.github/ISSUE_TEMPLATE/config.yml +4 -0
- data/remote-src/2.0.0.beta64/shoelace-next/.github/ISSUE_TEMPLATE/feature_request.md +17 -0
- data/remote-src/2.0.0.beta64/shoelace-next/.github/SECURITY.md +7 -0
- data/remote-src/2.0.0.beta64/shoelace-next/.github/workflows/node.js.yml +30 -0
- data/remote-src/2.0.0.beta64/shoelace-next/.github/workflows/release.yml +17 -0
- data/remote-src/2.0.0.beta64/shoelace-next/.gitignore +8 -0
- data/remote-src/2.0.0.beta64/shoelace-next/.husky/pre-commit +4 -0
- data/remote-src/2.0.0.beta64/shoelace-next/.prettierignore +12 -0
- data/remote-src/2.0.0.beta64/shoelace-next/.vscode/extensions.json +9 -0
- data/remote-src/2.0.0.beta64/shoelace-next/.vscode/settings.json +4 -0
- data/remote-src/2.0.0.beta64/shoelace-next/CONTRIBUTING.md +5 -0
- data/remote-src/2.0.0.beta64/shoelace-next/LICENSE.md +7 -0
- data/remote-src/2.0.0.beta64/shoelace-next/README.md +94 -0
- data/remote-src/2.0.0.beta64/shoelace-next/cspell.json +110 -0
- data/remote-src/2.0.0.beta64/shoelace-next/custom-elements-manifest.config.js +104 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/404.md +5 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/_sidebar.md +89 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/icons/sprite.svg +1 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/chrome.png +0 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/edge.png +0 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/firefox.png +0 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/logo.svg +7 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/og-image.png +0 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/opera.png +0 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/safari.png +0 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/shoe.svg +134 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/tie.webp +0 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/touch-icon.png +0 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/twitter-card.png +0 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/undraw-content-team.svg +80 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/undraw-not-found.svg +1 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/walk.gif +0 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/wordmark.svg +7 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/code-block/code-block.css +228 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/code-block/code-block.js +376 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/metadata/metadata.js +537 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/scroll-position/scroll-position.js +24 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/search/lunr.min.js +1311 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/search/search.css +180 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/search/search.js +293 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/theme-picker/theme-picker.css +29 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/theme-picker/theme-picker.js +83 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/styles/docs.css +642 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/alert.md +441 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/animated-image.md +128 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/animation.md +351 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/avatar.md +201 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/badge.md +191 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/breadcrumb-item.md +35 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/breadcrumb.md +266 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/button-group.md +470 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/button.md +453 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/card.md +311 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/checkbox.md +71 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/color-picker.md +101 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/details.md +89 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/dialog.md +265 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/divider.md +152 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/drawer.md +452 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/dropdown.md +389 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/format-bytes.md +126 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/format-date.md +120 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/format-number.md +124 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/icon-button.md +160 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/icon.md +711 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/image-comparer.md +51 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/include.md +47 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/input.md +283 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/menu-item.md +255 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/menu-label.md +52 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/menu.md +49 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/mutation-observer.md +196 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/progress-bar.md +144 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/progress-ring.md +178 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/qr-code.md +167 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/radio-group.md +52 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/radio.md +59 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/range.md +180 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/rating.md +153 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/relative-time.md +105 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/resize-observer.md +68 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/responsive-media.md +73 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/select.md +457 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/skeleton.md +439 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/spinner.md +86 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/split-panel.md +671 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/switch.md +77 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/tab-group.md +359 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/tab-panel.md +41 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/tab.md +29 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/tag.md +142 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/textarea.md +184 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/tooltip.md +410 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/visually-hidden.md +47 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/frameworks/angular.md +46 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/frameworks/react.md +156 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/frameworks/vue.md +92 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/getting-started/customizing.md +153 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/getting-started/form-controls.md +336 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/getting-started/installation.md +137 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/getting-started/localization.md +140 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/getting-started/overview.md +131 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/getting-started/themes.md +139 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/getting-started/usage.md +173 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/index.html +98 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/resources/accessibility.md +18 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/resources/changelog.md +925 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/resources/community.md +53 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/resources/contributing.md +261 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/tokens/border-radius.md +12 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/tokens/color.md +439 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/tokens/elevation.md +11 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/tokens/spacing.md +16 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/tokens/transition.md +11 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/tokens/typography.md +58 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/tokens/z-index.md +11 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/tutorials/integrating-with-laravel.md +117 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/tutorials/integrating-with-nextjs.md +137 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/tutorials/integrating-with-rails.md +103 -0
- data/remote-src/2.0.0.beta64/shoelace-next/lint-staged.config.js +4 -0
- data/remote-src/2.0.0.beta64/shoelace-next/package-lock.json +9534 -0
- data/remote-src/2.0.0.beta64/shoelace-next/package.json +93 -0
- data/remote-src/2.0.0.beta64/shoelace-next/prettier.config.cjs +17 -0
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/build.js +158 -0
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/make-css.js +42 -0
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/make-icons.js +71 -0
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/make-metadata.js +11 -0
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/make-react.js +63 -0
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/make-search.js +100 -0
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/make-vscode-data.js +58 -0
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/plop/plopfile.js +67 -0
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/plop/templates/component/component.hbs +44 -0
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/plop/templates/component/docs.hbs +21 -0
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/plop/templates/component/styles.hbs +10 -0
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/plop/templates/component/tests.hbs +13 -0
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/shared.js +18 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/alert/alert.styles.ts +95 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/alert/alert.test.ts +93 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/alert/alert.ts +238 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/animated-image/animated-image.styles.ts +52 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/animated-image/animated-image.test.ts +13 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/animated-image/animated-image.ts +120 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/animation/animation.styles.ts +10 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/animation/animation.ts +222 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/animation/animations.ts +15 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/avatar/avatar.styles.ts +66 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/avatar/avatar.test.ts +111 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/avatar/avatar.ts +83 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/badge/badge.styles.ts +94 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/badge/badge.test.ts +77 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/badge/badge.ts +53 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/breadcrumb/breadcrumb.styles.ts +12 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/breadcrumb/breadcrumb.test.ts +104 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/breadcrumb/breadcrumb.ts +82 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/breadcrumb-item/breadcrumb-item.styles.ts +85 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/breadcrumb-item/breadcrumb-item.test.ts +160 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/breadcrumb-item/breadcrumb-item.ts +92 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/button/button.styles.ts +637 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/button/button.ts +209 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/button-group/button-group.styles.ts +15 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/button-group/button-group.ts +84 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/card/card.styles.ts +62 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/card/card.test.ts +139 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/card/card.ts +68 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/checkbox/checkbox.styles.ts +108 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/checkbox/checkbox.test.ts +47 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/checkbox/checkbox.ts +203 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/color-picker/color-picker.styles.ts +326 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/color-picker/color-picker.test.ts +43 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/color-picker/color-picker.ts +853 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/details/details.styles.ts +73 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/details/details.test.ts +153 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/details/details.ts +192 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/dialog/dialog.styles.ts +106 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/dialog/dialog.test.ts +135 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/dialog/dialog.ts +296 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/divider/divider.styles.ts +25 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/divider/divider.ts +34 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/drawer/drawer.styles.ts +142 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/drawer/drawer.test.ts +135 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/drawer/drawer.ts +377 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/dropdown/dropdown.styles.ts +58 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/dropdown/dropdown.test.ts +147 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/dropdown/dropdown.ts +459 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/format-bytes/format-bytes.ts +35 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/format-date/format-date.ts +81 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/format-number/format-number.ts +69 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/icon/icon.styles.ts +21 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/icon/icon.ts +131 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/icon/library.default.ts +9 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/icon/library.system.ts +97 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/icon/library.ts +49 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/icon/request.ts +36 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/icon-button/icon-button.styles.ts +48 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/icon-button/icon-button.ts +100 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/image-comparer/image-comparer.styles.ts +77 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/image-comparer/image-comparer.ts +147 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/include/include.styles.ts +10 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/include/include.test.ts +62 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/include/include.ts +80 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/include/request.ts +23 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/input/input.styles.ts +282 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/input/input.test.ts +35 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/input/input.ts +410 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/menu/menu.styles.ts +18 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/menu/menu.ts +205 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/menu-item/menu-item.styles.ts +84 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/menu-item/menu-item.ts +92 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/menu-label/menu-label.styles.ts +21 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/menu-label/menu-label.ts +30 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/mutation-observer/mutation-observer.styles.ts +10 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/mutation-observer/mutation-observer.test.ts +13 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/mutation-observer/mutation-observer.ts +118 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/progress-bar/progress-bar.styles.ts +57 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/progress-bar/progress-bar.test.ts +89 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/progress-bar/progress-bar.ts +74 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/progress-ring/progress-ring.styles.ts +66 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/progress-ring/progress-ring.test.ts +68 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/progress-ring/progress-ring.ts +84 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/qr-code/qr-code.styles.ts +22 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/qr-code/qr-code.ts +90 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/radio/radio.styles.ts +107 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/radio/radio.test.ts +65 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/radio/radio.ts +226 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/radio-group/radio-group.styles.ts +47 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/radio-group/radio-group.ts +66 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/range/range.styles.ts +192 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/range/range.ts +273 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/rating/rating.styles.ts +79 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/rating/rating.ts +249 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/relative-time/relative-time.ts +116 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/resize-observer/resize-observer.styles.ts +10 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/resize-observer/resize-observer.ts +87 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/responsive-media/responsive-media.styles.ts +36 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/responsive-media/responsive-media.ts +50 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/select/select.styles.ts +331 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/select/select.test.ts +56 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/select/select.ts +560 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/skeleton/skeleton.styles.ts +60 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/skeleton/skeleton.ts +46 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/spinner/spinner.styles.ts +56 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/spinner/spinner.test.ts +24 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/spinner/spinner.ts +34 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/split-panel/split-panel.styles.ts +76 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/split-panel/split-panel.test.ts +13 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/split-panel/split-panel.ts +272 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/switch/switch.styles.ts +135 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/switch/switch.test.ts +64 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/switch/switch.ts +187 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tab/tab.styles.ts +61 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tab/tab.ts +104 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tab-group/tab-group.styles.ts +209 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tab-group/tab-group.ts +409 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tab-panel/tab-panel.styles.ts +17 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tab-panel/tab-panel.ts +49 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tag/tag.styles.ts +110 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tag/tag.ts +92 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/textarea/textarea.styles.ts +167 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/textarea/textarea.test.ts +35 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/textarea/textarea.ts +339 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tooltip/tooltip.styles.ts +131 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tooltip/tooltip.test.ts +117 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tooltip/tooltip.ts +355 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/visually-hidden/visually-hidden.styles.ts +18 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/visually-hidden/visually-hidden.test.ts +39 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/visually-hidden/visually-hidden.ts +24 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/declaration.d.ts +8 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/animate.ts +70 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/event.ts +35 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/focus-visible.ts +26 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/form-control.ts +203 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/formdata-event-polyfill.ts +93 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/math.ts +8 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/modal.ts +53 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/number.ts +32 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/offset.ts +13 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/scroll.ts +57 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/slot.ts +91 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/string.ts +3 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/support.ts +15 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/tabbable.ts +81 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/watch.ts +40 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/shoelace.ts +58 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/styles/component.styles.ts +23 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/styles/form-control.styles.ts +52 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/styles/utility.styles.ts +23 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/themes/dark.styles.ts +524 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/themes/light.styles.ts +524 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/de-ch.ts +21 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/de.ts +21 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/en.ts +21 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/es.ts +21 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/fr.ts +21 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/he.ts +21 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/ja.ts +21 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/nl.ts +21 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/pl.ts +21 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/pt.ts +21 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/ru.ts +21 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/utilities/animation-registry.ts +59 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/utilities/animation.ts +1 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/utilities/base-path.ts +43 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/utilities/form.ts +22 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/utilities/icon-library.ts +1 -0
- data/remote-src/2.0.0.beta64/shoelace-next/src/utilities/localize.ts +5 -0
- data/remote-src/2.0.0.beta64/shoelace-next/tsconfig.json +35 -0
- data/remote-src/2.0.0.beta64/shoelace-next/vercel.json +4 -0
- data/remote-src/2.0.0.beta64/shoelace-next/web-test-runner.config.js +14 -0
- data/shoelace-rails-ui.gemspec +39 -0
- data/shoelace-rails-ui.rb +0 -0
- metadata +377 -0
@@ -0,0 +1,167 @@
|
|
1
|
+
# QR Code
|
2
|
+
|
3
|
+
[component-header:sl-qr-code]
|
4
|
+
|
5
|
+
Generates a [QR code](https://www.qrcode.com/) and renders it using the [Canvas API](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API).
|
6
|
+
|
7
|
+
QR codes are useful for providing small pieces of information to users who can quickly scan them with a smartphone. Most smartphones have built-in QR code scanners, so simply pointing the camera at a QR code will decode it and allow the user to visit a website, dial a phone number, read a message, etc.
|
8
|
+
|
9
|
+
```html preview
|
10
|
+
<div class="qr-overview">
|
11
|
+
<sl-qr-code value="https://shoelace.style/" label="Scan this code to visit Shoelace on the web!"></sl-qr-code>
|
12
|
+
<br>
|
13
|
+
|
14
|
+
<sl-input maxlength="255" clearable></sl-input>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
<script>
|
18
|
+
const container = document.querySelector('.qr-overview');
|
19
|
+
const qrCode = container.querySelector('sl-qr-code');
|
20
|
+
const input = container.querySelector('sl-input');
|
21
|
+
|
22
|
+
input.value = qrCode.value;
|
23
|
+
input.addEventListener('sl-input', () => qrCode.value = input.value);
|
24
|
+
</script>
|
25
|
+
|
26
|
+
<style>
|
27
|
+
.qr-overview {
|
28
|
+
max-width: 256px;
|
29
|
+
}
|
30
|
+
|
31
|
+
.qr-overview sl-input {
|
32
|
+
margin-top: 1rem;
|
33
|
+
}
|
34
|
+
</style>
|
35
|
+
```
|
36
|
+
|
37
|
+
```jsx react
|
38
|
+
import { useState } from 'react';
|
39
|
+
import { SlQrCode, SlInput } from '@shoelace-style/shoelace/dist/react';
|
40
|
+
|
41
|
+
const css = `
|
42
|
+
.qr-overview {
|
43
|
+
max-width: 256px;
|
44
|
+
}
|
45
|
+
|
46
|
+
.qr-overview sl-input {
|
47
|
+
margin-top: 1rem;
|
48
|
+
}
|
49
|
+
`;
|
50
|
+
|
51
|
+
const App = () => {
|
52
|
+
const [value, setValue] = useState('https://shoelace.style/');
|
53
|
+
|
54
|
+
return (
|
55
|
+
<>
|
56
|
+
<div className="qr-overview">
|
57
|
+
<SlQrCode value={value} label="Scan this code to visit Shoelace on the web!" />
|
58
|
+
<br />
|
59
|
+
|
60
|
+
<SlInput maxlength="255" clearable onInput={event => setValue(event.target.value)} />
|
61
|
+
</div>
|
62
|
+
|
63
|
+
<style>{css}</style>
|
64
|
+
</>
|
65
|
+
);
|
66
|
+
};
|
67
|
+
```
|
68
|
+
|
69
|
+
## Examples
|
70
|
+
|
71
|
+
### Colors
|
72
|
+
|
73
|
+
Use the `fill` and `background` attributes to modify the QR code's colors. You should always ensure good contrast for optimal compatibility with QR code scanners.
|
74
|
+
|
75
|
+
```html preview
|
76
|
+
<sl-qr-code value="https://shoelace.style/" fill="deeppink" background="white"></sl-qr-code>
|
77
|
+
```
|
78
|
+
|
79
|
+
```jsx react
|
80
|
+
import { SlQrCode } from '@shoelace-style/shoelace/dist/react';
|
81
|
+
|
82
|
+
const App = () => (
|
83
|
+
<SlQrCode value="https://shoelace.style/" fill="deeppink" background="white" />
|
84
|
+
);
|
85
|
+
```
|
86
|
+
|
87
|
+
### Size
|
88
|
+
|
89
|
+
Use the `size` attribute to change the size of the QR code.
|
90
|
+
|
91
|
+
```html preview
|
92
|
+
<sl-qr-code value="https://shoelace.style/" size="64"></sl-qr-code>
|
93
|
+
```
|
94
|
+
|
95
|
+
```jsx react
|
96
|
+
import { SlQrCode } from '@shoelace-style/shoelace/dist/react';
|
97
|
+
|
98
|
+
const App = () => (
|
99
|
+
<SlQrCode value="https://shoelace.style/" size="64" />
|
100
|
+
);
|
101
|
+
```
|
102
|
+
|
103
|
+
### Radius
|
104
|
+
|
105
|
+
Create a rounded effect with the `radius` attribute.
|
106
|
+
|
107
|
+
```html preview
|
108
|
+
<sl-qr-code value="https://shoelace.style/" radius="0.5"></sl-qr-code>
|
109
|
+
```
|
110
|
+
|
111
|
+
```jsx react
|
112
|
+
import { SlQrCode } from '@shoelace-style/shoelace/dist/react';
|
113
|
+
|
114
|
+
const App = () => (
|
115
|
+
<SlQrCode value="https://shoelace.style/" radius="0.5" />
|
116
|
+
);
|
117
|
+
```
|
118
|
+
|
119
|
+
### Error Correction
|
120
|
+
|
121
|
+
QR codes can be rendered with various levels of [error correction](https://www.qrcode.com/en/about/error_correction.html) that can be set using the `error-correction` attribute. This example generates four codes with the same value using different error correction levels.
|
122
|
+
|
123
|
+
```html preview
|
124
|
+
<div class="qr-error-correction">
|
125
|
+
<sl-qr-code value="https://shoelace.style/" error-correction="L"></sl-qr-code>
|
126
|
+
<sl-qr-code value="https://shoelace.style/" error-correction="M"></sl-qr-code>
|
127
|
+
<sl-qr-code value="https://shoelace.style/" error-correction="Q"></sl-qr-code>
|
128
|
+
<sl-qr-code value="https://shoelace.style/" error-correction="H"></sl-qr-code>
|
129
|
+
</div>
|
130
|
+
|
131
|
+
<style>
|
132
|
+
.qr-error-correction {
|
133
|
+
display: flex;
|
134
|
+
flex-wrap: wrap;
|
135
|
+
gap: 1rem;
|
136
|
+
}
|
137
|
+
</style>
|
138
|
+
```
|
139
|
+
|
140
|
+
```jsx react
|
141
|
+
import { SlQrCode } from '@shoelace-style/shoelace/dist/react';
|
142
|
+
|
143
|
+
const css = `
|
144
|
+
.qr-error-correction {
|
145
|
+
display: flex;
|
146
|
+
flex-wrap: wrap;
|
147
|
+
gap: 1rem;
|
148
|
+
}
|
149
|
+
`;
|
150
|
+
|
151
|
+
const App = () => {
|
152
|
+
return (
|
153
|
+
<>
|
154
|
+
<div className="qr-error-correction">
|
155
|
+
<SlQrCode value="https://shoelace.style/" error-correction="L" />
|
156
|
+
<SlQrCode value="https://shoelace.style/" error-correction="M" />
|
157
|
+
<SlQrCode value="https://shoelace.style/" error-correction="Q" />
|
158
|
+
<SlQrCode value="https://shoelace.style/" error-correction="H" />
|
159
|
+
</div>
|
160
|
+
|
161
|
+
<style>{css}</style>
|
162
|
+
</>
|
163
|
+
);
|
164
|
+
};
|
165
|
+
```
|
166
|
+
|
167
|
+
[component-metadata:sl-qr-code]
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# Radio Group
|
2
|
+
|
3
|
+
[component-header:sl-radio-group]
|
4
|
+
|
5
|
+
Radio Groups are used to group multiple radios so they function as a single control.
|
6
|
+
|
7
|
+
```html preview
|
8
|
+
<sl-radio-group label="Select an option">
|
9
|
+
<sl-radio value="1" checked>Option 1</sl-radio>
|
10
|
+
<sl-radio value="2">Option 2</sl-radio>
|
11
|
+
<sl-radio value="3">Option 3</sl-radio>
|
12
|
+
</sl-radio-group>
|
13
|
+
```
|
14
|
+
|
15
|
+
```jsx react
|
16
|
+
import { SlRadio, SlRadioGroup } from '@shoelace-style/shoelace/dist/react';
|
17
|
+
|
18
|
+
const App = () => (
|
19
|
+
<SlRadioGroup label="Select an option">
|
20
|
+
<SlRadio value="1" checked>Option 1</SlRadio>
|
21
|
+
<SlRadio value="2">Option 2</SlRadio>
|
22
|
+
<SlRadio value="3">Option 3</SlRadio>
|
23
|
+
</SlRadioGroup>
|
24
|
+
);
|
25
|
+
```
|
26
|
+
|
27
|
+
## Examples
|
28
|
+
|
29
|
+
### Showing the Fieldset
|
30
|
+
|
31
|
+
You can show a fieldset and legend that wraps the radio group using the `fieldset` attribute.
|
32
|
+
|
33
|
+
```html preview
|
34
|
+
<sl-radio-group label="Select an option" fieldset>
|
35
|
+
<sl-radio value="1" checked>Option 1</sl-radio>
|
36
|
+
<sl-radio value="2">Option 2</sl-radio>
|
37
|
+
<sl-radio value="3">Option 3</sl-radio>
|
38
|
+
</sl-radio-group>
|
39
|
+
```
|
40
|
+
|
41
|
+
```jsx react
|
42
|
+
import { SlRadio, SlRadioGroup } from '@shoelace-style/shoelace/dist/react';
|
43
|
+
|
44
|
+
const App = () => (
|
45
|
+
<SlRadioGroup label="Select an option" fieldset>
|
46
|
+
<SlRadio value="1" checked>Option 1</SlRadio>
|
47
|
+
<SlRadio value="2">Option 2</SlRadio>
|
48
|
+
<SlRadio value="3">Option 3</SlRadio>
|
49
|
+
</SlRadioGroup>
|
50
|
+
);
|
51
|
+
```
|
52
|
+
[component-metadata:sl-radio-group]
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# Radio
|
2
|
+
|
3
|
+
[component-header:sl-radio]
|
4
|
+
|
5
|
+
Radios allow the user to select one option from a group of many.
|
6
|
+
|
7
|
+
Radios are designed to be used with [radio groups](/components/radio-group). As such, all of the examples on this page utilize them to demonstrate their correct usage.
|
8
|
+
|
9
|
+
```html preview
|
10
|
+
<sl-radio-group label="Select an option">
|
11
|
+
<sl-radio value="1" checked>Option 1</sl-radio>
|
12
|
+
<sl-radio value="2">Option 2</sl-radio>
|
13
|
+
<sl-radio value="3">Option 3</sl-radio>
|
14
|
+
</sl-radio-group>
|
15
|
+
```
|
16
|
+
|
17
|
+
```jsx react
|
18
|
+
import { SlRadio, SlRadioGroup } from '@shoelace-style/shoelace/dist/react';
|
19
|
+
|
20
|
+
const App = () => (
|
21
|
+
<SlRadioGroup label="Select an option">
|
22
|
+
<SlRadio value="1" checked>Option 1</SlRadio>
|
23
|
+
<SlRadio value="2">Option 2</SlRadio>
|
24
|
+
<SlRadio value="3">Option 3</SlRadio>
|
25
|
+
</SlRadioGroup>
|
26
|
+
);
|
27
|
+
```
|
28
|
+
|
29
|
+
?> This component works with standard `<form>` elements. Please refer to the section on [form controls](/getting-started/form-controls) to learn more about form submission and client-side validation.
|
30
|
+
|
31
|
+
## Examples
|
32
|
+
|
33
|
+
### Disabled
|
34
|
+
|
35
|
+
Use the `disabled` attribute to disable a radio.
|
36
|
+
|
37
|
+
```html preview
|
38
|
+
<sl-radio-group label="Select an option">
|
39
|
+
<sl-radio value="1" checked>Option 1</sl-radio>
|
40
|
+
<sl-radio value="2">Option 2</sl-radio>
|
41
|
+
<sl-radio value="3">Option 3</sl-radio>
|
42
|
+
<sl-radio value="4" disabled>Disabled</sl-radio>
|
43
|
+
</sl-radio-group>
|
44
|
+
```
|
45
|
+
|
46
|
+
```jsx react
|
47
|
+
import { SlRadio, SlRadioGroup } from '@shoelace-style/shoelace/dist/react';
|
48
|
+
|
49
|
+
const App = () => (
|
50
|
+
<SlRadioGroup label="Select an option">
|
51
|
+
<SlRadio value="1" checked>Option 1</SlRadio>
|
52
|
+
<SlRadio value="2">Option 2</SlRadio>
|
53
|
+
<SlRadio value="3">Option 3</SlRadio>
|
54
|
+
<SlRadio value="4" disabled>Disabled</SlRadio>
|
55
|
+
</SlRadioGroup>
|
56
|
+
);
|
57
|
+
```
|
58
|
+
|
59
|
+
[component-metadata:sl-radio]
|
@@ -0,0 +1,180 @@
|
|
1
|
+
# Range
|
2
|
+
|
3
|
+
[component-header:sl-range]
|
4
|
+
|
5
|
+
Ranges allow the user to select a single value within a given range using a slider.
|
6
|
+
|
7
|
+
```html preview
|
8
|
+
<sl-range></sl-range>
|
9
|
+
```
|
10
|
+
|
11
|
+
```jsx react
|
12
|
+
import { SlRange } from '@shoelace-style/shoelace/dist/react';
|
13
|
+
|
14
|
+
const App = () => (
|
15
|
+
<SlRange />
|
16
|
+
);
|
17
|
+
```
|
18
|
+
|
19
|
+
?> This component works with standard `<form>` elements. Please refer to the section on [form controls](/getting-started/form-controls) to learn more about form submission and client-side validation.
|
20
|
+
|
21
|
+
## Examples
|
22
|
+
|
23
|
+
### Min, Max, and Step
|
24
|
+
|
25
|
+
Use the `min` and `max` attributes to set the range's minimum and maximum values, respectively. The `step` attribute determines the value's interval when increasing and decreasing.
|
26
|
+
|
27
|
+
```html preview
|
28
|
+
<sl-range min="0" max="10" step="1"></sl-range>
|
29
|
+
```
|
30
|
+
|
31
|
+
```jsx react
|
32
|
+
import { SlRange } from '@shoelace-style/shoelace/dist/react';
|
33
|
+
|
34
|
+
const App = () => (
|
35
|
+
<SlRange min={0} max={10} step={1} />
|
36
|
+
);
|
37
|
+
```
|
38
|
+
|
39
|
+
### Disabled
|
40
|
+
|
41
|
+
Use the `disabled` attribute to disable a slider.
|
42
|
+
|
43
|
+
```html preview
|
44
|
+
<sl-range disabled></sl-range>
|
45
|
+
```
|
46
|
+
|
47
|
+
|
48
|
+
```jsx react
|
49
|
+
import { SlRange } from '@shoelace-style/shoelace/dist/react';
|
50
|
+
|
51
|
+
const App = () => (
|
52
|
+
<SlRange disabled />
|
53
|
+
);
|
54
|
+
```
|
55
|
+
|
56
|
+
### Tooltip Placement
|
57
|
+
|
58
|
+
By default, the tooltip is shown on top. Set `tooltip` to `bottom` to show it below the slider.
|
59
|
+
|
60
|
+
```html preview
|
61
|
+
<sl-range tooltip="bottom"></sl-range>
|
62
|
+
```
|
63
|
+
|
64
|
+
```jsx react
|
65
|
+
import { SlRange } from '@shoelace-style/shoelace/dist/react';
|
66
|
+
|
67
|
+
const App = () => (
|
68
|
+
<SlRange tooltip="bottom" />
|
69
|
+
);
|
70
|
+
```
|
71
|
+
|
72
|
+
### Disable the Tooltip
|
73
|
+
|
74
|
+
To disable the tooltip, set `tooltip` to `none`.
|
75
|
+
|
76
|
+
```html preview
|
77
|
+
<sl-range tooltip="none"></sl-range>
|
78
|
+
```
|
79
|
+
|
80
|
+
```jsx react
|
81
|
+
import { SlRange } from '@shoelace-style/shoelace/dist/react';
|
82
|
+
|
83
|
+
const App = () => (
|
84
|
+
<SlRange tooltip="none" />
|
85
|
+
);
|
86
|
+
```
|
87
|
+
|
88
|
+
### Custom Track Colors
|
89
|
+
|
90
|
+
You can customize the active and inactive portions of the track using the `--track-color-active` and `--track-color-inactive` custom properties.
|
91
|
+
|
92
|
+
```html preview
|
93
|
+
<sl-range style="
|
94
|
+
--track-color-active: var(--sl-color-primary-600);
|
95
|
+
--track-color-inactive: var(--sl-color-primary-100);
|
96
|
+
"></sl-range>
|
97
|
+
```
|
98
|
+
|
99
|
+
```jsx react
|
100
|
+
import { SlRange } from '@shoelace-style/shoelace/dist/react';
|
101
|
+
|
102
|
+
const App = () => (
|
103
|
+
<SlRange
|
104
|
+
style={{
|
105
|
+
'--track-color-active': 'var(--sl-color-primary-600)',
|
106
|
+
'--track-color-inactive': 'var(--sl-color-primary-200)'
|
107
|
+
}}
|
108
|
+
/>
|
109
|
+
);
|
110
|
+
```
|
111
|
+
|
112
|
+
### Custom Tooltip Formatter
|
113
|
+
|
114
|
+
You can change the tooltip's content by setting the `tooltipFormatter` property to a function that accepts the range's value as an argument.
|
115
|
+
|
116
|
+
```html preview
|
117
|
+
<sl-range min="0" max="100" step="1" class="range-with-custom-formatter"></sl-range>
|
118
|
+
|
119
|
+
<script>
|
120
|
+
const range = document.querySelector('.range-with-custom-formatter');
|
121
|
+
range.tooltipFormatter = value => `Total - ${value}%`;
|
122
|
+
</script>
|
123
|
+
```
|
124
|
+
|
125
|
+
```jsx react
|
126
|
+
import { SlRange } from '@shoelace-style/shoelace/dist/react';
|
127
|
+
|
128
|
+
const App = () => (
|
129
|
+
<SlRange
|
130
|
+
min={0}
|
131
|
+
max={100}
|
132
|
+
step={1}
|
133
|
+
tooltipFormatter={value => `Total - ${value}%`}
|
134
|
+
/>
|
135
|
+
);
|
136
|
+
```
|
137
|
+
|
138
|
+
### Labels
|
139
|
+
|
140
|
+
Use the `label` attribute to give the range an accessible label. For labels that contain HTML, use the `label` slot instead.
|
141
|
+
|
142
|
+
```html preview
|
143
|
+
<sl-range label="Volume" min="0" max="100"></sl-input>
|
144
|
+
```
|
145
|
+
|
146
|
+
```jsx react
|
147
|
+
import { SlRange } from '@shoelace-style/shoelace/dist/react';
|
148
|
+
|
149
|
+
const App = () => (
|
150
|
+
<SlRange label="Volume" min={0} max={100} />
|
151
|
+
);
|
152
|
+
```
|
153
|
+
|
154
|
+
### Help Text
|
155
|
+
|
156
|
+
Add descriptive help text to a range with the `help-text` attribute. For help texts that contain HTML, use the `help-text` slot instead.
|
157
|
+
|
158
|
+
```html preview
|
159
|
+
<sl-range
|
160
|
+
label="Volume"
|
161
|
+
help-text="Controls the volume of the current song."
|
162
|
+
min="0"
|
163
|
+
max="100"
|
164
|
+
></sl-input>
|
165
|
+
```
|
166
|
+
|
167
|
+
```jsx react
|
168
|
+
import { SlRange } from '@shoelace-style/shoelace/dist/react';
|
169
|
+
|
170
|
+
const App = () => (
|
171
|
+
<SlRange
|
172
|
+
label="Volume"
|
173
|
+
help-text="Controls the volume of the current song."
|
174
|
+
min={0}
|
175
|
+
max={100}
|
176
|
+
/>
|
177
|
+
);
|
178
|
+
```
|
179
|
+
|
180
|
+
[component-metadata:sl-range]
|
@@ -0,0 +1,153 @@
|
|
1
|
+
# Rating
|
2
|
+
|
3
|
+
[component-header:sl-rating]
|
4
|
+
|
5
|
+
Ratings give users a way to quickly view and provide feedback.
|
6
|
+
|
7
|
+
```html preview
|
8
|
+
<sl-rating></sl-rating>
|
9
|
+
```
|
10
|
+
|
11
|
+
```jsx react
|
12
|
+
import { SlRating } from '@shoelace-style/shoelace/dist/react';
|
13
|
+
|
14
|
+
const App = () => (
|
15
|
+
<SlRating />
|
16
|
+
);
|
17
|
+
```
|
18
|
+
|
19
|
+
## Examples
|
20
|
+
|
21
|
+
### Maximum Value
|
22
|
+
|
23
|
+
Ratings are 0-5 by default. To change the maximum possible value, use the `max` attribute.
|
24
|
+
|
25
|
+
```html preview
|
26
|
+
<sl-rating max="3"></sl-rating>
|
27
|
+
```
|
28
|
+
|
29
|
+
```jsx react
|
30
|
+
import { SlRating } from '@shoelace-style/shoelace/dist/react';
|
31
|
+
|
32
|
+
const App = () => (
|
33
|
+
<SlRating max={3} />
|
34
|
+
);
|
35
|
+
```
|
36
|
+
|
37
|
+
### Precision
|
38
|
+
|
39
|
+
Use the `precision` attribute to let users select fractional ratings.
|
40
|
+
|
41
|
+
```html preview
|
42
|
+
<sl-rating precision="0.5" value="2.5"></sl-rating>
|
43
|
+
```
|
44
|
+
|
45
|
+
```jsx react
|
46
|
+
import { SlRating } from '@shoelace-style/shoelace/dist/react';
|
47
|
+
|
48
|
+
const App = () => (
|
49
|
+
<SlRating precision={0.5} value={2.5} />
|
50
|
+
);
|
51
|
+
```
|
52
|
+
|
53
|
+
## Symbol Sizes
|
54
|
+
|
55
|
+
Set the `--symbol-size` custom property to adjust the size.
|
56
|
+
|
57
|
+
```html preview
|
58
|
+
<sl-rating style="--symbol-size: 2rem;"></sl-rating>
|
59
|
+
```
|
60
|
+
|
61
|
+
```jsx react
|
62
|
+
import { SlRating } from '@shoelace-style/shoelace/dist/react';
|
63
|
+
|
64
|
+
const App = () => (
|
65
|
+
<SlRating style={{ '--symbol-size': '2rem' }} />
|
66
|
+
);
|
67
|
+
```
|
68
|
+
|
69
|
+
### Readonly
|
70
|
+
|
71
|
+
Use the `readonly` attribute to display a rating that users can't change.
|
72
|
+
|
73
|
+
```html preview
|
74
|
+
<sl-rating readonly value="3"></sl-rating>
|
75
|
+
```
|
76
|
+
|
77
|
+
```jsx react
|
78
|
+
import { SlRating } from '@shoelace-style/shoelace/dist/react';
|
79
|
+
|
80
|
+
const App = () => (
|
81
|
+
<SlRating readonly value={3} />
|
82
|
+
);
|
83
|
+
```
|
84
|
+
|
85
|
+
### Disabled
|
86
|
+
|
87
|
+
Use the `disable` attribute to disable the rating.
|
88
|
+
|
89
|
+
```html preview
|
90
|
+
<sl-rating disabled value="3"></sl-rating>
|
91
|
+
```
|
92
|
+
|
93
|
+
```jsx react
|
94
|
+
import { SlRating } from '@shoelace-style/shoelace/dist/react';
|
95
|
+
|
96
|
+
const App = () => (
|
97
|
+
<SlRating disabled value={3} />
|
98
|
+
);
|
99
|
+
```
|
100
|
+
|
101
|
+
### Custom Icons
|
102
|
+
|
103
|
+
```html preview
|
104
|
+
<sl-rating class="rating-hearts" style="--symbol-color-active: #ff4136;"></sl-rating>
|
105
|
+
|
106
|
+
<script>
|
107
|
+
const rating = document.querySelector('.rating-hearts');
|
108
|
+
rating.getSymbol = () => '<sl-icon name="heart-fill"></sl-icon>';
|
109
|
+
</script>
|
110
|
+
```
|
111
|
+
|
112
|
+
```jsx react
|
113
|
+
import '@shoelace-style/shoelace/dist/components/icon/icon';
|
114
|
+
import { SlRating } from '@shoelace-style/shoelace/dist/react';
|
115
|
+
|
116
|
+
const App = () => (
|
117
|
+
<SlRating
|
118
|
+
getSymbol={() => '<sl-icon name="heart-fill"></sl-icon>'}
|
119
|
+
style={{ '--symbol-color-active': '#ff4136' }}
|
120
|
+
/>
|
121
|
+
);
|
122
|
+
```
|
123
|
+
|
124
|
+
### Value-based Icons
|
125
|
+
|
126
|
+
```html preview
|
127
|
+
<sl-rating class="rating-emojis"></sl-rating>
|
128
|
+
|
129
|
+
<script>
|
130
|
+
const rating = document.querySelector('.rating-emojis');
|
131
|
+
|
132
|
+
rating.getSymbol = (value) => {
|
133
|
+
const icons = ['emoji-angry', 'emoji-frown', 'emoji-expressionless', 'emoji-smile', 'emoji-laughing'];
|
134
|
+
return `<sl-icon name="${icons[value - 1]}"></sl-icon>`;
|
135
|
+
};
|
136
|
+
</script>
|
137
|
+
```
|
138
|
+
|
139
|
+
```jsx react
|
140
|
+
import '@shoelace-style/shoelace/dist/components/icon/icon';
|
141
|
+
import { SlRating } from '@shoelace-style/shoelace/dist/react';
|
142
|
+
|
143
|
+
function getSymbol(value) {
|
144
|
+
const icons = ['emoji-angry', 'emoji-frown', 'emoji-expressionless', 'emoji-smile', 'emoji-laughing'];
|
145
|
+
return `<sl-icon name="${icons[value - 1]}"></sl-icon>`;
|
146
|
+
}
|
147
|
+
|
148
|
+
const App = () => (
|
149
|
+
<SlRating getSymbol={getSymbol} />
|
150
|
+
);
|
151
|
+
```
|
152
|
+
|
153
|
+
[component-metadata:sl-rating]
|