kigumi 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +407 -0
- package/dist/chunk-FG4CIVPT.js +52 -0
- package/dist/chunk-IRCCX2A2.js +72 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6119 -0
- package/dist/path-aliases-3OJ2RKTE.js +95 -0
- package/dist/path-aliases-44XMTAAA.js +89 -0
- package/dist/path-aliases-CNBMGBKE.js +98 -0
- package/dist/path-aliases-L6USUZ4R.js +91 -0
- package/dist/path-aliases-NX2TDEHO.js +92 -0
- package/dist/path-aliases-ZRNAAXX2.js +94 -0
- package/dist/project-config-3XEQHIUM.js +115 -0
- package/dist/project-config-4YGWM3KJ.js +92 -0
- package/dist/project-config-YLUSQM7U.js +108 -0
- package/dist/templates/AGENTS.md +214 -0
- package/dist/templates/react/AnimatedImage/AnimatedImage.css.hbs +19 -0
- package/dist/templates/react/AnimatedImage/AnimatedImage.jsx.hbs +64 -0
- package/dist/templates/react/AnimatedImage/AnimatedImage.test.jsx.hbs +29 -0
- package/dist/templates/react/AnimatedImage/AnimatedImage.test.tsx.hbs +14 -0
- package/dist/templates/react/AnimatedImage/AnimatedImage.tsx.hbs +68 -0
- package/dist/templates/react/Animation/Animation.css.hbs +18 -0
- package/dist/templates/react/Animation/Animation.jsx.hbs +100 -0
- package/dist/templates/react/Animation/Animation.test.jsx.hbs +37 -0
- package/dist/templates/react/Animation/Animation.test.tsx.hbs +14 -0
- package/dist/templates/react/Animation/Animation.tsx.hbs +127 -0
- package/dist/templates/react/Avatar/Avatar.css.hbs +20 -0
- package/dist/templates/react/Avatar/Avatar.jsx.hbs +65 -0
- package/dist/templates/react/Avatar/Avatar.test.jsx.hbs +33 -0
- package/dist/templates/react/Avatar/Avatar.test.tsx.hbs +14 -0
- package/dist/templates/react/Avatar/Avatar.tsx.hbs +71 -0
- package/dist/templates/react/Badge/Badge.css.hbs +18 -0
- package/dist/templates/react/Badge/Badge.jsx.hbs +46 -0
- package/dist/templates/react/Badge/Badge.test.jsx.hbs +28 -0
- package/dist/templates/react/Badge/Badge.test.tsx.hbs +14 -0
- package/dist/templates/react/Badge/Badge.tsx.hbs +50 -0
- package/dist/templates/react/Breadcrumb/Breadcrumb.css.hbs +18 -0
- package/dist/templates/react/Breadcrumb/Breadcrumb.jsx.hbs +48 -0
- package/dist/templates/react/Breadcrumb/Breadcrumb.test.jsx.hbs +34 -0
- package/dist/templates/react/Breadcrumb/Breadcrumb.test.tsx.hbs +14 -0
- package/dist/templates/react/Breadcrumb/Breadcrumb.tsx.hbs +49 -0
- package/dist/templates/react/BreadcrumbItem/BreadcrumbItem.css.hbs +21 -0
- package/dist/templates/react/BreadcrumbItem/BreadcrumbItem.jsx.hbs +55 -0
- package/dist/templates/react/BreadcrumbItem/BreadcrumbItem.test.jsx.hbs +36 -0
- package/dist/templates/react/BreadcrumbItem/BreadcrumbItem.test.tsx.hbs +14 -0
- package/dist/templates/react/BreadcrumbItem/BreadcrumbItem.tsx.hbs +58 -0
- package/dist/templates/react/Button/Button.css.hbs +23 -0
- package/dist/templates/react/Button/Button.jsx.hbs +106 -0
- package/dist/templates/react/Button/Button.test.jsx.hbs +23 -0
- package/dist/templates/react/Button/Button.test.tsx.hbs +14 -0
- package/dist/templates/react/Button/Button.tsx.hbs +131 -0
- package/dist/templates/react/Card/Card.css.hbs +21 -0
- package/dist/templates/react/Card/Card.jsx.hbs +33 -0
- package/dist/templates/react/Card/Card.test.jsx.hbs +23 -0
- package/dist/templates/react/Card/Card.test.tsx.hbs +14 -0
- package/dist/templates/react/Card/Card.tsx.hbs +41 -0
- package/dist/templates/react/Carousel/Carousel.css.hbs +28 -0
- package/dist/templates/react/Carousel/Carousel.jsx.hbs +81 -0
- package/dist/templates/react/Carousel/Carousel.test.jsx.hbs +25 -0
- package/dist/templates/react/Carousel/Carousel.test.tsx.hbs +14 -0
- package/dist/templates/react/Carousel/Carousel.tsx.hbs +108 -0
- package/dist/templates/react/CarouselItem/CarouselItem.css.hbs +18 -0
- package/dist/templates/react/CarouselItem/CarouselItem.jsx.hbs +28 -0
- package/dist/templates/react/CarouselItem/CarouselItem.test.jsx.hbs +21 -0
- package/dist/templates/react/CarouselItem/CarouselItem.test.tsx.hbs +14 -0
- package/dist/templates/react/CarouselItem/CarouselItem.tsx.hbs +33 -0
- package/dist/templates/react/Checkbox/Checkbox.css.hbs +24 -0
- package/dist/templates/react/Checkbox/Checkbox.jsx.hbs +80 -0
- package/dist/templates/react/Checkbox/Checkbox.test.jsx.hbs +25 -0
- package/dist/templates/react/Checkbox/Checkbox.test.tsx.hbs +14 -0
- package/dist/templates/react/Checkbox/Checkbox.tsx.hbs +113 -0
- package/dist/templates/react/ColorPicker/ColorPicker.css.hbs +37 -0
- package/dist/templates/react/ColorPicker/ColorPicker.jsx.hbs +72 -0
- package/dist/templates/react/ColorPicker/ColorPicker.test.jsx.hbs +25 -0
- package/dist/templates/react/ColorPicker/ColorPicker.test.tsx.hbs +14 -0
- package/dist/templates/react/ColorPicker/ColorPicker.tsx.hbs +157 -0
- package/dist/templates/react/Combobox/Combobox.css.hbs +32 -0
- package/dist/templates/react/Combobox/Combobox.jsx.hbs +67 -0
- package/dist/templates/react/Combobox/Combobox.test.jsx.hbs +19 -0
- package/dist/templates/react/Combobox/Combobox.test.tsx.hbs +14 -0
- package/dist/templates/react/Combobox/Combobox.tsx.hbs +154 -0
- package/dist/templates/react/Comparison/Comparison.css.hbs +23 -0
- package/dist/templates/react/Comparison/Comparison.jsx.hbs +27 -0
- package/dist/templates/react/Comparison/Comparison.test.jsx.hbs +27 -0
- package/dist/templates/react/Comparison/Comparison.test.tsx.hbs +14 -0
- package/dist/templates/react/Comparison/Comparison.tsx.hbs +32 -0
- package/dist/templates/react/CopyButton/CopyButton.css.hbs +25 -0
- package/dist/templates/react/CopyButton/CopyButton.jsx.hbs +49 -0
- package/dist/templates/react/CopyButton/CopyButton.test.jsx.hbs +16 -0
- package/dist/templates/react/CopyButton/CopyButton.test.tsx.hbs +14 -0
- package/dist/templates/react/CopyButton/CopyButton.tsx.hbs +71 -0
- package/dist/templates/react/Details/Details.css.hbs +24 -0
- package/dist/templates/react/Details/Details.jsx.hbs +66 -0
- package/dist/templates/react/Details/Details.test.jsx.hbs +27 -0
- package/dist/templates/react/Details/Details.test.tsx.hbs +14 -0
- package/dist/templates/react/Details/Details.tsx.hbs +111 -0
- package/dist/templates/react/Dialog/Dialog.css.hbs +28 -0
- package/dist/templates/react/Dialog/Dialog.jsx.hbs +115 -0
- package/dist/templates/react/Dialog/Dialog.test.jsx.hbs +29 -0
- package/dist/templates/react/Dialog/Dialog.test.tsx.hbs +14 -0
- package/dist/templates/react/Dialog/Dialog.tsx.hbs +165 -0
- package/dist/templates/react/Divider/Divider.css.hbs +21 -0
- package/dist/templates/react/Divider/Divider.jsx.hbs +24 -0
- package/dist/templates/react/Divider/Divider.test.jsx.hbs +16 -0
- package/dist/templates/react/Divider/Divider.test.tsx.hbs +14 -0
- package/dist/templates/react/Divider/Divider.tsx.hbs +24 -0
- package/dist/templates/react/Drawer/Drawer.css.hbs +28 -0
- package/dist/templates/react/Drawer/Drawer.jsx.hbs +75 -0
- package/dist/templates/react/Drawer/Drawer.test.jsx.hbs +27 -0
- package/dist/templates/react/Drawer/Drawer.test.tsx.hbs +14 -0
- package/dist/templates/react/Drawer/Drawer.tsx.hbs +99 -0
- package/dist/templates/react/Dropdown/Dropdown.css.hbs +20 -0
- package/dist/templates/react/Dropdown/Dropdown.jsx.hbs +78 -0
- package/dist/templates/react/Dropdown/Dropdown.test.jsx.hbs +18 -0
- package/dist/templates/react/Dropdown/Dropdown.test.tsx.hbs +14 -0
- package/dist/templates/react/Dropdown/Dropdown.tsx.hbs +104 -0
- package/dist/templates/react/DropdownItem/DropdownItem.css.hbs +23 -0
- package/dist/templates/react/DropdownItem/DropdownItem.jsx.hbs +41 -0
- package/dist/templates/react/DropdownItem/DropdownItem.test.jsx.hbs +18 -0
- package/dist/templates/react/DropdownItem/DropdownItem.test.tsx.hbs +14 -0
- package/dist/templates/react/DropdownItem/DropdownItem.tsx.hbs +56 -0
- package/dist/templates/react/FormatBytes/FormatBytes.css.hbs +18 -0
- package/dist/templates/react/FormatBytes/FormatBytes.jsx.hbs +25 -0
- package/dist/templates/react/FormatBytes/FormatBytes.test.jsx.hbs +16 -0
- package/dist/templates/react/FormatBytes/FormatBytes.test.tsx.hbs +14 -0
- package/dist/templates/react/FormatBytes/FormatBytes.tsx.hbs +27 -0
- package/dist/templates/react/FormatDate/FormatDate.css.hbs +18 -0
- package/dist/templates/react/FormatDate/FormatDate.jsx.hbs +18 -0
- package/dist/templates/react/FormatDate/FormatDate.test.jsx.hbs +11 -0
- package/dist/templates/react/FormatDate/FormatDate.test.tsx.hbs +14 -0
- package/dist/templates/react/FormatDate/FormatDate.tsx.hbs +45 -0
- package/dist/templates/react/FormatNumber/FormatNumber.css.hbs +18 -0
- package/dist/templates/react/FormatNumber/FormatNumber.jsx.hbs +18 -0
- package/dist/templates/react/FormatNumber/FormatNumber.test.jsx.hbs +16 -0
- package/dist/templates/react/FormatNumber/FormatNumber.test.tsx.hbs +14 -0
- package/dist/templates/react/FormatNumber/FormatNumber.tsx.hbs +41 -0
- package/dist/templates/react/Icon/Icon.css.hbs +22 -0
- package/dist/templates/react/Icon/Icon.jsx.hbs +83 -0
- package/dist/templates/react/Icon/Icon.test.jsx.hbs +35 -0
- package/dist/templates/react/Icon/Icon.test.tsx.hbs +14 -0
- package/dist/templates/react/Icon/Icon.tsx.hbs +93 -0
- package/dist/templates/react/Include/Include.css.hbs +18 -0
- package/dist/templates/react/Include/Include.jsx.hbs +40 -0
- package/dist/templates/react/Include/Include.test.jsx.hbs +16 -0
- package/dist/templates/react/Include/Include.test.tsx.hbs +14 -0
- package/dist/templates/react/Include/Include.tsx.hbs +53 -0
- package/dist/templates/react/Input/Input.css.hbs +25 -0
- package/dist/templates/react/Input/Input.jsx.hbs +126 -0
- package/dist/templates/react/Input/Input.test.jsx.hbs +23 -0
- package/dist/templates/react/Input/Input.test.tsx.hbs +14 -0
- package/dist/templates/react/Input/Input.tsx.hbs +154 -0
- package/dist/templates/react/IntersectionObserver/IntersectionObserver.css.hbs +18 -0
- package/dist/templates/react/IntersectionObserver/IntersectionObserver.jsx.hbs +38 -0
- package/dist/templates/react/IntersectionObserver/IntersectionObserver.test.jsx.hbs +15 -0
- package/dist/templates/react/IntersectionObserver/IntersectionObserver.test.tsx.hbs +14 -0
- package/dist/templates/react/IntersectionObserver/IntersectionObserver.tsx.hbs +55 -0
- package/dist/templates/react/KIGUMI_SETUP.md.hbs +52 -0
- package/dist/templates/react/MutationObserver/MutationObserver.css.hbs +18 -0
- package/dist/templates/react/MutationObserver/MutationObserver.jsx.hbs +38 -0
- package/dist/templates/react/MutationObserver/MutationObserver.test.jsx.hbs +15 -0
- package/dist/templates/react/MutationObserver/MutationObserver.test.tsx.hbs +14 -0
- package/dist/templates/react/MutationObserver/MutationObserver.tsx.hbs +55 -0
- package/dist/templates/react/Option/Option.css.hbs +21 -0
- package/dist/templates/react/Option/Option.jsx.hbs +20 -0
- package/dist/templates/react/Option/Option.test.jsx.hbs +11 -0
- package/dist/templates/react/Option/Option.test.tsx.hbs +14 -0
- package/dist/templates/react/Option/Option.tsx.hbs +27 -0
- package/dist/templates/react/Popover/Popover.css.hbs +25 -0
- package/dist/templates/react/Popover/Popover.jsx.hbs +68 -0
- package/dist/templates/react/Popover/Popover.test.jsx.hbs +18 -0
- package/dist/templates/react/Popover/Popover.test.tsx.hbs +14 -0
- package/dist/templates/react/Popover/Popover.tsx.hbs +101 -0
- package/dist/templates/react/Popup/Popup.css.hbs +25 -0
- package/dist/templates/react/Popup/Popup.jsx.hbs +45 -0
- package/dist/templates/react/Popup/Popup.test.jsx.hbs +17 -0
- package/dist/templates/react/Popup/Popup.test.tsx.hbs +14 -0
- package/dist/templates/react/Popup/Popup.tsx.hbs +83 -0
- package/dist/templates/react/ProgressBar/ProgressBar.css.hbs +22 -0
- package/dist/templates/react/ProgressBar/ProgressBar.jsx.hbs +20 -0
- package/dist/templates/react/ProgressBar/ProgressBar.test.jsx.hbs +16 -0
- package/dist/templates/react/ProgressBar/ProgressBar.test.tsx.hbs +14 -0
- package/dist/templates/react/ProgressBar/ProgressBar.tsx.hbs +29 -0
- package/dist/templates/react/ProgressRing/ProgressRing.css.hbs +26 -0
- package/dist/templates/react/ProgressRing/ProgressRing.jsx.hbs +20 -0
- package/dist/templates/react/ProgressRing/ProgressRing.test.jsx.hbs +16 -0
- package/dist/templates/react/ProgressRing/ProgressRing.test.tsx.hbs +14 -0
- package/dist/templates/react/ProgressRing/ProgressRing.tsx.hbs +27 -0
- package/dist/templates/react/QrCode/QrCode.css.hbs +18 -0
- package/dist/templates/react/QrCode/QrCode.jsx.hbs +18 -0
- package/dist/templates/react/QrCode/QrCode.test.jsx.hbs +11 -0
- package/dist/templates/react/QrCode/QrCode.test.tsx.hbs +14 -0
- package/dist/templates/react/QrCode/QrCode.tsx.hbs +35 -0
- package/dist/templates/react/Radio/Radio.css.hbs +21 -0
- package/dist/templates/react/Radio/Radio.jsx.hbs +20 -0
- package/dist/templates/react/Radio/Radio.test.jsx.hbs +11 -0
- package/dist/templates/react/Radio/Radio.test.tsx.hbs +14 -0
- package/dist/templates/react/Radio/Radio.tsx.hbs +31 -0
- package/dist/templates/react/RadioGroup/RadioGroup.css.hbs +22 -0
- package/dist/templates/react/RadioGroup/RadioGroup.jsx.hbs +49 -0
- package/dist/templates/react/RadioGroup/RadioGroup.test.jsx.hbs +17 -0
- package/dist/templates/react/RadioGroup/RadioGroup.test.tsx.hbs +14 -0
- package/dist/templates/react/RadioGroup/RadioGroup.tsx.hbs +79 -0
- package/dist/templates/react/Rating/Rating.css.hbs +20 -0
- package/dist/templates/react/Rating/Rating.jsx.hbs +48 -0
- package/dist/templates/react/Rating/Rating.test.jsx.hbs +18 -0
- package/dist/templates/react/Rating/Rating.test.tsx.hbs +14 -0
- package/dist/templates/react/Rating/Rating.tsx.hbs +78 -0
- package/dist/templates/react/RelativeTime/RelativeTime.css.hbs +18 -0
- package/dist/templates/react/RelativeTime/RelativeTime.jsx.hbs +18 -0
- package/dist/templates/react/RelativeTime/RelativeTime.test.jsx.hbs +11 -0
- package/dist/templates/react/RelativeTime/RelativeTime.test.tsx.hbs +14 -0
- package/dist/templates/react/RelativeTime/RelativeTime.tsx.hbs +29 -0
- package/dist/templates/react/ResizeObserver/ResizeObserver.css.hbs +18 -0
- package/dist/templates/react/ResizeObserver/ResizeObserver.jsx.hbs +38 -0
- package/dist/templates/react/ResizeObserver/ResizeObserver.test.jsx.hbs +15 -0
- package/dist/templates/react/ResizeObserver/ResizeObserver.test.tsx.hbs +14 -0
- package/dist/templates/react/ResizeObserver/ResizeObserver.tsx.hbs +45 -0
- package/dist/templates/react/Scroller/Scroller.css.hbs +19 -0
- package/dist/templates/react/Scroller/Scroller.jsx.hbs +20 -0
- package/dist/templates/react/Scroller/Scroller.test.jsx.hbs +11 -0
- package/dist/templates/react/Scroller/Scroller.test.tsx.hbs +14 -0
- package/dist/templates/react/Scroller/Scroller.tsx.hbs +29 -0
- package/dist/templates/react/Select/Select.css.hbs +32 -0
- package/dist/templates/react/Select/Select.jsx.hbs +79 -0
- package/dist/templates/react/Select/Select.test.jsx.hbs +20 -0
- package/dist/templates/react/Select/Select.test.tsx.hbs +14 -0
- package/dist/templates/react/Select/Select.tsx.hbs +140 -0
- package/dist/templates/react/Skeleton/Skeleton.css.hbs +19 -0
- package/dist/templates/react/Skeleton/Skeleton.jsx.hbs +18 -0
- package/dist/templates/react/Skeleton/Skeleton.test.jsx.hbs +11 -0
- package/dist/templates/react/Skeleton/Skeleton.test.tsx.hbs +14 -0
- package/dist/templates/react/Skeleton/Skeleton.tsx.hbs +23 -0
- package/dist/templates/react/Slider/Slider.css.hbs +26 -0
- package/dist/templates/react/Slider/Slider.jsx.hbs +50 -0
- package/dist/templates/react/Slider/Slider.test.jsx.hbs +19 -0
- package/dist/templates/react/Slider/Slider.test.tsx.hbs +14 -0
- package/dist/templates/react/Slider/Slider.tsx.hbs +100 -0
- package/dist/templates/react/Spinner/Spinner.css.hbs +21 -0
- package/dist/templates/react/Spinner/Spinner.jsx.hbs +18 -0
- package/dist/templates/react/Spinner/Spinner.test.jsx.hbs +11 -0
- package/dist/templates/react/Spinner/Spinner.test.tsx.hbs +14 -0
- package/dist/templates/react/Spinner/Spinner.tsx.hbs +20 -0
- package/dist/templates/react/SplitPanel/SplitPanel.css.hbs +24 -0
- package/dist/templates/react/SplitPanel/SplitPanel.jsx.hbs +38 -0
- package/dist/templates/react/SplitPanel/SplitPanel.test.jsx.hbs +16 -0
- package/dist/templates/react/SplitPanel/SplitPanel.test.tsx.hbs +14 -0
- package/dist/templates/react/SplitPanel/SplitPanel.tsx.hbs +55 -0
- package/dist/templates/react/Switch/Switch.css.hbs +24 -0
- package/dist/templates/react/Switch/Switch.jsx.hbs +51 -0
- package/dist/templates/react/Switch/Switch.test.jsx.hbs +19 -0
- package/dist/templates/react/Switch/Switch.test.tsx.hbs +14 -0
- package/dist/templates/react/Switch/Switch.tsx.hbs +83 -0
- package/dist/templates/react/Tab/Tab.css.hbs +18 -0
- package/dist/templates/react/Tab/Tab.jsx.hbs +20 -0
- package/dist/templates/react/Tab/Tab.test.jsx.hbs +11 -0
- package/dist/templates/react/Tab/Tab.test.tsx.hbs +14 -0
- package/dist/templates/react/Tab/Tab.tsx.hbs +27 -0
- package/dist/templates/react/TabGroup/TabGroup.css.hbs +27 -0
- package/dist/templates/react/TabGroup/TabGroup.jsx.hbs +42 -0
- package/dist/templates/react/TabGroup/TabGroup.test.jsx.hbs +11 -0
- package/dist/templates/react/TabGroup/TabGroup.test.tsx.hbs +14 -0
- package/dist/templates/react/TabGroup/TabGroup.tsx.hbs +57 -0
- package/dist/templates/react/TabPanel/TabPanel.css.hbs +18 -0
- package/dist/templates/react/TabPanel/TabPanel.jsx.hbs +20 -0
- package/dist/templates/react/TabPanel/TabPanel.test.jsx.hbs +11 -0
- package/dist/templates/react/TabPanel/TabPanel.test.tsx.hbs +14 -0
- package/dist/templates/react/TabPanel/TabPanel.tsx.hbs +27 -0
- package/dist/templates/react/Tag/Tag.css.hbs +21 -0
- package/dist/templates/react/Tag/Tag.jsx.hbs +41 -0
- package/dist/templates/react/Tag/Tag.test.jsx.hbs +11 -0
- package/dist/templates/react/Tag/Tag.test.tsx.hbs +14 -0
- package/dist/templates/react/Tag/Tag.tsx.hbs +60 -0
- package/dist/templates/react/Textarea/Textarea.css.hbs +22 -0
- package/dist/templates/react/Textarea/Textarea.jsx.hbs +58 -0
- package/dist/templates/react/Textarea/Textarea.test.jsx.hbs +11 -0
- package/dist/templates/react/Textarea/Textarea.test.tsx.hbs +14 -0
- package/dist/templates/react/Textarea/Textarea.tsx.hbs +114 -0
- package/dist/templates/react/Tooltip/Tooltip.css.hbs +21 -0
- package/dist/templates/react/Tooltip/Tooltip.jsx.hbs +63 -0
- package/dist/templates/react/Tooltip/Tooltip.test.jsx.hbs +15 -0
- package/dist/templates/react/Tooltip/Tooltip.test.tsx.hbs +14 -0
- package/dist/templates/react/Tooltip/Tooltip.tsx.hbs +104 -0
- package/dist/templates/react/Tree/Tree.css.hbs +22 -0
- package/dist/templates/react/Tree/Tree.jsx.hbs +41 -0
- package/dist/templates/react/Tree/Tree.test.jsx.hbs +11 -0
- package/dist/templates/react/Tree/Tree.test.tsx.hbs +14 -0
- package/dist/templates/react/Tree/Tree.tsx.hbs +52 -0
- package/dist/templates/react/TreeItem/TreeItem.css.hbs +32 -0
- package/dist/templates/react/TreeItem/TreeItem.jsx.hbs +57 -0
- package/dist/templates/react/TreeItem/TreeItem.test.jsx.hbs +11 -0
- package/dist/templates/react/TreeItem/TreeItem.test.tsx.hbs +14 -0
- package/dist/templates/react/TreeItem/TreeItem.tsx.hbs +87 -0
- package/dist/templates/react/ZoomableFrame/ZoomableFrame.css.hbs +21 -0
- package/dist/templates/react/ZoomableFrame/ZoomableFrame.jsx.hbs +52 -0
- package/dist/templates/react/ZoomableFrame/ZoomableFrame.test.jsx.hbs +11 -0
- package/dist/templates/react/ZoomableFrame/ZoomableFrame.test.tsx.hbs +14 -0
- package/dist/templates/react/ZoomableFrame/ZoomableFrame.tsx.hbs +92 -0
- package/dist/templates/react/vite-env.d.ts.hbs +21 -0
- package/dist/tier-2ZEZT6E3.js +12 -0
- package/dist/tier-GFXZQZUI.js +12 -0
- package/package.json +82 -0
- package/templates/AGENTS.md +214 -0
- package/templates/react/AnimatedImage/AnimatedImage.css.hbs +19 -0
- package/templates/react/AnimatedImage/AnimatedImage.jsx.hbs +64 -0
- package/templates/react/AnimatedImage/AnimatedImage.test.jsx.hbs +29 -0
- package/templates/react/AnimatedImage/AnimatedImage.test.tsx.hbs +14 -0
- package/templates/react/AnimatedImage/AnimatedImage.tsx.hbs +68 -0
- package/templates/react/Animation/Animation.css.hbs +18 -0
- package/templates/react/Animation/Animation.jsx.hbs +100 -0
- package/templates/react/Animation/Animation.test.jsx.hbs +37 -0
- package/templates/react/Animation/Animation.test.tsx.hbs +14 -0
- package/templates/react/Animation/Animation.tsx.hbs +127 -0
- package/templates/react/Avatar/Avatar.css.hbs +20 -0
- package/templates/react/Avatar/Avatar.jsx.hbs +65 -0
- package/templates/react/Avatar/Avatar.test.jsx.hbs +33 -0
- package/templates/react/Avatar/Avatar.test.tsx.hbs +14 -0
- package/templates/react/Avatar/Avatar.tsx.hbs +71 -0
- package/templates/react/Badge/Badge.css.hbs +18 -0
- package/templates/react/Badge/Badge.jsx.hbs +46 -0
- package/templates/react/Badge/Badge.test.jsx.hbs +28 -0
- package/templates/react/Badge/Badge.test.tsx.hbs +14 -0
- package/templates/react/Badge/Badge.tsx.hbs +50 -0
- package/templates/react/Breadcrumb/Breadcrumb.css.hbs +18 -0
- package/templates/react/Breadcrumb/Breadcrumb.jsx.hbs +48 -0
- package/templates/react/Breadcrumb/Breadcrumb.test.jsx.hbs +34 -0
- package/templates/react/Breadcrumb/Breadcrumb.test.tsx.hbs +14 -0
- package/templates/react/Breadcrumb/Breadcrumb.tsx.hbs +49 -0
- package/templates/react/BreadcrumbItem/BreadcrumbItem.css.hbs +21 -0
- package/templates/react/BreadcrumbItem/BreadcrumbItem.jsx.hbs +55 -0
- package/templates/react/BreadcrumbItem/BreadcrumbItem.test.jsx.hbs +36 -0
- package/templates/react/BreadcrumbItem/BreadcrumbItem.test.tsx.hbs +14 -0
- package/templates/react/BreadcrumbItem/BreadcrumbItem.tsx.hbs +58 -0
- package/templates/react/Button/Button.css.hbs +23 -0
- package/templates/react/Button/Button.jsx.hbs +106 -0
- package/templates/react/Button/Button.test.jsx.hbs +23 -0
- package/templates/react/Button/Button.test.tsx.hbs +14 -0
- package/templates/react/Button/Button.tsx.hbs +131 -0
- package/templates/react/Card/Card.css.hbs +21 -0
- package/templates/react/Card/Card.jsx.hbs +33 -0
- package/templates/react/Card/Card.test.jsx.hbs +23 -0
- package/templates/react/Card/Card.test.tsx.hbs +14 -0
- package/templates/react/Card/Card.tsx.hbs +41 -0
- package/templates/react/Carousel/Carousel.css.hbs +28 -0
- package/templates/react/Carousel/Carousel.jsx.hbs +81 -0
- package/templates/react/Carousel/Carousel.test.jsx.hbs +25 -0
- package/templates/react/Carousel/Carousel.test.tsx.hbs +14 -0
- package/templates/react/Carousel/Carousel.tsx.hbs +108 -0
- package/templates/react/CarouselItem/CarouselItem.css.hbs +18 -0
- package/templates/react/CarouselItem/CarouselItem.jsx.hbs +28 -0
- package/templates/react/CarouselItem/CarouselItem.test.jsx.hbs +21 -0
- package/templates/react/CarouselItem/CarouselItem.test.tsx.hbs +14 -0
- package/templates/react/CarouselItem/CarouselItem.tsx.hbs +33 -0
- package/templates/react/Checkbox/Checkbox.css.hbs +24 -0
- package/templates/react/Checkbox/Checkbox.jsx.hbs +80 -0
- package/templates/react/Checkbox/Checkbox.test.jsx.hbs +25 -0
- package/templates/react/Checkbox/Checkbox.test.tsx.hbs +14 -0
- package/templates/react/Checkbox/Checkbox.tsx.hbs +113 -0
- package/templates/react/ColorPicker/ColorPicker.css.hbs +37 -0
- package/templates/react/ColorPicker/ColorPicker.jsx.hbs +72 -0
- package/templates/react/ColorPicker/ColorPicker.test.jsx.hbs +25 -0
- package/templates/react/ColorPicker/ColorPicker.test.tsx.hbs +14 -0
- package/templates/react/ColorPicker/ColorPicker.tsx.hbs +157 -0
- package/templates/react/Combobox/Combobox.css.hbs +32 -0
- package/templates/react/Combobox/Combobox.jsx.hbs +67 -0
- package/templates/react/Combobox/Combobox.test.jsx.hbs +19 -0
- package/templates/react/Combobox/Combobox.test.tsx.hbs +14 -0
- package/templates/react/Combobox/Combobox.tsx.hbs +154 -0
- package/templates/react/Comparison/Comparison.css.hbs +23 -0
- package/templates/react/Comparison/Comparison.jsx.hbs +27 -0
- package/templates/react/Comparison/Comparison.test.jsx.hbs +27 -0
- package/templates/react/Comparison/Comparison.test.tsx.hbs +14 -0
- package/templates/react/Comparison/Comparison.tsx.hbs +32 -0
- package/templates/react/CopyButton/CopyButton.css.hbs +25 -0
- package/templates/react/CopyButton/CopyButton.jsx.hbs +49 -0
- package/templates/react/CopyButton/CopyButton.test.jsx.hbs +16 -0
- package/templates/react/CopyButton/CopyButton.test.tsx.hbs +14 -0
- package/templates/react/CopyButton/CopyButton.tsx.hbs +71 -0
- package/templates/react/Details/Details.css.hbs +24 -0
- package/templates/react/Details/Details.jsx.hbs +66 -0
- package/templates/react/Details/Details.test.jsx.hbs +27 -0
- package/templates/react/Details/Details.test.tsx.hbs +14 -0
- package/templates/react/Details/Details.tsx.hbs +111 -0
- package/templates/react/Dialog/Dialog.css.hbs +28 -0
- package/templates/react/Dialog/Dialog.jsx.hbs +115 -0
- package/templates/react/Dialog/Dialog.test.jsx.hbs +29 -0
- package/templates/react/Dialog/Dialog.test.tsx.hbs +14 -0
- package/templates/react/Dialog/Dialog.tsx.hbs +165 -0
- package/templates/react/Divider/Divider.css.hbs +21 -0
- package/templates/react/Divider/Divider.jsx.hbs +24 -0
- package/templates/react/Divider/Divider.test.jsx.hbs +16 -0
- package/templates/react/Divider/Divider.test.tsx.hbs +14 -0
- package/templates/react/Divider/Divider.tsx.hbs +24 -0
- package/templates/react/Drawer/Drawer.css.hbs +28 -0
- package/templates/react/Drawer/Drawer.jsx.hbs +75 -0
- package/templates/react/Drawer/Drawer.test.jsx.hbs +27 -0
- package/templates/react/Drawer/Drawer.test.tsx.hbs +14 -0
- package/templates/react/Drawer/Drawer.tsx.hbs +99 -0
- package/templates/react/Dropdown/Dropdown.css.hbs +20 -0
- package/templates/react/Dropdown/Dropdown.jsx.hbs +78 -0
- package/templates/react/Dropdown/Dropdown.test.jsx.hbs +18 -0
- package/templates/react/Dropdown/Dropdown.test.tsx.hbs +14 -0
- package/templates/react/Dropdown/Dropdown.tsx.hbs +104 -0
- package/templates/react/DropdownItem/DropdownItem.css.hbs +23 -0
- package/templates/react/DropdownItem/DropdownItem.jsx.hbs +41 -0
- package/templates/react/DropdownItem/DropdownItem.test.jsx.hbs +18 -0
- package/templates/react/DropdownItem/DropdownItem.test.tsx.hbs +14 -0
- package/templates/react/DropdownItem/DropdownItem.tsx.hbs +56 -0
- package/templates/react/FormatBytes/FormatBytes.css.hbs +18 -0
- package/templates/react/FormatBytes/FormatBytes.jsx.hbs +25 -0
- package/templates/react/FormatBytes/FormatBytes.test.jsx.hbs +16 -0
- package/templates/react/FormatBytes/FormatBytes.test.tsx.hbs +14 -0
- package/templates/react/FormatBytes/FormatBytes.tsx.hbs +27 -0
- package/templates/react/FormatDate/FormatDate.css.hbs +18 -0
- package/templates/react/FormatDate/FormatDate.jsx.hbs +18 -0
- package/templates/react/FormatDate/FormatDate.test.jsx.hbs +11 -0
- package/templates/react/FormatDate/FormatDate.test.tsx.hbs +14 -0
- package/templates/react/FormatDate/FormatDate.tsx.hbs +45 -0
- package/templates/react/FormatNumber/FormatNumber.css.hbs +18 -0
- package/templates/react/FormatNumber/FormatNumber.jsx.hbs +18 -0
- package/templates/react/FormatNumber/FormatNumber.test.jsx.hbs +16 -0
- package/templates/react/FormatNumber/FormatNumber.test.tsx.hbs +14 -0
- package/templates/react/FormatNumber/FormatNumber.tsx.hbs +41 -0
- package/templates/react/Icon/Icon.css.hbs +22 -0
- package/templates/react/Icon/Icon.jsx.hbs +83 -0
- package/templates/react/Icon/Icon.test.jsx.hbs +35 -0
- package/templates/react/Icon/Icon.test.tsx.hbs +14 -0
- package/templates/react/Icon/Icon.tsx.hbs +93 -0
- package/templates/react/Include/Include.css.hbs +18 -0
- package/templates/react/Include/Include.jsx.hbs +40 -0
- package/templates/react/Include/Include.test.jsx.hbs +16 -0
- package/templates/react/Include/Include.test.tsx.hbs +14 -0
- package/templates/react/Include/Include.tsx.hbs +53 -0
- package/templates/react/Input/Input.css.hbs +25 -0
- package/templates/react/Input/Input.jsx.hbs +126 -0
- package/templates/react/Input/Input.test.jsx.hbs +23 -0
- package/templates/react/Input/Input.test.tsx.hbs +14 -0
- package/templates/react/Input/Input.tsx.hbs +154 -0
- package/templates/react/IntersectionObserver/IntersectionObserver.css.hbs +18 -0
- package/templates/react/IntersectionObserver/IntersectionObserver.jsx.hbs +38 -0
- package/templates/react/IntersectionObserver/IntersectionObserver.test.jsx.hbs +15 -0
- package/templates/react/IntersectionObserver/IntersectionObserver.test.tsx.hbs +14 -0
- package/templates/react/IntersectionObserver/IntersectionObserver.tsx.hbs +55 -0
- package/templates/react/MutationObserver/MutationObserver.css.hbs +18 -0
- package/templates/react/MutationObserver/MutationObserver.jsx.hbs +38 -0
- package/templates/react/MutationObserver/MutationObserver.test.jsx.hbs +15 -0
- package/templates/react/MutationObserver/MutationObserver.test.tsx.hbs +14 -0
- package/templates/react/MutationObserver/MutationObserver.tsx.hbs +55 -0
- package/templates/react/Option/Option.css.hbs +21 -0
- package/templates/react/Option/Option.jsx.hbs +20 -0
- package/templates/react/Option/Option.test.jsx.hbs +11 -0
- package/templates/react/Option/Option.test.tsx.hbs +14 -0
- package/templates/react/Option/Option.tsx.hbs +27 -0
- package/templates/react/Popover/Popover.css.hbs +25 -0
- package/templates/react/Popover/Popover.jsx.hbs +68 -0
- package/templates/react/Popover/Popover.test.jsx.hbs +18 -0
- package/templates/react/Popover/Popover.test.tsx.hbs +14 -0
- package/templates/react/Popover/Popover.tsx.hbs +101 -0
- package/templates/react/Popup/Popup.css.hbs +25 -0
- package/templates/react/Popup/Popup.jsx.hbs +45 -0
- package/templates/react/Popup/Popup.test.jsx.hbs +17 -0
- package/templates/react/Popup/Popup.test.tsx.hbs +14 -0
- package/templates/react/Popup/Popup.tsx.hbs +83 -0
- package/templates/react/ProgressBar/ProgressBar.css.hbs +22 -0
- package/templates/react/ProgressBar/ProgressBar.jsx.hbs +20 -0
- package/templates/react/ProgressBar/ProgressBar.test.jsx.hbs +16 -0
- package/templates/react/ProgressBar/ProgressBar.test.tsx.hbs +14 -0
- package/templates/react/ProgressBar/ProgressBar.tsx.hbs +29 -0
- package/templates/react/ProgressRing/ProgressRing.css.hbs +26 -0
- package/templates/react/ProgressRing/ProgressRing.jsx.hbs +20 -0
- package/templates/react/ProgressRing/ProgressRing.test.jsx.hbs +16 -0
- package/templates/react/ProgressRing/ProgressRing.test.tsx.hbs +14 -0
- package/templates/react/ProgressRing/ProgressRing.tsx.hbs +27 -0
- package/templates/react/QrCode/QrCode.css.hbs +18 -0
- package/templates/react/QrCode/QrCode.jsx.hbs +18 -0
- package/templates/react/QrCode/QrCode.test.jsx.hbs +11 -0
- package/templates/react/QrCode/QrCode.test.tsx.hbs +14 -0
- package/templates/react/QrCode/QrCode.tsx.hbs +35 -0
- package/templates/react/Radio/Radio.css.hbs +21 -0
- package/templates/react/Radio/Radio.jsx.hbs +20 -0
- package/templates/react/Radio/Radio.test.jsx.hbs +11 -0
- package/templates/react/Radio/Radio.test.tsx.hbs +14 -0
- package/templates/react/Radio/Radio.tsx.hbs +31 -0
- package/templates/react/RadioGroup/RadioGroup.css.hbs +22 -0
- package/templates/react/RadioGroup/RadioGroup.jsx.hbs +49 -0
- package/templates/react/RadioGroup/RadioGroup.test.jsx.hbs +17 -0
- package/templates/react/RadioGroup/RadioGroup.test.tsx.hbs +14 -0
- package/templates/react/RadioGroup/RadioGroup.tsx.hbs +79 -0
- package/templates/react/Rating/Rating.css.hbs +20 -0
- package/templates/react/Rating/Rating.jsx.hbs +48 -0
- package/templates/react/Rating/Rating.test.jsx.hbs +18 -0
- package/templates/react/Rating/Rating.test.tsx.hbs +14 -0
- package/templates/react/Rating/Rating.tsx.hbs +78 -0
- package/templates/react/RelativeTime/RelativeTime.css.hbs +18 -0
- package/templates/react/RelativeTime/RelativeTime.jsx.hbs +18 -0
- package/templates/react/RelativeTime/RelativeTime.test.jsx.hbs +11 -0
- package/templates/react/RelativeTime/RelativeTime.test.tsx.hbs +14 -0
- package/templates/react/RelativeTime/RelativeTime.tsx.hbs +29 -0
- package/templates/react/ResizeObserver/ResizeObserver.css.hbs +18 -0
- package/templates/react/ResizeObserver/ResizeObserver.jsx.hbs +38 -0
- package/templates/react/ResizeObserver/ResizeObserver.test.jsx.hbs +15 -0
- package/templates/react/ResizeObserver/ResizeObserver.test.tsx.hbs +14 -0
- package/templates/react/ResizeObserver/ResizeObserver.tsx.hbs +45 -0
- package/templates/react/Scroller/Scroller.css.hbs +19 -0
- package/templates/react/Scroller/Scroller.jsx.hbs +20 -0
- package/templates/react/Scroller/Scroller.test.jsx.hbs +11 -0
- package/templates/react/Scroller/Scroller.test.tsx.hbs +14 -0
- package/templates/react/Scroller/Scroller.tsx.hbs +29 -0
- package/templates/react/Select/Select.css.hbs +32 -0
- package/templates/react/Select/Select.jsx.hbs +79 -0
- package/templates/react/Select/Select.test.jsx.hbs +20 -0
- package/templates/react/Select/Select.test.tsx.hbs +14 -0
- package/templates/react/Select/Select.tsx.hbs +140 -0
- package/templates/react/Skeleton/Skeleton.css.hbs +19 -0
- package/templates/react/Skeleton/Skeleton.jsx.hbs +18 -0
- package/templates/react/Skeleton/Skeleton.test.jsx.hbs +11 -0
- package/templates/react/Skeleton/Skeleton.test.tsx.hbs +14 -0
- package/templates/react/Skeleton/Skeleton.tsx.hbs +23 -0
- package/templates/react/Slider/Slider.css.hbs +26 -0
- package/templates/react/Slider/Slider.jsx.hbs +50 -0
- package/templates/react/Slider/Slider.test.jsx.hbs +19 -0
- package/templates/react/Slider/Slider.test.tsx.hbs +14 -0
- package/templates/react/Slider/Slider.tsx.hbs +100 -0
- package/templates/react/Spinner/Spinner.css.hbs +21 -0
- package/templates/react/Spinner/Spinner.jsx.hbs +18 -0
- package/templates/react/Spinner/Spinner.test.jsx.hbs +11 -0
- package/templates/react/Spinner/Spinner.test.tsx.hbs +14 -0
- package/templates/react/Spinner/Spinner.tsx.hbs +20 -0
- package/templates/react/SplitPanel/SplitPanel.css.hbs +24 -0
- package/templates/react/SplitPanel/SplitPanel.jsx.hbs +38 -0
- package/templates/react/SplitPanel/SplitPanel.test.jsx.hbs +16 -0
- package/templates/react/SplitPanel/SplitPanel.test.tsx.hbs +14 -0
- package/templates/react/SplitPanel/SplitPanel.tsx.hbs +55 -0
- package/templates/react/Switch/Switch.css.hbs +24 -0
- package/templates/react/Switch/Switch.jsx.hbs +51 -0
- package/templates/react/Switch/Switch.test.jsx.hbs +19 -0
- package/templates/react/Switch/Switch.test.tsx.hbs +14 -0
- package/templates/react/Switch/Switch.tsx.hbs +83 -0
- package/templates/react/Tab/Tab.css.hbs +18 -0
- package/templates/react/Tab/Tab.jsx.hbs +20 -0
- package/templates/react/Tab/Tab.test.jsx.hbs +11 -0
- package/templates/react/Tab/Tab.test.tsx.hbs +14 -0
- package/templates/react/Tab/Tab.tsx.hbs +27 -0
- package/templates/react/TabGroup/TabGroup.css.hbs +27 -0
- package/templates/react/TabGroup/TabGroup.jsx.hbs +42 -0
- package/templates/react/TabGroup/TabGroup.test.jsx.hbs +11 -0
- package/templates/react/TabGroup/TabGroup.test.tsx.hbs +14 -0
- package/templates/react/TabGroup/TabGroup.tsx.hbs +57 -0
- package/templates/react/TabPanel/TabPanel.css.hbs +18 -0
- package/templates/react/TabPanel/TabPanel.jsx.hbs +20 -0
- package/templates/react/TabPanel/TabPanel.test.jsx.hbs +11 -0
- package/templates/react/TabPanel/TabPanel.test.tsx.hbs +14 -0
- package/templates/react/TabPanel/TabPanel.tsx.hbs +27 -0
- package/templates/react/Tag/Tag.css.hbs +21 -0
- package/templates/react/Tag/Tag.jsx.hbs +41 -0
- package/templates/react/Tag/Tag.test.jsx.hbs +11 -0
- package/templates/react/Tag/Tag.test.tsx.hbs +14 -0
- package/templates/react/Tag/Tag.tsx.hbs +60 -0
- package/templates/react/Textarea/Textarea.css.hbs +22 -0
- package/templates/react/Textarea/Textarea.jsx.hbs +58 -0
- package/templates/react/Textarea/Textarea.test.jsx.hbs +11 -0
- package/templates/react/Textarea/Textarea.test.tsx.hbs +14 -0
- package/templates/react/Textarea/Textarea.tsx.hbs +114 -0
- package/templates/react/Tooltip/Tooltip.css.hbs +21 -0
- package/templates/react/Tooltip/Tooltip.jsx.hbs +63 -0
- package/templates/react/Tooltip/Tooltip.test.jsx.hbs +15 -0
- package/templates/react/Tooltip/Tooltip.test.tsx.hbs +14 -0
- package/templates/react/Tooltip/Tooltip.tsx.hbs +104 -0
- package/templates/react/Tree/Tree.css.hbs +22 -0
- package/templates/react/Tree/Tree.jsx.hbs +41 -0
- package/templates/react/Tree/Tree.test.jsx.hbs +11 -0
- package/templates/react/Tree/Tree.test.tsx.hbs +14 -0
- package/templates/react/Tree/Tree.tsx.hbs +52 -0
- package/templates/react/TreeItem/TreeItem.css.hbs +32 -0
- package/templates/react/TreeItem/TreeItem.jsx.hbs +57 -0
- package/templates/react/TreeItem/TreeItem.test.jsx.hbs +11 -0
- package/templates/react/TreeItem/TreeItem.test.tsx.hbs +14 -0
- package/templates/react/TreeItem/TreeItem.tsx.hbs +87 -0
- package/templates/react/ZoomableFrame/ZoomableFrame.css.hbs +21 -0
- package/templates/react/ZoomableFrame/ZoomableFrame.jsx.hbs +52 -0
- package/templates/react/ZoomableFrame/ZoomableFrame.test.jsx.hbs +11 -0
- package/templates/react/ZoomableFrame/ZoomableFrame.test.tsx.hbs +14 -0
- package/templates/react/ZoomableFrame/ZoomableFrame.tsx.hbs +92 -0
- package/templates/react/vite-env.d.ts.hbs +21 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render } from '@testing-library/react';
|
|
2
|
+
import { ProgressRing } from './ProgressRing';
|
|
3
|
+
|
|
4
|
+
describe('ProgressRing', () => {
|
|
5
|
+
it('renders without crashing', () => {
|
|
6
|
+
const { container } = render(<ProgressRing value={50} />);
|
|
7
|
+
expect(container.querySelector('wa-progress-ring')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('applies custom className', () => {
|
|
11
|
+
const { container } = render(<ProgressRing value={50} className="custom-class" />);
|
|
12
|
+
expect(container.querySelector('.custom-class')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { forwardRef, type HTMLAttributes } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './ProgressRing.css';
|
|
5
|
+
|
|
6
|
+
export interface ProgressRingProps extends Omit<HTMLAttributes<HTMLElement>, 'dir'> {
|
|
7
|
+
/** The current progress as a percentage, 0 to 100 */
|
|
8
|
+
value?: number;
|
|
9
|
+
/** A custom label for assistive devices */
|
|
10
|
+
label?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const ProgressRing = forwardRef<HTMLElement, ProgressRingProps>(
|
|
14
|
+
({ children, className, ...props }, ref) => {
|
|
15
|
+
return (
|
|
16
|
+
<wa-progress-ring
|
|
17
|
+
ref={ref}
|
|
18
|
+
class={clsx('ProgressRing', className)}
|
|
19
|
+
{...(props as Record<string, unknown>)}
|
|
20
|
+
>
|
|
21
|
+
{children}
|
|
22
|
+
</wa-progress-ring>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
ProgressRing.displayName = 'ProgressRing';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QrCode Component Styles
|
|
3
|
+
* Documentation: https://webawesome.com/docs/components/qr-code
|
|
4
|
+
*
|
|
5
|
+
* CSS Custom Properties:
|
|
6
|
+
* - --size: The size of the QR code
|
|
7
|
+
*
|
|
8
|
+
* CSS Parts:
|
|
9
|
+
* - base: The component's base wrapper
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* .QrCode::part(base) {
|
|
13
|
+
* // Custom styles
|
|
14
|
+
* }
|
|
15
|
+
*/
|
|
16
|
+
.QrCode {
|
|
17
|
+
/* Add your custom styles here */
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './QrCode.css';
|
|
5
|
+
|
|
6
|
+
export const QrCode = React.forwardRef(
|
|
7
|
+
({ className, ...props }, ref) => {
|
|
8
|
+
return (
|
|
9
|
+
<wa-qr-code
|
|
10
|
+
ref={ref}
|
|
11
|
+
class={clsx('QrCode', className)}
|
|
12
|
+
{...props}
|
|
13
|
+
/>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
QrCode.displayName = 'QrCode';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { QrCode } from './QrCode';
|
|
5
|
+
|
|
6
|
+
describe('QrCode', () => {
|
|
7
|
+
it('renders without crashing', () => {
|
|
8
|
+
const { container } = render(<QrCode value="https://example.com" />);
|
|
9
|
+
expect(container.querySelector('wa-qr-code')).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render } from '@testing-library/react';
|
|
2
|
+
import { QrCode } from './QrCode';
|
|
3
|
+
|
|
4
|
+
describe('QrCode', () => {
|
|
5
|
+
it('renders without crashing', () => {
|
|
6
|
+
const { container } = render(<QrCode value="https://example.com" />);
|
|
7
|
+
expect(container.querySelector('wa-qr-code')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('applies custom className', () => {
|
|
11
|
+
const { container } = render(<QrCode value="https://example.com" className="custom-class" />);
|
|
12
|
+
expect(container.querySelector('.custom-class')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { forwardRef, type HTMLAttributes } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './QrCode.css';
|
|
5
|
+
|
|
6
|
+
export interface QrCodeProps extends Omit<HTMLAttributes<HTMLElement>, 'dir'> {
|
|
7
|
+
/** The QR code's value */
|
|
8
|
+
value: string;
|
|
9
|
+
/** The size of the QR code, in pixels */
|
|
10
|
+
size?: number;
|
|
11
|
+
/** The fill color */
|
|
12
|
+
fill?: string;
|
|
13
|
+
/** The background color */
|
|
14
|
+
background?: string;
|
|
15
|
+
/** The edge radius of each module (0-0.5 range) */
|
|
16
|
+
radius?: number;
|
|
17
|
+
/** The level of error correction to use */
|
|
18
|
+
'error-correction'?: 'L' | 'M' | 'Q' | 'H';
|
|
19
|
+
/** The label for assistive devices */
|
|
20
|
+
label?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const QrCode = forwardRef<HTMLElement, QrCodeProps>(
|
|
24
|
+
({ className, ...props }, ref) => {
|
|
25
|
+
return (
|
|
26
|
+
<wa-qr-code
|
|
27
|
+
ref={ref}
|
|
28
|
+
class={clsx('QrCode', className)}
|
|
29
|
+
{...(props as Record<string, unknown>)}
|
|
30
|
+
/>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
QrCode.displayName = 'QrCode';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Radio Component Styles
|
|
3
|
+
* Documentation: https://webawesome.com/docs/components/radio
|
|
4
|
+
*
|
|
5
|
+
* CSS Custom Properties:
|
|
6
|
+
* - --checked-icon-color: The color of the checked icon
|
|
7
|
+
* - --checked-icon-scale: The size of the checked icon relative to the radio button
|
|
8
|
+
*
|
|
9
|
+
* CSS Parts:
|
|
10
|
+
* - control: The circular container that wraps the radio's checked state
|
|
11
|
+
* - checked-icon: The checked icon, a <wa-icon> element
|
|
12
|
+
* - label: The container that wraps the radio's label
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* .Radio::part(control) {
|
|
16
|
+
* // Custom styles
|
|
17
|
+
* }
|
|
18
|
+
*/
|
|
19
|
+
.Radio {
|
|
20
|
+
/* Add your custom styles here */
|
|
21
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Radio.css';
|
|
5
|
+
|
|
6
|
+
export const Radio = React.forwardRef(
|
|
7
|
+
({ children, className, ...props }, ref) => {
|
|
8
|
+
return (
|
|
9
|
+
<wa-radio
|
|
10
|
+
ref={ref}
|
|
11
|
+
class={clsx('Radio', className)}
|
|
12
|
+
{...props}
|
|
13
|
+
>
|
|
14
|
+
{children}
|
|
15
|
+
</wa-radio>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
Radio.displayName = 'Radio';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Radio } from './Radio';
|
|
5
|
+
|
|
6
|
+
describe('Radio', () => {
|
|
7
|
+
it('renders without crashing', () => {
|
|
8
|
+
const { container } = render(<Radio value="option1">Option 1</Radio>);
|
|
9
|
+
expect(container.querySelector('wa-radio')).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { Radio } from './Radio';
|
|
3
|
+
|
|
4
|
+
describe('Radio', () => {
|
|
5
|
+
it('renders children', () => {
|
|
6
|
+
render(<Radio value="1">Test</Radio>);
|
|
7
|
+
expect(screen.getByText('Test')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('applies custom className', () => {
|
|
11
|
+
const { container } = render(<Radio value="1" className="custom-class">Test</Radio>);
|
|
12
|
+
expect(container.querySelector('.custom-class')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { forwardRef, type HTMLAttributes } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Radio.css';
|
|
5
|
+
|
|
6
|
+
export interface RadioProps extends Omit<HTMLAttributes<HTMLElement>, 'dir'> {
|
|
7
|
+
/** The radio's value */
|
|
8
|
+
value?: string;
|
|
9
|
+
/** The radio's visual presentation style */
|
|
10
|
+
appearance?: 'default' | 'button';
|
|
11
|
+
/** Disables the radio */
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
/** Adjustable sizing */
|
|
14
|
+
size?: 'small' | 'medium' | 'large';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const Radio = forwardRef<HTMLElement, RadioProps>(
|
|
18
|
+
({ children, className, ...props }, ref) => {
|
|
19
|
+
return (
|
|
20
|
+
<wa-radio
|
|
21
|
+
ref={ref}
|
|
22
|
+
class={clsx('Radio', className)}
|
|
23
|
+
{...(props as Record<string, unknown>)}
|
|
24
|
+
>
|
|
25
|
+
{children}
|
|
26
|
+
</wa-radio>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
Radio.displayName = 'Radio';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RadioGroup Component Styles
|
|
3
|
+
* Documentation: https://webawesome.com/docs/components/radio-group
|
|
4
|
+
*
|
|
5
|
+
* CSS Custom Properties:
|
|
6
|
+
* (No custom properties defined for this component)
|
|
7
|
+
*
|
|
8
|
+
* CSS Parts:
|
|
9
|
+
* - form-control: The form control that wraps the label, input, and hint
|
|
10
|
+
* - form-control-label: The label's wrapper
|
|
11
|
+
* - form-control-input: The input's wrapper
|
|
12
|
+
* - radios: The container that wraps the radio buttons
|
|
13
|
+
* - hint: The hint's wrapper
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* .RadioGroup::part(radios) {
|
|
17
|
+
* // Custom styles
|
|
18
|
+
* }
|
|
19
|
+
*/
|
|
20
|
+
.RadioGroup {
|
|
21
|
+
/* Add your custom styles here */
|
|
22
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './RadioGroup.css';
|
|
5
|
+
|
|
6
|
+
export const RadioGroup = React.forwardRef(
|
|
7
|
+
({ children, className, onChange, onInvalid, ...props }, ref) => {
|
|
8
|
+
const groupRef = React.useRef(null);
|
|
9
|
+
|
|
10
|
+
React.useImperativeHandle(
|
|
11
|
+
ref,
|
|
12
|
+
() => ({
|
|
13
|
+
focus: (options) => groupRef.current?.focus?.(options),
|
|
14
|
+
get element() {
|
|
15
|
+
return groupRef.current;
|
|
16
|
+
},
|
|
17
|
+
}),
|
|
18
|
+
[]
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
React.useEffect(() => {
|
|
22
|
+
const el = groupRef.current;
|
|
23
|
+
if (!el) return;
|
|
24
|
+
|
|
25
|
+
const handleChange = (e) => onChange?.(e);
|
|
26
|
+
const handleInvalid = (e) => onInvalid?.(e);
|
|
27
|
+
|
|
28
|
+
el.addEventListener('change', handleChange);
|
|
29
|
+
el.addEventListener('wa-invalid', handleInvalid);
|
|
30
|
+
|
|
31
|
+
return () => {
|
|
32
|
+
el.removeEventListener('change', handleChange);
|
|
33
|
+
el.removeEventListener('wa-invalid', handleInvalid);
|
|
34
|
+
};
|
|
35
|
+
}, [onChange, onInvalid]);
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<wa-radio-group
|
|
39
|
+
ref={groupRef}
|
|
40
|
+
class={clsx('RadioGroup', className)}
|
|
41
|
+
{...props}
|
|
42
|
+
>
|
|
43
|
+
{children}
|
|
44
|
+
</wa-radio-group>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
RadioGroup.displayName = 'RadioGroup';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { RadioGroup } from './RadioGroup';
|
|
5
|
+
|
|
6
|
+
describe('RadioGroup', () => {
|
|
7
|
+
it('renders without crashing', () => {
|
|
8
|
+
const { container } = render(<RadioGroup label="Options" />);
|
|
9
|
+
expect(container.querySelector('wa-radio-group')).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('exposes ref methods', () => {
|
|
13
|
+
const ref = React.createRef();
|
|
14
|
+
render(<RadioGroup ref={ref} label="Options" />);
|
|
15
|
+
expect(ref.current).toHaveProperty('focus');
|
|
16
|
+
});
|
|
17
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { RadioGroup } from './RadioGroup';
|
|
3
|
+
|
|
4
|
+
describe('RadioGroup', () => {
|
|
5
|
+
it('renders children', () => {
|
|
6
|
+
render(<RadioGroup label="Options">Test</RadioGroup>);
|
|
7
|
+
expect(screen.getByText('Test')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('applies custom className', () => {
|
|
11
|
+
const { container } = render(<RadioGroup label="Options" className="custom-class">Test</RadioGroup>);
|
|
12
|
+
expect(container.querySelector('.custom-class')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { forwardRef, useRef, useImperativeHandle, useEffect, type HTMLAttributes } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './RadioGroup.css';
|
|
5
|
+
|
|
6
|
+
export interface RadioGroupProps extends Omit<HTMLAttributes<HTMLElement>, 'onChange' | 'onInvalid' | 'dir'> {
|
|
7
|
+
/** Group label; required for accessibility */
|
|
8
|
+
label?: string;
|
|
9
|
+
/** Name attribute for form submission */
|
|
10
|
+
name?: string | null;
|
|
11
|
+
/** Current selected value */
|
|
12
|
+
value?: string;
|
|
13
|
+
/** Disables the radio group */
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/** Requires selection before form submission */
|
|
16
|
+
required?: boolean;
|
|
17
|
+
/** Layout direction for radio items */
|
|
18
|
+
orientation?: 'horizontal' | 'vertical';
|
|
19
|
+
/** Size applied to child radios */
|
|
20
|
+
size?: 'small' | 'medium' | 'large';
|
|
21
|
+
/** Descriptive hint text */
|
|
22
|
+
hint?: string;
|
|
23
|
+
/** Event fired when selected value changes */
|
|
24
|
+
onChange?: (event: Event) => void;
|
|
25
|
+
/** Event fired when validation fails */
|
|
26
|
+
onInvalid?: (event: CustomEvent) => void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface RadioGroupRef {
|
|
30
|
+
focus: (options?: FocusOptions) => void;
|
|
31
|
+
element: HTMLElement | null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const RadioGroup = forwardRef<RadioGroupRef, RadioGroupProps>(
|
|
35
|
+
({ children, className, onChange, onInvalid, ...props }, ref) => {
|
|
36
|
+
const groupRef = useRef<HTMLElement & {
|
|
37
|
+
focus?: (options?: FocusOptions) => void;
|
|
38
|
+
}>(null);
|
|
39
|
+
|
|
40
|
+
useImperativeHandle(
|
|
41
|
+
ref,
|
|
42
|
+
() => ({
|
|
43
|
+
focus: (options) => groupRef.current?.focus?.(options),
|
|
44
|
+
get element() {
|
|
45
|
+
return groupRef.current;
|
|
46
|
+
},
|
|
47
|
+
}),
|
|
48
|
+
[]
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
const el = groupRef.current;
|
|
53
|
+
if (!el) return;
|
|
54
|
+
|
|
55
|
+
const handleChange = (e: Event) => onChange?.(e);
|
|
56
|
+
const handleInvalid = (e: Event) => onInvalid?.(e as CustomEvent);
|
|
57
|
+
|
|
58
|
+
el.addEventListener('change', handleChange);
|
|
59
|
+
el.addEventListener('wa-invalid', handleInvalid);
|
|
60
|
+
|
|
61
|
+
return () => {
|
|
62
|
+
el.removeEventListener('change', handleChange);
|
|
63
|
+
el.removeEventListener('wa-invalid', handleInvalid);
|
|
64
|
+
};
|
|
65
|
+
}, [onChange, onInvalid]);
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<wa-radio-group
|
|
69
|
+
ref={groupRef}
|
|
70
|
+
class={clsx('RadioGroup', className)}
|
|
71
|
+
{...(props as Record<string, unknown>)}
|
|
72
|
+
>
|
|
73
|
+
{children}
|
|
74
|
+
</wa-radio-group>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
RadioGroup.displayName = 'RadioGroup';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rating Component Styles
|
|
3
|
+
* Documentation: https://webawesome.com/docs/components/rating
|
|
4
|
+
*
|
|
5
|
+
* CSS Custom Properties:
|
|
6
|
+
* - --symbol-color: The inactive color for rating symbols
|
|
7
|
+
* - --symbol-color-active: The active color for rating symbols
|
|
8
|
+
* - --symbol-spacing: The spacing to use around symbols
|
|
9
|
+
*
|
|
10
|
+
* CSS Parts:
|
|
11
|
+
* - base: The component's base wrapper
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* .Rating::part(base) {
|
|
15
|
+
* // Custom styles
|
|
16
|
+
* }
|
|
17
|
+
*/
|
|
18
|
+
.Rating {
|
|
19
|
+
/* Add your custom styles here */
|
|
20
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Rating.css';
|
|
5
|
+
|
|
6
|
+
export const Rating = React.forwardRef(
|
|
7
|
+
({ className, onChange, onHover, ...props }, ref) => {
|
|
8
|
+
const ratingRef = React.useRef(null);
|
|
9
|
+
|
|
10
|
+
React.useImperativeHandle(
|
|
11
|
+
ref,
|
|
12
|
+
() => ({
|
|
13
|
+
focus: (options) => ratingRef.current?.focus?.(options),
|
|
14
|
+
blur: () => ratingRef.current?.blur?.(),
|
|
15
|
+
get element() {
|
|
16
|
+
return ratingRef.current;
|
|
17
|
+
},
|
|
18
|
+
}),
|
|
19
|
+
[]
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
React.useEffect(() => {
|
|
23
|
+
const el = ratingRef.current;
|
|
24
|
+
if (!el) return;
|
|
25
|
+
|
|
26
|
+
const handleChange = (e) => onChange?.(e);
|
|
27
|
+
const handleHover = (e) => onHover?.(e);
|
|
28
|
+
|
|
29
|
+
el.addEventListener('change', handleChange);
|
|
30
|
+
el.addEventListener('wa-hover', handleHover);
|
|
31
|
+
|
|
32
|
+
return () => {
|
|
33
|
+
el.removeEventListener('change', handleChange);
|
|
34
|
+
el.removeEventListener('wa-hover', handleHover);
|
|
35
|
+
};
|
|
36
|
+
}, [onChange, onHover]);
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<wa-rating
|
|
40
|
+
ref={ratingRef}
|
|
41
|
+
class={clsx('Rating', className)}
|
|
42
|
+
{...props}
|
|
43
|
+
/>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
Rating.displayName = 'Rating';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Rating } from './Rating';
|
|
5
|
+
|
|
6
|
+
describe('Rating', () => {
|
|
7
|
+
it('renders without crashing', () => {
|
|
8
|
+
const { container } = render(<Rating />);
|
|
9
|
+
expect(container.querySelector('wa-rating')).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('exposes ref methods', () => {
|
|
13
|
+
const ref = React.createRef();
|
|
14
|
+
render(<Rating ref={ref} />);
|
|
15
|
+
expect(ref.current).toHaveProperty('focus');
|
|
16
|
+
expect(ref.current).toHaveProperty('blur');
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render } from '@testing-library/react';
|
|
2
|
+
import { Rating } from './Rating';
|
|
3
|
+
|
|
4
|
+
describe('Rating', () => {
|
|
5
|
+
it('renders without crashing', () => {
|
|
6
|
+
const { container } = render(<Rating />);
|
|
7
|
+
expect(container.querySelector('wa-rating')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('applies custom className', () => {
|
|
11
|
+
const { container } = render(<Rating className="custom-class" />);
|
|
12
|
+
expect(container.querySelector('.custom-class')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { forwardRef, useRef, useImperativeHandle, useEffect, type HTMLAttributes } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Rating.css';
|
|
5
|
+
|
|
6
|
+
export interface RatingProps extends Omit<HTMLAttributes<HTMLElement>, 'onChange' | 'dir'> {
|
|
7
|
+
/** The current rating */
|
|
8
|
+
value?: number;
|
|
9
|
+
/** The highest rating to show */
|
|
10
|
+
max?: number;
|
|
11
|
+
/** Allows fractional ratings */
|
|
12
|
+
precision?: number;
|
|
13
|
+
/** Makes the rating readonly */
|
|
14
|
+
readonly?: boolean;
|
|
15
|
+
/** Disables the rating */
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
/** A label for assistive devices */
|
|
18
|
+
label?: string;
|
|
19
|
+
/** The component's size */
|
|
20
|
+
size?: 'small' | 'medium' | 'large';
|
|
21
|
+
/** Event fired when the rating's value changes */
|
|
22
|
+
onChange?: (event: Event) => void;
|
|
23
|
+
/** Event fired during user interaction */
|
|
24
|
+
onHover?: (event: CustomEvent) => void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface RatingRef {
|
|
28
|
+
focus: (options?: FocusOptions) => void;
|
|
29
|
+
blur: () => void;
|
|
30
|
+
element: HTMLElement | null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const Rating = forwardRef<RatingRef, RatingProps>(
|
|
34
|
+
({ className, onChange, onHover, ...props }, ref) => {
|
|
35
|
+
const ratingRef = useRef<HTMLElement & {
|
|
36
|
+
focus?: (options?: FocusOptions) => void;
|
|
37
|
+
blur?: () => void;
|
|
38
|
+
}>(null);
|
|
39
|
+
|
|
40
|
+
useImperativeHandle(
|
|
41
|
+
ref,
|
|
42
|
+
() => ({
|
|
43
|
+
focus: (options) => ratingRef.current?.focus?.(options),
|
|
44
|
+
blur: () => ratingRef.current?.blur?.(),
|
|
45
|
+
get element() {
|
|
46
|
+
return ratingRef.current;
|
|
47
|
+
},
|
|
48
|
+
}),
|
|
49
|
+
[]
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
const el = ratingRef.current;
|
|
54
|
+
if (!el) return;
|
|
55
|
+
|
|
56
|
+
const handleChange = (e: Event) => onChange?.(e);
|
|
57
|
+
const handleHover = (e: Event) => onHover?.(e as CustomEvent);
|
|
58
|
+
|
|
59
|
+
el.addEventListener('change', handleChange);
|
|
60
|
+
el.addEventListener('wa-hover', handleHover);
|
|
61
|
+
|
|
62
|
+
return () => {
|
|
63
|
+
el.removeEventListener('change', handleChange);
|
|
64
|
+
el.removeEventListener('wa-hover', handleHover);
|
|
65
|
+
};
|
|
66
|
+
}, [onChange, onHover]);
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<wa-rating
|
|
70
|
+
ref={ratingRef}
|
|
71
|
+
class={clsx('Rating', className)}
|
|
72
|
+
{...(props as Record<string, unknown>)}
|
|
73
|
+
/>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
Rating.displayName = 'Rating';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RelativeTime Component Styles
|
|
3
|
+
* Documentation: https://webawesome.com/docs/components/relative-time
|
|
4
|
+
*
|
|
5
|
+
* CSS Custom Properties:
|
|
6
|
+
* (No custom properties defined for this component)
|
|
7
|
+
*
|
|
8
|
+
* CSS Parts:
|
|
9
|
+
* (No CSS parts defined for this component)
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* .RelativeTime {
|
|
13
|
+
* // Custom styles
|
|
14
|
+
* }
|
|
15
|
+
*/
|
|
16
|
+
.RelativeTime {
|
|
17
|
+
/* Add your custom styles here */
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './RelativeTime.css';
|
|
5
|
+
|
|
6
|
+
export const RelativeTime = React.forwardRef(
|
|
7
|
+
({ className, ...props }, ref) => {
|
|
8
|
+
return (
|
|
9
|
+
<wa-relative-time
|
|
10
|
+
ref={ref}
|
|
11
|
+
class={clsx('RelativeTime', className)}
|
|
12
|
+
{...props}
|
|
13
|
+
/>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
RelativeTime.displayName = 'RelativeTime';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { RelativeTime } from './RelativeTime';
|
|
5
|
+
|
|
6
|
+
describe('RelativeTime', () => {
|
|
7
|
+
it('renders without crashing', () => {
|
|
8
|
+
const { container } = render(<RelativeTime />);
|
|
9
|
+
expect(container.querySelector('wa-relative-time')).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
});
|