@iyulab/components 0.4.0 → 1.0.1
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 +59 -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/{UJsonElement.d.ts → UDataElement.d.ts} +3 -5
- package/dist/components/UDataElement.js +101 -0
- package/dist/components/{UJsonElement.styles.js → UDataElement.styles.js} +4 -4
- package/dist/components/UElement.d.ts +18 -23
- package/dist/components/UElement.js +82 -95
- package/dist/components/UElement.styles.js +43 -4
- package/dist/components/UFloatingElement.d.ts +69 -48
- package/dist/components/UFloatingElement.js +236 -193
- package/dist/components/UFloatingElement.styles.d.ts +8 -0
- package/dist/components/UFloatingElement.styles.js +28 -5
- 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 +17 -17
- 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 +56 -4
- package/dist/components/icon/UIcon.styles.js +5 -6
- 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 +152 -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 +316 -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 +148 -0
- package/dist/components/textarea/UTextarea.styles.d.ts +1 -0
- package/dist/components/textarea/UTextarea.styles.js +164 -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 +37 -10
- package/dist/index.js +56 -52
- 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.js +62 -33
- package/dist/utilities/icons.d.ts +67 -0
- package/dist/utilities/icons.js +200 -0
- package/dist/utilities/sanitizers.js +64 -32
- package/package.json +26 -19
- 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-up.svg.js +0 -3
- 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/code-slash.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/download.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/sort-alpha-down.svg.js +0 -3
- package/dist/assets/icons/sort-alpha-up.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/UJsonElement.js +0 -93
- package/dist/components/UModalElement.d.ts +0 -70
- package/dist/components/UModalElement.js +0 -144
- package/dist/components/UModalElement.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 -78
- package/dist/components/carousel/UCarousel.component.js +0 -264
- 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 -134
- 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/{UJsonElement.styles.d.ts → UDataElement.styles.d.ts} +0 -0
- /package/dist/components/{UModalElement.styles.d.ts → UFormControlElement.styles.d.ts} +0 -0
|
@@ -1,43 +1,75 @@
|
|
|
1
|
+
//#region src/utilities/sanitizers.ts
|
|
2
|
+
/**
|
|
3
|
+
* HTML 출력 시 XSS 방지를 위한 escape 유틸
|
|
4
|
+
*
|
|
5
|
+
* 컨텍스트에 맞는 함수를 사용해야 합니다.
|
|
6
|
+
*
|
|
7
|
+
* - escapeHtmlText : HTML 텍스트 노드에 삽입할 때
|
|
8
|
+
* - escapeHtmlAttr : HTML attribute 값에 삽입할 때
|
|
9
|
+
* - escapeHtmlHref : href/src 같은 URL attribute에 삽입할 때
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Zero Width Space / LTR / RTL mark / BOM 등
|
|
13
|
+
* 화면에 표시되지 않는 유니코드 문자를 제거합니다.
|
|
14
|
+
*/
|
|
1
15
|
function stripZeroWidth(value) {
|
|
2
|
-
|
|
3
|
-
|
|
16
|
+
const ZERO_WIDTH_REGEX = /[\u200B\u200C\u200D\u200E\u200F\uFEFF]/g;
|
|
17
|
+
return ZERO_WIDTH_REGEX.test(value) ? value.replace(ZERO_WIDTH_REGEX, "") : value;
|
|
4
18
|
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
19
|
+
/** HTML text context escape 대상 문자 */
|
|
20
|
+
var HTML_TEXT_ESCAPE_REGEX = /[&<>"']/g;
|
|
21
|
+
/** HTML text context escape용 문자 매핑 */
|
|
22
|
+
var HTML_TEXT_ESCAPE_MAP = {
|
|
23
|
+
"&": "&",
|
|
24
|
+
"<": "<",
|
|
25
|
+
">": ">",
|
|
26
|
+
"\"": """,
|
|
27
|
+
"'": "'"
|
|
12
28
|
};
|
|
29
|
+
/**
|
|
30
|
+
* HTML 텍스트 노드(context)에 삽입할 문자열을 escape합니다.
|
|
31
|
+
*
|
|
32
|
+
* 예:
|
|
33
|
+
* <script> → <script>
|
|
34
|
+
*/
|
|
13
35
|
function escapeHtmlText(value) {
|
|
14
|
-
|
|
36
|
+
return HTML_TEXT_ESCAPE_REGEX.test(value) ? value.replace(HTML_TEXT_ESCAPE_REGEX, (ch) => HTML_TEXT_ESCAPE_MAP[ch]) : value;
|
|
15
37
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
38
|
+
/** HTML attribute escape 대상 문자 */
|
|
39
|
+
var HTML_ATTR_ESCAPE_REGEX = /[&<>"]/g;
|
|
40
|
+
/** HTML attribute escape용 문자 매핑 */
|
|
41
|
+
var HTML_ATTR_ESCAPE_MAP = {
|
|
42
|
+
"&": "&",
|
|
43
|
+
"<": "<",
|
|
44
|
+
">": ">",
|
|
45
|
+
"\"": """
|
|
22
46
|
};
|
|
47
|
+
/**
|
|
48
|
+
* HTML attribute 값(context)에 삽입할 문자열을 escape합니다.
|
|
49
|
+
*
|
|
50
|
+
* 예:
|
|
51
|
+
* <div title="{value}">
|
|
52
|
+
*/
|
|
23
53
|
function escapeHtmlAttr(value) {
|
|
24
|
-
|
|
54
|
+
return HTML_ATTR_ESCAPE_REGEX.test(value) ? value.replace(HTML_ATTR_ESCAPE_REGEX, (ch) => HTML_ATTR_ESCAPE_MAP[ch]) : value;
|
|
25
55
|
}
|
|
26
|
-
|
|
27
|
-
|
|
56
|
+
/** protocol 우회 공격 방지를 위한 공백/제어문자 제거 */
|
|
57
|
+
var HREF_STRIP_CHARS_REGEX = /[\u0000-\u001F\u007F\s]+/g;
|
|
58
|
+
/** href/src에서 차단해야 하는 위험 protocol */
|
|
59
|
+
var HREF_UNSAFE_PROTOCOL_REGEX = /^(?:javascript|data|vbscript):/i;
|
|
60
|
+
/**
|
|
61
|
+
* href / src attribute용 문자열 처리
|
|
62
|
+
*
|
|
63
|
+
* 예:
|
|
64
|
+
* <a href="{value}">
|
|
65
|
+
*/
|
|
28
66
|
function escapeHtmlHref(value) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return "#";
|
|
36
|
-
}
|
|
37
|
-
if (HREF_UNSAFE_PROTOCOL_REGEX.test(normalized)) {
|
|
38
|
-
return "#";
|
|
39
|
-
}
|
|
40
|
-
return escapeHtmlAttr(normalized);
|
|
67
|
+
let normalized = stripZeroWidth(value).trim();
|
|
68
|
+
if (HREF_STRIP_CHARS_REGEX.test(normalized)) normalized = normalized.replace(HREF_STRIP_CHARS_REGEX, "");
|
|
69
|
+
normalized = normalized.replace(/\\/g, "/");
|
|
70
|
+
if (normalized.startsWith("//")) return "#";
|
|
71
|
+
if (HREF_UNSAFE_PROTOCOL_REGEX.test(normalized)) return "#";
|
|
72
|
+
return escapeHtmlAttr(normalized);
|
|
41
73
|
}
|
|
42
|
-
|
|
74
|
+
//#endregion
|
|
43
75
|
export { escapeHtmlAttr, escapeHtmlHref, escapeHtmlText, stripZeroWidth };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iyulab/components",
|
|
3
3
|
"description": "web-components library based on lit-element made by iyulab",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"iyulab",
|
|
7
7
|
"components",
|
|
@@ -17,6 +17,9 @@
|
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
19
19
|
"dist",
|
|
20
|
+
"plugins/**/*.js",
|
|
21
|
+
"plugins/**/*.d.ts",
|
|
22
|
+
"skills",
|
|
20
23
|
"LICENSE",
|
|
21
24
|
"README.md",
|
|
22
25
|
"CHANGELOG.md",
|
|
@@ -29,42 +32,46 @@
|
|
|
29
32
|
"types": "./dist/index.d.ts",
|
|
30
33
|
"import": "./dist/index.js"
|
|
31
34
|
},
|
|
32
|
-
"./dist/*":
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
"./dist/*": "./dist/*",
|
|
36
|
+
"./react": "./dist/react/index.js",
|
|
37
|
+
"./react/*": "./dist/react/*",
|
|
38
|
+
"./styles/*": "./dist/styles/*",
|
|
39
|
+
"./plugins/*": "./plugins/*"
|
|
36
40
|
},
|
|
37
41
|
"scripts": {
|
|
38
42
|
"test": "vite --force",
|
|
39
|
-
"build": "
|
|
43
|
+
"build:plugins": "tsc -p plugins/tsconfig.json",
|
|
44
|
+
"build": "eslint && vite build && npm run build:plugins"
|
|
40
45
|
},
|
|
41
46
|
"dependencies": {
|
|
42
|
-
"@floating-ui/dom": "^1.7.
|
|
43
|
-
"
|
|
44
|
-
"
|
|
47
|
+
"@floating-ui/dom": "^1.7.6",
|
|
48
|
+
"focus-trap": "^8.0.1",
|
|
49
|
+
"lit": "^3.3.2"
|
|
45
50
|
},
|
|
46
51
|
"peerDependencies": {
|
|
47
|
-
"@lit/react": ">=1.0.
|
|
52
|
+
"@lit/react": ">=1.0.8",
|
|
48
53
|
"react": ">=18.0.0"
|
|
49
54
|
},
|
|
50
55
|
"peerDependenciesMeta": {
|
|
51
|
-
"react": {
|
|
56
|
+
"@lit/react": {
|
|
52
57
|
"optional": true
|
|
53
58
|
},
|
|
54
|
-
"
|
|
59
|
+
"react": {
|
|
55
60
|
"optional": true
|
|
56
61
|
}
|
|
57
62
|
},
|
|
58
63
|
"devDependencies": {
|
|
59
|
-
"@eslint/js": "^9.39.
|
|
60
|
-
"@types/node": "^25.
|
|
61
|
-
"eslint": "^9.39.
|
|
64
|
+
"@eslint/js": "^9.39.4",
|
|
65
|
+
"@types/node": "^25.5.0",
|
|
66
|
+
"eslint": "^9.39.4",
|
|
62
67
|
"eslint-plugin-lit": "^2.2.1",
|
|
63
|
-
"
|
|
68
|
+
"glob": "^13.0.6",
|
|
69
|
+
"globals": "^17.4.0",
|
|
70
|
+
"react": "^19.2.4",
|
|
64
71
|
"typescript": "^5.9.3",
|
|
65
|
-
"typescript-eslint": "^8.
|
|
66
|
-
"vite": "^
|
|
72
|
+
"typescript-eslint": "^8.57.2",
|
|
73
|
+
"vite": "^8.0.3",
|
|
67
74
|
"vite-plugin-dts": "^4.5.4",
|
|
68
|
-
"vite-plugin-static-copy": "^
|
|
75
|
+
"vite-plugin-static-copy": "^4.0.0"
|
|
69
76
|
}
|
|
70
77
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Plugin } from 'vite';
|
|
2
|
+
/**
|
|
3
|
+
* Rolldown의 preserveModules 모드에서 import.meta.glob의 query 옵션 사용 시
|
|
4
|
+
* 빈 export가 생성되는 문제를 해결하는 플러그인.
|
|
5
|
+
*
|
|
6
|
+
* - `?raw`: 파일 내용을 문자열로 반환
|
|
7
|
+
* - `?inline`: 파일 내용을 문자열로 반환
|
|
8
|
+
* - `?url`: 파일을 asset으로 emit하고 URL을 반환
|
|
9
|
+
*
|
|
10
|
+
* 가상 모듈(\0 prefix)로 변환하여 파일명에 `?`가 포함되는 것을 방지합니다.
|
|
11
|
+
*/
|
|
12
|
+
export default function globResolve(): Plugin;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { readFileSync } from 'fs';
|
|
2
|
+
import { resolve, dirname, basename } from 'path';
|
|
3
|
+
import { createHash } from 'crypto';
|
|
4
|
+
const VIRTUAL_PREFIX = '\0glob-assets';
|
|
5
|
+
const SUPPORTED_QUERIES = ['?raw', '?inline', '?url'];
|
|
6
|
+
function shortHash(input) {
|
|
7
|
+
return createHash('md5').update(input).digest('hex').slice(0, 8);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Rolldown의 preserveModules 모드에서 import.meta.glob의 query 옵션 사용 시
|
|
11
|
+
* 빈 export가 생성되는 문제를 해결하는 플러그인.
|
|
12
|
+
*
|
|
13
|
+
* - `?raw`: 파일 내용을 문자열로 반환
|
|
14
|
+
* - `?inline`: 파일 내용을 문자열로 반환
|
|
15
|
+
* - `?url`: 파일을 asset으로 emit하고 URL을 반환
|
|
16
|
+
*
|
|
17
|
+
* 가상 모듈(\0 prefix)로 변환하여 파일명에 `?`가 포함되는 것을 방지합니다.
|
|
18
|
+
*/
|
|
19
|
+
export default function globResolve() {
|
|
20
|
+
const idToAbsPath = new Map();
|
|
21
|
+
return {
|
|
22
|
+
name: 'vite:glob-resolve',
|
|
23
|
+
enforce: 'pre',
|
|
24
|
+
resolveId(source, importer) {
|
|
25
|
+
for (const query of SUPPORTED_QUERIES) {
|
|
26
|
+
if (source.endsWith(query)) {
|
|
27
|
+
const rawPath = source.slice(0, -query.length);
|
|
28
|
+
const absPath = importer
|
|
29
|
+
? resolve(dirname(importer), rawPath)
|
|
30
|
+
: rawPath;
|
|
31
|
+
const name = basename(absPath);
|
|
32
|
+
const hash = shortHash(absPath);
|
|
33
|
+
const queryName = query.slice(1);
|
|
34
|
+
const virtualId = `${VIRTUAL_PREFIX}_${queryName}/${name}.${hash}`;
|
|
35
|
+
idToAbsPath.set(virtualId, absPath);
|
|
36
|
+
return virtualId;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return null;
|
|
40
|
+
},
|
|
41
|
+
load(id) {
|
|
42
|
+
if (!id.startsWith(VIRTUAL_PREFIX))
|
|
43
|
+
return null;
|
|
44
|
+
const absPath = idToAbsPath.get(id);
|
|
45
|
+
if (!absPath)
|
|
46
|
+
return null;
|
|
47
|
+
// virtualId에서 queryName 추출: "\0glob-assets_{queryName}/..."
|
|
48
|
+
const queryName = id.slice(VIRTUAL_PREFIX.length + 1).split('/')[0];
|
|
49
|
+
if (queryName === 'raw' || queryName === 'inline') {
|
|
50
|
+
const content = readFileSync(absPath, 'utf-8');
|
|
51
|
+
return `export default ${JSON.stringify(content)};`;
|
|
52
|
+
}
|
|
53
|
+
if (queryName === 'url') {
|
|
54
|
+
const source = readFileSync(absPath);
|
|
55
|
+
const fileName = basename(absPath);
|
|
56
|
+
const ref = this.emitFile({
|
|
57
|
+
type: 'asset',
|
|
58
|
+
name: fileName,
|
|
59
|
+
source,
|
|
60
|
+
});
|
|
61
|
+
return `export default import.meta.ROLLUP_FILE_URL_${ref};`;
|
|
62
|
+
}
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Plugin } from 'vite';
|
|
2
|
+
interface PluginOptions {
|
|
3
|
+
/** 컴포넌트 소스 디렉토리 경로 (기본값: 'src/components') */
|
|
4
|
+
input?: string;
|
|
5
|
+
/** React 래퍼 출력 폴더 - 빌드 outDir 기준 상대 경로 (기본값: 'react') */
|
|
6
|
+
output?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Lit Element 컴포넌트를 React 래퍼로 자동 생성하는 Vite 플러그인
|
|
10
|
+
*/
|
|
11
|
+
export default function reactWrapperPlugin(options: PluginOptions): Plugin;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { resolve, join, relative, dirname, basename } from 'path';
|
|
2
|
+
import { readFileSync, writeFileSync, mkdirSync } from 'fs';
|
|
3
|
+
import { gzipSync } from 'zlib';
|
|
4
|
+
import { globSync } from 'glob';
|
|
5
|
+
/**
|
|
6
|
+
* Lit Element 컴포넌트를 React 래퍼로 자동 생성하는 Vite 플러그인
|
|
7
|
+
*/
|
|
8
|
+
export default function reactWrapperPlugin(options) {
|
|
9
|
+
let rootDir;
|
|
10
|
+
let buildOutDir;
|
|
11
|
+
let outDir;
|
|
12
|
+
return {
|
|
13
|
+
name: 'vite-plugin-react-wrapper',
|
|
14
|
+
configResolved(config) {
|
|
15
|
+
rootDir = config.root;
|
|
16
|
+
buildOutDir = resolve(rootDir, config.build.outDir);
|
|
17
|
+
outDir = resolve(buildOutDir, options.output || 'react');
|
|
18
|
+
},
|
|
19
|
+
closeBundle() {
|
|
20
|
+
const log = (msg) => console.log(`\x1b[36m[react-wrapper]\x1b[0m ${msg}`);
|
|
21
|
+
log('Generating React wrappers...');
|
|
22
|
+
// 컴포넌트 수집
|
|
23
|
+
const inputPattern = (options.input || 'src/components') + '/**/*.ts';
|
|
24
|
+
const files = globSync(inputPattern, { cwd: rootDir, absolute: true });
|
|
25
|
+
const components = files.flatMap((f) => parseComponent(f));
|
|
26
|
+
if (components.length === 0) {
|
|
27
|
+
log('No components found.');
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
// 출력 디렉토리 생성
|
|
31
|
+
mkdirSync(outDir, { recursive: true });
|
|
32
|
+
// 래퍼 생성
|
|
33
|
+
const generated = [];
|
|
34
|
+
for (const comp of components) {
|
|
35
|
+
generated.push(...writeWrapper(comp, outDir, buildOutDir));
|
|
36
|
+
}
|
|
37
|
+
generated.push(...writeIndex(components, outDir, buildOutDir));
|
|
38
|
+
// 결과 출력
|
|
39
|
+
generated.sort((a, b) => a.size - b.size);
|
|
40
|
+
for (const f of generated) {
|
|
41
|
+
const kb = (f.size / 1024).toFixed(2);
|
|
42
|
+
const gzKb = (f.gzipSize / 1024).toFixed(2);
|
|
43
|
+
const pad = ' '.repeat(Math.max(0, 50 - f.path.length));
|
|
44
|
+
console.log(`${f.path}${pad}${kb.padStart(6)} kB │ gzip: ${gzKb.padStart(6)} kB`);
|
|
45
|
+
}
|
|
46
|
+
log(`Generated ${components.length} React wrappers.`);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
// --- 컴포넌트 파싱 ---
|
|
51
|
+
function parseComponent(filePath) {
|
|
52
|
+
const content = readFileSync(filePath, 'utf-8');
|
|
53
|
+
// @customElement('tag-name') 데코레이터 확인
|
|
54
|
+
const tagMatch = content.match(/@customElement\s*\(\s*['"]([^'"]+)['"]\s*\)/);
|
|
55
|
+
if (!tagMatch)
|
|
56
|
+
return [];
|
|
57
|
+
// export class ClassName 추출
|
|
58
|
+
const classMatch = content.match(/export\s+class\s+(\w+)/);
|
|
59
|
+
if (!classMatch)
|
|
60
|
+
return [];
|
|
61
|
+
const events = collectEvents(content);
|
|
62
|
+
return [{
|
|
63
|
+
className: classMatch[1],
|
|
64
|
+
tagName: tagMatch[1],
|
|
65
|
+
filePath,
|
|
66
|
+
events,
|
|
67
|
+
}];
|
|
68
|
+
}
|
|
69
|
+
function collectEvents(content) {
|
|
70
|
+
// import 구문에서 타입명 → 소스 경로 매핑 수집
|
|
71
|
+
// 예: import { ShowEventDetail } from '../../events/ShowEvent.js';
|
|
72
|
+
const typeImportMap = new Map();
|
|
73
|
+
for (const m of content.matchAll(/import\s+\{([^}]+)\}\s+from\s+['"]([^'"]+)['"]/g)) {
|
|
74
|
+
const importPath = m[2];
|
|
75
|
+
for (const name of m[1].split(',')) {
|
|
76
|
+
const typeName = name.replace(/type\s+/, '').trim();
|
|
77
|
+
if (typeName)
|
|
78
|
+
typeImportMap.set(typeName, importPath);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const eventMap = new Map();
|
|
82
|
+
// JSDoc @event 패턴: @event eventName
|
|
83
|
+
for (const m of content.matchAll(/@event\s+([\w-]+)/g)) {
|
|
84
|
+
if (!eventMap.has(m[1]))
|
|
85
|
+
eventMap.set(m[1], { detailType: 'unknown', importPath: '' });
|
|
86
|
+
}
|
|
87
|
+
// this.fire<DetailType>('eventName') 패턴 - 제네릭 타입 추출
|
|
88
|
+
for (const m of content.matchAll(/this\.fire\s*(?:<([^>]+)>)?\s*\(\s*['"]([\w-]+)['"]/g)) {
|
|
89
|
+
const detailType = m[1] || 'unknown';
|
|
90
|
+
const importPath = typeImportMap.get(detailType) || '';
|
|
91
|
+
eventMap.set(m[2], { detailType, importPath });
|
|
92
|
+
}
|
|
93
|
+
return Array.from(eventMap, ([name, { detailType, importPath }]) => ({
|
|
94
|
+
name,
|
|
95
|
+
reactName: toCamelEvent(name),
|
|
96
|
+
detailType,
|
|
97
|
+
importPath,
|
|
98
|
+
}));
|
|
99
|
+
}
|
|
100
|
+
/** kebab-case 이벤트명을 onCamelCase로 변환 (예: shift-start → onShiftStart) */
|
|
101
|
+
function toCamelEvent(name) {
|
|
102
|
+
return 'on' + name.split('-').map(s => s.charAt(0).toUpperCase() + s.slice(1)).join('');
|
|
103
|
+
}
|
|
104
|
+
function writeFile(filePath, content, buildOutDir) {
|
|
105
|
+
writeFileSync(filePath, content, 'utf-8');
|
|
106
|
+
return {
|
|
107
|
+
path: relative(buildOutDir, filePath).replace(/\\/g, '/'),
|
|
108
|
+
size: Buffer.byteLength(content, 'utf-8'),
|
|
109
|
+
gzipSize: gzipSync(content).length,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function computeImportPath(from, to) {
|
|
113
|
+
let rel = relative(dirname(from), to).replace(/\\/g, '/').replace(/\.ts$/, '');
|
|
114
|
+
if (!rel.startsWith('.'))
|
|
115
|
+
rel = './' + rel;
|
|
116
|
+
return rel;
|
|
117
|
+
}
|
|
118
|
+
function writeWrapper(comp, outDir, buildOutDir) {
|
|
119
|
+
const { className, tagName, events } = comp;
|
|
120
|
+
const jsPath = join(outDir, `${className}.js`);
|
|
121
|
+
const dtsPath = join(outDir, `${className}.d.ts`);
|
|
122
|
+
// 소스 파일의 빌드 출력 경로 추정 (src/ → 빌드 outDir 매핑)
|
|
123
|
+
const srcIndex = comp.filePath.replace(/\\/g, '/').indexOf('/src/');
|
|
124
|
+
const relFromSrc = srcIndex >= 0
|
|
125
|
+
? comp.filePath.substring(srcIndex + 5).replace(/\\/g, '/').replace(/\.ts$/, '')
|
|
126
|
+
: basename(comp.filePath, '.ts');
|
|
127
|
+
const builtModulePath = resolve(buildOutDir, relFromSrc + '.js');
|
|
128
|
+
const importPath = computeImportPath(jsPath, builtModulePath);
|
|
129
|
+
// events 객체 생성
|
|
130
|
+
const eventsObj = events.length > 0
|
|
131
|
+
? `{\n${events.map(e => ` ${e.reactName}: '${e.name}',`).join('\n')}\n }`
|
|
132
|
+
: '{}';
|
|
133
|
+
// .js
|
|
134
|
+
const js = `import React from 'react';
|
|
135
|
+
import { createComponent } from '@lit/react';
|
|
136
|
+
import { ${className} } from '${importPath}';
|
|
137
|
+
|
|
138
|
+
export const ${className} = createComponent({
|
|
139
|
+
react: React,
|
|
140
|
+
tagName: '${tagName}',
|
|
141
|
+
elementClass: ${className},
|
|
142
|
+
events: ${eventsObj},
|
|
143
|
+
});
|
|
144
|
+
`;
|
|
145
|
+
// .d.ts - import 구문 생성
|
|
146
|
+
const dtsImportPath = importPath.replace(/\.js$/, '');
|
|
147
|
+
const dtsImports = [
|
|
148
|
+
`import React from 'react';`,
|
|
149
|
+
`import { ${className} as ${className}Element } from '${dtsImportPath}';`,
|
|
150
|
+
];
|
|
151
|
+
// 이벤트 detail 타입별 import - 소스 원본 경로 기준으로 빌드 경로 계산
|
|
152
|
+
const srcDir = dirname(comp.filePath);
|
|
153
|
+
const detailImportMap = new Map(); // 빌드경로 → [타입명]
|
|
154
|
+
for (const e of events) {
|
|
155
|
+
if (e.detailType === 'unknown' || !e.importPath)
|
|
156
|
+
continue;
|
|
157
|
+
// 소스 상대경로를 절대경로로 변환 후 빌드 경로 계산
|
|
158
|
+
const absEventSrc = resolve(srcDir, e.importPath).replace(/\\/g, '/');
|
|
159
|
+
const eventSrcIndex = absEventSrc.indexOf('/src/');
|
|
160
|
+
const relFromSrc = eventSrcIndex >= 0
|
|
161
|
+
? absEventSrc.substring(eventSrcIndex + 5).replace(/\.js$/, '')
|
|
162
|
+
: '';
|
|
163
|
+
if (!relFromSrc)
|
|
164
|
+
continue;
|
|
165
|
+
const absEventBuilt = resolve(buildOutDir, relFromSrc);
|
|
166
|
+
const eventImportPath = computeImportPath(dtsPath, absEventBuilt + '.js').replace(/\.js$/, '');
|
|
167
|
+
const types = detailImportMap.get(eventImportPath) || [];
|
|
168
|
+
if (!types.includes(e.detailType))
|
|
169
|
+
types.push(e.detailType);
|
|
170
|
+
detailImportMap.set(eventImportPath, types);
|
|
171
|
+
}
|
|
172
|
+
for (const [path, types] of detailImportMap) {
|
|
173
|
+
dtsImports.push(`import { type ${types.join(', type ')} } from '${path}';`);
|
|
174
|
+
}
|
|
175
|
+
const eventTypes = events.length > 0
|
|
176
|
+
? events.map(e => {
|
|
177
|
+
const type = e.detailType !== 'unknown' ? `CustomEvent<${e.detailType}>` : 'CustomEvent';
|
|
178
|
+
return ` ${e.reactName}?: (event: ${type}) => void;`;
|
|
179
|
+
}).join('\n') + '\n'
|
|
180
|
+
: '';
|
|
181
|
+
const dts = `${dtsImports.join('\n')}
|
|
182
|
+
|
|
183
|
+
export declare const ${className}: React.ForwardRefExoticComponent<
|
|
184
|
+
Partial<${className}Element> & React.HTMLAttributes<${className}Element> & {
|
|
185
|
+
${eventTypes} }
|
|
186
|
+
>;
|
|
187
|
+
|
|
188
|
+
export type ${className}Props = React.ComponentProps<typeof ${className}>;
|
|
189
|
+
`;
|
|
190
|
+
return [
|
|
191
|
+
writeFile(jsPath, js, buildOutDir),
|
|
192
|
+
writeFile(dtsPath, dts, buildOutDir),
|
|
193
|
+
];
|
|
194
|
+
}
|
|
195
|
+
function writeIndex(components, outDir, buildOutDir) {
|
|
196
|
+
const jsExports = components
|
|
197
|
+
.map(c => `export { ${c.className} } from './${c.className}.js';`)
|
|
198
|
+
.join('\n');
|
|
199
|
+
const dtsExports = components
|
|
200
|
+
.map(c => `export { ${c.className}, ${c.className}Props } from './${c.className}';`)
|
|
201
|
+
.join('\n');
|
|
202
|
+
return [
|
|
203
|
+
writeFile(join(outDir, 'index.js'), jsExports + '\n', buildOutDir),
|
|
204
|
+
writeFile(join(outDir, 'index.d.ts'), dtsExports + '\n', buildOutDir),
|
|
205
|
+
];
|
|
206
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: iyulab-components
|
|
3
|
+
description: Web component library built on Lit. Covers all u-* custom elements (buttons, forms, overlays, navigation, data display), utilities (Theme, Toast, Dialog, icons), and base classes for extension. Use when working with @iyulab/components package.
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
author: iyulab
|
|
7
|
+
version: "1.0.1"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# @iyulab/components
|
|
11
|
+
|
|
12
|
+
Web component library built on [Lit](https://lit.dev/). All components are custom elements (`u-*` tags) that work in any framework or vanilla HTML.
|
|
13
|
+
|
|
14
|
+
## Quick Start
|
|
15
|
+
|
|
16
|
+
Install the package:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install @iyulab/components
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Initialize theme and import all components:
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { Theme } from '@iyulab/components';
|
|
26
|
+
import '@iyulab/components'; // registers all u-* custom elements
|
|
27
|
+
|
|
28
|
+
await Theme.init(); // optional — applies system/light/dark theme
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Import individual components (tree-shakable):
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
import '@iyulab/components/dist/components/button/UButton.js';
|
|
35
|
+
import '@iyulab/components/dist/components/input/UInput.js';
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
React wrappers (requires `@lit/react`):
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
import { UButton, UInput } from '@iyulab/components/react';
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
> For detailed guidance on theming, icon setup, and advanced usage, see [./references/usage.md](./references/usage.md).
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Components
|
|
49
|
+
|
|
50
|
+
### Feedback
|
|
51
|
+
|
|
52
|
+
- [`u-alert`](./references/components/alert.md) — Closable message banner with status variants and auto-dismiss
|
|
53
|
+
- [`u-spinner`](./references/components/spinner.md) — Animated loading indicator
|
|
54
|
+
- [`u-skeleton`](./references/components/skeleton.md) — Placeholder shape shown while content loads
|
|
55
|
+
- [`u-progress-bar`](./references/components/progress-bar.md) — Linear progress indicator with buffer and segment support
|
|
56
|
+
- [`u-progress-ring`](./references/components/progress-ring.md) — Circular progress indicator
|
|
57
|
+
|
|
58
|
+
### Buttons & Actions
|
|
59
|
+
|
|
60
|
+
- [`u-button`](./references/components/button.md) — Versatile button with multiple variants; renders as `<a>` when `href` is set
|
|
61
|
+
- [`u-icon-button`](./references/components/icon-button.md) — Square icon-only button with built-in tooltip
|
|
62
|
+
- [`u-button-group`](./references/components/button-group.md) — Groups buttons with shared variant and disabled state
|
|
63
|
+
|
|
64
|
+
### Form Controls
|
|
65
|
+
|
|
66
|
+
- [`u-input`](./references/components/input.md) — Text input; combobox mode when `u-option` children are present
|
|
67
|
+
- [`u-textarea`](./references/components/textarea.md) — Multi-line text input with auto-resize and character counter
|
|
68
|
+
- [`u-select`](./references/components/select.md) — Dropdown select; single or multiple, with search
|
|
69
|
+
- [`u-checkbox`](./references/components/checkbox.md) — Checkbox with indeterminate state support
|
|
70
|
+
- [`u-radio`](./references/components/radio.md) — Radio group built from `u-option` children
|
|
71
|
+
- [`u-switch`](./references/components/switch.md) — Toggle switch
|
|
72
|
+
- [`u-slider`](./references/components/slider.md) — Range slider; single-thumb or dual-thumb (range) mode
|
|
73
|
+
- [`u-rating`](./references/components/rating.md) — Star/custom-symbol rating input
|
|
74
|
+
- [`u-field`](./references/components/field.md) — Layout wrapper providing label, description, and validation message
|
|
75
|
+
- [`u-form`](./references/components/form.md) — Form group with two-way model binding and validation
|
|
76
|
+
- [`u-option`](./references/components/option.md) — Selectable option item for `u-select`, `u-radio`, `u-input`
|
|
77
|
+
|
|
78
|
+
### Overlay & Floating
|
|
79
|
+
|
|
80
|
+
- [`u-dialog`](./references/components/dialog.md) — Modal/non-modal dialog with configurable placement
|
|
81
|
+
- [`u-drawer`](./references/components/drawer.md) — Side-panel that slides in from any edge
|
|
82
|
+
- [`u-popover`](./references/components/popover.md) — Anchored floating panel with flexible trigger/dismiss policies
|
|
83
|
+
- [`u-tooltip`](./references/components/tooltip.md) — Hover/focus tooltip anchored to a target element
|
|
84
|
+
|
|
85
|
+
### Navigation
|
|
86
|
+
|
|
87
|
+
- [`u-breadcrumb`](./references/components/breadcrumb.md) — Hierarchical location indicator
|
|
88
|
+
- [`u-breadcrumb-item`](./references/components/breadcrumb.md) — Individual breadcrumb link/label
|
|
89
|
+
- [`u-menu`](./references/components/menu.md) — Menu container with keyboard navigation and selection modes
|
|
90
|
+
- [`u-menu-item`](./references/components/menu.md) — Menu entry with optional sub-menu
|
|
91
|
+
- [`u-tab-panel`](./references/components/tab-panel.md) — Tab-based content switcher
|
|
92
|
+
- [`u-tab`](./references/components/tab-panel.md) — Individual tab button used inside `u-tab-panel`
|
|
93
|
+
- [`u-tree`](./references/components/tree.md) — Hierarchical tree with select, check, and drag-and-drop
|
|
94
|
+
- [`u-tree-item`](./references/components/tree.md) — Individual node inside `u-tree`
|
|
95
|
+
|
|
96
|
+
### Layout & Display
|
|
97
|
+
|
|
98
|
+
- [`u-card`](./references/components/card.md) — Content card with media, header, and footer slots
|
|
99
|
+
- [`u-carousel`](./references/components/carousel.md) — Slide carousel with autoplay, navigation, and pagination
|
|
100
|
+
- [`u-split-panel`](./references/components/split-panel.md) — Resizable two-panel layout
|
|
101
|
+
- [`u-panel`](./references/components/panel.md) — General-purpose content panel with optional collapsing
|
|
102
|
+
- [`u-divider`](./references/components/divider.md) — Horizontal or vertical separator line
|
|
103
|
+
|
|
104
|
+
### Data Display
|
|
105
|
+
|
|
106
|
+
- [`u-avatar`](./references/components/avatar.md) — User avatar with image, initials, or custom slot
|
|
107
|
+
- [`u-badge`](./references/components/badge.md) — Status badge; can be anchored on top of other elements
|
|
108
|
+
- [`u-chip`](./references/components/chip.md) — Selectable/removable chip tag
|
|
109
|
+
- [`u-tag`](./references/components/tag.md) — Non-interactive label tag
|
|
110
|
+
- [`u-icon`](./references/components/icon.md) — SVG icon from built-in or external icon library
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Utilities
|
|
115
|
+
|
|
116
|
+
- [`Theme`](./references/utilities/theme.md) — Apply and manage light/dark/system theme
|
|
117
|
+
- [`Toast`](./references/utilities/toast.md) — Programmatically show toast notifications
|
|
118
|
+
- [`Dialog`](./references/utilities/dialog.md) — Programmatically show alert/confirm/prompt dialogs
|
|
119
|
+
- [`IconRegistry`](./references/utilities/icons.md) — Register and resolve icon libraries
|
|
120
|
+
- [`BrowserStorage`](./references/utilities/browser-storage.md) — Unified localStorage / Cookie API
|
|
121
|
+
- [`converters`](./references/utilities/converters.md) — Lit property attribute converters (array, JSON, date, url…)
|
|
122
|
+
- [`sanitizers`](./references/utilities/sanitizers.md) — XSS-safe HTML/URL escape helpers
|
|
123
|
+
- [`elements`](./references/utilities/elements.md) — Shadow-DOM-aware DOM query helpers
|
|
124
|
+
- [`OverlayManager`](./references/utilities/overlay-manager.md) — Internal overlay stack and z-index manager
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Extensions
|
|
129
|
+
|
|
130
|
+
`@iyulab/components` exposes abstract base classes you can extend to build custom components that integrate seamlessly with the library's patterns (form association, overlays, floating positioning, etc.).
|
|
131
|
+
|
|
132
|
+
> See [./references/extensions/](./references/extensions/) for per-class details.
|
|
133
|
+
|
|
134
|
+
- [`UElement`](./references/extensions/element.md) — Root base for all components; provides `fire()`, `relay()`, `replace()` helpers
|
|
135
|
+
- [`UFormControlElement<T>`](./references/extensions/form-control.md) — Base for form-associated controls; handles `disabled`, `readonly`, `invalid`, validation lifecycle
|
|
136
|
+
- [`UFloatingElement`](./references/extensions/floating.md) — Base for anchored floating UI (popover, tooltip); wraps `@floating-ui/dom`
|
|
137
|
+
- [`UOverlayElement`](./references/extensions/overlay.md) — Base for full-screen overlays (dialog, drawer); manages focus-trap, scroll-lock, ESC/backdrop close
|
|
138
|
+
- [`UDataElement`](./references/extensions/data.md) — Base for data-driven components; auto-loads JSON from inline `<script type="application/json">`
|