kigumi 0.2.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/README.md +407 -0
- package/dist/chunk-FG4CIVPT.js +52 -0
- package/dist/chunk-IRCCX2A2.js +72 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6119 -0
- package/dist/path-aliases-3OJ2RKTE.js +95 -0
- package/dist/path-aliases-44XMTAAA.js +89 -0
- package/dist/path-aliases-CNBMGBKE.js +98 -0
- package/dist/path-aliases-L6USUZ4R.js +91 -0
- package/dist/path-aliases-NX2TDEHO.js +92 -0
- package/dist/path-aliases-ZRNAAXX2.js +94 -0
- package/dist/project-config-3XEQHIUM.js +115 -0
- package/dist/project-config-4YGWM3KJ.js +92 -0
- package/dist/project-config-YLUSQM7U.js +108 -0
- package/dist/templates/AGENTS.md +214 -0
- package/dist/templates/react/AnimatedImage/AnimatedImage.css.hbs +19 -0
- package/dist/templates/react/AnimatedImage/AnimatedImage.jsx.hbs +64 -0
- package/dist/templates/react/AnimatedImage/AnimatedImage.test.jsx.hbs +29 -0
- package/dist/templates/react/AnimatedImage/AnimatedImage.test.tsx.hbs +14 -0
- package/dist/templates/react/AnimatedImage/AnimatedImage.tsx.hbs +68 -0
- package/dist/templates/react/Animation/Animation.css.hbs +18 -0
- package/dist/templates/react/Animation/Animation.jsx.hbs +100 -0
- package/dist/templates/react/Animation/Animation.test.jsx.hbs +37 -0
- package/dist/templates/react/Animation/Animation.test.tsx.hbs +14 -0
- package/dist/templates/react/Animation/Animation.tsx.hbs +127 -0
- package/dist/templates/react/Avatar/Avatar.css.hbs +20 -0
- package/dist/templates/react/Avatar/Avatar.jsx.hbs +65 -0
- package/dist/templates/react/Avatar/Avatar.test.jsx.hbs +33 -0
- package/dist/templates/react/Avatar/Avatar.test.tsx.hbs +14 -0
- package/dist/templates/react/Avatar/Avatar.tsx.hbs +71 -0
- package/dist/templates/react/Badge/Badge.css.hbs +18 -0
- package/dist/templates/react/Badge/Badge.jsx.hbs +46 -0
- package/dist/templates/react/Badge/Badge.test.jsx.hbs +28 -0
- package/dist/templates/react/Badge/Badge.test.tsx.hbs +14 -0
- package/dist/templates/react/Badge/Badge.tsx.hbs +50 -0
- package/dist/templates/react/Breadcrumb/Breadcrumb.css.hbs +18 -0
- package/dist/templates/react/Breadcrumb/Breadcrumb.jsx.hbs +48 -0
- package/dist/templates/react/Breadcrumb/Breadcrumb.test.jsx.hbs +34 -0
- package/dist/templates/react/Breadcrumb/Breadcrumb.test.tsx.hbs +14 -0
- package/dist/templates/react/Breadcrumb/Breadcrumb.tsx.hbs +49 -0
- package/dist/templates/react/BreadcrumbItem/BreadcrumbItem.css.hbs +21 -0
- package/dist/templates/react/BreadcrumbItem/BreadcrumbItem.jsx.hbs +55 -0
- package/dist/templates/react/BreadcrumbItem/BreadcrumbItem.test.jsx.hbs +36 -0
- package/dist/templates/react/BreadcrumbItem/BreadcrumbItem.test.tsx.hbs +14 -0
- package/dist/templates/react/BreadcrumbItem/BreadcrumbItem.tsx.hbs +58 -0
- package/dist/templates/react/Button/Button.css.hbs +23 -0
- package/dist/templates/react/Button/Button.jsx.hbs +106 -0
- package/dist/templates/react/Button/Button.test.jsx.hbs +23 -0
- package/dist/templates/react/Button/Button.test.tsx.hbs +14 -0
- package/dist/templates/react/Button/Button.tsx.hbs +131 -0
- package/dist/templates/react/Card/Card.css.hbs +21 -0
- package/dist/templates/react/Card/Card.jsx.hbs +33 -0
- package/dist/templates/react/Card/Card.test.jsx.hbs +23 -0
- package/dist/templates/react/Card/Card.test.tsx.hbs +14 -0
- package/dist/templates/react/Card/Card.tsx.hbs +41 -0
- package/dist/templates/react/Carousel/Carousel.css.hbs +28 -0
- package/dist/templates/react/Carousel/Carousel.jsx.hbs +81 -0
- package/dist/templates/react/Carousel/Carousel.test.jsx.hbs +25 -0
- package/dist/templates/react/Carousel/Carousel.test.tsx.hbs +14 -0
- package/dist/templates/react/Carousel/Carousel.tsx.hbs +108 -0
- package/dist/templates/react/CarouselItem/CarouselItem.css.hbs +18 -0
- package/dist/templates/react/CarouselItem/CarouselItem.jsx.hbs +28 -0
- package/dist/templates/react/CarouselItem/CarouselItem.test.jsx.hbs +21 -0
- package/dist/templates/react/CarouselItem/CarouselItem.test.tsx.hbs +14 -0
- package/dist/templates/react/CarouselItem/CarouselItem.tsx.hbs +33 -0
- package/dist/templates/react/Checkbox/Checkbox.css.hbs +24 -0
- package/dist/templates/react/Checkbox/Checkbox.jsx.hbs +80 -0
- package/dist/templates/react/Checkbox/Checkbox.test.jsx.hbs +25 -0
- package/dist/templates/react/Checkbox/Checkbox.test.tsx.hbs +14 -0
- package/dist/templates/react/Checkbox/Checkbox.tsx.hbs +113 -0
- package/dist/templates/react/ColorPicker/ColorPicker.css.hbs +37 -0
- package/dist/templates/react/ColorPicker/ColorPicker.jsx.hbs +72 -0
- package/dist/templates/react/ColorPicker/ColorPicker.test.jsx.hbs +25 -0
- package/dist/templates/react/ColorPicker/ColorPicker.test.tsx.hbs +14 -0
- package/dist/templates/react/ColorPicker/ColorPicker.tsx.hbs +157 -0
- package/dist/templates/react/Combobox/Combobox.css.hbs +32 -0
- package/dist/templates/react/Combobox/Combobox.jsx.hbs +67 -0
- package/dist/templates/react/Combobox/Combobox.test.jsx.hbs +19 -0
- package/dist/templates/react/Combobox/Combobox.test.tsx.hbs +14 -0
- package/dist/templates/react/Combobox/Combobox.tsx.hbs +154 -0
- package/dist/templates/react/Comparison/Comparison.css.hbs +23 -0
- package/dist/templates/react/Comparison/Comparison.jsx.hbs +27 -0
- package/dist/templates/react/Comparison/Comparison.test.jsx.hbs +27 -0
- package/dist/templates/react/Comparison/Comparison.test.tsx.hbs +14 -0
- package/dist/templates/react/Comparison/Comparison.tsx.hbs +32 -0
- package/dist/templates/react/CopyButton/CopyButton.css.hbs +25 -0
- package/dist/templates/react/CopyButton/CopyButton.jsx.hbs +49 -0
- package/dist/templates/react/CopyButton/CopyButton.test.jsx.hbs +16 -0
- package/dist/templates/react/CopyButton/CopyButton.test.tsx.hbs +14 -0
- package/dist/templates/react/CopyButton/CopyButton.tsx.hbs +71 -0
- package/dist/templates/react/Details/Details.css.hbs +24 -0
- package/dist/templates/react/Details/Details.jsx.hbs +66 -0
- package/dist/templates/react/Details/Details.test.jsx.hbs +27 -0
- package/dist/templates/react/Details/Details.test.tsx.hbs +14 -0
- package/dist/templates/react/Details/Details.tsx.hbs +111 -0
- package/dist/templates/react/Dialog/Dialog.css.hbs +28 -0
- package/dist/templates/react/Dialog/Dialog.jsx.hbs +115 -0
- package/dist/templates/react/Dialog/Dialog.test.jsx.hbs +29 -0
- package/dist/templates/react/Dialog/Dialog.test.tsx.hbs +14 -0
- package/dist/templates/react/Dialog/Dialog.tsx.hbs +165 -0
- package/dist/templates/react/Divider/Divider.css.hbs +21 -0
- package/dist/templates/react/Divider/Divider.jsx.hbs +24 -0
- package/dist/templates/react/Divider/Divider.test.jsx.hbs +16 -0
- package/dist/templates/react/Divider/Divider.test.tsx.hbs +14 -0
- package/dist/templates/react/Divider/Divider.tsx.hbs +24 -0
- package/dist/templates/react/Drawer/Drawer.css.hbs +28 -0
- package/dist/templates/react/Drawer/Drawer.jsx.hbs +75 -0
- package/dist/templates/react/Drawer/Drawer.test.jsx.hbs +27 -0
- package/dist/templates/react/Drawer/Drawer.test.tsx.hbs +14 -0
- package/dist/templates/react/Drawer/Drawer.tsx.hbs +99 -0
- package/dist/templates/react/Dropdown/Dropdown.css.hbs +20 -0
- package/dist/templates/react/Dropdown/Dropdown.jsx.hbs +78 -0
- package/dist/templates/react/Dropdown/Dropdown.test.jsx.hbs +18 -0
- package/dist/templates/react/Dropdown/Dropdown.test.tsx.hbs +14 -0
- package/dist/templates/react/Dropdown/Dropdown.tsx.hbs +104 -0
- package/dist/templates/react/DropdownItem/DropdownItem.css.hbs +23 -0
- package/dist/templates/react/DropdownItem/DropdownItem.jsx.hbs +41 -0
- package/dist/templates/react/DropdownItem/DropdownItem.test.jsx.hbs +18 -0
- package/dist/templates/react/DropdownItem/DropdownItem.test.tsx.hbs +14 -0
- package/dist/templates/react/DropdownItem/DropdownItem.tsx.hbs +56 -0
- package/dist/templates/react/FormatBytes/FormatBytes.css.hbs +18 -0
- package/dist/templates/react/FormatBytes/FormatBytes.jsx.hbs +25 -0
- package/dist/templates/react/FormatBytes/FormatBytes.test.jsx.hbs +16 -0
- package/dist/templates/react/FormatBytes/FormatBytes.test.tsx.hbs +14 -0
- package/dist/templates/react/FormatBytes/FormatBytes.tsx.hbs +27 -0
- package/dist/templates/react/FormatDate/FormatDate.css.hbs +18 -0
- package/dist/templates/react/FormatDate/FormatDate.jsx.hbs +18 -0
- package/dist/templates/react/FormatDate/FormatDate.test.jsx.hbs +11 -0
- package/dist/templates/react/FormatDate/FormatDate.test.tsx.hbs +14 -0
- package/dist/templates/react/FormatDate/FormatDate.tsx.hbs +45 -0
- package/dist/templates/react/FormatNumber/FormatNumber.css.hbs +18 -0
- package/dist/templates/react/FormatNumber/FormatNumber.jsx.hbs +18 -0
- package/dist/templates/react/FormatNumber/FormatNumber.test.jsx.hbs +16 -0
- package/dist/templates/react/FormatNumber/FormatNumber.test.tsx.hbs +14 -0
- package/dist/templates/react/FormatNumber/FormatNumber.tsx.hbs +41 -0
- package/dist/templates/react/Icon/Icon.css.hbs +22 -0
- package/dist/templates/react/Icon/Icon.jsx.hbs +83 -0
- package/dist/templates/react/Icon/Icon.test.jsx.hbs +35 -0
- package/dist/templates/react/Icon/Icon.test.tsx.hbs +14 -0
- package/dist/templates/react/Icon/Icon.tsx.hbs +93 -0
- package/dist/templates/react/Include/Include.css.hbs +18 -0
- package/dist/templates/react/Include/Include.jsx.hbs +40 -0
- package/dist/templates/react/Include/Include.test.jsx.hbs +16 -0
- package/dist/templates/react/Include/Include.test.tsx.hbs +14 -0
- package/dist/templates/react/Include/Include.tsx.hbs +53 -0
- package/dist/templates/react/Input/Input.css.hbs +25 -0
- package/dist/templates/react/Input/Input.jsx.hbs +126 -0
- package/dist/templates/react/Input/Input.test.jsx.hbs +23 -0
- package/dist/templates/react/Input/Input.test.tsx.hbs +14 -0
- package/dist/templates/react/Input/Input.tsx.hbs +154 -0
- package/dist/templates/react/IntersectionObserver/IntersectionObserver.css.hbs +18 -0
- package/dist/templates/react/IntersectionObserver/IntersectionObserver.jsx.hbs +38 -0
- package/dist/templates/react/IntersectionObserver/IntersectionObserver.test.jsx.hbs +15 -0
- package/dist/templates/react/IntersectionObserver/IntersectionObserver.test.tsx.hbs +14 -0
- package/dist/templates/react/IntersectionObserver/IntersectionObserver.tsx.hbs +55 -0
- package/dist/templates/react/KIGUMI_SETUP.md.hbs +52 -0
- package/dist/templates/react/MutationObserver/MutationObserver.css.hbs +18 -0
- package/dist/templates/react/MutationObserver/MutationObserver.jsx.hbs +38 -0
- package/dist/templates/react/MutationObserver/MutationObserver.test.jsx.hbs +15 -0
- package/dist/templates/react/MutationObserver/MutationObserver.test.tsx.hbs +14 -0
- package/dist/templates/react/MutationObserver/MutationObserver.tsx.hbs +55 -0
- package/dist/templates/react/Option/Option.css.hbs +21 -0
- package/dist/templates/react/Option/Option.jsx.hbs +20 -0
- package/dist/templates/react/Option/Option.test.jsx.hbs +11 -0
- package/dist/templates/react/Option/Option.test.tsx.hbs +14 -0
- package/dist/templates/react/Option/Option.tsx.hbs +27 -0
- package/dist/templates/react/Popover/Popover.css.hbs +25 -0
- package/dist/templates/react/Popover/Popover.jsx.hbs +68 -0
- package/dist/templates/react/Popover/Popover.test.jsx.hbs +18 -0
- package/dist/templates/react/Popover/Popover.test.tsx.hbs +14 -0
- package/dist/templates/react/Popover/Popover.tsx.hbs +101 -0
- package/dist/templates/react/Popup/Popup.css.hbs +25 -0
- package/dist/templates/react/Popup/Popup.jsx.hbs +45 -0
- package/dist/templates/react/Popup/Popup.test.jsx.hbs +17 -0
- package/dist/templates/react/Popup/Popup.test.tsx.hbs +14 -0
- package/dist/templates/react/Popup/Popup.tsx.hbs +83 -0
- package/dist/templates/react/ProgressBar/ProgressBar.css.hbs +22 -0
- package/dist/templates/react/ProgressBar/ProgressBar.jsx.hbs +20 -0
- package/dist/templates/react/ProgressBar/ProgressBar.test.jsx.hbs +16 -0
- package/dist/templates/react/ProgressBar/ProgressBar.test.tsx.hbs +14 -0
- package/dist/templates/react/ProgressBar/ProgressBar.tsx.hbs +29 -0
- package/dist/templates/react/ProgressRing/ProgressRing.css.hbs +26 -0
- package/dist/templates/react/ProgressRing/ProgressRing.jsx.hbs +20 -0
- package/dist/templates/react/ProgressRing/ProgressRing.test.jsx.hbs +16 -0
- package/dist/templates/react/ProgressRing/ProgressRing.test.tsx.hbs +14 -0
- package/dist/templates/react/ProgressRing/ProgressRing.tsx.hbs +27 -0
- package/dist/templates/react/QrCode/QrCode.css.hbs +18 -0
- package/dist/templates/react/QrCode/QrCode.jsx.hbs +18 -0
- package/dist/templates/react/QrCode/QrCode.test.jsx.hbs +11 -0
- package/dist/templates/react/QrCode/QrCode.test.tsx.hbs +14 -0
- package/dist/templates/react/QrCode/QrCode.tsx.hbs +35 -0
- package/dist/templates/react/Radio/Radio.css.hbs +21 -0
- package/dist/templates/react/Radio/Radio.jsx.hbs +20 -0
- package/dist/templates/react/Radio/Radio.test.jsx.hbs +11 -0
- package/dist/templates/react/Radio/Radio.test.tsx.hbs +14 -0
- package/dist/templates/react/Radio/Radio.tsx.hbs +31 -0
- package/dist/templates/react/RadioGroup/RadioGroup.css.hbs +22 -0
- package/dist/templates/react/RadioGroup/RadioGroup.jsx.hbs +49 -0
- package/dist/templates/react/RadioGroup/RadioGroup.test.jsx.hbs +17 -0
- package/dist/templates/react/RadioGroup/RadioGroup.test.tsx.hbs +14 -0
- package/dist/templates/react/RadioGroup/RadioGroup.tsx.hbs +79 -0
- package/dist/templates/react/Rating/Rating.css.hbs +20 -0
- package/dist/templates/react/Rating/Rating.jsx.hbs +48 -0
- package/dist/templates/react/Rating/Rating.test.jsx.hbs +18 -0
- package/dist/templates/react/Rating/Rating.test.tsx.hbs +14 -0
- package/dist/templates/react/Rating/Rating.tsx.hbs +78 -0
- package/dist/templates/react/RelativeTime/RelativeTime.css.hbs +18 -0
- package/dist/templates/react/RelativeTime/RelativeTime.jsx.hbs +18 -0
- package/dist/templates/react/RelativeTime/RelativeTime.test.jsx.hbs +11 -0
- package/dist/templates/react/RelativeTime/RelativeTime.test.tsx.hbs +14 -0
- package/dist/templates/react/RelativeTime/RelativeTime.tsx.hbs +29 -0
- package/dist/templates/react/ResizeObserver/ResizeObserver.css.hbs +18 -0
- package/dist/templates/react/ResizeObserver/ResizeObserver.jsx.hbs +38 -0
- package/dist/templates/react/ResizeObserver/ResizeObserver.test.jsx.hbs +15 -0
- package/dist/templates/react/ResizeObserver/ResizeObserver.test.tsx.hbs +14 -0
- package/dist/templates/react/ResizeObserver/ResizeObserver.tsx.hbs +45 -0
- package/dist/templates/react/Scroller/Scroller.css.hbs +19 -0
- package/dist/templates/react/Scroller/Scroller.jsx.hbs +20 -0
- package/dist/templates/react/Scroller/Scroller.test.jsx.hbs +11 -0
- package/dist/templates/react/Scroller/Scroller.test.tsx.hbs +14 -0
- package/dist/templates/react/Scroller/Scroller.tsx.hbs +29 -0
- package/dist/templates/react/Select/Select.css.hbs +32 -0
- package/dist/templates/react/Select/Select.jsx.hbs +79 -0
- package/dist/templates/react/Select/Select.test.jsx.hbs +20 -0
- package/dist/templates/react/Select/Select.test.tsx.hbs +14 -0
- package/dist/templates/react/Select/Select.tsx.hbs +140 -0
- package/dist/templates/react/Skeleton/Skeleton.css.hbs +19 -0
- package/dist/templates/react/Skeleton/Skeleton.jsx.hbs +18 -0
- package/dist/templates/react/Skeleton/Skeleton.test.jsx.hbs +11 -0
- package/dist/templates/react/Skeleton/Skeleton.test.tsx.hbs +14 -0
- package/dist/templates/react/Skeleton/Skeleton.tsx.hbs +23 -0
- package/dist/templates/react/Slider/Slider.css.hbs +26 -0
- package/dist/templates/react/Slider/Slider.jsx.hbs +50 -0
- package/dist/templates/react/Slider/Slider.test.jsx.hbs +19 -0
- package/dist/templates/react/Slider/Slider.test.tsx.hbs +14 -0
- package/dist/templates/react/Slider/Slider.tsx.hbs +100 -0
- package/dist/templates/react/Spinner/Spinner.css.hbs +21 -0
- package/dist/templates/react/Spinner/Spinner.jsx.hbs +18 -0
- package/dist/templates/react/Spinner/Spinner.test.jsx.hbs +11 -0
- package/dist/templates/react/Spinner/Spinner.test.tsx.hbs +14 -0
- package/dist/templates/react/Spinner/Spinner.tsx.hbs +20 -0
- package/dist/templates/react/SplitPanel/SplitPanel.css.hbs +24 -0
- package/dist/templates/react/SplitPanel/SplitPanel.jsx.hbs +38 -0
- package/dist/templates/react/SplitPanel/SplitPanel.test.jsx.hbs +16 -0
- package/dist/templates/react/SplitPanel/SplitPanel.test.tsx.hbs +14 -0
- package/dist/templates/react/SplitPanel/SplitPanel.tsx.hbs +55 -0
- package/dist/templates/react/Switch/Switch.css.hbs +24 -0
- package/dist/templates/react/Switch/Switch.jsx.hbs +51 -0
- package/dist/templates/react/Switch/Switch.test.jsx.hbs +19 -0
- package/dist/templates/react/Switch/Switch.test.tsx.hbs +14 -0
- package/dist/templates/react/Switch/Switch.tsx.hbs +83 -0
- package/dist/templates/react/Tab/Tab.css.hbs +18 -0
- package/dist/templates/react/Tab/Tab.jsx.hbs +20 -0
- package/dist/templates/react/Tab/Tab.test.jsx.hbs +11 -0
- package/dist/templates/react/Tab/Tab.test.tsx.hbs +14 -0
- package/dist/templates/react/Tab/Tab.tsx.hbs +27 -0
- package/dist/templates/react/TabGroup/TabGroup.css.hbs +27 -0
- package/dist/templates/react/TabGroup/TabGroup.jsx.hbs +42 -0
- package/dist/templates/react/TabGroup/TabGroup.test.jsx.hbs +11 -0
- package/dist/templates/react/TabGroup/TabGroup.test.tsx.hbs +14 -0
- package/dist/templates/react/TabGroup/TabGroup.tsx.hbs +57 -0
- package/dist/templates/react/TabPanel/TabPanel.css.hbs +18 -0
- package/dist/templates/react/TabPanel/TabPanel.jsx.hbs +20 -0
- package/dist/templates/react/TabPanel/TabPanel.test.jsx.hbs +11 -0
- package/dist/templates/react/TabPanel/TabPanel.test.tsx.hbs +14 -0
- package/dist/templates/react/TabPanel/TabPanel.tsx.hbs +27 -0
- package/dist/templates/react/Tag/Tag.css.hbs +21 -0
- package/dist/templates/react/Tag/Tag.jsx.hbs +41 -0
- package/dist/templates/react/Tag/Tag.test.jsx.hbs +11 -0
- package/dist/templates/react/Tag/Tag.test.tsx.hbs +14 -0
- package/dist/templates/react/Tag/Tag.tsx.hbs +60 -0
- package/dist/templates/react/Textarea/Textarea.css.hbs +22 -0
- package/dist/templates/react/Textarea/Textarea.jsx.hbs +58 -0
- package/dist/templates/react/Textarea/Textarea.test.jsx.hbs +11 -0
- package/dist/templates/react/Textarea/Textarea.test.tsx.hbs +14 -0
- package/dist/templates/react/Textarea/Textarea.tsx.hbs +114 -0
- package/dist/templates/react/Tooltip/Tooltip.css.hbs +21 -0
- package/dist/templates/react/Tooltip/Tooltip.jsx.hbs +63 -0
- package/dist/templates/react/Tooltip/Tooltip.test.jsx.hbs +15 -0
- package/dist/templates/react/Tooltip/Tooltip.test.tsx.hbs +14 -0
- package/dist/templates/react/Tooltip/Tooltip.tsx.hbs +104 -0
- package/dist/templates/react/Tree/Tree.css.hbs +22 -0
- package/dist/templates/react/Tree/Tree.jsx.hbs +41 -0
- package/dist/templates/react/Tree/Tree.test.jsx.hbs +11 -0
- package/dist/templates/react/Tree/Tree.test.tsx.hbs +14 -0
- package/dist/templates/react/Tree/Tree.tsx.hbs +52 -0
- package/dist/templates/react/TreeItem/TreeItem.css.hbs +32 -0
- package/dist/templates/react/TreeItem/TreeItem.jsx.hbs +57 -0
- package/dist/templates/react/TreeItem/TreeItem.test.jsx.hbs +11 -0
- package/dist/templates/react/TreeItem/TreeItem.test.tsx.hbs +14 -0
- package/dist/templates/react/TreeItem/TreeItem.tsx.hbs +87 -0
- package/dist/templates/react/ZoomableFrame/ZoomableFrame.css.hbs +21 -0
- package/dist/templates/react/ZoomableFrame/ZoomableFrame.jsx.hbs +52 -0
- package/dist/templates/react/ZoomableFrame/ZoomableFrame.test.jsx.hbs +11 -0
- package/dist/templates/react/ZoomableFrame/ZoomableFrame.test.tsx.hbs +14 -0
- package/dist/templates/react/ZoomableFrame/ZoomableFrame.tsx.hbs +92 -0
- package/dist/templates/react/vite-env.d.ts.hbs +21 -0
- package/dist/tier-2ZEZT6E3.js +12 -0
- package/dist/tier-GFXZQZUI.js +12 -0
- package/package.json +82 -0
- package/templates/AGENTS.md +214 -0
- package/templates/react/AnimatedImage/AnimatedImage.css.hbs +19 -0
- package/templates/react/AnimatedImage/AnimatedImage.jsx.hbs +64 -0
- package/templates/react/AnimatedImage/AnimatedImage.test.jsx.hbs +29 -0
- package/templates/react/AnimatedImage/AnimatedImage.test.tsx.hbs +14 -0
- package/templates/react/AnimatedImage/AnimatedImage.tsx.hbs +68 -0
- package/templates/react/Animation/Animation.css.hbs +18 -0
- package/templates/react/Animation/Animation.jsx.hbs +100 -0
- package/templates/react/Animation/Animation.test.jsx.hbs +37 -0
- package/templates/react/Animation/Animation.test.tsx.hbs +14 -0
- package/templates/react/Animation/Animation.tsx.hbs +127 -0
- package/templates/react/Avatar/Avatar.css.hbs +20 -0
- package/templates/react/Avatar/Avatar.jsx.hbs +65 -0
- package/templates/react/Avatar/Avatar.test.jsx.hbs +33 -0
- package/templates/react/Avatar/Avatar.test.tsx.hbs +14 -0
- package/templates/react/Avatar/Avatar.tsx.hbs +71 -0
- package/templates/react/Badge/Badge.css.hbs +18 -0
- package/templates/react/Badge/Badge.jsx.hbs +46 -0
- package/templates/react/Badge/Badge.test.jsx.hbs +28 -0
- package/templates/react/Badge/Badge.test.tsx.hbs +14 -0
- package/templates/react/Badge/Badge.tsx.hbs +50 -0
- package/templates/react/Breadcrumb/Breadcrumb.css.hbs +18 -0
- package/templates/react/Breadcrumb/Breadcrumb.jsx.hbs +48 -0
- package/templates/react/Breadcrumb/Breadcrumb.test.jsx.hbs +34 -0
- package/templates/react/Breadcrumb/Breadcrumb.test.tsx.hbs +14 -0
- package/templates/react/Breadcrumb/Breadcrumb.tsx.hbs +49 -0
- package/templates/react/BreadcrumbItem/BreadcrumbItem.css.hbs +21 -0
- package/templates/react/BreadcrumbItem/BreadcrumbItem.jsx.hbs +55 -0
- package/templates/react/BreadcrumbItem/BreadcrumbItem.test.jsx.hbs +36 -0
- package/templates/react/BreadcrumbItem/BreadcrumbItem.test.tsx.hbs +14 -0
- package/templates/react/BreadcrumbItem/BreadcrumbItem.tsx.hbs +58 -0
- package/templates/react/Button/Button.css.hbs +23 -0
- package/templates/react/Button/Button.jsx.hbs +106 -0
- package/templates/react/Button/Button.test.jsx.hbs +23 -0
- package/templates/react/Button/Button.test.tsx.hbs +14 -0
- package/templates/react/Button/Button.tsx.hbs +131 -0
- package/templates/react/Card/Card.css.hbs +21 -0
- package/templates/react/Card/Card.jsx.hbs +33 -0
- package/templates/react/Card/Card.test.jsx.hbs +23 -0
- package/templates/react/Card/Card.test.tsx.hbs +14 -0
- package/templates/react/Card/Card.tsx.hbs +41 -0
- package/templates/react/Carousel/Carousel.css.hbs +28 -0
- package/templates/react/Carousel/Carousel.jsx.hbs +81 -0
- package/templates/react/Carousel/Carousel.test.jsx.hbs +25 -0
- package/templates/react/Carousel/Carousel.test.tsx.hbs +14 -0
- package/templates/react/Carousel/Carousel.tsx.hbs +108 -0
- package/templates/react/CarouselItem/CarouselItem.css.hbs +18 -0
- package/templates/react/CarouselItem/CarouselItem.jsx.hbs +28 -0
- package/templates/react/CarouselItem/CarouselItem.test.jsx.hbs +21 -0
- package/templates/react/CarouselItem/CarouselItem.test.tsx.hbs +14 -0
- package/templates/react/CarouselItem/CarouselItem.tsx.hbs +33 -0
- package/templates/react/Checkbox/Checkbox.css.hbs +24 -0
- package/templates/react/Checkbox/Checkbox.jsx.hbs +80 -0
- package/templates/react/Checkbox/Checkbox.test.jsx.hbs +25 -0
- package/templates/react/Checkbox/Checkbox.test.tsx.hbs +14 -0
- package/templates/react/Checkbox/Checkbox.tsx.hbs +113 -0
- package/templates/react/ColorPicker/ColorPicker.css.hbs +37 -0
- package/templates/react/ColorPicker/ColorPicker.jsx.hbs +72 -0
- package/templates/react/ColorPicker/ColorPicker.test.jsx.hbs +25 -0
- package/templates/react/ColorPicker/ColorPicker.test.tsx.hbs +14 -0
- package/templates/react/ColorPicker/ColorPicker.tsx.hbs +157 -0
- package/templates/react/Combobox/Combobox.css.hbs +32 -0
- package/templates/react/Combobox/Combobox.jsx.hbs +67 -0
- package/templates/react/Combobox/Combobox.test.jsx.hbs +19 -0
- package/templates/react/Combobox/Combobox.test.tsx.hbs +14 -0
- package/templates/react/Combobox/Combobox.tsx.hbs +154 -0
- package/templates/react/Comparison/Comparison.css.hbs +23 -0
- package/templates/react/Comparison/Comparison.jsx.hbs +27 -0
- package/templates/react/Comparison/Comparison.test.jsx.hbs +27 -0
- package/templates/react/Comparison/Comparison.test.tsx.hbs +14 -0
- package/templates/react/Comparison/Comparison.tsx.hbs +32 -0
- package/templates/react/CopyButton/CopyButton.css.hbs +25 -0
- package/templates/react/CopyButton/CopyButton.jsx.hbs +49 -0
- package/templates/react/CopyButton/CopyButton.test.jsx.hbs +16 -0
- package/templates/react/CopyButton/CopyButton.test.tsx.hbs +14 -0
- package/templates/react/CopyButton/CopyButton.tsx.hbs +71 -0
- package/templates/react/Details/Details.css.hbs +24 -0
- package/templates/react/Details/Details.jsx.hbs +66 -0
- package/templates/react/Details/Details.test.jsx.hbs +27 -0
- package/templates/react/Details/Details.test.tsx.hbs +14 -0
- package/templates/react/Details/Details.tsx.hbs +111 -0
- package/templates/react/Dialog/Dialog.css.hbs +28 -0
- package/templates/react/Dialog/Dialog.jsx.hbs +115 -0
- package/templates/react/Dialog/Dialog.test.jsx.hbs +29 -0
- package/templates/react/Dialog/Dialog.test.tsx.hbs +14 -0
- package/templates/react/Dialog/Dialog.tsx.hbs +165 -0
- package/templates/react/Divider/Divider.css.hbs +21 -0
- package/templates/react/Divider/Divider.jsx.hbs +24 -0
- package/templates/react/Divider/Divider.test.jsx.hbs +16 -0
- package/templates/react/Divider/Divider.test.tsx.hbs +14 -0
- package/templates/react/Divider/Divider.tsx.hbs +24 -0
- package/templates/react/Drawer/Drawer.css.hbs +28 -0
- package/templates/react/Drawer/Drawer.jsx.hbs +75 -0
- package/templates/react/Drawer/Drawer.test.jsx.hbs +27 -0
- package/templates/react/Drawer/Drawer.test.tsx.hbs +14 -0
- package/templates/react/Drawer/Drawer.tsx.hbs +99 -0
- package/templates/react/Dropdown/Dropdown.css.hbs +20 -0
- package/templates/react/Dropdown/Dropdown.jsx.hbs +78 -0
- package/templates/react/Dropdown/Dropdown.test.jsx.hbs +18 -0
- package/templates/react/Dropdown/Dropdown.test.tsx.hbs +14 -0
- package/templates/react/Dropdown/Dropdown.tsx.hbs +104 -0
- package/templates/react/DropdownItem/DropdownItem.css.hbs +23 -0
- package/templates/react/DropdownItem/DropdownItem.jsx.hbs +41 -0
- package/templates/react/DropdownItem/DropdownItem.test.jsx.hbs +18 -0
- package/templates/react/DropdownItem/DropdownItem.test.tsx.hbs +14 -0
- package/templates/react/DropdownItem/DropdownItem.tsx.hbs +56 -0
- package/templates/react/FormatBytes/FormatBytes.css.hbs +18 -0
- package/templates/react/FormatBytes/FormatBytes.jsx.hbs +25 -0
- package/templates/react/FormatBytes/FormatBytes.test.jsx.hbs +16 -0
- package/templates/react/FormatBytes/FormatBytes.test.tsx.hbs +14 -0
- package/templates/react/FormatBytes/FormatBytes.tsx.hbs +27 -0
- package/templates/react/FormatDate/FormatDate.css.hbs +18 -0
- package/templates/react/FormatDate/FormatDate.jsx.hbs +18 -0
- package/templates/react/FormatDate/FormatDate.test.jsx.hbs +11 -0
- package/templates/react/FormatDate/FormatDate.test.tsx.hbs +14 -0
- package/templates/react/FormatDate/FormatDate.tsx.hbs +45 -0
- package/templates/react/FormatNumber/FormatNumber.css.hbs +18 -0
- package/templates/react/FormatNumber/FormatNumber.jsx.hbs +18 -0
- package/templates/react/FormatNumber/FormatNumber.test.jsx.hbs +16 -0
- package/templates/react/FormatNumber/FormatNumber.test.tsx.hbs +14 -0
- package/templates/react/FormatNumber/FormatNumber.tsx.hbs +41 -0
- package/templates/react/Icon/Icon.css.hbs +22 -0
- package/templates/react/Icon/Icon.jsx.hbs +83 -0
- package/templates/react/Icon/Icon.test.jsx.hbs +35 -0
- package/templates/react/Icon/Icon.test.tsx.hbs +14 -0
- package/templates/react/Icon/Icon.tsx.hbs +93 -0
- package/templates/react/Include/Include.css.hbs +18 -0
- package/templates/react/Include/Include.jsx.hbs +40 -0
- package/templates/react/Include/Include.test.jsx.hbs +16 -0
- package/templates/react/Include/Include.test.tsx.hbs +14 -0
- package/templates/react/Include/Include.tsx.hbs +53 -0
- package/templates/react/Input/Input.css.hbs +25 -0
- package/templates/react/Input/Input.jsx.hbs +126 -0
- package/templates/react/Input/Input.test.jsx.hbs +23 -0
- package/templates/react/Input/Input.test.tsx.hbs +14 -0
- package/templates/react/Input/Input.tsx.hbs +154 -0
- package/templates/react/IntersectionObserver/IntersectionObserver.css.hbs +18 -0
- package/templates/react/IntersectionObserver/IntersectionObserver.jsx.hbs +38 -0
- package/templates/react/IntersectionObserver/IntersectionObserver.test.jsx.hbs +15 -0
- package/templates/react/IntersectionObserver/IntersectionObserver.test.tsx.hbs +14 -0
- package/templates/react/IntersectionObserver/IntersectionObserver.tsx.hbs +55 -0
- package/templates/react/MutationObserver/MutationObserver.css.hbs +18 -0
- package/templates/react/MutationObserver/MutationObserver.jsx.hbs +38 -0
- package/templates/react/MutationObserver/MutationObserver.test.jsx.hbs +15 -0
- package/templates/react/MutationObserver/MutationObserver.test.tsx.hbs +14 -0
- package/templates/react/MutationObserver/MutationObserver.tsx.hbs +55 -0
- package/templates/react/Option/Option.css.hbs +21 -0
- package/templates/react/Option/Option.jsx.hbs +20 -0
- package/templates/react/Option/Option.test.jsx.hbs +11 -0
- package/templates/react/Option/Option.test.tsx.hbs +14 -0
- package/templates/react/Option/Option.tsx.hbs +27 -0
- package/templates/react/Popover/Popover.css.hbs +25 -0
- package/templates/react/Popover/Popover.jsx.hbs +68 -0
- package/templates/react/Popover/Popover.test.jsx.hbs +18 -0
- package/templates/react/Popover/Popover.test.tsx.hbs +14 -0
- package/templates/react/Popover/Popover.tsx.hbs +101 -0
- package/templates/react/Popup/Popup.css.hbs +25 -0
- package/templates/react/Popup/Popup.jsx.hbs +45 -0
- package/templates/react/Popup/Popup.test.jsx.hbs +17 -0
- package/templates/react/Popup/Popup.test.tsx.hbs +14 -0
- package/templates/react/Popup/Popup.tsx.hbs +83 -0
- package/templates/react/ProgressBar/ProgressBar.css.hbs +22 -0
- package/templates/react/ProgressBar/ProgressBar.jsx.hbs +20 -0
- package/templates/react/ProgressBar/ProgressBar.test.jsx.hbs +16 -0
- package/templates/react/ProgressBar/ProgressBar.test.tsx.hbs +14 -0
- package/templates/react/ProgressBar/ProgressBar.tsx.hbs +29 -0
- package/templates/react/ProgressRing/ProgressRing.css.hbs +26 -0
- package/templates/react/ProgressRing/ProgressRing.jsx.hbs +20 -0
- package/templates/react/ProgressRing/ProgressRing.test.jsx.hbs +16 -0
- package/templates/react/ProgressRing/ProgressRing.test.tsx.hbs +14 -0
- package/templates/react/ProgressRing/ProgressRing.tsx.hbs +27 -0
- package/templates/react/QrCode/QrCode.css.hbs +18 -0
- package/templates/react/QrCode/QrCode.jsx.hbs +18 -0
- package/templates/react/QrCode/QrCode.test.jsx.hbs +11 -0
- package/templates/react/QrCode/QrCode.test.tsx.hbs +14 -0
- package/templates/react/QrCode/QrCode.tsx.hbs +35 -0
- package/templates/react/Radio/Radio.css.hbs +21 -0
- package/templates/react/Radio/Radio.jsx.hbs +20 -0
- package/templates/react/Radio/Radio.test.jsx.hbs +11 -0
- package/templates/react/Radio/Radio.test.tsx.hbs +14 -0
- package/templates/react/Radio/Radio.tsx.hbs +31 -0
- package/templates/react/RadioGroup/RadioGroup.css.hbs +22 -0
- package/templates/react/RadioGroup/RadioGroup.jsx.hbs +49 -0
- package/templates/react/RadioGroup/RadioGroup.test.jsx.hbs +17 -0
- package/templates/react/RadioGroup/RadioGroup.test.tsx.hbs +14 -0
- package/templates/react/RadioGroup/RadioGroup.tsx.hbs +79 -0
- package/templates/react/Rating/Rating.css.hbs +20 -0
- package/templates/react/Rating/Rating.jsx.hbs +48 -0
- package/templates/react/Rating/Rating.test.jsx.hbs +18 -0
- package/templates/react/Rating/Rating.test.tsx.hbs +14 -0
- package/templates/react/Rating/Rating.tsx.hbs +78 -0
- package/templates/react/RelativeTime/RelativeTime.css.hbs +18 -0
- package/templates/react/RelativeTime/RelativeTime.jsx.hbs +18 -0
- package/templates/react/RelativeTime/RelativeTime.test.jsx.hbs +11 -0
- package/templates/react/RelativeTime/RelativeTime.test.tsx.hbs +14 -0
- package/templates/react/RelativeTime/RelativeTime.tsx.hbs +29 -0
- package/templates/react/ResizeObserver/ResizeObserver.css.hbs +18 -0
- package/templates/react/ResizeObserver/ResizeObserver.jsx.hbs +38 -0
- package/templates/react/ResizeObserver/ResizeObserver.test.jsx.hbs +15 -0
- package/templates/react/ResizeObserver/ResizeObserver.test.tsx.hbs +14 -0
- package/templates/react/ResizeObserver/ResizeObserver.tsx.hbs +45 -0
- package/templates/react/Scroller/Scroller.css.hbs +19 -0
- package/templates/react/Scroller/Scroller.jsx.hbs +20 -0
- package/templates/react/Scroller/Scroller.test.jsx.hbs +11 -0
- package/templates/react/Scroller/Scroller.test.tsx.hbs +14 -0
- package/templates/react/Scroller/Scroller.tsx.hbs +29 -0
- package/templates/react/Select/Select.css.hbs +32 -0
- package/templates/react/Select/Select.jsx.hbs +79 -0
- package/templates/react/Select/Select.test.jsx.hbs +20 -0
- package/templates/react/Select/Select.test.tsx.hbs +14 -0
- package/templates/react/Select/Select.tsx.hbs +140 -0
- package/templates/react/Skeleton/Skeleton.css.hbs +19 -0
- package/templates/react/Skeleton/Skeleton.jsx.hbs +18 -0
- package/templates/react/Skeleton/Skeleton.test.jsx.hbs +11 -0
- package/templates/react/Skeleton/Skeleton.test.tsx.hbs +14 -0
- package/templates/react/Skeleton/Skeleton.tsx.hbs +23 -0
- package/templates/react/Slider/Slider.css.hbs +26 -0
- package/templates/react/Slider/Slider.jsx.hbs +50 -0
- package/templates/react/Slider/Slider.test.jsx.hbs +19 -0
- package/templates/react/Slider/Slider.test.tsx.hbs +14 -0
- package/templates/react/Slider/Slider.tsx.hbs +100 -0
- package/templates/react/Spinner/Spinner.css.hbs +21 -0
- package/templates/react/Spinner/Spinner.jsx.hbs +18 -0
- package/templates/react/Spinner/Spinner.test.jsx.hbs +11 -0
- package/templates/react/Spinner/Spinner.test.tsx.hbs +14 -0
- package/templates/react/Spinner/Spinner.tsx.hbs +20 -0
- package/templates/react/SplitPanel/SplitPanel.css.hbs +24 -0
- package/templates/react/SplitPanel/SplitPanel.jsx.hbs +38 -0
- package/templates/react/SplitPanel/SplitPanel.test.jsx.hbs +16 -0
- package/templates/react/SplitPanel/SplitPanel.test.tsx.hbs +14 -0
- package/templates/react/SplitPanel/SplitPanel.tsx.hbs +55 -0
- package/templates/react/Switch/Switch.css.hbs +24 -0
- package/templates/react/Switch/Switch.jsx.hbs +51 -0
- package/templates/react/Switch/Switch.test.jsx.hbs +19 -0
- package/templates/react/Switch/Switch.test.tsx.hbs +14 -0
- package/templates/react/Switch/Switch.tsx.hbs +83 -0
- package/templates/react/Tab/Tab.css.hbs +18 -0
- package/templates/react/Tab/Tab.jsx.hbs +20 -0
- package/templates/react/Tab/Tab.test.jsx.hbs +11 -0
- package/templates/react/Tab/Tab.test.tsx.hbs +14 -0
- package/templates/react/Tab/Tab.tsx.hbs +27 -0
- package/templates/react/TabGroup/TabGroup.css.hbs +27 -0
- package/templates/react/TabGroup/TabGroup.jsx.hbs +42 -0
- package/templates/react/TabGroup/TabGroup.test.jsx.hbs +11 -0
- package/templates/react/TabGroup/TabGroup.test.tsx.hbs +14 -0
- package/templates/react/TabGroup/TabGroup.tsx.hbs +57 -0
- package/templates/react/TabPanel/TabPanel.css.hbs +18 -0
- package/templates/react/TabPanel/TabPanel.jsx.hbs +20 -0
- package/templates/react/TabPanel/TabPanel.test.jsx.hbs +11 -0
- package/templates/react/TabPanel/TabPanel.test.tsx.hbs +14 -0
- package/templates/react/TabPanel/TabPanel.tsx.hbs +27 -0
- package/templates/react/Tag/Tag.css.hbs +21 -0
- package/templates/react/Tag/Tag.jsx.hbs +41 -0
- package/templates/react/Tag/Tag.test.jsx.hbs +11 -0
- package/templates/react/Tag/Tag.test.tsx.hbs +14 -0
- package/templates/react/Tag/Tag.tsx.hbs +60 -0
- package/templates/react/Textarea/Textarea.css.hbs +22 -0
- package/templates/react/Textarea/Textarea.jsx.hbs +58 -0
- package/templates/react/Textarea/Textarea.test.jsx.hbs +11 -0
- package/templates/react/Textarea/Textarea.test.tsx.hbs +14 -0
- package/templates/react/Textarea/Textarea.tsx.hbs +114 -0
- package/templates/react/Tooltip/Tooltip.css.hbs +21 -0
- package/templates/react/Tooltip/Tooltip.jsx.hbs +63 -0
- package/templates/react/Tooltip/Tooltip.test.jsx.hbs +15 -0
- package/templates/react/Tooltip/Tooltip.test.tsx.hbs +14 -0
- package/templates/react/Tooltip/Tooltip.tsx.hbs +104 -0
- package/templates/react/Tree/Tree.css.hbs +22 -0
- package/templates/react/Tree/Tree.jsx.hbs +41 -0
- package/templates/react/Tree/Tree.test.jsx.hbs +11 -0
- package/templates/react/Tree/Tree.test.tsx.hbs +14 -0
- package/templates/react/Tree/Tree.tsx.hbs +52 -0
- package/templates/react/TreeItem/TreeItem.css.hbs +32 -0
- package/templates/react/TreeItem/TreeItem.jsx.hbs +57 -0
- package/templates/react/TreeItem/TreeItem.test.jsx.hbs +11 -0
- package/templates/react/TreeItem/TreeItem.test.tsx.hbs +14 -0
- package/templates/react/TreeItem/TreeItem.tsx.hbs +87 -0
- package/templates/react/ZoomableFrame/ZoomableFrame.css.hbs +21 -0
- package/templates/react/ZoomableFrame/ZoomableFrame.jsx.hbs +52 -0
- package/templates/react/ZoomableFrame/ZoomableFrame.test.jsx.hbs +11 -0
- package/templates/react/ZoomableFrame/ZoomableFrame.test.tsx.hbs +14 -0
- package/templates/react/ZoomableFrame/ZoomableFrame.tsx.hbs +92 -0
- package/templates/react/vite-env.d.ts.hbs +21 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { forwardRef, useRef, useImperativeHandle, useEffect, type HTMLAttributes } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Checkbox.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Checkboxes allow the user to toggle an option on or off
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <Checkbox checked>Remember me</Checkbox>
|
|
12
|
+
* <Checkbox indeterminate>Select all</Checkbox>
|
|
13
|
+
* <Checkbox hint="Optional setting">Enable feature</Checkbox>
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export interface CheckboxProps extends Omit<HTMLAttributes<HTMLElement>, 'onInvalid' | 'dir'> {
|
|
17
|
+
/** Draws checkbox in checked state */
|
|
18
|
+
checked?: boolean;
|
|
19
|
+
/** Default value for form resets */
|
|
20
|
+
defaultChecked?: boolean;
|
|
21
|
+
/** Disables the checkbox */
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/** Descriptive helper text */
|
|
24
|
+
hint?: string;
|
|
25
|
+
/** Mixed/parent selection state */
|
|
26
|
+
indeterminate?: boolean;
|
|
27
|
+
/** Form submission identifier */
|
|
28
|
+
name?: string;
|
|
29
|
+
/** Makes field mandatory */
|
|
30
|
+
required?: boolean;
|
|
31
|
+
/** Adjusts checkbox dimensions */
|
|
32
|
+
size?: 'small' | 'medium' | 'large';
|
|
33
|
+
/** Form submission value */
|
|
34
|
+
value?: string;
|
|
35
|
+
/** Event fired when validation fails */
|
|
36
|
+
onInvalid?: (event: CustomEvent) => void;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface CheckboxRef {
|
|
40
|
+
focus: (options?: FocusOptions) => void;
|
|
41
|
+
blur: () => void;
|
|
42
|
+
click: () => void;
|
|
43
|
+
setCustomValidity: (message: string) => void;
|
|
44
|
+
element: HTMLElement | null;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const Checkbox = forwardRef<CheckboxRef, CheckboxProps>(
|
|
48
|
+
({ children, className, onInvalid, ...props }, ref) => {
|
|
49
|
+
const checkboxRef = useRef<HTMLElement & {
|
|
50
|
+
focus?: (options?: FocusOptions) => void;
|
|
51
|
+
blur?: () => void;
|
|
52
|
+
click?: () => void;
|
|
53
|
+
setCustomValidity?: (message: string) => void;
|
|
54
|
+
}>(null);
|
|
55
|
+
|
|
56
|
+
useImperativeHandle(
|
|
57
|
+
ref,
|
|
58
|
+
() => ({
|
|
59
|
+
focus: (options?: FocusOptions) => {
|
|
60
|
+
if (checkboxRef.current && typeof checkboxRef.current.focus === 'function') {
|
|
61
|
+
checkboxRef.current.focus(options);
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
blur: () => {
|
|
65
|
+
if (checkboxRef.current && typeof checkboxRef.current.blur === 'function') {
|
|
66
|
+
checkboxRef.current.blur();
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
click: () => {
|
|
70
|
+
if (checkboxRef.current && typeof checkboxRef.current.click === 'function') {
|
|
71
|
+
checkboxRef.current.click();
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
setCustomValidity: (message: string) => {
|
|
75
|
+
if (checkboxRef.current && typeof checkboxRef.current.setCustomValidity === 'function') {
|
|
76
|
+
checkboxRef.current.setCustomValidity(message);
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
get element() {
|
|
80
|
+
return checkboxRef.current;
|
|
81
|
+
},
|
|
82
|
+
}),
|
|
83
|
+
[]
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
useEffect(() => {
|
|
87
|
+
const el = checkboxRef.current;
|
|
88
|
+
if (!el) return;
|
|
89
|
+
|
|
90
|
+
const handleInvalid = (e: Event) => {
|
|
91
|
+
if (onInvalid) onInvalid(e as CustomEvent);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
el.addEventListener('wa-invalid', handleInvalid);
|
|
95
|
+
|
|
96
|
+
return () => {
|
|
97
|
+
el.removeEventListener('wa-invalid', handleInvalid);
|
|
98
|
+
};
|
|
99
|
+
}, [onInvalid]);
|
|
100
|
+
|
|
101
|
+
return (
|
|
102
|
+
<wa-checkbox
|
|
103
|
+
ref={checkboxRef}
|
|
104
|
+
class={clsx('Checkbox', className)}
|
|
105
|
+
{...(props as Record<string, unknown>)}
|
|
106
|
+
>
|
|
107
|
+
{children}
|
|
108
|
+
</wa-checkbox>
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
Checkbox.displayName = 'Checkbox';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ColorPicker Component Styles
|
|
3
|
+
* Documentation: https://webawesome.com/docs/components/color-picker
|
|
4
|
+
*
|
|
5
|
+
* CSS Custom Properties:
|
|
6
|
+
* - --grid-width: The width of the color grid
|
|
7
|
+
* - --grid-height: The height of the color grid
|
|
8
|
+
* - --grid-handle-size: The size of the color grid's handle
|
|
9
|
+
* - --slider-height: The height of the hue and alpha sliders
|
|
10
|
+
* - --slider-handle-size: The diameter of the slider's handle
|
|
11
|
+
*
|
|
12
|
+
* CSS Parts:
|
|
13
|
+
* - base: The component's base wrapper
|
|
14
|
+
* - trigger: The color picker's dropdown trigger
|
|
15
|
+
* - swatches: The container that holds the swatches
|
|
16
|
+
* - swatch: Each individual swatch
|
|
17
|
+
* - grid: The color grid
|
|
18
|
+
* - grid-handle: The color grid's handle
|
|
19
|
+
* - slider: Hue and opacity sliders
|
|
20
|
+
* - slider-handle: Hue and opacity slider handles
|
|
21
|
+
* - hue-slider: The hue slider
|
|
22
|
+
* - hue-slider-handle: The hue slider's handle
|
|
23
|
+
* - opacity-slider: The opacity slider
|
|
24
|
+
* - opacity-slider-handle: The opacity slider's handle
|
|
25
|
+
* - preview: The preview color
|
|
26
|
+
* - input: The text input
|
|
27
|
+
* - eyedropper-button: The eye dropper button
|
|
28
|
+
* - format-button: The format button
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* .ColorPicker::part(base) {
|
|
32
|
+
* // Custom styles
|
|
33
|
+
* }
|
|
34
|
+
*/
|
|
35
|
+
.ColorPicker {
|
|
36
|
+
/* Add your custom styles here */
|
|
37
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './ColorPicker.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Color pickers allow the user to select a color
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```jsx
|
|
11
|
+
* <ColorPicker value="#ff0000" />
|
|
12
|
+
* <ColorPicker format="rgb" opacity />
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export const ColorPicker = React.forwardRef(
|
|
16
|
+
({ children, className, onShow, onAfterShow, onHide, onAfterHide, onInvalid, ...props }, ref) => {
|
|
17
|
+
const pickerRef = React.useRef(null);
|
|
18
|
+
|
|
19
|
+
React.useImperativeHandle(
|
|
20
|
+
ref,
|
|
21
|
+
() => ({
|
|
22
|
+
show: () => pickerRef.current?.show?.(),
|
|
23
|
+
hide: () => pickerRef.current?.hide?.(),
|
|
24
|
+
focus: (options) => pickerRef.current?.focus?.(options),
|
|
25
|
+
blur: () => pickerRef.current?.blur?.(),
|
|
26
|
+
getFormattedValue: (format) => pickerRef.current?.getFormattedValue?.(format) || '',
|
|
27
|
+
reportValidity: () => pickerRef.current?.reportValidity?.() ?? true,
|
|
28
|
+
get element() {
|
|
29
|
+
return pickerRef.current;
|
|
30
|
+
},
|
|
31
|
+
}),
|
|
32
|
+
[]
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
React.useEffect(() => {
|
|
36
|
+
const el = pickerRef.current;
|
|
37
|
+
if (!el) return;
|
|
38
|
+
|
|
39
|
+
const handleShow = (e) => onShow?.(e);
|
|
40
|
+
const handleAfterShow = (e) => onAfterShow?.(e);
|
|
41
|
+
const handleHide = (e) => onHide?.(e);
|
|
42
|
+
const handleAfterHide = (e) => onAfterHide?.(e);
|
|
43
|
+
const handleInvalid = (e) => onInvalid?.(e);
|
|
44
|
+
|
|
45
|
+
el.addEventListener('wa-show', handleShow);
|
|
46
|
+
el.addEventListener('wa-after-show', handleAfterShow);
|
|
47
|
+
el.addEventListener('wa-hide', handleHide);
|
|
48
|
+
el.addEventListener('wa-after-hide', handleAfterHide);
|
|
49
|
+
el.addEventListener('wa-invalid', handleInvalid);
|
|
50
|
+
|
|
51
|
+
return () => {
|
|
52
|
+
el.removeEventListener('wa-show', handleShow);
|
|
53
|
+
el.removeEventListener('wa-after-show', handleAfterShow);
|
|
54
|
+
el.removeEventListener('wa-hide', handleHide);
|
|
55
|
+
el.removeEventListener('wa-after-hide', handleAfterHide);
|
|
56
|
+
el.removeEventListener('wa-invalid', handleInvalid);
|
|
57
|
+
};
|
|
58
|
+
}, [onShow, onAfterShow, onHide, onAfterHide, onInvalid]);
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<wa-color-picker
|
|
62
|
+
ref={pickerRef}
|
|
63
|
+
class={clsx('ColorPicker', className)}
|
|
64
|
+
{...props}
|
|
65
|
+
>
|
|
66
|
+
{children}
|
|
67
|
+
</wa-color-picker>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
ColorPicker.displayName = 'ColorPicker';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { ColorPicker } from './ColorPicker';
|
|
5
|
+
|
|
6
|
+
describe('ColorPicker', () => {
|
|
7
|
+
it('renders without crashing', () => {
|
|
8
|
+
const { container } = render(<ColorPicker />);
|
|
9
|
+
expect(container.querySelector('wa-color-picker')).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('exposes ref methods', () => {
|
|
13
|
+
const ref = React.createRef();
|
|
14
|
+
render(<ColorPicker ref={ref} />);
|
|
15
|
+
expect(ref.current).toHaveProperty('show');
|
|
16
|
+
expect(ref.current).toHaveProperty('hide');
|
|
17
|
+
expect(ref.current).toHaveProperty('getFormattedValue');
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('applies custom className', () => {
|
|
21
|
+
const { container } = render(<ColorPicker className="custom-class" />);
|
|
22
|
+
const element = container.querySelector('wa-color-picker');
|
|
23
|
+
expect(element?.getAttribute('class')).toContain('custom-class');
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render } from '@testing-library/react';
|
|
2
|
+
import { ColorPicker } from './ColorPicker';
|
|
3
|
+
|
|
4
|
+
describe('ColorPicker', () => {
|
|
5
|
+
it('renders without crashing', () => {
|
|
6
|
+
const { container } = render(<ColorPicker />);
|
|
7
|
+
expect(container.querySelector('wa-color-picker')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('applies custom className', () => {
|
|
11
|
+
const { container } = render(<ColorPicker className="custom-class" />);
|
|
12
|
+
expect(container.querySelector('.custom-class')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { forwardRef, useRef, useImperativeHandle, useEffect, type HTMLAttributes } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './ColorPicker.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Color pickers allow the user to select a color
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <ColorPicker value="#ff0000" />
|
|
12
|
+
* <ColorPicker format="rgb" opacity />
|
|
13
|
+
* <ColorPicker swatches="#ff0000;#00ff00;#0000ff" />
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export interface ColorPickerProps extends Omit<HTMLAttributes<HTMLElement>, 'onInvalid' | 'dir'> {
|
|
17
|
+
/** The current color value */
|
|
18
|
+
value?: string;
|
|
19
|
+
/** Default value for form resets */
|
|
20
|
+
defaultValue?: string;
|
|
21
|
+
/** Color format */
|
|
22
|
+
format?: 'hex' | 'rgb' | 'hsl' | 'hsv';
|
|
23
|
+
/** Enables opacity slider */
|
|
24
|
+
opacity?: boolean;
|
|
25
|
+
/** Disables the color picker */
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/** Makes field mandatory */
|
|
28
|
+
required?: boolean;
|
|
29
|
+
/** Color picker size */
|
|
30
|
+
size?: 'small' | 'medium' | 'large';
|
|
31
|
+
/** Label text */
|
|
32
|
+
label?: string;
|
|
33
|
+
/** Hint text */
|
|
34
|
+
hint?: string;
|
|
35
|
+
/** Form field name */
|
|
36
|
+
name?: string;
|
|
37
|
+
/** Whether the panel is open */
|
|
38
|
+
open?: boolean;
|
|
39
|
+
/** Predefined color swatches (semicolon-separated or array) */
|
|
40
|
+
swatches?: string | string[];
|
|
41
|
+
/** Displays hex values in uppercase */
|
|
42
|
+
uppercase?: boolean;
|
|
43
|
+
/** Hides the format toggle button */
|
|
44
|
+
'without-format-toggle'?: boolean;
|
|
45
|
+
/** Event fired when panel opens */
|
|
46
|
+
onShow?: (event: CustomEvent) => void;
|
|
47
|
+
/** Event fired after panel opens */
|
|
48
|
+
onAfterShow?: (event: CustomEvent) => void;
|
|
49
|
+
/** Event fired when panel closes */
|
|
50
|
+
onHide?: (event: CustomEvent) => void;
|
|
51
|
+
/** Event fired after panel closes */
|
|
52
|
+
onAfterHide?: (event: CustomEvent) => void;
|
|
53
|
+
/** Event fired when validation fails */
|
|
54
|
+
onInvalid?: (event: CustomEvent) => void;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface ColorPickerRef {
|
|
58
|
+
show: () => void;
|
|
59
|
+
hide: () => void;
|
|
60
|
+
focus: (options?: FocusOptions) => void;
|
|
61
|
+
blur: () => void;
|
|
62
|
+
getFormattedValue: (format: string) => string;
|
|
63
|
+
reportValidity: () => boolean;
|
|
64
|
+
element: HTMLElement | null;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export const ColorPicker = forwardRef<ColorPickerRef, ColorPickerProps>(
|
|
68
|
+
({ children, className, onShow, onAfterShow, onHide, onAfterHide, onInvalid, ...props }, ref) => {
|
|
69
|
+
const pickerRef = useRef<HTMLElement & {
|
|
70
|
+
show?: () => void;
|
|
71
|
+
hide?: () => void;
|
|
72
|
+
focus?: (options?: FocusOptions) => void;
|
|
73
|
+
blur?: () => void;
|
|
74
|
+
getFormattedValue?: (format: string) => string;
|
|
75
|
+
reportValidity?: () => boolean;
|
|
76
|
+
}>(null);
|
|
77
|
+
|
|
78
|
+
useImperativeHandle(
|
|
79
|
+
ref,
|
|
80
|
+
() => ({
|
|
81
|
+
show: () => {
|
|
82
|
+
if (pickerRef.current && typeof pickerRef.current.show === 'function') {
|
|
83
|
+
pickerRef.current.show();
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
hide: () => {
|
|
87
|
+
if (pickerRef.current && typeof pickerRef.current.hide === 'function') {
|
|
88
|
+
pickerRef.current.hide();
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
focus: (options?: FocusOptions) => {
|
|
92
|
+
if (pickerRef.current && typeof pickerRef.current.focus === 'function') {
|
|
93
|
+
pickerRef.current.focus(options);
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
blur: () => {
|
|
97
|
+
if (pickerRef.current && typeof pickerRef.current.blur === 'function') {
|
|
98
|
+
pickerRef.current.blur();
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
getFormattedValue: (format: string) => {
|
|
102
|
+
if (pickerRef.current && typeof pickerRef.current.getFormattedValue === 'function') {
|
|
103
|
+
return pickerRef.current.getFormattedValue(format);
|
|
104
|
+
}
|
|
105
|
+
return '';
|
|
106
|
+
},
|
|
107
|
+
reportValidity: () => {
|
|
108
|
+
if (pickerRef.current && typeof pickerRef.current.reportValidity === 'function') {
|
|
109
|
+
return pickerRef.current.reportValidity();
|
|
110
|
+
}
|
|
111
|
+
return true;
|
|
112
|
+
},
|
|
113
|
+
get element() {
|
|
114
|
+
return pickerRef.current;
|
|
115
|
+
},
|
|
116
|
+
}),
|
|
117
|
+
[]
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
useEffect(() => {
|
|
121
|
+
const el = pickerRef.current;
|
|
122
|
+
if (!el) return;
|
|
123
|
+
|
|
124
|
+
const handleShow = (e: Event) => onShow?.(e as CustomEvent);
|
|
125
|
+
const handleAfterShow = (e: Event) => onAfterShow?.(e as CustomEvent);
|
|
126
|
+
const handleHide = (e: Event) => onHide?.(e as CustomEvent);
|
|
127
|
+
const handleAfterHide = (e: Event) => onAfterHide?.(e as CustomEvent);
|
|
128
|
+
const handleInvalid = (e: Event) => onInvalid?.(e as CustomEvent);
|
|
129
|
+
|
|
130
|
+
el.addEventListener('wa-show', handleShow);
|
|
131
|
+
el.addEventListener('wa-after-show', handleAfterShow);
|
|
132
|
+
el.addEventListener('wa-hide', handleHide);
|
|
133
|
+
el.addEventListener('wa-after-hide', handleAfterHide);
|
|
134
|
+
el.addEventListener('wa-invalid', handleInvalid);
|
|
135
|
+
|
|
136
|
+
return () => {
|
|
137
|
+
el.removeEventListener('wa-show', handleShow);
|
|
138
|
+
el.removeEventListener('wa-after-show', handleAfterShow);
|
|
139
|
+
el.removeEventListener('wa-hide', handleHide);
|
|
140
|
+
el.removeEventListener('wa-after-hide', handleAfterHide);
|
|
141
|
+
el.removeEventListener('wa-invalid', handleInvalid);
|
|
142
|
+
};
|
|
143
|
+
}, [onShow, onAfterShow, onHide, onAfterHide, onInvalid]);
|
|
144
|
+
|
|
145
|
+
return (
|
|
146
|
+
<wa-color-picker
|
|
147
|
+
ref={pickerRef}
|
|
148
|
+
class={clsx('ColorPicker', className)}
|
|
149
|
+
{...(props as Record<string, unknown>)}
|
|
150
|
+
>
|
|
151
|
+
{children}
|
|
152
|
+
</wa-color-picker>
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
);
|
|
156
|
+
|
|
157
|
+
ColorPicker.displayName = 'ColorPicker';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Combobox Component Styles
|
|
3
|
+
* Documentation: https://webawesome.com/docs/components/combobox
|
|
4
|
+
*
|
|
5
|
+
* CSS Custom Properties:
|
|
6
|
+
* - --show-duration: The duration of the show animation (Default: 100ms)
|
|
7
|
+
* - --hide-duration: The duration of the hide animation (Default: 100ms)
|
|
8
|
+
* - --tag-max-size: When using multiple, the max size of tags before their content is truncated (Default: 10ch)
|
|
9
|
+
*
|
|
10
|
+
* CSS Parts:
|
|
11
|
+
* - form-control: The form control that wraps the label, input, and hint
|
|
12
|
+
* - form-control-label: The label's wrapper
|
|
13
|
+
* - form-control-input: The combobox's wrapper
|
|
14
|
+
* - hint: The hint's wrapper
|
|
15
|
+
* - combobox: The container the wraps the start, end, value, clear icon, and expand button
|
|
16
|
+
* - start: The container that wraps the start slot
|
|
17
|
+
* - end: The container that wraps the end slot
|
|
18
|
+
* - combobox-input: The text input element
|
|
19
|
+
* - listbox: The listbox container where options are slotted
|
|
20
|
+
* - tags: The container that houses option tags when multiselect is used
|
|
21
|
+
* - tag: The individual tags that represent each multiselect option
|
|
22
|
+
* - clear-button: The clear button
|
|
23
|
+
* - expand-icon: The container that wraps the expand icon
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* .Combobox::part(combobox) {
|
|
27
|
+
* // Custom styles
|
|
28
|
+
* }
|
|
29
|
+
*/
|
|
30
|
+
.Combobox {
|
|
31
|
+
/* Add your custom styles here */
|
|
32
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Combobox.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Combines a text input with a listbox for filtering and selecting options
|
|
8
|
+
*/
|
|
9
|
+
export const Combobox = React.forwardRef(
|
|
10
|
+
({ children, className, onShow, onAfterShow, onHide, onAfterHide, onClear, onInvalid, ...props }, ref) => {
|
|
11
|
+
const comboboxRef = React.useRef(null);
|
|
12
|
+
|
|
13
|
+
React.useImperativeHandle(
|
|
14
|
+
ref,
|
|
15
|
+
() => ({
|
|
16
|
+
show: () => comboboxRef.current?.show?.(),
|
|
17
|
+
hide: () => comboboxRef.current?.hide?.(),
|
|
18
|
+
focus: (options) => comboboxRef.current?.focus?.(options),
|
|
19
|
+
blur: () => comboboxRef.current?.blur?.(),
|
|
20
|
+
get element() {
|
|
21
|
+
return comboboxRef.current;
|
|
22
|
+
},
|
|
23
|
+
}),
|
|
24
|
+
[]
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
React.useEffect(() => {
|
|
28
|
+
const el = comboboxRef.current;
|
|
29
|
+
if (!el) return;
|
|
30
|
+
|
|
31
|
+
const handleShow = (e) => onShow?.(e);
|
|
32
|
+
const handleAfterShow = (e) => onAfterShow?.(e);
|
|
33
|
+
const handleHide = (e) => onHide?.(e);
|
|
34
|
+
const handleAfterHide = (e) => onAfterHide?.(e);
|
|
35
|
+
const handleClear = (e) => onClear?.(e);
|
|
36
|
+
const handleInvalid = (e) => onInvalid?.(e);
|
|
37
|
+
|
|
38
|
+
el.addEventListener('wa-show', handleShow);
|
|
39
|
+
el.addEventListener('wa-after-show', handleAfterShow);
|
|
40
|
+
el.addEventListener('wa-hide', handleHide);
|
|
41
|
+
el.addEventListener('wa-after-hide', handleAfterHide);
|
|
42
|
+
el.addEventListener('wa-clear', handleClear);
|
|
43
|
+
el.addEventListener('wa-invalid', handleInvalid);
|
|
44
|
+
|
|
45
|
+
return () => {
|
|
46
|
+
el.removeEventListener('wa-show', handleShow);
|
|
47
|
+
el.removeEventListener('wa-after-show', handleAfterShow);
|
|
48
|
+
el.removeEventListener('wa-hide', handleHide);
|
|
49
|
+
el.removeEventListener('wa-after-hide', handleAfterHide);
|
|
50
|
+
el.removeEventListener('wa-clear', handleClear);
|
|
51
|
+
el.removeEventListener('wa-invalid', handleInvalid);
|
|
52
|
+
};
|
|
53
|
+
}, [onShow, onAfterShow, onHide, onAfterHide, onClear, onInvalid]);
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<wa-combobox
|
|
57
|
+
ref={comboboxRef}
|
|
58
|
+
class={clsx('Combobox', className)}
|
|
59
|
+
{...props}
|
|
60
|
+
>
|
|
61
|
+
{children}
|
|
62
|
+
</wa-combobox>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
Combobox.displayName = 'Combobox';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Combobox } from './Combobox';
|
|
5
|
+
|
|
6
|
+
describe('Combobox', () => {
|
|
7
|
+
it('renders without crashing', () => {
|
|
8
|
+
const { container } = render(<Combobox />);
|
|
9
|
+
expect(container.querySelector('wa-combobox')).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('exposes ref methods', () => {
|
|
13
|
+
const ref = React.createRef();
|
|
14
|
+
render(<Combobox ref={ref} />);
|
|
15
|
+
expect(ref.current).toHaveProperty('show');
|
|
16
|
+
expect(ref.current).toHaveProperty('hide');
|
|
17
|
+
expect(ref.current).toHaveProperty('focus');
|
|
18
|
+
});
|
|
19
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { Combobox } from './Combobox';
|
|
3
|
+
|
|
4
|
+
describe('Combobox', () => {
|
|
5
|
+
it('renders children', () => {
|
|
6
|
+
render(<Combobox>Test</Combobox>);
|
|
7
|
+
expect(screen.getByText('Test')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('applies custom className', () => {
|
|
11
|
+
const { container } = render(<Combobox className="custom-class">Test</Combobox>);
|
|
12
|
+
expect(container.querySelector('.custom-class')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|