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
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"label.atom.js","sourceRoot":"","sources":["../../../../../src/components/atoms/label/label.atom.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAc,IAAI,EAAE,GAAG,EAAkB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAGvC,IAAM,KAAK,aAAX,MAAM,KAAM,SAAQ,WAAW;IAA/B;;QAGuB,QAAG,GAAG,EAAE,CAAC;IAoDvC,CAAC;IApCW,YAAY,CAAC,kBAAkC;QACvD,MAAM,SAAS,GAAG,CAAC,oCAAoC,CAAC,CAAC;QACzD,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC;IAC1D,CAAC;IAEO,QAAQ,CAAC,CAAQ;QACvB,IAAI,CAAC,CAAC,gBAAgB;YAAE,OAAO;QAC/B,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACzD,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,CAAC;IACH,CAAC;IAES,sBAAsB;QAC9B,OAAO,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IAChC,CAAC;IAED,MAAM;QACJ,MAAM,UAAU,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAEhD,OAAO,IAAI,CAAA;;eAEA,IAAI,CAAC,GAAG;kBACL,IAAI,CAAC,QAAQ;oBACX,IAAI,CAAC,QAAQ;iBAChB,EAAE,CACT,OAAK,CAAC,aAAa,CAAC;YAClB,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAC,CACH;UACC,MAAM,CAAC,UAAU,CAAC;;;;KAIvB,CAAC;IACJ,CAAC;;AArDM,mBAAa,GAAG,UAAU,AAAb,CAAc;AAI3B,YAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;KASF;IACD,QAAQ;CACT,AAZY,CAYX;AAd0B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kCAAU;AAH1B,KAAK;IADjB,aAAa,CAAC,WAAW,CAAC;GACd,KAAK,CAuDjB","sourcesContent":["import { LitElement, html, css, PropertyValues } from 'lit';\nimport { property, customElement } from 'lit/decorators.js';\nimport { BaseElement, cn } from '../../../helpers';\nimport { TWStyles } from '../../../styles';\nimport { labelStyle } from './label.style';\nimport { spread } from '@open-wc/lit-helpers';\n\n@customElement('rtg-label')\nexport class Label extends BaseElement {\n static labelVariants = labelStyle;\n\n @property({ type: String }) for = '';\n\n static styles = [\n css`\n :root {\n --label-text-color: inherit;\n --label-padding: inherit;\n }\n .label-base {\n color: var(--label-text-color) !important;\n padding: var(--label-padding) !important;\n }\n `,\n TWStyles,\n ];\n\n protected firstUpdated(_changedProperties: PropertyValues): void {\n const variables = ['--label-text-color,--label-padding'];\n this.applyCustomClass(variables, 'label', 'label-base');\n }\n\n private _onClick(e: Event) {\n if (e.defaultPrevented) return;\n const target = this.shadowRoot?.getElementById(this.for);\n if (target) {\n target.click();\n }\n }\n\n protected getAttributesToExclude(): string[] {\n return ['for', 'data-testid'];\n }\n\n render() {\n const attributes = this.getFilteredAttributes();\n\n return html`\n <label\n for=\"${this.for}\"\n @click=\"${this._onClick}\"\n @keydown=\"${this._onClick}\"\n class=\"${cn(\n Label.labelVariants({\n className: this.className,\n })\n )}\"\n ${spread(attributes)}\n >\n <slot></slot>\n </label>\n `;\n }\n}\n"]}
|
@@ -0,0 +1,85 @@
|
|
1
|
+
import { html } from 'lit';
|
2
|
+
import './label.atom';
|
3
|
+
import { expect, within, fn, waitFor, userEvent } from '@storybook/test';
|
4
|
+
import { Label } from './label.atom';
|
5
|
+
// Label Test Behavior
|
6
|
+
const testLabelBehavior = async (args, canvasElement, mockHandler) => {
|
7
|
+
const canvas = within(canvasElement);
|
8
|
+
const label = await waitFor(() => canvas.getByTestId('label-id'));
|
9
|
+
if (label.shadowRoot) {
|
10
|
+
const innerLabel = label.shadowRoot.querySelector('label') || '';
|
11
|
+
// 1. Test: Label should have correct "for" attribute
|
12
|
+
expect(label).toHaveAttribute('for', args.for);
|
13
|
+
// 2. Test: Label should apply correct variant classes
|
14
|
+
const expectedClasses = Label.labelVariants({
|
15
|
+
className: '',
|
16
|
+
});
|
17
|
+
expect(innerLabel).toHaveClass(expectedClasses);
|
18
|
+
// 3. Test: Label should trigger associated input's click when clicked
|
19
|
+
if (!args.disabled) {
|
20
|
+
const targetInput = document.createElement('input');
|
21
|
+
targetInput.id = args.for;
|
22
|
+
label.shadowRoot.appendChild(targetInput);
|
23
|
+
targetInput.click = fn(); // Mock click behavior for test
|
24
|
+
await userEvent.click(innerLabel);
|
25
|
+
expect(targetInput.click).toHaveBeenCalled();
|
26
|
+
label.shadowRoot.removeChild(targetInput); // Clean up
|
27
|
+
}
|
28
|
+
// 4. Test: Ensure that label doesn't trigger input click when default is prevented
|
29
|
+
const event = new Event('click', { cancelable: true });
|
30
|
+
label.dispatchEvent(event);
|
31
|
+
if (!event.defaultPrevented) {
|
32
|
+
await userEvent.click(innerLabel);
|
33
|
+
expect(mockHandler).not.toHaveBeenCalled(); // should not trigger if default prevented
|
34
|
+
}
|
35
|
+
}
|
36
|
+
};
|
37
|
+
export default {
|
38
|
+
title: 'components/atoms/label',
|
39
|
+
tags: ['autodocs'],
|
40
|
+
argTypes: {
|
41
|
+
label: {
|
42
|
+
type: 'string',
|
43
|
+
description: 'The text to display on the label.',
|
44
|
+
table: {
|
45
|
+
defaultValue: { summary: '' },
|
46
|
+
},
|
47
|
+
},
|
48
|
+
for: {
|
49
|
+
type: 'string',
|
50
|
+
description: "The text that the label is describing. This is typically the ID of the input element it's labeling.",
|
51
|
+
table: {
|
52
|
+
defaultValue: { summary: '' },
|
53
|
+
},
|
54
|
+
},
|
55
|
+
},
|
56
|
+
};
|
57
|
+
const Template = (args) => html ` <rtg-label
|
58
|
+
data-testchild="children-id"
|
59
|
+
data-testid="label-id"
|
60
|
+
for=${args.for}
|
61
|
+
>${args.label}</rtg-label
|
62
|
+
>`;
|
63
|
+
const HtmlForTemplate = (args) => html ` <rtg-label
|
64
|
+
data-testchild="children-id"
|
65
|
+
data-testid="label-id"
|
66
|
+
for=${args.for}
|
67
|
+
>
|
68
|
+
${args.label}
|
69
|
+
<input type="text" id=${args.for} />
|
70
|
+
</rtg-label>`;
|
71
|
+
export const Default = Template.bind({});
|
72
|
+
export const HtmlFor = HtmlForTemplate.bind({});
|
73
|
+
Default.args = {
|
74
|
+
for: 'id',
|
75
|
+
label: 'Email address',
|
76
|
+
};
|
77
|
+
HtmlFor.args = {
|
78
|
+
for: 'id',
|
79
|
+
label: 'Email address',
|
80
|
+
};
|
81
|
+
Default.play = async ({ args, canvasElement }) => {
|
82
|
+
const mockHandler = fn();
|
83
|
+
await testLabelBehavior(args, canvasElement, mockHandler);
|
84
|
+
};
|
85
|
+
//# sourceMappingURL=label.stories.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"label.stories.js","sourceRoot":"","sources":["../../../../../src/components/atoms/label/label.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAE3B,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,sBAAsB;AACtB,MAAM,iBAAiB,GAAG,KAAK,EAC7B,IAAS,EACT,aAAkB,EAClB,WAAgB,EAChB,EAAE;IACF,MAAM,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;IACrC,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC;IAClE,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;QACrB,MAAM,UAAU,GACd,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,IAAK,EAAyB,CAAC;QACxE,qDAAqD;QACrD,MAAM,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;QAE/C,sDAAsD;QACtD,MAAM,eAAe,GAAG,KAAK,CAAC,aAAa,CAAC;YAC1C,SAAS,EAAE,EAAE;SACd,CAAC,CAAC;QACH,MAAM,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;QAEhD,sEAAsE;QACtE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,MAAM,WAAW,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;YACpD,WAAW,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC;YAC1B,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;YAC1C,WAAW,CAAC,KAAK,GAAG,EAAE,EAAE,CAAC,CAAC,+BAA+B;YACzD,MAAM,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YAClC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,gBAAgB,EAAE,CAAC;YAC7C,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW;QACxD,CAAC;QAED,mFAAmF;QACnF,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QACvD,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC;YAC5B,MAAM,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YAClC,MAAM,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC,CAAC,0CAA0C;QACxF,CAAC;IACH,CAAC;AACH,CAAC,CAAC;AAEF,eAAe;IACb,KAAK,EAAE,wBAAwB;IAC/B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,mCAAmC;YAChD,KAAK,EAAE;gBACL,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;aAC9B;SACF;QACD,GAAG,EAAE;YACH,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,qGAAqG;YACvG,KAAK,EAAE;gBACL,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;aAC9B;SACF;KACF;CACM,CAAC;AAEV,MAAM,QAAQ,GAAY,CAAC,IAAS,EAAE,EAAE,CACtC,IAAI,CAAA;;;UAGI,IAAI,CAAC,GAAG;OACX,IAAI,CAAC,KAAK;IACb,CAAC;AAEL,MAAM,eAAe,GAAY,CAAC,IAAS,EAAE,EAAE,CAC7C,IAAI,CAAA;;;UAGI,IAAI,CAAC,GAAG;;MAEZ,IAAI,CAAC,KAAK;4BACY,IAAI,CAAC,GAAG;eACrB,CAAC;AAChB,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzC,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAEhD,OAAO,CAAC,IAAI,GAAG;IACb,GAAG,EAAE,IAAI;IACT,KAAK,EAAE,eAAe;CACvB,CAAC;AACF,OAAO,CAAC,IAAI,GAAG;IACb,GAAG,EAAE,IAAI;IACT,KAAK,EAAE,eAAe;CACvB,CAAC;AACF,OAAO,CAAC,IAAI,GAAG,KAAK,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE;IAC/C,MAAM,WAAW,GAAG,EAAE,EAAE,CAAC;IACzB,MAAM,iBAAiB,CAAC,IAAI,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC;AAC5D,CAAC,CAAC","sourcesContent":["import { html } from 'lit';\nimport { Meta, StoryFn } from '@storybook/web-components';\nimport './label.atom';\n\nimport { expect, within, fn, waitFor, userEvent } from '@storybook/test';\nimport { Label } from './label.atom';\n\n// Label Test Behavior\nconst testLabelBehavior = async (\n args: any,\n canvasElement: any,\n mockHandler: any\n) => {\n const canvas = within(canvasElement);\n const label = await waitFor(() => canvas.getByTestId('label-id'));\n if (label.shadowRoot) {\n const innerLabel =\n label.shadowRoot.querySelector('label') || ('' as unknown as Element);\n // 1. Test: Label should have correct \"for\" attribute\n expect(label).toHaveAttribute('for', args.for);\n\n // 2. Test: Label should apply correct variant classes\n const expectedClasses = Label.labelVariants({\n className: '',\n });\n expect(innerLabel).toHaveClass(expectedClasses);\n\n // 3. Test: Label should trigger associated input's click when clicked\n if (!args.disabled) {\n const targetInput = document.createElement('input');\n targetInput.id = args.for;\n label.shadowRoot.appendChild(targetInput);\n targetInput.click = fn(); // Mock click behavior for test\n await userEvent.click(innerLabel);\n expect(targetInput.click).toHaveBeenCalled();\n label.shadowRoot.removeChild(targetInput); // Clean up\n }\n\n // 4. Test: Ensure that label doesn't trigger input click when default is prevented\n const event = new Event('click', { cancelable: true });\n label.dispatchEvent(event);\n if (!event.defaultPrevented) {\n await userEvent.click(innerLabel);\n expect(mockHandler).not.toHaveBeenCalled(); // should not trigger if default prevented\n }\n }\n};\n\nexport default {\n title: 'components/atoms/label',\n tags: ['autodocs'],\n argTypes: {\n label: {\n type: 'string',\n description: 'The text to display on the label.',\n table: {\n defaultValue: { summary: '' },\n },\n },\n for: {\n type: 'string',\n description:\n \"The text that the label is describing. This is typically the ID of the input element it's labeling.\",\n table: {\n defaultValue: { summary: '' },\n },\n },\n },\n} as Meta;\n\nconst Template: StoryFn = (args: any) =>\n html` <rtg-label\n data-testchild=\"children-id\"\n data-testid=\"label-id\"\n for=${args.for}\n >${args.label}</rtg-label\n >`;\n\nconst HtmlForTemplate: StoryFn = (args: any) =>\n html` <rtg-label\n data-testchild=\"children-id\"\n data-testid=\"label-id\"\n for=${args.for}\n >\n ${args.label}\n <input type=\"text\" id=${args.for} />\n </rtg-label>`;\nexport const Default = Template.bind({});\nexport const HtmlFor = HtmlForTemplate.bind({});\n\nDefault.args = {\n for: 'id',\n label: 'Email address',\n};\nHtmlFor.args = {\n for: 'id',\n label: 'Email address',\n};\nDefault.play = async ({ args, canvasElement }) => {\n const mockHandler = fn();\n await testLabelBehavior(args, canvasElement, mockHandler);\n};\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const labelStyle: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"label.style.js","sourceRoot":"","sources":["../../../../../src/components/atoms/label/label.style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE/C,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAC3B,4FAA4F,CAC7F,CAAC","sourcesContent":["import { cva } from 'class-variance-authority';\n\nexport const labelStyle = cva(\n 'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70'\n);\n"]}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
2
|
+
import { Popover } from './popover.atom';
|
3
|
+
export declare class PopoverContent extends LitElement {
|
4
|
+
static styles: import("lit").CSSResult[];
|
5
|
+
get _popover(): Popover | null;
|
6
|
+
side: 'bottom' | 'left' | 'right' | 'top';
|
7
|
+
private handleClickOutside;
|
8
|
+
protected firstUpdated(_changedProperties: PropertyValues): void;
|
9
|
+
protected updated(_changedProperties: PropertyValues): void;
|
10
|
+
render(): import("lit-html").TemplateResult<1>;
|
11
|
+
}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
import { __decorate } from "tslib";
|
2
|
+
import { LitElement, html, css } from 'lit';
|
3
|
+
import { customElement, property } from 'lit/decorators.js';
|
4
|
+
import { popoverContentStyle } from './popover.style'; // Import the cva styles
|
5
|
+
import { TWStyles } from '../../../styles';
|
6
|
+
import { Popover } from './popover.atom';
|
7
|
+
import { cn } from '../../../helpers';
|
8
|
+
let PopoverContent = class PopoverContent extends LitElement {
|
9
|
+
constructor() {
|
10
|
+
super(...arguments);
|
11
|
+
this.side = 'bottom';
|
12
|
+
}
|
13
|
+
get _popover() {
|
14
|
+
let parent = this.parentElement;
|
15
|
+
// Traverse up the DOM tree to find the parent `Popover`
|
16
|
+
while (parent && !(parent instanceof Popover)) {
|
17
|
+
parent = parent.parentElement;
|
18
|
+
}
|
19
|
+
return parent;
|
20
|
+
}
|
21
|
+
handleClickOutside(event) {
|
22
|
+
// Check if the click was outside the popover
|
23
|
+
const slot = this.shadowRoot?.querySelector('slot');
|
24
|
+
if (slot) {
|
25
|
+
const assignedElements = slot.assignedElements({ flatten: true });
|
26
|
+
console.log(assignedElements[0]);
|
27
|
+
if (!assignedElements[0]?.contains(event.target)) {
|
28
|
+
const popover = this._popover; // Get the parent popover
|
29
|
+
//@ts-ignore
|
30
|
+
popover.isOpen = false;
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
34
|
+
firstUpdated(_changedProperties) {
|
35
|
+
window.addEventListener('click', this.handleClickOutside.bind(this));
|
36
|
+
}
|
37
|
+
updated(_changedProperties) {
|
38
|
+
if (!this._popover?.isOpen) {
|
39
|
+
window.removeEventListener('click', this.handleClickOutside.bind(this));
|
40
|
+
}
|
41
|
+
}
|
42
|
+
render() {
|
43
|
+
const classes = popoverContentStyle({
|
44
|
+
state: 'open',
|
45
|
+
side: this.side,
|
46
|
+
});
|
47
|
+
return html `
|
48
|
+
<div class="${cn(classes)}">
|
49
|
+
<slot></slot>
|
50
|
+
</div>
|
51
|
+
`;
|
52
|
+
}
|
53
|
+
};
|
54
|
+
PopoverContent.styles = [css ``, TWStyles];
|
55
|
+
__decorate([
|
56
|
+
property({ type: String })
|
57
|
+
], PopoverContent.prototype, "side", void 0);
|
58
|
+
PopoverContent = __decorate([
|
59
|
+
customElement('rtg-popover-content')
|
60
|
+
], PopoverContent);
|
61
|
+
export { PopoverContent };
|
62
|
+
//# sourceMappingURL=popover-content.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"popover-content.js","sourceRoot":"","sources":["../../../../../src/components/atoms/popover/popover-content.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAkB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC,CAAC,wBAAwB;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAG/B,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,UAAU;IAAvC;;QAWuB,SAAI,GAC9B,QAAQ,CAAC;IAqCb,CAAC;IA/CC,IAAI,QAAQ;QACV,IAAI,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC;QAChC,wDAAwD;QACxD,OAAO,MAAM,IAAI,CAAC,CAAC,MAAM,YAAY,OAAO,CAAC,EAAE,CAAC;YAC9C,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC;QAChC,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAIO,kBAAkB,CAAC,KAAiB;QAC1C,6CAA6C;QAC7C,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;QACpD,IAAI,IAAI,EAAE,CAAC;YACT,MAAM,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;YAClE,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;YACjC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAc,CAAC,EAAE,CAAC;gBACzD,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,yBAAyB;gBACxD,YAAY;gBACZ,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC;YACzB,CAAC;QACH,CAAC;IACH,CAAC;IAES,YAAY,CAAC,kBAAkC;QACvD,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACvE,CAAC;IAES,OAAO,CAAC,kBAAkC;QAClD,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;YAC3B,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC;IAED,MAAM;QACJ,MAAM,OAAO,GAAG,mBAAmB,CAAC;YAClC,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC,CAAC;QAEH,OAAO,IAAI,CAAA;oBACK,EAAE,CAAC,OAAO,CAAC;;;KAG1B,CAAC;IACJ,CAAC;;AA/CM,qBAAM,GAAG,CAAC,GAAG,CAAA,EAAE,EAAE,QAAQ,CAAC,AAApB,CAAqB;AAUN;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAChB;AAZA,cAAc;IAD1B,aAAa,CAAC,qBAAqB,CAAC;GACxB,cAAc,CAiD1B","sourcesContent":["import { LitElement, html, css, PropertyValues } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { popoverContentStyle } from './popover.style'; // Import the cva styles\nimport { TWStyles } from '../../../styles';\nimport { Popover } from './popover.atom';\nimport { cn } from '../../../helpers';\n\n@customElement('rtg-popover-content')\nexport class PopoverContent extends LitElement {\n static styles = [css``, TWStyles];\n get _popover(): Popover | null {\n let parent = this.parentElement;\n // Traverse up the DOM tree to find the parent `Popover`\n while (parent && !(parent instanceof Popover)) {\n parent = parent.parentElement;\n }\n return parent;\n }\n\n @property({ type: String }) side: 'bottom' | 'left' | 'right' | 'top' =\n 'bottom';\n private handleClickOutside(event: MouseEvent) {\n // Check if the click was outside the popover\n const slot = this.shadowRoot?.querySelector('slot');\n if (slot) {\n const assignedElements = slot.assignedElements({ flatten: true });\n console.log(assignedElements[0]);\n if (!assignedElements[0]?.contains(event.target as Node)) {\n const popover = this._popover; // Get the parent popover\n //@ts-ignore\n popover.isOpen = false;\n }\n }\n }\n\n protected firstUpdated(_changedProperties: PropertyValues): void {\n window.addEventListener('click', this.handleClickOutside.bind(this));\n }\n\n protected updated(_changedProperties: PropertyValues): void {\n if (!this._popover?.isOpen) {\n window.removeEventListener('click', this.handleClickOutside.bind(this));\n }\n }\n\n render() {\n const classes = popoverContentStyle({\n state: 'open',\n side: this.side,\n });\n\n return html`\n <div class=\"${cn(classes)}\">\n <slot></slot>\n </div>\n `;\n }\n}\n"]}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
2
|
+
import { Popover } from './popover.atom';
|
3
|
+
export declare class PopoverTrigger extends LitElement {
|
4
|
+
static styles: import("lit").CSSResult[];
|
5
|
+
handleClick: () => void;
|
6
|
+
protected firstUpdated(_changedProperties: PropertyValues): void;
|
7
|
+
get _popover(): Popover | null;
|
8
|
+
render(): import("lit-html").TemplateResult<1>;
|
9
|
+
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
import { __decorate } from "tslib";
|
2
|
+
import { LitElement, html, css } from 'lit';
|
3
|
+
import { customElement } from 'lit/decorators.js';
|
4
|
+
import { TWStyles } from '../../../styles';
|
5
|
+
import { Popover } from './popover.atom'; // Import the correct parent component
|
6
|
+
let PopoverTrigger = class PopoverTrigger extends LitElement {
|
7
|
+
constructor() {
|
8
|
+
super(...arguments);
|
9
|
+
this.handleClick = () => {
|
10
|
+
const popover = this._popover; // Get the parent popover
|
11
|
+
if (popover) {
|
12
|
+
popover.isOpen = !popover.isOpen;
|
13
|
+
}
|
14
|
+
};
|
15
|
+
}
|
16
|
+
firstUpdated(_changedProperties) {
|
17
|
+
super.firstUpdated(_changedProperties);
|
18
|
+
const slots = this.shadowRoot?.querySelector('slot[name="trigger-button"]');
|
19
|
+
const assignedElements = slots?.assignedElements({ flatten: true });
|
20
|
+
if (assignedElements && assignedElements.length > 0) {
|
21
|
+
//@ts-ignore
|
22
|
+
assignedElements[0].click = this.handleClick;
|
23
|
+
// assignedElements[0].addEventListener('click', this.handleClick);
|
24
|
+
}
|
25
|
+
this.shadowRoot?.addEventListener('click', e => {
|
26
|
+
e.stopPropagation();
|
27
|
+
});
|
28
|
+
}
|
29
|
+
get _popover() {
|
30
|
+
let parent = this.parentElement;
|
31
|
+
// Traverse up the DOM tree to find the parent `Popover`
|
32
|
+
while (parent && !(parent instanceof Popover)) {
|
33
|
+
parent = parent.parentElement;
|
34
|
+
}
|
35
|
+
return parent;
|
36
|
+
}
|
37
|
+
render() {
|
38
|
+
return html `
|
39
|
+
<div style="width: fit-content;">
|
40
|
+
<slot name="trigger-button"></slot>
|
41
|
+
</div>
|
42
|
+
`;
|
43
|
+
}
|
44
|
+
};
|
45
|
+
PopoverTrigger.styles = [css ``, TWStyles];
|
46
|
+
PopoverTrigger = __decorate([
|
47
|
+
customElement('rtg-popover-trigger') // Rename the custom element tag to avoid conflict
|
48
|
+
], PopoverTrigger);
|
49
|
+
export { PopoverTrigger };
|
50
|
+
//# sourceMappingURL=popover-trigger.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"popover-trigger.js","sourceRoot":"","sources":["../../../../../src/components/atoms/popover/popover-trigger.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAkB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC,CAAC,sCAAsC;AAGzE,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,UAAU;IAAvC;;QAGL,gBAAW,GAAG,GAAG,EAAE;YACjB,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,yBAAyB;YACxD,IAAI,OAAO,EAAE,CAAC;gBACZ,OAAO,CAAC,MAAM,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC;YACnC,CAAC;QACH,CAAC,CAAC;IAmCJ,CAAC;IAjCW,YAAY,CAAC,kBAAkC;QACvD,KAAK,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;QACvC,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,EAAE,aAAa,CAC1C,6BAA6B,CACX,CAAC;QACrB,MAAM,gBAAgB,GAAG,KAAK,EAAE,gBAAgB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QACpE,IAAI,gBAAgB,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACpD,YAAY;YACZ,gBAAgB,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC;YAC7C,mEAAmE;QACrE,CAAC;QAED,IAAI,CAAC,UAAU,EAAE,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE;YAC7C,CAAC,CAAC,eAAe,EAAE,CAAC;QACtB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,IAAI,QAAQ;QACV,IAAI,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC;QAChC,wDAAwD;QACxD,OAAO,MAAM,IAAI,CAAC,CAAC,MAAM,YAAY,OAAO,CAAC,EAAE,CAAC;YAC9C,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC;QAChC,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA;;;;KAIV,CAAC;IACJ,CAAC;;AAzCM,qBAAM,GAAG,CAAC,GAAG,CAAA,EAAE,EAAE,QAAQ,CAAC,AAApB,CAAqB;AADvB,cAAc;IAD1B,aAAa,CAAC,qBAAqB,CAAC,CAAC,kDAAkD;GAC3E,cAAc,CA2C1B","sourcesContent":["import { LitElement, html, css, PropertyValues } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { TWStyles } from '../../../styles';\nimport { Popover } from './popover.atom'; // Import the correct parent component\n\n@customElement('rtg-popover-trigger') // Rename the custom element tag to avoid conflict\nexport class PopoverTrigger extends LitElement {\n static styles = [css``, TWStyles];\n\n handleClick = () => {\n const popover = this._popover; // Get the parent popover\n if (popover) {\n popover.isOpen = !popover.isOpen;\n }\n };\n\n protected firstUpdated(_changedProperties: PropertyValues): void {\n super.firstUpdated(_changedProperties);\n const slots = this.shadowRoot?.querySelector(\n 'slot[name=\"trigger-button\"]'\n ) as HTMLSlotElement;\n const assignedElements = slots?.assignedElements({ flatten: true });\n if (assignedElements && assignedElements.length > 0) {\n //@ts-ignore\n assignedElements[0].click = this.handleClick;\n // assignedElements[0].addEventListener('click', this.handleClick);\n }\n\n this.shadowRoot?.addEventListener('click', e => {\n e.stopPropagation();\n });\n }\n\n get _popover(): Popover | null {\n let parent = this.parentElement;\n // Traverse up the DOM tree to find the parent `Popover`\n while (parent && !(parent instanceof Popover)) {\n parent = parent.parentElement;\n }\n return parent;\n }\n\n render() {\n return html`\n <div style=\"width: fit-content;\">\n <slot name=\"trigger-button\"></slot>\n </div>\n `;\n }\n}\n"]}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
2
|
+
export declare class Popover extends LitElement {
|
3
|
+
static styles: import("lit").CSSResult[];
|
4
|
+
isOpen: boolean;
|
5
|
+
protected firstUpdated(_changedProperties: PropertyValues): void;
|
6
|
+
protected updated(_changedProperties: PropertyValues): void;
|
7
|
+
render(): import("lit-html").TemplateResult<1>;
|
8
|
+
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import { __decorate } from "tslib";
|
2
|
+
import { LitElement, html, css } from 'lit';
|
3
|
+
import { customElement, state } from 'lit/decorators.js';
|
4
|
+
import { TWStyles } from '../../../styles';
|
5
|
+
let Popover = class Popover extends LitElement {
|
6
|
+
constructor() {
|
7
|
+
super(...arguments);
|
8
|
+
this.isOpen = false;
|
9
|
+
}
|
10
|
+
firstUpdated(_changedProperties) {
|
11
|
+
super.firstUpdated(_changedProperties);
|
12
|
+
// Add event listener for clicks outside the popover
|
13
|
+
}
|
14
|
+
updated(_changedProperties) {
|
15
|
+
super.updated(_changedProperties);
|
16
|
+
// Remove event listener when the popover is closed
|
17
|
+
}
|
18
|
+
render() {
|
19
|
+
return html `
|
20
|
+
<div>
|
21
|
+
<slot
|
22
|
+
name="trigger"
|
23
|
+
@click="${() => (this.isOpen = !this.isOpen)}"
|
24
|
+
></slot>
|
25
|
+
<div data-testid="popover-content-holder" ?hidden="${!this.isOpen}">
|
26
|
+
<slot name="content"></slot>
|
27
|
+
</div>
|
28
|
+
</div>
|
29
|
+
`;
|
30
|
+
}
|
31
|
+
};
|
32
|
+
Popover.styles = [css ``, TWStyles];
|
33
|
+
__decorate([
|
34
|
+
state()
|
35
|
+
], Popover.prototype, "isOpen", void 0);
|
36
|
+
Popover = __decorate([
|
37
|
+
customElement('rtg-popover')
|
38
|
+
], Popover);
|
39
|
+
export { Popover };
|
40
|
+
//# sourceMappingURL=popover.atom.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"popover.atom.js","sourceRoot":"","sources":["../../../../../src/components/atoms/popover/popover.atom.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAkB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGpC,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,UAAU;IAAhC;;QAGI,WAAM,GAAY,KAAK,CAAC;IAyBnC,CAAC;IAvBW,YAAY,CAAC,kBAAkC;QACvD,KAAK,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;QACvC,oDAAoD;IACtD,CAAC;IAES,OAAO,CAAC,kBAAkC;QAClD,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;QAClC,mDAAmD;IACrD,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA;;;;oBAIK,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC;;6DAEO,CAAC,IAAI,CAAC,MAAM;;;;KAIpE,CAAC;IACJ,CAAC;;AA1BM,cAAM,GAAG,CAAC,GAAG,CAAA,EAAE,EAAE,QAAQ,CAAC,AAApB,CAAqB;AAEzB;IAAR,KAAK,EAAE;uCAAyB;AAHtB,OAAO;IADnB,aAAa,CAAC,aAAa,CAAC;GAChB,OAAO,CA4BnB","sourcesContent":["import { LitElement, html, css, PropertyValues } from 'lit';\nimport { customElement, state } from 'lit/decorators.js';\nimport { TWStyles } from '../../../styles';\n\n@customElement('rtg-popover')\nexport class Popover extends LitElement {\n static styles = [css``, TWStyles];\n\n @state() isOpen: boolean = false;\n\n protected firstUpdated(_changedProperties: PropertyValues): void {\n super.firstUpdated(_changedProperties);\n // Add event listener for clicks outside the popover\n }\n\n protected updated(_changedProperties: PropertyValues): void {\n super.updated(_changedProperties);\n // Remove event listener when the popover is closed\n }\n\n render() {\n return html`\n <div>\n <slot\n name=\"trigger\"\n @click=\"${() => (this.isOpen = !this.isOpen)}\"\n ></slot>\n <div data-testid=\"popover-content-holder\" ?hidden=\"${!this.isOpen}\">\n <slot name=\"content\"></slot>\n </div>\n </div>\n `;\n }\n}\n"]}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { Meta, StoryFn } from '@storybook/web-components';
|
2
|
+
import './popover.atom';
|
3
|
+
import './popover-trigger';
|
4
|
+
import './popover-content';
|
5
|
+
import '../button/button.atom';
|
6
|
+
import '../label/label.atom';
|
7
|
+
import '../input/input.atom';
|
8
|
+
declare const _default: Meta;
|
9
|
+
export default _default;
|
10
|
+
export declare const Default: StoryFn;
|
@@ -0,0 +1,69 @@
|
|
1
|
+
import { html } from 'lit';
|
2
|
+
import './popover.atom';
|
3
|
+
import './popover-trigger';
|
4
|
+
import './popover-content';
|
5
|
+
import '../button/button.atom';
|
6
|
+
import '../label/label.atom';
|
7
|
+
import '../input/input.atom';
|
8
|
+
import { expect, within, userEvent } from '@storybook/test';
|
9
|
+
// Create a test to ensure the popover opens and closes correctly
|
10
|
+
const testPopoverBehavior = async (args, canvasElement) => {
|
11
|
+
const canvas = within(canvasElement);
|
12
|
+
// Click on the trigger button to open the popover
|
13
|
+
const trigger = await canvas.getByText(args.triggerLabel);
|
14
|
+
await userEvent.click(trigger);
|
15
|
+
// Ensure the popover content is visible
|
16
|
+
const popoverContent = await canvas.getByTestId('popover-content');
|
17
|
+
expect(popoverContent).toBeVisible();
|
18
|
+
// Click inside the popover content, it should remain open
|
19
|
+
await userEvent.click(popoverContent);
|
20
|
+
expect(popoverContent).toBeVisible();
|
21
|
+
// Click outside the popover, it should close
|
22
|
+
await userEvent.click(document.body); // Trigger a click outside
|
23
|
+
await new Promise(r => setTimeout(r, 100)); // Wait for state update
|
24
|
+
// Check if popover content is hidden
|
25
|
+
const hiddenPopoverContent = canvas.queryByTestId('popover-content-holder');
|
26
|
+
expect(hiddenPopoverContent).toBeNull();
|
27
|
+
};
|
28
|
+
export default {
|
29
|
+
title: 'components/atoms/popover',
|
30
|
+
component: 'rtg-popover',
|
31
|
+
tags: ['autodocs'],
|
32
|
+
argTypes: {
|
33
|
+
triggerLabel: { control: 'text', defaultValue: 'Click me' },
|
34
|
+
popoverContent: {
|
35
|
+
control: 'text',
|
36
|
+
defaultValue: 'This is the content inside the popover.',
|
37
|
+
},
|
38
|
+
},
|
39
|
+
};
|
40
|
+
const Template = (args) => html `
|
41
|
+
<rtg-popover>
|
42
|
+
<!-- Trigger to open/close the popover -->
|
43
|
+
<rtg-popover-trigger slot="trigger">
|
44
|
+
<rtg-button variant="outline" slot="trigger-button"
|
45
|
+
>${args.triggerLabel}</rtg-button
|
46
|
+
>
|
47
|
+
</rtg-popover-trigger>
|
48
|
+
|
49
|
+
<!-- Popover content that will be shown or hidden -->
|
50
|
+
<rtg-popover-content
|
51
|
+
data-side="bottom"
|
52
|
+
data-testid="popover-content"
|
53
|
+
slot="content"
|
54
|
+
>
|
55
|
+
<div>
|
56
|
+
<p>${args.popoverContent}</p>
|
57
|
+
</div>
|
58
|
+
</rtg-popover-content>
|
59
|
+
</rtg-popover>
|
60
|
+
`;
|
61
|
+
export const Default = Template.bind({});
|
62
|
+
Default.args = {
|
63
|
+
triggerLabel: 'Click me',
|
64
|
+
popoverContent: 'This is the content inside the popover.',
|
65
|
+
};
|
66
|
+
Default.play = async ({ canvasElement }) => {
|
67
|
+
await testPopoverBehavior(Default.args, canvasElement);
|
68
|
+
};
|
69
|
+
//# sourceMappingURL=popover.stories.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"popover.stories.js","sourceRoot":"","sources":["../../../../../src/components/atoms/popover/popover.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAE3B,OAAO,gBAAgB,CAAC;AACxB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,mBAAmB,CAAC;AAC3B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,qBAAqB,CAAC;AAE7B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5D,iEAAiE;AACjE,MAAM,mBAAmB,GAAG,KAAK,EAAE,IAAS,EAAE,aAAkB,EAAE,EAAE;IAClE,MAAM,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;IAErC,kDAAkD;IAClD,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC1D,MAAM,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAE/B,wCAAwC;IACxC,MAAM,cAAc,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;IACnE,MAAM,CAAC,cAAc,CAAC,CAAC,WAAW,EAAE,CAAC;IAErC,0DAA0D;IAC1D,MAAM,SAAS,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IACtC,MAAM,CAAC,cAAc,CAAC,CAAC,WAAW,EAAE,CAAC;IAErC,6CAA6C;IAC7C,MAAM,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,0BAA0B;IAChE,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,wBAAwB;IAEpE,qCAAqC;IACrC,MAAM,oBAAoB,GAAG,MAAM,CAAC,aAAa,CAAC,wBAAwB,CAAC,CAAC;IAC5E,MAAM,CAAC,oBAAoB,CAAC,CAAC,QAAQ,EAAE,CAAC;AAC1C,CAAC,CAAC;AAEF,eAAe;IACb,KAAK,EAAE,0BAA0B;IACjC,SAAS,EAAE,aAAa;IACxB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,YAAY,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE;QAC3D,cAAc,EAAE;YACd,OAAO,EAAE,MAAM;YACf,YAAY,EAAE,yCAAyC;SACxD;KACF;CACM,CAAC;AAEV,MAAM,QAAQ,GAAY,CAAC,IAAS,EAAE,EAAE,CAAC,IAAI,CAAA;;;;;WAKlC,IAAI,CAAC,YAAY;;;;;;;;;;;aAWf,IAAI,CAAC,cAAc;;;;CAI/B,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzC,OAAO,CAAC,IAAI,GAAG;IACb,YAAY,EAAE,UAAU;IACxB,cAAc,EAAE,yCAAyC;CAC1D,CAAC;AACF,OAAO,CAAC,IAAI,GAAG,KAAK,EAAE,EAAE,aAAa,EAAE,EAAE,EAAE;IACzC,MAAM,mBAAmB,CAAC,OAAO,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;AACzD,CAAC,CAAC","sourcesContent":["import { html } from 'lit';\nimport { Meta, StoryFn } from '@storybook/web-components';\nimport './popover.atom';\nimport './popover-trigger';\nimport './popover-content';\nimport '../button/button.atom';\nimport '../label/label.atom';\nimport '../input/input.atom';\n\nimport { expect, within, userEvent } from '@storybook/test';\n\n// Create a test to ensure the popover opens and closes correctly\nconst testPopoverBehavior = async (args: any, canvasElement: any) => {\n const canvas = within(canvasElement);\n\n // Click on the trigger button to open the popover\n const trigger = await canvas.getByText(args.triggerLabel);\n await userEvent.click(trigger);\n\n // Ensure the popover content is visible\n const popoverContent = await canvas.getByTestId('popover-content');\n expect(popoverContent).toBeVisible();\n\n // Click inside the popover content, it should remain open\n await userEvent.click(popoverContent);\n expect(popoverContent).toBeVisible();\n\n // Click outside the popover, it should close\n await userEvent.click(document.body); // Trigger a click outside\n await new Promise(r => setTimeout(r, 100)); // Wait for state update\n\n // Check if popover content is hidden\n const hiddenPopoverContent = canvas.queryByTestId('popover-content-holder');\n expect(hiddenPopoverContent).toBeNull();\n};\n\nexport default {\n title: 'components/atoms/popover',\n component: 'rtg-popover',\n tags: ['autodocs'],\n argTypes: {\n triggerLabel: { control: 'text', defaultValue: 'Click me' },\n popoverContent: {\n control: 'text',\n defaultValue: 'This is the content inside the popover.',\n },\n },\n} as Meta;\n\nconst Template: StoryFn = (args: any) => html`\n <rtg-popover>\n <!-- Trigger to open/close the popover -->\n <rtg-popover-trigger slot=\"trigger\">\n <rtg-button variant=\"outline\" slot=\"trigger-button\"\n >${args.triggerLabel}</rtg-button\n >\n </rtg-popover-trigger>\n\n <!-- Popover content that will be shown or hidden -->\n <rtg-popover-content\n data-side=\"bottom\"\n data-testid=\"popover-content\"\n slot=\"content\"\n >\n <div>\n <p>${args.popoverContent}</p>\n </div>\n </rtg-popover-content>\n </rtg-popover>\n`;\n\nexport const Default = Template.bind({});\nDefault.args = {\n triggerLabel: 'Click me',\n popoverContent: 'This is the content inside the popover.',\n};\nDefault.play = async ({ canvasElement }) => {\n await testPopoverBehavior(Default.args, canvasElement);\n};\n"]}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
export declare const popoverRootStyle: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
2
|
+
export declare const popoverContentStyle: (props?: ({
|
3
|
+
state?: "open" | "closed" | null | undefined;
|
4
|
+
side?: "bottom" | "left" | "right" | "top" | null | undefined;
|
5
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { cva } from 'class-variance-authority';
|
2
|
+
export const popoverRootStyle = cva('rtgpop-root');
|
3
|
+
export const popoverContentStyle = cva('z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none transition-transform transition-opacity', {
|
4
|
+
variants: {
|
5
|
+
state: {
|
6
|
+
open: 'opacity-100 scale-100 duration-500', // 0.5 seconds for the transition
|
7
|
+
closed: 'opacity-0 scale-95 duration-500', // 0.5 seconds for the transition
|
8
|
+
},
|
9
|
+
side: {
|
10
|
+
bottom: 'translate-y-0',
|
11
|
+
left: 'translate-x-0',
|
12
|
+
right: 'translate-x-0',
|
13
|
+
top: 'translate-y-0',
|
14
|
+
},
|
15
|
+
},
|
16
|
+
defaultVariants: {
|
17
|
+
state: 'closed',
|
18
|
+
side: 'bottom',
|
19
|
+
},
|
20
|
+
});
|
21
|
+
//# sourceMappingURL=popover.style.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"popover.style.js","sourceRoot":"","sources":["../../../../../src/components/atoms/popover/popover.style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE/C,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC,aAAa,CAAC,CAAC;AAEnD,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CACpC,mIAAmI,EACnI;IACE,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,IAAI,EAAE,oCAAoC,EAAE,iCAAiC;YAC7E,MAAM,EAAE,iCAAiC,EAAE,iCAAiC;SAC7E;QACD,IAAI,EAAE;YACJ,MAAM,EAAE,eAAe;YACvB,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,eAAe;YACtB,GAAG,EAAE,eAAe;SACrB;KACF;IACD,eAAe,EAAE;QACf,KAAK,EAAE,QAAQ;QACf,IAAI,EAAE,QAAQ;KACf;CACF,CACF,CAAC","sourcesContent":["import { cva } from 'class-variance-authority';\n\nexport const popoverRootStyle = cva('rtgpop-root');\n\nexport const popoverContentStyle = cva(\n 'z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none transition-transform transition-opacity',\n {\n variants: {\n state: {\n open: 'opacity-100 scale-100 duration-500', // 0.5 seconds for the transition\n closed: 'opacity-0 scale-95 duration-500', // 0.5 seconds for the transition\n },\n side: {\n bottom: 'translate-y-0',\n left: 'translate-x-0',\n right: 'translate-x-0',\n top: 'translate-y-0',\n },\n },\n defaultVariants: {\n state: 'closed',\n side: 'bottom',\n },\n }\n);\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"popover.types.js","sourceRoot":"","sources":["../../../../../src/components/atoms/popover/popover.types.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC;AACjC,MAAM,CAAC,MAAM,YAAY,GAAG,QAAQ,CAAC","sourcesContent":["// popoverConstants.ts\nexport const STATE_OPEN = 'open';\nexport const STATE_CLOSED = 'closed';\n"]}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
/**
|
2
|
+
* Toggle size.
|
3
|
+
*/
|
4
|
+
export declare enum TOGGLE_SIZE {
|
5
|
+
/**
|
6
|
+
* Small size
|
7
|
+
*/
|
8
|
+
SMALL = "sm",
|
9
|
+
/**
|
10
|
+
* medium size
|
11
|
+
*/
|
12
|
+
MEDIUM = "md",
|
13
|
+
/**
|
14
|
+
* Large size
|
15
|
+
*/
|
16
|
+
LARGE = "lg"
|
17
|
+
}
|
18
|
+
export declare enum TOGGLE_VARIANT {
|
19
|
+
/**
|
20
|
+
* Default variant
|
21
|
+
*/
|
22
|
+
DEFAULT = "default",
|
23
|
+
/**
|
24
|
+
* Outline variant
|
25
|
+
*/
|
26
|
+
OUTLINE = "outline"
|
27
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
/**
|
2
|
+
* Toggle size.
|
3
|
+
*/
|
4
|
+
export var TOGGLE_SIZE;
|
5
|
+
(function (TOGGLE_SIZE) {
|
6
|
+
/**
|
7
|
+
* Small size
|
8
|
+
*/
|
9
|
+
TOGGLE_SIZE["SMALL"] = "sm";
|
10
|
+
/**
|
11
|
+
* medium size
|
12
|
+
*/
|
13
|
+
TOGGLE_SIZE["MEDIUM"] = "md";
|
14
|
+
/**
|
15
|
+
* Large size
|
16
|
+
*/
|
17
|
+
TOGGLE_SIZE["LARGE"] = "lg";
|
18
|
+
})(TOGGLE_SIZE || (TOGGLE_SIZE = {}));
|
19
|
+
export var TOGGLE_VARIANT;
|
20
|
+
(function (TOGGLE_VARIANT) {
|
21
|
+
/**
|
22
|
+
* Default variant
|
23
|
+
*/
|
24
|
+
TOGGLE_VARIANT["DEFAULT"] = "default";
|
25
|
+
/**
|
26
|
+
* Outline variant
|
27
|
+
*/
|
28
|
+
TOGGLE_VARIANT["OUTLINE"] = "outline";
|
29
|
+
})(TOGGLE_VARIANT || (TOGGLE_VARIANT = {}));
|
30
|
+
//# sourceMappingURL=defs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"defs.js","sourceRoot":"","sources":["../../../../../src/components/atoms/toggle/defs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,CAAN,IAAY,WAaX;AAbD,WAAY,WAAW;IACrB;;OAEG;IACH,2BAAY,CAAA;IACZ;;OAEG;IACH,4BAAa,CAAA;IACb;;OAEG;IACH,2BAAY,CAAA;AACd,CAAC,EAbW,WAAW,KAAX,WAAW,QAatB;AAED,MAAM,CAAN,IAAY,cASX;AATD,WAAY,cAAc;IACxB;;OAEG;IACH,qCAAmB,CAAA;IACnB;;OAEG;IACH,qCAAmB,CAAA;AACrB,CAAC,EATW,cAAc,KAAd,cAAc,QASzB","sourcesContent":["/**\n * Toggle size.\n */\n\nexport enum TOGGLE_SIZE {\n /**\n * Small size\n */\n SMALL = 'sm',\n /**\n * medium size\n */\n MEDIUM = 'md',\n /**\n * Large size\n */\n LARGE = 'lg',\n}\n\nexport enum TOGGLE_VARIANT {\n /**\n * Default variant\n */\n DEFAULT = 'default',\n /**\n * Outline variant\n */\n OUTLINE = 'outline',\n}\n"]}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { TOGGLE_SIZE, TOGGLE_VARIANT } from './defs';
|
2
|
+
import { BaseElement } from '../../../helpers';
|
3
|
+
export { TOGGLE_SIZE, TOGGLE_VARIANT };
|
4
|
+
declare class Toggle extends BaseElement {
|
5
|
+
disabled: boolean;
|
6
|
+
checked: boolean;
|
7
|
+
required: boolean;
|
8
|
+
variant: TOGGLE_VARIANT;
|
9
|
+
size: TOGGLE_SIZE;
|
10
|
+
static styles: import("lit-element").CSSResult[];
|
11
|
+
static toggleVariants: (props?: ({
|
12
|
+
variant?: "default" | "outline" | null | undefined;
|
13
|
+
size?: "sm" | "lg" | "md" | null | undefined;
|
14
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
15
|
+
protected getAttributesToExclude(): string[];
|
16
|
+
toggle(): void;
|
17
|
+
render(): import("lit-html").TemplateResult<1>;
|
18
|
+
}
|
19
|
+
export { Toggle };
|