@moduix/solid-tailwind 1.0.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/LICENSE.md +9 -0
- package/README.md +130 -0
- package/THIRD_PARTY_NOTICES.md +49 -0
- package/dist/components/accordion/Accordion.d.ts +22 -0
- package/dist/components/accordion/Accordion.js +103 -0
- package/dist/components/accordion/Accordion.jsx +63 -0
- package/dist/components/accordion/index.d.ts +1 -0
- package/dist/components/accordion/index.js +1 -0
- package/dist/components/accordion/index.jsx +1 -0
- package/dist/components/alert/Alert.d.ts +20 -0
- package/dist/components/alert/Alert.js +116 -0
- package/dist/components/alert/Alert.jsx +66 -0
- package/dist/components/alert/index.d.ts +1 -0
- package/dist/components/alert/index.js +1 -0
- package/dist/components/alert/index.jsx +1 -0
- package/dist/components/angle-slider/AngleSlider.d.ts +37 -0
- package/dist/components/angle-slider/AngleSlider.js +165 -0
- package/dist/components/angle-slider/AngleSlider.jsx +97 -0
- package/dist/components/angle-slider/index.d.ts +1 -0
- package/dist/components/angle-slider/index.js +1 -0
- package/dist/components/angle-slider/index.jsx +1 -0
- package/dist/components/aspect-ratio/AspectRatio.d.ts +13 -0
- package/dist/components/aspect-ratio/AspectRatio.js +43 -0
- package/dist/components/aspect-ratio/AspectRatio.jsx +28 -0
- package/dist/components/aspect-ratio/index.d.ts +1 -0
- package/dist/components/aspect-ratio/index.js +1 -0
- package/dist/components/aspect-ratio/index.jsx +1 -0
- package/dist/components/avatar/Avatar.d.ts +21 -0
- package/dist/components/avatar/Avatar.js +88 -0
- package/dist/components/avatar/Avatar.jsx +59 -0
- package/dist/components/avatar/index.d.ts +1 -0
- package/dist/components/avatar/index.js +1 -0
- package/dist/components/avatar/index.jsx +1 -0
- package/dist/components/badge/Badge.d.ts +14 -0
- package/dist/components/badge/Badge.js +72 -0
- package/dist/components/badge/Badge.jsx +46 -0
- package/dist/components/badge/index.d.ts +1 -0
- package/dist/components/badge/index.js +1 -0
- package/dist/components/badge/index.jsx +1 -0
- package/dist/components/bleed/Bleed.d.ts +17 -0
- package/dist/components/bleed/Bleed.js +68 -0
- package/dist/components/bleed/Bleed.jsx +50 -0
- package/dist/components/bleed/index.d.ts +1 -0
- package/dist/components/bleed/index.js +1 -0
- package/dist/components/bleed/index.jsx +1 -0
- package/dist/components/breadcrumbs/Breadcrumbs.d.ts +30 -0
- package/dist/components/breadcrumbs/Breadcrumbs.js +158 -0
- package/dist/components/breadcrumbs/Breadcrumbs.jsx +88 -0
- package/dist/components/breadcrumbs/index.d.ts +1 -0
- package/dist/components/breadcrumbs/index.js +1 -0
- package/dist/components/breadcrumbs/index.jsx +1 -0
- package/dist/components/button/Button.d.ts +16 -0
- package/dist/components/button/Button.js +124 -0
- package/dist/components/button/Button.jsx +75 -0
- package/dist/components/button/index.d.ts +1 -0
- package/dist/components/button/index.js +1 -0
- package/dist/components/button/index.jsx +1 -0
- package/dist/components/card/Card.d.ts +28 -0
- package/dist/components/card/Card.js +210 -0
- package/dist/components/card/Card.jsx +103 -0
- package/dist/components/card/index.d.ts +1 -0
- package/dist/components/card/index.js +1 -0
- package/dist/components/card/index.jsx +1 -0
- package/dist/components/carousel/Carousel.d.ts +35 -0
- package/dist/components/carousel/Carousel.js +218 -0
- package/dist/components/carousel/Carousel.jsx +121 -0
- package/dist/components/carousel/index.d.ts +1 -0
- package/dist/components/carousel/index.js +1 -0
- package/dist/components/carousel/index.jsx +1 -0
- package/dist/components/chart/Chart.d.ts +34 -0
- package/dist/components/chart/Chart.js +450 -0
- package/dist/components/chart/Chart.jsx +265 -0
- package/dist/components/chart/index.d.ts +1 -0
- package/dist/components/chart/index.js +1 -0
- package/dist/components/chart/index.jsx +1 -0
- package/dist/components/checkbox/Checkbox.d.ts +26 -0
- package/dist/components/checkbox/Checkbox.js +139 -0
- package/dist/components/checkbox/Checkbox.jsx +76 -0
- package/dist/components/checkbox/index.d.ts +1 -0
- package/dist/components/checkbox/index.js +1 -0
- package/dist/components/checkbox/index.jsx +1 -0
- package/dist/components/clipboard/Clipboard.d.ts +26 -0
- package/dist/components/clipboard/Clipboard.js +143 -0
- package/dist/components/clipboard/Clipboard.jsx +85 -0
- package/dist/components/clipboard/index.d.ts +1 -0
- package/dist/components/clipboard/index.js +1 -0
- package/dist/components/clipboard/index.jsx +1 -0
- package/dist/components/close-button/CloseButton.d.ts +14 -0
- package/dist/components/close-button/CloseButton.js +89 -0
- package/dist/components/close-button/CloseButton.jsx +48 -0
- package/dist/components/close-button/index.d.ts +1 -0
- package/dist/components/close-button/index.js +1 -0
- package/dist/components/close-button/index.jsx +1 -0
- package/dist/components/collapsible/Collapsible.d.ts +19 -0
- package/dist/components/collapsible/Collapsible.js +92 -0
- package/dist/components/collapsible/Collapsible.jsx +56 -0
- package/dist/components/collapsible/index.d.ts +1 -0
- package/dist/components/collapsible/index.js +1 -0
- package/dist/components/collapsible/index.jsx +1 -0
- package/dist/components/color-picker/ColorPicker.d.ts +66 -0
- package/dist/components/color-picker/ColorPicker.js +514 -0
- package/dist/components/color-picker/ColorPicker.jsx +276 -0
- package/dist/components/color-picker/index.d.ts +1 -0
- package/dist/components/color-picker/index.js +1 -0
- package/dist/components/color-picker/index.jsx +1 -0
- package/dist/components/combobox/Combobox.d.ts +50 -0
- package/dist/components/combobox/Combobox.js +353 -0
- package/dist/components/combobox/Combobox.jsx +187 -0
- package/dist/components/combobox/index.d.ts +1 -0
- package/dist/components/combobox/index.js +1 -0
- package/dist/components/combobox/index.jsx +1 -0
- package/dist/components/command-palette/CommandPalette.d.ts +72 -0
- package/dist/components/command-palette/CommandPalette.js +575 -0
- package/dist/components/command-palette/CommandPalette.jsx +324 -0
- package/dist/components/command-palette/index.d.ts +1 -0
- package/dist/components/command-palette/index.js +1 -0
- package/dist/components/command-palette/index.jsx +1 -0
- package/dist/components/container/Container.d.ts +17 -0
- package/dist/components/container/Container.js +140 -0
- package/dist/components/container/Container.jsx +126 -0
- package/dist/components/container/index.d.ts +1 -0
- package/dist/components/container/index.js +1 -0
- package/dist/components/container/index.jsx +1 -0
- package/dist/components/date-input/DateInput.d.ts +25 -0
- package/dist/components/date-input/DateInput.js +136 -0
- package/dist/components/date-input/DateInput.jsx +76 -0
- package/dist/components/date-input/index.d.ts +1 -0
- package/dist/components/date-input/index.js +1 -0
- package/dist/components/date-input/index.jsx +1 -0
- package/dist/components/date-picker/DatePicker.d.ts +98 -0
- package/dist/components/date-picker/DatePicker.js +701 -0
- package/dist/components/date-picker/DatePicker.jsx +359 -0
- package/dist/components/date-picker/index.d.ts +2 -0
- package/dist/components/date-picker/index.js +1 -0
- package/dist/components/date-picker/index.jsx +1 -0
- package/dist/components/dialog/Dialog.d.ts +38 -0
- package/dist/components/dialog/Dialog.js +239 -0
- package/dist/components/dialog/Dialog.jsx +130 -0
- package/dist/components/dialog/index.d.ts +2 -0
- package/dist/components/dialog/index.js +1 -0
- package/dist/components/dialog/index.jsx +1 -0
- package/dist/components/drawer/Drawer.d.ts +54 -0
- package/dist/components/drawer/Drawer.js +333 -0
- package/dist/components/drawer/Drawer.jsx +179 -0
- package/dist/components/drawer/index.d.ts +1 -0
- package/dist/components/drawer/index.js +1 -0
- package/dist/components/drawer/index.jsx +1 -0
- package/dist/components/editable/Editable.d.ts +29 -0
- package/dist/components/editable/Editable.js +181 -0
- package/dist/components/editable/Editable.jsx +105 -0
- package/dist/components/editable/index.d.ts +1 -0
- package/dist/components/editable/index.js +1 -0
- package/dist/components/editable/index.jsx +1 -0
- package/dist/components/empty/Empty.d.ts +16 -0
- package/dist/components/empty/Empty.js +121 -0
- package/dist/components/empty/Empty.jsx +54 -0
- package/dist/components/empty/index.d.ts +1 -0
- package/dist/components/empty/index.js +1 -0
- package/dist/components/empty/index.jsx +1 -0
- package/dist/components/field/Field.d.ts +37 -0
- package/dist/components/field/Field.js +236 -0
- package/dist/components/field/Field.jsx +134 -0
- package/dist/components/field/index.d.ts +1 -0
- package/dist/components/field/index.js +1 -0
- package/dist/components/field/index.jsx +1 -0
- package/dist/components/fieldset/Fieldset.d.ts +16 -0
- package/dist/components/fieldset/Fieldset.js +93 -0
- package/dist/components/fieldset/Fieldset.jsx +47 -0
- package/dist/components/fieldset/index.d.ts +1 -0
- package/dist/components/fieldset/index.js +1 -0
- package/dist/components/fieldset/index.jsx +1 -0
- package/dist/components/file-upload/FileUpload.d.ts +44 -0
- package/dist/components/file-upload/FileUpload.js +325 -0
- package/dist/components/file-upload/FileUpload.jsx +178 -0
- package/dist/components/file-upload/index.d.ts +1 -0
- package/dist/components/file-upload/index.js +1 -0
- package/dist/components/file-upload/index.jsx +1 -0
- package/dist/components/floating-panel/FloatingPanel.d.ts +53 -0
- package/dist/components/floating-panel/FloatingPanel.js +338 -0
- package/dist/components/floating-panel/FloatingPanel.jsx +186 -0
- package/dist/components/floating-panel/index.d.ts +2 -0
- package/dist/components/floating-panel/index.js +1 -0
- package/dist/components/floating-panel/index.jsx +1 -0
- package/dist/components/heading/Heading.d.ts +20 -0
- package/dist/components/heading/Heading.js +82 -0
- package/dist/components/heading/Heading.jsx +62 -0
- package/dist/components/heading/index.d.ts +1 -0
- package/dist/components/heading/index.js +1 -0
- package/dist/components/heading/index.jsx +1 -0
- package/dist/components/highlight/Highlight.d.ts +12 -0
- package/dist/components/highlight/Highlight.js +24 -0
- package/dist/components/highlight/Highlight.jsx +16 -0
- package/dist/components/highlight/index.d.ts +1 -0
- package/dist/components/highlight/index.js +1 -0
- package/dist/components/highlight/index.jsx +1 -0
- package/dist/components/hover-card/HoverCard.d.ts +27 -0
- package/dist/components/hover-card/HoverCard.js +164 -0
- package/dist/components/hover-card/HoverCard.jsx +89 -0
- package/dist/components/hover-card/index.d.ts +1 -0
- package/dist/components/hover-card/index.js +1 -0
- package/dist/components/hover-card/index.jsx +1 -0
- package/dist/components/image/Image.d.ts +14 -0
- package/dist/components/image/Image.js +53 -0
- package/dist/components/image/Image.jsx +33 -0
- package/dist/components/image/index.d.ts +1 -0
- package/dist/components/image/index.js +1 -0
- package/dist/components/image/index.jsx +1 -0
- package/dist/components/image-cropper/ImageCropper.d.ts +27 -0
- package/dist/components/image-cropper/ImageCropper.js +131 -0
- package/dist/components/image-cropper/ImageCropper.jsx +72 -0
- package/dist/components/image-cropper/index.d.ts +1 -0
- package/dist/components/image-cropper/index.js +1 -0
- package/dist/components/image-cropper/index.jsx +1 -0
- package/dist/components/input/Input.d.ts +13 -0
- package/dist/components/input/Input.js +57 -0
- package/dist/components/input/Input.jsx +36 -0
- package/dist/components/input/index.d.ts +1 -0
- package/dist/components/input/index.js +1 -0
- package/dist/components/input/index.jsx +1 -0
- package/dist/components/input-group/InputGroup.d.ts +27 -0
- package/dist/components/input-group/InputGroup.js +191 -0
- package/dist/components/input-group/InputGroup.jsx +129 -0
- package/dist/components/input-group/index.d.ts +1 -0
- package/dist/components/input-group/index.js +1 -0
- package/dist/components/input-group/index.jsx +1 -0
- package/dist/components/json-tree-view/JsonTreeView.d.ts +11 -0
- package/dist/components/json-tree-view/JsonTreeView.js +69 -0
- package/dist/components/json-tree-view/JsonTreeView.jsx +37 -0
- package/dist/components/json-tree-view/index.d.ts +1 -0
- package/dist/components/json-tree-view/index.js +1 -0
- package/dist/components/json-tree-view/index.jsx +1 -0
- package/dist/components/kbd/Kbd.d.ts +8 -0
- package/dist/components/kbd/Kbd.js +36 -0
- package/dist/components/kbd/Kbd.jsx +20 -0
- package/dist/components/kbd/index.d.ts +1 -0
- package/dist/components/kbd/index.js +1 -0
- package/dist/components/kbd/index.jsx +1 -0
- package/dist/components/lightbox/Lightbox.d.ts +60 -0
- package/dist/components/lightbox/Lightbox.js +351 -0
- package/dist/components/lightbox/Lightbox.jsx +218 -0
- package/dist/components/lightbox/index.d.ts +2 -0
- package/dist/components/lightbox/index.js +1 -0
- package/dist/components/lightbox/index.jsx +1 -0
- package/dist/components/list/List.d.ts +36 -0
- package/dist/components/list/List.js +201 -0
- package/dist/components/list/List.jsx +133 -0
- package/dist/components/list/index.d.ts +1 -0
- package/dist/components/list/index.js +1 -0
- package/dist/components/list/index.jsx +1 -0
- package/dist/components/listbox/Listbox.d.ts +46 -0
- package/dist/components/listbox/Listbox.js +249 -0
- package/dist/components/listbox/Listbox.jsx +147 -0
- package/dist/components/listbox/index.d.ts +1 -0
- package/dist/components/listbox/index.js +1 -0
- package/dist/components/listbox/index.jsx +1 -0
- package/dist/components/marquee/Marquee.d.ts +18 -0
- package/dist/components/marquee/Marquee.js +120 -0
- package/dist/components/marquee/Marquee.jsx +80 -0
- package/dist/components/marquee/index.d.ts +1 -0
- package/dist/components/marquee/index.js +1 -0
- package/dist/components/marquee/index.jsx +1 -0
- package/dist/components/menu/Menu.d.ts +74 -0
- package/dist/components/menu/Menu.js +476 -0
- package/dist/components/menu/Menu.jsx +277 -0
- package/dist/components/menu/index.d.ts +1 -0
- package/dist/components/menu/index.js +1 -0
- package/dist/components/menu/index.jsx +1 -0
- package/dist/components/native-select/NativeSelect.d.ts +11 -0
- package/dist/components/native-select/NativeSelect.js +49 -0
- package/dist/components/native-select/NativeSelect.jsx +24 -0
- package/dist/components/native-select/index.d.ts +1 -0
- package/dist/components/native-select/index.js +1 -0
- package/dist/components/native-select/index.jsx +1 -0
- package/dist/components/navigation-menu/NavigationMenu.d.ts +31 -0
- package/dist/components/navigation-menu/NavigationMenu.js +156 -0
- package/dist/components/navigation-menu/NavigationMenu.jsx +92 -0
- package/dist/components/navigation-menu/index.d.ts +1 -0
- package/dist/components/navigation-menu/index.js +1 -0
- package/dist/components/navigation-menu/index.jsx +1 -0
- package/dist/components/number-input/NumberInput.d.ts +27 -0
- package/dist/components/number-input/NumberInput.js +167 -0
- package/dist/components/number-input/NumberInput.jsx +97 -0
- package/dist/components/number-input/index.d.ts +1 -0
- package/dist/components/number-input/index.js +1 -0
- package/dist/components/number-input/index.jsx +1 -0
- package/dist/components/pagination/Pagination.d.ts +28 -0
- package/dist/components/pagination/Pagination.js +218 -0
- package/dist/components/pagination/Pagination.jsx +115 -0
- package/dist/components/pagination/index.d.ts +1 -0
- package/dist/components/pagination/index.js +1 -0
- package/dist/components/pagination/index.jsx +1 -0
- package/dist/components/password-input/PasswordInput.d.ts +26 -0
- package/dist/components/password-input/PasswordInput.js +135 -0
- package/dist/components/password-input/PasswordInput.jsx +83 -0
- package/dist/components/password-input/index.d.ts +1 -0
- package/dist/components/password-input/index.js +1 -0
- package/dist/components/password-input/index.jsx +1 -0
- package/dist/components/pin-input/PinInput.d.ts +24 -0
- package/dist/components/pin-input/PinInput.js +144 -0
- package/dist/components/pin-input/PinInput.jsx +80 -0
- package/dist/components/pin-input/index.d.ts +1 -0
- package/dist/components/pin-input/index.js +1 -0
- package/dist/components/pin-input/index.jsx +1 -0
- package/dist/components/popover/Popover.d.ts +46 -0
- package/dist/components/popover/Popover.js +288 -0
- package/dist/components/popover/Popover.jsx +155 -0
- package/dist/components/popover/index.d.ts +1 -0
- package/dist/components/popover/index.js +1 -0
- package/dist/components/popover/index.jsx +1 -0
- package/dist/components/progress-circular/ProgressCircular.d.ts +28 -0
- package/dist/components/progress-circular/ProgressCircular.js +164 -0
- package/dist/components/progress-circular/ProgressCircular.jsx +89 -0
- package/dist/components/progress-circular/index.d.ts +1 -0
- package/dist/components/progress-circular/index.js +1 -0
- package/dist/components/progress-circular/index.jsx +1 -0
- package/dist/components/progress-linear/ProgressLinear.d.ts +23 -0
- package/dist/components/progress-linear/ProgressLinear.js +132 -0
- package/dist/components/progress-linear/ProgressLinear.jsx +71 -0
- package/dist/components/progress-linear/index.d.ts +1 -0
- package/dist/components/progress-linear/index.js +1 -0
- package/dist/components/progress-linear/index.jsx +1 -0
- package/dist/components/qr-code/QrCode.d.ts +19 -0
- package/dist/components/qr-code/QrCode.js +129 -0
- package/dist/components/qr-code/QrCode.jsx +70 -0
- package/dist/components/qr-code/index.d.ts +1 -0
- package/dist/components/qr-code/index.js +1 -0
- package/dist/components/qr-code/index.jsx +1 -0
- package/dist/components/radio-group/RadioGroup.d.ts +33 -0
- package/dist/components/radio-group/RadioGroup.js +158 -0
- package/dist/components/radio-group/RadioGroup.jsx +94 -0
- package/dist/components/radio-group/index.d.ts +2 -0
- package/dist/components/radio-group/index.js +1 -0
- package/dist/components/radio-group/index.jsx +1 -0
- package/dist/components/rating-group/RatingGroup.d.ts +33 -0
- package/dist/components/rating-group/RatingGroup.js +150 -0
- package/dist/components/rating-group/RatingGroup.jsx +80 -0
- package/dist/components/rating-group/index.d.ts +2 -0
- package/dist/components/rating-group/index.js +1 -0
- package/dist/components/rating-group/index.jsx +1 -0
- package/dist/components/scroll-area/ScrollArea.d.ts +30 -0
- package/dist/components/scroll-area/ScrollArea.js +109 -0
- package/dist/components/scroll-area/ScrollArea.jsx +61 -0
- package/dist/components/scroll-area/index.d.ts +2 -0
- package/dist/components/scroll-area/index.js +1 -0
- package/dist/components/scroll-area/index.jsx +1 -0
- package/dist/components/segment-group/SegmentGroup.d.ts +33 -0
- package/dist/components/segment-group/SegmentGroup.js +205 -0
- package/dist/components/segment-group/SegmentGroup.jsx +126 -0
- package/dist/components/segment-group/index.d.ts +1 -0
- package/dist/components/segment-group/index.js +1 -0
- package/dist/components/segment-group/index.jsx +1 -0
- package/dist/components/select/Select.d.ts +57 -0
- package/dist/components/select/Select.js +395 -0
- package/dist/components/select/Select.jsx +210 -0
- package/dist/components/select/index.d.ts +1 -0
- package/dist/components/select/index.js +1 -0
- package/dist/components/select/index.jsx +1 -0
- package/dist/components/separator/Separator.d.ts +17 -0
- package/dist/components/separator/Separator.js +127 -0
- package/dist/components/separator/Separator.jsx +100 -0
- package/dist/components/separator/index.d.ts +1 -0
- package/dist/components/separator/index.js +1 -0
- package/dist/components/separator/index.jsx +1 -0
- package/dist/components/sidebar/Sidebar.d.ts +82 -0
- package/dist/components/sidebar/Sidebar.js +590 -0
- package/dist/components/sidebar/Sidebar.jsx +308 -0
- package/dist/components/sidebar/index.d.ts +1 -0
- package/dist/components/sidebar/index.js +1 -0
- package/dist/components/sidebar/index.jsx +1 -0
- package/dist/components/signature-pad/SignaturePad.d.ts +30 -0
- package/dist/components/signature-pad/SignaturePad.js +211 -0
- package/dist/components/signature-pad/SignaturePad.jsx +116 -0
- package/dist/components/signature-pad/index.d.ts +1 -0
- package/dist/components/signature-pad/index.js +1 -0
- package/dist/components/signature-pad/index.jsx +1 -0
- package/dist/components/simple-grid/SimpleGrid.d.ts +17 -0
- package/dist/components/simple-grid/SimpleGrid.js +74 -0
- package/dist/components/simple-grid/SimpleGrid.jsx +59 -0
- package/dist/components/simple-grid/index.d.ts +1 -0
- package/dist/components/simple-grid/index.js +1 -0
- package/dist/components/simple-grid/index.jsx +1 -0
- package/dist/components/skeleton/Skeleton.d.ts +15 -0
- package/dist/components/skeleton/Skeleton.js +74 -0
- package/dist/components/skeleton/Skeleton.jsx +47 -0
- package/dist/components/skeleton/index.d.ts +1 -0
- package/dist/components/skeleton/index.js +1 -0
- package/dist/components/skeleton/index.jsx +1 -0
- package/dist/components/slider/Slider.d.ts +36 -0
- package/dist/components/slider/Slider.js +202 -0
- package/dist/components/slider/Slider.jsx +109 -0
- package/dist/components/slider/index.d.ts +1 -0
- package/dist/components/slider/index.js +1 -0
- package/dist/components/slider/index.jsx +1 -0
- package/dist/components/spinner/Spinner.d.ts +11 -0
- package/dist/components/spinner/Spinner.js +73 -0
- package/dist/components/spinner/Spinner.jsx +44 -0
- package/dist/components/spinner/index.d.ts +1 -0
- package/dist/components/spinner/index.js +1 -0
- package/dist/components/spinner/index.jsx +1 -0
- package/dist/components/split-button/SplitButton.d.ts +41 -0
- package/dist/components/split-button/SplitButton.js +197 -0
- package/dist/components/split-button/SplitButton.jsx +117 -0
- package/dist/components/split-button/index.d.ts +1 -0
- package/dist/components/split-button/index.js +1 -0
- package/dist/components/split-button/index.jsx +1 -0
- package/dist/components/splitter/Splitter.d.ts +18 -0
- package/dist/components/splitter/Splitter.js +101 -0
- package/dist/components/splitter/Splitter.jsx +58 -0
- package/dist/components/splitter/index.d.ts +1 -0
- package/dist/components/splitter/index.js +1 -0
- package/dist/components/splitter/index.jsx +1 -0
- package/dist/components/stack/Stack.d.ts +19 -0
- package/dist/components/stack/Stack.js +83 -0
- package/dist/components/stack/Stack.jsx +68 -0
- package/dist/components/stack/index.d.ts +1 -0
- package/dist/components/stack/index.js +1 -0
- package/dist/components/stack/index.jsx +1 -0
- package/dist/components/steps/Steps.d.ts +35 -0
- package/dist/components/steps/Steps.js +162 -0
- package/dist/components/steps/Steps.jsx +99 -0
- package/dist/components/steps/index.d.ts +1 -0
- package/dist/components/steps/index.js +1 -0
- package/dist/components/steps/index.jsx +1 -0
- package/dist/components/swap/Swap.d.ts +20 -0
- package/dist/components/swap/Swap.js +52 -0
- package/dist/components/swap/Swap.jsx +30 -0
- package/dist/components/swap/index.d.ts +1 -0
- package/dist/components/swap/index.js +1 -0
- package/dist/components/swap/index.jsx +1 -0
- package/dist/components/switch/Switch.d.ts +25 -0
- package/dist/components/switch/Switch.js +101 -0
- package/dist/components/switch/Switch.jsx +57 -0
- package/dist/components/switch/index.d.ts +1 -0
- package/dist/components/switch/index.js +1 -0
- package/dist/components/switch/index.jsx +1 -0
- package/dist/components/table/Table.d.ts +71 -0
- package/dist/components/table/Table.js +363 -0
- package/dist/components/table/Table.jsx +189 -0
- package/dist/components/table/index.d.ts +1 -0
- package/dist/components/table/index.js +1 -0
- package/dist/components/table/index.jsx +1 -0
- package/dist/components/tabs/Tabs.d.ts +25 -0
- package/dist/components/tabs/Tabs.js +98 -0
- package/dist/components/tabs/Tabs.jsx +55 -0
- package/dist/components/tabs/index.d.ts +1 -0
- package/dist/components/tabs/index.js +1 -0
- package/dist/components/tabs/index.jsx +1 -0
- package/dist/components/tag/Tag.d.ts +24 -0
- package/dist/components/tag/Tag.js +147 -0
- package/dist/components/tag/Tag.jsx +78 -0
- package/dist/components/tag/index.d.ts +1 -0
- package/dist/components/tag/index.js +1 -0
- package/dist/components/tag/index.jsx +1 -0
- package/dist/components/tags-input/TagsInput.d.ts +32 -0
- package/dist/components/tags-input/TagsInput.js +240 -0
- package/dist/components/tags-input/TagsInput.jsx +127 -0
- package/dist/components/tags-input/index.d.ts +1 -0
- package/dist/components/tags-input/index.js +1 -0
- package/dist/components/tags-input/index.jsx +1 -0
- package/dist/components/text/Text.d.ts +30 -0
- package/dist/components/text/Text.js +126 -0
- package/dist/components/text/Text.jsx +91 -0
- package/dist/components/text/index.d.ts +1 -0
- package/dist/components/text/index.js +1 -0
- package/dist/components/text/index.jsx +1 -0
- package/dist/components/textarea/Textarea.d.ts +9 -0
- package/dist/components/textarea/Textarea.js +45 -0
- package/dist/components/textarea/Textarea.jsx +26 -0
- package/dist/components/textarea/index.d.ts +1 -0
- package/dist/components/textarea/index.js +1 -0
- package/dist/components/textarea/index.jsx +1 -0
- package/dist/components/timer/Timer.d.ts +26 -0
- package/dist/components/timer/Timer.js +126 -0
- package/dist/components/timer/Timer.jsx +77 -0
- package/dist/components/timer/index.d.ts +1 -0
- package/dist/components/timer/index.js +1 -0
- package/dist/components/timer/index.jsx +1 -0
- package/dist/components/toast/Toast.d.ts +22 -0
- package/dist/components/toast/Toast.js +184 -0
- package/dist/components/toast/Toast.jsx +94 -0
- package/dist/components/toast/index.d.ts +1 -0
- package/dist/components/toast/index.js +1 -0
- package/dist/components/toast/index.jsx +1 -0
- package/dist/components/toc/Toc.d.ts +34 -0
- package/dist/components/toc/Toc.js +222 -0
- package/dist/components/toc/Toc.jsx +129 -0
- package/dist/components/toc/index.d.ts +1 -0
- package/dist/components/toc/index.js +1 -0
- package/dist/components/toc/index.jsx +1 -0
- package/dist/components/toggle/Toggle.d.ts +17 -0
- package/dist/components/toggle/Toggle.js +76 -0
- package/dist/components/toggle/Toggle.jsx +51 -0
- package/dist/components/toggle/index.d.ts +2 -0
- package/dist/components/toggle/index.js +1 -0
- package/dist/components/toggle/index.jsx +1 -0
- package/dist/components/toggle-group/ToggleGroup.d.ts +27 -0
- package/dist/components/toggle-group/ToggleGroup.js +165 -0
- package/dist/components/toggle-group/ToggleGroup.jsx +110 -0
- package/dist/components/toggle-group/index.d.ts +2 -0
- package/dist/components/toggle-group/index.js +1 -0
- package/dist/components/toggle-group/index.jsx +1 -0
- package/dist/components/tooltip/Tooltip.d.ts +29 -0
- package/dist/components/tooltip/Tooltip.js +192 -0
- package/dist/components/tooltip/Tooltip.jsx +108 -0
- package/dist/components/tooltip/index.d.ts +1 -0
- package/dist/components/tooltip/index.js +1 -0
- package/dist/components/tooltip/index.jsx +1 -0
- package/dist/components/tour/Tour.d.ts +46 -0
- package/dist/components/tour/Tour.js +274 -0
- package/dist/components/tour/Tour.jsx +155 -0
- package/dist/components/tour/index.d.ts +2 -0
- package/dist/components/tour/index.js +1 -0
- package/dist/components/tour/index.jsx +1 -0
- package/dist/components/tree-view/TreeView.d.ts +58 -0
- package/dist/components/tree-view/TreeView.js +296 -0
- package/dist/components/tree-view/TreeView.jsx +173 -0
- package/dist/components/tree-view/index.d.ts +1 -0
- package/dist/components/tree-view/index.js +1 -0
- package/dist/components/tree-view/index.jsx +1 -0
- package/dist/components/typeset/Typeset.d.ts +15 -0
- package/dist/components/typeset/Typeset.js +68 -0
- package/dist/components/typeset/Typeset.jsx +33 -0
- package/dist/components/typeset/Typeset.module.js +6 -0
- package/dist/components/typeset/Typeset.module.jsx +6 -0
- package/dist/components/typeset/Typeset_module.css +466 -0
- package/dist/components/typeset/index.d.ts +1 -0
- package/dist/components/typeset/index.js +1 -0
- package/dist/components/typeset/index.jsx +1 -0
- package/dist/internal/cn.d.ts +2 -0
- package/dist/internal/cn.js +40 -0
- package/dist/internal/cn.jsx +40 -0
- package/dist/internal/icons/ui/Icons.d.ts +37 -0
- package/dist/internal/icons/ui/Icons.js +115 -0
- package/dist/internal/icons/ui/Icons.jsx +93 -0
- package/dist/internal/icons/ui/index.d.ts +1 -0
- package/dist/internal/icons/ui/index.js +1 -0
- package/dist/internal/icons/ui/index.jsx +1 -0
- package/dist/internal/overlayPortal.d.ts +13 -0
- package/dist/internal/overlayPortal.js +39 -0
- package/dist/internal/overlayPortal.jsx +19 -0
- package/dist/locale.d.ts +1 -0
- package/dist/locale.js +1 -0
- package/dist/locale.jsx +1 -0
- package/dist/presets/contrast.css +65 -0
- package/dist/presets/dense.css +78 -0
- package/dist/presets/soft.css +77 -0
- package/dist/styles/animations.css +371 -0
- package/dist/styles/borders.css +10 -0
- package/dist/styles/colors.css +122 -0
- package/dist/styles/opacity.css +5 -0
- package/dist/styles/radius.css +11 -0
- package/dist/styles/shadows.css +5 -0
- package/dist/styles/sizing.css +11 -0
- package/dist/styles/spacing.css +26 -0
- package/dist/styles/style.css +180 -0
- package/dist/styles/transforms.css +4 -0
- package/dist/styles/transitions.css +32 -0
- package/dist/styles/typography.css +37 -0
- package/dist/styles/z-index.css +13 -0
- package/package.json +633 -0
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { ark } from "@ark-ui/solid/factory";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { children, splitProps } from "solid-js";
|
|
4
|
+
import { cn } from "../../internal/cn.jsx";
|
|
5
|
+
const tableVariants = cva('group/table isolate w-full border-collapse border-spacing-0 text-left text-foreground', {
|
|
6
|
+
variants: {
|
|
7
|
+
size: {
|
|
8
|
+
sm: 'text-xs leading-4',
|
|
9
|
+
md: 'text-sm leading-5',
|
|
10
|
+
lg: 'text-md leading-6'
|
|
11
|
+
},
|
|
12
|
+
variant: {
|
|
13
|
+
line: '',
|
|
14
|
+
outline: 'border border-border'
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
defaultVariants: {
|
|
18
|
+
size: 'md',
|
|
19
|
+
variant: 'line'
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
function TableRoot(props) {
|
|
23
|
+
const [local, others] = splitProps(props, [
|
|
24
|
+
'asChild',
|
|
25
|
+
'class',
|
|
26
|
+
'data-interactive',
|
|
27
|
+
'data-part',
|
|
28
|
+
'data-scope',
|
|
29
|
+
'data-show-column-border',
|
|
30
|
+
'data-size',
|
|
31
|
+
'data-slot',
|
|
32
|
+
'data-sticky-header',
|
|
33
|
+
'data-striped',
|
|
34
|
+
'data-variant',
|
|
35
|
+
'interactive',
|
|
36
|
+
'showColumnBorder',
|
|
37
|
+
'size',
|
|
38
|
+
'stickyHeader',
|
|
39
|
+
'striped',
|
|
40
|
+
'variant'
|
|
41
|
+
]);
|
|
42
|
+
const size = ()=>local.size ?? 'md';
|
|
43
|
+
const variant = ()=>local.variant ?? 'line';
|
|
44
|
+
return <ark.table asChild={local.asChild} {...others} data-scope="table" data-part="root" data-slot="table-root" data-interactive={local.interactive || void 0} data-show-column-border={local.showColumnBorder || void 0} data-size={size()} data-sticky-header={local.stickyHeader || void 0} data-striped={local.striped || void 0} data-variant={variant()} class={cn(tableVariants({
|
|
45
|
+
size: size(),
|
|
46
|
+
variant: variant()
|
|
47
|
+
}), local.class)}/>;
|
|
48
|
+
}
|
|
49
|
+
function TableScrollArea(props) {
|
|
50
|
+
const [local, others] = splitProps(props, [
|
|
51
|
+
'asChild',
|
|
52
|
+
'class',
|
|
53
|
+
'data-part',
|
|
54
|
+
'data-scope',
|
|
55
|
+
'data-slot'
|
|
56
|
+
]);
|
|
57
|
+
return <ark.div asChild={local.asChild} {...others} data-scope="table" data-part="scroll-area" data-slot="table-scroll-area" class={cn('relative isolate w-full min-w-0 overflow-x-auto rounded-lg border border-border bg-card', local.class)}/>;
|
|
58
|
+
}
|
|
59
|
+
function TableCaption(props) {
|
|
60
|
+
const [local, others] = splitProps(props, [
|
|
61
|
+
'asChild',
|
|
62
|
+
'class',
|
|
63
|
+
'data-part',
|
|
64
|
+
'data-scope',
|
|
65
|
+
'data-side',
|
|
66
|
+
'data-slot',
|
|
67
|
+
'side'
|
|
68
|
+
]);
|
|
69
|
+
const side = ()=>local.side ?? 'bottom';
|
|
70
|
+
return <ark.caption asChild={local.asChild} {...others} data-scope="table" data-part="caption" data-side={side()} data-slot="table-caption" class={cn('px-4 text-left text-sm leading-5 text-pretty text-muted-foreground group-data-[size=lg]/table:px-5 group-data-[size=sm]/table:px-3 data-[side=bottom]:caption-bottom data-[side=bottom]:pt-3 data-[side=bottom]:pb-2 data-[side=top]:caption-top data-[side=top]:pt-2 data-[side=top]:pb-3', local.class)}/>;
|
|
71
|
+
}
|
|
72
|
+
function TableColumnGroup(props) {
|
|
73
|
+
const [local, others] = splitProps(props, [
|
|
74
|
+
'asChild',
|
|
75
|
+
'class',
|
|
76
|
+
'data-part',
|
|
77
|
+
'data-scope',
|
|
78
|
+
'data-slot'
|
|
79
|
+
]);
|
|
80
|
+
return <ark.colgroup asChild={local.asChild} {...others} data-scope="table" data-part="column-group" data-slot="table-column-group" class={local.class}/>;
|
|
81
|
+
}
|
|
82
|
+
function TableColumn(props) {
|
|
83
|
+
const [local, others] = splitProps(props, [
|
|
84
|
+
'asChild',
|
|
85
|
+
'class',
|
|
86
|
+
'data-part',
|
|
87
|
+
'data-scope',
|
|
88
|
+
'data-slot',
|
|
89
|
+
'htmlWidth',
|
|
90
|
+
'width'
|
|
91
|
+
]);
|
|
92
|
+
return <ark.col asChild={local.asChild} {...others} data-scope="table" data-part="column" data-slot="table-column" width={local.htmlWidth ?? local.width} class={local.class}/>;
|
|
93
|
+
}
|
|
94
|
+
function TableHeader(props) {
|
|
95
|
+
const [local, others] = splitProps(props, [
|
|
96
|
+
'asChild',
|
|
97
|
+
'class',
|
|
98
|
+
'data-part',
|
|
99
|
+
'data-scope',
|
|
100
|
+
'data-slot'
|
|
101
|
+
]);
|
|
102
|
+
return <ark.thead asChild={local.asChild} {...others} data-scope="table" data-part="header" data-slot="table-header" class={cn('group/table-header group-data-[sticky-header]/table:sticky group-data-[sticky-header]/table:top-0 group-data-[sticky-header]/table:z-3 group-data-[sticky-header]/table:bg-card', local.class)}/>;
|
|
103
|
+
}
|
|
104
|
+
function TableBody(props) {
|
|
105
|
+
const [local, others] = splitProps(props, [
|
|
106
|
+
'asChild',
|
|
107
|
+
'class',
|
|
108
|
+
'data-part',
|
|
109
|
+
'data-scope',
|
|
110
|
+
'data-slot'
|
|
111
|
+
]);
|
|
112
|
+
return <ark.tbody asChild={local.asChild} {...others} data-scope="table" data-part="body" data-slot="table-body" class={cn('group/table-body', local.class)}/>;
|
|
113
|
+
}
|
|
114
|
+
function TableFooter(props) {
|
|
115
|
+
const [local, others] = splitProps(props, [
|
|
116
|
+
'asChild',
|
|
117
|
+
'class',
|
|
118
|
+
'data-part',
|
|
119
|
+
'data-scope',
|
|
120
|
+
'data-slot'
|
|
121
|
+
]);
|
|
122
|
+
return <ark.tfoot asChild={local.asChild} {...others} data-scope="table" data-part="footer" data-slot="table-footer" class={cn('border-t border-border bg-muted font-medium', local.class)}/>;
|
|
123
|
+
}
|
|
124
|
+
function TableRow(props) {
|
|
125
|
+
const [local, others] = splitProps(props, [
|
|
126
|
+
'asChild',
|
|
127
|
+
'class',
|
|
128
|
+
'data-part',
|
|
129
|
+
'data-scope',
|
|
130
|
+
'data-slot'
|
|
131
|
+
]);
|
|
132
|
+
return <ark.tr asChild={local.asChild} {...others} data-scope="table" data-part="row" data-slot="table-row" class={cn('transition-colors duration-200 ease-in-out group-data-[slot=table-body]/table-body:border-b group-data-[slot=table-body]/table-body:border-border group-data-[slot=table-header]/table-header:border-b group-data-[slot=table-header]/table-header:border-border group-data-[slot=table-body]/table-body:last:border-b-0 group-data-[interactive]/table:group-data-[slot=table-body]/table-body:[&:not([data-empty])]:focus-within:bg-muted group-data-[interactive]/table:group-data-[slot=table-body]/table-body:[&:not([data-empty])]:hover:bg-muted group-data-[striped]/table:[&:nth-child(even):not([data-empty])]:bg-muted/35', local.class)}/>;
|
|
133
|
+
}
|
|
134
|
+
function TableColumnHeader(props) {
|
|
135
|
+
const [local, others] = splitProps(props, [
|
|
136
|
+
'asChild',
|
|
137
|
+
'class',
|
|
138
|
+
'data-numeric',
|
|
139
|
+
'data-part',
|
|
140
|
+
'data-scope',
|
|
141
|
+
'data-slot',
|
|
142
|
+
'numeric'
|
|
143
|
+
]);
|
|
144
|
+
return <ark.th asChild={local.asChild} {...others} data-scope="table" data-part="column-header" data-numeric={local.numeric || void 0} data-slot="table-column-header" class={cn('relative z-0 px-4 py-3 align-middle font-medium whitespace-nowrap text-muted-foreground group-data-[size=lg]/table:px-5 group-data-[size=lg]/table:py-4 group-data-[size=sm]/table:px-3 group-data-[size=sm]/table:py-2 group-data-[sticky-header]/table:data-[sticky]:z-4 data-[sticky=end]:sticky data-[sticky=end]:end-0 data-[sticky=end]:z-2 data-[sticky=end]:bg-card data-[sticky=start]:sticky data-[sticky=start]:start-0 data-[sticky=start]:z-2 data-[sticky=start]:bg-card group-data-[show-column-border]/table:[&:not(:last-child)]:border-e group-data-[show-column-border]/table:[&:not(:last-child)]:border-border', local.numeric && 'text-end tabular-nums', local.class)}/>;
|
|
145
|
+
}
|
|
146
|
+
function TableCell(props) {
|
|
147
|
+
const [local, others] = splitProps(props, [
|
|
148
|
+
'asChild',
|
|
149
|
+
'class',
|
|
150
|
+
'data-numeric',
|
|
151
|
+
'data-part',
|
|
152
|
+
'data-scope',
|
|
153
|
+
'data-slot',
|
|
154
|
+
'numeric'
|
|
155
|
+
]);
|
|
156
|
+
return <ark.td asChild={local.asChild} {...others} data-scope="table" data-part="cell" data-numeric={local.numeric || void 0} data-slot="table-cell" class={cn('relative z-0 px-4 py-3 align-middle group-data-[size=lg]/table:px-5 group-data-[size=lg]/table:py-4 group-data-[size=sm]/table:px-3 group-data-[size=sm]/table:py-2 data-[sticky=end]:sticky data-[sticky=end]:end-0 data-[sticky=end]:z-2 data-[sticky=end]:bg-card data-[sticky=start]:sticky data-[sticky=start]:start-0 data-[sticky=start]:z-2 data-[sticky=start]:bg-card group-data-[show-column-border]/table:[&:not(:last-child)]:border-e group-data-[show-column-border]/table:[&:not(:last-child)]:border-border', local.numeric && 'text-end tabular-nums', local.class)}/>;
|
|
157
|
+
}
|
|
158
|
+
function TableEmpty(props) {
|
|
159
|
+
const [local, others] = splitProps(props, [
|
|
160
|
+
'asChild',
|
|
161
|
+
'children',
|
|
162
|
+
'class',
|
|
163
|
+
'colSpan',
|
|
164
|
+
'data-part',
|
|
165
|
+
'data-scope',
|
|
166
|
+
'data-slot'
|
|
167
|
+
]);
|
|
168
|
+
const resolvedChildren = children(()=>local.children);
|
|
169
|
+
return <ark.tr data-scope="table" data-part="row" data-empty data-slot="table-row" class="transition-colors duration-200 ease-in-out group-data-[slot=table-body]/table-body:border-b group-data-[slot=table-body]/table-body:border-border group-data-[slot=table-body]/table-body:last:border-b-0">
|
|
170
|
+
<ark.td asChild={local.asChild} {...others} data-scope="table" data-part="empty" data-slot="table-empty" colSpan={local.colSpan} class={cn('relative z-0 px-4 py-3 align-middle group-data-[size=lg]/table:px-5 group-data-[size=lg]/table:py-4 group-data-[size=sm]/table:px-3 group-data-[size=sm]/table:py-2 data-[sticky=end]:sticky data-[sticky=end]:end-0 data-[sticky=end]:z-2 data-[sticky=end]:bg-card data-[sticky=start]:sticky data-[sticky=start]:start-0 data-[sticky=start]:z-2 data-[sticky=start]:bg-card group-data-[show-column-border]/table:[&:not(:last-child)]:border-e group-data-[show-column-border]/table:[&:not(:last-child)]:border-border', 'py-6 text-center text-muted-foreground group-data-[size=lg]/table:py-8 group-data-[size=sm]/table:py-4', local.class)}>
|
|
171
|
+
{resolvedChildren() ?? 'No results.'}
|
|
172
|
+
</ark.td>
|
|
173
|
+
</ark.tr>;
|
|
174
|
+
}
|
|
175
|
+
const Table = Object.assign(TableRoot, {
|
|
176
|
+
Root: TableRoot,
|
|
177
|
+
ScrollArea: TableScrollArea,
|
|
178
|
+
Caption: TableCaption,
|
|
179
|
+
ColumnGroup: TableColumnGroup,
|
|
180
|
+
Column: TableColumn,
|
|
181
|
+
Header: TableHeader,
|
|
182
|
+
Body: TableBody,
|
|
183
|
+
Footer: TableFooter,
|
|
184
|
+
Row: TableRow,
|
|
185
|
+
ColumnHeader: TableColumnHeader,
|
|
186
|
+
Cell: TableCell,
|
|
187
|
+
Empty: TableEmpty
|
|
188
|
+
});
|
|
189
|
+
export { Table };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Table } from './Table.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Table } from "./Table.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Table } from "./Table.jsx";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Tabs as TabsPrimitive, useTabs, useTabsContext } from '@ark-ui/solid/tabs';
|
|
2
|
+
import type { ComponentProps } from 'solid-js';
|
|
3
|
+
type TabsVariant = 'default' | 'line';
|
|
4
|
+
declare function TabsRoot(props: ComponentProps<typeof TabsPrimitive.Root> & {
|
|
5
|
+
variant?: TabsVariant;
|
|
6
|
+
}): import("solid-js").JSX.Element;
|
|
7
|
+
declare function TabsRootProvider(props: ComponentProps<typeof TabsPrimitive.RootProvider> & {
|
|
8
|
+
variant?: TabsVariant;
|
|
9
|
+
}): import("solid-js").JSX.Element;
|
|
10
|
+
declare function TabsList(props: ComponentProps<typeof TabsPrimitive.List>): import("solid-js").JSX.Element;
|
|
11
|
+
declare function TabsTrigger(props: ComponentProps<typeof TabsPrimitive.Trigger>): import("solid-js").JSX.Element;
|
|
12
|
+
declare function TabsIndicator(props: ComponentProps<typeof TabsPrimitive.Indicator>): import("solid-js").JSX.Element;
|
|
13
|
+
declare function TabsContent(props: ComponentProps<typeof TabsPrimitive.Content>): import("solid-js").JSX.Element;
|
|
14
|
+
type TabsComponent = typeof TabsRoot & {
|
|
15
|
+
Root: typeof TabsRoot;
|
|
16
|
+
RootProvider: typeof TabsRootProvider;
|
|
17
|
+
Context: typeof TabsPrimitive.Context;
|
|
18
|
+
List: typeof TabsList;
|
|
19
|
+
Trigger: typeof TabsTrigger;
|
|
20
|
+
Indicator: typeof TabsIndicator;
|
|
21
|
+
Content: typeof TabsContent;
|
|
22
|
+
useTabs: typeof useTabs;
|
|
23
|
+
};
|
|
24
|
+
declare const Tabs: TabsComponent;
|
|
25
|
+
export { Tabs, useTabs, useTabsContext };
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { createComponent, memo, mergeProps } from "solid-js/web";
|
|
2
|
+
import { Tabs, useTabs, useTabsContext } from "@ark-ui/solid/tabs";
|
|
3
|
+
import { splitProps } from "solid-js";
|
|
4
|
+
import { cn } from "../../internal/cn.js";
|
|
5
|
+
function TabsRoot(props) {
|
|
6
|
+
const [local, others] = splitProps(props, [
|
|
7
|
+
'class',
|
|
8
|
+
'orientation',
|
|
9
|
+
'variant'
|
|
10
|
+
]);
|
|
11
|
+
return createComponent(Tabs.Root, mergeProps({
|
|
12
|
+
"data-slot": "tabs-root",
|
|
13
|
+
get ["data-variant"] () {
|
|
14
|
+
return memo(()=>'vertical' === local.orientation)() ? 'default' : local.variant ?? 'default';
|
|
15
|
+
},
|
|
16
|
+
get ["class"] () {
|
|
17
|
+
return cn('group/tabs box-border flex w-full min-w-0 flex-col gap-3 text-foreground data-[orientation=vertical]:flex-row data-[orientation=vertical]:items-stretch', local.class);
|
|
18
|
+
},
|
|
19
|
+
get orientation () {
|
|
20
|
+
return local.orientation;
|
|
21
|
+
}
|
|
22
|
+
}, others));
|
|
23
|
+
}
|
|
24
|
+
function TabsRootProvider(props) {
|
|
25
|
+
const [local, others] = splitProps(props, [
|
|
26
|
+
'class',
|
|
27
|
+
'value',
|
|
28
|
+
'variant'
|
|
29
|
+
]);
|
|
30
|
+
const orientation = ()=>local.value().getRootProps()['data-orientation'];
|
|
31
|
+
return createComponent(Tabs.RootProvider, mergeProps({
|
|
32
|
+
"data-slot": "tabs-root-provider",
|
|
33
|
+
get ["data-variant"] () {
|
|
34
|
+
return memo(()=>'vertical' === orientation())() ? 'default' : local.variant ?? 'default';
|
|
35
|
+
},
|
|
36
|
+
get ["class"] () {
|
|
37
|
+
return cn('group/tabs box-border flex w-full min-w-0 flex-col gap-3 text-foreground data-[orientation=vertical]:flex-row data-[orientation=vertical]:items-stretch', local.class);
|
|
38
|
+
},
|
|
39
|
+
get value () {
|
|
40
|
+
return local.value;
|
|
41
|
+
}
|
|
42
|
+
}, others));
|
|
43
|
+
}
|
|
44
|
+
function TabsList(props) {
|
|
45
|
+
const [local, others] = splitProps(props, [
|
|
46
|
+
'class'
|
|
47
|
+
]);
|
|
48
|
+
return createComponent(Tabs.List, mergeProps({
|
|
49
|
+
"data-slot": "tabs-list",
|
|
50
|
+
get ["class"] () {
|
|
51
|
+
return cn('relative z-0 inline-flex w-fit max-w-full items-stretch gap-1 rounded-lg border border-border bg-muted p-1 group-data-[orientation=horizontal]/tabs:overflow-x-auto group-data-[orientation=vertical]/tabs:w-48 group-data-[orientation=vertical]/tabs:min-w-48 group-data-[orientation=vertical]/tabs:flex-col group-data-[variant=line]/tabs:w-full group-data-[variant=line]/tabs:rounded-none group-data-[variant=line]/tabs:border-x-0 group-data-[variant=line]/tabs:border-t-0 group-data-[variant=line]/tabs:bg-transparent group-data-[variant=line]/tabs:px-0 group-data-[orientation=vertical]/tabs:max-[30rem]:w-2/5 group-data-[orientation=vertical]/tabs:max-[30rem]:min-w-0', local.class);
|
|
52
|
+
}
|
|
53
|
+
}, others));
|
|
54
|
+
}
|
|
55
|
+
function TabsTrigger(props) {
|
|
56
|
+
const [local, others] = splitProps(props, [
|
|
57
|
+
'class'
|
|
58
|
+
]);
|
|
59
|
+
return createComponent(Tabs.Trigger, mergeProps({
|
|
60
|
+
"data-slot": "tabs-trigger",
|
|
61
|
+
get ["class"] () {
|
|
62
|
+
return cn("relative z-1 inline-flex h-8 cursor-pointer items-center justify-center gap-2 rounded-md border-0 bg-transparent px-2.5 text-sm leading-5 font-medium whitespace-nowrap text-muted-foreground no-underline outline-0 transition-[color,opacity] duration-200 ease-in-out select-none focus-visible:before:pointer-events-none focus-visible:before:absolute focus-visible:before:inset-0 focus-visible:before:rounded-[inherit] focus-visible:before:outline-1 focus-visible:before:outline-ring focus-visible:before:content-[''] disabled:pointer-events-none disabled:cursor-default disabled:opacity-50 data-disabled:pointer-events-none data-disabled:cursor-default data-disabled:opacity-50 data-selected:text-foreground motion-reduce:transition-none [&>svg]:size-4 [&>svg]:shrink-0 [@media(hover:hover)]:hover:text-foreground", local.class);
|
|
63
|
+
}
|
|
64
|
+
}, others));
|
|
65
|
+
}
|
|
66
|
+
function TabsIndicator(props) {
|
|
67
|
+
const [local, others] = splitProps(props, [
|
|
68
|
+
'class'
|
|
69
|
+
]);
|
|
70
|
+
return createComponent(Tabs.Indicator, mergeProps({
|
|
71
|
+
"data-slot": "tabs-indicator",
|
|
72
|
+
get ["class"] () {
|
|
73
|
+
return cn('pointer-events-none absolute top-1/2 left-[var(--left,0)] z-0 h-8 w-[var(--width,0)] -translate-y-1/2 rounded-md bg-background shadow-sm transition-[var(--transition-property,translate)] duration-200 ease-in-out group-data-[orientation=vertical]/tabs:top-[var(--top,0)] group-data-[orientation=vertical]/tabs:left-1/2 group-data-[orientation=vertical]/tabs:h-[var(--height,0)] group-data-[orientation=vertical]/tabs:w-[calc(100%-0.5rem)] group-data-[orientation=vertical]/tabs:-translate-x-1/2 group-data-[orientation=vertical]/tabs:translate-y-0 group-data-[variant=line]/tabs:top-auto group-data-[variant=line]/tabs:bottom-0 group-data-[variant=line]/tabs:h-0.5 group-data-[variant=line]/tabs:[translate:none] group-data-[variant=line]/tabs:rounded-full group-data-[variant=line]/tabs:bg-foreground group-data-[variant=line]/tabs:shadow-none motion-reduce:transition-none', local.class);
|
|
74
|
+
}
|
|
75
|
+
}, others));
|
|
76
|
+
}
|
|
77
|
+
function TabsContent(props) {
|
|
78
|
+
const [local, others] = splitProps(props, [
|
|
79
|
+
'class'
|
|
80
|
+
]);
|
|
81
|
+
return createComponent(Tabs.Content, mergeProps({
|
|
82
|
+
"data-slot": "tabs-content",
|
|
83
|
+
get ["class"] () {
|
|
84
|
+
return cn("box-border min-w-0 flex-1 rounded-lg border border-border bg-background p-4 text-sm leading-5 text-foreground outline-0 focus-visible:rounded-[inherit] focus-visible:outline-1 focus-visible:-outline-offset-1 focus-visible:outline-ring [&[hidden]:not([hidden='until-found'])]:hidden", local.class);
|
|
85
|
+
}
|
|
86
|
+
}, others));
|
|
87
|
+
}
|
|
88
|
+
const Tabs_Tabs = Object.assign(TabsRoot, {
|
|
89
|
+
Root: TabsRoot,
|
|
90
|
+
RootProvider: TabsRootProvider,
|
|
91
|
+
Context: Tabs.Context,
|
|
92
|
+
List: TabsList,
|
|
93
|
+
Trigger: TabsTrigger,
|
|
94
|
+
Indicator: TabsIndicator,
|
|
95
|
+
Content: TabsContent,
|
|
96
|
+
useTabs: useTabs
|
|
97
|
+
});
|
|
98
|
+
export { Tabs_Tabs as Tabs, useTabs, useTabsContext };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Tabs, useTabs, useTabsContext } from "@ark-ui/solid/tabs";
|
|
2
|
+
import { splitProps } from "solid-js";
|
|
3
|
+
import { cn } from "../../internal/cn.jsx";
|
|
4
|
+
function TabsRoot(props) {
|
|
5
|
+
const [local, others] = splitProps(props, [
|
|
6
|
+
'class',
|
|
7
|
+
'orientation',
|
|
8
|
+
'variant'
|
|
9
|
+
]);
|
|
10
|
+
return <Tabs.Root data-slot="tabs-root" data-variant={'vertical' === local.orientation ? 'default' : local.variant ?? 'default'} class={cn('group/tabs box-border flex w-full min-w-0 flex-col gap-3 text-foreground data-[orientation=vertical]:flex-row data-[orientation=vertical]:items-stretch', local.class)} orientation={local.orientation} {...others}/>;
|
|
11
|
+
}
|
|
12
|
+
function TabsRootProvider(props) {
|
|
13
|
+
const [local, others] = splitProps(props, [
|
|
14
|
+
'class',
|
|
15
|
+
'value',
|
|
16
|
+
'variant'
|
|
17
|
+
]);
|
|
18
|
+
const orientation = ()=>local.value().getRootProps()['data-orientation'];
|
|
19
|
+
return <Tabs.RootProvider data-slot="tabs-root-provider" data-variant={'vertical' === orientation() ? 'default' : local.variant ?? 'default'} class={cn('group/tabs box-border flex w-full min-w-0 flex-col gap-3 text-foreground data-[orientation=vertical]:flex-row data-[orientation=vertical]:items-stretch', local.class)} value={local.value} {...others}/>;
|
|
20
|
+
}
|
|
21
|
+
function TabsList(props) {
|
|
22
|
+
const [local, others] = splitProps(props, [
|
|
23
|
+
'class'
|
|
24
|
+
]);
|
|
25
|
+
return <Tabs.List data-slot="tabs-list" class={cn('relative z-0 inline-flex w-fit max-w-full items-stretch gap-1 rounded-lg border border-border bg-muted p-1 group-data-[orientation=horizontal]/tabs:overflow-x-auto group-data-[orientation=vertical]/tabs:w-48 group-data-[orientation=vertical]/tabs:min-w-48 group-data-[orientation=vertical]/tabs:flex-col group-data-[variant=line]/tabs:w-full group-data-[variant=line]/tabs:rounded-none group-data-[variant=line]/tabs:border-x-0 group-data-[variant=line]/tabs:border-t-0 group-data-[variant=line]/tabs:bg-transparent group-data-[variant=line]/tabs:px-0 group-data-[orientation=vertical]/tabs:max-[30rem]:w-2/5 group-data-[orientation=vertical]/tabs:max-[30rem]:min-w-0', local.class)} {...others}/>;
|
|
26
|
+
}
|
|
27
|
+
function TabsTrigger(props) {
|
|
28
|
+
const [local, others] = splitProps(props, [
|
|
29
|
+
'class'
|
|
30
|
+
]);
|
|
31
|
+
return <Tabs.Trigger data-slot="tabs-trigger" class={cn("relative z-1 inline-flex h-8 cursor-pointer items-center justify-center gap-2 rounded-md border-0 bg-transparent px-2.5 text-sm leading-5 font-medium whitespace-nowrap text-muted-foreground no-underline outline-0 transition-[color,opacity] duration-200 ease-in-out select-none focus-visible:before:pointer-events-none focus-visible:before:absolute focus-visible:before:inset-0 focus-visible:before:rounded-[inherit] focus-visible:before:outline-1 focus-visible:before:outline-ring focus-visible:before:content-[''] disabled:pointer-events-none disabled:cursor-default disabled:opacity-50 data-disabled:pointer-events-none data-disabled:cursor-default data-disabled:opacity-50 data-selected:text-foreground motion-reduce:transition-none [&>svg]:size-4 [&>svg]:shrink-0 [@media(hover:hover)]:hover:text-foreground", local.class)} {...others}/>;
|
|
32
|
+
}
|
|
33
|
+
function TabsIndicator(props) {
|
|
34
|
+
const [local, others] = splitProps(props, [
|
|
35
|
+
'class'
|
|
36
|
+
]);
|
|
37
|
+
return <Tabs.Indicator data-slot="tabs-indicator" class={cn('pointer-events-none absolute top-1/2 left-[var(--left,0)] z-0 h-8 w-[var(--width,0)] -translate-y-1/2 rounded-md bg-background shadow-sm transition-[var(--transition-property,translate)] duration-200 ease-in-out group-data-[orientation=vertical]/tabs:top-[var(--top,0)] group-data-[orientation=vertical]/tabs:left-1/2 group-data-[orientation=vertical]/tabs:h-[var(--height,0)] group-data-[orientation=vertical]/tabs:w-[calc(100%-0.5rem)] group-data-[orientation=vertical]/tabs:-translate-x-1/2 group-data-[orientation=vertical]/tabs:translate-y-0 group-data-[variant=line]/tabs:top-auto group-data-[variant=line]/tabs:bottom-0 group-data-[variant=line]/tabs:h-0.5 group-data-[variant=line]/tabs:[translate:none] group-data-[variant=line]/tabs:rounded-full group-data-[variant=line]/tabs:bg-foreground group-data-[variant=line]/tabs:shadow-none motion-reduce:transition-none', local.class)} {...others}/>;
|
|
38
|
+
}
|
|
39
|
+
function TabsContent(props) {
|
|
40
|
+
const [local, others] = splitProps(props, [
|
|
41
|
+
'class'
|
|
42
|
+
]);
|
|
43
|
+
return <Tabs.Content data-slot="tabs-content" class={cn("box-border min-w-0 flex-1 rounded-lg border border-border bg-background p-4 text-sm leading-5 text-foreground outline-0 focus-visible:rounded-[inherit] focus-visible:outline-1 focus-visible:-outline-offset-1 focus-visible:outline-ring [&[hidden]:not([hidden='until-found'])]:hidden", local.class)} {...others}/>;
|
|
44
|
+
}
|
|
45
|
+
const Tabs_Tabs = Object.assign(TabsRoot, {
|
|
46
|
+
Root: TabsRoot,
|
|
47
|
+
RootProvider: TabsRootProvider,
|
|
48
|
+
Context: Tabs.Context,
|
|
49
|
+
List: TabsList,
|
|
50
|
+
Trigger: TabsTrigger,
|
|
51
|
+
Indicator: TabsIndicator,
|
|
52
|
+
Content: TabsContent,
|
|
53
|
+
useTabs: useTabs
|
|
54
|
+
});
|
|
55
|
+
export { Tabs_Tabs as Tabs, useTabs, useTabsContext };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tabs, useTabs, useTabsContext } from './Tabs.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tabs, useTabs, useTabsContext } from "./Tabs.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tabs, useTabs, useTabsContext } from "./Tabs.jsx";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { HTMLArkProps } from '@ark-ui/solid/factory';
|
|
2
|
+
type TagVariant = 'default' | 'secondary' | 'outline' | 'ghost' | 'destructive';
|
|
3
|
+
type TagSize = 'sm' | 'md';
|
|
4
|
+
type TagRootProps = HTMLArkProps<'span'> & {
|
|
5
|
+
variant?: TagVariant;
|
|
6
|
+
size?: TagSize;
|
|
7
|
+
};
|
|
8
|
+
type TagLabelProps = HTMLArkProps<'span'>;
|
|
9
|
+
type TagStartElementProps = HTMLArkProps<'span'>;
|
|
10
|
+
type TagEndElementProps = HTMLArkProps<'span'>;
|
|
11
|
+
type TagCloseTriggerProps = HTMLArkProps<'button'>;
|
|
12
|
+
declare function TagRoot(props: TagRootProps): import("solid-js").JSX.Element;
|
|
13
|
+
declare function TagLabel(props: TagLabelProps): import("solid-js").JSX.Element;
|
|
14
|
+
declare function TagStartElement(props: TagStartElementProps): import("solid-js").JSX.Element;
|
|
15
|
+
declare function TagEndElement(props: TagEndElementProps): import("solid-js").JSX.Element;
|
|
16
|
+
declare function TagCloseTrigger(props: TagCloseTriggerProps): import("solid-js").JSX.Element;
|
|
17
|
+
declare const Tag: typeof TagRoot & {
|
|
18
|
+
Root: typeof TagRoot;
|
|
19
|
+
Label: typeof TagLabel;
|
|
20
|
+
StartElement: typeof TagStartElement;
|
|
21
|
+
EndElement: typeof TagEndElement;
|
|
22
|
+
CloseTrigger: typeof TagCloseTrigger;
|
|
23
|
+
};
|
|
24
|
+
export { Tag };
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { createComponent, mergeProps } from "solid-js/web";
|
|
2
|
+
import { ark } from "@ark-ui/solid/factory";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { children, splitProps } from "solid-js";
|
|
5
|
+
import { cn } from "../../internal/cn.js";
|
|
6
|
+
import { CloseButton } from "../close-button/index.js";
|
|
7
|
+
const tagVariants = cva('inline-flex min-h-control-xs w-fit max-w-full min-w-0 items-center gap-1.5 rounded-full border px-2 py-0.5 align-middle font-medium text-xs whitespace-nowrap transition-colors duration-200 ease-in-out motion-reduce:transition-none [&>svg]:pointer-events-none [&>svg]:size-3 [&>svg]:shrink-0', {
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: 'border-transparent bg-primary text-primary-foreground',
|
|
11
|
+
secondary: 'border-transparent bg-secondary text-secondary-foreground',
|
|
12
|
+
outline: 'border-border bg-transparent text-foreground',
|
|
13
|
+
ghost: 'border-transparent bg-transparent text-foreground',
|
|
14
|
+
destructive: 'border-transparent bg-destructive text-destructive-foreground'
|
|
15
|
+
},
|
|
16
|
+
size: {
|
|
17
|
+
sm: 'min-h-5 gap-1 px-1.5 py-0',
|
|
18
|
+
md: ''
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
variant: 'default',
|
|
23
|
+
size: 'md'
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
function TagRoot(props) {
|
|
27
|
+
const [local, others] = splitProps(props, [
|
|
28
|
+
'asChild',
|
|
29
|
+
'class',
|
|
30
|
+
'size',
|
|
31
|
+
'variant'
|
|
32
|
+
]);
|
|
33
|
+
return createComponent(ark.span, mergeProps({
|
|
34
|
+
get asChild () {
|
|
35
|
+
return local.asChild;
|
|
36
|
+
}
|
|
37
|
+
}, others, {
|
|
38
|
+
"data-scope": "tag",
|
|
39
|
+
"data-part": "root",
|
|
40
|
+
"data-slot": "tag-root",
|
|
41
|
+
get ["data-size"] () {
|
|
42
|
+
return local.size ?? 'md';
|
|
43
|
+
},
|
|
44
|
+
get ["data-variant"] () {
|
|
45
|
+
return local.variant ?? 'default';
|
|
46
|
+
},
|
|
47
|
+
get ["class"] () {
|
|
48
|
+
return cn(tagVariants({
|
|
49
|
+
size: local.size,
|
|
50
|
+
variant: local.variant
|
|
51
|
+
}), local.class);
|
|
52
|
+
}
|
|
53
|
+
}));
|
|
54
|
+
}
|
|
55
|
+
function TagLabel(props) {
|
|
56
|
+
const [local, others] = splitProps(props, [
|
|
57
|
+
'asChild',
|
|
58
|
+
'class'
|
|
59
|
+
]);
|
|
60
|
+
return createComponent(ark.span, mergeProps({
|
|
61
|
+
get asChild () {
|
|
62
|
+
return local.asChild;
|
|
63
|
+
}
|
|
64
|
+
}, others, {
|
|
65
|
+
"data-scope": "tag",
|
|
66
|
+
"data-part": "label",
|
|
67
|
+
"data-slot": "tag-label",
|
|
68
|
+
get ["class"] () {
|
|
69
|
+
return cn('min-w-0 overflow-hidden text-ellipsis', local.class);
|
|
70
|
+
}
|
|
71
|
+
}));
|
|
72
|
+
}
|
|
73
|
+
function TagStartElement(props) {
|
|
74
|
+
const [local, others] = splitProps(props, [
|
|
75
|
+
'asChild',
|
|
76
|
+
'class'
|
|
77
|
+
]);
|
|
78
|
+
return createComponent(ark.span, mergeProps({
|
|
79
|
+
get asChild () {
|
|
80
|
+
return local.asChild;
|
|
81
|
+
}
|
|
82
|
+
}, others, {
|
|
83
|
+
"data-scope": "tag",
|
|
84
|
+
"data-part": "start-element",
|
|
85
|
+
"data-slot": "tag-start-element",
|
|
86
|
+
get ["class"] () {
|
|
87
|
+
return cn('inline-flex min-w-0 shrink-0 items-center justify-center [&>svg]:pointer-events-none [&>svg]:size-3 [&>svg]:shrink-0', local.class);
|
|
88
|
+
}
|
|
89
|
+
}));
|
|
90
|
+
}
|
|
91
|
+
function TagEndElement(props) {
|
|
92
|
+
const [local, others] = splitProps(props, [
|
|
93
|
+
'asChild',
|
|
94
|
+
'class'
|
|
95
|
+
]);
|
|
96
|
+
return createComponent(ark.span, mergeProps({
|
|
97
|
+
get asChild () {
|
|
98
|
+
return local.asChild;
|
|
99
|
+
}
|
|
100
|
+
}, others, {
|
|
101
|
+
"data-scope": "tag",
|
|
102
|
+
"data-part": "end-element",
|
|
103
|
+
"data-slot": "tag-end-element",
|
|
104
|
+
get ["class"] () {
|
|
105
|
+
return cn('inline-flex min-w-0 shrink-0 items-center justify-center [&>svg]:pointer-events-none [&>svg]:size-3 [&>svg]:shrink-0', local.class);
|
|
106
|
+
}
|
|
107
|
+
}));
|
|
108
|
+
}
|
|
109
|
+
function TagCloseTrigger(props) {
|
|
110
|
+
const [local, others] = splitProps(props, [
|
|
111
|
+
'asChild',
|
|
112
|
+
'aria-label',
|
|
113
|
+
'aria-labelledby',
|
|
114
|
+
'children',
|
|
115
|
+
'class'
|
|
116
|
+
]);
|
|
117
|
+
const resolvedChildren = children(()=>local.children);
|
|
118
|
+
return createComponent(CloseButton.Root, mergeProps({
|
|
119
|
+
get asChild () {
|
|
120
|
+
return local.asChild;
|
|
121
|
+
}
|
|
122
|
+
}, others, {
|
|
123
|
+
"data-scope": "tag",
|
|
124
|
+
"data-part": "close-trigger",
|
|
125
|
+
"data-slot": "tag-close-trigger",
|
|
126
|
+
get ["aria-label"] () {
|
|
127
|
+
return local['aria-label'] ?? (local.asChild || null != resolvedChildren() || null != local['aria-labelledby'] ? void 0 : 'Remove tag');
|
|
128
|
+
},
|
|
129
|
+
get ["aria-labelledby"] () {
|
|
130
|
+
return local['aria-labelledby'];
|
|
131
|
+
},
|
|
132
|
+
get ["class"] () {
|
|
133
|
+
return cn('size-4 rounded-full bg-transparent p-0 text-inherit focus-visible:outline-1 focus-visible:outline-offset-0 [&>svg]:size-2.5 [@media(hover:hover)]:[&:not([data-disabled]):hover]:bg-current/10 [@media(hover:hover)]:[&:not([data-disabled]):hover]:text-inherit', local.class);
|
|
134
|
+
},
|
|
135
|
+
get children () {
|
|
136
|
+
return local.children;
|
|
137
|
+
}
|
|
138
|
+
}));
|
|
139
|
+
}
|
|
140
|
+
const Tag = Object.assign(TagRoot, {
|
|
141
|
+
Root: TagRoot,
|
|
142
|
+
Label: TagLabel,
|
|
143
|
+
StartElement: TagStartElement,
|
|
144
|
+
EndElement: TagEndElement,
|
|
145
|
+
CloseTrigger: TagCloseTrigger
|
|
146
|
+
});
|
|
147
|
+
export { Tag };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { ark } from "@ark-ui/solid/factory";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { children, splitProps } from "solid-js";
|
|
4
|
+
import { cn } from "../../internal/cn.jsx";
|
|
5
|
+
import { CloseButton } from "../close-button/index.jsx";
|
|
6
|
+
const tagVariants = cva('inline-flex min-h-control-xs w-fit max-w-full min-w-0 items-center gap-1.5 rounded-full border px-2 py-0.5 align-middle font-medium text-xs whitespace-nowrap transition-colors duration-200 ease-in-out motion-reduce:transition-none [&>svg]:pointer-events-none [&>svg]:size-3 [&>svg]:shrink-0', {
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
default: 'border-transparent bg-primary text-primary-foreground',
|
|
10
|
+
secondary: 'border-transparent bg-secondary text-secondary-foreground',
|
|
11
|
+
outline: 'border-border bg-transparent text-foreground',
|
|
12
|
+
ghost: 'border-transparent bg-transparent text-foreground',
|
|
13
|
+
destructive: 'border-transparent bg-destructive text-destructive-foreground'
|
|
14
|
+
},
|
|
15
|
+
size: {
|
|
16
|
+
sm: 'min-h-5 gap-1 px-1.5 py-0',
|
|
17
|
+
md: ''
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
variant: 'default',
|
|
22
|
+
size: 'md'
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
function TagRoot(props) {
|
|
26
|
+
const [local, others] = splitProps(props, [
|
|
27
|
+
'asChild',
|
|
28
|
+
'class',
|
|
29
|
+
'size',
|
|
30
|
+
'variant'
|
|
31
|
+
]);
|
|
32
|
+
return <ark.span asChild={local.asChild} {...others} data-scope="tag" data-part="root" data-slot="tag-root" data-size={local.size ?? 'md'} data-variant={local.variant ?? 'default'} class={cn(tagVariants({
|
|
33
|
+
size: local.size,
|
|
34
|
+
variant: local.variant
|
|
35
|
+
}), local.class)}/>;
|
|
36
|
+
}
|
|
37
|
+
function TagLabel(props) {
|
|
38
|
+
const [local, others] = splitProps(props, [
|
|
39
|
+
'asChild',
|
|
40
|
+
'class'
|
|
41
|
+
]);
|
|
42
|
+
return <ark.span asChild={local.asChild} {...others} data-scope="tag" data-part="label" data-slot="tag-label" class={cn('min-w-0 overflow-hidden text-ellipsis', local.class)}/>;
|
|
43
|
+
}
|
|
44
|
+
function TagStartElement(props) {
|
|
45
|
+
const [local, others] = splitProps(props, [
|
|
46
|
+
'asChild',
|
|
47
|
+
'class'
|
|
48
|
+
]);
|
|
49
|
+
return <ark.span asChild={local.asChild} {...others} data-scope="tag" data-part="start-element" data-slot="tag-start-element" class={cn('inline-flex min-w-0 shrink-0 items-center justify-center [&>svg]:pointer-events-none [&>svg]:size-3 [&>svg]:shrink-0', local.class)}/>;
|
|
50
|
+
}
|
|
51
|
+
function TagEndElement(props) {
|
|
52
|
+
const [local, others] = splitProps(props, [
|
|
53
|
+
'asChild',
|
|
54
|
+
'class'
|
|
55
|
+
]);
|
|
56
|
+
return <ark.span asChild={local.asChild} {...others} data-scope="tag" data-part="end-element" data-slot="tag-end-element" class={cn('inline-flex min-w-0 shrink-0 items-center justify-center [&>svg]:pointer-events-none [&>svg]:size-3 [&>svg]:shrink-0', local.class)}/>;
|
|
57
|
+
}
|
|
58
|
+
function TagCloseTrigger(props) {
|
|
59
|
+
const [local, others] = splitProps(props, [
|
|
60
|
+
'asChild',
|
|
61
|
+
'aria-label',
|
|
62
|
+
'aria-labelledby',
|
|
63
|
+
'children',
|
|
64
|
+
'class'
|
|
65
|
+
]);
|
|
66
|
+
const resolvedChildren = children(()=>local.children);
|
|
67
|
+
return <CloseButton.Root asChild={local.asChild} {...others} data-scope="tag" data-part="close-trigger" data-slot="tag-close-trigger" aria-label={local['aria-label'] ?? (!local.asChild && null == resolvedChildren() && null == local['aria-labelledby'] ? 'Remove tag' : void 0)} aria-labelledby={local['aria-labelledby']} class={cn('size-4 rounded-full bg-transparent p-0 text-inherit focus-visible:outline-1 focus-visible:outline-offset-0 [&>svg]:size-2.5 [@media(hover:hover)]:[&:not([data-disabled]):hover]:bg-current/10 [@media(hover:hover)]:[&:not([data-disabled]):hover]:text-inherit', local.class)}>
|
|
68
|
+
{local.children}
|
|
69
|
+
</CloseButton.Root>;
|
|
70
|
+
}
|
|
71
|
+
const Tag = Object.assign(TagRoot, {
|
|
72
|
+
Root: TagRoot,
|
|
73
|
+
Label: TagLabel,
|
|
74
|
+
StartElement: TagStartElement,
|
|
75
|
+
EndElement: TagEndElement,
|
|
76
|
+
CloseTrigger: TagCloseTrigger
|
|
77
|
+
});
|
|
78
|
+
export { Tag };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tag } from './Tag.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tag } from "./Tag.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tag } from "./Tag.jsx";
|