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,100 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Animation.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* {{description}}
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```jsx
|
|
11
|
+
* // Using built-in animations
|
|
12
|
+
* <Animation name="bounce" duration={2000} play>
|
|
13
|
+
* <div className="box">Bouncing!</div>
|
|
14
|
+
* </Animation>
|
|
15
|
+
*
|
|
16
|
+
* // Using ref methods
|
|
17
|
+
* const animRef = React.useRef(null);
|
|
18
|
+
* <button onClick={() => animRef.current?.cancel()}>Cancel</button>
|
|
19
|
+
* <Animation ref={animRef} name="pulse" iterations={3}>
|
|
20
|
+
* <div>Content</div>
|
|
21
|
+
* </Animation>
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @typedef {Object} AnimationProps
|
|
25
|
+
* @property {string} [name] - The name of the built-in animation to use
|
|
26
|
+
* @property {boolean} [play] - Plays the animation
|
|
27
|
+
* @property {number} [delay] - Milliseconds to delay the start
|
|
28
|
+
* @property {string} [direction] - Direction of playback
|
|
29
|
+
* @property {number} [duration] - Milliseconds each iteration takes
|
|
30
|
+
* @property {string} [easing] - The easing function to use
|
|
31
|
+
* @property {number} [iterations] - Number of iterations to run
|
|
32
|
+
* @property {function} [onCancel] - Event fired when canceled
|
|
33
|
+
* @property {function} [onFinish] - Event fired when finished
|
|
34
|
+
* @property {function} [onStart] - Event fired when started
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
export const Animation = React.forwardRef(
|
|
38
|
+
({ children, className, onCancel, onFinish, onStart, ...props }, ref) => {
|
|
39
|
+
const animationRef = React.useRef(null);
|
|
40
|
+
|
|
41
|
+
React.useImperativeHandle(
|
|
42
|
+
ref,
|
|
43
|
+
() => ({
|
|
44
|
+
cancel: () => {
|
|
45
|
+
if (animationRef.current && typeof animationRef.current.cancel === 'function') {
|
|
46
|
+
animationRef.current.cancel();
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
finish: () => {
|
|
50
|
+
if (animationRef.current && typeof animationRef.current.finish === 'function') {
|
|
51
|
+
animationRef.current.finish();
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
get element() {
|
|
55
|
+
return animationRef.current;
|
|
56
|
+
},
|
|
57
|
+
}),
|
|
58
|
+
[]
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
React.useEffect(() => {
|
|
62
|
+
const el = animationRef.current;
|
|
63
|
+
if (!el) return;
|
|
64
|
+
|
|
65
|
+
const handleCancel = (e) => {
|
|
66
|
+
if (onCancel) onCancel(e);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const handleFinish = (e) => {
|
|
70
|
+
if (onFinish) onFinish(e);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const handleStart = (e) => {
|
|
74
|
+
if (onStart) onStart(e);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
el.addEventListener('wa-cancel', handleCancel);
|
|
78
|
+
el.addEventListener('wa-finish', handleFinish);
|
|
79
|
+
el.addEventListener('wa-start', handleStart);
|
|
80
|
+
|
|
81
|
+
return () => {
|
|
82
|
+
el.removeEventListener('wa-cancel', handleCancel);
|
|
83
|
+
el.removeEventListener('wa-finish', handleFinish);
|
|
84
|
+
el.removeEventListener('wa-start', handleStart);
|
|
85
|
+
};
|
|
86
|
+
}, [onCancel, onFinish, onStart]);
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<wa-animation
|
|
90
|
+
ref={animationRef}
|
|
91
|
+
class={clsx('Animation', className)}
|
|
92
|
+
{...props}
|
|
93
|
+
>
|
|
94
|
+
{children}
|
|
95
|
+
</wa-animation>
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
Animation.displayName = 'Animation';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import { Animation } from './Animation';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
describe('Animation', () => {
|
|
7
|
+
it('renders without crashing', () => {
|
|
8
|
+
const { container } = render(
|
|
9
|
+
<Animation name="bounce">
|
|
10
|
+
<div>Content</div>
|
|
11
|
+
</Animation>
|
|
12
|
+
);
|
|
13
|
+
expect(container.querySelector('wa-animation')).toBeInTheDocument();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('exposes ref methods', () => {
|
|
17
|
+
const ref = React.createRef();
|
|
18
|
+
render(
|
|
19
|
+
<Animation ref={ref} name="pulse">
|
|
20
|
+
<div>Content</div>
|
|
21
|
+
</Animation>
|
|
22
|
+
);
|
|
23
|
+
expect(ref.current).toHaveProperty('cancel');
|
|
24
|
+
expect(ref.current).toHaveProperty('finish');
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('passes animation props', () => {
|
|
28
|
+
const { container } = render(
|
|
29
|
+
<Animation name="bounce" duration={2000} iterations={3}>
|
|
30
|
+
<div>Content</div>
|
|
31
|
+
</Animation>
|
|
32
|
+
);
|
|
33
|
+
const element = container.querySelector('wa-animation');
|
|
34
|
+
expect(element?.getAttribute('name')).toBe('bounce');
|
|
35
|
+
expect(element?.getAttribute('duration')).toBe('2000');
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { Animation } from './Animation';
|
|
3
|
+
|
|
4
|
+
describe('Animation', () => {
|
|
5
|
+
it('renders children', () => {
|
|
6
|
+
render(<Animation>Test</Animation>);
|
|
7
|
+
expect(screen.getByText('Test')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('applies custom className', () => {
|
|
11
|
+
const { container } = render(<Animation className="custom-class">Test</Animation>);
|
|
12
|
+
expect(container.querySelector('.custom-class')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { forwardRef, useRef, useImperativeHandle, useEffect, type HTMLAttributes } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Animation.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* {{description}}
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* // Using built-in animations
|
|
12
|
+
* <Animation name="bounce" duration={2000} play>
|
|
13
|
+
* <div className="box">Bouncing!</div>
|
|
14
|
+
* </Animation>
|
|
15
|
+
*
|
|
16
|
+
* // Using ref methods
|
|
17
|
+
* const animRef = useRef<AnimationRef>(null);
|
|
18
|
+
* <button onClick={() => animRef.current?.cancel()}>Cancel</button>
|
|
19
|
+
* <Animation ref={animRef} name="pulse" iterations={3}>
|
|
20
|
+
* <div>Content</div>
|
|
21
|
+
* </Animation>
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export interface AnimationProps extends Omit<HTMLAttributes<HTMLElement>, 'dir'> {
|
|
25
|
+
/** The name of the built-in animation to use */
|
|
26
|
+
name?: string;
|
|
27
|
+
/** Plays the animation. When omitted, the animation will be paused */
|
|
28
|
+
play?: boolean;
|
|
29
|
+
/** The number of milliseconds to delay the start of the animation */
|
|
30
|
+
delay?: number;
|
|
31
|
+
/** Determines the direction of playback */
|
|
32
|
+
direction?: 'normal' | 'reverse' | 'alternate' | 'alternate-reverse';
|
|
33
|
+
/** The number of milliseconds each iteration takes to complete */
|
|
34
|
+
duration?: number;
|
|
35
|
+
/** The easing function to use */
|
|
36
|
+
easing?: string;
|
|
37
|
+
/** The number of milliseconds to delay after the active period */
|
|
38
|
+
'end-delay'?: number;
|
|
39
|
+
/** Sets how the animation applies styles before and after execution */
|
|
40
|
+
fill?: 'auto' | 'backwards' | 'both' | 'forwards' | 'none';
|
|
41
|
+
/** The number of iterations to run before completing */
|
|
42
|
+
iterations?: number;
|
|
43
|
+
/** The offset at which to start the animation */
|
|
44
|
+
'iteration-start'?: number;
|
|
45
|
+
/** Sets the animation's playback rate */
|
|
46
|
+
'playback-rate'?: number;
|
|
47
|
+
/** Event fired when the animation is canceled */
|
|
48
|
+
onCancel?: (event: CustomEvent) => void;
|
|
49
|
+
/** Event fired when the animation finishes */
|
|
50
|
+
onFinish?: (event: CustomEvent) => void;
|
|
51
|
+
/** Event fired when the animation starts or restarts */
|
|
52
|
+
onStart?: (event: CustomEvent) => void;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface AnimationRef {
|
|
56
|
+
cancel: () => void;
|
|
57
|
+
finish: () => void;
|
|
58
|
+
element: HTMLElement | null;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export const Animation = forwardRef<AnimationRef, AnimationProps>(
|
|
62
|
+
({ children, className, onCancel, onFinish, onStart, ...props }, ref) => {
|
|
63
|
+
const animationRef = useRef<HTMLElement & {
|
|
64
|
+
cancel?: () => void;
|
|
65
|
+
finish?: () => void;
|
|
66
|
+
}>(null);
|
|
67
|
+
|
|
68
|
+
useImperativeHandle(
|
|
69
|
+
ref,
|
|
70
|
+
() => ({
|
|
71
|
+
cancel: () => {
|
|
72
|
+
if (animationRef.current && typeof animationRef.current.cancel === 'function') {
|
|
73
|
+
animationRef.current.cancel();
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
finish: () => {
|
|
77
|
+
if (animationRef.current && typeof animationRef.current.finish === 'function') {
|
|
78
|
+
animationRef.current.finish();
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
get element() {
|
|
82
|
+
return animationRef.current;
|
|
83
|
+
},
|
|
84
|
+
}),
|
|
85
|
+
[]
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
const el = animationRef.current;
|
|
90
|
+
if (!el) return;
|
|
91
|
+
|
|
92
|
+
const handleCancel = (e: Event) => {
|
|
93
|
+
if (onCancel) onCancel(e as CustomEvent);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const handleFinish = (e: Event) => {
|
|
97
|
+
if (onFinish) onFinish(e as CustomEvent);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const handleStart = (e: Event) => {
|
|
101
|
+
if (onStart) onStart(e as CustomEvent);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
el.addEventListener('wa-cancel', handleCancel);
|
|
105
|
+
el.addEventListener('wa-finish', handleFinish);
|
|
106
|
+
el.addEventListener('wa-start', handleStart);
|
|
107
|
+
|
|
108
|
+
return () => {
|
|
109
|
+
el.removeEventListener('wa-cancel', handleCancel);
|
|
110
|
+
el.removeEventListener('wa-finish', handleFinish);
|
|
111
|
+
el.removeEventListener('wa-start', handleStart);
|
|
112
|
+
};
|
|
113
|
+
}, [onCancel, onFinish, onStart]);
|
|
114
|
+
|
|
115
|
+
return (
|
|
116
|
+
<wa-animation
|
|
117
|
+
ref={animationRef}
|
|
118
|
+
class={clsx('Animation', className)}
|
|
119
|
+
{...(props as Record<string, unknown>)}
|
|
120
|
+
>
|
|
121
|
+
{children}
|
|
122
|
+
</wa-animation>
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
Animation.displayName = 'Animation';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Avatar Component Styles
|
|
3
|
+
* Documentation: https://webawesome.com/docs/components/avatar
|
|
4
|
+
*
|
|
5
|
+
* CSS Custom Properties:
|
|
6
|
+
* - --size: The size of the avatar
|
|
7
|
+
*
|
|
8
|
+
* CSS Parts:
|
|
9
|
+
* - icon: The container that wraps the avatar's icon
|
|
10
|
+
* - initials: The container that wraps the avatar's initials
|
|
11
|
+
* - image: The avatar image. Only shown when the image attribute is set
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* .Avatar::part(icon) {
|
|
15
|
+
* // Custom styles
|
|
16
|
+
* }
|
|
17
|
+
*/
|
|
18
|
+
.Avatar {
|
|
19
|
+
/* Add your custom styles here */
|
|
20
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Avatar.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* {{description}}
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```jsx
|
|
11
|
+
* // With image
|
|
12
|
+
* <Avatar image="https://example.com/avatar.jpg" label="User avatar" />
|
|
13
|
+
*
|
|
14
|
+
* // With initials
|
|
15
|
+
* <Avatar initials="JD" label="John Doe" />
|
|
16
|
+
*
|
|
17
|
+
* // With custom icon
|
|
18
|
+
* <Avatar label="Settings">
|
|
19
|
+
* <wa-icon slot="icon" name="gear" />
|
|
20
|
+
* </Avatar>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @typedef {Object} AvatarProps
|
|
24
|
+
* @property {string} [image] - The image source to use for the avatar
|
|
25
|
+
* @property {string} label - A label for assistive devices (required)
|
|
26
|
+
* @property {string} [initials] - Initials to use as fallback
|
|
27
|
+
* @property {string} [loading] - How the browser should load the image
|
|
28
|
+
* @property {string} [shape] - The shape of the avatar
|
|
29
|
+
* @property {function} [onError] - Event fired when image fails to load
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
export const Avatar = React.forwardRef(
|
|
33
|
+
({ children, className, onError, ...props }, ref) => {
|
|
34
|
+
const elementRef = React.useRef(null);
|
|
35
|
+
|
|
36
|
+
React.useImperativeHandle(ref, () => elementRef.current, []);
|
|
37
|
+
|
|
38
|
+
React.useEffect(() => {
|
|
39
|
+
const el = elementRef.current;
|
|
40
|
+
if (!el || !onError) return;
|
|
41
|
+
|
|
42
|
+
const handleError = (e) => {
|
|
43
|
+
onError(e);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
el.addEventListener('wa-error', handleError);
|
|
47
|
+
|
|
48
|
+
return () => {
|
|
49
|
+
el.removeEventListener('wa-error', handleError);
|
|
50
|
+
};
|
|
51
|
+
}, [onError]);
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<wa-avatar
|
|
55
|
+
ref={elementRef}
|
|
56
|
+
class={clsx('Avatar', className)}
|
|
57
|
+
{...props}
|
|
58
|
+
>
|
|
59
|
+
{children}
|
|
60
|
+
</wa-avatar>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
Avatar.displayName = 'Avatar';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import { Avatar } from './Avatar';
|
|
4
|
+
|
|
5
|
+
describe('Avatar', () => {
|
|
6
|
+
it('renders without crashing', () => {
|
|
7
|
+
const { container } = render(<Avatar label="User avatar" />);
|
|
8
|
+
expect(container.querySelector('wa-avatar')).toBeInTheDocument();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('applies custom className', () => {
|
|
12
|
+
const { container } = render(
|
|
13
|
+
<Avatar label="User" className="custom-class" />
|
|
14
|
+
);
|
|
15
|
+
const element = container.querySelector('wa-avatar');
|
|
16
|
+
expect(element?.getAttribute('class')).toContain('custom-class');
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('passes image and label props', () => {
|
|
20
|
+
const { container } = render(
|
|
21
|
+
<Avatar image="avatar.jpg" label="John Doe" />
|
|
22
|
+
);
|
|
23
|
+
const element = container.querySelector('wa-avatar');
|
|
24
|
+
expect(element?.getAttribute('image')).toBe('avatar.jpg');
|
|
25
|
+
expect(element?.getAttribute('label')).toBe('John Doe');
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('passes initials prop', () => {
|
|
29
|
+
const { container } = render(<Avatar initials="JD" label="John Doe" />);
|
|
30
|
+
const element = container.querySelector('wa-avatar');
|
|
31
|
+
expect(element?.getAttribute('initials')).toBe('JD');
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render } from '@testing-library/react';
|
|
2
|
+
import { Avatar } from './Avatar';
|
|
3
|
+
|
|
4
|
+
describe('Avatar', () => {
|
|
5
|
+
it('renders without crashing', () => {
|
|
6
|
+
const { container } = render(<Avatar />);
|
|
7
|
+
expect(container.querySelector('wa-avatar')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('applies custom className', () => {
|
|
11
|
+
const { container } = render(<Avatar className="custom-class" />);
|
|
12
|
+
expect(container.querySelector('.custom-class')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { forwardRef, useRef, useImperativeHandle, useEffect, type HTMLAttributes } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Avatar.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* {{description}}
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* // With image
|
|
12
|
+
* <Avatar image="https://example.com/avatar.jpg" label="User avatar" />
|
|
13
|
+
*
|
|
14
|
+
* // With initials
|
|
15
|
+
* <Avatar initials="JD" label="John Doe" />
|
|
16
|
+
*
|
|
17
|
+
* // With custom icon
|
|
18
|
+
* <Avatar label="Settings">
|
|
19
|
+
* <wa-icon slot="icon" name="gear" />
|
|
20
|
+
* </Avatar>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export interface AvatarProps extends Omit<HTMLAttributes<HTMLElement>, 'onError' | 'dir'> {
|
|
24
|
+
/** The image source to use for the avatar */
|
|
25
|
+
image?: string;
|
|
26
|
+
/** A label to use to describe the avatar to assistive devices */
|
|
27
|
+
label: string;
|
|
28
|
+
/** Initials to use as a fallback when no image is available */
|
|
29
|
+
initials?: string;
|
|
30
|
+
/** Indicates how the browser should load the image */
|
|
31
|
+
loading?: 'eager' | 'lazy';
|
|
32
|
+
/** The shape of the avatar */
|
|
33
|
+
shape?: 'circle' | 'square' | 'rounded';
|
|
34
|
+
/** Event fired when the image could not be loaded */
|
|
35
|
+
onError?: (event: CustomEvent) => void;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const Avatar = forwardRef<HTMLElement, AvatarProps>(
|
|
39
|
+
({ children, className, onError, ...props }, ref) => {
|
|
40
|
+
const elementRef = useRef<HTMLElement>(null);
|
|
41
|
+
|
|
42
|
+
useImperativeHandle(ref, () => elementRef.current as HTMLElement, []);
|
|
43
|
+
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
const el = elementRef.current;
|
|
46
|
+
if (!el || !onError) return;
|
|
47
|
+
|
|
48
|
+
const handleError = (e: Event) => {
|
|
49
|
+
onError(e as CustomEvent);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
el.addEventListener('wa-error', handleError);
|
|
53
|
+
|
|
54
|
+
return () => {
|
|
55
|
+
el.removeEventListener('wa-error', handleError);
|
|
56
|
+
};
|
|
57
|
+
}, [onError]);
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<wa-avatar
|
|
61
|
+
ref={elementRef}
|
|
62
|
+
class={clsx('Avatar', className)}
|
|
63
|
+
{...(props as Record<string, unknown>)}
|
|
64
|
+
>
|
|
65
|
+
{children}
|
|
66
|
+
</wa-avatar>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
Avatar.displayName = 'Avatar';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Badge Component Styles
|
|
3
|
+
* Documentation: https://webawesome.com/docs/components/badge
|
|
4
|
+
*
|
|
5
|
+
* CSS Custom Properties:
|
|
6
|
+
* - --pulse-color: The color of the badge's pulse effect when using attention="pulse"
|
|
7
|
+
*
|
|
8
|
+
* CSS Parts:
|
|
9
|
+
* - base: The component's base wrapper
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* .Badge::part(base) {
|
|
13
|
+
* // Custom styles
|
|
14
|
+
* }
|
|
15
|
+
*/
|
|
16
|
+
.Badge {
|
|
17
|
+
/* Add your custom styles here */
|
|
18
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Badge.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* {{description}}
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```jsx
|
|
11
|
+
* // Basic badge
|
|
12
|
+
* <Badge>New</Badge>
|
|
13
|
+
*
|
|
14
|
+
* // Variants
|
|
15
|
+
* <Badge variant="success">Success</Badge>
|
|
16
|
+
* <Badge variant="warning">Warning</Badge>
|
|
17
|
+
* <Badge variant="danger">Error</Badge>
|
|
18
|
+
*
|
|
19
|
+
* // Pill style with attention
|
|
20
|
+
* <Badge pill attention="pulse">5</Badge>
|
|
21
|
+
*
|
|
22
|
+
* // On buttons
|
|
23
|
+
* <Button>
|
|
24
|
+
* Notifications
|
|
25
|
+
* <Badge pill>3</Badge>
|
|
26
|
+
* </Button>
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @typedef {Object} BadgeProps
|
|
30
|
+
* @property {string} [variant] - The badge's theme variant
|
|
31
|
+
* @property {string} [appearance] - The badge's visual appearance
|
|
32
|
+
* @property {boolean} [pill] - Draws a pill-style badge
|
|
33
|
+
* @property {string} [attention] - Adds an animation to draw attention
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
export const Badge = React.forwardRef(
|
|
37
|
+
({ children, className, ...props }, ref) => {
|
|
38
|
+
return (
|
|
39
|
+
<wa-badge ref={ref} class={clsx('Badge', className)} {...props}>
|
|
40
|
+
{children}
|
|
41
|
+
</wa-badge>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
Badge.displayName = 'Badge';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import { Badge } from './Badge';
|
|
4
|
+
|
|
5
|
+
describe('Badge', () => {
|
|
6
|
+
it('renders without crashing', () => {
|
|
7
|
+
const { container } = render(<Badge>Test</Badge>);
|
|
8
|
+
expect(container.querySelector('wa-badge')).toBeInTheDocument();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('applies custom className', () => {
|
|
12
|
+
const { container } = render(<Badge className="custom-class">Test</Badge>);
|
|
13
|
+
const element = container.querySelector('wa-badge');
|
|
14
|
+
expect(element?.getAttribute('class')).toContain('custom-class');
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('passes variant prop', () => {
|
|
18
|
+
const { container } = render(<Badge variant="success">Success</Badge>);
|
|
19
|
+
const element = container.querySelector('wa-badge');
|
|
20
|
+
expect(element?.getAttribute('variant')).toBe('success');
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('passes pill prop', () => {
|
|
24
|
+
const { container } = render(<Badge pill>5</Badge>);
|
|
25
|
+
const element = container.querySelector('wa-badge');
|
|
26
|
+
expect(element?.hasAttribute('pill')).toBe(true);
|
|
27
|
+
});
|
|
28
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { Badge } from './Badge';
|
|
3
|
+
|
|
4
|
+
describe('Badge', () => {
|
|
5
|
+
it('renders children', () => {
|
|
6
|
+
render(<Badge>Test</Badge>);
|
|
7
|
+
expect(screen.getByText('Test')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('applies custom className', () => {
|
|
11
|
+
const { container } = render(<Badge className="custom-class">Test</Badge>);
|
|
12
|
+
expect(container.querySelector('.custom-class')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { forwardRef, type HTMLAttributes } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Badge.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* {{description}}
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* // Basic badge
|
|
12
|
+
* <Badge>New</Badge>
|
|
13
|
+
*
|
|
14
|
+
* // Variants
|
|
15
|
+
* <Badge variant="success">Success</Badge>
|
|
16
|
+
* <Badge variant="warning">Warning</Badge>
|
|
17
|
+
* <Badge variant="danger">Error</Badge>
|
|
18
|
+
*
|
|
19
|
+
* // Pill style with attention
|
|
20
|
+
* <Badge pill attention="pulse">5</Badge>
|
|
21
|
+
*
|
|
22
|
+
* // On buttons
|
|
23
|
+
* <Button>
|
|
24
|
+
* Notifications
|
|
25
|
+
* <Badge pill>3</Badge>
|
|
26
|
+
* </Button>
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export interface BadgeProps extends Omit<HTMLAttributes<HTMLElement>, 'dir'> {
|
|
30
|
+
/** The badge's theme variant */
|
|
31
|
+
variant?: 'brand' | 'neutral' | 'success' | 'warning' | 'danger';
|
|
32
|
+
/** The badge's visual appearance */
|
|
33
|
+
appearance?: 'accent' | 'filled' | 'outlined' | 'filled-outlined';
|
|
34
|
+
/** Draws a pill-style badge with rounded edges */
|
|
35
|
+
pill?: boolean;
|
|
36
|
+
/** Adds an animation to draw attention to the badge */
|
|
37
|
+
attention?: 'none' | 'pulse' | 'bounce';
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const Badge = forwardRef<HTMLElement, BadgeProps>(
|
|
41
|
+
({ children, className, ...props }, ref) => {
|
|
42
|
+
return (
|
|
43
|
+
<wa-badge ref={ref} class={clsx('Badge', className)} {...(props as Record<string, unknown>)}>
|
|
44
|
+
{children}
|
|
45
|
+
</wa-badge>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
Badge.displayName = 'Badge';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Breadcrumb Component Styles
|
|
3
|
+
* Documentation: https://webawesome.com/docs/components/breadcrumb
|
|
4
|
+
*
|
|
5
|
+
* CSS Custom Properties:
|
|
6
|
+
* (No custom properties defined for this component)
|
|
7
|
+
*
|
|
8
|
+
* CSS Parts:
|
|
9
|
+
* - base: The component's base wrapper
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* .Breadcrumb::part(base) {
|
|
13
|
+
* // Custom styles
|
|
14
|
+
* }
|
|
15
|
+
*/
|
|
16
|
+
.Breadcrumb {
|
|
17
|
+
/* Add your custom styles here */
|
|
18
|
+
}
|