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,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Card.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* {{description}}
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* <Card>
|
|
11
|
+
* <div slot="header">Card Header</div>
|
|
12
|
+
* <p>Card content goes here</p>
|
|
13
|
+
* <div slot="footer">Card Footer</div>
|
|
14
|
+
* </Card>
|
|
15
|
+
*
|
|
16
|
+
* @param {Object} props
|
|
17
|
+
* @param {'outlined' | 'filled-outlined' | 'plain' | 'filled' | 'accent'} [props.appearance] - Visual appearance style
|
|
18
|
+
* @param {'vertical' | 'horizontal'} [props.orientation] - Card layout orientation
|
|
19
|
+
* @param {boolean} [props['with-header']] - Adds header section (for SSR)
|
|
20
|
+
* @param {boolean} [props['with-footer']] - Adds footer section (for SSR)
|
|
21
|
+
* @param {boolean} [props['with-media']] - Adds media section (for SSR)
|
|
22
|
+
* @param {string} [props.className] - Additional CSS classes
|
|
23
|
+
* @param {React.ReactNode} [props.children] - Card content
|
|
24
|
+
*/
|
|
25
|
+
export const Card = React.forwardRef(({ children, className, ...props }, ref) => {
|
|
26
|
+
return (
|
|
27
|
+
<wa-card ref={ref} class={clsx('Card', className)} {...props}>
|
|
28
|
+
{children}
|
|
29
|
+
</wa-card>
|
|
30
|
+
);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
Card.displayName = 'Card';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { Card } from './Card';
|
|
4
|
+
|
|
5
|
+
describe('Card', () => {
|
|
6
|
+
it('renders without crashing', () => {
|
|
7
|
+
render(<Card>Card content</Card>);
|
|
8
|
+
const card = screen.getByText('Card content');
|
|
9
|
+
expect(card).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('applies custom className', () => {
|
|
13
|
+
render(<Card className="custom-class">Test</Card>);
|
|
14
|
+
const card = screen.getByText('Test');
|
|
15
|
+
expect(card.className).toContain('custom-class');
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('forwards ref correctly', () => {
|
|
19
|
+
const ref = React.createRef();
|
|
20
|
+
render(<Card ref={ref}>Test</Card>);
|
|
21
|
+
expect(ref.current).toBeInstanceOf(HTMLElement);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { Card } from './Card';
|
|
3
|
+
|
|
4
|
+
describe('Card', () => {
|
|
5
|
+
it('renders children', () => {
|
|
6
|
+
render(<Card>Test</Card>);
|
|
7
|
+
expect(screen.getByText('Test')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('applies custom className', () => {
|
|
11
|
+
const { container } = render(<Card className="custom-class">Test</Card>);
|
|
12
|
+
expect(container.querySelector('.custom-class')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { forwardRef, type HTMLAttributes } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Card.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* {{description}}
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <Card>
|
|
12
|
+
* <div slot="header">Card Header</div>
|
|
13
|
+
* <p>Card content goes here</p>
|
|
14
|
+
* <div slot="footer">Card Footer</div>
|
|
15
|
+
* </Card>
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export interface CardProps extends Omit<HTMLAttributes<HTMLElement>, 'dir'> {
|
|
19
|
+
/** Visual appearance style */
|
|
20
|
+
appearance?: 'outlined' | 'filled-outlined' | 'plain' | 'filled' | 'accent';
|
|
21
|
+
/** Card layout orientation */
|
|
22
|
+
orientation?: 'vertical' | 'horizontal';
|
|
23
|
+
/** Adds header section (for SSR) */
|
|
24
|
+
'with-header'?: boolean;
|
|
25
|
+
/** Adds footer section (for SSR) */
|
|
26
|
+
'with-footer'?: boolean;
|
|
27
|
+
/** Adds media section (for SSR) */
|
|
28
|
+
'with-media'?: boolean;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const Card = forwardRef<HTMLElement, CardProps>(
|
|
32
|
+
({ children, className, ...props }, ref) => {
|
|
33
|
+
return (
|
|
34
|
+
<wa-card ref={ref} class={clsx('Card', className)} {...(props as Record<string, unknown>)}>
|
|
35
|
+
{children}
|
|
36
|
+
</wa-card>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
Card.displayName = 'Card';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Carousel Component Styles
|
|
3
|
+
* Documentation: https://webawesome.com/docs/components/carousel
|
|
4
|
+
*
|
|
5
|
+
* CSS Custom Properties:
|
|
6
|
+
* - --aspect-ratio: The aspect ratio of each slide (Default: 16/9)
|
|
7
|
+
* - --scroll-hint: The amount of padding to apply to the scroll area
|
|
8
|
+
* - --slide-gap: The space between each slide (Default: var(--wa-space-m))
|
|
9
|
+
*
|
|
10
|
+
* CSS Parts:
|
|
11
|
+
* - base: The carousel's internal wrapper
|
|
12
|
+
* - scroll-container: The scroll container that wraps the slides
|
|
13
|
+
* - pagination: The pagination indicators wrapper
|
|
14
|
+
* - pagination-item: The pagination indicator
|
|
15
|
+
* - pagination-item-active: Applied when the item is active
|
|
16
|
+
* - navigation: The navigation wrapper
|
|
17
|
+
* - navigation-button: The navigation button
|
|
18
|
+
* - navigation-button-previous: Applied to the previous button
|
|
19
|
+
* - navigation-button-next: Applied to the next button
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* .Carousel::part(base) {
|
|
23
|
+
* // Custom styles
|
|
24
|
+
* }
|
|
25
|
+
*/
|
|
26
|
+
.Carousel {
|
|
27
|
+
/* Add your custom styles here */
|
|
28
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Carousel.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Displays an arbitrary number of content slides along a horizontal or vertical axis
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```jsx
|
|
11
|
+
* <Carousel navigation pagination loop>
|
|
12
|
+
* <CarouselItem>Slide 1</CarouselItem>
|
|
13
|
+
* <CarouselItem>Slide 2</CarouselItem>
|
|
14
|
+
* <CarouselItem>Slide 3</CarouselItem>
|
|
15
|
+
* </Carousel>
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @typedef {Object} CarouselProps
|
|
19
|
+
* @property {boolean} [autoplay] - Automatically scrolls slides
|
|
20
|
+
* @property {number} [autoplay-interval] - Milliseconds between scrolls
|
|
21
|
+
* @property {boolean} [loop] - Allows infinite navigation
|
|
22
|
+
* @property {boolean} [mouse-dragging] - Enables mouse dragging
|
|
23
|
+
* @property {boolean} [navigation] - Shows navigation buttons
|
|
24
|
+
* @property {'horizontal'|'vertical'} [orientation] - Layout direction
|
|
25
|
+
* @property {boolean} [pagination] - Shows pagination dots
|
|
26
|
+
* @property {number} [slides-per-move] - Slides to advance per scroll
|
|
27
|
+
* @property {number} [slides-per-page] - Visible slides count
|
|
28
|
+
* @property {(event: CustomEvent) => void} [onSlideChange] - Slide change handler
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
export const Carousel = React.forwardRef(
|
|
32
|
+
({ children, className, onSlideChange, ...props }, ref) => {
|
|
33
|
+
const carouselRef = React.useRef(null);
|
|
34
|
+
|
|
35
|
+
React.useImperativeHandle(
|
|
36
|
+
ref,
|
|
37
|
+
() => ({
|
|
38
|
+
goToSlide: (index, behavior) => {
|
|
39
|
+
carouselRef.current?.goToSlide?.(index, behavior);
|
|
40
|
+
},
|
|
41
|
+
next: (behavior) => {
|
|
42
|
+
carouselRef.current?.next?.(behavior);
|
|
43
|
+
},
|
|
44
|
+
previous: (behavior) => {
|
|
45
|
+
carouselRef.current?.previous?.(behavior);
|
|
46
|
+
},
|
|
47
|
+
get element() {
|
|
48
|
+
return carouselRef.current;
|
|
49
|
+
},
|
|
50
|
+
}),
|
|
51
|
+
[]
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
React.useEffect(() => {
|
|
55
|
+
const el = carouselRef.current;
|
|
56
|
+
if (!el) return;
|
|
57
|
+
|
|
58
|
+
const handleSlideChange = (e) => {
|
|
59
|
+
if (onSlideChange) onSlideChange(e);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
el.addEventListener('wa-slide-change', handleSlideChange);
|
|
63
|
+
|
|
64
|
+
return () => {
|
|
65
|
+
el.removeEventListener('wa-slide-change', handleSlideChange);
|
|
66
|
+
};
|
|
67
|
+
}, [onSlideChange]);
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<wa-carousel
|
|
71
|
+
ref={carouselRef}
|
|
72
|
+
class={clsx('Carousel', className)}
|
|
73
|
+
{...props}
|
|
74
|
+
>
|
|
75
|
+
{children}
|
|
76
|
+
</wa-carousel>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
Carousel.displayName = 'Carousel';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Carousel } from './Carousel';
|
|
5
|
+
|
|
6
|
+
describe('Carousel', () => {
|
|
7
|
+
it('renders without crashing', () => {
|
|
8
|
+
const { container } = render(<Carousel />);
|
|
9
|
+
expect(container.querySelector('wa-carousel')).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('exposes ref methods', () => {
|
|
13
|
+
const ref = React.createRef();
|
|
14
|
+
render(<Carousel ref={ref} />);
|
|
15
|
+
expect(ref.current).toHaveProperty('goToSlide');
|
|
16
|
+
expect(ref.current).toHaveProperty('next');
|
|
17
|
+
expect(ref.current).toHaveProperty('previous');
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('applies custom className', () => {
|
|
21
|
+
const { container } = render(<Carousel className="custom-class" />);
|
|
22
|
+
const element = container.querySelector('wa-carousel');
|
|
23
|
+
expect(element?.getAttribute('class')).toContain('custom-class');
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { Carousel } from './Carousel';
|
|
3
|
+
|
|
4
|
+
describe('Carousel', () => {
|
|
5
|
+
it('renders children', () => {
|
|
6
|
+
render(<Carousel>Test</Carousel>);
|
|
7
|
+
expect(screen.getByText('Test')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('applies custom className', () => {
|
|
11
|
+
const { container } = render(<Carousel className="custom-class">Test</Carousel>);
|
|
12
|
+
expect(container.querySelector('.custom-class')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { forwardRef, useRef, useImperativeHandle, useEffect, type HTMLAttributes } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Carousel.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Displays an arbitrary number of content slides along a horizontal or vertical axis
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <Carousel navigation pagination loop>
|
|
12
|
+
* <CarouselItem>Slide 1</CarouselItem>
|
|
13
|
+
* <CarouselItem>Slide 2</CarouselItem>
|
|
14
|
+
* <CarouselItem>Slide 3</CarouselItem>
|
|
15
|
+
* </Carousel>
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export interface CarouselProps extends Omit<HTMLAttributes<HTMLElement>, 'dir'> {
|
|
19
|
+
/** Automatically scrolls slides when user isn't interacting */
|
|
20
|
+
autoplay?: boolean;
|
|
21
|
+
/** Milliseconds between automatic scrolls */
|
|
22
|
+
'autoplay-interval'?: number;
|
|
23
|
+
/** Allows infinite navigation in same direction */
|
|
24
|
+
loop?: boolean;
|
|
25
|
+
/** Enables dragging slides with mouse */
|
|
26
|
+
'mouse-dragging'?: boolean;
|
|
27
|
+
/** Shows previous/next buttons */
|
|
28
|
+
navigation?: boolean;
|
|
29
|
+
/** Carousel layout direction */
|
|
30
|
+
orientation?: 'horizontal' | 'vertical';
|
|
31
|
+
/** Shows slide indicator dots */
|
|
32
|
+
pagination?: boolean;
|
|
33
|
+
/** Number of slides to advance per scroll */
|
|
34
|
+
'slides-per-move'?: number;
|
|
35
|
+
/** Number of slides visible at once */
|
|
36
|
+
'slides-per-page'?: number;
|
|
37
|
+
/** Event fired when the active slide changes */
|
|
38
|
+
onSlideChange?: (event: CustomEvent) => void;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface CarouselRef {
|
|
42
|
+
goToSlide: (index: number, behavior?: ScrollBehavior) => void;
|
|
43
|
+
next: (behavior?: ScrollBehavior) => void;
|
|
44
|
+
previous: (behavior?: ScrollBehavior) => void;
|
|
45
|
+
element: HTMLElement | null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const Carousel = forwardRef<CarouselRef, CarouselProps>(
|
|
49
|
+
({ children, className, onSlideChange, ...props }, ref) => {
|
|
50
|
+
const carouselRef = useRef<HTMLElement & {
|
|
51
|
+
goToSlide?: (index: number, behavior?: ScrollBehavior) => void;
|
|
52
|
+
next?: (behavior?: ScrollBehavior) => void;
|
|
53
|
+
previous?: (behavior?: ScrollBehavior) => void;
|
|
54
|
+
}>(null);
|
|
55
|
+
|
|
56
|
+
useImperativeHandle(
|
|
57
|
+
ref,
|
|
58
|
+
() => ({
|
|
59
|
+
goToSlide: (index: number, behavior?: ScrollBehavior) => {
|
|
60
|
+
if (carouselRef.current && typeof carouselRef.current.goToSlide === 'function') {
|
|
61
|
+
carouselRef.current.goToSlide(index, behavior);
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
next: (behavior?: ScrollBehavior) => {
|
|
65
|
+
if (carouselRef.current && typeof carouselRef.current.next === 'function') {
|
|
66
|
+
carouselRef.current.next(behavior);
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
previous: (behavior?: ScrollBehavior) => {
|
|
70
|
+
if (carouselRef.current && typeof carouselRef.current.previous === 'function') {
|
|
71
|
+
carouselRef.current.previous(behavior);
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
get element() {
|
|
75
|
+
return carouselRef.current;
|
|
76
|
+
},
|
|
77
|
+
}),
|
|
78
|
+
[]
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
const el = carouselRef.current;
|
|
83
|
+
if (!el) return;
|
|
84
|
+
|
|
85
|
+
const handleSlideChange = (e: Event) => {
|
|
86
|
+
if (onSlideChange) onSlideChange(e as CustomEvent);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
el.addEventListener('wa-slide-change', handleSlideChange);
|
|
90
|
+
|
|
91
|
+
return () => {
|
|
92
|
+
el.removeEventListener('wa-slide-change', handleSlideChange);
|
|
93
|
+
};
|
|
94
|
+
}, [onSlideChange]);
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<wa-carousel
|
|
98
|
+
ref={carouselRef}
|
|
99
|
+
class={clsx('Carousel', className)}
|
|
100
|
+
{...(props as Record<string, unknown>)}
|
|
101
|
+
>
|
|
102
|
+
{children}
|
|
103
|
+
</wa-carousel>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
Carousel.displayName = 'Carousel';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CarouselItem Component Styles
|
|
3
|
+
* Documentation: https://webawesome.com/docs/components/carousel-item
|
|
4
|
+
*
|
|
5
|
+
* CSS Custom Properties:
|
|
6
|
+
* - --aspect-ratio: The slide's aspect ratio (inherited from the carousel by default)
|
|
7
|
+
*
|
|
8
|
+
* CSS Parts:
|
|
9
|
+
* (No CSS parts defined for this component)
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* .CarouselItem {
|
|
13
|
+
* // Custom styles
|
|
14
|
+
* }
|
|
15
|
+
*/
|
|
16
|
+
.CarouselItem {
|
|
17
|
+
/* Add your custom styles here */
|
|
18
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './CarouselItem.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Represents an individual slide within a carousel component
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```jsx
|
|
11
|
+
* <Carousel>
|
|
12
|
+
* <CarouselItem>
|
|
13
|
+
* <img src="slide1.jpg" alt="Slide 1" />
|
|
14
|
+
* </CarouselItem>
|
|
15
|
+
* </Carousel>
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export const CarouselItem = React.forwardRef(
|
|
19
|
+
({ children, className, ...props }, ref) => {
|
|
20
|
+
return (
|
|
21
|
+
<wa-carousel-item ref={ref} class={clsx('CarouselItem', className)} {...props}>
|
|
22
|
+
{children}
|
|
23
|
+
</wa-carousel-item>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
CarouselItem.displayName = 'CarouselItem';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import { CarouselItem } from './CarouselItem';
|
|
4
|
+
|
|
5
|
+
describe('CarouselItem', () => {
|
|
6
|
+
it('renders without crashing', () => {
|
|
7
|
+
const { container } = render(<CarouselItem />);
|
|
8
|
+
expect(container.querySelector('wa-carousel-item')).toBeInTheDocument();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('renders children', () => {
|
|
12
|
+
const { getByText } = render(<CarouselItem>Slide Content</CarouselItem>);
|
|
13
|
+
expect(getByText('Slide Content')).toBeInTheDocument();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('applies custom className', () => {
|
|
17
|
+
const { container } = render(<CarouselItem className="custom-class" />);
|
|
18
|
+
const element = container.querySelector('wa-carousel-item');
|
|
19
|
+
expect(element?.getAttribute('class')).toContain('custom-class');
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { CarouselItem } from './CarouselItem';
|
|
3
|
+
|
|
4
|
+
describe('CarouselItem', () => {
|
|
5
|
+
it('renders children', () => {
|
|
6
|
+
render(<CarouselItem>Test</CarouselItem>);
|
|
7
|
+
expect(screen.getByText('Test')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('applies custom className', () => {
|
|
11
|
+
const { container } = render(<CarouselItem className="custom-class">Test</CarouselItem>);
|
|
12
|
+
expect(container.querySelector('.custom-class')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { forwardRef, type HTMLAttributes } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './CarouselItem.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Represents an individual slide within a carousel component
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <Carousel>
|
|
12
|
+
* <CarouselItem>
|
|
13
|
+
* <img src="slide1.jpg" alt="Slide 1" />
|
|
14
|
+
* </CarouselItem>
|
|
15
|
+
* <CarouselItem>
|
|
16
|
+
* <img src="slide2.jpg" alt="Slide 2" />
|
|
17
|
+
* </CarouselItem>
|
|
18
|
+
* </Carousel>
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export type CarouselItemProps = Omit<HTMLAttributes<HTMLElement>, 'dir'>;
|
|
22
|
+
|
|
23
|
+
export const CarouselItem = forwardRef<HTMLElement, CarouselItemProps>(
|
|
24
|
+
({ children, className, ...props }, ref) => {
|
|
25
|
+
return (
|
|
26
|
+
<wa-carousel-item ref={ref} class={clsx('CarouselItem', className)} {...(props as Record<string, unknown>)}>
|
|
27
|
+
{children}
|
|
28
|
+
</wa-carousel-item>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
CarouselItem.displayName = 'CarouselItem';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checkbox Component Styles
|
|
3
|
+
* Documentation: https://webawesome.com/docs/components/checkbox
|
|
4
|
+
*
|
|
5
|
+
* CSS Custom Properties:
|
|
6
|
+
* - --checked-icon-color: The color of the checked and indeterminate icons
|
|
7
|
+
* - --checked-icon-scale: The size of the checked and indeterminate icons relative to the checkbox
|
|
8
|
+
*
|
|
9
|
+
* CSS Parts:
|
|
10
|
+
* - base: The component's label
|
|
11
|
+
* - control: The square container that wraps the checkbox's checked state
|
|
12
|
+
* - checked-icon: The checked icon, a <wa-icon> element
|
|
13
|
+
* - indeterminate-icon: The indeterminate icon, a <wa-icon> element
|
|
14
|
+
* - label: The container that wraps the checkbox's label
|
|
15
|
+
* - hint: The hint's wrapper
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* .Checkbox::part(control) {
|
|
19
|
+
* // Custom styles
|
|
20
|
+
* }
|
|
21
|
+
*/
|
|
22
|
+
.Checkbox {
|
|
23
|
+
/* Add your custom styles here */
|
|
24
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Checkbox.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Checkboxes allow the user to toggle an option on or off
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```jsx
|
|
11
|
+
* <Checkbox checked>Remember me</Checkbox>
|
|
12
|
+
* <Checkbox indeterminate>Select all</Checkbox>
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @typedef {Object} CheckboxProps
|
|
16
|
+
* @property {boolean} [checked] - Checked state
|
|
17
|
+
* @property {boolean} [disabled] - Disabled state
|
|
18
|
+
* @property {string} [hint] - Helper text
|
|
19
|
+
* @property {boolean} [indeterminate] - Mixed state
|
|
20
|
+
* @property {string} [name] - Form field name
|
|
21
|
+
* @property {boolean} [required] - Required field
|
|
22
|
+
* @property {'small'|'medium'|'large'} [size] - Checkbox size
|
|
23
|
+
* @property {string} [value] - Form value
|
|
24
|
+
* @property {(event: CustomEvent) => void} [onInvalid] - Invalid handler
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
export const Checkbox = React.forwardRef(
|
|
28
|
+
({ children, className, onInvalid, ...props }, ref) => {
|
|
29
|
+
const checkboxRef = React.useRef(null);
|
|
30
|
+
|
|
31
|
+
React.useImperativeHandle(
|
|
32
|
+
ref,
|
|
33
|
+
() => ({
|
|
34
|
+
focus: (options) => {
|
|
35
|
+
checkboxRef.current?.focus?.(options);
|
|
36
|
+
},
|
|
37
|
+
blur: () => {
|
|
38
|
+
checkboxRef.current?.blur?.();
|
|
39
|
+
},
|
|
40
|
+
click: () => {
|
|
41
|
+
checkboxRef.current?.click?.();
|
|
42
|
+
},
|
|
43
|
+
setCustomValidity: (message) => {
|
|
44
|
+
checkboxRef.current?.setCustomValidity?.(message);
|
|
45
|
+
},
|
|
46
|
+
get element() {
|
|
47
|
+
return checkboxRef.current;
|
|
48
|
+
},
|
|
49
|
+
}),
|
|
50
|
+
[]
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
React.useEffect(() => {
|
|
54
|
+
const el = checkboxRef.current;
|
|
55
|
+
if (!el) return;
|
|
56
|
+
|
|
57
|
+
const handleInvalid = (e) => {
|
|
58
|
+
if (onInvalid) onInvalid(e);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
el.addEventListener('wa-invalid', handleInvalid);
|
|
62
|
+
|
|
63
|
+
return () => {
|
|
64
|
+
el.removeEventListener('wa-invalid', handleInvalid);
|
|
65
|
+
};
|
|
66
|
+
}, [onInvalid]);
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<wa-checkbox
|
|
70
|
+
ref={checkboxRef}
|
|
71
|
+
class={clsx('Checkbox', className)}
|
|
72
|
+
{...props}
|
|
73
|
+
>
|
|
74
|
+
{children}
|
|
75
|
+
</wa-checkbox>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
Checkbox.displayName = 'Checkbox';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Checkbox } from './Checkbox';
|
|
5
|
+
|
|
6
|
+
describe('Checkbox', () => {
|
|
7
|
+
it('renders without crashing', () => {
|
|
8
|
+
const { container } = render(<Checkbox />);
|
|
9
|
+
expect(container.querySelector('wa-checkbox')).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('exposes ref methods', () => {
|
|
13
|
+
const ref = React.createRef();
|
|
14
|
+
render(<Checkbox ref={ref} />);
|
|
15
|
+
expect(ref.current).toHaveProperty('focus');
|
|
16
|
+
expect(ref.current).toHaveProperty('blur');
|
|
17
|
+
expect(ref.current).toHaveProperty('click');
|
|
18
|
+
expect(ref.current).toHaveProperty('setCustomValidity');
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('renders children as label', () => {
|
|
22
|
+
const { getByText } = render(<Checkbox>Accept terms</Checkbox>);
|
|
23
|
+
expect(getByText('Accept terms')).toBeInTheDocument();
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { Checkbox } from './Checkbox';
|
|
3
|
+
|
|
4
|
+
describe('Checkbox', () => {
|
|
5
|
+
it('renders children', () => {
|
|
6
|
+
render(<Checkbox>Test</Checkbox>);
|
|
7
|
+
expect(screen.getByText('Test')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('applies custom className', () => {
|
|
11
|
+
const { container } = render(<Checkbox className="custom-class">Test</Checkbox>);
|
|
12
|
+
expect(container.querySelector('.custom-class')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|