@iyulab/components 0.3.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +67 -0
- package/README.md +42 -236
- package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js +9 -0
- package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/decorateMetadata.js +6 -0
- package/dist/_virtual/_glob-assets_raw/bell-fill.svg.d37c41d9.js +4 -0
- package/dist/_virtual/_glob-assets_raw/check-circle-fill.svg.51c33a2a.js +4 -0
- package/dist/_virtual/_glob-assets_raw/check-lg.svg.371c5e78.js +4 -0
- package/dist/_virtual/_glob-assets_raw/chevron-down.svg.0ccd06ea.js +4 -0
- package/dist/_virtual/_glob-assets_raw/chevron-left.svg.b4601050.js +4 -0
- package/dist/_virtual/_glob-assets_raw/chevron-right.svg.0711bb67.js +4 -0
- package/dist/_virtual/_glob-assets_raw/chevron-up.svg.ed917211.js +4 -0
- package/dist/_virtual/_glob-assets_raw/dark.css.e8ac080d.js +4 -0
- package/dist/_virtual/_glob-assets_raw/dash-lg.svg.b40b8b3a.js +4 -0
- package/dist/_virtual/_glob-assets_raw/exclamation-circle-fill.svg.dc8c523e.js +4 -0
- package/dist/_virtual/_glob-assets_raw/exclamation-triangle-fill.svg.7949d2c7.js +4 -0
- package/dist/_virtual/_glob-assets_raw/eye-slash.svg.240afafa.js +4 -0
- package/dist/_virtual/_glob-assets_raw/eye.svg.2e5e9c4c.js +4 -0
- package/dist/_virtual/_glob-assets_raw/info-circle-fill.svg.6580071d.js +4 -0
- package/dist/_virtual/_glob-assets_raw/light.css.637cb2f8.js +4 -0
- package/dist/_virtual/_glob-assets_raw/plus-lg.svg.294e9073.js +4 -0
- package/dist/_virtual/_glob-assets_raw/search.svg.0ba2012d.js +4 -0
- package/dist/_virtual/_glob-assets_raw/star-fill.svg.f24b5a2d.js +4 -0
- package/dist/_virtual/_glob-assets_raw/star.svg.4af61468.js +4 -0
- package/dist/_virtual/_glob-assets_raw/three-dots-vertical.svg.9fee78c5.js +4 -0
- package/dist/_virtual/_glob-assets_raw/three-dots.svg.6a7a5b23.js +4 -0
- package/dist/_virtual/_glob-assets_raw/x-lg.svg.f34b882c.js +4 -0
- package/dist/components/UDataElement.d.ts +44 -0
- package/dist/components/UDataElement.js +101 -0
- package/dist/components/UDataElement.styles.js +95 -0
- package/dist/components/UElement.d.ts +54 -0
- package/dist/components/UElement.js +83 -0
- package/dist/components/UElement.styles.js +67 -0
- package/dist/components/UFloatingElement.d.ts +125 -0
- package/dist/components/UFloatingElement.js +238 -0
- package/dist/components/UFloatingElement.styles.d.ts +9 -0
- package/dist/components/UFloatingElement.styles.js +46 -0
- package/dist/components/UFormControlElement.d.ts +57 -0
- package/dist/components/UFormControlElement.js +68 -0
- package/dist/components/UFormControlElement.styles.js +14 -0
- package/dist/components/UOverlayElement.d.ts +66 -0
- package/dist/components/UOverlayElement.js +123 -0
- package/dist/components/UOverlayElement.styles.d.ts +1 -0
- package/dist/components/UOverlayElement.styles.js +35 -0
- package/dist/components/alert/UAlert.d.ts +58 -3
- package/dist/components/alert/UAlert.js +115 -4
- package/dist/components/alert/UAlert.styles.js +73 -48
- package/dist/components/avatar/UAvatar.d.ts +27 -0
- package/dist/components/avatar/UAvatar.js +42 -0
- package/dist/components/avatar/UAvatar.styles.d.ts +1 -0
- package/dist/components/avatar/UAvatar.styles.js +45 -0
- package/dist/components/badge/UBadge.d.ts +28 -0
- package/dist/components/badge/UBadge.js +40 -0
- package/dist/components/badge/UBadge.styles.d.ts +1 -0
- package/dist/components/badge/UBadge.styles.js +113 -0
- package/dist/components/breadcrumb/UBreadcrumb.d.ts +24 -0
- package/dist/components/breadcrumb/UBreadcrumb.js +65 -0
- package/dist/components/breadcrumb/UBreadcrumb.styles.d.ts +1 -0
- package/dist/components/breadcrumb/UBreadcrumb.styles.js +37 -0
- package/dist/components/breadcrumb-item/UBreadcrumbItem.d.ts +30 -0
- package/dist/components/breadcrumb-item/UBreadcrumbItem.js +52 -0
- package/dist/components/breadcrumb-item/UBreadcrumbItem.styles.d.ts +1 -0
- package/dist/components/breadcrumb-item/UBreadcrumbItem.styles.js +41 -0
- package/dist/components/button/UButton.d.ts +46 -3
- package/dist/components/button/UButton.js +104 -4
- package/dist/components/button/UButton.styles.js +121 -48
- package/dist/components/button-group/UButtonGroup.d.ts +28 -0
- package/dist/components/button-group/UButtonGroup.js +93 -0
- package/dist/components/button-group/UButtonGroup.styles.d.ts +1 -0
- package/dist/components/button-group/UButtonGroup.styles.js +34 -0
- package/dist/components/card/UCard.d.ts +30 -3
- package/dist/components/card/UCard.js +61 -4
- package/dist/components/card/UCard.styles.js +13 -12
- package/dist/components/carousel/UCarousel.d.ts +65 -3
- package/dist/components/carousel/UCarousel.js +219 -2
- package/dist/components/carousel/UCarousel.styles.js +32 -33
- package/dist/components/checkbox/UCheckbox.d.ts +39 -0
- package/dist/components/checkbox/UCheckbox.js +88 -0
- package/dist/components/checkbox/UCheckbox.styles.d.ts +1 -0
- package/dist/components/checkbox/UCheckbox.styles.js +211 -0
- package/dist/components/chip/UChip.d.ts +43 -0
- package/dist/components/chip/UChip.js +103 -0
- package/dist/components/chip/UChip.styles.d.ts +1 -0
- package/dist/components/chip/UChip.styles.js +31 -0
- package/dist/components/dialog/UDialog.d.ts +29 -2
- package/dist/components/dialog/UDialog.js +66 -4
- package/dist/components/dialog/UDialog.styles.js +90 -39
- package/dist/components/divider/UDivider.d.ts +27 -2
- package/dist/components/divider/UDivider.js +45 -4
- package/dist/components/divider/UDivider.styles.js +80 -10
- package/dist/components/drawer/UDrawer.d.ts +25 -3
- package/dist/components/drawer/UDrawer.js +54 -4
- package/dist/components/drawer/UDrawer.styles.js +67 -60
- package/dist/components/field/UField.d.ts +31 -0
- package/dist/components/field/UField.js +64 -0
- package/dist/components/field/UField.styles.d.ts +1 -0
- package/dist/components/field/UField.styles.js +47 -0
- package/dist/components/form/UForm.d.ts +38 -2
- package/dist/components/form/UForm.js +105 -4
- package/dist/components/form/UForm.styles.js +5 -5
- package/dist/components/icon/UIcon.d.ts +23 -4
- package/dist/components/icon/UIcon.js +55 -4
- package/dist/components/icon/UIcon.styles.js +5 -5
- package/dist/components/icon-button/UIconButton.d.ts +48 -0
- package/dist/components/icon-button/UIconButton.js +88 -0
- package/dist/components/icon-button/UIconButton.styles.d.ts +1 -0
- package/dist/components/icon-button/UIconButton.styles.js +24 -0
- package/dist/components/input/UInput.d.ts +95 -3
- package/dist/components/input/UInput.js +258 -2
- package/dist/components/input/UInput.styles.js +120 -86
- package/dist/components/menu/UMenu.d.ts +41 -3
- package/dist/components/menu/UMenu.js +178 -4
- package/dist/components/menu/UMenu.styles.js +16 -30
- package/dist/components/menu-item/UMenuItem.d.ts +48 -2
- package/dist/components/menu-item/UMenuItem.js +159 -2
- package/dist/components/menu-item/UMenuItem.styles.js +120 -34
- package/dist/components/option/UOption.d.ts +42 -0
- package/dist/components/option/UOption.js +64 -0
- package/dist/components/option/UOption.styles.d.ts +1 -0
- package/dist/components/option/UOption.styles.js +132 -0
- package/dist/components/panel/UPanel.d.ts +22 -0
- package/dist/components/panel/UPanel.js +36 -0
- package/dist/components/panel/UPanel.styles.d.ts +1 -0
- package/dist/components/panel/UPanel.styles.js +14 -0
- package/dist/components/popover/UPopover.d.ts +69 -0
- package/dist/components/popover/UPopover.js +235 -0
- package/dist/components/popover/UPopover.styles.d.ts +1 -0
- package/dist/components/popover/UPopover.styles.js +9 -0
- package/dist/components/progress-bar/UProgressBar.d.ts +46 -2
- package/dist/components/progress-bar/UProgressBar.js +94 -2
- package/dist/components/progress-bar/UProgressBar.styles.js +110 -36
- package/dist/components/progress-ring/UProgressRing.d.ts +46 -3
- package/dist/components/progress-ring/UProgressRing.js +152 -2
- package/dist/components/progress-ring/UProgressRing.styles.js +88 -25
- package/dist/components/radio/URadio.d.ts +41 -0
- package/dist/components/radio/URadio.js +151 -0
- package/dist/components/radio/URadio.styles.d.ts +1 -0
- package/dist/components/radio/URadio.styles.js +111 -0
- package/dist/components/rating/URating.d.ts +48 -0
- package/dist/components/rating/URating.js +196 -0
- package/dist/components/rating/URating.styles.d.ts +1 -0
- package/dist/components/rating/URating.styles.js +55 -0
- package/dist/components/select/USelect.d.ts +70 -0
- package/dist/components/select/USelect.js +315 -0
- package/dist/components/select/USelect.styles.d.ts +1 -0
- package/dist/components/select/USelect.styles.js +200 -0
- package/dist/components/skeleton/USkeleton.d.ts +27 -3
- package/dist/components/skeleton/USkeleton.js +37 -4
- package/dist/components/skeleton/USkeleton.styles.js +15 -18
- package/dist/components/slider/USlider.d.ts +88 -0
- package/dist/components/slider/USlider.js +286 -0
- package/dist/components/slider/USlider.styles.d.ts +1 -0
- package/dist/components/slider/USlider.styles.js +125 -0
- package/dist/components/spinner/USpinner.d.ts +23 -2
- package/dist/components/spinner/USpinner.js +37 -3
- package/dist/components/spinner/USpinner.styles.js +34 -13
- package/dist/components/split-panel/USplitPanel.d.ts +49 -2
- package/dist/components/split-panel/USplitPanel.js +239 -3
- package/dist/components/split-panel/USplitPanel.styles.js +47 -15
- package/dist/components/switch/USwitch.d.ts +43 -0
- package/dist/components/switch/USwitch.js +80 -0
- package/dist/components/switch/USwitch.styles.d.ts +1 -0
- package/dist/components/switch/USwitch.styles.js +191 -0
- package/dist/components/tab/UTab.d.ts +31 -0
- package/dist/components/tab/UTab.js +68 -0
- package/dist/components/tab/UTab.styles.d.ts +1 -0
- package/dist/components/tab/UTab.styles.js +46 -0
- package/dist/components/tab-panel/UTabPanel.d.ts +45 -0
- package/dist/components/tab-panel/UTabPanel.js +150 -0
- package/dist/components/tab-panel/UTabPanel.styles.d.ts +1 -0
- package/dist/components/tab-panel/UTabPanel.styles.js +201 -0
- package/dist/components/tag/UTag.d.ts +26 -3
- package/dist/components/tag/UTag.js +41 -4
- package/dist/components/tag/UTag.styles.js +206 -60
- package/dist/components/textarea/UTextarea.d.ts +65 -0
- package/dist/components/textarea/UTextarea.js +145 -0
- package/dist/components/textarea/UTextarea.styles.d.ts +1 -0
- package/dist/components/textarea/UTextarea.styles.js +157 -0
- package/dist/components/tooltip/UTooltip.d.ts +28 -2
- package/dist/components/tooltip/UTooltip.js +104 -4
- package/dist/components/tooltip/UTooltip.styles.js +10 -12
- package/dist/components/tree/UTree.d.ts +62 -2
- package/dist/components/tree/UTree.js +308 -3
- package/dist/components/tree/UTree.styles.js +13 -19
- package/dist/components/tree-item/UTreeItem.d.ts +61 -2
- package/dist/components/tree-item/UTreeItem.js +191 -2
- package/dist/components/tree-item/UTreeItem.styles.js +96 -37
- package/dist/events/CheckEvent.d.ts +7 -0
- package/dist/events/CollapseEvent.d.ts +7 -0
- package/dist/events/ExpandEvent.d.ts +7 -0
- package/dist/events/HideEvent.d.ts +7 -0
- package/dist/events/NavigateEvent.d.ts +7 -0
- package/dist/events/PickEvent.d.ts +18 -0
- package/dist/events/RemoveEvent.d.ts +7 -0
- package/dist/events/ShiftEvent.d.ts +16 -0
- package/dist/events/ShowEvent.d.ts +7 -0
- package/dist/index.d.ts +41 -8
- package/dist/index.js +56 -46
- package/dist/react/UAlert.d.ts +13 -0
- package/dist/{react-components → react}/UAlert.js +5 -2
- package/dist/react/UAvatar.d.ts +9 -0
- package/dist/react/UAvatar.js +10 -0
- package/dist/react/UBadge.d.ts +9 -0
- package/dist/react/UBadge.js +10 -0
- package/dist/react/UBreadcrumb.d.ts +9 -0
- package/dist/react/UBreadcrumb.js +10 -0
- package/dist/react/UBreadcrumbItem.d.ts +11 -0
- package/dist/react/UBreadcrumbItem.js +12 -0
- package/dist/{react-components → react}/UButton.d.ts +3 -2
- package/dist/{react-components → react}/UButton.js +2 -2
- package/dist/react/UButtonGroup.d.ts +9 -0
- package/dist/react/UButtonGroup.js +10 -0
- package/dist/{react-components → react}/UCard.d.ts +3 -2
- package/dist/{react-components → react}/UCard.js +2 -2
- package/dist/{react-components → react}/UCarousel.d.ts +3 -2
- package/dist/{react-components → react}/UCarousel.js +2 -2
- package/dist/react/UCheckbox.d.ts +9 -0
- package/dist/react/UCheckbox.js +10 -0
- package/dist/react/UChip.d.ts +13 -0
- package/dist/react/UChip.js +13 -0
- package/dist/{react-components → react}/UDialog.d.ts +3 -2
- package/dist/{react-components → react}/UDialog.js +2 -2
- package/dist/{react-components → react}/UDivider.d.ts +3 -2
- package/dist/{react-components → react}/UDivider.js +2 -2
- package/dist/{react-components → react}/UDrawer.d.ts +3 -2
- package/dist/{react-components → react}/UDrawer.js +2 -2
- package/dist/react/UField.d.ts +9 -0
- package/dist/react/UField.js +10 -0
- package/dist/react/UForm.d.ts +10 -0
- package/dist/{react-components → react}/UForm.js +4 -2
- package/dist/{react-components → react}/UIcon.d.ts +3 -2
- package/dist/{react-components → react}/UIcon.js +2 -2
- package/dist/react/UIconButton.d.ts +9 -0
- package/dist/react/UIconButton.js +10 -0
- package/dist/react/UInput.d.ts +11 -0
- package/dist/{react-components → react}/UInput.js +5 -2
- package/dist/react/UMenu.d.ts +10 -0
- package/dist/{react-components → react}/UMenu.js +4 -2
- package/dist/react/UMenuItem.d.ts +11 -0
- package/dist/{react-components → react}/UMenuItem.js +4 -2
- package/dist/react/UOption.d.ts +9 -0
- package/dist/react/UOption.js +10 -0
- package/dist/react/UPanel.d.ts +9 -0
- package/dist/react/UPanel.js +10 -0
- package/dist/react/UPopover.d.ts +11 -0
- package/dist/react/UPopover.js +13 -0
- package/dist/react/UProgressBar.d.ts +9 -0
- package/dist/{react-components → react}/UProgressBar.js +2 -2
- package/dist/react/UProgressRing.d.ts +9 -0
- package/dist/{react-components → react}/UProgressRing.js +2 -2
- package/dist/react/URadio.d.ts +10 -0
- package/dist/react/URadio.js +12 -0
- package/dist/react/URating.d.ts +10 -0
- package/dist/react/URating.js +12 -0
- package/dist/react/USelect.d.ts +10 -0
- package/dist/react/USelect.js +12 -0
- package/dist/{react-components → react}/USkeleton.d.ts +3 -2
- package/dist/{react-components → react}/USkeleton.js +2 -2
- package/dist/react/USlider.d.ts +10 -0
- package/dist/react/USlider.js +12 -0
- package/dist/{react-components → react}/USpinner.d.ts +3 -2
- package/dist/{react-components → react}/USpinner.js +2 -2
- package/dist/react/USplitPanel.d.ts +13 -0
- package/dist/{react-components → react}/USplitPanel.js +6 -2
- package/dist/react/USwitch.d.ts +10 -0
- package/dist/react/USwitch.js +12 -0
- package/dist/react/UTab.d.ts +11 -0
- package/dist/react/UTab.js +12 -0
- package/dist/react/UTabPanel.d.ts +9 -0
- package/dist/react/UTabPanel.js +10 -0
- package/dist/{react-components → react}/UTag.d.ts +3 -2
- package/dist/{react-components → react}/UTag.js +2 -2
- package/dist/react/UTextarea.d.ts +11 -0
- package/dist/react/UTextarea.js +13 -0
- package/dist/react/UTooltip.d.ts +11 -0
- package/dist/{react-components → react}/UTooltip.js +5 -2
- package/dist/react/UTree.d.ts +10 -0
- package/dist/{react-components → react}/UTree.js +4 -2
- package/dist/react/UTreeItem.d.ts +17 -0
- package/dist/{react-components → react}/UTreeItem.js +7 -2
- package/dist/{react-components → react}/index.d.ts +40 -27
- package/dist/{react-components → react}/index.js +40 -20
- package/dist/{assets/styles → styles}/dark.css +68 -3
- package/dist/{assets/styles → styles}/light.css +68 -3
- package/dist/utilities/BrowserStorage.d.ts +2 -1
- package/dist/utilities/BrowserStorage.js +69 -86
- package/dist/utilities/Dialog.d.ts +83 -0
- package/dist/utilities/Dialog.js +141 -0
- package/dist/utilities/OverlayManager.d.ts +37 -0
- package/dist/utilities/OverlayManager.js +68 -0
- package/dist/utilities/Theme.js +134 -141
- package/dist/utilities/Toast.d.ts +45 -0
- package/dist/utilities/Toast.js +114 -0
- package/dist/utilities/converters.d.ts +44 -1
- package/dist/utilities/converters.js +112 -14
- package/dist/utilities/elements.d.ts +23 -0
- package/dist/utilities/elements.js +67 -16
- package/dist/utilities/icons.d.ts +67 -0
- package/dist/utilities/icons.js +200 -0
- package/dist/utilities/sanitizers.d.ts +35 -0
- package/dist/utilities/sanitizers.js +75 -0
- package/package.json +24 -21
- package/plugins/vite-plugin-glob-resolve.d.ts +12 -0
- package/plugins/vite-plugin-glob-resolve.js +66 -0
- package/plugins/vite-plugin-react-wrapper.d.ts +12 -0
- package/plugins/vite-plugin-react-wrapper.js +206 -0
- package/skills/iyulab-components/SKILL.md +138 -0
- package/skills/iyulab-components/references/components/alert.md +74 -0
- package/skills/iyulab-components/references/components/avatar.md +41 -0
- package/skills/iyulab-components/references/components/badge.md +38 -0
- package/skills/iyulab-components/references/components/breadcrumb.md +75 -0
- package/skills/iyulab-components/references/components/button-group.md +38 -0
- package/skills/iyulab-components/references/components/button.md +56 -0
- package/skills/iyulab-components/references/components/card.md +53 -0
- package/skills/iyulab-components/references/components/carousel.md +63 -0
- package/skills/iyulab-components/references/components/checkbox.md +70 -0
- package/skills/iyulab-components/references/components/chip.md +64 -0
- package/skills/iyulab-components/references/components/dialog.md +71 -0
- package/skills/iyulab-components/references/components/divider.md +56 -0
- package/skills/iyulab-components/references/components/drawer.md +63 -0
- package/skills/iyulab-components/references/components/field.md +42 -0
- package/skills/iyulab-components/references/components/form.md +68 -0
- package/skills/iyulab-components/references/components/icon-button.md +56 -0
- package/skills/iyulab-components/references/components/icon.md +49 -0
- package/skills/iyulab-components/references/components/input.md +95 -0
- package/skills/iyulab-components/references/components/menu.md +106 -0
- package/skills/iyulab-components/references/components/option.md +70 -0
- package/skills/iyulab-components/references/components/panel.md +38 -0
- package/skills/iyulab-components/references/components/popover.md +62 -0
- package/skills/iyulab-components/references/components/progress-bar.md +61 -0
- package/skills/iyulab-components/references/components/progress-ring.md +58 -0
- package/skills/iyulab-components/references/components/radio.md +67 -0
- package/skills/iyulab-components/references/components/rating.md +74 -0
- package/skills/iyulab-components/references/components/select.md +86 -0
- package/skills/iyulab-components/references/components/skeleton.md +46 -0
- package/skills/iyulab-components/references/components/slider.md +89 -0
- package/skills/iyulab-components/references/components/spinner.md +47 -0
- package/skills/iyulab-components/references/components/split-panel.md +65 -0
- package/skills/iyulab-components/references/components/switch.md +81 -0
- package/skills/iyulab-components/references/components/tab-panel.md +93 -0
- package/skills/iyulab-components/references/components/tag.md +55 -0
- package/skills/iyulab-components/references/components/textarea.md +67 -0
- package/skills/iyulab-components/references/components/tooltip.md +58 -0
- package/skills/iyulab-components/references/components/tree.md +128 -0
- package/skills/iyulab-components/references/extensions/data.md +60 -0
- package/skills/iyulab-components/references/extensions/element.md +57 -0
- package/skills/iyulab-components/references/extensions/floating.md +60 -0
- package/skills/iyulab-components/references/extensions/form-control.md +79 -0
- package/skills/iyulab-components/references/extensions/overlay.md +76 -0
- package/skills/iyulab-components/references/usage.md +216 -0
- package/skills/iyulab-components/references/utilities/browser-storage.md +54 -0
- package/skills/iyulab-components/references/utilities/converters.md +42 -0
- package/skills/iyulab-components/references/utilities/dialog.md +75 -0
- package/skills/iyulab-components/references/utilities/elements.md +55 -0
- package/skills/iyulab-components/references/utilities/icons.md +53 -0
- package/skills/iyulab-components/references/utilities/overlay-manager.md +34 -0
- package/skills/iyulab-components/references/utilities/sanitizers.md +32 -0
- package/skills/iyulab-components/references/utilities/theme.md +45 -0
- package/skills/iyulab-components/references/utilities/toast.md +58 -0
- package/dist/assets/icons/arrow-down.svg.js +0 -3
- package/dist/assets/icons/arrow-repeat.svg.js +0 -3
- package/dist/assets/icons/arrow-up.svg.js +0 -3
- package/dist/assets/icons/ban.svg.js +0 -3
- package/dist/assets/icons/bell-fill.svg.js +0 -3
- package/dist/assets/icons/box-arrow-up-right.svg.js +0 -3
- package/dist/assets/icons/check-circle-fill.svg.js +0 -3
- package/dist/assets/icons/check-lg.svg.js +0 -3
- package/dist/assets/icons/chevron-down.svg.js +0 -3
- package/dist/assets/icons/chevron-left.svg.js +0 -3
- package/dist/assets/icons/chevron-right.svg.js +0 -3
- package/dist/assets/icons/chevron-up.svg.js +0 -3
- package/dist/assets/icons/copy.svg.js +0 -3
- package/dist/assets/icons/dash-lg.svg.js +0 -3
- package/dist/assets/icons/exclamation-circle-fill.svg.js +0 -3
- package/dist/assets/icons/exclamation-triangle-fill.svg.js +0 -3
- package/dist/assets/icons/eye-slash.svg.js +0 -3
- package/dist/assets/icons/eye.svg.js +0 -3
- package/dist/assets/icons/file-earmark.svg.js +0 -3
- package/dist/assets/icons/flag.svg.js +0 -3
- package/dist/assets/icons/globe.svg.js +0 -3
- package/dist/assets/icons/hand-thumbs-down-fill.svg.js +0 -3
- package/dist/assets/icons/hand-thumbs-down.svg.js +0 -3
- package/dist/assets/icons/hand-thumbs-up-fill.svg.js +0 -3
- package/dist/assets/icons/hand-thumbs-up.svg.js +0 -3
- package/dist/assets/icons/info-circle-fill.svg.js +0 -3
- package/dist/assets/icons/lightbulb-fill.svg.js +0 -3
- package/dist/assets/icons/lightbulb-off.svg.js +0 -3
- package/dist/assets/icons/lightbulb.svg.js +0 -3
- package/dist/assets/icons/mic-fill.svg.js +0 -3
- package/dist/assets/icons/mic-mute-fill.svg.js +0 -3
- package/dist/assets/icons/paperclip.svg.js +0 -3
- package/dist/assets/icons/pencil-square.svg.js +0 -3
- package/dist/assets/icons/plus-lg.svg.js +0 -3
- package/dist/assets/icons/search.svg.js +0 -3
- package/dist/assets/icons/share.svg.js +0 -3
- package/dist/assets/icons/stop-circle.svg.js +0 -3
- package/dist/assets/icons/tools.svg.js +0 -3
- package/dist/assets/icons/x-lg.svg.js +0 -3
- package/dist/assets/styles/dark.css.js +0 -3
- package/dist/assets/styles/light.css.js +0 -3
- package/dist/components/BaseElement.d.ts +0 -33
- package/dist/components/BaseElement.js +0 -59
- package/dist/components/BaseElement.styles.js +0 -28
- package/dist/components/FloatingElement.d.ts +0 -104
- package/dist/components/FloatingElement.js +0 -195
- package/dist/components/FloatingElement.styles.js +0 -23
- package/dist/components/ModalElement.d.ts +0 -70
- package/dist/components/ModalElement.js +0 -144
- package/dist/components/ModalElement.styles.js +0 -29
- package/dist/components/alert/UAlert.component.d.ts +0 -40
- package/dist/components/alert/UAlert.component.js +0 -146
- package/dist/components/button/UButton.component.d.ts +0 -23
- package/dist/components/button/UButton.component.js +0 -72
- package/dist/components/card/UCard.component.d.ts +0 -21
- package/dist/components/card/UCard.component.js +0 -66
- package/dist/components/carousel/UCarousel.component.d.ts +0 -67
- package/dist/components/carousel/UCarousel.component.js +0 -243
- package/dist/components/dialog/UDialog.component.d.ts +0 -17
- package/dist/components/dialog/UDialog.component.js +0 -70
- package/dist/components/divider/UDivider.component.d.ts +0 -10
- package/dist/components/divider/UDivider.component.js +0 -30
- package/dist/components/drawer/UDrawer.component.d.ts +0 -18
- package/dist/components/drawer/UDrawer.component.js +0 -64
- package/dist/components/form/UForm.component.d.ts +0 -24
- package/dist/components/form/UForm.component.js +0 -76
- package/dist/components/icon/UIcon.component.d.ts +0 -29
- package/dist/components/icon/UIcon.component.js +0 -57
- package/dist/components/input/UInput.component.d.ts +0 -92
- package/dist/components/input/UInput.component.js +0 -267
- package/dist/components/menu/UMenu.component.d.ts +0 -67
- package/dist/components/menu/UMenu.component.js +0 -338
- package/dist/components/menu-item/UMenuItem.component.d.ts +0 -25
- package/dist/components/menu-item/UMenuItem.component.js +0 -111
- package/dist/components/progress-bar/UProgressBar.component.d.ts +0 -27
- package/dist/components/progress-bar/UProgressBar.component.js +0 -99
- package/dist/components/progress-ring/UProgressRing.component.d.ts +0 -33
- package/dist/components/progress-ring/UProgressRing.component.js +0 -114
- package/dist/components/skeleton/USkeleton.component.d.ts +0 -22
- package/dist/components/skeleton/USkeleton.component.js +0 -58
- package/dist/components/spinner/USpinner.component.d.ts +0 -9
- package/dist/components/spinner/USpinner.component.js +0 -22
- package/dist/components/split-panel/USplitPanel.component.d.ts +0 -44
- package/dist/components/split-panel/USplitPanel.component.js +0 -185
- package/dist/components/tag/UTag.component.d.ts +0 -23
- package/dist/components/tag/UTag.component.js +0 -72
- package/dist/components/tooltip/UTooltip.component.d.ts +0 -27
- package/dist/components/tooltip/UTooltip.component.js +0 -88
- package/dist/components/tree/UTree.component.d.ts +0 -37
- package/dist/components/tree/UTree.component.js +0 -120
- package/dist/components/tree-item/UTreeItem.component.d.ts +0 -41
- package/dist/components/tree-item/UTreeItem.component.js +0 -161
- package/dist/events/UChangeEvent.d.ts +0 -6
- package/dist/events/UHideEvent.d.ts +0 -6
- package/dist/events/UInputEvent.d.ts +0 -6
- package/dist/events/UResizeEvent.d.ts +0 -6
- package/dist/events/USelectEvent.d.ts +0 -6
- package/dist/events/UShowEvent.d.ts +0 -6
- package/dist/react-components/UAlert.d.ts +0 -8
- package/dist/react-components/UForm.d.ts +0 -8
- package/dist/react-components/UInput.d.ts +0 -8
- package/dist/react-components/UMenu.d.ts +0 -8
- package/dist/react-components/UMenuItem.d.ts +0 -8
- package/dist/react-components/UProgressBar.d.ts +0 -8
- package/dist/react-components/UProgressRing.d.ts +0 -8
- package/dist/react-components/USplitPanel.d.ts +0 -8
- package/dist/react-components/UTooltip.d.ts +0 -8
- package/dist/react-components/UTree.d.ts +0 -8
- package/dist/react-components/UTreeItem.d.ts +0 -8
- package/dist/utilities/IconRegistry.d.ts +0 -40
- package/dist/utilities/IconRegistry.js +0 -119
- package/dist/utilities/Notifier.d.ts +0 -31
- package/dist/utilities/Notifier.js +0 -79
- package/dist/utilities/decorators.d.ts +0 -28
- /package/dist/components/{BaseElement.styles.d.ts → UDataElement.styles.d.ts} +0 -0
- /package/dist/components/{FloatingElement.styles.d.ts → UElement.styles.d.ts} +0 -0
- /package/dist/components/{ModalElement.styles.d.ts → UFormControlElement.styles.d.ts} +0 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { UElement } from "../UElement.js";
|
|
2
|
+
import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorateMetadata.js";
|
|
3
|
+
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js";
|
|
4
|
+
import { UButton } from "../button/UButton.js";
|
|
5
|
+
import { UIconButton } from "../icon-button/UIconButton.js";
|
|
6
|
+
import { styles } from "./UButtonGroup.styles.js";
|
|
7
|
+
import { customElement, property } from "lit/decorators.js";
|
|
8
|
+
import { html } from "lit";
|
|
9
|
+
//#region src/components/button-group/UButtonGroup.ts
|
|
10
|
+
var UButtonGroup = class UButtonGroup extends UElement {
|
|
11
|
+
constructor(..._args) {
|
|
12
|
+
super(..._args);
|
|
13
|
+
this.variant = "solid";
|
|
14
|
+
this.vertical = false;
|
|
15
|
+
this.disabled = false;
|
|
16
|
+
this.handleSlotChange = () => {
|
|
17
|
+
this.propagate();
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
static {
|
|
21
|
+
this.styles = [super.styles, styles];
|
|
22
|
+
}
|
|
23
|
+
updated(changedProperties) {
|
|
24
|
+
super.updated(changedProperties);
|
|
25
|
+
if ([
|
|
26
|
+
"variant",
|
|
27
|
+
"disabled",
|
|
28
|
+
"vertical"
|
|
29
|
+
].some((k) => changedProperties.has(k))) this.propagate();
|
|
30
|
+
}
|
|
31
|
+
render() {
|
|
32
|
+
return html`
|
|
33
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
34
|
+
`;
|
|
35
|
+
}
|
|
36
|
+
propagate() {
|
|
37
|
+
const buttons = (this.shadowRoot?.querySelector("slot"))?.assignedElements({ flatten: true }).filter((el) => el instanceof UButton || el instanceof UIconButton);
|
|
38
|
+
if (!buttons?.length) return;
|
|
39
|
+
const variant = this.variant;
|
|
40
|
+
const vertical = this.vertical;
|
|
41
|
+
const lastIndex = buttons.length - 1;
|
|
42
|
+
const isGhost = variant === "ghost" || variant === "link";
|
|
43
|
+
const isSolid = variant === "solid" || variant === "filled";
|
|
44
|
+
buttons.forEach((button, index) => {
|
|
45
|
+
button.variant = variant;
|
|
46
|
+
button.disabled = this.disabled;
|
|
47
|
+
const radius = this.getRadius(index, lastIndex, vertical);
|
|
48
|
+
const margin = index > 0 && !isGhost ? "-1px" : "";
|
|
49
|
+
const borderCollapse = isSolid && button instanceof UButton;
|
|
50
|
+
if (button instanceof UIconButton) {
|
|
51
|
+
const inner = button.shadowRoot?.querySelector("u-button");
|
|
52
|
+
if (inner) inner.style.borderRadius = radius;
|
|
53
|
+
button.style.borderRadius = "";
|
|
54
|
+
button.style.margin = vertical ? `${margin} 0 0 0` : `0 0 0 ${margin}`;
|
|
55
|
+
} else {
|
|
56
|
+
button.style.borderRadius = radius;
|
|
57
|
+
button.style.margin = vertical ? `${margin} 0 0 0` : `0 0 0 ${margin}`;
|
|
58
|
+
if (borderCollapse) if (vertical) {
|
|
59
|
+
button.style.borderBottomWidth = index < lastIndex ? "0" : "";
|
|
60
|
+
button.style.borderRightWidth = "";
|
|
61
|
+
} else {
|
|
62
|
+
button.style.borderRightWidth = index < lastIndex ? "0" : "";
|
|
63
|
+
button.style.borderBottomWidth = "";
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
button.style.borderRightWidth = "";
|
|
67
|
+
button.style.borderBottomWidth = "";
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
getRadius(index, last, vertical) {
|
|
73
|
+
if (last === 0) return "6px";
|
|
74
|
+
if (index === 0) return vertical ? "6px 6px 0 0" : "6px 0 0 6px";
|
|
75
|
+
if (index === last) return vertical ? "0 0 6px 6px" : "0 6px 6px 0";
|
|
76
|
+
return "0";
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
__decorate([property({
|
|
80
|
+
type: String,
|
|
81
|
+
reflect: true
|
|
82
|
+
}), __decorateMetadata("design:type", Object)], UButtonGroup.prototype, "variant", void 0);
|
|
83
|
+
__decorate([property({
|
|
84
|
+
type: Boolean,
|
|
85
|
+
reflect: true
|
|
86
|
+
}), __decorateMetadata("design:type", Object)], UButtonGroup.prototype, "vertical", void 0);
|
|
87
|
+
__decorate([property({
|
|
88
|
+
type: Boolean,
|
|
89
|
+
reflect: true
|
|
90
|
+
}), __decorateMetadata("design:type", Object)], UButtonGroup.prototype, "disabled", void 0);
|
|
91
|
+
UButtonGroup = __decorate([customElement("u-button-group")], UButtonGroup);
|
|
92
|
+
//#endregion
|
|
93
|
+
export { UButtonGroup };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import('lit').CSSResult;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
//#region src/components/button-group/UButtonGroup.styles.ts
|
|
3
|
+
var styles = css`
|
|
4
|
+
:host {
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
flex-direction: row;
|
|
7
|
+
align-items: stretch;
|
|
8
|
+
font-size: 14px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
:host([vertical]) {
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
::slotted(u-button),
|
|
16
|
+
::slotted(u-icon-button) {
|
|
17
|
+
font-size: inherit;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* hover/focus 시 border 겹침 위로 올리기 */
|
|
21
|
+
::slotted(u-button:hover),
|
|
22
|
+
::slotted(u-button:focus-within),
|
|
23
|
+
::slotted(u-icon-button:hover),
|
|
24
|
+
::slotted(u-icon-button:focus-within) {
|
|
25
|
+
z-index: 1;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:host([variant="ghost"]),
|
|
29
|
+
:host([variant="link"]) {
|
|
30
|
+
gap: 2px;
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
//#endregion
|
|
34
|
+
export { styles };
|
|
@@ -1,7 +1,34 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UElement } from '../UElement.js';
|
|
2
|
+
export type CardOrientation = 'vertical' | 'horizontal';
|
|
3
|
+
/**
|
|
4
|
+
* 콘텐츠를 카드 형태로 표시하는 컴포넌트입니다.
|
|
5
|
+
*
|
|
6
|
+
* @slot - 카드의 본문 콘텐츠
|
|
7
|
+
* @slot header - 카드 상단 헤더 영역
|
|
8
|
+
* @slot footer - 카드 하단 푸터 영역
|
|
9
|
+
* @slot media - 카드의 미디어 영역 (이미지, 동영상 등)
|
|
10
|
+
*
|
|
11
|
+
* @csspart media - 미디어 영역 컨테이너
|
|
12
|
+
* @csspart content - 콘텐츠 영역 컨테이너
|
|
13
|
+
* @csspart header - 헤더 영역 컨테이너
|
|
14
|
+
* @csspart body - 본문 영역 컨테이너
|
|
15
|
+
* @csspart footer - 푸터 영역 컨테이너
|
|
16
|
+
*/
|
|
17
|
+
export declare class UCard extends UElement {
|
|
18
|
+
static styles: import('lit').CSSResultGroup[];
|
|
19
|
+
/** 카드 레이아웃 방향 */
|
|
20
|
+
orientation: CardOrientation;
|
|
21
|
+
/** 그림자 제거 여부 */
|
|
22
|
+
shadowless: boolean;
|
|
23
|
+
/** 테두리 제거 여부 */
|
|
24
|
+
borderless: boolean;
|
|
25
|
+
/** 마우스 오버 효과 적용 여부 */
|
|
26
|
+
hoverable: boolean;
|
|
27
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
28
|
+
private handleSlotChange;
|
|
29
|
+
}
|
|
2
30
|
declare global {
|
|
3
31
|
interface HTMLElementTagNameMap {
|
|
4
|
-
|
|
32
|
+
'u-card': UCard;
|
|
5
33
|
}
|
|
6
34
|
}
|
|
7
|
-
export { UCard };
|
|
@@ -1,5 +1,62 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { UElement } from "../UElement.js";
|
|
2
|
+
import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorateMetadata.js";
|
|
3
|
+
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js";
|
|
4
|
+
import { styles } from "./UCard.styles.js";
|
|
5
|
+
import { customElement, property } from "lit/decorators.js";
|
|
6
|
+
import { html } from "lit";
|
|
7
|
+
//#region src/components/card/UCard.ts
|
|
8
|
+
var UCard = class UCard extends UElement {
|
|
9
|
+
constructor(..._args) {
|
|
10
|
+
super(..._args);
|
|
11
|
+
this.orientation = "vertical";
|
|
12
|
+
this.shadowless = false;
|
|
13
|
+
this.borderless = false;
|
|
14
|
+
this.hoverable = false;
|
|
15
|
+
}
|
|
16
|
+
static {
|
|
17
|
+
this.styles = [super.styles, styles];
|
|
18
|
+
}
|
|
19
|
+
render() {
|
|
20
|
+
return html`
|
|
21
|
+
<div class="media" part="media">
|
|
22
|
+
<slot name="media" @slotchange=${this.handleSlotChange}></slot>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="content" part="content">
|
|
25
|
+
<header class="header" part="header">
|
|
26
|
+
<slot name="header" @slotchange=${this.handleSlotChange}></slot>
|
|
27
|
+
</header>
|
|
28
|
+
<div class="body" part="body">
|
|
29
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
30
|
+
</div>
|
|
31
|
+
<footer class="footer" part="footer">
|
|
32
|
+
<slot name="footer" @slotchange=${this.handleSlotChange}></slot>
|
|
33
|
+
</footer>
|
|
34
|
+
</div>
|
|
35
|
+
`;
|
|
36
|
+
}
|
|
37
|
+
handleSlotChange(e) {
|
|
38
|
+
const slot = e.target;
|
|
39
|
+
const container = slot.parentElement;
|
|
40
|
+
const hasContent = slot.assignedNodes({ flatten: true }).length > 0;
|
|
41
|
+
if (container) container.classList.toggle("has-content", hasContent);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
__decorate([property({
|
|
45
|
+
type: String,
|
|
46
|
+
reflect: true
|
|
47
|
+
}), __decorateMetadata("design:type", Object)], UCard.prototype, "orientation", void 0);
|
|
48
|
+
__decorate([property({
|
|
49
|
+
type: Boolean,
|
|
50
|
+
reflect: true
|
|
51
|
+
}), __decorateMetadata("design:type", Object)], UCard.prototype, "shadowless", void 0);
|
|
52
|
+
__decorate([property({
|
|
53
|
+
type: Boolean,
|
|
54
|
+
reflect: true
|
|
55
|
+
}), __decorateMetadata("design:type", Object)], UCard.prototype, "borderless", void 0);
|
|
56
|
+
__decorate([property({
|
|
57
|
+
type: Boolean,
|
|
58
|
+
reflect: true
|
|
59
|
+
}), __decorateMetadata("design:type", Object)], UCard.prototype, "hoverable", void 0);
|
|
60
|
+
UCard = __decorate([customElement("u-card")], UCard);
|
|
61
|
+
//#endregion
|
|
5
62
|
export { UCard };
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import { css } from
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
//#region src/components/card/UCard.styles.ts
|
|
3
|
+
var styles = css`
|
|
4
4
|
:host {
|
|
5
5
|
display: flex;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
background-color: var(--u-panel-bg-color);
|
|
8
|
-
border-radius: 8px;
|
|
9
|
-
overflow: hidden;
|
|
10
6
|
border: 1px solid var(--u-border-color);
|
|
7
|
+
border-radius: 8px;
|
|
8
|
+
background-color: var(--u-panel-bg-color);
|
|
11
9
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
}
|
|
12
|
+
:host([orientation="vertical"]) {
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
}
|
|
15
|
+
:host([orientation="horizontal"]) {
|
|
16
|
+
flex-direction: row;
|
|
12
17
|
}
|
|
13
18
|
:host([borderless]) {
|
|
14
19
|
border: none;
|
|
@@ -24,9 +29,6 @@ const styles = css`
|
|
|
24
29
|
transform: translateY(-2px);
|
|
25
30
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
26
31
|
}
|
|
27
|
-
:host([orientation="horizontal"]) {
|
|
28
|
-
flex-direction: row;
|
|
29
|
-
}
|
|
30
32
|
|
|
31
33
|
.media {
|
|
32
34
|
display: none;
|
|
@@ -70,7 +72,6 @@ const styles = css`
|
|
|
70
72
|
.footer.has-content {
|
|
71
73
|
display: block;
|
|
72
74
|
}
|
|
73
|
-
|
|
74
75
|
`;
|
|
75
|
-
|
|
76
|
+
//#endregion
|
|
76
77
|
export { styles };
|
|
@@ -1,7 +1,69 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { UElement } from '../UElement.js';
|
|
3
|
+
/**
|
|
4
|
+
* 여러 슬라이드를 전환하며 표시하는 캐러셀 컴포넌트입니다.
|
|
5
|
+
*
|
|
6
|
+
* @slot - 슬라이드로 표시할 콘텐츠 (각 자식 요소가 하나의 슬라이드)
|
|
7
|
+
*
|
|
8
|
+
* @csspart slides - 슬라이드 컨테이너
|
|
9
|
+
* @csspart prev-button - 이전 버튼
|
|
10
|
+
* @csspart next-button - 다음 버튼
|
|
11
|
+
* @csspart indicator - 페이지네이션 컨테이너
|
|
12
|
+
* @csspart dot - 페이지네이션 점
|
|
13
|
+
*/
|
|
14
|
+
export declare class UCarousel extends UElement {
|
|
15
|
+
static styles: import('lit').CSSResultGroup[];
|
|
16
|
+
/** 자동 재생 활성화 */
|
|
17
|
+
autoplay: boolean;
|
|
18
|
+
/** 자동 재생 간격 (ms) */
|
|
19
|
+
autoplayInterval: number;
|
|
20
|
+
/** 처음/끝에서 순환 이동 */
|
|
21
|
+
loop: boolean;
|
|
22
|
+
/** 이전/다음 내비게이션 버튼 표시 */
|
|
23
|
+
navigation: boolean;
|
|
24
|
+
/** 페이지 페이지네이션 표시 */
|
|
25
|
+
pagination: boolean;
|
|
26
|
+
/** 드래그로 슬라이드 이동 */
|
|
27
|
+
draggable: boolean;
|
|
28
|
+
/** 한 화면에 표시할 슬라이드 수 */
|
|
29
|
+
slidesPerView: number;
|
|
30
|
+
/** 한 번에 이동할 슬라이드 수 */
|
|
31
|
+
slidesPerMove: number;
|
|
32
|
+
/** 슬라이드 간 간격 (px) */
|
|
33
|
+
gap: number;
|
|
34
|
+
/** 현재 활성 슬라이드 인덱스 */
|
|
35
|
+
index: number;
|
|
36
|
+
private slideCount;
|
|
37
|
+
private isDragging;
|
|
38
|
+
private dragOffset;
|
|
39
|
+
private autoplayTimer?;
|
|
40
|
+
private dragStartX;
|
|
41
|
+
private dragStartTime;
|
|
42
|
+
private pointerDown;
|
|
43
|
+
private get perView();
|
|
44
|
+
private get perMove();
|
|
45
|
+
private get maxIndex();
|
|
46
|
+
private get pageCount();
|
|
47
|
+
private get currentPage();
|
|
48
|
+
connectedCallback(): void;
|
|
49
|
+
disconnectedCallback(): void;
|
|
50
|
+
protected willUpdate(changedProperties: PropertyValues): void;
|
|
51
|
+
protected updated(changedProperties: PropertyValues): void;
|
|
52
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
53
|
+
prev: () => void;
|
|
54
|
+
next: () => void;
|
|
55
|
+
goTo: (index: number) => void;
|
|
56
|
+
private startAutoplay;
|
|
57
|
+
private stopAutoplay;
|
|
58
|
+
private handleSlotChange;
|
|
59
|
+
private handleDragStart;
|
|
60
|
+
private handlePointerDown;
|
|
61
|
+
private handlePointerMove;
|
|
62
|
+
private handlePointerUp;
|
|
63
|
+
private handleClickCancel;
|
|
64
|
+
}
|
|
2
65
|
declare global {
|
|
3
66
|
interface HTMLElementTagNameMap {
|
|
4
|
-
|
|
67
|
+
'u-carousel': UCarousel;
|
|
5
68
|
}
|
|
6
69
|
}
|
|
7
|
-
export { UCarousel };
|
|
@@ -1,5 +1,222 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UElement } from "../UElement.js";
|
|
2
|
+
import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorateMetadata.js";
|
|
3
|
+
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js";
|
|
4
|
+
import "../icon/UIcon.js";
|
|
5
|
+
import "../button/UButton.js";
|
|
6
|
+
import { styles } from "./UCarousel.styles.js";
|
|
7
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
8
|
+
import { html } from "lit";
|
|
9
|
+
//#region src/components/carousel/UCarousel.ts
|
|
10
|
+
var UCarousel = class UCarousel extends UElement {
|
|
11
|
+
constructor(..._args) {
|
|
12
|
+
super(..._args);
|
|
13
|
+
this.autoplay = false;
|
|
14
|
+
this.autoplayInterval = 3e3;
|
|
15
|
+
this.loop = false;
|
|
16
|
+
this.navigation = false;
|
|
17
|
+
this.pagination = false;
|
|
18
|
+
this.draggable = false;
|
|
19
|
+
this.slidesPerView = 1;
|
|
20
|
+
this.slidesPerMove = 1;
|
|
21
|
+
this.gap = 0;
|
|
22
|
+
this.index = 0;
|
|
23
|
+
this.slideCount = 0;
|
|
24
|
+
this.isDragging = false;
|
|
25
|
+
this.dragOffset = 0;
|
|
26
|
+
this.dragStartX = 0;
|
|
27
|
+
this.dragStartTime = 0;
|
|
28
|
+
this.pointerDown = false;
|
|
29
|
+
this.prev = () => {
|
|
30
|
+
const target = Math.max(0, this.index - this.perMove);
|
|
31
|
+
if (target !== this.index) this.goTo(target);
|
|
32
|
+
else if (this.loop) this.goTo(Math.min((this.pageCount - 1) * this.perMove, this.maxIndex));
|
|
33
|
+
};
|
|
34
|
+
this.next = () => {
|
|
35
|
+
const target = Math.min(this.maxIndex, this.index + this.perMove);
|
|
36
|
+
if (target !== this.index) this.goTo(target);
|
|
37
|
+
else if (this.loop) this.goTo(0);
|
|
38
|
+
};
|
|
39
|
+
this.goTo = (index) => {
|
|
40
|
+
if (index < 0 || index > this.maxIndex || index === this.index) return;
|
|
41
|
+
this.index = index;
|
|
42
|
+
if (this.autoplay) this.startAutoplay();
|
|
43
|
+
};
|
|
44
|
+
this.handleDragStart = (e) => {
|
|
45
|
+
e.preventDefault();
|
|
46
|
+
};
|
|
47
|
+
this.handlePointerDown = (e) => {
|
|
48
|
+
if (e.button !== 0) return;
|
|
49
|
+
this.pointerDown = true;
|
|
50
|
+
this.dragStartX = e.clientX;
|
|
51
|
+
this.dragOffset = 0;
|
|
52
|
+
this.dragStartTime = Date.now();
|
|
53
|
+
if (this.autoplay) this.stopAutoplay();
|
|
54
|
+
};
|
|
55
|
+
this.handlePointerMove = (e) => {
|
|
56
|
+
if (!this.pointerDown) return;
|
|
57
|
+
const wrapper = e.currentTarget;
|
|
58
|
+
const offset = (e.clientX - this.dragStartX) / wrapper.offsetWidth * 100;
|
|
59
|
+
if (!this.isDragging && Math.abs(e.clientX - this.dragStartX) > 5) {
|
|
60
|
+
this.isDragging = true;
|
|
61
|
+
wrapper.setPointerCapture(e.pointerId);
|
|
62
|
+
}
|
|
63
|
+
if (this.isDragging) this.dragOffset = offset;
|
|
64
|
+
};
|
|
65
|
+
this.handlePointerUp = (e) => {
|
|
66
|
+
if (!this.pointerDown) return;
|
|
67
|
+
const elapsed = Date.now() - this.dragStartTime;
|
|
68
|
+
const absDrag = Math.abs(this.dragOffset);
|
|
69
|
+
if (this.isDragging && (absDrag > 20 || absDrag > 5 && elapsed < 300)) {
|
|
70
|
+
if (this.dragOffset < 0) this.next();
|
|
71
|
+
else this.prev();
|
|
72
|
+
this.addEventListener("click", this.handleClickCancel, {
|
|
73
|
+
capture: true,
|
|
74
|
+
once: true
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
if (this.isDragging) e.currentTarget.releasePointerCapture(e.pointerId);
|
|
78
|
+
this.pointerDown = false;
|
|
79
|
+
this.isDragging = false;
|
|
80
|
+
this.dragOffset = 0;
|
|
81
|
+
if (this.autoplay) this.startAutoplay();
|
|
82
|
+
};
|
|
83
|
+
this.handleClickCancel = (e) => {
|
|
84
|
+
e.preventDefault();
|
|
85
|
+
e.stopPropagation();
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
static {
|
|
89
|
+
this.styles = [super.styles, styles];
|
|
90
|
+
}
|
|
91
|
+
get perView() {
|
|
92
|
+
return Math.max(1, this.slidesPerView);
|
|
93
|
+
}
|
|
94
|
+
get perMove() {
|
|
95
|
+
return Math.max(1, this.slidesPerMove);
|
|
96
|
+
}
|
|
97
|
+
get maxIndex() {
|
|
98
|
+
return Math.max(0, this.slideCount - this.perView);
|
|
99
|
+
}
|
|
100
|
+
get pageCount() {
|
|
101
|
+
return this.maxIndex <= 0 ? 1 : Math.ceil(this.maxIndex / this.perMove) + 1;
|
|
102
|
+
}
|
|
103
|
+
get currentPage() {
|
|
104
|
+
return this.index >= this.maxIndex ? this.pageCount - 1 : Math.floor(this.index / this.perMove);
|
|
105
|
+
}
|
|
106
|
+
connectedCallback() {
|
|
107
|
+
super.connectedCallback();
|
|
108
|
+
if (this.autoplay) this.startAutoplay();
|
|
109
|
+
}
|
|
110
|
+
disconnectedCallback() {
|
|
111
|
+
this.stopAutoplay();
|
|
112
|
+
super.disconnectedCallback();
|
|
113
|
+
}
|
|
114
|
+
willUpdate(changedProperties) {
|
|
115
|
+
super.willUpdate(changedProperties);
|
|
116
|
+
if (changedProperties.has("slidesPerView")) this.style.setProperty("--slides-per-view", String(this.perView));
|
|
117
|
+
if (changedProperties.has("gap")) this.style.setProperty("--slide-gap", `${this.gap}px`);
|
|
118
|
+
}
|
|
119
|
+
updated(changedProperties) {
|
|
120
|
+
super.updated(changedProperties);
|
|
121
|
+
if (changedProperties.has("autoplay") || changedProperties.has("autoplayInterval")) if (this.autoplay) this.startAutoplay();
|
|
122
|
+
else this.stopAutoplay();
|
|
123
|
+
}
|
|
124
|
+
render() {
|
|
125
|
+
const pct = -(this.index * (100 / this.perView)) + this.dragOffset;
|
|
126
|
+
const gapPx = this.gap > 0 ? -(this.index * this.gap / this.perView) : 0;
|
|
127
|
+
const style = `transform: ${gapPx ? `translateX(calc(${pct}% + ${gapPx}px))` : `translateX(${pct}%)`}${this.isDragging ? "; transition: none" : ""}`;
|
|
128
|
+
return html`
|
|
129
|
+
<div class="slides-wrapper"
|
|
130
|
+
@dragstart=${this.handleDragStart}
|
|
131
|
+
@pointerdown=${this.draggable ? this.handlePointerDown : null}
|
|
132
|
+
@pointermove=${this.draggable ? this.handlePointerMove : null}
|
|
133
|
+
@pointerup=${this.draggable ? this.handlePointerUp : null}
|
|
134
|
+
@pointerleave=${this.draggable ? this.handlePointerUp : null}>
|
|
135
|
+
<div part="slides" class="slides" style="${style}">
|
|
136
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
2
139
|
|
|
3
|
-
|
|
140
|
+
<u-button part="prev-button" class="nav-button prev"
|
|
141
|
+
?hidden=${!this.navigation || !this.loop && this.index <= 0}
|
|
142
|
+
variant="ghost"
|
|
143
|
+
rounded
|
|
144
|
+
@click=${this.prev}>
|
|
145
|
+
<u-icon lib="internal" name="chevron-left"></u-icon>
|
|
146
|
+
</u-button>
|
|
147
|
+
<u-button part="next-button" class="nav-button next"
|
|
148
|
+
?hidden=${!this.navigation || !this.loop && this.index >= this.maxIndex}
|
|
149
|
+
variant="ghost"
|
|
150
|
+
rounded
|
|
151
|
+
@click=${this.next}>
|
|
152
|
+
<u-icon lib="internal" name="chevron-right"></u-icon>
|
|
153
|
+
</u-button>
|
|
4
154
|
|
|
155
|
+
<div part="indicator" class="indicator"
|
|
156
|
+
?hidden=${!this.pagination || this.pageCount <= 1}>
|
|
157
|
+
${Array.from({ length: this.pageCount }, (_, i) => html`
|
|
158
|
+
<button part="dot" class="dot"
|
|
159
|
+
?active=${i === this.currentPage}
|
|
160
|
+
@click=${() => this.goTo(Math.min(i * this.perMove, this.maxIndex))}>
|
|
161
|
+
</button>
|
|
162
|
+
`)}
|
|
163
|
+
</div>
|
|
164
|
+
`;
|
|
165
|
+
}
|
|
166
|
+
startAutoplay() {
|
|
167
|
+
this.stopAutoplay();
|
|
168
|
+
this.autoplayTimer = window.setInterval(() => {
|
|
169
|
+
this.next();
|
|
170
|
+
}, this.autoplayInterval);
|
|
171
|
+
}
|
|
172
|
+
stopAutoplay() {
|
|
173
|
+
if (this.autoplayTimer) {
|
|
174
|
+
clearInterval(this.autoplayTimer);
|
|
175
|
+
this.autoplayTimer = void 0;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
handleSlotChange(e) {
|
|
179
|
+
this.slideCount = e.target.assignedElements().length;
|
|
180
|
+
if (this.index >= this.slideCount) this.index = Math.max(0, this.slideCount - 1);
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
__decorate([property({
|
|
184
|
+
type: Boolean,
|
|
185
|
+
reflect: true
|
|
186
|
+
}), __decorateMetadata("design:type", Object)], UCarousel.prototype, "autoplay", void 0);
|
|
187
|
+
__decorate([property({
|
|
188
|
+
type: Number,
|
|
189
|
+
attribute: "autoplay-interval"
|
|
190
|
+
}), __decorateMetadata("design:type", Object)], UCarousel.prototype, "autoplayInterval", void 0);
|
|
191
|
+
__decorate([property({
|
|
192
|
+
type: Boolean,
|
|
193
|
+
reflect: true
|
|
194
|
+
}), __decorateMetadata("design:type", Object)], UCarousel.prototype, "loop", void 0);
|
|
195
|
+
__decorate([property({
|
|
196
|
+
type: Boolean,
|
|
197
|
+
reflect: true
|
|
198
|
+
}), __decorateMetadata("design:type", Object)], UCarousel.prototype, "navigation", void 0);
|
|
199
|
+
__decorate([property({
|
|
200
|
+
type: Boolean,
|
|
201
|
+
reflect: true
|
|
202
|
+
}), __decorateMetadata("design:type", Object)], UCarousel.prototype, "pagination", void 0);
|
|
203
|
+
__decorate([property({
|
|
204
|
+
type: Boolean,
|
|
205
|
+
reflect: true
|
|
206
|
+
}), __decorateMetadata("design:type", Object)], UCarousel.prototype, "draggable", void 0);
|
|
207
|
+
__decorate([property({
|
|
208
|
+
type: Number,
|
|
209
|
+
attribute: "slides-per-view"
|
|
210
|
+
}), __decorateMetadata("design:type", Object)], UCarousel.prototype, "slidesPerView", void 0);
|
|
211
|
+
__decorate([property({
|
|
212
|
+
type: Number,
|
|
213
|
+
attribute: "slides-per-move"
|
|
214
|
+
}), __decorateMetadata("design:type", Object)], UCarousel.prototype, "slidesPerMove", void 0);
|
|
215
|
+
__decorate([property({ type: Number }), __decorateMetadata("design:type", Object)], UCarousel.prototype, "gap", void 0);
|
|
216
|
+
__decorate([property({ type: Number }), __decorateMetadata("design:type", Object)], UCarousel.prototype, "index", void 0);
|
|
217
|
+
__decorate([state(), __decorateMetadata("design:type", Object)], UCarousel.prototype, "slideCount", void 0);
|
|
218
|
+
__decorate([state(), __decorateMetadata("design:type", Object)], UCarousel.prototype, "isDragging", void 0);
|
|
219
|
+
__decorate([state(), __decorateMetadata("design:type", Object)], UCarousel.prototype, "dragOffset", void 0);
|
|
220
|
+
UCarousel = __decorate([customElement("u-carousel")], UCarousel);
|
|
221
|
+
//#endregion
|
|
5
222
|
export { UCarousel };
|