revotech-ui-kit 0.0.6-beta → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/revotech-ui-kit.cjs +2293 -0
- package/dist/revotech-ui-kit.js +5608 -0
- package/dist/src/assets/icons/arrows.icon.d.ts +1 -0
- package/{src/assets/icons/arrows.icon.ts → dist/src/assets/icons/arrows.icon.js} +2 -2
- package/dist/src/assets/icons/arrows.icon.js.map +1 -0
- package/dist/src/assets/icons/index.js +4 -0
- package/dist/src/assets/icons/index.js.map +1 -0
- package/dist/src/assets/icons/search.icon.d.ts +1 -0
- package/{src/assets/icons/search.icon.ts → dist/src/assets/icons/search.icon.js} +2 -2
- package/dist/src/assets/icons/search.icon.js.map +1 -0
- package/dist/src/assets/icons/tick.icon.d.ts +1 -0
- package/{src/assets/icons/tick.icon.ts → dist/src/assets/icons/tick.icon.js} +2 -2
- package/dist/src/assets/icons/tick.icon.js.map +1 -0
- package/dist/src/components/atoms/alert/alert-description.d.ts +5 -0
- package/dist/src/components/atoms/alert/alert-description.js +18 -0
- package/dist/src/components/atoms/alert/alert-description.js.map +1 -0
- package/dist/src/components/atoms/alert/alert-title.d.ts +5 -0
- package/dist/src/components/atoms/alert/alert-title.js +20 -0
- package/dist/src/components/atoms/alert/alert-title.js.map +1 -0
- package/dist/src/components/atoms/alert/alert.atom.d.ts +15 -0
- package/{src/components/atoms/alert/alert.atom.ts → dist/src/components/atoms/alert/alert.atom.js} +33 -33
- package/dist/src/components/atoms/alert/alert.atom.js.map +1 -0
- package/dist/src/components/atoms/alert/alert.stories.d.ts +6 -0
- package/dist/src/components/atoms/alert/alert.stories.js +62 -0
- package/dist/src/components/atoms/alert/alert.stories.js.map +1 -0
- package/dist/src/components/atoms/alert/alert.styles.d.ts +4 -0
- package/dist/src/components/atoms/alert/alert.styles.js +21 -0
- package/dist/src/components/atoms/alert/alert.styles.js.map +1 -0
- package/dist/src/components/atoms/alert/alert.types.js +2 -0
- package/dist/src/components/atoms/alert/alert.types.js.map +1 -0
- package/dist/src/components/atoms/badge/badge.atom.d.ts +16 -0
- package/dist/src/components/atoms/badge/badge.atom.js +43 -0
- package/dist/src/components/atoms/badge/badge.atom.js.map +1 -0
- package/dist/src/components/atoms/badge/badge.stories.d.ts +6 -0
- package/dist/src/components/atoms/badge/badge.stories.js +110 -0
- package/dist/src/components/atoms/badge/badge.stories.js.map +1 -0
- package/dist/src/components/atoms/badge/badge.style.d.ts +3 -0
- package/dist/src/components/atoms/badge/badge.style.js +17 -0
- package/dist/src/components/atoms/badge/badge.style.js.map +1 -0
- package/dist/src/components/atoms/badge/badge.type.d.ts +1 -0
- package/dist/src/components/atoms/badge/badge.type.js +2 -0
- package/dist/src/components/atoms/badge/badge.type.js.map +1 -0
- package/dist/src/components/atoms/button/button.atom.d.ts +22 -0
- package/dist/src/components/atoms/button/button.atom.js +67 -0
- package/dist/src/components/atoms/button/button.atom.js.map +1 -0
- package/dist/src/components/atoms/button/button.stories.d.ts +6 -0
- package/dist/src/components/atoms/button/button.stories.js +204 -0
- package/dist/src/components/atoms/button/button.stories.js.map +1 -0
- package/dist/src/components/atoms/button/button.style.d.ts +4 -0
- package/dist/src/components/atoms/button/button.style.js +24 -0
- package/dist/src/components/atoms/button/button.style.js.map +1 -0
- package/{src/components/atoms/button/button.type.ts → dist/src/components/atoms/button/button.type.d.ts} +1 -8
- package/dist/src/components/atoms/button/button.type.js +2 -0
- package/dist/src/components/atoms/button/button.type.js.map +1 -0
- package/dist/src/components/atoms/card/card-content.d.ts +5 -0
- package/dist/src/components/atoms/card/card-content.js +17 -0
- package/dist/src/components/atoms/card/card-content.js.map +1 -0
- package/dist/src/components/atoms/card/card-description.d.ts +5 -0
- package/dist/src/components/atoms/card/card-description.js +17 -0
- package/dist/src/components/atoms/card/card-description.js.map +1 -0
- package/dist/src/components/atoms/card/card-footer.d.ts +5 -0
- package/dist/src/components/atoms/card/card-footer.js +17 -0
- package/dist/src/components/atoms/card/card-footer.js.map +1 -0
- package/dist/src/components/atoms/card/card-header.d.ts +5 -0
- package/dist/src/components/atoms/card/card-header.js +17 -0
- package/dist/src/components/atoms/card/card-header.js.map +1 -0
- package/dist/src/components/atoms/card/card-title.d.ts +5 -0
- package/dist/src/components/atoms/card/card-title.js +17 -0
- package/dist/src/components/atoms/card/card-title.js.map +1 -0
- package/dist/src/components/atoms/card/card.atom.d.ts +11 -0
- package/{src/components/atoms/card/card.atom.ts → dist/src/components/atoms/card/card.atom.js} +11 -17
- package/dist/src/components/atoms/card/card.atom.js.map +1 -0
- package/dist/src/components/atoms/card/card.stories.d.ts +6 -0
- package/{src/components/atoms/card/card.stories.ts → dist/src/components/atoms/card/card.stories.js} +42 -55
- package/dist/src/components/atoms/card/card.stories.js.map +1 -0
- package/dist/src/components/atoms/checkbox/checkbox.atom.d.ts +13 -0
- package/dist/src/components/atoms/checkbox/checkbox.atom.js +87 -0
- package/dist/src/components/atoms/checkbox/checkbox.atom.js.map +1 -0
- package/dist/src/components/atoms/checkbox/checkbox.stories.d.ts +8 -0
- package/dist/src/components/atoms/checkbox/checkbox.stories.js +244 -0
- package/dist/src/components/atoms/checkbox/checkbox.stories.js.map +1 -0
- package/dist/src/components/atoms/checkbox/checkbox.style.d.ts +2 -0
- package/dist/src/components/atoms/checkbox/checkbox.style.js +3 -0
- package/dist/src/components/atoms/checkbox/checkbox.style.js.map +1 -0
- package/dist/src/components/atoms/checkbox/checkbox.type.d.ts +21 -0
- package/dist/src/components/atoms/checkbox/checkbox.type.js +2 -0
- package/dist/src/components/atoms/checkbox/checkbox.type.js.map +1 -0
- package/dist/src/components/atoms/combo-box/combo-box-input.d.ts +8 -0
- package/dist/src/components/atoms/combo-box/combo-box-input.js +47 -0
- package/dist/src/components/atoms/combo-box/combo-box-input.js.map +1 -0
- package/dist/src/components/atoms/combo-box/combo-box-item.d.ts +12 -0
- package/{src/components/atoms/combo-box/combo-box-item.ts → dist/src/components/atoms/combo-box/combo-box-item.js} +44 -18
- package/dist/src/components/atoms/combo-box/combo-box-item.js.map +1 -0
- package/dist/src/components/atoms/combo-box/combo-box-list.d.ts +9 -0
- package/{src/components/atoms/combo-box/combo-box-list.ts → dist/src/components/atoms/combo-box/combo-box-list.js} +37 -27
- package/dist/src/components/atoms/combo-box/combo-box-list.js.map +1 -0
- package/dist/src/components/atoms/combo-box/combo-box.atom.d.ts +23 -0
- package/dist/src/components/atoms/combo-box/combo-box.atom.js +199 -0
- package/dist/src/components/atoms/combo-box/combo-box.atom.js.map +1 -0
- package/dist/src/components/atoms/combo-box/combo-box.stories.d.ts +9 -0
- package/dist/src/components/atoms/combo-box/combo-box.stories.js +86 -0
- package/dist/src/components/atoms/combo-box/combo-box.stories.js.map +1 -0
- package/dist/src/components/atoms/command-empty/command-empty.atom.d.ts +9 -0
- package/dist/src/components/atoms/command-empty/command-empty.atom.js +53 -0
- package/dist/src/components/atoms/command-empty/command-empty.atom.js.map +1 -0
- package/dist/src/components/atoms/command-group/command-group.atom.d.ts +10 -0
- package/dist/src/components/atoms/command-group/command-group.atom.js +70 -0
- package/dist/src/components/atoms/command-group/command-group.atom.js.map +1 -0
- package/dist/src/components/atoms/command-item/command-item.atom.d.ts +12 -0
- package/dist/src/components/atoms/command-item/command-item.atom.js +78 -0
- package/dist/src/components/atoms/command-item/command-item.atom.js.map +1 -0
- package/dist/src/components/atoms/command-list/command-list.atom.d.ts +6 -0
- package/dist/src/components/atoms/command-list/command-list.atom.js +35 -0
- package/dist/src/components/atoms/command-list/command-list.atom.js.map +1 -0
- package/dist/src/components/atoms/command-separator/command-separator.atom.d.ts +9 -0
- package/dist/src/components/atoms/command-separator/command-separator.atom.js +51 -0
- package/dist/src/components/atoms/command-separator/command-separator.atom.js.map +1 -0
- package/dist/src/components/atoms/dialog/dialog-close.d.ts +7 -0
- package/dist/src/components/atoms/dialog/dialog-close.js +46 -0
- package/dist/src/components/atoms/dialog/dialog-close.js.map +1 -0
- package/dist/src/components/atoms/dialog/dialog-content.d.ts +8 -0
- package/dist/src/components/atoms/dialog/dialog-content.js +72 -0
- package/dist/src/components/atoms/dialog/dialog-content.js.map +1 -0
- package/dist/src/components/atoms/dialog/dialog-footer.d.ts +5 -0
- package/dist/src/components/atoms/dialog/dialog-footer.js +22 -0
- package/dist/src/components/atoms/dialog/dialog-footer.js.map +1 -0
- package/dist/src/components/atoms/dialog/dialog-header.d.ts +7 -0
- package/dist/src/components/atoms/dialog/dialog-header.js +40 -0
- package/dist/src/components/atoms/dialog/dialog-header.js.map +1 -0
- package/dist/src/components/atoms/dialog/dialog-overly.d.ts +5 -0
- package/dist/src/components/atoms/dialog/dialog-overly.js +20 -0
- package/dist/src/components/atoms/dialog/dialog-overly.js.map +1 -0
- package/dist/src/components/atoms/dialog/dialog-trigger.d.ts +8 -0
- package/dist/src/components/atoms/dialog/dialog-trigger.js +53 -0
- package/dist/src/components/atoms/dialog/dialog-trigger.js.map +1 -0
- package/dist/src/components/atoms/dialog/dialog.atom.d.ts +8 -0
- package/dist/src/components/atoms/dialog/dialog.atom.js +78 -0
- package/dist/src/components/atoms/dialog/dialog.atom.js.map +1 -0
- package/dist/src/components/atoms/dialog/dialog.stories.d.ts +16 -0
- package/{src/components/atoms/dialog/dialog.stories.ts → dist/src/components/atoms/dialog/dialog.stories.js} +7 -12
- package/dist/src/components/atoms/dialog/dialog.stories.js.map +1 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-checkbox-Item.d.ts +15 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-checkbox-Item.js +115 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-checkbox-Item.js.map +1 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-content.d.ts +13 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-content.js +80 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-content.js.map +1 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-group.d.ts +10 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-group.js +70 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-group.js.map +1 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-item.d.ts +12 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-item.js +78 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-item.js.map +1 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-radio-item.d.ts +15 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-radio-item.js +116 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-radio-item.js.map +1 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-seperator.d.ts +9 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-seperator.js +51 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-seperator.js.map +1 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-shortcut.d.ts +5 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-shortcut.js +20 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-shortcut.js.map +1 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu.atom.d.ts +14 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu.atom.js +77 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu.atom.js.map +1 -0
- package/dist/src/components/atoms/dropdownMenu/dropdownMenu.stories.d.ts +15 -0
- package/{src/components/atoms/dropdownMenu/dropdownMenu.stories.ts → dist/src/components/atoms/dropdownMenu/dropdownMenu.stories.js} +7 -16
- package/dist/src/components/atoms/dropdownMenu/dropdownMenu.stories.js.map +1 -0
- package/dist/src/components/atoms/dropdownMenu/dropdownMenu.style.d.ts +2 -0
- package/dist/src/components/atoms/dropdownMenu/dropdownMenu.style.js +4 -0
- package/dist/src/components/atoms/dropdownMenu/dropdownMenu.style.js.map +1 -0
- package/dist/src/components/atoms/index.js +14 -0
- package/dist/src/components/atoms/index.js.map +1 -0
- package/dist/src/components/atoms/input/input.atom.d.ts +21 -0
- package/dist/src/components/atoms/input/input.atom.js +93 -0
- package/dist/src/components/atoms/input/input.atom.js.map +1 -0
- package/dist/src/components/atoms/input/input.stories.d.ts +8 -0
- package/dist/src/components/atoms/input/input.stories.js +382 -0
- package/dist/src/components/atoms/input/input.stories.js.map +1 -0
- package/dist/src/components/atoms/input/input.styles.d.ts +1 -0
- package/dist/src/components/atoms/input/input.styles.js +2 -0
- package/dist/src/components/atoms/input/input.styles.js.map +1 -0
- package/dist/src/components/atoms/input/input.type.d.ts +21 -0
- package/dist/src/components/atoms/input/input.type.js +2 -0
- package/dist/src/components/atoms/input/input.type.js.map +1 -0
- package/dist/src/components/atoms/label/label.atom.d.ts +11 -0
- package/dist/src/components/atoms/label/label.atom.js +67 -0
- package/dist/src/components/atoms/label/label.atom.js.map +1 -0
- package/dist/src/components/atoms/label/label.stories.d.ts +6 -0
- package/dist/src/components/atoms/label/label.stories.js +85 -0
- package/dist/src/components/atoms/label/label.stories.js.map +1 -0
- package/dist/src/components/atoms/label/label.style.d.ts +1 -0
- package/dist/src/components/atoms/label/label.style.js +3 -0
- package/dist/src/components/atoms/label/label.style.js.map +1 -0
- package/dist/src/components/atoms/popover/popover-content.d.ts +11 -0
- package/dist/src/components/atoms/popover/popover-content.js +62 -0
- package/dist/src/components/atoms/popover/popover-content.js.map +1 -0
- package/dist/src/components/atoms/popover/popover-trigger.d.ts +9 -0
- package/dist/src/components/atoms/popover/popover-trigger.js +50 -0
- package/dist/src/components/atoms/popover/popover-trigger.js.map +1 -0
- package/dist/src/components/atoms/popover/popover.atom.d.ts +8 -0
- package/dist/src/components/atoms/popover/popover.atom.js +40 -0
- package/dist/src/components/atoms/popover/popover.atom.js.map +1 -0
- package/dist/src/components/atoms/popover/popover.stories.d.ts +10 -0
- package/dist/src/components/atoms/popover/popover.stories.js +69 -0
- package/dist/src/components/atoms/popover/popover.stories.js.map +1 -0
- package/dist/src/components/atoms/popover/popover.style.d.ts +5 -0
- package/dist/src/components/atoms/popover/popover.style.js +21 -0
- package/dist/src/components/atoms/popover/popover.style.js.map +1 -0
- package/dist/src/components/atoms/popover/popover.types.d.ts +2 -0
- package/{src/components/atoms/popover/popover.types.ts → dist/src/components/atoms/popover/popover.types.js} +1 -0
- package/dist/src/components/atoms/popover/popover.types.js.map +1 -0
- package/dist/src/components/atoms/toggle/defs.d.ts +27 -0
- package/dist/src/components/atoms/toggle/defs.js +30 -0
- package/dist/src/components/atoms/toggle/defs.js.map +1 -0
- package/dist/src/components/atoms/toggle/toggle.atom.d.ts +19 -0
- package/dist/src/components/atoms/toggle/toggle.atom.js +72 -0
- package/dist/src/components/atoms/toggle/toggle.atom.js.map +1 -0
- package/dist/src/components/atoms/toggle/toggle.stories.d.ts +6 -0
- package/dist/src/components/atoms/toggle/toggle.stories.js +189 -0
- package/dist/src/components/atoms/toggle/toggle.stories.js.map +1 -0
- package/dist/src/components/atoms/toggle/toggle.style.d.ts +4 -0
- package/dist/src/components/atoms/toggle/toggle.style.js +19 -0
- package/dist/src/components/atoms/toggle/toggle.style.js.map +1 -0
- package/dist/src/components/command/command.d.ts +56 -0
- package/dist/src/components/command/command.js +402 -0
- package/dist/src/components/command/command.js.map +1 -0
- package/dist/src/components/command/command.stories.d.ts +5 -0
- package/{src/components/command/command.stories.ts → dist/src/components/command/command.stories.js} +6 -7
- package/dist/src/components/command/command.stories.js.map +1 -0
- package/dist/src/components/index.js +3 -0
- package/dist/src/components/index.js.map +1 -0
- package/dist/src/components/molecules/command/command.molecules.d.ts +6 -0
- package/dist/src/components/molecules/command/command.molecules.js +27 -0
- package/dist/src/components/molecules/command/command.molecules.js.map +1 -0
- package/dist/src/components/molecules/command-input/command-input.atom.d.ts +10 -0
- package/dist/src/components/molecules/command-input/command-input.atom.js +125 -0
- package/dist/src/components/molecules/command-input/command-input.atom.js.map +1 -0
- package/dist/src/components/molecules/dropdownMenu/dropdownMenu.molecules.js +2 -0
- package/dist/src/components/molecules/dropdownMenu/dropdownMenu.molecules.js.map +1 -0
- package/dist/src/components/molecules/index.js +2 -0
- package/dist/src/components/molecules/index.js.map +1 -0
- package/dist/src/helpers/base-element.d.ts +10 -0
- package/dist/src/helpers/base-element.js +62 -0
- package/dist/src/helpers/base-element.js.map +1 -0
- package/dist/src/helpers/index.js +4 -0
- package/dist/src/helpers/index.js.map +1 -0
- package/dist/src/helpers/mouse-conroller.helper.d.ts +14 -0
- package/dist/src/helpers/mouse-conroller.helper.js +33 -0
- package/dist/src/helpers/mouse-conroller.helper.js.map +1 -0
- package/dist/src/helpers/style.helpers.d.ts +2 -0
- package/dist/src/helpers/style.helpers.js +6 -0
- package/dist/src/helpers/style.helpers.js.map +1 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.js +5 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/interfaces/actionable.interface.d.ts +5 -0
- package/dist/src/interfaces/actionable.interface.js +2 -0
- package/dist/src/interfaces/actionable.interface.js.map +1 -0
- package/dist/src/interfaces/atomic.interface.d.ts +6 -0
- package/dist/src/interfaces/atomic.interface.js +2 -0
- package/dist/src/interfaces/atomic.interface.js.map +1 -0
- package/{src/interfaces/changeable.interface.ts → dist/src/interfaces/changeable.interface.d.ts} +7 -14
- package/dist/src/interfaces/changeable.interface.js +2 -0
- package/dist/src/interfaces/changeable.interface.js.map +1 -0
- package/{src/interfaces/child-support-atomic.interface.ts → dist/src/interfaces/child-support-atomic.interface.d.ts} +4 -5
- package/dist/src/interfaces/child-support-atomic.interface.js +2 -0
- package/dist/src/interfaces/child-support-atomic.interface.js.map +1 -0
- package/dist/src/interfaces/index.js +7 -0
- package/dist/src/interfaces/index.js.map +1 -0
- package/dist/src/interfaces/intractable.interface.d.ts +6 -0
- package/dist/src/interfaces/intractable.interface.js +2 -0
- package/dist/src/interfaces/intractable.interface.js.map +1 -0
- package/{src/interfaces/variant.interface.ts → dist/src/interfaces/variant.interface.d.ts} +1 -1
- package/dist/src/interfaces/variant.interface.js +2 -0
- package/dist/src/interfaces/variant.interface.js.map +1 -0
- package/dist/src/lib/index.js +2 -0
- package/dist/src/lib/index.js.map +1 -0
- package/dist/src/lib/next/next.lib.js +2 -0
- package/dist/src/lib/next/next.lib.js.map +1 -0
- package/dist/src/lib/react/react.lib.d.ts +5 -0
- package/{src/lib/react/react.lib.ts → dist/src/lib/react/react.lib.js} +7 -9
- package/dist/src/lib/react/react.lib.js.map +1 -0
- package/dist/src/lib/tw-styles.d.ts +1 -0
- package/{src/lib/tw-styles.ts → dist/src/lib/tw-styles.js} +4 -5
- package/dist/src/lib/tw-styles.js.map +1 -0
- package/dist/src/styles/index.js +2 -0
- package/dist/src/styles/index.js.map +1 -0
- package/dist/src/styles/tw.styles.d.ts +1 -0
- package/{src/styles/tw.styles.ts → dist/src/styles/tw.styles.js} +4 -5
- package/dist/src/styles/tw.styles.js.map +1 -0
- package/dist/src/wc-ui-app.d.ts +6 -0
- package/{src/wc-ui-app.ts → dist/src/wc-ui-app.js} +42 -35
- package/dist/src/wc-ui-app.js.map +1 -0
- package/dist/test/wc-ui-app.test.js +18 -0
- package/dist/test/wc-ui-app.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/vite.config.d.ts +2 -0
- package/dist/vite.config.js +29 -0
- package/dist/vite.config.js.map +1 -0
- package/package.json +14 -21
- package/.editorconfig +0 -29
- package/.eslintrc +0 -10
- package/.github/workflows/deploy-storybook.yml +0 -107
- package/.storybook/main.ts +0 -17
- package/.storybook/preview-head.html +0 -1
- package/.storybook/preview.ts +0 -17
- package/assets/fonts/Geist/Geist-Black.otf +0 -0
- package/assets/fonts/Geist/Geist-Black.woff2 +0 -0
- package/assets/fonts/Geist/Geist-Bold.otf +0 -0
- package/assets/fonts/Geist/Geist-Bold.woff2 +0 -0
- package/assets/fonts/Geist/Geist-Light.otf +0 -0
- package/assets/fonts/Geist/Geist-Light.woff2 +0 -0
- package/assets/fonts/Geist/Geist-Medium.otf +0 -0
- package/assets/fonts/Geist/Geist-Medium.woff2 +0 -0
- package/assets/fonts/Geist/Geist-Regular.otf +0 -0
- package/assets/fonts/Geist/Geist-Regular.woff2 +0 -0
- package/assets/fonts/Geist/Geist-SemiBold.otf +0 -0
- package/assets/fonts/Geist/Geist-SemiBold.woff2 +0 -0
- package/assets/fonts/Geist/Geist-Thin.otf +0 -0
- package/assets/fonts/Geist/Geist-Thin.woff2 +0 -0
- package/assets/fonts/Geist/Geist-UltraBlack.otf +0 -0
- package/assets/fonts/Geist/Geist-UltraBlack.woff2 +0 -0
- package/assets/fonts/Geist/Geist-UltraLight.otf +0 -0
- package/assets/fonts/Geist/Geist-UltraLight.woff2 +0 -0
- package/assets/fonts/Geist/GeistVariableVF.ttf +0 -0
- package/assets/fonts/Geist/GeistVariableVF.woff2 +0 -0
- package/assets/fonts/Geist/LICENSE.TXT +0 -92
- package/assets/open-wc-logo.svg +0 -29
- package/assume_role.sh +0 -18
- package/dist/f28fd4b1.js +0 -1
- package/dist/index.ts +0 -1
- package/dist/sw.js +0 -2
- package/dist/sw.js.map +0 -1
- package/dist/workbox-a523fd56.js +0 -2
- package/dist/workbox-a523fd56.js.map +0 -1
- package/index.html +0 -314
- package/rollup.config.js +0 -83
- package/src/components/atoms/alert/alert-description.ts +0 -15
- package/src/components/atoms/alert/alert-title.ts +0 -17
- package/src/components/atoms/alert/alert.stories.ts +0 -71
- package/src/components/atoms/alert/alert.styles.ts +0 -21
- package/src/components/atoms/badge/badge.atom.ts +0 -40
- package/src/components/atoms/badge/badge.stories.ts +0 -118
- package/src/components/atoms/badge/badge.style.ts +0 -24
- package/src/components/atoms/badge/badge.type.ts +0 -7
- package/src/components/atoms/button/button.atom.ts +0 -59
- package/src/components/atoms/button/button.stories.ts +0 -224
- package/src/components/atoms/button/button.style.ts +0 -31
- package/src/components/atoms/card/card-content.ts +0 -15
- package/src/components/atoms/card/card-description.ts +0 -15
- package/src/components/atoms/card/card-footer.ts +0 -15
- package/src/components/atoms/card/card-header.ts +0 -15
- package/src/components/atoms/card/card-title.ts +0 -15
- package/src/components/atoms/checkbox/checkbox.atom.ts +0 -76
- package/src/components/atoms/checkbox/checkbox.stories.ts +0 -309
- package/src/components/atoms/checkbox/checkbox.style.ts +0 -5
- package/src/components/atoms/checkbox/checkbox.type.ts +0 -24
- package/src/components/atoms/combo-box/combo-box-input.ts +0 -33
- package/src/components/atoms/combo-box/combo-box.atom.ts +0 -187
- package/src/components/atoms/combo-box/combo-box.stories.ts +0 -95
- package/src/components/atoms/command-empty/command-empty.atom.ts +0 -44
- package/src/components/atoms/command-group/command-group.atom.ts +0 -60
- package/src/components/atoms/command-item/command-item.atom.ts +0 -74
- package/src/components/atoms/command-list/command-list.atom.ts +0 -37
- package/src/components/atoms/command-separator/command-separator.atom.ts +0 -42
- package/src/components/atoms/dialog/dialog-close.ts +0 -50
- package/src/components/atoms/dialog/dialog-content.ts +0 -71
- package/src/components/atoms/dialog/dialog-footer.ts +0 -22
- package/src/components/atoms/dialog/dialog-header.ts +0 -36
- package/src/components/atoms/dialog/dialog-overly.ts +0 -20
- package/src/components/atoms/dialog/dialog-trigger.ts +0 -54
- package/src/components/atoms/dialog/dialog.atom.ts +0 -78
- package/src/components/atoms/dropdownMenu/dropdown-menu-checkbox-Item.ts +0 -106
- package/src/components/atoms/dropdownMenu/dropdown-menu-content.ts +0 -79
- package/src/components/atoms/dropdownMenu/dropdown-menu-group.ts +0 -60
- package/src/components/atoms/dropdownMenu/dropdown-menu-item.ts +0 -74
- package/src/components/atoms/dropdownMenu/dropdown-menu-radio-item.ts +0 -107
- package/src/components/atoms/dropdownMenu/dropdown-menu-seperator.ts +0 -44
- package/src/components/atoms/dropdownMenu/dropdown-menu-shortcut.ts +0 -17
- package/src/components/atoms/dropdownMenu/dropdown-menu.atom.ts +0 -84
- package/src/components/atoms/dropdownMenu/dropdownMenu.style.ts +0 -7
- package/src/components/atoms/input/input.atom.ts +0 -88
- package/src/components/atoms/input/input.stories.ts +0 -451
- package/src/components/atoms/input/input.styles.ts +0 -2
- package/src/components/atoms/input/input.type.ts +0 -58
- package/src/components/atoms/label/label.atom.ts +0 -64
- package/src/components/atoms/label/label.stories.ts +0 -102
- package/src/components/atoms/label/label.style.ts +0 -5
- package/src/components/atoms/popover/popover-content.ts +0 -58
- package/src/components/atoms/popover/popover-trigger.ts +0 -50
- package/src/components/atoms/popover/popover.atom.ts +0 -34
- package/src/components/atoms/popover/popover.stories.ts +0 -79
- package/src/components/atoms/popover/popover.style.ts +0 -25
- package/src/components/atoms/toggle/defs.ts +0 -29
- package/src/components/atoms/toggle/toggle.atom.ts +0 -58
- package/src/components/atoms/toggle/toggle.stories.ts +0 -204
- package/src/components/atoms/toggle/toggle.style.ts +0 -22
- package/src/components/command/command.ts +0 -391
- package/src/components/molecules/command/command.molecules.ts +0 -31
- package/src/components/molecules/command-input/command-input.atom.ts +0 -130
- package/src/globals.css +0 -2215
- package/src/helpers/base-element.ts +0 -79
- package/src/helpers/mouse-conroller.helper.ts +0 -42
- package/src/helpers/style.helpers.ts +0 -6
- package/src/index.d.ts +0 -1
- package/src/index.ts +0 -1
- package/src/interfaces/actionable.interface.ts +0 -6
- package/src/interfaces/atomic.interface.ts +0 -6
- package/src/interfaces/intractable.interface.ts +0 -6
- package/src/tailwind-lib.css +0 -115
- package/tailwind.config.js +0 -217
- package/test/wc-ui-app.test.ts +0 -22
- package/tsconfig.json +0 -30
- package/web-dev-server.config.mjs +0 -26
- package/web-test-runner.config.mjs +0 -41
- /package/{src/assets/icons/index.ts → dist/src/assets/icons/index.d.ts} +0 -0
- /package/{src/components/atoms/alert/alert.types.ts → dist/src/components/atoms/alert/alert.types.d.ts} +0 -0
- /package/{src/components/atoms/index.ts → dist/src/components/atoms/index.d.ts} +0 -0
- /package/{src/components/index.ts → dist/src/components/index.d.ts} +0 -0
- /package/{src/chai-custom.d.ts → dist/src/components/molecules/dropdownMenu/dropdownMenu.molecules.d.ts} +0 -0
- /package/{src/components/molecules/index.ts → dist/src/components/molecules/index.d.ts} +0 -0
- /package/{src/helpers/index.ts → dist/src/helpers/index.d.ts} +0 -0
- /package/{src/interfaces/index.ts → dist/src/interfaces/index.d.ts} +0 -0
- /package/{src/components/molecules/dropdownMenu/dropdownMenu.molecules.ts → dist/src/lib/index.d.ts} +0 -0
- /package/{src/lib/index.ts → dist/src/lib/next/next.lib.d.ts} +0 -0
- /package/{src/styles/index.ts → dist/src/styles/index.d.ts} +0 -0
- /package/{src/lib/next/next.lib.ts → dist/test/wc-ui-app.test.d.ts} +0 -0
@@ -1,309 +0,0 @@
|
|
1
|
-
import type { Meta, StoryFn, StoryContext } from '@storybook/web-components';
|
2
|
-
import { html } from 'lit';
|
3
|
-
import './checkbox.atom';
|
4
|
-
import { expect, within, userEvent, waitFor, fn } from '@storybook/test';
|
5
|
-
import {
|
6
|
-
CheckboxArgs,
|
7
|
-
CheckboxWithRequiredArgs,
|
8
|
-
CheckboxWithValueArgs,
|
9
|
-
} from './checkbox.type';
|
10
|
-
import '../button/button.atom';
|
11
|
-
|
12
|
-
const allowedTypes = ['checkbox'];
|
13
|
-
|
14
|
-
export default {
|
15
|
-
component: 'components/checkbox',
|
16
|
-
tags: ['autodocs'],
|
17
|
-
} as Meta;
|
18
|
-
|
19
|
-
const mockOnClickHandler = fn(event => {
|
20
|
-
alert('submit data!');
|
21
|
-
});
|
22
|
-
|
23
|
-
const testCheckboxBehavior = async (
|
24
|
-
args: CheckboxArgs,
|
25
|
-
canvasElement: HTMLElement
|
26
|
-
) => {
|
27
|
-
const canvas = within(canvasElement);
|
28
|
-
const checkbox = await waitFor(() => canvas.getByTestId('checkbox-id'));
|
29
|
-
|
30
|
-
if (checkbox.shadowRoot) {
|
31
|
-
const innerCheckbox = checkbox.shadowRoot.querySelector(
|
32
|
-
'[data-testid="checkbox-atom"]'
|
33
|
-
);
|
34
|
-
|
35
|
-
// 1. Test: Checkbox should have correct Role attribute
|
36
|
-
expect(innerCheckbox).toHaveRole('checkbox');
|
37
|
-
|
38
|
-
// 2. Test: Checkbox should have the correct `checked` state based on args
|
39
|
-
if (args.checked) {
|
40
|
-
expect(innerCheckbox).toBeChecked();
|
41
|
-
} else {
|
42
|
-
expect(innerCheckbox).not.toBeChecked();
|
43
|
-
}
|
44
|
-
|
45
|
-
// 3. Test: Checkbox should be disabled when the `disabled` prop is true
|
46
|
-
if (args.disabled) {
|
47
|
-
expect(innerCheckbox).toBeDisabled();
|
48
|
-
} else {
|
49
|
-
expect(innerCheckbox).not.toBeDisabled();
|
50
|
-
}
|
51
|
-
|
52
|
-
// 4. Test: Label should have correct `for` attribute linking to the checkbox
|
53
|
-
const label = await waitFor(() => canvas.getByText(args.label));
|
54
|
-
expect(label).toBeInTheDocument();
|
55
|
-
expect(label).toHaveAttribute('for', checkbox.getAttribute('id'));
|
56
|
-
}
|
57
|
-
};
|
58
|
-
|
59
|
-
const testCheckboxWithRequiredBehavior = async (
|
60
|
-
args: CheckboxWithRequiredArgs,
|
61
|
-
canvasElement: HTMLElement
|
62
|
-
) => {
|
63
|
-
const canvas = within(canvasElement);
|
64
|
-
const checkbox = await waitFor(() => canvas.getByTestId('checkbox-id'));
|
65
|
-
const button = await waitFor(() => canvas.getByTestId('btn-id'));
|
66
|
-
|
67
|
-
if (checkbox.shadowRoot) {
|
68
|
-
const innerCheckbox = checkbox.shadowRoot.querySelector(
|
69
|
-
'[data-testid="checkbox-atom"]'
|
70
|
-
);
|
71
|
-
|
72
|
-
// Test: Checkbox should have the correct required attribute
|
73
|
-
if (args.required) {
|
74
|
-
expect(innerCheckbox).toHaveAttribute('required');
|
75
|
-
} else {
|
76
|
-
expect(innerCheckbox).not.toHaveAttribute('required');
|
77
|
-
}
|
78
|
-
|
79
|
-
// Test: Button should be disabled when checkbox is unchecked and required is true
|
80
|
-
if (args.required && !args.checked) {
|
81
|
-
expect(button).toBeDisabled();
|
82
|
-
} else if (args.required && args.checked) {
|
83
|
-
expect(button).not.toBeDisabled();
|
84
|
-
}
|
85
|
-
|
86
|
-
// Additional tests for the checked state
|
87
|
-
if (args.checked) {
|
88
|
-
expect(innerCheckbox).toBeChecked();
|
89
|
-
} else {
|
90
|
-
expect(innerCheckbox).not.toBeChecked();
|
91
|
-
}
|
92
|
-
|
93
|
-
// Additional tests for the disabled state
|
94
|
-
if (args.disabled) {
|
95
|
-
expect(innerCheckbox).toBeDisabled();
|
96
|
-
} else {
|
97
|
-
expect(innerCheckbox).not.toBeDisabled();
|
98
|
-
}
|
99
|
-
}
|
100
|
-
};
|
101
|
-
|
102
|
-
const testCheckboxWithValueBehavior = async (
|
103
|
-
args: CheckboxWithValueArgs,
|
104
|
-
canvasElement: HTMLElement
|
105
|
-
) => {
|
106
|
-
const canvas = within(canvasElement);
|
107
|
-
const checkbox = await waitFor(() => canvas.getByTestId('checkbox-id'));
|
108
|
-
|
109
|
-
if (checkbox.shadowRoot) {
|
110
|
-
const innerCheckbox = checkbox.shadowRoot.querySelector(
|
111
|
-
'[data-testid="checkbox-atom"]'
|
112
|
-
);
|
113
|
-
|
114
|
-
// Test: Checkbox should have the correct value attribute
|
115
|
-
expect(innerCheckbox).toHaveAttribute('value', args.value);
|
116
|
-
|
117
|
-
// Additional tests for disabled state if needed
|
118
|
-
if (args.disabled) {
|
119
|
-
expect(innerCheckbox).toBeDisabled();
|
120
|
-
} else {
|
121
|
-
expect(innerCheckbox).not.toBeDisabled();
|
122
|
-
}
|
123
|
-
}
|
124
|
-
};
|
125
|
-
|
126
|
-
const TemplatewithChecked: StoryFn = ({ disabled, checked, label }) =>
|
127
|
-
html`
|
128
|
-
<div style="display:flex">
|
129
|
-
<rtg-checkbox
|
130
|
-
id="terms"
|
131
|
-
data-testid="checkbox-id"
|
132
|
-
?disabled=${disabled}
|
133
|
-
?checked=${checked}
|
134
|
-
></rtg-checkbox>
|
135
|
-
<rtg-label style="margin:2px 0px 0px 4px" for="terms">${label}</rtg-label>
|
136
|
-
</div>
|
137
|
-
`;
|
138
|
-
|
139
|
-
const TemplatewithRequired: StoryFn = ({
|
140
|
-
disabled,
|
141
|
-
checked,
|
142
|
-
label,
|
143
|
-
required,
|
144
|
-
}) =>
|
145
|
-
html`
|
146
|
-
<div style="display: flex; flex-direction: column;">
|
147
|
-
<div style="display:flex">
|
148
|
-
<rtg-checkbox
|
149
|
-
id="terms"
|
150
|
-
data-testid="checkbox-id"
|
151
|
-
?disabled=${disabled}
|
152
|
-
?checked=${checked}
|
153
|
-
?required=${required}
|
154
|
-
@click=${(e: Event) => {
|
155
|
-
const checkbox = e.target as HTMLInputElement;
|
156
|
-
const button = document.querySelector(
|
157
|
-
'rtg-button'
|
158
|
-
) as HTMLButtonElement;
|
159
|
-
if (button) {
|
160
|
-
button.disabled = required ? !checkbox.checked : false;
|
161
|
-
}
|
162
|
-
}}
|
163
|
-
></rtg-checkbox>
|
164
|
-
<rtg-label style="margin:2px 0px 0px 4px" for="terms"
|
165
|
-
>${label}</rtg-label
|
166
|
-
>
|
167
|
-
</div>
|
168
|
-
<div style="margin-top:16px">
|
169
|
-
<rtg-button
|
170
|
-
variant="default"
|
171
|
-
size="default"
|
172
|
-
data-testid="btn-id"
|
173
|
-
?disabled=${required ? !checked : false}
|
174
|
-
.click=${mockOnClickHandler}
|
175
|
-
>Submit</rtg-button
|
176
|
-
>
|
177
|
-
</div>
|
178
|
-
</div>
|
179
|
-
`;
|
180
|
-
|
181
|
-
const TemplateWithVlaue: StoryFn = ({ disabled, label, value }) =>
|
182
|
-
html`
|
183
|
-
<div style="display:flex">
|
184
|
-
<rtg-checkbox
|
185
|
-
id="terms"
|
186
|
-
data-testid="checkbox-id"
|
187
|
-
value=${value}
|
188
|
-
?disabled=${disabled}
|
189
|
-
></rtg-checkbox>
|
190
|
-
<rtg-label style="margin:2px 0px 0px 4px" for="terms">${label}</rtg-label>
|
191
|
-
</div>
|
192
|
-
`;
|
193
|
-
|
194
|
-
export const CheckboxWithReuired = TemplatewithRequired.bind({});
|
195
|
-
CheckboxWithReuired.args = {
|
196
|
-
disabled: false,
|
197
|
-
checked: false,
|
198
|
-
required: false,
|
199
|
-
label: 'Accept terms and conditions',
|
200
|
-
};
|
201
|
-
|
202
|
-
CheckboxWithReuired.parameters = {
|
203
|
-
docs: {
|
204
|
-
source: {
|
205
|
-
transform: (code: string, storyContext: StoryContext) => {
|
206
|
-
const args = storyContext.args;
|
207
|
-
|
208
|
-
// Handling boolean attributes: if true, render without value, if false, omit the attribute
|
209
|
-
const updatedCode = code
|
210
|
-
.replace(/disabled=""/g, 'disabled=true')
|
211
|
-
.replace(/checked=""/g, 'checked=true')
|
212
|
-
.replace(/required=""/g, 'required=true')
|
213
|
-
.replace(/disabled="false"/g, '')
|
214
|
-
.replace(/checked="false"/g, '')
|
215
|
-
.replace(/required="false"/g, '');
|
216
|
-
|
217
|
-
return updatedCode;
|
218
|
-
},
|
219
|
-
},
|
220
|
-
},
|
221
|
-
};
|
222
|
-
|
223
|
-
CheckboxWithReuired.argTypes = {
|
224
|
-
disabled: {
|
225
|
-
control: 'boolean',
|
226
|
-
description: 'Determines whether the checkbox is disabled (unclickable).',
|
227
|
-
table: {
|
228
|
-
defaultValue: { summary: 'false' },
|
229
|
-
},
|
230
|
-
docs: {
|
231
|
-
source: {
|
232
|
-
code: (args: { disabled: boolean }) => (args.disabled ? true : ''),
|
233
|
-
},
|
234
|
-
},
|
235
|
-
},
|
236
|
-
checked: {
|
237
|
-
control: 'boolean',
|
238
|
-
description: 'Specifies whether the checkbox is checked by default.',
|
239
|
-
table: {
|
240
|
-
defaultValue: { summary: 'false' },
|
241
|
-
},
|
242
|
-
},
|
243
|
-
required: {
|
244
|
-
control: 'boolean',
|
245
|
-
description:
|
246
|
-
'Marks the checkbox as a required field. When true, the checkbox must be checked for form submission, and related actions such as enabling a submit button are dependent on this state.',
|
247
|
-
table: {
|
248
|
-
defaultValue: { summary: 'false' },
|
249
|
-
},
|
250
|
-
},
|
251
|
-
label: {
|
252
|
-
control: 'text',
|
253
|
-
description:
|
254
|
-
'The text displayed next to the checkbox, describing its purpose.',
|
255
|
-
},
|
256
|
-
};
|
257
|
-
|
258
|
-
CheckboxWithReuired.play = async ({ args, canvasElement }) => {
|
259
|
-
await testCheckboxWithRequiredBehavior(
|
260
|
-
args as CheckboxWithRequiredArgs,
|
261
|
-
canvasElement
|
262
|
-
);
|
263
|
-
};
|
264
|
-
|
265
|
-
export const Checkbox = TemplatewithChecked.bind({});
|
266
|
-
Checkbox.args = {
|
267
|
-
disabled: false,
|
268
|
-
checked: false,
|
269
|
-
label: 'Accept terms and conditions',
|
270
|
-
};
|
271
|
-
|
272
|
-
Checkbox.argTypes = {
|
273
|
-
disabled: {
|
274
|
-
control: 'boolean',
|
275
|
-
},
|
276
|
-
checked: {
|
277
|
-
control: 'boolean',
|
278
|
-
},
|
279
|
-
label: {
|
280
|
-
control: 'text',
|
281
|
-
},
|
282
|
-
};
|
283
|
-
|
284
|
-
Checkbox.play = async ({ args, canvasElement }) => {
|
285
|
-
await testCheckboxBehavior(args as CheckboxArgs, canvasElement);
|
286
|
-
};
|
287
|
-
|
288
|
-
export const CheckboxWithValue = TemplateWithVlaue.bind({});
|
289
|
-
CheckboxWithValue.args = {
|
290
|
-
disabled: false,
|
291
|
-
value: 'off',
|
292
|
-
label: 'Accept terms and conditions',
|
293
|
-
};
|
294
|
-
|
295
|
-
CheckboxWithValue.argTypes = {
|
296
|
-
disabled: { control: 'boolean' },
|
297
|
-
value: {
|
298
|
-
control: { type: 'select' },
|
299
|
-
options: ['on', 'off'],
|
300
|
-
},
|
301
|
-
label: { control: 'text' },
|
302
|
-
};
|
303
|
-
|
304
|
-
CheckboxWithValue.play = async ({ args, canvasElement }) => {
|
305
|
-
await testCheckboxWithValueBehavior(
|
306
|
-
args as CheckboxWithValueArgs,
|
307
|
-
canvasElement
|
308
|
-
);
|
309
|
-
};
|
@@ -1,5 +0,0 @@
|
|
1
|
-
export const checkboxStyles =
|
2
|
-
'peer h-4 w-4 align-middle shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground';
|
3
|
-
|
4
|
-
export const iconStyles =
|
5
|
-
'flex items-center justify-center text-current pointer-events-none';
|
@@ -1,24 +0,0 @@
|
|
1
|
-
export type CheckboxProperties = {
|
2
|
-
disabled: boolean;
|
3
|
-
checked: boolean;
|
4
|
-
};
|
5
|
-
|
6
|
-
export type CheckboxArgs = {
|
7
|
-
disabled: boolean;
|
8
|
-
checked: boolean;
|
9
|
-
label: string;
|
10
|
-
};
|
11
|
-
|
12
|
-
export type CheckboxWithRequiredArgs = {
|
13
|
-
disabled: boolean;
|
14
|
-
checked: boolean;
|
15
|
-
required: boolean;
|
16
|
-
label: string;
|
17
|
-
value?: string;
|
18
|
-
};
|
19
|
-
|
20
|
-
export type CheckboxWithValueArgs = {
|
21
|
-
disabled: boolean;
|
22
|
-
value: string;
|
23
|
-
label: string;
|
24
|
-
};
|
@@ -1,33 +0,0 @@
|
|
1
|
-
import { LitElement, html, css } from 'lit';
|
2
|
-
import { customElement, property } from 'lit/decorators.js';
|
3
|
-
import { TWStyles } from '../../../styles';
|
4
|
-
|
5
|
-
@customElement('combo-box-input')
|
6
|
-
export class ComboBoxInput extends LitElement {
|
7
|
-
@property({ type: String }) value = '';
|
8
|
-
@property({ type: Function }) handleClick = () => {};
|
9
|
-
@property({ type: Function }) handleKeyDown = () => {};
|
10
|
-
|
11
|
-
static styles = [css``, TWStyles];
|
12
|
-
|
13
|
-
render() {
|
14
|
-
return html`
|
15
|
-
<input
|
16
|
-
class="inline-flex justify-between items-center w-full h-10 px-4 py-2 whitespace-nowrap rounded-md
|
17
|
-
text-sm font-medium border border-input cursor-pointer
|
18
|
-
ring-offset-background
|
19
|
-
transition-colors disabled:pointer-events-none
|
20
|
-
disabled:opacity-50
|
21
|
-
bg-background hover:bg-accent
|
22
|
-
hover:text-accent-foreground
|
23
|
-
outline-none"
|
24
|
-
role="combobox"
|
25
|
-
aria-expanded="false"
|
26
|
-
readonly="true"
|
27
|
-
.value=${this.value}
|
28
|
-
@click=${this.handleClick}
|
29
|
-
@keydown=${this.handleKeyDown}
|
30
|
-
/>
|
31
|
-
`;
|
32
|
-
}
|
33
|
-
}
|
@@ -1,187 +0,0 @@
|
|
1
|
-
import { css, html, LitElement, PropertyValues } from 'lit';
|
2
|
-
import { customElement, property, state } from 'lit/decorators.js';
|
3
|
-
import { TWStyles } from '../../../styles';
|
4
|
-
import { arrowsIcon, searchIcon } from '../../../assets/icons';
|
5
|
-
import './combo-box-input';
|
6
|
-
import './combo-box-item';
|
7
|
-
|
8
|
-
@customElement('rtg-combo-box')
|
9
|
-
class ComboBox extends LitElement {
|
10
|
-
static styles = [css``, TWStyles];
|
11
|
-
|
12
|
-
@state() isOpen = false;
|
13
|
-
@state() selectedValue = '';
|
14
|
-
@state() searchTerm = '';
|
15
|
-
@state() focusedIndex = -1;
|
16
|
-
@state() filteredItems: string[] = [];
|
17
|
-
@property({ type: String }) label: string = 'Select an item';
|
18
|
-
@property({ type: Array }) items = [];
|
19
|
-
protected firstUpdated(_changedProperties: PropertyValues): void {
|
20
|
-
if (this.items && this.items.length > 0)
|
21
|
-
this.filteredItems = this.items.filter((item: string) =>
|
22
|
-
item.toLowerCase().includes(this.searchTerm)
|
23
|
-
);
|
24
|
-
}
|
25
|
-
toggleDropdown() {
|
26
|
-
this.isOpen = !this.isOpen;
|
27
|
-
this.focusedIndex = -1;
|
28
|
-
}
|
29
|
-
|
30
|
-
selectItem(event: Event) {
|
31
|
-
const target = event.target as EventTarget;
|
32
|
-
if (target instanceof HTMLElement) {
|
33
|
-
const closestItem = target.closest(
|
34
|
-
'combo-box-item'
|
35
|
-
) as HTMLElement | null;
|
36
|
-
if (closestItem) {
|
37
|
-
this.selectedValue =
|
38
|
-
closestItem.getAttribute('data-hs-combo-box-value') || '';
|
39
|
-
this.isOpen = false;
|
40
|
-
} else {
|
41
|
-
console.log('No valid combo-box-item found');
|
42
|
-
}
|
43
|
-
} else {
|
44
|
-
console.log('Event target is not an HTMLElement');
|
45
|
-
}
|
46
|
-
}
|
47
|
-
|
48
|
-
handleInputClick() {
|
49
|
-
this.toggleDropdown();
|
50
|
-
}
|
51
|
-
|
52
|
-
handleSearch(event: Event) {
|
53
|
-
const input = event.target as HTMLInputElement;
|
54
|
-
this.searchTerm = input.value;
|
55
|
-
this.filteredItems = this.items.filter((item: string) =>
|
56
|
-
item.toLowerCase().includes(this.searchTerm)
|
57
|
-
);
|
58
|
-
}
|
59
|
-
|
60
|
-
handleKeyDown(event: KeyboardEvent) {
|
61
|
-
const filteredLength = this.filteredItems.length;
|
62
|
-
|
63
|
-
switch (event.key) {
|
64
|
-
case 'ArrowDown':
|
65
|
-
event.preventDefault();
|
66
|
-
this.focusedIndex = (this.focusedIndex + 1) % filteredLength;
|
67
|
-
break;
|
68
|
-
case 'ArrowUp':
|
69
|
-
event.preventDefault();
|
70
|
-
this.focusedIndex =
|
71
|
-
(this.focusedIndex - 1 + filteredLength) % filteredLength;
|
72
|
-
break;
|
73
|
-
case 'Enter':
|
74
|
-
if (this.focusedIndex >= 0 && this.focusedIndex < filteredLength) {
|
75
|
-
this.selectedValue = this.filteredItems[this.focusedIndex];
|
76
|
-
this.isOpen = false;
|
77
|
-
}
|
78
|
-
break;
|
79
|
-
default:
|
80
|
-
break;
|
81
|
-
}
|
82
|
-
}
|
83
|
-
|
84
|
-
handleMouseOver(event: Event, index: number) {
|
85
|
-
event.preventDefault();
|
86
|
-
this.focusedIndex = index;
|
87
|
-
}
|
88
|
-
|
89
|
-
updateFocus() {
|
90
|
-
if (!this.shadowRoot) return;
|
91
|
-
|
92
|
-
const items =
|
93
|
-
this.shadowRoot.querySelectorAll<HTMLElement>('combo-box-item');
|
94
|
-
items.forEach((item, index) => {
|
95
|
-
if (index === this.focusedIndex) {
|
96
|
-
item.classList.add('bg-gray-100');
|
97
|
-
} else {
|
98
|
-
item.classList.remove('bg-gray-100');
|
99
|
-
}
|
100
|
-
});
|
101
|
-
}
|
102
|
-
|
103
|
-
render() {
|
104
|
-
return html`
|
105
|
-
<div class="relative" data-hs-combo-box="">
|
106
|
-
<div class="relative">
|
107
|
-
<input
|
108
|
-
class="inline-flex justify-between items-center w-full h-10 px-4 py-2 whitespace-nowrap rounded-md
|
109
|
-
text-sm font-medium border border-input cursor-pointer
|
110
|
-
ring-offset-background
|
111
|
-
transition-colors disabled:pointer-events-none
|
112
|
-
disabled:opacity-50
|
113
|
-
bg-background hover:bg-accent
|
114
|
-
hover:text-accent-foreground
|
115
|
-
outline-none"
|
116
|
-
role="combobox"
|
117
|
-
aria-expanded=${this.isOpen}
|
118
|
-
readonly
|
119
|
-
.value=${this.selectedValue || this.label}
|
120
|
-
@click="${this.handleInputClick}"
|
121
|
-
@keydown="${this.handleKeyDown}"
|
122
|
-
/>
|
123
|
-
<div
|
124
|
-
class="absolute top-1/2 end-3 -translate-y-1/2 cursor-pointer"
|
125
|
-
aria-expanded=${this.isOpen}
|
126
|
-
data-hs-combo-box-toggle=""
|
127
|
-
@click="${this.toggleDropdown}"
|
128
|
-
>
|
129
|
-
${arrowsIcon()}
|
130
|
-
</div>
|
131
|
-
</div>
|
132
|
-
<div
|
133
|
-
class="absolute z-50 w-full max-h-72 p-1 bg-white border border-gray-200 rounded-lg overflow-hidden overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-900 dark:border-neutral-700"
|
134
|
-
style="display: ${this.isOpen ? 'block' : 'none'}; top:115%"
|
135
|
-
data-hs-combo-box-output=""
|
136
|
-
@keydown="${this.handleKeyDown}"
|
137
|
-
>
|
138
|
-
<div
|
139
|
-
class="flex items-center justify-center px-3 border-b border-gray-300 mb-1"
|
140
|
-
>
|
141
|
-
${searchIcon()}
|
142
|
-
<input
|
143
|
-
type="text"
|
144
|
-
class="w-full px-2 py-2 rounded focus:outline-none"
|
145
|
-
placeholder="Search..."
|
146
|
-
autocomplete="off"
|
147
|
-
autocorrect="off"
|
148
|
-
spellcheck="false"
|
149
|
-
aria-autocomplete="list"
|
150
|
-
role="combobox"
|
151
|
-
@input="${this.handleSearch}"
|
152
|
-
@keydown="${this.handleKeyDown}"
|
153
|
-
/>
|
154
|
-
</div>
|
155
|
-
${this.filteredItems.length === 0
|
156
|
-
? html`
|
157
|
-
<div
|
158
|
-
class="py-6 text-center text-sm"
|
159
|
-
cmdk-empty=""
|
160
|
-
role="presentation"
|
161
|
-
>
|
162
|
-
No item found.
|
163
|
-
</div>
|
164
|
-
`
|
165
|
-
: html`
|
166
|
-
${this.filteredItems.map((item, index) => {
|
167
|
-
return html`
|
168
|
-
<combo-box-item
|
169
|
-
.searchText=${item}
|
170
|
-
.value=${item}
|
171
|
-
data-hs-combo-box-value=${item}
|
172
|
-
tabIndex=${index}
|
173
|
-
@click="${(event: Event) => this.selectItem(event)}"
|
174
|
-
@mouseover="${(event: Event) =>
|
175
|
-
this.handleMouseOver(event, index)}"
|
176
|
-
?isSelected=${item === this.selectedValue}
|
177
|
-
></combo-box-item>
|
178
|
-
`;
|
179
|
-
})}
|
180
|
-
`}
|
181
|
-
</div>
|
182
|
-
</div>
|
183
|
-
`;
|
184
|
-
}
|
185
|
-
}
|
186
|
-
|
187
|
-
export { ComboBox };
|
@@ -1,95 +0,0 @@
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/web-components';
|
2
|
-
import { html } from 'lit';
|
3
|
-
import { expect, within, userEvent, waitFor, fn } from '@storybook/test';
|
4
|
-
import './combo-box.atom';
|
5
|
-
import './combo-box-list';
|
6
|
-
import './combo-box-item';
|
7
|
-
|
8
|
-
const frameworks = [
|
9
|
-
{
|
10
|
-
value: 'next.js',
|
11
|
-
label: 'Next.js',
|
12
|
-
},
|
13
|
-
{
|
14
|
-
value: 'sveltekit',
|
15
|
-
label: 'SvelteKit',
|
16
|
-
},
|
17
|
-
{
|
18
|
-
value: 'nuxt.js',
|
19
|
-
label: 'Nuxt.js',
|
20
|
-
},
|
21
|
-
{
|
22
|
-
value: 'remix',
|
23
|
-
label: 'Remix',
|
24
|
-
},
|
25
|
-
{
|
26
|
-
value: 'astro',
|
27
|
-
label: 'Astro',
|
28
|
-
},
|
29
|
-
];
|
30
|
-
|
31
|
-
const meta: Meta = {
|
32
|
-
component: 'components/combo-box',
|
33
|
-
tags: ['autodocs'],
|
34
|
-
argTypes: {
|
35
|
-
items: {
|
36
|
-
control: 'select',
|
37
|
-
description:
|
38
|
-
'An array of items to display in the dropdown menu. Each item should be a string representing the option text.',
|
39
|
-
table: {
|
40
|
-
defaultValue: { summary: '["Option 1", "Option 2", "Option 3"]' },
|
41
|
-
},
|
42
|
-
},
|
43
|
-
label: {
|
44
|
-
control: 'text',
|
45
|
-
description:
|
46
|
-
'The text displayed on the dropdown. This text is shown to users when the dropdown is closed.',
|
47
|
-
type: 'string',
|
48
|
-
table: {
|
49
|
-
defaultValue: { summary: 'Select an item' },
|
50
|
-
},
|
51
|
-
},
|
52
|
-
},
|
53
|
-
};
|
54
|
-
export default meta;
|
55
|
-
type Story = StoryObj;
|
56
|
-
// Base story
|
57
|
-
export const basicComboBox: Story = {
|
58
|
-
name: 'Basic Usage',
|
59
|
-
args: {
|
60
|
-
items: ['Argentina', 'Brazil', 'China', 'USA', 'Italy', 'Iran', 'UAE'],
|
61
|
-
label: 'Select an item',
|
62
|
-
},
|
63
|
-
render: ({ label, items }) => {
|
64
|
-
return html`
|
65
|
-
<rtg-combo-box label="${label}" .items=${items}>
|
66
|
-
<combo-box-list>
|
67
|
-
${frameworks.map(
|
68
|
-
(item, index) => html`
|
69
|
-
<combo-box-item
|
70
|
-
.searchText="${item.label}"
|
71
|
-
.value="${item.value}"
|
72
|
-
data-hs-combo-box-value="${item.value}"
|
73
|
-
tabIndex="${index}"
|
74
|
-
></combo-box-item>
|
75
|
-
`
|
76
|
-
)}
|
77
|
-
</combo-box-list>
|
78
|
-
</rtg-combo-box>
|
79
|
-
`;
|
80
|
-
},
|
81
|
-
};
|
82
|
-
|
83
|
-
// Story for empty items array
|
84
|
-
export const emptyComboBox: Story = {
|
85
|
-
name: 'Empty Items',
|
86
|
-
args: {
|
87
|
-
items: [],
|
88
|
-
label: 'Select an item',
|
89
|
-
},
|
90
|
-
render: ({ label, items }) => {
|
91
|
-
return html`
|
92
|
-
<rtg-combo-box label=${label}" .items=${items}> </rtg-combo-box>
|
93
|
-
`;
|
94
|
-
},
|
95
|
-
};
|
@@ -1,44 +0,0 @@
|
|
1
|
-
import { LitElement, html, css, nothing } from 'lit';
|
2
|
-
import { property, customElement } from 'lit/decorators.js';
|
3
|
-
import { cn } from '../../../helpers';
|
4
|
-
import { TWStyles } from '../../../styles';
|
5
|
-
|
6
|
-
@customElement('rtg-command-empty')
|
7
|
-
export class CommandEmpty extends LitElement {
|
8
|
-
@property({ type: String }) _id = '';
|
9
|
-
|
10
|
-
@property({ attribute: 'aria-hidden', type: String }) _hidden = 'true';
|
11
|
-
|
12
|
-
private static _counter = 0;
|
13
|
-
|
14
|
-
static styles = [css``, TWStyles];
|
15
|
-
|
16
|
-
private get identifier() {
|
17
|
-
if (this._id !== '') {
|
18
|
-
return this._id;
|
19
|
-
}
|
20
|
-
const parent =
|
21
|
-
this.parentElement?.shadowRoot?.querySelector('div[rtgcmd-list]');
|
22
|
-
if (parent) {
|
23
|
-
this._id = `${parent.getAttribute('id')}e${CommandEmpty._counter++}`;
|
24
|
-
} else {
|
25
|
-
this._id = `rtgcmdrxlxe${CommandEmpty._counter++}`;
|
26
|
-
}
|
27
|
-
return this._id;
|
28
|
-
}
|
29
|
-
|
30
|
-
render() {
|
31
|
-
return html`${this._hidden === 'true'
|
32
|
-
? nothing
|
33
|
-
: html`
|
34
|
-
<div
|
35
|
-
class="${cn('py-6 text-center text-sm', this.className)}"
|
36
|
-
rtgcmd-empty
|
37
|
-
role="presentation"
|
38
|
-
id="${this.identifier}"
|
39
|
-
>
|
40
|
-
<slot></slot>
|
41
|
-
</div>
|
42
|
-
`}`;
|
43
|
-
}
|
44
|
-
}
|