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,111 @@
|
|
|
1
|
+
import { forwardRef, useRef, useImperativeHandle, useEffect, type HTMLAttributes } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Details.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Shows a brief summary and expands to show additional content
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <Details summary="Click to expand">
|
|
12
|
+
* <p>Hidden content that reveals when expanded.</p>
|
|
13
|
+
* </Details>
|
|
14
|
+
*
|
|
15
|
+
* // Controlled
|
|
16
|
+
* <Details open summary="Already open">
|
|
17
|
+
* <p>This is expanded by default.</p>
|
|
18
|
+
* </Details>
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export interface DetailsProps extends Omit<HTMLAttributes<HTMLElement>, 'dir'> {
|
|
22
|
+
/** Whether the details are expanded */
|
|
23
|
+
open?: boolean;
|
|
24
|
+
/** Summary text shown in header */
|
|
25
|
+
summary?: string;
|
|
26
|
+
/** Disables the details */
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
/** Visual appearance style */
|
|
29
|
+
appearance?: 'filled' | 'outlined' | 'filled-outlined' | 'plain';
|
|
30
|
+
/** Position of the expand icon */
|
|
31
|
+
'icon-placement'?: 'start' | 'end';
|
|
32
|
+
/** Name for accordion grouping */
|
|
33
|
+
name?: string;
|
|
34
|
+
/** Event fired when details opens */
|
|
35
|
+
onShow?: (event: CustomEvent) => void;
|
|
36
|
+
/** Event fired after details opens */
|
|
37
|
+
onAfterShow?: (event: CustomEvent) => void;
|
|
38
|
+
/** Event fired when details closes */
|
|
39
|
+
onHide?: (event: CustomEvent) => void;
|
|
40
|
+
/** Event fired after details closes */
|
|
41
|
+
onAfterHide?: (event: CustomEvent) => void;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface DetailsRef {
|
|
45
|
+
show: () => void;
|
|
46
|
+
hide: () => void;
|
|
47
|
+
element: HTMLElement | null;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export const Details = forwardRef<DetailsRef, DetailsProps>(
|
|
51
|
+
({ children, className, onShow, onAfterShow, onHide, onAfterHide, ...props }, ref) => {
|
|
52
|
+
const detailsRef = useRef<HTMLElement & {
|
|
53
|
+
show?: () => void;
|
|
54
|
+
hide?: () => void;
|
|
55
|
+
}>(null);
|
|
56
|
+
|
|
57
|
+
useImperativeHandle(
|
|
58
|
+
ref,
|
|
59
|
+
() => ({
|
|
60
|
+
show: () => {
|
|
61
|
+
if (detailsRef.current && typeof detailsRef.current.show === 'function') {
|
|
62
|
+
detailsRef.current.show();
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
hide: () => {
|
|
66
|
+
if (detailsRef.current && typeof detailsRef.current.hide === 'function') {
|
|
67
|
+
detailsRef.current.hide();
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
get element() {
|
|
71
|
+
return detailsRef.current;
|
|
72
|
+
},
|
|
73
|
+
}),
|
|
74
|
+
[]
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
const el = detailsRef.current;
|
|
79
|
+
if (!el) return;
|
|
80
|
+
|
|
81
|
+
const handleShow = (e: Event) => onShow?.(e as CustomEvent);
|
|
82
|
+
const handleAfterShow = (e: Event) => onAfterShow?.(e as CustomEvent);
|
|
83
|
+
const handleHide = (e: Event) => onHide?.(e as CustomEvent);
|
|
84
|
+
const handleAfterHide = (e: Event) => onAfterHide?.(e as CustomEvent);
|
|
85
|
+
|
|
86
|
+
el.addEventListener('wa-show', handleShow);
|
|
87
|
+
el.addEventListener('wa-after-show', handleAfterShow);
|
|
88
|
+
el.addEventListener('wa-hide', handleHide);
|
|
89
|
+
el.addEventListener('wa-after-hide', handleAfterHide);
|
|
90
|
+
|
|
91
|
+
return () => {
|
|
92
|
+
el.removeEventListener('wa-show', handleShow);
|
|
93
|
+
el.removeEventListener('wa-after-show', handleAfterShow);
|
|
94
|
+
el.removeEventListener('wa-hide', handleHide);
|
|
95
|
+
el.removeEventListener('wa-after-hide', handleAfterHide);
|
|
96
|
+
};
|
|
97
|
+
}, [onShow, onAfterShow, onHide, onAfterHide]);
|
|
98
|
+
|
|
99
|
+
return (
|
|
100
|
+
<wa-details
|
|
101
|
+
ref={detailsRef}
|
|
102
|
+
class={clsx('Details', className)}
|
|
103
|
+
{...(props as Record<string, unknown>)}
|
|
104
|
+
>
|
|
105
|
+
{children}
|
|
106
|
+
</wa-details>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
Details.displayName = 'Details';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dialog Component Styles
|
|
3
|
+
* Documentation: https://webawesome.com/docs/components/dialog
|
|
4
|
+
*
|
|
5
|
+
* CSS Custom Properties:
|
|
6
|
+
* - --spacing: The amount of space around and between the dialog's content
|
|
7
|
+
* - --width: The preferred width of the dialog
|
|
8
|
+
* - --show-duration: The animation duration when showing the dialog (Default: 200ms)
|
|
9
|
+
* - --hide-duration: The animation duration when hiding the dialog (Default: 200ms)
|
|
10
|
+
*
|
|
11
|
+
* CSS Parts:
|
|
12
|
+
* - dialog: The dialog's internal <dialog> element
|
|
13
|
+
* - header: The dialog's header. This element wraps the title and header actions
|
|
14
|
+
* - header-actions: Optional actions to add to the header
|
|
15
|
+
* - title: The dialog's title
|
|
16
|
+
* - close-button: The close button, a <wa-button>
|
|
17
|
+
* - close-button__base: The close button's exported base part
|
|
18
|
+
* - body: The dialog's body
|
|
19
|
+
* - footer: The dialog's footer
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* .Dialog::part(dialog) {
|
|
23
|
+
* // Custom styles
|
|
24
|
+
* }
|
|
25
|
+
*/
|
|
26
|
+
.Dialog {
|
|
27
|
+
/* Add your custom styles here */
|
|
28
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Dialog.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Dialogs display important prompts and information
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* // Using ref methods
|
|
11
|
+
* const dialogRef = React.useRef(null);
|
|
12
|
+
* <Dialog ref={dialogRef} label="Dialog Title">
|
|
13
|
+
* <p>Dialog content</p>
|
|
14
|
+
* <div slot="footer">
|
|
15
|
+
* <Button data-dialog="close">Close</Button>
|
|
16
|
+
* </div>
|
|
17
|
+
* </Dialog>
|
|
18
|
+
* dialogRef.current?.show();
|
|
19
|
+
*
|
|
20
|
+
* // Using open prop (recommended)
|
|
21
|
+
* const [open, setOpen] = React.useState(false);
|
|
22
|
+
* <Dialog open={open} label="Dialog Title" onHide={() => setOpen(false)}>
|
|
23
|
+
* <p>Dialog content</p>
|
|
24
|
+
* </Dialog>
|
|
25
|
+
*
|
|
26
|
+
* @param {Object} props
|
|
27
|
+
* @param {boolean} [props.open] - Indicates whether or not the dialog is open
|
|
28
|
+
* @param {string} props.label - The dialog's label as displayed in the header
|
|
29
|
+
* @param {boolean} [props['without-header']] - Disables the header and removes the default close button
|
|
30
|
+
* @param {boolean} [props['light-dismiss']] - When enabled, the dialog will be closed when the user clicks outside of it
|
|
31
|
+
* @param {function} [props.onShow] - Event fired when the dialog is shown
|
|
32
|
+
* @param {function} [props.onAfterShow] - Event fired after the dialog is shown
|
|
33
|
+
* @param {function} [props.onHide] - Event fired when the dialog is about to hide
|
|
34
|
+
* @param {function} [props.onAfterHide] - Event fired after the dialog is hidden
|
|
35
|
+
* @param {string} [props.className] - Additional CSS classes
|
|
36
|
+
* @param {React.ReactNode} [props.children] - Dialog content
|
|
37
|
+
* @param {React.Ref} ref - Ref with methods: show(), hide(), requestClose()
|
|
38
|
+
*/
|
|
39
|
+
export const Dialog = React.forwardRef(
|
|
40
|
+
({ children, className, onShow, onAfterShow, onHide, onAfterHide, ...props }, ref) => {
|
|
41
|
+
const dialogRef = React.useRef(null);
|
|
42
|
+
|
|
43
|
+
React.useImperativeHandle(
|
|
44
|
+
ref,
|
|
45
|
+
() => ({
|
|
46
|
+
show: () => {
|
|
47
|
+
if (dialogRef.current && typeof dialogRef.current.show === 'function') {
|
|
48
|
+
dialogRef.current.show();
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
hide: () => {
|
|
52
|
+
// hide is an alias for requestClose for consistency with other components
|
|
53
|
+
if (dialogRef.current && typeof dialogRef.current.requestClose === 'function') {
|
|
54
|
+
dialogRef.current.requestClose();
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
requestClose: () => {
|
|
58
|
+
if (dialogRef.current && typeof dialogRef.current.requestClose === 'function') {
|
|
59
|
+
dialogRef.current.requestClose();
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
get element() {
|
|
63
|
+
return dialogRef.current;
|
|
64
|
+
},
|
|
65
|
+
}),
|
|
66
|
+
[]
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
// Setup event listeners
|
|
70
|
+
React.useEffect(() => {
|
|
71
|
+
const el = dialogRef.current;
|
|
72
|
+
if (!el) return;
|
|
73
|
+
|
|
74
|
+
const handleShow = (e) => {
|
|
75
|
+
if (onShow) onShow(e);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const handleAfterShow = (e) => {
|
|
79
|
+
if (onAfterShow) onAfterShow(e);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const handleHide = (e) => {
|
|
83
|
+
if (onHide) onHide(e);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const handleAfterHide = (e) => {
|
|
87
|
+
if (onAfterHide) onAfterHide(e);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
el.addEventListener('wa-show', handleShow);
|
|
91
|
+
el.addEventListener('wa-after-show', handleAfterShow);
|
|
92
|
+
el.addEventListener('wa-hide', handleHide);
|
|
93
|
+
el.addEventListener('wa-after-hide', handleAfterHide);
|
|
94
|
+
|
|
95
|
+
return () => {
|
|
96
|
+
el.removeEventListener('wa-show', handleShow);
|
|
97
|
+
el.removeEventListener('wa-after-show', handleAfterShow);
|
|
98
|
+
el.removeEventListener('wa-hide', handleHide);
|
|
99
|
+
el.removeEventListener('wa-after-hide', handleAfterHide);
|
|
100
|
+
};
|
|
101
|
+
}, [onShow, onAfterShow, onHide, onAfterHide]);
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<wa-dialog
|
|
105
|
+
ref={dialogRef}
|
|
106
|
+
class={clsx('Dialog', className)}
|
|
107
|
+
{...props}
|
|
108
|
+
>
|
|
109
|
+
{children}
|
|
110
|
+
</wa-dialog>
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
Dialog.displayName = 'Dialog';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { Dialog } from './Dialog';
|
|
4
|
+
|
|
5
|
+
describe('Dialog', () => {
|
|
6
|
+
it('renders without crashing', () => {
|
|
7
|
+
render(<Dialog label="Test Dialog">Dialog content</Dialog>);
|
|
8
|
+
const dialog = screen.getByText('Dialog content');
|
|
9
|
+
expect(dialog).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('applies custom className', () => {
|
|
13
|
+
const { container } = render(
|
|
14
|
+
<Dialog label="Test" className="custom-class">
|
|
15
|
+
Test
|
|
16
|
+
</Dialog>
|
|
17
|
+
);
|
|
18
|
+
const dialog = container.querySelector('wa-dialog');
|
|
19
|
+
expect(dialog?.className).toContain('custom-class');
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('forwards ref correctly', () => {
|
|
23
|
+
const ref = React.createRef();
|
|
24
|
+
render(<Dialog ref={ref} label="Test">Test</Dialog>);
|
|
25
|
+
expect(ref.current).toHaveProperty('show');
|
|
26
|
+
expect(ref.current).toHaveProperty('hide');
|
|
27
|
+
expect(ref.current).toHaveProperty('requestClose');
|
|
28
|
+
});
|
|
29
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { Dialog } from './Dialog';
|
|
3
|
+
|
|
4
|
+
describe('Dialog', () => {
|
|
5
|
+
it('renders children', () => {
|
|
6
|
+
render(<Dialog label="Test">Test</Dialog>);
|
|
7
|
+
expect(screen.getByText('Test')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('applies custom className', () => {
|
|
11
|
+
const { container } = render(<Dialog label="Test" className="custom-class">Test</Dialog>);
|
|
12
|
+
expect(container.querySelector('.custom-class')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { forwardRef, useRef, useImperativeHandle, useEffect, type HTMLAttributes } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Dialog.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Dialogs display important prompts and information
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* // Using open prop (recommended)
|
|
12
|
+
* import { useState } from 'react';
|
|
13
|
+
* import { Dialog } from './components/ui';
|
|
14
|
+
* import { Button } from './components/ui';
|
|
15
|
+
*
|
|
16
|
+
* function App() {
|
|
17
|
+
* const [open, setOpen] = useState(false);
|
|
18
|
+
*
|
|
19
|
+
* return (
|
|
20
|
+
* <>
|
|
21
|
+
* <Button onClick={() => setOpen(true)}>Open Dialog</Button>
|
|
22
|
+
* <Dialog open={open} label="Dialog Title" onHide={() => setOpen(false)}>
|
|
23
|
+
* <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
|
|
24
|
+
* <Button slot="footer" variant="brand" onClick={() => setOpen(false)}>
|
|
25
|
+
* Close
|
|
26
|
+
* </Button>
|
|
27
|
+
* </Dialog>
|
|
28
|
+
* </>
|
|
29
|
+
* );
|
|
30
|
+
* }
|
|
31
|
+
*
|
|
32
|
+
* // Using ref methods (alternative)
|
|
33
|
+
* import { useRef } from 'react';
|
|
34
|
+
* const dialogRef = useRef<DialogRef>(null);
|
|
35
|
+
*
|
|
36
|
+
* <Button onClick={() => dialogRef.current?.show()}>Open Dialog</Button>
|
|
37
|
+
* <Dialog ref={dialogRef} label="Dialog Title">
|
|
38
|
+
* <p>Dialog content</p>
|
|
39
|
+
* <Button slot="footer" variant="brand" onClick={() => dialogRef.current?.hide()}>
|
|
40
|
+
* Close
|
|
41
|
+
* </Button>
|
|
42
|
+
* </Dialog>
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export interface DialogProps extends Omit<HTMLAttributes<HTMLElement>, 'onLoad' | 'dir'> {
|
|
46
|
+
/** Indicates whether or not the dialog is open */
|
|
47
|
+
open?: boolean;
|
|
48
|
+
/** The dialog's label as displayed in the header */
|
|
49
|
+
label: string;
|
|
50
|
+
/** Disables the header and removes the default close button */
|
|
51
|
+
'without-header'?: boolean;
|
|
52
|
+
/** When enabled, the dialog will be closed when the user clicks outside of it */
|
|
53
|
+
'light-dismiss'?: boolean;
|
|
54
|
+
/** Event fired when the dialog is shown */
|
|
55
|
+
onShow?: (event: CustomEvent) => void;
|
|
56
|
+
/** Event fired after the dialog is shown */
|
|
57
|
+
onAfterShow?: (event: CustomEvent) => void;
|
|
58
|
+
/** Event fired when the dialog is about to hide */
|
|
59
|
+
onHide?: (event: CustomEvent) => void;
|
|
60
|
+
/** Event fired after the dialog is hidden */
|
|
61
|
+
onAfterHide?: (event: CustomEvent) => void;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface DialogRef {
|
|
65
|
+
show: () => void;
|
|
66
|
+
hide: () => void;
|
|
67
|
+
requestClose: () => void;
|
|
68
|
+
element: HTMLElement | null;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export const Dialog = forwardRef<DialogRef, DialogProps>(
|
|
72
|
+
({ children, className, open, onShow, onAfterShow, onHide, onAfterHide, ...props }, ref) => {
|
|
73
|
+
const dialogRef = useRef<HTMLElement & {
|
|
74
|
+
show?: () => void;
|
|
75
|
+
requestClose?: () => void;
|
|
76
|
+
open?: boolean;
|
|
77
|
+
}>(null);
|
|
78
|
+
|
|
79
|
+
useImperativeHandle(
|
|
80
|
+
ref,
|
|
81
|
+
() => ({
|
|
82
|
+
show: () => {
|
|
83
|
+
if (dialogRef.current && typeof dialogRef.current.show === 'function') {
|
|
84
|
+
dialogRef.current.show();
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
hide: () => {
|
|
88
|
+
// hide is an alias for requestClose for consistency with other components
|
|
89
|
+
if (dialogRef.current && typeof dialogRef.current.requestClose === 'function') {
|
|
90
|
+
dialogRef.current.requestClose();
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
requestClose: () => {
|
|
94
|
+
if (dialogRef.current && typeof dialogRef.current.requestClose === 'function') {
|
|
95
|
+
dialogRef.current.requestClose();
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
get element() {
|
|
99
|
+
return dialogRef.current;
|
|
100
|
+
},
|
|
101
|
+
}),
|
|
102
|
+
[]
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
// Sync open prop with dialog element
|
|
106
|
+
useEffect(() => {
|
|
107
|
+
const el = dialogRef.current;
|
|
108
|
+
if (!el || open === undefined) return;
|
|
109
|
+
|
|
110
|
+
// Sync open prop with element state
|
|
111
|
+
const isOpen = el.open ?? false;
|
|
112
|
+
if (open && !isOpen) {
|
|
113
|
+
el.show?.();
|
|
114
|
+
} else if (!open && isOpen) {
|
|
115
|
+
el.requestClose?.();
|
|
116
|
+
}
|
|
117
|
+
}, [open]);
|
|
118
|
+
|
|
119
|
+
// Setup event listeners
|
|
120
|
+
useEffect(() => {
|
|
121
|
+
const el = dialogRef.current;
|
|
122
|
+
if (!el) return;
|
|
123
|
+
|
|
124
|
+
const handleShow = (e: Event) => {
|
|
125
|
+
if (onShow) onShow(e as CustomEvent);
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const handleAfterShow = (e: Event) => {
|
|
129
|
+
if (onAfterShow) onAfterShow(e as CustomEvent);
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const handleHide = (e: Event) => {
|
|
133
|
+
if (onHide) onHide(e as CustomEvent);
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const handleAfterHide = (e: Event) => {
|
|
137
|
+
if (onAfterHide) onAfterHide(e as CustomEvent);
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
el.addEventListener('wa-show', handleShow);
|
|
141
|
+
el.addEventListener('wa-after-show', handleAfterShow);
|
|
142
|
+
el.addEventListener('wa-hide', handleHide);
|
|
143
|
+
el.addEventListener('wa-after-hide', handleAfterHide);
|
|
144
|
+
|
|
145
|
+
return () => {
|
|
146
|
+
el.removeEventListener('wa-show', handleShow);
|
|
147
|
+
el.removeEventListener('wa-after-show', handleAfterShow);
|
|
148
|
+
el.removeEventListener('wa-hide', handleHide);
|
|
149
|
+
el.removeEventListener('wa-after-hide', handleAfterHide);
|
|
150
|
+
};
|
|
151
|
+
}, [onShow, onAfterShow, onHide, onAfterHide]);
|
|
152
|
+
|
|
153
|
+
return (
|
|
154
|
+
<wa-dialog
|
|
155
|
+
ref={dialogRef}
|
|
156
|
+
class={clsx('Dialog', className)}
|
|
157
|
+
{...(props as Record<string, unknown>)}
|
|
158
|
+
>
|
|
159
|
+
{children}
|
|
160
|
+
</wa-dialog>
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
|
|
165
|
+
Dialog.displayName = 'Dialog';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Divider Component Styles
|
|
3
|
+
* Documentation: https://webawesome.com/docs/components/divider
|
|
4
|
+
*
|
|
5
|
+
* CSS Custom Properties:
|
|
6
|
+
* - --color: The color of the divider
|
|
7
|
+
* - --width: The width of the divider
|
|
8
|
+
* - --spacing: The spacing of the divider
|
|
9
|
+
*
|
|
10
|
+
* CSS Parts:
|
|
11
|
+
* (No CSS parts defined for this component)
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* .Divider {
|
|
15
|
+
* --color: #ccc;
|
|
16
|
+
* --width: 2px;
|
|
17
|
+
* }
|
|
18
|
+
*/
|
|
19
|
+
.Divider {
|
|
20
|
+
/* Add your custom styles here */
|
|
21
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Divider.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {Object} DividerProps
|
|
8
|
+
* @property {'horizontal' | 'vertical'} [orientation] - Sets the divider's orientation
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export const Divider = React.forwardRef(
|
|
12
|
+
({ className, orientation, ...props }, ref) => {
|
|
13
|
+
return (
|
|
14
|
+
<wa-divider
|
|
15
|
+
ref={ref}
|
|
16
|
+
class={clsx('Divider', className)}
|
|
17
|
+
orientation={orientation}
|
|
18
|
+
{...props}
|
|
19
|
+
/>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
Divider.displayName = 'Divider';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Divider } from './Divider';
|
|
5
|
+
|
|
6
|
+
describe('Divider', () => {
|
|
7
|
+
it('renders without crashing', () => {
|
|
8
|
+
const { container } = render(<Divider />);
|
|
9
|
+
expect(container.querySelector('wa-divider')).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('applies orientation prop', () => {
|
|
13
|
+
const { container } = render(<Divider orientation="vertical" />);
|
|
14
|
+
expect(container.querySelector('wa-divider')).toHaveAttribute('orientation', 'vertical');
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render } from '@testing-library/react';
|
|
2
|
+
import { Divider } from './Divider';
|
|
3
|
+
|
|
4
|
+
describe('Divider', () => {
|
|
5
|
+
it('renders without crashing', () => {
|
|
6
|
+
const { container } = render(<Divider />);
|
|
7
|
+
expect(container.querySelector('wa-divider')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('applies custom className', () => {
|
|
11
|
+
const { container } = render(<Divider className="custom-class" />);
|
|
12
|
+
expect(container.querySelector('.custom-class')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { forwardRef, type HTMLAttributes } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Divider.css';
|
|
5
|
+
|
|
6
|
+
export interface DividerProps extends Omit<HTMLAttributes<HTMLElement>, 'dir'> {
|
|
7
|
+
/** Sets the divider's orientation */
|
|
8
|
+
orientation?: 'horizontal' | 'vertical';
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const Divider = forwardRef<HTMLElement, DividerProps>(
|
|
12
|
+
({ className, orientation, ...props }, ref) => {
|
|
13
|
+
return (
|
|
14
|
+
<wa-divider
|
|
15
|
+
ref={ref}
|
|
16
|
+
class={clsx('Divider', className)}
|
|
17
|
+
orientation={orientation}
|
|
18
|
+
{...(props as Record<string, unknown>)}
|
|
19
|
+
/>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
Divider.displayName = 'Divider';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drawer Component Styles
|
|
3
|
+
* Documentation: https://webawesome.com/docs/components/drawer
|
|
4
|
+
*
|
|
5
|
+
* CSS Custom Properties:
|
|
6
|
+
* - --spacing: The amount of space around and between the drawer's content
|
|
7
|
+
* - --size: The preferred size of the drawer
|
|
8
|
+
* - --show-duration: The animation duration when showing the drawer (Default: 200ms)
|
|
9
|
+
* - --hide-duration: The animation duration when hiding the drawer (Default: 200ms)
|
|
10
|
+
*
|
|
11
|
+
* CSS Parts:
|
|
12
|
+
* - dialog: The drawer's internal <dialog> element
|
|
13
|
+
* - header: The drawer's header. This element wraps the title and header actions
|
|
14
|
+
* - header-actions: Optional actions to add to the header
|
|
15
|
+
* - title: The drawer's title
|
|
16
|
+
* - close-button: The close button, a <wa-button>
|
|
17
|
+
* - close-button__base: The close button's exported base part
|
|
18
|
+
* - body: The drawer's body
|
|
19
|
+
* - footer: The drawer's footer
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* .Drawer::part(dialog) {
|
|
23
|
+
* // Custom styles
|
|
24
|
+
* }
|
|
25
|
+
*/
|
|
26
|
+
.Drawer {
|
|
27
|
+
/* Add your custom styles here */
|
|
28
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Drawer.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {Object} DrawerRef
|
|
8
|
+
* @property {() => void} show
|
|
9
|
+
* @property {() => void} hide
|
|
10
|
+
* @property {HTMLElement | null} element
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export const Drawer = React.forwardRef(
|
|
14
|
+
({ children, className, open, onShow, onAfterShow, onHide, onAfterHide, ...props }, ref) => {
|
|
15
|
+
const drawerRef = React.useRef(null);
|
|
16
|
+
|
|
17
|
+
React.useImperativeHandle(
|
|
18
|
+
ref,
|
|
19
|
+
() => ({
|
|
20
|
+
show: () => drawerRef.current?.show?.(),
|
|
21
|
+
hide: () => drawerRef.current?.hide?.(),
|
|
22
|
+
get element() {
|
|
23
|
+
return drawerRef.current;
|
|
24
|
+
},
|
|
25
|
+
}),
|
|
26
|
+
[]
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
React.useEffect(() => {
|
|
30
|
+
const el = drawerRef.current;
|
|
31
|
+
if (!el || open === undefined) return;
|
|
32
|
+
|
|
33
|
+
const isOpen = el.open ?? false;
|
|
34
|
+
if (open && !isOpen) {
|
|
35
|
+
el.show?.();
|
|
36
|
+
} else if (!open && isOpen) {
|
|
37
|
+
el.hide?.();
|
|
38
|
+
}
|
|
39
|
+
}, [open]);
|
|
40
|
+
|
|
41
|
+
React.useEffect(() => {
|
|
42
|
+
const el = drawerRef.current;
|
|
43
|
+
if (!el) return;
|
|
44
|
+
|
|
45
|
+
const handleShow = (e) => onShow?.(e);
|
|
46
|
+
const handleAfterShow = (e) => onAfterShow?.(e);
|
|
47
|
+
const handleHide = (e) => onHide?.(e);
|
|
48
|
+
const handleAfterHide = (e) => onAfterHide?.(e);
|
|
49
|
+
|
|
50
|
+
el.addEventListener('wa-show', handleShow);
|
|
51
|
+
el.addEventListener('wa-after-show', handleAfterShow);
|
|
52
|
+
el.addEventListener('wa-hide', handleHide);
|
|
53
|
+
el.addEventListener('wa-after-hide', handleAfterHide);
|
|
54
|
+
|
|
55
|
+
return () => {
|
|
56
|
+
el.removeEventListener('wa-show', handleShow);
|
|
57
|
+
el.removeEventListener('wa-after-show', handleAfterShow);
|
|
58
|
+
el.removeEventListener('wa-hide', handleHide);
|
|
59
|
+
el.removeEventListener('wa-after-hide', handleAfterHide);
|
|
60
|
+
};
|
|
61
|
+
}, [onShow, onAfterShow, onHide, onAfterHide]);
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<wa-drawer
|
|
65
|
+
ref={drawerRef}
|
|
66
|
+
class={clsx('Drawer', className)}
|
|
67
|
+
{...props}
|
|
68
|
+
>
|
|
69
|
+
{children}
|
|
70
|
+
</wa-drawer>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
Drawer.displayName = 'Drawer';
|