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, screen } from '@testing-library/react';
|
|
2
|
+
import { Tab } from './Tab';
|
|
3
|
+
|
|
4
|
+
describe('Tab', () => {
|
|
5
|
+
it('renders children', () => {
|
|
6
|
+
render(<Tab panel="panel-1">Test</Tab>);
|
|
7
|
+
expect(screen.getByText('Test')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('applies custom className', () => {
|
|
11
|
+
const { container } = render(<Tab panel="panel-1" className="custom-class">Test</Tab>);
|
|
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 './Tab.css';
|
|
5
|
+
|
|
6
|
+
export interface TabProps extends Omit<HTMLAttributes<HTMLElement>, 'dir'> {
|
|
7
|
+
/** The name of the tab panel this tab is associated with */
|
|
8
|
+
panel?: string;
|
|
9
|
+
/** Disables the tab */
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const Tab = forwardRef<HTMLElement, TabProps>(
|
|
14
|
+
({ children, className, ...props }, ref) => {
|
|
15
|
+
return (
|
|
16
|
+
<wa-tab
|
|
17
|
+
ref={ref}
|
|
18
|
+
class={clsx('Tab', className)}
|
|
19
|
+
{...(props as Record<string, unknown>)}
|
|
20
|
+
>
|
|
21
|
+
{children}
|
|
22
|
+
</wa-tab>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
Tab.displayName = 'Tab';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TabGroup Component Styles
|
|
3
|
+
* Documentation: https://webawesome.com/docs/components/tab-group
|
|
4
|
+
*
|
|
5
|
+
* CSS Custom Properties:
|
|
6
|
+
* - --indicator-color: The color of the active tab indicator
|
|
7
|
+
* - --track-color: The color of the indicator's track (the line that separates tabs from panels)
|
|
8
|
+
* - --track-width: The width of the indicator's track (the line that separates tabs from panels)
|
|
9
|
+
*
|
|
10
|
+
* CSS Parts:
|
|
11
|
+
* - base: The component's base wrapper
|
|
12
|
+
* - nav: The tab group's navigation container where tabs are slotted in
|
|
13
|
+
* - tabs: The container that wraps the tabs
|
|
14
|
+
* - body: The tab group's body where tab panels are slotted in
|
|
15
|
+
* - scroll-button: The previous/next scroll buttons that show when tabs are scrollable, a <wa-button>
|
|
16
|
+
* - scroll-button-start: The starting scroll button
|
|
17
|
+
* - scroll-button-end: The ending scroll button
|
|
18
|
+
* - scroll-button__base: The scroll button's exported base part
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* .TabGroup::part(tabs) {
|
|
22
|
+
* // Custom styles
|
|
23
|
+
* }
|
|
24
|
+
*/
|
|
25
|
+
.TabGroup {
|
|
26
|
+
/* Add your custom styles here */
|
|
27
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './TabGroup.css';
|
|
5
|
+
|
|
6
|
+
export const TabGroup = React.forwardRef(
|
|
7
|
+
({ children, className, onTabShow, onTabHide, ...props }, ref) => {
|
|
8
|
+
const groupRef = React.useRef(null);
|
|
9
|
+
|
|
10
|
+
React.useEffect(() => {
|
|
11
|
+
const el = groupRef.current;
|
|
12
|
+
if (!el) return;
|
|
13
|
+
|
|
14
|
+
const handleTabShow = (e) => onTabShow?.(e);
|
|
15
|
+
const handleTabHide = (e) => onTabHide?.(e);
|
|
16
|
+
|
|
17
|
+
el.addEventListener('wa-tab-show', handleTabShow);
|
|
18
|
+
el.addEventListener('wa-tab-hide', handleTabHide);
|
|
19
|
+
|
|
20
|
+
return () => {
|
|
21
|
+
el.removeEventListener('wa-tab-show', handleTabShow);
|
|
22
|
+
el.removeEventListener('wa-tab-hide', handleTabHide);
|
|
23
|
+
};
|
|
24
|
+
}, [onTabShow, onTabHide]);
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<wa-tab-group
|
|
28
|
+
ref={(node) => {
|
|
29
|
+
groupRef.current = node;
|
|
30
|
+
if (typeof ref === 'function') ref(node);
|
|
31
|
+
else if (ref) ref.current = node;
|
|
32
|
+
}}
|
|
33
|
+
class={clsx('TabGroup', className)}
|
|
34
|
+
{...props}
|
|
35
|
+
>
|
|
36
|
+
{children}
|
|
37
|
+
</wa-tab-group>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
TabGroup.displayName = 'TabGroup';
|
|
@@ -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 { TabGroup } from './TabGroup';
|
|
5
|
+
|
|
6
|
+
describe('TabGroup', () => {
|
|
7
|
+
it('renders without crashing', () => {
|
|
8
|
+
const { container } = render(<TabGroup />);
|
|
9
|
+
expect(container.querySelector('wa-tab-group')).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { TabGroup } from './TabGroup';
|
|
3
|
+
|
|
4
|
+
describe('TabGroup', () => {
|
|
5
|
+
it('renders children', () => {
|
|
6
|
+
render(<TabGroup>Test</TabGroup>);
|
|
7
|
+
expect(screen.getByText('Test')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('applies custom className', () => {
|
|
11
|
+
const { container } = render(<TabGroup className="custom-class">Test</TabGroup>);
|
|
12
|
+
expect(container.querySelector('.custom-class')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { forwardRef, useRef, useEffect, type HTMLAttributes } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './TabGroup.css';
|
|
5
|
+
|
|
6
|
+
export interface TabGroupProps extends Omit<HTMLAttributes<HTMLElement>, 'dir'> {
|
|
7
|
+
/** When auto, navigating tabs will instantly show the panel */
|
|
8
|
+
activation?: 'auto' | 'manual';
|
|
9
|
+
/** Sets the currently displayed tab panel */
|
|
10
|
+
active?: string;
|
|
11
|
+
/** Determines tab position relative to panels */
|
|
12
|
+
placement?: 'top' | 'bottom' | 'start' | 'end';
|
|
13
|
+
/** Disables the scroll arrows */
|
|
14
|
+
'without-scroll-controls'?: boolean;
|
|
15
|
+
/** Event fired when a tab becomes visible */
|
|
16
|
+
onTabShow?: (event: CustomEvent) => void;
|
|
17
|
+
/** Event fired when a tab becomes hidden */
|
|
18
|
+
onTabHide?: (event: CustomEvent) => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const TabGroup = forwardRef<HTMLElement, TabGroupProps>(
|
|
22
|
+
({ children, className, onTabShow, onTabHide, ...props }, ref) => {
|
|
23
|
+
const groupRef = useRef<HTMLElement>(null);
|
|
24
|
+
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
const el = groupRef.current;
|
|
27
|
+
if (!el) return;
|
|
28
|
+
|
|
29
|
+
const handleTabShow = (e: Event) => onTabShow?.(e as CustomEvent);
|
|
30
|
+
const handleTabHide = (e: Event) => onTabHide?.(e as CustomEvent);
|
|
31
|
+
|
|
32
|
+
el.addEventListener('wa-tab-show', handleTabShow);
|
|
33
|
+
el.addEventListener('wa-tab-hide', handleTabHide);
|
|
34
|
+
|
|
35
|
+
return () => {
|
|
36
|
+
el.removeEventListener('wa-tab-show', handleTabShow);
|
|
37
|
+
el.removeEventListener('wa-tab-hide', handleTabHide);
|
|
38
|
+
};
|
|
39
|
+
}, [onTabShow, onTabHide]);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<wa-tab-group
|
|
43
|
+
ref={(node: HTMLElement | null) => {
|
|
44
|
+
(groupRef as React.MutableRefObject<HTMLElement | null>).current = node;
|
|
45
|
+
if (typeof ref === 'function') ref(node);
|
|
46
|
+
else if (ref) ref.current = node;
|
|
47
|
+
}}
|
|
48
|
+
class={clsx('TabGroup', className)}
|
|
49
|
+
{...(props as Record<string, unknown>)}
|
|
50
|
+
>
|
|
51
|
+
{children}
|
|
52
|
+
</wa-tab-group>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
TabGroup.displayName = 'TabGroup';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TabPanel Component Styles
|
|
3
|
+
* Documentation: https://webawesome.com/docs/components/tab-panel
|
|
4
|
+
*
|
|
5
|
+
* CSS Custom Properties:
|
|
6
|
+
* - --padding: The tab panel's padding
|
|
7
|
+
*
|
|
8
|
+
* CSS Parts:
|
|
9
|
+
* - base: The component's base wrapper
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* .TabPanel::part(base) {
|
|
13
|
+
* // Custom styles
|
|
14
|
+
* }
|
|
15
|
+
*/
|
|
16
|
+
.TabPanel {
|
|
17
|
+
/* Add your custom styles here */
|
|
18
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './TabPanel.css';
|
|
5
|
+
|
|
6
|
+
export const TabPanel = React.forwardRef(
|
|
7
|
+
({ children, className, ...props }, ref) => {
|
|
8
|
+
return (
|
|
9
|
+
<wa-tab-panel
|
|
10
|
+
ref={ref}
|
|
11
|
+
class={clsx('TabPanel', className)}
|
|
12
|
+
{...props}
|
|
13
|
+
>
|
|
14
|
+
{children}
|
|
15
|
+
</wa-tab-panel>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
TabPanel.displayName = 'TabPanel';
|
|
@@ -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 { TabPanel } from './TabPanel';
|
|
5
|
+
|
|
6
|
+
describe('TabPanel', () => {
|
|
7
|
+
it('renders without crashing', () => {
|
|
8
|
+
const { container } = render(<TabPanel name="panel-1">Content</TabPanel>);
|
|
9
|
+
expect(container.querySelector('wa-tab-panel')).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { TabPanel } from './TabPanel';
|
|
3
|
+
|
|
4
|
+
describe('TabPanel', () => {
|
|
5
|
+
it('renders children', () => {
|
|
6
|
+
render(<TabPanel name="panel-1">Test</TabPanel>);
|
|
7
|
+
expect(screen.getByText('Test')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('applies custom className', () => {
|
|
11
|
+
const { container } = render(<TabPanel name="panel-1" className="custom-class">Test</TabPanel>);
|
|
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 './TabPanel.css';
|
|
5
|
+
|
|
6
|
+
export interface TabPanelProps extends Omit<HTMLAttributes<HTMLElement>, 'dir'> {
|
|
7
|
+
/** The tab panel's name */
|
|
8
|
+
name?: string;
|
|
9
|
+
/** When true, the tab panel will be shown */
|
|
10
|
+
active?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const TabPanel = forwardRef<HTMLElement, TabPanelProps>(
|
|
14
|
+
({ children, className, ...props }, ref) => {
|
|
15
|
+
return (
|
|
16
|
+
<wa-tab-panel
|
|
17
|
+
ref={ref}
|
|
18
|
+
class={clsx('TabPanel', className)}
|
|
19
|
+
{...(props as Record<string, unknown>)}
|
|
20
|
+
>
|
|
21
|
+
{children}
|
|
22
|
+
</wa-tab-panel>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
TabPanel.displayName = 'TabPanel';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tag Component Styles
|
|
3
|
+
* Documentation: https://webawesome.com/docs/components/tag
|
|
4
|
+
*
|
|
5
|
+
* CSS Custom Properties:
|
|
6
|
+
* (No custom properties defined for this component)
|
|
7
|
+
*
|
|
8
|
+
* CSS Parts:
|
|
9
|
+
* - base: The component's base wrapper
|
|
10
|
+
* - content: The tag's content
|
|
11
|
+
* - remove-button: The tag's remove button, a <wa-button>
|
|
12
|
+
* - remove-button__base: The remove button's exported base part
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* .Tag::part(base) {
|
|
16
|
+
* // Custom styles
|
|
17
|
+
* }
|
|
18
|
+
*/
|
|
19
|
+
.Tag {
|
|
20
|
+
/* Add your custom styles here */
|
|
21
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React, { useRef, useImperativeHandle, useEffect } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Tag.css';
|
|
5
|
+
|
|
6
|
+
export const Tag = React.forwardRef(
|
|
7
|
+
({ children, className, onRemove, ...props }, ref) => {
|
|
8
|
+
const tagRef = useRef(null);
|
|
9
|
+
|
|
10
|
+
useImperativeHandle(ref, () => ({
|
|
11
|
+
get element() {
|
|
12
|
+
return tagRef.current;
|
|
13
|
+
},
|
|
14
|
+
}), []);
|
|
15
|
+
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
const el = tagRef.current;
|
|
18
|
+
if (!el) return;
|
|
19
|
+
|
|
20
|
+
const handleRemove = (e) => onRemove?.(e);
|
|
21
|
+
|
|
22
|
+
el.addEventListener('wa-remove', handleRemove);
|
|
23
|
+
|
|
24
|
+
return () => {
|
|
25
|
+
el.removeEventListener('wa-remove', handleRemove);
|
|
26
|
+
};
|
|
27
|
+
}, [onRemove]);
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<wa-tag
|
|
31
|
+
ref={tagRef}
|
|
32
|
+
class={clsx('Tag', className)}
|
|
33
|
+
{...props}
|
|
34
|
+
>
|
|
35
|
+
{children}
|
|
36
|
+
</wa-tag>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
Tag.displayName = 'Tag';
|
|
@@ -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 { Tag } from './Tag';
|
|
5
|
+
|
|
6
|
+
describe('Tag', () => {
|
|
7
|
+
it('renders without crashing', () => {
|
|
8
|
+
const { container } = render(<Tag>Label</Tag>);
|
|
9
|
+
expect(container.querySelector('wa-tag')).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { Tag } from './Tag';
|
|
3
|
+
|
|
4
|
+
describe('Tag', () => {
|
|
5
|
+
it('renders children', () => {
|
|
6
|
+
render(<Tag>Test</Tag>);
|
|
7
|
+
expect(screen.getByText('Test')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('applies custom className', () => {
|
|
11
|
+
const { container } = render(<Tag className="custom-class">Test</Tag>);
|
|
12
|
+
expect(container.querySelector('.custom-class')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { forwardRef, useRef, useImperativeHandle, useEffect, type HTMLAttributes } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Tag.css';
|
|
5
|
+
|
|
6
|
+
export interface TagProps extends Omit<HTMLAttributes<HTMLElement>, 'dir'> {
|
|
7
|
+
/** The tag's visual appearance */
|
|
8
|
+
appearance?: 'accent' | 'filled' | 'outlined' | 'filled-outlined';
|
|
9
|
+
/** Draws a pill-style tag with rounded edges */
|
|
10
|
+
pill?: boolean;
|
|
11
|
+
/** The tag's size */
|
|
12
|
+
size?: 'small' | 'medium' | 'large';
|
|
13
|
+
/** The tag's theme variant */
|
|
14
|
+
variant?: 'brand' | 'neutral' | 'success' | 'warning' | 'danger';
|
|
15
|
+
/** Makes the tag removable and shows a remove button */
|
|
16
|
+
withRemove?: boolean;
|
|
17
|
+
/** Emitted when the remove button is activated */
|
|
18
|
+
onRemove?: (event: CustomEvent) => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface TagRef {
|
|
22
|
+
element: HTMLElement | null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const Tag = forwardRef<TagRef, TagProps>(
|
|
26
|
+
({ children, className, onRemove, ...props }, ref) => {
|
|
27
|
+
const tagRef = useRef<HTMLElement>(null);
|
|
28
|
+
|
|
29
|
+
useImperativeHandle(ref, () => ({
|
|
30
|
+
get element() {
|
|
31
|
+
return tagRef.current;
|
|
32
|
+
},
|
|
33
|
+
}), []);
|
|
34
|
+
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
const el = tagRef.current;
|
|
37
|
+
if (!el) return;
|
|
38
|
+
|
|
39
|
+
const handleRemove = (e: Event) => onRemove?.(e as CustomEvent);
|
|
40
|
+
|
|
41
|
+
el.addEventListener('wa-remove', handleRemove);
|
|
42
|
+
|
|
43
|
+
return () => {
|
|
44
|
+
el.removeEventListener('wa-remove', handleRemove);
|
|
45
|
+
};
|
|
46
|
+
}, [onRemove]);
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<wa-tag
|
|
50
|
+
ref={tagRef}
|
|
51
|
+
class={clsx('Tag', className)}
|
|
52
|
+
{...(props as Record<string, unknown>)}
|
|
53
|
+
>
|
|
54
|
+
{children}
|
|
55
|
+
</wa-tag>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
Tag.displayName = 'Tag';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Textarea Component Styles
|
|
3
|
+
* Documentation: https://webawesome.com/docs/components/textarea
|
|
4
|
+
*
|
|
5
|
+
* CSS Custom Properties:
|
|
6
|
+
* (No custom properties defined for this component)
|
|
7
|
+
*
|
|
8
|
+
* CSS Parts:
|
|
9
|
+
* - label: The label
|
|
10
|
+
* - form-control-input: The input's wrapper
|
|
11
|
+
* - hint: The hint's wrapper
|
|
12
|
+
* - textarea: The internal <textarea> control
|
|
13
|
+
* - base: The wrapper around the <textarea> control
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* .Textarea::part(textarea) {
|
|
17
|
+
* // Custom styles
|
|
18
|
+
* }
|
|
19
|
+
*/
|
|
20
|
+
.Textarea {
|
|
21
|
+
/* Add your custom styles here */
|
|
22
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React, { useRef, useImperativeHandle, useEffect } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Textarea.css';
|
|
5
|
+
|
|
6
|
+
export const Textarea = React.forwardRef(
|
|
7
|
+
({ className, onInput, onChange, onInvalid, onFocus, onBlur, ...props }, ref) => {
|
|
8
|
+
const textareaRef = useRef(null);
|
|
9
|
+
|
|
10
|
+
useImperativeHandle(ref, () => ({
|
|
11
|
+
focus: (options) => textareaRef.current?.focus?.(options),
|
|
12
|
+
blur: () => textareaRef.current?.blur?.(),
|
|
13
|
+
select: () => textareaRef.current?.select?.(),
|
|
14
|
+
setRangeText: (replacement, start, end, selectMode) =>
|
|
15
|
+
textareaRef.current?.setRangeText?.(replacement, start, end, selectMode),
|
|
16
|
+
setSelectionRange: (start, end, direction) =>
|
|
17
|
+
textareaRef.current?.setSelectionRange?.(start, end, direction),
|
|
18
|
+
get element() {
|
|
19
|
+
return textareaRef.current;
|
|
20
|
+
},
|
|
21
|
+
}), []);
|
|
22
|
+
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
const el = textareaRef.current;
|
|
25
|
+
if (!el) return;
|
|
26
|
+
|
|
27
|
+
const handleInput = (e) => onInput?.(e);
|
|
28
|
+
const handleChange = (e) => onChange?.(e);
|
|
29
|
+
const handleInvalid = (e) => onInvalid?.(e);
|
|
30
|
+
const handleFocus = (e) => onFocus?.(e);
|
|
31
|
+
const handleBlur = (e) => onBlur?.(e);
|
|
32
|
+
|
|
33
|
+
el.addEventListener('input', handleInput);
|
|
34
|
+
el.addEventListener('change', handleChange);
|
|
35
|
+
el.addEventListener('wa-invalid', handleInvalid);
|
|
36
|
+
el.addEventListener('focus', handleFocus);
|
|
37
|
+
el.addEventListener('blur', handleBlur);
|
|
38
|
+
|
|
39
|
+
return () => {
|
|
40
|
+
el.removeEventListener('input', handleInput);
|
|
41
|
+
el.removeEventListener('change', handleChange);
|
|
42
|
+
el.removeEventListener('wa-invalid', handleInvalid);
|
|
43
|
+
el.removeEventListener('focus', handleFocus);
|
|
44
|
+
el.removeEventListener('blur', handleBlur);
|
|
45
|
+
};
|
|
46
|
+
}, [onInput, onChange, onInvalid, onFocus, onBlur]);
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<wa-textarea
|
|
50
|
+
ref={textareaRef}
|
|
51
|
+
class={clsx('Textarea', className)}
|
|
52
|
+
{...props}
|
|
53
|
+
/>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
Textarea.displayName = 'Textarea';
|
|
@@ -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 { Textarea } from './Textarea';
|
|
5
|
+
|
|
6
|
+
describe('Textarea', () => {
|
|
7
|
+
it('renders without crashing', () => {
|
|
8
|
+
const { container } = render(<Textarea label="Message" />);
|
|
9
|
+
expect(container.querySelector('wa-textarea')).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render } from '@testing-library/react';
|
|
2
|
+
import { Textarea } from './Textarea';
|
|
3
|
+
|
|
4
|
+
describe('Textarea', () => {
|
|
5
|
+
it('renders without crashing', () => {
|
|
6
|
+
const { container } = render(<Textarea />);
|
|
7
|
+
expect(container.querySelector('wa-textarea')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('applies custom className', () => {
|
|
11
|
+
const { container } = render(<Textarea className="custom-class" />);
|
|
12
|
+
expect(container.querySelector('.custom-class')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { forwardRef, useRef, useImperativeHandle, useEffect, type HTMLAttributes } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Textarea.css';
|
|
5
|
+
|
|
6
|
+
export interface TextareaProps extends Omit<HTMLAttributes<HTMLElement>, 'onChange' | 'onInput' | 'onFocus' | 'onBlur' | 'onInvalid' | 'dir'> {
|
|
7
|
+
/** The textarea's visual appearance */
|
|
8
|
+
appearance?: 'filled' | 'outlined' | 'filled-outlined';
|
|
9
|
+
/** Disables the textarea */
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/** The textarea's label */
|
|
12
|
+
label?: string;
|
|
13
|
+
/** Hint text displayed below the textarea */
|
|
14
|
+
hint?: string;
|
|
15
|
+
/** Placeholder text */
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
/** The textarea's value */
|
|
18
|
+
value?: string;
|
|
19
|
+
/** Number of visible rows */
|
|
20
|
+
rows?: number;
|
|
21
|
+
/** The textarea's size */
|
|
22
|
+
size?: 'small' | 'medium' | 'large';
|
|
23
|
+
/** How the textarea can be resized */
|
|
24
|
+
resize?: 'none' | 'vertical' | 'horizontal' | 'both' | 'auto';
|
|
25
|
+
/** Makes the textarea readonly */
|
|
26
|
+
readonly?: boolean;
|
|
27
|
+
/** Makes the textarea required */
|
|
28
|
+
required?: boolean;
|
|
29
|
+
/** Maximum character length */
|
|
30
|
+
maxlength?: number;
|
|
31
|
+
/** Minimum character length */
|
|
32
|
+
minlength?: number;
|
|
33
|
+
/** Enable spell checking */
|
|
34
|
+
spellcheck?: boolean;
|
|
35
|
+
/** Emitted when the textarea receives input */
|
|
36
|
+
onInput?: (event: Event) => void;
|
|
37
|
+
/** Emitted when the value is committed by the user */
|
|
38
|
+
onChange?: (event: Event) => void;
|
|
39
|
+
/** Emitted when the form control is checked for validity */
|
|
40
|
+
onInvalid?: (event: CustomEvent) => void;
|
|
41
|
+
/** Emitted when the textarea gains focus */
|
|
42
|
+
onFocus?: (event: FocusEvent) => void;
|
|
43
|
+
/** Emitted when the textarea loses focus */
|
|
44
|
+
onBlur?: (event: FocusEvent) => void;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface TextareaRef {
|
|
48
|
+
focus: (options?: FocusOptions) => void;
|
|
49
|
+
blur: () => void;
|
|
50
|
+
select: () => void;
|
|
51
|
+
setRangeText: (replacement: string, start?: number, end?: number, selectMode?: string) => void;
|
|
52
|
+
setSelectionRange: (start: number | null, end: number | null, direction?: string) => void;
|
|
53
|
+
element: HTMLElement | null;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export const Textarea = forwardRef<TextareaRef, TextareaProps>(
|
|
57
|
+
({ className, onInput, onChange, onInvalid, onFocus, onBlur, ...props }, ref) => {
|
|
58
|
+
const textareaRef = useRef<HTMLElement & {
|
|
59
|
+
focus?: (options?: FocusOptions) => void;
|
|
60
|
+
blur?: () => void;
|
|
61
|
+
select?: () => void;
|
|
62
|
+
setRangeText?: (replacement: string, start?: number, end?: number, selectMode?: string) => void;
|
|
63
|
+
setSelectionRange?: (start: number | null, end: number | null, direction?: string) => void;
|
|
64
|
+
}>(null);
|
|
65
|
+
|
|
66
|
+
useImperativeHandle(ref, () => ({
|
|
67
|
+
focus: (options?: FocusOptions) => textareaRef.current?.focus?.(options),
|
|
68
|
+
blur: () => textareaRef.current?.blur?.(),
|
|
69
|
+
select: () => textareaRef.current?.select?.(),
|
|
70
|
+
setRangeText: (replacement: string, start?: number, end?: number, selectMode?: string) =>
|
|
71
|
+
textareaRef.current?.setRangeText?.(replacement, start, end, selectMode),
|
|
72
|
+
setSelectionRange: (start: number | null, end: number | null, direction?: string) =>
|
|
73
|
+
textareaRef.current?.setSelectionRange?.(start, end, direction),
|
|
74
|
+
get element() {
|
|
75
|
+
return textareaRef.current;
|
|
76
|
+
},
|
|
77
|
+
}), []);
|
|
78
|
+
|
|
79
|
+
useEffect(() => {
|
|
80
|
+
const el = textareaRef.current;
|
|
81
|
+
if (!el) return;
|
|
82
|
+
|
|
83
|
+
const handleInput = (e: Event) => onInput?.(e);
|
|
84
|
+
const handleChange = (e: Event) => onChange?.(e);
|
|
85
|
+
const handleInvalid = (e: Event) => onInvalid?.(e as CustomEvent);
|
|
86
|
+
const handleFocus = (e: Event) => onFocus?.(e as FocusEvent);
|
|
87
|
+
const handleBlur = (e: Event) => onBlur?.(e as FocusEvent);
|
|
88
|
+
|
|
89
|
+
el.addEventListener('input', handleInput);
|
|
90
|
+
el.addEventListener('change', handleChange);
|
|
91
|
+
el.addEventListener('wa-invalid', handleInvalid);
|
|
92
|
+
el.addEventListener('focus', handleFocus);
|
|
93
|
+
el.addEventListener('blur', handleBlur);
|
|
94
|
+
|
|
95
|
+
return () => {
|
|
96
|
+
el.removeEventListener('input', handleInput);
|
|
97
|
+
el.removeEventListener('change', handleChange);
|
|
98
|
+
el.removeEventListener('wa-invalid', handleInvalid);
|
|
99
|
+
el.removeEventListener('focus', handleFocus);
|
|
100
|
+
el.removeEventListener('blur', handleBlur);
|
|
101
|
+
};
|
|
102
|
+
}, [onInput, onChange, onInvalid, onFocus, onBlur]);
|
|
103
|
+
|
|
104
|
+
return (
|
|
105
|
+
<wa-textarea
|
|
106
|
+
ref={textareaRef}
|
|
107
|
+
class={clsx('Textarea', className)}
|
|
108
|
+
{...(props as Record<string, unknown>)}
|
|
109
|
+
/>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
Textarea.displayName = 'Textarea';
|