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,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tooltip Component Styles
|
|
3
|
+
* Documentation: https://webawesome.com/docs/components/tooltip
|
|
4
|
+
*
|
|
5
|
+
* CSS Custom Properties:
|
|
6
|
+
* - --max-width: The maximum width of the tooltip before its content will wrap
|
|
7
|
+
*
|
|
8
|
+
* CSS Parts:
|
|
9
|
+
* - base: The component's base wrapper, an <wa-popup> element
|
|
10
|
+
* - base__popup: The popup's exported popup part. Use this to target the tooltip's popup container
|
|
11
|
+
* - base__arrow: The popup's exported arrow part. Use this to target the tooltip's arrow
|
|
12
|
+
* - body: The tooltip's body where its content is rendered
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* .Tooltip::part(body) {
|
|
16
|
+
* // Custom styles
|
|
17
|
+
* }
|
|
18
|
+
*/
|
|
19
|
+
.Tooltip {
|
|
20
|
+
/* Add your custom styles here */
|
|
21
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React, { useRef, useImperativeHandle, useEffect } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Tooltip.css';
|
|
5
|
+
|
|
6
|
+
export const Tooltip = React.forwardRef(
|
|
7
|
+
({ children, className, open, onShow, onAfterShow, onHide, onAfterHide, ...props }, ref) => {
|
|
8
|
+
const tooltipRef = useRef(null);
|
|
9
|
+
|
|
10
|
+
useImperativeHandle(ref, () => ({
|
|
11
|
+
show: () => tooltipRef.current?.show?.(),
|
|
12
|
+
hide: () => tooltipRef.current?.hide?.(),
|
|
13
|
+
get element() {
|
|
14
|
+
return tooltipRef.current;
|
|
15
|
+
},
|
|
16
|
+
}), []);
|
|
17
|
+
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
const el = tooltipRef.current;
|
|
20
|
+
if (!el || open === undefined) return;
|
|
21
|
+
const isOpen = el.open ?? false;
|
|
22
|
+
if (open && !isOpen) {
|
|
23
|
+
el.show?.();
|
|
24
|
+
} else if (!open && isOpen) {
|
|
25
|
+
el.hide?.();
|
|
26
|
+
}
|
|
27
|
+
}, [open]);
|
|
28
|
+
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
const el = tooltipRef.current;
|
|
31
|
+
if (!el) return;
|
|
32
|
+
|
|
33
|
+
const handleShow = (e) => onShow?.(e);
|
|
34
|
+
const handleAfterShow = (e) => onAfterShow?.(e);
|
|
35
|
+
const handleHide = (e) => onHide?.(e);
|
|
36
|
+
const handleAfterHide = (e) => onAfterHide?.(e);
|
|
37
|
+
|
|
38
|
+
el.addEventListener('wa-show', handleShow);
|
|
39
|
+
el.addEventListener('wa-after-show', handleAfterShow);
|
|
40
|
+
el.addEventListener('wa-hide', handleHide);
|
|
41
|
+
el.addEventListener('wa-after-hide', handleAfterHide);
|
|
42
|
+
|
|
43
|
+
return () => {
|
|
44
|
+
el.removeEventListener('wa-show', handleShow);
|
|
45
|
+
el.removeEventListener('wa-after-show', handleAfterShow);
|
|
46
|
+
el.removeEventListener('wa-hide', handleHide);
|
|
47
|
+
el.removeEventListener('wa-after-hide', handleAfterHide);
|
|
48
|
+
};
|
|
49
|
+
}, [onShow, onAfterShow, onHide, onAfterHide]);
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<wa-tooltip
|
|
53
|
+
ref={tooltipRef}
|
|
54
|
+
class={clsx('Tooltip', className)}
|
|
55
|
+
{...props}
|
|
56
|
+
>
|
|
57
|
+
{children}
|
|
58
|
+
</wa-tooltip>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
Tooltip.displayName = 'Tooltip';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Tooltip } from './Tooltip';
|
|
5
|
+
|
|
6
|
+
describe('Tooltip', () => {
|
|
7
|
+
it('renders without crashing', () => {
|
|
8
|
+
const { container } = render(
|
|
9
|
+
<Tooltip content="Tooltip text">
|
|
10
|
+
<button>Hover me</button>
|
|
11
|
+
</Tooltip>
|
|
12
|
+
);
|
|
13
|
+
expect(container.querySelector('wa-tooltip')).toBeInTheDocument();
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { Tooltip } from './Tooltip';
|
|
3
|
+
|
|
4
|
+
describe('Tooltip', () => {
|
|
5
|
+
it('renders children', () => {
|
|
6
|
+
render(<Tooltip content="Tooltip text">Test</Tooltip>);
|
|
7
|
+
expect(screen.getByText('Test')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('applies custom className', () => {
|
|
11
|
+
const { container } = render(<Tooltip content="Tooltip text" className="custom-class">Test</Tooltip>);
|
|
12
|
+
expect(container.querySelector('.custom-class')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { forwardRef, useRef, useImperativeHandle, useEffect, type HTMLAttributes } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Tooltip.css';
|
|
5
|
+
|
|
6
|
+
export interface TooltipProps extends Omit<HTMLAttributes<HTMLElement>, 'dir'> {
|
|
7
|
+
/** The tooltip's content */
|
|
8
|
+
content?: string;
|
|
9
|
+
/** Disables the tooltip */
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/** Distance in pixels from the target */
|
|
12
|
+
distance?: number;
|
|
13
|
+
/** Delay before hiding (ms) */
|
|
14
|
+
hideDelay?: number;
|
|
15
|
+
/** Whether the tooltip is open */
|
|
16
|
+
open?: boolean;
|
|
17
|
+
/** Tooltip placement */
|
|
18
|
+
placement?: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end';
|
|
19
|
+
/** Delay before showing (ms) */
|
|
20
|
+
showDelay?: number;
|
|
21
|
+
/** Offset along the target (px) */
|
|
22
|
+
skidding?: number;
|
|
23
|
+
/** Activation method */
|
|
24
|
+
trigger?: string;
|
|
25
|
+
/** Removes the arrow */
|
|
26
|
+
withoutArrow?: boolean;
|
|
27
|
+
/** Emitted when the tooltip begins to show */
|
|
28
|
+
onShow?: (event: CustomEvent) => void;
|
|
29
|
+
/** Emitted after the tooltip has shown */
|
|
30
|
+
onAfterShow?: (event: CustomEvent) => void;
|
|
31
|
+
/** Emitted when the tooltip begins to hide */
|
|
32
|
+
onHide?: (event: CustomEvent) => void;
|
|
33
|
+
/** Emitted after the tooltip has hidden */
|
|
34
|
+
onAfterHide?: (event: CustomEvent) => void;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface TooltipRef {
|
|
38
|
+
show: () => void;
|
|
39
|
+
hide: () => void;
|
|
40
|
+
element: HTMLElement | null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export const Tooltip = forwardRef<TooltipRef, TooltipProps>(
|
|
44
|
+
({ children, className, open, onShow, onAfterShow, onHide, onAfterHide, ...props }, ref) => {
|
|
45
|
+
const tooltipRef = useRef<HTMLElement & {
|
|
46
|
+
show?: () => void;
|
|
47
|
+
hide?: () => void;
|
|
48
|
+
open?: boolean;
|
|
49
|
+
}>(null);
|
|
50
|
+
|
|
51
|
+
useImperativeHandle(ref, () => ({
|
|
52
|
+
show: () => tooltipRef.current?.show?.(),
|
|
53
|
+
hide: () => tooltipRef.current?.hide?.(),
|
|
54
|
+
get element() {
|
|
55
|
+
return tooltipRef.current;
|
|
56
|
+
},
|
|
57
|
+
}), []);
|
|
58
|
+
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
const el = tooltipRef.current;
|
|
61
|
+
if (!el || open === undefined) return;
|
|
62
|
+
const isOpen = el.open ?? false;
|
|
63
|
+
if (open && !isOpen) {
|
|
64
|
+
el.show?.();
|
|
65
|
+
} else if (!open && isOpen) {
|
|
66
|
+
el.hide?.();
|
|
67
|
+
}
|
|
68
|
+
}, [open]);
|
|
69
|
+
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
const el = tooltipRef.current;
|
|
72
|
+
if (!el) return;
|
|
73
|
+
|
|
74
|
+
const handleShow = (e: Event) => onShow?.(e as CustomEvent);
|
|
75
|
+
const handleAfterShow = (e: Event) => onAfterShow?.(e as CustomEvent);
|
|
76
|
+
const handleHide = (e: Event) => onHide?.(e as CustomEvent);
|
|
77
|
+
const handleAfterHide = (e: Event) => onAfterHide?.(e as CustomEvent);
|
|
78
|
+
|
|
79
|
+
el.addEventListener('wa-show', handleShow);
|
|
80
|
+
el.addEventListener('wa-after-show', handleAfterShow);
|
|
81
|
+
el.addEventListener('wa-hide', handleHide);
|
|
82
|
+
el.addEventListener('wa-after-hide', handleAfterHide);
|
|
83
|
+
|
|
84
|
+
return () => {
|
|
85
|
+
el.removeEventListener('wa-show', handleShow);
|
|
86
|
+
el.removeEventListener('wa-after-show', handleAfterShow);
|
|
87
|
+
el.removeEventListener('wa-hide', handleHide);
|
|
88
|
+
el.removeEventListener('wa-after-hide', handleAfterHide);
|
|
89
|
+
};
|
|
90
|
+
}, [onShow, onAfterShow, onHide, onAfterHide]);
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
<wa-tooltip
|
|
94
|
+
ref={tooltipRef}
|
|
95
|
+
class={clsx('Tooltip', className)}
|
|
96
|
+
{...(props as Record<string, unknown>)}
|
|
97
|
+
>
|
|
98
|
+
{children}
|
|
99
|
+
</wa-tooltip>
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
Tooltip.displayName = 'Tooltip';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tree Component Styles
|
|
3
|
+
* Documentation: https://webawesome.com/docs/components/tree
|
|
4
|
+
*
|
|
5
|
+
* CSS Custom Properties:
|
|
6
|
+
* - --indent-size: The size of the indentation for nested items (Default: var(--wa-space-m))
|
|
7
|
+
* - --indent-guide-color: The color of the indentation line (Default: var(--wa-color-surface-border))
|
|
8
|
+
* - --indent-guide-offset: The amount of vertical spacing to leave between the top and bottom of the indentation line's starting position (Default: 0)
|
|
9
|
+
* - --indent-guide-style: The style of the indentation line, e.g. solid, dotted, dashed (Default: solid)
|
|
10
|
+
* - --indent-guide-width: The width of the indentation line (Default: 0)
|
|
11
|
+
*
|
|
12
|
+
* CSS Parts:
|
|
13
|
+
* - base: The component's base wrapper
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* .Tree::part(base) {
|
|
17
|
+
* // Custom styles
|
|
18
|
+
* }
|
|
19
|
+
*/
|
|
20
|
+
.Tree {
|
|
21
|
+
/* Add your custom styles here */
|
|
22
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React, { useRef, useImperativeHandle, useEffect } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Tree.css';
|
|
5
|
+
|
|
6
|
+
export const Tree = React.forwardRef(
|
|
7
|
+
({ children, className, onSelectionChange, ...props }, ref) => {
|
|
8
|
+
const treeRef = useRef(null);
|
|
9
|
+
|
|
10
|
+
useImperativeHandle(ref, () => ({
|
|
11
|
+
get element() {
|
|
12
|
+
return treeRef.current;
|
|
13
|
+
},
|
|
14
|
+
}), []);
|
|
15
|
+
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
const el = treeRef.current;
|
|
18
|
+
if (!el) return;
|
|
19
|
+
|
|
20
|
+
const handleSelectionChange = (e) => onSelectionChange?.(e);
|
|
21
|
+
|
|
22
|
+
el.addEventListener('wa-selection-change', handleSelectionChange);
|
|
23
|
+
|
|
24
|
+
return () => {
|
|
25
|
+
el.removeEventListener('wa-selection-change', handleSelectionChange);
|
|
26
|
+
};
|
|
27
|
+
}, [onSelectionChange]);
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<wa-tree
|
|
31
|
+
ref={treeRef}
|
|
32
|
+
class={clsx('Tree', className)}
|
|
33
|
+
{...props}
|
|
34
|
+
>
|
|
35
|
+
{children}
|
|
36
|
+
</wa-tree>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
Tree.displayName = 'Tree';
|
|
@@ -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 { Tree } from './Tree';
|
|
5
|
+
|
|
6
|
+
describe('Tree', () => {
|
|
7
|
+
it('renders without crashing', () => {
|
|
8
|
+
const { container } = render(<Tree>Tree content</Tree>);
|
|
9
|
+
expect(container.querySelector('wa-tree')).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { Tree } from './Tree';
|
|
3
|
+
|
|
4
|
+
describe('Tree', () => {
|
|
5
|
+
it('renders children', () => {
|
|
6
|
+
render(<Tree>Test</Tree>);
|
|
7
|
+
expect(screen.getByText('Test')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('applies custom className', () => {
|
|
11
|
+
const { container } = render(<Tree className="custom-class">Test</Tree>);
|
|
12
|
+
expect(container.querySelector('.custom-class')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { forwardRef, useRef, useImperativeHandle, useEffect, type HTMLAttributes } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './Tree.css';
|
|
5
|
+
|
|
6
|
+
export interface TreeProps extends Omit<HTMLAttributes<HTMLElement>, 'dir'> {
|
|
7
|
+
/** The selection behavior of the tree */
|
|
8
|
+
selection?: 'single' | 'multiple' | 'leaf';
|
|
9
|
+
/** Emitted when a tree item is selected or deselected */
|
|
10
|
+
onSelectionChange?: (event: CustomEvent) => void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface TreeRef {
|
|
14
|
+
element: HTMLElement | null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const Tree = forwardRef<TreeRef, TreeProps>(
|
|
18
|
+
({ children, className, onSelectionChange, ...props }, ref) => {
|
|
19
|
+
const treeRef = useRef<HTMLElement>(null);
|
|
20
|
+
|
|
21
|
+
useImperativeHandle(ref, () => ({
|
|
22
|
+
get element() {
|
|
23
|
+
return treeRef.current;
|
|
24
|
+
},
|
|
25
|
+
}), []);
|
|
26
|
+
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
const el = treeRef.current;
|
|
29
|
+
if (!el) return;
|
|
30
|
+
|
|
31
|
+
const handleSelectionChange = (e: Event) => onSelectionChange?.(e as CustomEvent);
|
|
32
|
+
|
|
33
|
+
el.addEventListener('wa-selection-change', handleSelectionChange);
|
|
34
|
+
|
|
35
|
+
return () => {
|
|
36
|
+
el.removeEventListener('wa-selection-change', handleSelectionChange);
|
|
37
|
+
};
|
|
38
|
+
}, [onSelectionChange]);
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<wa-tree
|
|
42
|
+
ref={treeRef}
|
|
43
|
+
class={clsx('Tree', className)}
|
|
44
|
+
{...(props as Record<string, unknown>)}
|
|
45
|
+
>
|
|
46
|
+
{children}
|
|
47
|
+
</wa-tree>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
Tree.displayName = 'Tree';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TreeItem Component Styles
|
|
3
|
+
* Documentation: https://webawesome.com/docs/components/tree-item
|
|
4
|
+
*
|
|
5
|
+
* CSS Custom Properties:
|
|
6
|
+
* - --show-duration: The animation duration when expanding tree items (Default: 200ms)
|
|
7
|
+
* - --hide-duration: The animation duration when collapsing tree items (Default: 200ms)
|
|
8
|
+
*
|
|
9
|
+
* CSS Parts:
|
|
10
|
+
* - base: The component's base wrapper
|
|
11
|
+
* - item: The tree item's container. This element wraps everything except slotted tree item children
|
|
12
|
+
* - indentation: The tree item's indentation container
|
|
13
|
+
* - expand-button: The container that wraps the tree item's expand button and spinner
|
|
14
|
+
* - spinner: The spinner that shows when a lazy tree item is in the loading state
|
|
15
|
+
* - spinner__base: The spinner's base part
|
|
16
|
+
* - label: The tree item's label
|
|
17
|
+
* - children: The container that wraps the tree item's nested children
|
|
18
|
+
* - checkbox: The checkbox that shows when using multiselect
|
|
19
|
+
* - checkbox__base: The checkbox's exported base part
|
|
20
|
+
* - checkbox__control: The checkbox's exported control part
|
|
21
|
+
* - checkbox__checked-icon: The checkbox's exported checked-icon part
|
|
22
|
+
* - checkbox__indeterminate-icon: The checkbox's exported indeterminate-icon part
|
|
23
|
+
* - checkbox__label: The checkbox's exported label part
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* .TreeItem::part(item) {
|
|
27
|
+
* // Custom styles
|
|
28
|
+
* }
|
|
29
|
+
*/
|
|
30
|
+
.TreeItem {
|
|
31
|
+
/* Add your custom styles here */
|
|
32
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React, { useRef, useImperativeHandle, useEffect } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './TreeItem.css';
|
|
5
|
+
|
|
6
|
+
export const TreeItem = React.forwardRef(
|
|
7
|
+
({ children, className, onCollapse, onAfterCollapse, onExpand, onAfterExpand, onLazyChange, onLazyLoad, ...props }, ref) => {
|
|
8
|
+
const treeItemRef = useRef(null);
|
|
9
|
+
|
|
10
|
+
useImperativeHandle(ref, () => ({
|
|
11
|
+
getChildrenItems: (options) => treeItemRef.current?.getChildrenItems?.(options) ?? [],
|
|
12
|
+
get element() {
|
|
13
|
+
return treeItemRef.current;
|
|
14
|
+
},
|
|
15
|
+
}), []);
|
|
16
|
+
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
const el = treeItemRef.current;
|
|
19
|
+
if (!el) return;
|
|
20
|
+
|
|
21
|
+
const handleCollapse = (e) => onCollapse?.(e);
|
|
22
|
+
const handleAfterCollapse = (e) => onAfterCollapse?.(e);
|
|
23
|
+
const handleExpand = (e) => onExpand?.(e);
|
|
24
|
+
const handleAfterExpand = (e) => onAfterExpand?.(e);
|
|
25
|
+
const handleLazyChange = (e) => onLazyChange?.(e);
|
|
26
|
+
const handleLazyLoad = (e) => onLazyLoad?.(e);
|
|
27
|
+
|
|
28
|
+
el.addEventListener('wa-collapse', handleCollapse);
|
|
29
|
+
el.addEventListener('wa-after-collapse', handleAfterCollapse);
|
|
30
|
+
el.addEventListener('wa-expand', handleExpand);
|
|
31
|
+
el.addEventListener('wa-after-expand', handleAfterExpand);
|
|
32
|
+
el.addEventListener('wa-lazy-change', handleLazyChange);
|
|
33
|
+
el.addEventListener('wa-lazy-load', handleLazyLoad);
|
|
34
|
+
|
|
35
|
+
return () => {
|
|
36
|
+
el.removeEventListener('wa-collapse', handleCollapse);
|
|
37
|
+
el.removeEventListener('wa-after-collapse', handleAfterCollapse);
|
|
38
|
+
el.removeEventListener('wa-expand', handleExpand);
|
|
39
|
+
el.removeEventListener('wa-after-expand', handleAfterExpand);
|
|
40
|
+
el.removeEventListener('wa-lazy-change', handleLazyChange);
|
|
41
|
+
el.removeEventListener('wa-lazy-load', handleLazyLoad);
|
|
42
|
+
};
|
|
43
|
+
}, [onCollapse, onAfterCollapse, onExpand, onAfterExpand, onLazyChange, onLazyLoad]);
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<wa-tree-item
|
|
47
|
+
ref={treeItemRef}
|
|
48
|
+
class={clsx('TreeItem', className)}
|
|
49
|
+
{...props}
|
|
50
|
+
>
|
|
51
|
+
{children}
|
|
52
|
+
</wa-tree-item>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
TreeItem.displayName = 'TreeItem';
|
|
@@ -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 { TreeItem } from './TreeItem';
|
|
5
|
+
|
|
6
|
+
describe('TreeItem', () => {
|
|
7
|
+
it('renders without crashing', () => {
|
|
8
|
+
const { container } = render(<TreeItem>Item 1</TreeItem>);
|
|
9
|
+
expect(container.querySelector('wa-tree-item')).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { TreeItem } from './TreeItem';
|
|
3
|
+
|
|
4
|
+
describe('TreeItem', () => {
|
|
5
|
+
it('renders children', () => {
|
|
6
|
+
render(<TreeItem>Test</TreeItem>);
|
|
7
|
+
expect(screen.getByText('Test')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('applies custom className', () => {
|
|
11
|
+
const { container } = render(<TreeItem className="custom-class">Test</TreeItem>);
|
|
12
|
+
expect(container.querySelector('.custom-class')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { forwardRef, useRef, useImperativeHandle, useEffect, type HTMLAttributes } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './TreeItem.css';
|
|
5
|
+
|
|
6
|
+
export interface TreeItemProps extends Omit<HTMLAttributes<HTMLElement>, 'dir'> {
|
|
7
|
+
/** Disables the tree item */
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
/** Expands the tree item */
|
|
10
|
+
expanded?: boolean;
|
|
11
|
+
/** Enables lazy loading behavior */
|
|
12
|
+
lazy?: boolean;
|
|
13
|
+
/** Draws the tree item in a selected state */
|
|
14
|
+
selected?: boolean;
|
|
15
|
+
/** Emitted when the item collapses */
|
|
16
|
+
onCollapse?: (event: CustomEvent) => void;
|
|
17
|
+
/** Emitted after collapse animation completes */
|
|
18
|
+
onAfterCollapse?: (event: CustomEvent) => void;
|
|
19
|
+
/** Emitted when the item expands */
|
|
20
|
+
onExpand?: (event: CustomEvent) => void;
|
|
21
|
+
/** Emitted after expand animation completes */
|
|
22
|
+
onAfterExpand?: (event: CustomEvent) => void;
|
|
23
|
+
/** Emitted when lazy state changes */
|
|
24
|
+
onLazyChange?: (event: CustomEvent) => void;
|
|
25
|
+
/** Emitted when a lazy item is selected for async loading */
|
|
26
|
+
onLazyLoad?: (event: CustomEvent) => void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface TreeItemRef {
|
|
30
|
+
getChildrenItems: (options?: { includeDisabled?: boolean }) => HTMLElement[];
|
|
31
|
+
element: HTMLElement | null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const TreeItem = forwardRef<TreeItemRef, TreeItemProps>(
|
|
35
|
+
({ children, className, onCollapse, onAfterCollapse, onExpand, onAfterExpand, onLazyChange, onLazyLoad, ...props }, ref) => {
|
|
36
|
+
const treeItemRef = useRef<HTMLElement & {
|
|
37
|
+
getChildrenItems?: (options?: { includeDisabled?: boolean }) => HTMLElement[];
|
|
38
|
+
}>(null);
|
|
39
|
+
|
|
40
|
+
useImperativeHandle(ref, () => ({
|
|
41
|
+
getChildrenItems: (options) => treeItemRef.current?.getChildrenItems?.(options) ?? [],
|
|
42
|
+
get element() {
|
|
43
|
+
return treeItemRef.current;
|
|
44
|
+
},
|
|
45
|
+
}), []);
|
|
46
|
+
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
const el = treeItemRef.current;
|
|
49
|
+
if (!el) return;
|
|
50
|
+
|
|
51
|
+
const handleCollapse = (e: Event) => onCollapse?.(e as CustomEvent);
|
|
52
|
+
const handleAfterCollapse = (e: Event) => onAfterCollapse?.(e as CustomEvent);
|
|
53
|
+
const handleExpand = (e: Event) => onExpand?.(e as CustomEvent);
|
|
54
|
+
const handleAfterExpand = (e: Event) => onAfterExpand?.(e as CustomEvent);
|
|
55
|
+
const handleLazyChange = (e: Event) => onLazyChange?.(e as CustomEvent);
|
|
56
|
+
const handleLazyLoad = (e: Event) => onLazyLoad?.(e as CustomEvent);
|
|
57
|
+
|
|
58
|
+
el.addEventListener('wa-collapse', handleCollapse);
|
|
59
|
+
el.addEventListener('wa-after-collapse', handleAfterCollapse);
|
|
60
|
+
el.addEventListener('wa-expand', handleExpand);
|
|
61
|
+
el.addEventListener('wa-after-expand', handleAfterExpand);
|
|
62
|
+
el.addEventListener('wa-lazy-change', handleLazyChange);
|
|
63
|
+
el.addEventListener('wa-lazy-load', handleLazyLoad);
|
|
64
|
+
|
|
65
|
+
return () => {
|
|
66
|
+
el.removeEventListener('wa-collapse', handleCollapse);
|
|
67
|
+
el.removeEventListener('wa-after-collapse', handleAfterCollapse);
|
|
68
|
+
el.removeEventListener('wa-expand', handleExpand);
|
|
69
|
+
el.removeEventListener('wa-after-expand', handleAfterExpand);
|
|
70
|
+
el.removeEventListener('wa-lazy-change', handleLazyChange);
|
|
71
|
+
el.removeEventListener('wa-lazy-load', handleLazyLoad);
|
|
72
|
+
};
|
|
73
|
+
}, [onCollapse, onAfterCollapse, onExpand, onAfterExpand, onLazyChange, onLazyLoad]);
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
<wa-tree-item
|
|
77
|
+
ref={treeItemRef}
|
|
78
|
+
class={clsx('TreeItem', className)}
|
|
79
|
+
{...(props as Record<string, unknown>)}
|
|
80
|
+
>
|
|
81
|
+
{children}
|
|
82
|
+
</wa-tree-item>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
TreeItem.displayName = 'TreeItem';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ZoomableFrame Component Styles
|
|
3
|
+
* Documentation: https://webawesome.com/docs/components/zoomable-frame
|
|
4
|
+
*
|
|
5
|
+
* CSS Custom Properties:
|
|
6
|
+
* (No custom properties defined for this component)
|
|
7
|
+
*
|
|
8
|
+
* CSS Parts:
|
|
9
|
+
* - iframe: The internal <iframe> element
|
|
10
|
+
* - controls: The container that surrounds zoom control buttons
|
|
11
|
+
* - zoom-in-button: The zoom in button
|
|
12
|
+
* - zoom-out-button: The zoom out button
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* .ZoomableFrame::part(iframe) {
|
|
16
|
+
* // Custom styles
|
|
17
|
+
* }
|
|
18
|
+
*/
|
|
19
|
+
.ZoomableFrame {
|
|
20
|
+
/* Add your custom styles here */
|
|
21
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React, { useRef, useImperativeHandle, useEffect } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '{{{importPath}}}';
|
|
4
|
+
import './ZoomableFrame.css';
|
|
5
|
+
|
|
6
|
+
export const ZoomableFrame = React.forwardRef(
|
|
7
|
+
({ children, className, onLoad, onError, ...props }, ref) => {
|
|
8
|
+
const frameRef = useRef(null);
|
|
9
|
+
|
|
10
|
+
useImperativeHandle(ref, () => ({
|
|
11
|
+
zoomIn: () => frameRef.current?.zoomIn?.(),
|
|
12
|
+
zoomOut: () => frameRef.current?.zoomOut?.(),
|
|
13
|
+
get contentDocument() {
|
|
14
|
+
return frameRef.current?.contentDocument ?? null;
|
|
15
|
+
},
|
|
16
|
+
get contentWindow() {
|
|
17
|
+
return frameRef.current?.contentWindow ?? null;
|
|
18
|
+
},
|
|
19
|
+
get element() {
|
|
20
|
+
return frameRef.current;
|
|
21
|
+
},
|
|
22
|
+
}), []);
|
|
23
|
+
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
const el = frameRef.current;
|
|
26
|
+
if (!el) return;
|
|
27
|
+
|
|
28
|
+
const handleLoad = (e) => onLoad?.(e);
|
|
29
|
+
const handleError = (e) => onError?.(e);
|
|
30
|
+
|
|
31
|
+
el.addEventListener('load', handleLoad);
|
|
32
|
+
el.addEventListener('error', handleError);
|
|
33
|
+
|
|
34
|
+
return () => {
|
|
35
|
+
el.removeEventListener('load', handleLoad);
|
|
36
|
+
el.removeEventListener('error', handleError);
|
|
37
|
+
};
|
|
38
|
+
}, [onLoad, onError]);
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<wa-zoomable-frame
|
|
42
|
+
ref={frameRef}
|
|
43
|
+
class={clsx('ZoomableFrame', className)}
|
|
44
|
+
{...props}
|
|
45
|
+
>
|
|
46
|
+
{children}
|
|
47
|
+
</wa-zoomable-frame>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
ZoomableFrame.displayName = 'ZoomableFrame';
|
|
@@ -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 { ZoomableFrame } from './ZoomableFrame';
|
|
5
|
+
|
|
6
|
+
describe('ZoomableFrame', () => {
|
|
7
|
+
it('renders without crashing', () => {
|
|
8
|
+
const { container } = render(<ZoomableFrame src="https://example.com" />);
|
|
9
|
+
expect(container.querySelector('wa-zoomable-frame')).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render } from '@testing-library/react';
|
|
2
|
+
import { ZoomableFrame } from './ZoomableFrame';
|
|
3
|
+
|
|
4
|
+
describe('ZoomableFrame', () => {
|
|
5
|
+
it('renders without crashing', () => {
|
|
6
|
+
const { container } = render(<ZoomableFrame src="https://example.com" />);
|
|
7
|
+
expect(container.querySelector('wa-zoomable-frame')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('applies custom className', () => {
|
|
11
|
+
const { container } = render(<ZoomableFrame src="https://example.com" className="custom-class" />);
|
|
12
|
+
expect(container.querySelector('.custom-class')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|