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,27 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Drawer } from './Drawer';
|
|
5
|
+
|
|
6
|
+
describe('Drawer', () => {
|
|
7
|
+
it('renders without crashing', () => {
|
|
8
|
+
const { container } = render(<Drawer label="Test" />);
|
|
9
|
+
expect(container.querySelector('wa-drawer')).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('exposes ref methods', () => {
|
|
13
|
+
const ref = React.createRef();
|
|
14
|
+
render(<Drawer ref={ref} label="Test" />);
|
|
15
|
+
expect(ref.current).toHaveProperty('show');
|
|
16
|
+
expect(ref.current).toHaveProperty('hide');
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('renders children', () => {
|
|
20
|
+
const { getByText } = render(
|
|
21
|
+
<Drawer label="Test">
|
|
22
|
+
Content here
|
|
23
|
+
</Drawer>
|
|
24
|
+
);
|
|
25
|
+
expect(getByText('Content here')).toBeInTheDocument();
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { Drawer } from './Drawer';
|
|
3
|
+
|
|
4
|
+
describe('Drawer', () => {
|
|
5
|
+
it('renders children', () => {
|
|
6
|
+
render(<Drawer label="Test">Test</Drawer>);
|
|
7
|
+
expect(screen.getByText('Test')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('applies custom className', () => {
|
|
11
|
+
const { container } = render(<Drawer label="Test" className="custom-class">Test</Drawer>);
|
|
12
|
+
expect(container.querySelector('.custom-class')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { forwardRef, useRef, useImperativeHandle, useEffect, type HTMLAttributes } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Drawer.css';
|
|
5
|
+
|
|
6
|
+
export interface DrawerProps extends Omit<HTMLAttributes<HTMLElement>, 'onLoad' | 'dir'> {
|
|
7
|
+
/** Indicates whether or not the drawer is open */
|
|
8
|
+
open?: boolean;
|
|
9
|
+
/** The drawer's label as displayed in the header */
|
|
10
|
+
label?: string;
|
|
11
|
+
/** The direction from which the drawer will open */
|
|
12
|
+
placement?: 'top' | 'end' | 'bottom' | 'start';
|
|
13
|
+
/** When enabled, the drawer will be closed when the user clicks outside of it */
|
|
14
|
+
'light-dismiss'?: boolean;
|
|
15
|
+
/** Disables the header and removes the default close button */
|
|
16
|
+
'without-header'?: boolean;
|
|
17
|
+
/** Event fired when the drawer is shown */
|
|
18
|
+
onShow?: (event: CustomEvent) => void;
|
|
19
|
+
/** Event fired after the drawer is shown */
|
|
20
|
+
onAfterShow?: (event: CustomEvent) => void;
|
|
21
|
+
/** Event fired when the drawer is about to hide */
|
|
22
|
+
onHide?: (event: CustomEvent) => void;
|
|
23
|
+
/** Event fired after the drawer is hidden */
|
|
24
|
+
onAfterHide?: (event: CustomEvent) => void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface DrawerRef {
|
|
28
|
+
show: () => void;
|
|
29
|
+
hide: () => void;
|
|
30
|
+
element: HTMLElement | null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const Drawer = forwardRef<DrawerRef, DrawerProps>(
|
|
34
|
+
({ children, className, open, onShow, onAfterShow, onHide, onAfterHide, ...props }, ref) => {
|
|
35
|
+
const drawerRef = useRef<HTMLElement & {
|
|
36
|
+
show?: () => void;
|
|
37
|
+
hide?: () => void;
|
|
38
|
+
open?: boolean;
|
|
39
|
+
}>(null);
|
|
40
|
+
|
|
41
|
+
useImperativeHandle(
|
|
42
|
+
ref,
|
|
43
|
+
() => ({
|
|
44
|
+
show: () => drawerRef.current?.show?.(),
|
|
45
|
+
hide: () => drawerRef.current?.hide?.(),
|
|
46
|
+
get element() {
|
|
47
|
+
return drawerRef.current;
|
|
48
|
+
},
|
|
49
|
+
}),
|
|
50
|
+
[]
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
const el = drawerRef.current;
|
|
55
|
+
if (!el || open === undefined) return;
|
|
56
|
+
|
|
57
|
+
const isOpen = el.open ?? false;
|
|
58
|
+
if (open && !isOpen) {
|
|
59
|
+
el.show?.();
|
|
60
|
+
} else if (!open && isOpen) {
|
|
61
|
+
el.hide?.();
|
|
62
|
+
}
|
|
63
|
+
}, [open]);
|
|
64
|
+
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
const el = drawerRef.current;
|
|
67
|
+
if (!el) return;
|
|
68
|
+
|
|
69
|
+
const handleShow = (e: Event) => onShow?.(e as CustomEvent);
|
|
70
|
+
const handleAfterShow = (e: Event) => onAfterShow?.(e as CustomEvent);
|
|
71
|
+
const handleHide = (e: Event) => onHide?.(e as CustomEvent);
|
|
72
|
+
const handleAfterHide = (e: Event) => onAfterHide?.(e as CustomEvent);
|
|
73
|
+
|
|
74
|
+
el.addEventListener('wa-show', handleShow);
|
|
75
|
+
el.addEventListener('wa-after-show', handleAfterShow);
|
|
76
|
+
el.addEventListener('wa-hide', handleHide);
|
|
77
|
+
el.addEventListener('wa-after-hide', handleAfterHide);
|
|
78
|
+
|
|
79
|
+
return () => {
|
|
80
|
+
el.removeEventListener('wa-show', handleShow);
|
|
81
|
+
el.removeEventListener('wa-after-show', handleAfterShow);
|
|
82
|
+
el.removeEventListener('wa-hide', handleHide);
|
|
83
|
+
el.removeEventListener('wa-after-hide', handleAfterHide);
|
|
84
|
+
};
|
|
85
|
+
}, [onShow, onAfterShow, onHide, onAfterHide]);
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<wa-drawer
|
|
89
|
+
ref={drawerRef}
|
|
90
|
+
class={clsx('Drawer', className)}
|
|
91
|
+
{...(props as Record<string, unknown>)}
|
|
92
|
+
>
|
|
93
|
+
{children}
|
|
94
|
+
</wa-drawer>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
Drawer.displayName = 'Drawer';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dropdown Component Styles
|
|
3
|
+
* Documentation: https://webawesome.com/docs/components/dropdown
|
|
4
|
+
*
|
|
5
|
+
* CSS Custom Properties:
|
|
6
|
+
* - --show-duration: The duration of the show animation
|
|
7
|
+
* - --hide-duration: The duration of the hide animation
|
|
8
|
+
*
|
|
9
|
+
* CSS Parts:
|
|
10
|
+
* - base: The component's host element
|
|
11
|
+
* - menu: The dropdown menu container
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* .Dropdown::part(menu) {
|
|
15
|
+
* // Custom styles
|
|
16
|
+
* }
|
|
17
|
+
*/
|
|
18
|
+
.Dropdown {
|
|
19
|
+
/* Add your custom styles here */
|
|
20
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Dropdown.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {Object} DropdownRef
|
|
8
|
+
* @property {() => void} show
|
|
9
|
+
* @property {() => void} hide
|
|
10
|
+
* @property {HTMLElement | null} element
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export const Dropdown = React.forwardRef(
|
|
14
|
+
({ children, className, open, onShow, onAfterShow, onHide, onAfterHide, onSelect, ...props }, ref) => {
|
|
15
|
+
const dropdownRef = React.useRef(null);
|
|
16
|
+
|
|
17
|
+
React.useImperativeHandle(
|
|
18
|
+
ref,
|
|
19
|
+
() => ({
|
|
20
|
+
show: () => dropdownRef.current?.show?.(),
|
|
21
|
+
hide: () => dropdownRef.current?.hide?.(),
|
|
22
|
+
get element() {
|
|
23
|
+
return dropdownRef.current;
|
|
24
|
+
},
|
|
25
|
+
}),
|
|
26
|
+
[]
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
React.useEffect(() => {
|
|
30
|
+
const el = dropdownRef.current;
|
|
31
|
+
if (!el || open === undefined) return;
|
|
32
|
+
|
|
33
|
+
const isOpen = el.open ?? false;
|
|
34
|
+
if (open && !isOpen) {
|
|
35
|
+
el.show?.();
|
|
36
|
+
} else if (!open && isOpen) {
|
|
37
|
+
el.hide?.();
|
|
38
|
+
}
|
|
39
|
+
}, [open]);
|
|
40
|
+
|
|
41
|
+
React.useEffect(() => {
|
|
42
|
+
const el = dropdownRef.current;
|
|
43
|
+
if (!el) return;
|
|
44
|
+
|
|
45
|
+
const handleShow = (e) => onShow?.(e);
|
|
46
|
+
const handleAfterShow = (e) => onAfterShow?.(e);
|
|
47
|
+
const handleHide = (e) => onHide?.(e);
|
|
48
|
+
const handleAfterHide = (e) => onAfterHide?.(e);
|
|
49
|
+
const handleSelect = (e) => onSelect?.(e);
|
|
50
|
+
|
|
51
|
+
el.addEventListener('wa-show', handleShow);
|
|
52
|
+
el.addEventListener('wa-after-show', handleAfterShow);
|
|
53
|
+
el.addEventListener('wa-hide', handleHide);
|
|
54
|
+
el.addEventListener('wa-after-hide', handleAfterHide);
|
|
55
|
+
el.addEventListener('wa-select', handleSelect);
|
|
56
|
+
|
|
57
|
+
return () => {
|
|
58
|
+
el.removeEventListener('wa-show', handleShow);
|
|
59
|
+
el.removeEventListener('wa-after-show', handleAfterShow);
|
|
60
|
+
el.removeEventListener('wa-hide', handleHide);
|
|
61
|
+
el.removeEventListener('wa-after-hide', handleAfterHide);
|
|
62
|
+
el.removeEventListener('wa-select', handleSelect);
|
|
63
|
+
};
|
|
64
|
+
}, [onShow, onAfterShow, onHide, onAfterHide, onSelect]);
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<wa-dropdown
|
|
68
|
+
ref={dropdownRef}
|
|
69
|
+
class={clsx('Dropdown', className)}
|
|
70
|
+
{...props}
|
|
71
|
+
>
|
|
72
|
+
{children}
|
|
73
|
+
</wa-dropdown>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
Dropdown.displayName = 'Dropdown';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Dropdown } from './Dropdown';
|
|
5
|
+
|
|
6
|
+
describe('Dropdown', () => {
|
|
7
|
+
it('renders without crashing', () => {
|
|
8
|
+
const { container } = render(<Dropdown />);
|
|
9
|
+
expect(container.querySelector('wa-dropdown')).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('exposes ref methods', () => {
|
|
13
|
+
const ref = React.createRef();
|
|
14
|
+
render(<Dropdown ref={ref} />);
|
|
15
|
+
expect(ref.current).toHaveProperty('show');
|
|
16
|
+
expect(ref.current).toHaveProperty('hide');
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { Dropdown } from './Dropdown';
|
|
3
|
+
|
|
4
|
+
describe('Dropdown', () => {
|
|
5
|
+
it('renders children', () => {
|
|
6
|
+
render(<Dropdown>Test</Dropdown>);
|
|
7
|
+
expect(screen.getByText('Test')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('applies custom className', () => {
|
|
11
|
+
const { container } = render(<Dropdown className="custom-class">Test</Dropdown>);
|
|
12
|
+
expect(container.querySelector('.custom-class')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { forwardRef, useRef, useImperativeHandle, useEffect, type HTMLAttributes } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Dropdown.css';
|
|
5
|
+
|
|
6
|
+
export interface DropdownProps extends Omit<HTMLAttributes<HTMLElement>, 'dir' | 'onSelect'> {
|
|
7
|
+
/** Opens or closes the dropdown */
|
|
8
|
+
open?: boolean;
|
|
9
|
+
/** The placement of the dropdown menu */
|
|
10
|
+
placement?: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'right' | 'right-start' | 'right-end' | 'left' | 'left-start' | 'left-end';
|
|
11
|
+
/** The dropdown's size */
|
|
12
|
+
size?: 'small' | 'medium' | 'large';
|
|
13
|
+
/** The distance of the dropdown menu from its trigger */
|
|
14
|
+
distance?: number;
|
|
15
|
+
/** The offset of the dropdown menu along its trigger */
|
|
16
|
+
skidding?: number;
|
|
17
|
+
/** Event fired when the dropdown is shown */
|
|
18
|
+
onShow?: (event: CustomEvent) => void;
|
|
19
|
+
/** Event fired after the dropdown is shown */
|
|
20
|
+
onAfterShow?: (event: CustomEvent) => void;
|
|
21
|
+
/** Event fired when the dropdown is about to hide */
|
|
22
|
+
onHide?: (event: CustomEvent) => void;
|
|
23
|
+
/** Event fired after the dropdown is hidden */
|
|
24
|
+
onAfterHide?: (event: CustomEvent) => void;
|
|
25
|
+
/** Event fired when an item is selected */
|
|
26
|
+
onSelect?: (event: CustomEvent) => void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface DropdownRef {
|
|
30
|
+
show: () => void;
|
|
31
|
+
hide: () => void;
|
|
32
|
+
element: HTMLElement | null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const Dropdown = forwardRef<DropdownRef, DropdownProps>(
|
|
36
|
+
({ children, className, open, onShow, onAfterShow, onHide, onAfterHide, onSelect, ...props }, ref) => {
|
|
37
|
+
const dropdownRef = useRef<HTMLElement & {
|
|
38
|
+
show?: () => void;
|
|
39
|
+
hide?: () => void;
|
|
40
|
+
open?: boolean;
|
|
41
|
+
}>(null);
|
|
42
|
+
|
|
43
|
+
useImperativeHandle(
|
|
44
|
+
ref,
|
|
45
|
+
() => ({
|
|
46
|
+
show: () => dropdownRef.current?.show?.(),
|
|
47
|
+
hide: () => dropdownRef.current?.hide?.(),
|
|
48
|
+
get element() {
|
|
49
|
+
return dropdownRef.current;
|
|
50
|
+
},
|
|
51
|
+
}),
|
|
52
|
+
[]
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
const el = dropdownRef.current;
|
|
57
|
+
if (!el || open === undefined) return;
|
|
58
|
+
|
|
59
|
+
const isOpen = el.open ?? false;
|
|
60
|
+
if (open && !isOpen) {
|
|
61
|
+
el.show?.();
|
|
62
|
+
} else if (!open && isOpen) {
|
|
63
|
+
el.hide?.();
|
|
64
|
+
}
|
|
65
|
+
}, [open]);
|
|
66
|
+
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
const el = dropdownRef.current;
|
|
69
|
+
if (!el) return;
|
|
70
|
+
|
|
71
|
+
const handleShow = (e: Event) => onShow?.(e as CustomEvent);
|
|
72
|
+
const handleAfterShow = (e: Event) => onAfterShow?.(e as CustomEvent);
|
|
73
|
+
const handleHide = (e: Event) => onHide?.(e as CustomEvent);
|
|
74
|
+
const handleAfterHide = (e: Event) => onAfterHide?.(e as CustomEvent);
|
|
75
|
+
const handleSelect = (e: Event) => onSelect?.(e as CustomEvent);
|
|
76
|
+
|
|
77
|
+
el.addEventListener('wa-show', handleShow);
|
|
78
|
+
el.addEventListener('wa-after-show', handleAfterShow);
|
|
79
|
+
el.addEventListener('wa-hide', handleHide);
|
|
80
|
+
el.addEventListener('wa-after-hide', handleAfterHide);
|
|
81
|
+
el.addEventListener('wa-select', handleSelect);
|
|
82
|
+
|
|
83
|
+
return () => {
|
|
84
|
+
el.removeEventListener('wa-show', handleShow);
|
|
85
|
+
el.removeEventListener('wa-after-show', handleAfterShow);
|
|
86
|
+
el.removeEventListener('wa-hide', handleHide);
|
|
87
|
+
el.removeEventListener('wa-after-hide', handleAfterHide);
|
|
88
|
+
el.removeEventListener('wa-select', handleSelect);
|
|
89
|
+
};
|
|
90
|
+
}, [onShow, onAfterShow, onHide, onAfterHide, onSelect]);
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
<wa-dropdown
|
|
94
|
+
ref={dropdownRef}
|
|
95
|
+
class={clsx('Dropdown', className)}
|
|
96
|
+
{...(props as Record<string, unknown>)}
|
|
97
|
+
>
|
|
98
|
+
{children}
|
|
99
|
+
</wa-dropdown>
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
Dropdown.displayName = 'Dropdown';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DropdownItem Component Styles
|
|
3
|
+
* Documentation: https://webawesome.com/docs/components/dropdown-item
|
|
4
|
+
*
|
|
5
|
+
* CSS Custom Properties:
|
|
6
|
+
* (No custom properties defined for this component)
|
|
7
|
+
*
|
|
8
|
+
* CSS Parts:
|
|
9
|
+
* - checkmark: The checkmark icon (a <wa-icon> element) when the item is a checkbox
|
|
10
|
+
* - icon: The container for the icon slot
|
|
11
|
+
* - label: The container for the label slot
|
|
12
|
+
* - details: The container for the details slot
|
|
13
|
+
* - submenu-icon: The submenu indicator icon (a <wa-icon> element)
|
|
14
|
+
* - submenu: The submenu container
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* .DropdownItem::part(label) {
|
|
18
|
+
* // Custom styles
|
|
19
|
+
* }
|
|
20
|
+
*/
|
|
21
|
+
.DropdownItem {
|
|
22
|
+
/* Add your custom styles here */
|
|
23
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './DropdownItem.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {Object} DropdownItemRef
|
|
8
|
+
* @property {() => void} openSubmenu
|
|
9
|
+
* @property {() => void} closeSubmenu
|
|
10
|
+
* @property {HTMLElement | null} element
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export const DropdownItem = React.forwardRef(
|
|
14
|
+
({ children, className, ...props }, ref) => {
|
|
15
|
+
const itemRef = React.useRef(null);
|
|
16
|
+
|
|
17
|
+
React.useImperativeHandle(
|
|
18
|
+
ref,
|
|
19
|
+
() => ({
|
|
20
|
+
openSubmenu: () => itemRef.current?.openSubmenu?.(),
|
|
21
|
+
closeSubmenu: () => itemRef.current?.closeSubmenu?.(),
|
|
22
|
+
get element() {
|
|
23
|
+
return itemRef.current;
|
|
24
|
+
},
|
|
25
|
+
}),
|
|
26
|
+
[]
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<wa-dropdown-item
|
|
31
|
+
ref={itemRef}
|
|
32
|
+
class={clsx('DropdownItem', className)}
|
|
33
|
+
{...props}
|
|
34
|
+
>
|
|
35
|
+
{children}
|
|
36
|
+
</wa-dropdown-item>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
DropdownItem.displayName = 'DropdownItem';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { DropdownItem } from './DropdownItem';
|
|
5
|
+
|
|
6
|
+
describe('DropdownItem', () => {
|
|
7
|
+
it('renders without crashing', () => {
|
|
8
|
+
const { container } = render(<DropdownItem>Item</DropdownItem>);
|
|
9
|
+
expect(container.querySelector('wa-dropdown-item')).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('exposes ref methods', () => {
|
|
13
|
+
const ref = React.createRef();
|
|
14
|
+
render(<DropdownItem ref={ref}>Item</DropdownItem>);
|
|
15
|
+
expect(ref.current).toHaveProperty('openSubmenu');
|
|
16
|
+
expect(ref.current).toHaveProperty('closeSubmenu');
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { DropdownItem } from './DropdownItem';
|
|
3
|
+
|
|
4
|
+
describe('DropdownItem', () => {
|
|
5
|
+
it('renders children', () => {
|
|
6
|
+
render(<DropdownItem>Test</DropdownItem>);
|
|
7
|
+
expect(screen.getByText('Test')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('applies custom className', () => {
|
|
11
|
+
const { container } = render(<DropdownItem className="custom-class">Test</DropdownItem>);
|
|
12
|
+
expect(container.querySelector('.custom-class')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { forwardRef, useRef, useImperativeHandle, type HTMLAttributes } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './DropdownItem.css';
|
|
5
|
+
|
|
6
|
+
export interface DropdownItemProps extends Omit<HTMLAttributes<HTMLElement>, 'dir'> {
|
|
7
|
+
/** The dropdown item's type */
|
|
8
|
+
type?: 'normal' | 'checkbox';
|
|
9
|
+
/** Set to true to check the dropdown item (only valid when type is checkbox) */
|
|
10
|
+
checked?: boolean;
|
|
11
|
+
/** Disables the dropdown item */
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
/** An optional value for the menu item */
|
|
14
|
+
value?: string;
|
|
15
|
+
/** The type of menu item to render */
|
|
16
|
+
variant?: 'default' | 'danger';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface DropdownItemRef {
|
|
20
|
+
openSubmenu: () => void;
|
|
21
|
+
closeSubmenu: () => void;
|
|
22
|
+
element: HTMLElement | null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const DropdownItem = forwardRef<DropdownItemRef, DropdownItemProps>(
|
|
26
|
+
({ children, className, ...props }, ref) => {
|
|
27
|
+
const itemRef = useRef<HTMLElement & {
|
|
28
|
+
openSubmenu?: () => void;
|
|
29
|
+
closeSubmenu?: () => void;
|
|
30
|
+
}>(null);
|
|
31
|
+
|
|
32
|
+
useImperativeHandle(
|
|
33
|
+
ref,
|
|
34
|
+
() => ({
|
|
35
|
+
openSubmenu: () => itemRef.current?.openSubmenu?.(),
|
|
36
|
+
closeSubmenu: () => itemRef.current?.closeSubmenu?.(),
|
|
37
|
+
get element() {
|
|
38
|
+
return itemRef.current;
|
|
39
|
+
},
|
|
40
|
+
}),
|
|
41
|
+
[]
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<wa-dropdown-item
|
|
46
|
+
ref={itemRef}
|
|
47
|
+
class={clsx('DropdownItem', className)}
|
|
48
|
+
{...(props as Record<string, unknown>)}
|
|
49
|
+
>
|
|
50
|
+
{children}
|
|
51
|
+
</wa-dropdown-item>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
DropdownItem.displayName = 'DropdownItem';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FormatBytes Component Styles
|
|
3
|
+
* Documentation: https://webawesome.com/docs/components/format-bytes
|
|
4
|
+
*
|
|
5
|
+
* CSS Custom Properties:
|
|
6
|
+
* (No custom properties defined for this component)
|
|
7
|
+
*
|
|
8
|
+
* CSS Parts:
|
|
9
|
+
* (No CSS parts defined for this component)
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* .FormatBytes {
|
|
13
|
+
* // Custom styles
|
|
14
|
+
* }
|
|
15
|
+
*/
|
|
16
|
+
.FormatBytes {
|
|
17
|
+
/* Add your custom styles here */
|
|
18
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './FormatBytes.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {Object} FormatBytesProps
|
|
8
|
+
* @property {number} value - The number to format in bytes
|
|
9
|
+
* @property {'byte' | 'bit'} [unit] - The type of unit to display
|
|
10
|
+
* @property {'long' | 'short' | 'narrow'} [display] - Determines how to display the result
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export const FormatBytes = React.forwardRef(
|
|
14
|
+
({ className, ...props }, ref) => {
|
|
15
|
+
return (
|
|
16
|
+
<wa-format-bytes
|
|
17
|
+
ref={ref}
|
|
18
|
+
class={clsx('FormatBytes', className)}
|
|
19
|
+
{...props}
|
|
20
|
+
/>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
FormatBytes.displayName = 'FormatBytes';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { FormatBytes } from './FormatBytes';
|
|
5
|
+
|
|
6
|
+
describe('FormatBytes', () => {
|
|
7
|
+
it('renders without crashing', () => {
|
|
8
|
+
const { container } = render(<FormatBytes value={1024} />);
|
|
9
|
+
expect(container.querySelector('wa-format-bytes')).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('applies value prop', () => {
|
|
13
|
+
const { container } = render(<FormatBytes value={2048} />);
|
|
14
|
+
expect(container.querySelector('wa-format-bytes')).toHaveAttribute('value', '2048');
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render } from '@testing-library/react';
|
|
2
|
+
import { FormatBytes } from './FormatBytes';
|
|
3
|
+
|
|
4
|
+
describe('FormatBytes', () => {
|
|
5
|
+
it('renders without crashing', () => {
|
|
6
|
+
const { container } = render(<FormatBytes value={1024} />);
|
|
7
|
+
expect(container.querySelector('wa-format-bytes')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('applies custom className', () => {
|
|
11
|
+
const { container } = render(<FormatBytes value={1024} className="custom-class" />);
|
|
12
|
+
expect(container.querySelector('.custom-class')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { forwardRef, type HTMLAttributes } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './FormatBytes.css';
|
|
5
|
+
|
|
6
|
+
export interface FormatBytesProps extends Omit<HTMLAttributes<HTMLElement>, 'dir'> {
|
|
7
|
+
/** The number to format in bytes */
|
|
8
|
+
value: number;
|
|
9
|
+
/** The type of unit to display */
|
|
10
|
+
unit?: 'byte' | 'bit';
|
|
11
|
+
/** Determines how to display the result */
|
|
12
|
+
display?: 'long' | 'short' | 'narrow';
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const FormatBytes = forwardRef<HTMLElement, FormatBytesProps>(
|
|
16
|
+
({ className, ...props }, ref) => {
|
|
17
|
+
return (
|
|
18
|
+
<wa-format-bytes
|
|
19
|
+
ref={ref}
|
|
20
|
+
class={clsx('FormatBytes', className)}
|
|
21
|
+
{...(props as Record<string, unknown>)}
|
|
22
|
+
/>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
FormatBytes.displayName = 'FormatBytes';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FormatDate Component Styles
|
|
3
|
+
* Documentation: https://webawesome.com/docs/components/format-date
|
|
4
|
+
*
|
|
5
|
+
* CSS Custom Properties:
|
|
6
|
+
* (No custom properties defined for this component)
|
|
7
|
+
*
|
|
8
|
+
* CSS Parts:
|
|
9
|
+
* (No CSS parts defined for this component)
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* .FormatDate {
|
|
13
|
+
* // Custom styles
|
|
14
|
+
* }
|
|
15
|
+
*/
|
|
16
|
+
.FormatDate {
|
|
17
|
+
/* Add your custom styles here */
|
|
18
|
+
}
|