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,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
|
+
});
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { forwardRef, useRef, useImperativeHandle, useEffect, type HTMLAttributes } 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
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <Combobox label="Select a fruit" placeholder="Search...">
|
|
12
|
+
* <wa-option value="apple">Apple</wa-option>
|
|
13
|
+
* <wa-option value="banana">Banana</wa-option>
|
|
14
|
+
* <wa-option value="cherry">Cherry</wa-option>
|
|
15
|
+
* </Combobox>
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export interface ComboboxProps extends Omit<HTMLAttributes<HTMLElement>, 'onInvalid' | 'dir'> {
|
|
19
|
+
/** Allows entering custom values */
|
|
20
|
+
'allow-custom-value'?: boolean;
|
|
21
|
+
/** Visual appearance style */
|
|
22
|
+
appearance?: 'filled' | 'outlined' | 'filled-outlined';
|
|
23
|
+
/** Autocomplete behavior */
|
|
24
|
+
autocomplete?: 'list' | 'none';
|
|
25
|
+
/** Disables the combobox */
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/** Hint text */
|
|
28
|
+
hint?: string;
|
|
29
|
+
/** Label text */
|
|
30
|
+
label?: string;
|
|
31
|
+
/** Maximum visible options */
|
|
32
|
+
'max-options-visible'?: number;
|
|
33
|
+
/** Allows multiple selections */
|
|
34
|
+
multiple?: boolean;
|
|
35
|
+
/** Form field name */
|
|
36
|
+
name?: string;
|
|
37
|
+
/** Whether the listbox is open */
|
|
38
|
+
open?: boolean;
|
|
39
|
+
/** Rounded edges style */
|
|
40
|
+
pill?: boolean;
|
|
41
|
+
/** Placeholder text */
|
|
42
|
+
placeholder?: string;
|
|
43
|
+
/** Listbox placement */
|
|
44
|
+
placement?: 'top' | 'bottom';
|
|
45
|
+
/** Makes field mandatory */
|
|
46
|
+
required?: boolean;
|
|
47
|
+
/** Combobox size */
|
|
48
|
+
size?: 'small' | 'medium' | 'large';
|
|
49
|
+
/** Current value */
|
|
50
|
+
value?: string | string[];
|
|
51
|
+
/** Shows clear button */
|
|
52
|
+
'with-clear'?: boolean;
|
|
53
|
+
/** Event fired when listbox opens */
|
|
54
|
+
onShow?: (event: CustomEvent) => void;
|
|
55
|
+
/** Event fired after listbox opens */
|
|
56
|
+
onAfterShow?: (event: CustomEvent) => void;
|
|
57
|
+
/** Event fired when listbox closes */
|
|
58
|
+
onHide?: (event: CustomEvent) => void;
|
|
59
|
+
/** Event fired after listbox closes */
|
|
60
|
+
onAfterHide?: (event: CustomEvent) => void;
|
|
61
|
+
/** Event fired when value is cleared */
|
|
62
|
+
onClear?: (event: CustomEvent) => void;
|
|
63
|
+
/** Event fired when validation fails */
|
|
64
|
+
onInvalid?: (event: CustomEvent) => void;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface ComboboxRef {
|
|
68
|
+
show: () => void;
|
|
69
|
+
hide: () => void;
|
|
70
|
+
focus: (options?: FocusOptions) => void;
|
|
71
|
+
blur: () => void;
|
|
72
|
+
element: HTMLElement | null;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export const Combobox = forwardRef<ComboboxRef, ComboboxProps>(
|
|
76
|
+
({ children, className, onShow, onAfterShow, onHide, onAfterHide, onClear, onInvalid, ...props }, ref) => {
|
|
77
|
+
const comboboxRef = useRef<HTMLElement & {
|
|
78
|
+
show?: () => void;
|
|
79
|
+
hide?: () => void;
|
|
80
|
+
focus?: (options?: FocusOptions) => void;
|
|
81
|
+
blur?: () => void;
|
|
82
|
+
}>(null);
|
|
83
|
+
|
|
84
|
+
useImperativeHandle(
|
|
85
|
+
ref,
|
|
86
|
+
() => ({
|
|
87
|
+
show: () => {
|
|
88
|
+
if (comboboxRef.current && typeof comboboxRef.current.show === 'function') {
|
|
89
|
+
comboboxRef.current.show();
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
hide: () => {
|
|
93
|
+
if (comboboxRef.current && typeof comboboxRef.current.hide === 'function') {
|
|
94
|
+
comboboxRef.current.hide();
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
focus: (options?: FocusOptions) => {
|
|
98
|
+
if (comboboxRef.current && typeof comboboxRef.current.focus === 'function') {
|
|
99
|
+
comboboxRef.current.focus(options);
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
blur: () => {
|
|
103
|
+
if (comboboxRef.current && typeof comboboxRef.current.blur === 'function') {
|
|
104
|
+
comboboxRef.current.blur();
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
get element() {
|
|
108
|
+
return comboboxRef.current;
|
|
109
|
+
},
|
|
110
|
+
}),
|
|
111
|
+
[]
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
useEffect(() => {
|
|
115
|
+
const el = comboboxRef.current;
|
|
116
|
+
if (!el) return;
|
|
117
|
+
|
|
118
|
+
const handleShow = (e: Event) => onShow?.(e as CustomEvent);
|
|
119
|
+
const handleAfterShow = (e: Event) => onAfterShow?.(e as CustomEvent);
|
|
120
|
+
const handleHide = (e: Event) => onHide?.(e as CustomEvent);
|
|
121
|
+
const handleAfterHide = (e: Event) => onAfterHide?.(e as CustomEvent);
|
|
122
|
+
const handleClear = (e: Event) => onClear?.(e as CustomEvent);
|
|
123
|
+
const handleInvalid = (e: Event) => onInvalid?.(e as CustomEvent);
|
|
124
|
+
|
|
125
|
+
el.addEventListener('wa-show', handleShow);
|
|
126
|
+
el.addEventListener('wa-after-show', handleAfterShow);
|
|
127
|
+
el.addEventListener('wa-hide', handleHide);
|
|
128
|
+
el.addEventListener('wa-after-hide', handleAfterHide);
|
|
129
|
+
el.addEventListener('wa-clear', handleClear);
|
|
130
|
+
el.addEventListener('wa-invalid', handleInvalid);
|
|
131
|
+
|
|
132
|
+
return () => {
|
|
133
|
+
el.removeEventListener('wa-show', handleShow);
|
|
134
|
+
el.removeEventListener('wa-after-show', handleAfterShow);
|
|
135
|
+
el.removeEventListener('wa-hide', handleHide);
|
|
136
|
+
el.removeEventListener('wa-after-hide', handleAfterHide);
|
|
137
|
+
el.removeEventListener('wa-clear', handleClear);
|
|
138
|
+
el.removeEventListener('wa-invalid', handleInvalid);
|
|
139
|
+
};
|
|
140
|
+
}, [onShow, onAfterShow, onHide, onAfterHide, onClear, onInvalid]);
|
|
141
|
+
|
|
142
|
+
return (
|
|
143
|
+
<wa-combobox
|
|
144
|
+
ref={comboboxRef}
|
|
145
|
+
class={clsx('Combobox', className)}
|
|
146
|
+
{...(props as Record<string, unknown>)}
|
|
147
|
+
>
|
|
148
|
+
{children}
|
|
149
|
+
</wa-combobox>
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
|
|
154
|
+
Combobox.displayName = 'Combobox';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Comparison Component Styles
|
|
3
|
+
* Documentation: https://webawesome.com/docs/components/comparison
|
|
4
|
+
*
|
|
5
|
+
* CSS Custom Properties:
|
|
6
|
+
* - --divider-width: The width of the dividing line
|
|
7
|
+
* - --handle-size: The size of the compare handle
|
|
8
|
+
*
|
|
9
|
+
* CSS Parts:
|
|
10
|
+
* - base: The container that wraps the before and after content
|
|
11
|
+
* - before: The container that wraps the before content
|
|
12
|
+
* - after: The container that wraps the after content
|
|
13
|
+
* - divider: The divider that separates the before and after content
|
|
14
|
+
* - handle: The handle that the user drags to expose the after content
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* .Comparison::part(handle) {
|
|
18
|
+
* // Custom styles
|
|
19
|
+
* }
|
|
20
|
+
*/
|
|
21
|
+
.Comparison {
|
|
22
|
+
/* Add your custom styles here */
|
|
23
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Comparison.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Compare visual differences between similar content with a sliding panel
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```jsx
|
|
11
|
+
* <Comparison position={50}>
|
|
12
|
+
* <img slot="before" src="before.jpg" alt="Before" />
|
|
13
|
+
* <img slot="after" src="after.jpg" alt="After" />
|
|
14
|
+
* </Comparison>
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export const Comparison = React.forwardRef(
|
|
18
|
+
({ children, className, ...props }, ref) => {
|
|
19
|
+
return (
|
|
20
|
+
<wa-comparison ref={ref} class={clsx('Comparison', className)} {...props}>
|
|
21
|
+
{children}
|
|
22
|
+
</wa-comparison>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
Comparison.displayName = 'Comparison';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import { Comparison } from './Comparison';
|
|
4
|
+
|
|
5
|
+
describe('Comparison', () => {
|
|
6
|
+
it('renders without crashing', () => {
|
|
7
|
+
const { container } = render(<Comparison />);
|
|
8
|
+
expect(container.querySelector('wa-comparison')).toBeInTheDocument();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('renders slot content', () => {
|
|
12
|
+
const { container } = render(
|
|
13
|
+
<Comparison>
|
|
14
|
+
<div slot="before">Before</div>
|
|
15
|
+
<div slot="after">After</div>
|
|
16
|
+
</Comparison>
|
|
17
|
+
);
|
|
18
|
+
expect(container.querySelector('[slot="before"]')).toBeInTheDocument();
|
|
19
|
+
expect(container.querySelector('[slot="after"]')).toBeInTheDocument();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('applies custom className', () => {
|
|
23
|
+
const { container } = render(<Comparison className="custom-class" />);
|
|
24
|
+
const element = container.querySelector('wa-comparison');
|
|
25
|
+
expect(element?.getAttribute('class')).toContain('custom-class');
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render } from '@testing-library/react';
|
|
2
|
+
import { Comparison } from './Comparison';
|
|
3
|
+
|
|
4
|
+
describe('Comparison', () => {
|
|
5
|
+
it('renders without crashing', () => {
|
|
6
|
+
const { container } = render(<Comparison />);
|
|
7
|
+
expect(container.querySelector('wa-comparison')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('applies custom className', () => {
|
|
11
|
+
const { container } = render(<Comparison className="custom-class" />);
|
|
12
|
+
expect(container.querySelector('.custom-class')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { forwardRef, type HTMLAttributes } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Comparison.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Compare visual differences between similar content with a sliding panel
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <Comparison position={50}>
|
|
12
|
+
* <img slot="before" src="before.jpg" alt="Before" />
|
|
13
|
+
* <img slot="after" src="after.jpg" alt="After" />
|
|
14
|
+
* </Comparison>
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export interface ComparisonProps extends Omit<HTMLAttributes<HTMLElement>, 'dir'> {
|
|
18
|
+
/** Divider location as percentage (0-100) */
|
|
19
|
+
position?: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const Comparison = forwardRef<HTMLElement, ComparisonProps>(
|
|
23
|
+
({ children, className, ...props }, ref) => {
|
|
24
|
+
return (
|
|
25
|
+
<wa-comparison ref={ref} class={clsx('Comparison', className)} {...(props as Record<string, unknown>)}>
|
|
26
|
+
{children}
|
|
27
|
+
</wa-comparison>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
Comparison.displayName = 'Comparison';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CopyButton Component Styles
|
|
3
|
+
* Documentation: https://webawesome.com/docs/components/copy-button
|
|
4
|
+
*
|
|
5
|
+
* CSS Custom Properties:
|
|
6
|
+
* (No custom properties defined for this component)
|
|
7
|
+
*
|
|
8
|
+
* CSS Parts:
|
|
9
|
+
* - button: The internal <button> element
|
|
10
|
+
* - copy-icon: The container that holds the copy icon
|
|
11
|
+
* - success-icon: The container that holds the success icon
|
|
12
|
+
* - error-icon: The container that holds the error icon
|
|
13
|
+
* - tooltip__base: The tooltip's exported base part
|
|
14
|
+
* - tooltip__base__popup: The tooltip's exported popup part
|
|
15
|
+
* - tooltip__base__arrow: The tooltip's exported arrow part
|
|
16
|
+
* - tooltip__body: The tooltip's exported body part
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* .CopyButton::part(button) {
|
|
20
|
+
* // Custom styles
|
|
21
|
+
* }
|
|
22
|
+
*/
|
|
23
|
+
.CopyButton {
|
|
24
|
+
/* Add your custom styles here */
|
|
25
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './CopyButton.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Copies text data to the clipboard when clicked
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```jsx
|
|
11
|
+
* <CopyButton value="Text to copy" />
|
|
12
|
+
* <CopyButton from=".code-block" copy-label="Copy code" />
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export const CopyButton = React.forwardRef(
|
|
16
|
+
({ children, className, onCopy, onError, ...props }, ref) => {
|
|
17
|
+
const internalRef = React.useRef(null);
|
|
18
|
+
const elementRef = ref || internalRef;
|
|
19
|
+
|
|
20
|
+
React.useEffect(() => {
|
|
21
|
+
const el = elementRef.current;
|
|
22
|
+
if (!el) return;
|
|
23
|
+
|
|
24
|
+
const handleCopy = (e) => {
|
|
25
|
+
if (onCopy) onCopy(e);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const handleError = (e) => {
|
|
29
|
+
if (onError) onError(e);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
el.addEventListener('wa-copy', handleCopy);
|
|
33
|
+
el.addEventListener('wa-error', handleError);
|
|
34
|
+
|
|
35
|
+
return () => {
|
|
36
|
+
el.removeEventListener('wa-copy', handleCopy);
|
|
37
|
+
el.removeEventListener('wa-error', handleError);
|
|
38
|
+
};
|
|
39
|
+
}, [elementRef, onCopy, onError]);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<wa-copy-button ref={elementRef} class={clsx('CopyButton', className)} {...props}>
|
|
43
|
+
{children}
|
|
44
|
+
</wa-copy-button>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
CopyButton.displayName = 'CopyButton';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import { CopyButton } from './CopyButton';
|
|
4
|
+
|
|
5
|
+
describe('CopyButton', () => {
|
|
6
|
+
it('renders without crashing', () => {
|
|
7
|
+
const { container } = render(<CopyButton value="test" />);
|
|
8
|
+
expect(container.querySelector('wa-copy-button')).toBeInTheDocument();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('applies custom className', () => {
|
|
12
|
+
const { container } = render(<CopyButton value="test" className="custom-class" />);
|
|
13
|
+
const element = container.querySelector('wa-copy-button');
|
|
14
|
+
expect(element?.getAttribute('class')).toContain('custom-class');
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render } from '@testing-library/react';
|
|
2
|
+
import { CopyButton } from './CopyButton';
|
|
3
|
+
|
|
4
|
+
describe('CopyButton', () => {
|
|
5
|
+
it('renders without crashing', () => {
|
|
6
|
+
const { container } = render(<CopyButton value="test" />);
|
|
7
|
+
expect(container.querySelector('wa-copy-button')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('applies custom className', () => {
|
|
11
|
+
const { container } = render(<CopyButton value="test" className="custom-class" />);
|
|
12
|
+
expect(container.querySelector('.custom-class')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { forwardRef, useEffect, type HTMLAttributes } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './CopyButton.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Copies text data to the clipboard when clicked
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <CopyButton value="Text to copy" />
|
|
12
|
+
* <CopyButton from=".code-block" copy-label="Copy code" success-label="Copied!" />
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export interface CopyButtonProps extends Omit<HTMLAttributes<HTMLElement>, 'onCopy' | 'onError' | 'dir'> {
|
|
16
|
+
/** The text to copy */
|
|
17
|
+
value?: string;
|
|
18
|
+
/** Element selector to copy text from */
|
|
19
|
+
from?: string;
|
|
20
|
+
/** Disables the button */
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
/** Tooltip label for copy state */
|
|
23
|
+
'copy-label'?: string;
|
|
24
|
+
/** Tooltip label for success state */
|
|
25
|
+
'success-label'?: string;
|
|
26
|
+
/** Tooltip label for error state */
|
|
27
|
+
'error-label'?: string;
|
|
28
|
+
/** Duration of feedback state in milliseconds */
|
|
29
|
+
'feedback-duration'?: number;
|
|
30
|
+
/** Tooltip position */
|
|
31
|
+
'tooltip-placement'?: 'top' | 'right' | 'bottom' | 'left';
|
|
32
|
+
/** Event fired when copy succeeds */
|
|
33
|
+
onCopy?: (event: CustomEvent) => void;
|
|
34
|
+
/** Event fired when copy fails */
|
|
35
|
+
onError?: (event: CustomEvent) => void;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const CopyButton = forwardRef<HTMLElement, CopyButtonProps>(
|
|
39
|
+
({ children, className, onCopy, onError, ...props }, ref) => {
|
|
40
|
+
const internalRef = ref as React.RefObject<HTMLElement>;
|
|
41
|
+
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
const el = internalRef && 'current' in internalRef ? internalRef.current : null;
|
|
44
|
+
if (!el) return;
|
|
45
|
+
|
|
46
|
+
const handleCopy = (e: Event) => {
|
|
47
|
+
if (onCopy) onCopy(e as CustomEvent);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const handleError = (e: Event) => {
|
|
51
|
+
if (onError) onError(e as CustomEvent);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
el.addEventListener('wa-copy', handleCopy);
|
|
55
|
+
el.addEventListener('wa-error', handleError);
|
|
56
|
+
|
|
57
|
+
return () => {
|
|
58
|
+
el.removeEventListener('wa-copy', handleCopy);
|
|
59
|
+
el.removeEventListener('wa-error', handleError);
|
|
60
|
+
};
|
|
61
|
+
}, [internalRef, onCopy, onError]);
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<wa-copy-button ref={ref} class={clsx('CopyButton', className)} {...(props as Record<string, unknown>)}>
|
|
65
|
+
{children}
|
|
66
|
+
</wa-copy-button>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
CopyButton.displayName = 'CopyButton';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Details Component Styles
|
|
3
|
+
* Documentation: https://webawesome.com/docs/components/details
|
|
4
|
+
*
|
|
5
|
+
* CSS Custom Properties:
|
|
6
|
+
* - --spacing: The amount of space around and between the details' content
|
|
7
|
+
* - --show-duration: The show duration to use when applying built-in animation classes (Default: 200ms)
|
|
8
|
+
* - --hide-duration: The hide duration to use when applying built-in animation classes (Default: 200ms)
|
|
9
|
+
*
|
|
10
|
+
* CSS Parts:
|
|
11
|
+
* - base: The inner <details> element used to render the component
|
|
12
|
+
* - header: The header that wraps both the summary and the expand/collapse icon
|
|
13
|
+
* - summary: The container that wraps the summary
|
|
14
|
+
* - icon: The container that wraps the expand/collapse icons
|
|
15
|
+
* - content: The details content
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* .Details::part(header) {
|
|
19
|
+
* // Custom styles
|
|
20
|
+
* }
|
|
21
|
+
*/
|
|
22
|
+
.Details {
|
|
23
|
+
/* Add your custom styles here */
|
|
24
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Details.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Shows a brief summary and expands to show additional content
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```jsx
|
|
11
|
+
* <Details summary="Click to expand">
|
|
12
|
+
* <p>Hidden content that reveals when expanded.</p>
|
|
13
|
+
* </Details>
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export const Details = React.forwardRef(
|
|
17
|
+
({ children, className, onShow, onAfterShow, onHide, onAfterHide, ...props }, ref) => {
|
|
18
|
+
const detailsRef = React.useRef(null);
|
|
19
|
+
|
|
20
|
+
React.useImperativeHandle(
|
|
21
|
+
ref,
|
|
22
|
+
() => ({
|
|
23
|
+
show: () => detailsRef.current?.show?.(),
|
|
24
|
+
hide: () => detailsRef.current?.hide?.(),
|
|
25
|
+
get element() {
|
|
26
|
+
return detailsRef.current;
|
|
27
|
+
},
|
|
28
|
+
}),
|
|
29
|
+
[]
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
React.useEffect(() => {
|
|
33
|
+
const el = detailsRef.current;
|
|
34
|
+
if (!el) return;
|
|
35
|
+
|
|
36
|
+
const handleShow = (e) => onShow?.(e);
|
|
37
|
+
const handleAfterShow = (e) => onAfterShow?.(e);
|
|
38
|
+
const handleHide = (e) => onHide?.(e);
|
|
39
|
+
const handleAfterHide = (e) => onAfterHide?.(e);
|
|
40
|
+
|
|
41
|
+
el.addEventListener('wa-show', handleShow);
|
|
42
|
+
el.addEventListener('wa-after-show', handleAfterShow);
|
|
43
|
+
el.addEventListener('wa-hide', handleHide);
|
|
44
|
+
el.addEventListener('wa-after-hide', handleAfterHide);
|
|
45
|
+
|
|
46
|
+
return () => {
|
|
47
|
+
el.removeEventListener('wa-show', handleShow);
|
|
48
|
+
el.removeEventListener('wa-after-show', handleAfterShow);
|
|
49
|
+
el.removeEventListener('wa-hide', handleHide);
|
|
50
|
+
el.removeEventListener('wa-after-hide', handleAfterHide);
|
|
51
|
+
};
|
|
52
|
+
}, [onShow, onAfterShow, onHide, onAfterHide]);
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<wa-details
|
|
56
|
+
ref={detailsRef}
|
|
57
|
+
class={clsx('Details', className)}
|
|
58
|
+
{...props}
|
|
59
|
+
>
|
|
60
|
+
{children}
|
|
61
|
+
</wa-details>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
Details.displayName = 'Details';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Details } from './Details';
|
|
5
|
+
|
|
6
|
+
describe('Details', () => {
|
|
7
|
+
it('renders without crashing', () => {
|
|
8
|
+
const { container } = render(<Details summary="Test" />);
|
|
9
|
+
expect(container.querySelector('wa-details')).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('exposes ref methods', () => {
|
|
13
|
+
const ref = React.createRef();
|
|
14
|
+
render(<Details ref={ref} summary="Test" />);
|
|
15
|
+
expect(ref.current).toHaveProperty('show');
|
|
16
|
+
expect(ref.current).toHaveProperty('hide');
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('renders children', () => {
|
|
20
|
+
const { getByText } = render(
|
|
21
|
+
<Details summary="Summary">
|
|
22
|
+
Content here
|
|
23
|
+
</Details>
|
|
24
|
+
);
|
|
25
|
+
expect(getByText('Content here')).toBeInTheDocument();
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { Details } from './Details';
|
|
3
|
+
|
|
4
|
+
describe('Details', () => {
|
|
5
|
+
it('renders children', () => {
|
|
6
|
+
render(<Details summary="Summary">Test</Details>);
|
|
7
|
+
expect(screen.getByText('Test')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('applies custom className', () => {
|
|
11
|
+
const { container } = render(<Details summary="Summary" className="custom-class">Test</Details>);
|
|
12
|
+
expect(container.querySelector('.custom-class')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|