shoelace-rails-ui 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +20 -0
- data/README.md +49 -22
- data/Rakefile +5 -13
- data/app/assets/config/shoelace_rails_ui_manifest.js +1 -0
- data/app/assets/javascripts/shoelace.js +300 -0
- data/app/assets/stylesheets/sl_styles_light.css +455 -0
- data/app/controllers/shoelace/rails/ui/application_controller.rb +8 -0
- data/app/helpers/shoelace/rails/ui/application_helper.rb +11 -0
- data/app/helpers/shoelace/rails/ui/form_helper.rb +442 -0
- data/app/jobs/shoelace/rails/ui/application_job.rb +8 -0
- data/app/mailers/shoelace/rails/ui/application_mailer.rb +10 -0
- data/app/models/shoelace/rails/ui/application_record.rb +9 -0
- data/app/views/layouts/shoelace/rails/ui/application.html.erb +15 -0
- data/config/routes.rb +2 -0
- data/lib/shoelace/rails/ui/engine.rb +15 -0
- data/lib/shoelace/rails/ui/version.rb +1 -3
- data/lib/shoelace/rails/ui.rb +2 -4
- data/lib/tasks/shoelace/rails/ui_tasks.rake +4 -0
- metadata +36 -334
- data/.DS_Store +0 -0
- data/CHANGELOG.md +0 -5
- data/CODE_OF_CONDUCT.md +0 -84
- data/Gemfile +0 -12
- data/Gemfile.lock +0 -42
- data/LICENSE.txt +0 -21
- data/README-real.md +0 -24
- data/bin/console +0 -15
- data/bin/setup +0 -8
- data/regenerate.rb +0 -48
- 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 +0 -15
- data/remote-src/2.0.0.beta64/shoelace-next/.github/CODE_OF_CONDUCT.md +0 -44
- data/remote-src/2.0.0.beta64/shoelace-next/.github/FUNDING.yml +0 -1
- data/remote-src/2.0.0.beta64/shoelace-next/.github/ISSUE_TEMPLATE/bug_report.md +0 -36
- data/remote-src/2.0.0.beta64/shoelace-next/.github/ISSUE_TEMPLATE/config.yml +0 -4
- data/remote-src/2.0.0.beta64/shoelace-next/.github/ISSUE_TEMPLATE/feature_request.md +0 -17
- data/remote-src/2.0.0.beta64/shoelace-next/.github/SECURITY.md +0 -7
- data/remote-src/2.0.0.beta64/shoelace-next/.github/workflows/node.js.yml +0 -30
- data/remote-src/2.0.0.beta64/shoelace-next/.github/workflows/release.yml +0 -17
- data/remote-src/2.0.0.beta64/shoelace-next/.gitignore +0 -8
- data/remote-src/2.0.0.beta64/shoelace-next/.husky/pre-commit +0 -4
- data/remote-src/2.0.0.beta64/shoelace-next/.prettierignore +0 -12
- data/remote-src/2.0.0.beta64/shoelace-next/.vscode/extensions.json +0 -9
- data/remote-src/2.0.0.beta64/shoelace-next/.vscode/settings.json +0 -4
- data/remote-src/2.0.0.beta64/shoelace-next/CONTRIBUTING.md +0 -5
- data/remote-src/2.0.0.beta64/shoelace-next/LICENSE.md +0 -7
- data/remote-src/2.0.0.beta64/shoelace-next/README.md +0 -94
- data/remote-src/2.0.0.beta64/shoelace-next/cspell.json +0 -110
- data/remote-src/2.0.0.beta64/shoelace-next/custom-elements-manifest.config.js +0 -104
- data/remote-src/2.0.0.beta64/shoelace-next/docs/404.md +0 -5
- data/remote-src/2.0.0.beta64/shoelace-next/docs/_sidebar.md +0 -89
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/icons/sprite.svg +0 -1
- 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 +0 -7
- 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 +0 -134
- 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 +0 -80
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/undraw-not-found.svg +0 -1
- 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 +0 -7
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/code-block/code-block.css +0 -228
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/code-block/code-block.js +0 -376
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/metadata/metadata.js +0 -537
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/scroll-position/scroll-position.js +0 -24
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/search/lunr.min.js +0 -1311
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/search/search.css +0 -180
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/search/search.js +0 -293
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/theme-picker/theme-picker.css +0 -29
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/theme-picker/theme-picker.js +0 -83
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/styles/docs.css +0 -642
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/alert.md +0 -441
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/animated-image.md +0 -128
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/animation.md +0 -351
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/avatar.md +0 -201
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/badge.md +0 -191
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/breadcrumb-item.md +0 -35
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/breadcrumb.md +0 -266
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/button-group.md +0 -470
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/button.md +0 -453
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/card.md +0 -311
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/checkbox.md +0 -71
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/color-picker.md +0 -101
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/details.md +0 -89
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/dialog.md +0 -265
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/divider.md +0 -152
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/drawer.md +0 -452
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/dropdown.md +0 -389
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/format-bytes.md +0 -126
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/format-date.md +0 -120
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/format-number.md +0 -124
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/icon-button.md +0 -160
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/icon.md +0 -711
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/image-comparer.md +0 -51
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/include.md +0 -47
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/input.md +0 -283
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/menu-item.md +0 -255
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/menu-label.md +0 -52
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/menu.md +0 -49
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/mutation-observer.md +0 -196
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/progress-bar.md +0 -144
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/progress-ring.md +0 -178
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/qr-code.md +0 -167
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/radio-group.md +0 -52
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/radio.md +0 -59
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/range.md +0 -180
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/rating.md +0 -153
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/relative-time.md +0 -105
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/resize-observer.md +0 -68
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/responsive-media.md +0 -73
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/select.md +0 -457
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/skeleton.md +0 -439
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/spinner.md +0 -86
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/split-panel.md +0 -671
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/switch.md +0 -77
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/tab-group.md +0 -359
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/tab-panel.md +0 -41
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/tab.md +0 -29
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/tag.md +0 -142
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/textarea.md +0 -184
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/tooltip.md +0 -410
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/visually-hidden.md +0 -47
- data/remote-src/2.0.0.beta64/shoelace-next/docs/frameworks/angular.md +0 -46
- data/remote-src/2.0.0.beta64/shoelace-next/docs/frameworks/react.md +0 -156
- data/remote-src/2.0.0.beta64/shoelace-next/docs/frameworks/vue.md +0 -92
- data/remote-src/2.0.0.beta64/shoelace-next/docs/getting-started/customizing.md +0 -153
- data/remote-src/2.0.0.beta64/shoelace-next/docs/getting-started/form-controls.md +0 -336
- data/remote-src/2.0.0.beta64/shoelace-next/docs/getting-started/installation.md +0 -137
- data/remote-src/2.0.0.beta64/shoelace-next/docs/getting-started/localization.md +0 -140
- data/remote-src/2.0.0.beta64/shoelace-next/docs/getting-started/overview.md +0 -131
- data/remote-src/2.0.0.beta64/shoelace-next/docs/getting-started/themes.md +0 -139
- data/remote-src/2.0.0.beta64/shoelace-next/docs/getting-started/usage.md +0 -173
- data/remote-src/2.0.0.beta64/shoelace-next/docs/index.html +0 -98
- data/remote-src/2.0.0.beta64/shoelace-next/docs/resources/accessibility.md +0 -18
- data/remote-src/2.0.0.beta64/shoelace-next/docs/resources/changelog.md +0 -925
- data/remote-src/2.0.0.beta64/shoelace-next/docs/resources/community.md +0 -53
- data/remote-src/2.0.0.beta64/shoelace-next/docs/resources/contributing.md +0 -261
- data/remote-src/2.0.0.beta64/shoelace-next/docs/tokens/border-radius.md +0 -12
- data/remote-src/2.0.0.beta64/shoelace-next/docs/tokens/color.md +0 -439
- data/remote-src/2.0.0.beta64/shoelace-next/docs/tokens/elevation.md +0 -11
- data/remote-src/2.0.0.beta64/shoelace-next/docs/tokens/spacing.md +0 -16
- data/remote-src/2.0.0.beta64/shoelace-next/docs/tokens/transition.md +0 -11
- data/remote-src/2.0.0.beta64/shoelace-next/docs/tokens/typography.md +0 -58
- data/remote-src/2.0.0.beta64/shoelace-next/docs/tokens/z-index.md +0 -11
- data/remote-src/2.0.0.beta64/shoelace-next/docs/tutorials/integrating-with-laravel.md +0 -117
- data/remote-src/2.0.0.beta64/shoelace-next/docs/tutorials/integrating-with-nextjs.md +0 -137
- data/remote-src/2.0.0.beta64/shoelace-next/docs/tutorials/integrating-with-rails.md +0 -103
- data/remote-src/2.0.0.beta64/shoelace-next/lint-staged.config.js +0 -4
- data/remote-src/2.0.0.beta64/shoelace-next/package-lock.json +0 -9534
- data/remote-src/2.0.0.beta64/shoelace-next/package.json +0 -93
- data/remote-src/2.0.0.beta64/shoelace-next/prettier.config.cjs +0 -17
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/build.js +0 -158
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/make-css.js +0 -42
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/make-icons.js +0 -71
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/make-metadata.js +0 -11
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/make-react.js +0 -63
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/make-search.js +0 -100
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/make-vscode-data.js +0 -58
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/plop/plopfile.js +0 -67
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/plop/templates/component/component.hbs +0 -44
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/plop/templates/component/docs.hbs +0 -21
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/plop/templates/component/styles.hbs +0 -10
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/plop/templates/component/tests.hbs +0 -13
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/shared.js +0 -18
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/alert/alert.styles.ts +0 -95
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/alert/alert.test.ts +0 -93
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/alert/alert.ts +0 -238
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/animated-image/animated-image.styles.ts +0 -52
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/animated-image/animated-image.test.ts +0 -13
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/animated-image/animated-image.ts +0 -120
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/animation/animation.styles.ts +0 -10
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/animation/animation.ts +0 -222
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/animation/animations.ts +0 -15
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/avatar/avatar.styles.ts +0 -66
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/avatar/avatar.test.ts +0 -111
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/avatar/avatar.ts +0 -83
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/badge/badge.styles.ts +0 -94
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/badge/badge.test.ts +0 -77
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/badge/badge.ts +0 -53
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/breadcrumb/breadcrumb.styles.ts +0 -12
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/breadcrumb/breadcrumb.test.ts +0 -104
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/breadcrumb/breadcrumb.ts +0 -82
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/breadcrumb-item/breadcrumb-item.styles.ts +0 -85
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/breadcrumb-item/breadcrumb-item.test.ts +0 -160
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/breadcrumb-item/breadcrumb-item.ts +0 -92
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/button/button.styles.ts +0 -637
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/button/button.ts +0 -209
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/button-group/button-group.styles.ts +0 -15
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/button-group/button-group.ts +0 -84
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/card/card.styles.ts +0 -62
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/card/card.test.ts +0 -139
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/card/card.ts +0 -68
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/checkbox/checkbox.styles.ts +0 -108
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/checkbox/checkbox.test.ts +0 -47
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/checkbox/checkbox.ts +0 -203
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/color-picker/color-picker.styles.ts +0 -326
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/color-picker/color-picker.test.ts +0 -43
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/color-picker/color-picker.ts +0 -853
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/details/details.styles.ts +0 -73
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/details/details.test.ts +0 -153
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/details/details.ts +0 -192
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/dialog/dialog.styles.ts +0 -106
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/dialog/dialog.test.ts +0 -135
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/dialog/dialog.ts +0 -296
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/divider/divider.styles.ts +0 -25
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/divider/divider.ts +0 -34
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/drawer/drawer.styles.ts +0 -142
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/drawer/drawer.test.ts +0 -135
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/drawer/drawer.ts +0 -377
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/dropdown/dropdown.styles.ts +0 -58
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/dropdown/dropdown.test.ts +0 -147
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/dropdown/dropdown.ts +0 -459
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/format-bytes/format-bytes.ts +0 -35
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/format-date/format-date.ts +0 -81
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/format-number/format-number.ts +0 -69
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/icon/icon.styles.ts +0 -21
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/icon/icon.ts +0 -131
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/icon/library.default.ts +0 -9
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/icon/library.system.ts +0 -97
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/icon/library.ts +0 -49
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/icon/request.ts +0 -36
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/icon-button/icon-button.styles.ts +0 -48
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/icon-button/icon-button.ts +0 -100
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/image-comparer/image-comparer.styles.ts +0 -77
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/image-comparer/image-comparer.ts +0 -147
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/include/include.styles.ts +0 -10
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/include/include.test.ts +0 -62
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/include/include.ts +0 -80
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/include/request.ts +0 -23
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/input/input.styles.ts +0 -282
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/input/input.test.ts +0 -35
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/input/input.ts +0 -410
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/menu/menu.styles.ts +0 -18
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/menu/menu.ts +0 -205
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/menu-item/menu-item.styles.ts +0 -84
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/menu-item/menu-item.ts +0 -92
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/menu-label/menu-label.styles.ts +0 -21
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/menu-label/menu-label.ts +0 -30
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/mutation-observer/mutation-observer.styles.ts +0 -10
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/mutation-observer/mutation-observer.test.ts +0 -13
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/mutation-observer/mutation-observer.ts +0 -118
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/progress-bar/progress-bar.styles.ts +0 -57
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/progress-bar/progress-bar.test.ts +0 -89
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/progress-bar/progress-bar.ts +0 -74
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/progress-ring/progress-ring.styles.ts +0 -66
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/progress-ring/progress-ring.test.ts +0 -68
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/progress-ring/progress-ring.ts +0 -84
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/qr-code/qr-code.styles.ts +0 -22
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/qr-code/qr-code.ts +0 -90
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/radio/radio.styles.ts +0 -107
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/radio/radio.test.ts +0 -65
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/radio/radio.ts +0 -226
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/radio-group/radio-group.styles.ts +0 -47
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/radio-group/radio-group.ts +0 -66
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/range/range.styles.ts +0 -192
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/range/range.ts +0 -273
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/rating/rating.styles.ts +0 -79
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/rating/rating.ts +0 -249
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/relative-time/relative-time.ts +0 -116
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/resize-observer/resize-observer.styles.ts +0 -10
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/resize-observer/resize-observer.ts +0 -87
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/responsive-media/responsive-media.styles.ts +0 -36
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/responsive-media/responsive-media.ts +0 -50
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/select/select.styles.ts +0 -331
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/select/select.test.ts +0 -56
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/select/select.ts +0 -560
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/skeleton/skeleton.styles.ts +0 -60
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/skeleton/skeleton.ts +0 -46
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/spinner/spinner.styles.ts +0 -56
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/spinner/spinner.test.ts +0 -24
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/spinner/spinner.ts +0 -34
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/split-panel/split-panel.styles.ts +0 -76
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/split-panel/split-panel.test.ts +0 -13
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/split-panel/split-panel.ts +0 -272
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/switch/switch.styles.ts +0 -135
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/switch/switch.test.ts +0 -64
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/switch/switch.ts +0 -187
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tab/tab.styles.ts +0 -61
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tab/tab.ts +0 -104
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tab-group/tab-group.styles.ts +0 -209
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tab-group/tab-group.ts +0 -409
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tab-panel/tab-panel.styles.ts +0 -17
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tab-panel/tab-panel.ts +0 -49
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tag/tag.styles.ts +0 -110
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tag/tag.ts +0 -92
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/textarea/textarea.styles.ts +0 -167
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/textarea/textarea.test.ts +0 -35
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/textarea/textarea.ts +0 -339
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tooltip/tooltip.styles.ts +0 -131
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tooltip/tooltip.test.ts +0 -117
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tooltip/tooltip.ts +0 -355
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/visually-hidden/visually-hidden.styles.ts +0 -18
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/visually-hidden/visually-hidden.test.ts +0 -39
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/visually-hidden/visually-hidden.ts +0 -24
- data/remote-src/2.0.0.beta64/shoelace-next/src/declaration.d.ts +0 -8
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/animate.ts +0 -70
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/event.ts +0 -35
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/focus-visible.ts +0 -26
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/form-control.ts +0 -203
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/formdata-event-polyfill.ts +0 -93
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/math.ts +0 -8
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/modal.ts +0 -53
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/number.ts +0 -32
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/offset.ts +0 -13
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/scroll.ts +0 -57
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/slot.ts +0 -91
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/string.ts +0 -3
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/support.ts +0 -15
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/tabbable.ts +0 -81
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/watch.ts +0 -40
- data/remote-src/2.0.0.beta64/shoelace-next/src/shoelace.ts +0 -58
- data/remote-src/2.0.0.beta64/shoelace-next/src/styles/component.styles.ts +0 -23
- data/remote-src/2.0.0.beta64/shoelace-next/src/styles/form-control.styles.ts +0 -52
- data/remote-src/2.0.0.beta64/shoelace-next/src/styles/utility.styles.ts +0 -23
- data/remote-src/2.0.0.beta64/shoelace-next/src/themes/dark.styles.ts +0 -524
- data/remote-src/2.0.0.beta64/shoelace-next/src/themes/light.styles.ts +0 -524
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/de-ch.ts +0 -21
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/de.ts +0 -21
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/en.ts +0 -21
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/es.ts +0 -21
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/fr.ts +0 -21
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/he.ts +0 -21
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/ja.ts +0 -21
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/nl.ts +0 -21
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/pl.ts +0 -21
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/pt.ts +0 -21
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/ru.ts +0 -21
- data/remote-src/2.0.0.beta64/shoelace-next/src/utilities/animation-registry.ts +0 -59
- data/remote-src/2.0.0.beta64/shoelace-next/src/utilities/animation.ts +0 -1
- data/remote-src/2.0.0.beta64/shoelace-next/src/utilities/base-path.ts +0 -43
- data/remote-src/2.0.0.beta64/shoelace-next/src/utilities/form.ts +0 -22
- data/remote-src/2.0.0.beta64/shoelace-next/src/utilities/icon-library.ts +0 -1
- data/remote-src/2.0.0.beta64/shoelace-next/src/utilities/localize.ts +0 -5
- data/remote-src/2.0.0.beta64/shoelace-next/tsconfig.json +0 -35
- data/remote-src/2.0.0.beta64/shoelace-next/vercel.json +0 -4
- data/remote-src/2.0.0.beta64/shoelace-next/web-test-runner.config.js +0 -14
- data/shoelace-rails-ui.gemspec +0 -39
- data/shoelace-rails-ui.rb +0 -0
@@ -1,167 +0,0 @@
|
|
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]
|
@@ -1,52 +0,0 @@
|
|
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]
|
@@ -1,59 +0,0 @@
|
|
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]
|
@@ -1,180 +0,0 @@
|
|
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]
|
@@ -1,153 +0,0 @@
|
|
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]
|