@stevederico/skateboard-ui 3.12.0 → 4.1.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/CHANGELOG.md +25 -0
- package/README.md +37 -31
- package/dist/components/core/Command.js +33 -7
- package/dist/shadcn/ui/accordion.d.ts +1 -6
- package/dist/shadcn/ui/accordion.js +3 -17
- package/dist/shadcn/ui/alert-dialog.d.ts +1 -18
- package/dist/shadcn/ui/alert-dialog.js +3 -43
- package/dist/shadcn/ui/alert.d.ts +1 -13
- package/dist/shadcn/ui/alert.js +3 -28
- package/dist/shadcn/ui/aspect-ratio.d.ts +1 -4
- package/dist/shadcn/ui/aspect-ratio.js +3 -8
- package/dist/shadcn/ui/avatar.d.ts +1 -11
- package/dist/shadcn/ui/avatar.js +3 -24
- package/dist/shadcn/ui/badge.d.ts +1 -14
- package/dist/shadcn/ui/badge.js +3 -33
- package/dist/shadcn/ui/breadcrumb.d.ts +1 -10
- package/dist/shadcn/ui/breadcrumb.js +3 -37
- package/dist/shadcn/ui/button-group.d.ts +1 -13
- package/dist/shadcn/ui/button-group.js +3 -36
- package/dist/shadcn/ui/button.d.ts +1 -34
- package/dist/shadcn/ui/button.js +3 -53
- package/dist/shadcn/ui/calendar.d.ts +1 -13
- package/dist/shadcn/ui/calendar.js +3 -75
- package/dist/shadcn/ui/card.d.ts +1 -11
- package/dist/shadcn/ui/card.js +3 -25
- package/dist/shadcn/ui/checkbox.d.ts +1 -3
- package/dist/shadcn/ui/checkbox.js +3 -9
- package/dist/shadcn/ui/collapsible.d.ts +1 -5
- package/dist/shadcn/ui/collapsible.js +3 -13
- package/dist/shadcn/ui/command.d.ts +1 -19
- package/dist/shadcn/ui/command.js +3 -35
- package/dist/shadcn/ui/context-menu.d.ts +1 -29
- package/dist/shadcn/ui/context-menu.js +3 -52
- package/dist/shadcn/ui/dialog.d.ts +1 -17
- package/dist/shadcn/ui/dialog.js +3 -38
- package/dist/shadcn/ui/drawer.d.ts +1 -13
- package/dist/shadcn/ui/drawer.js +3 -196
- package/dist/shadcn/ui/dropdown-menu.d.ts +1 -29
- package/dist/shadcn/ui/dropdown-menu.js +3 -52
- package/dist/shadcn/ui/empty.d.ts +1 -14
- package/dist/shadcn/ui/empty.js +3 -33
- package/dist/shadcn/ui/field.d.ts +1 -28
- package/dist/shadcn/ui/field.js +3 -68
- package/dist/shadcn/ui/hover-card.d.ts +1 -5
- package/dist/shadcn/ui/hover-card.js +3 -14
- package/dist/shadcn/ui/input-group.d.ts +1 -28
- package/dist/shadcn/ui/input-group.js +3 -58
- package/dist/shadcn/ui/input.d.ts +1 -3
- package/dist/shadcn/ui/input.js +3 -8
- package/dist/shadcn/ui/item.d.ts +1 -34
- package/dist/shadcn/ui/item.js +3 -79
- package/dist/shadcn/ui/kbd.d.ts +1 -3
- package/dist/shadcn/ui/kbd.js +3 -9
- package/dist/shadcn/ui/label.d.ts +1 -3
- package/dist/shadcn/ui/label.js +3 -8
- package/dist/shadcn/ui/menubar.d.ts +1 -29
- package/dist/shadcn/ui/menubar.js +3 -57
- package/dist/shadcn/ui/navigation-menu.d.ts +1 -13
- package/dist/shadcn/ui/navigation-menu.js +3 -31
- package/dist/shadcn/ui/pagination.d.ts +1 -17
- package/dist/shadcn/ui/pagination.js +3 -27
- package/dist/shadcn/ui/popover.d.ts +1 -9
- package/dist/shadcn/ui/popover.js +3 -24
- package/dist/shadcn/ui/progress.d.ts +1 -7
- package/dist/shadcn/ui/progress.js +3 -20
- package/dist/shadcn/ui/radio-group.d.ts +1 -5
- package/dist/shadcn/ui/radio-group.js +3 -12
- package/dist/shadcn/ui/scroll-area.d.ts +1 -5
- package/dist/shadcn/ui/scroll-area.js +3 -12
- package/dist/shadcn/ui/select.d.ts +1 -15
- package/dist/shadcn/ui/select.js +3 -35
- package/dist/shadcn/ui/separator.d.ts +1 -3
- package/dist/shadcn/ui/separator.js +3 -8
- package/dist/shadcn/ui/sheet.d.ts +1 -14
- package/dist/shadcn/ui/sheet.js +3 -38
- package/dist/shadcn/ui/sidebar.d.ts +1 -70
- package/dist/shadcn/ui/sidebar.js +3 -256
- package/dist/shadcn/ui/skeleton.d.ts +1 -2
- package/dist/shadcn/ui/skeleton.js +3 -6
- package/dist/shadcn/ui/slider.d.ts +1 -3
- package/dist/shadcn/ui/slider.js +3 -12
- package/dist/shadcn/ui/spinner.d.ts +1 -2
- package/dist/shadcn/ui/spinner.js +3 -7
- package/dist/shadcn/ui/switch.d.ts +1 -5
- package/dist/shadcn/ui/switch.js +3 -8
- package/dist/shadcn/ui/table.d.ts +1 -10
- package/dist/shadcn/ui/table.js +3 -29
- package/dist/shadcn/ui/tabs.d.ts +1 -13
- package/dist/shadcn/ui/tabs.js +3 -29
- package/dist/shadcn/ui/textarea.d.ts +1 -3
- package/dist/shadcn/ui/textarea.js +3 -7
- package/dist/shadcn/ui/toggle-group.d.ts +1 -11
- package/dist/shadcn/ui/toggle-group.js +3 -25
- package/dist/shadcn/ui/toggle.d.ts +1 -15
- package/dist/shadcn/ui/toggle.js +3 -26
- package/dist/shadcn/ui/tooltip.d.ts +1 -6
- package/dist/shadcn/ui/tooltip.js +3 -17
- package/dist/ui/accordion.d.ts +21 -0
- package/dist/ui/accordion.js +67 -0
- package/dist/ui/alert-dialog.d.ts +32 -0
- package/dist/ui/alert-dialog.js +102 -0
- package/dist/ui/alert.d.ts +13 -0
- package/dist/ui/alert.js +28 -0
- package/dist/ui/aspect-ratio.d.ts +5 -0
- package/dist/ui/aspect-ratio.js +9 -0
- package/dist/ui/avatar.d.ts +14 -0
- package/dist/ui/avatar.js +49 -0
- package/dist/ui/badge.d.ts +22 -0
- package/dist/ui/badge.js +26 -0
- package/dist/ui/breadcrumb.d.ts +13 -0
- package/dist/ui/breadcrumb.js +29 -0
- package/dist/ui/button-group.d.ts +21 -0
- package/dist/ui/button-group.js +29 -0
- package/dist/ui/button.d.ts +38 -0
- package/dist/ui/button.js +49 -0
- package/dist/ui/calendar.d.ts +13 -0
- package/dist/ui/calendar.js +75 -0
- package/dist/ui/card.d.ts +11 -0
- package/dist/ui/card.js +25 -0
- package/dist/ui/checkbox.d.ts +17 -0
- package/dist/ui/checkbox.js +25 -0
- package/dist/ui/collapsible.d.ts +11 -0
- package/dist/ui/collapsible.js +40 -0
- package/dist/ui/command.d.ts +19 -0
- package/dist/ui/command.js +35 -0
- package/dist/ui/context-menu.d.ts +53 -0
- package/dist/ui/context-menu.js +372 -0
- package/dist/ui/dialog.d.ts +40 -0
- package/dist/ui/dialog.js +109 -0
- package/dist/ui/drawer.d.ts +36 -0
- package/dist/ui/drawer.js +243 -0
- package/dist/ui/dropdown-menu.d.ts +61 -0
- package/dist/ui/dropdown-menu.js +347 -0
- package/dist/ui/empty.d.ts +14 -0
- package/dist/ui/empty.js +33 -0
- package/dist/ui/field.d.ts +28 -0
- package/dist/ui/field.js +68 -0
- package/dist/ui/hover-card.d.ts +32 -0
- package/dist/ui/hover-card.js +119 -0
- package/dist/ui/input-group.d.ts +28 -0
- package/dist/ui/input-group.js +58 -0
- package/dist/ui/input.d.ts +3 -0
- package/dist/ui/input.js +7 -0
- package/dist/ui/item.d.ts +41 -0
- package/dist/ui/item.js +69 -0
- package/dist/ui/kbd.d.ts +4 -0
- package/dist/ui/kbd.js +10 -0
- package/dist/ui/label.d.ts +3 -0
- package/dist/ui/label.js +8 -0
- package/dist/ui/menubar.d.ts +59 -0
- package/dist/ui/menubar.js +397 -0
- package/dist/ui/navigation-menu.d.ts +24 -0
- package/dist/ui/navigation-menu.js +203 -0
- package/dist/ui/pagination.d.ts +17 -0
- package/dist/ui/pagination.js +36 -0
- package/dist/ui/popover.d.ts +25 -0
- package/dist/ui/popover.js +126 -0
- package/dist/ui/portal.d.ts +7 -0
- package/dist/ui/portal.js +12 -0
- package/dist/ui/progress.d.ts +15 -0
- package/dist/ui/progress.js +36 -0
- package/dist/ui/radio-group.d.ts +17 -0
- package/dist/ui/radio-group.js +66 -0
- package/dist/ui/scroll-area.d.ts +9 -0
- package/dist/ui/scroll-area.js +72 -0
- package/dist/ui/select.d.ts +37 -0
- package/dist/ui/select.js +226 -0
- package/dist/ui/separator.d.ts +14 -0
- package/dist/ui/separator.js +13 -0
- package/dist/ui/sheet.d.ts +31 -0
- package/dist/ui/sheet.js +121 -0
- package/dist/ui/sidebar.d.ts +86 -0
- package/dist/ui/sidebar.js +211 -0
- package/dist/ui/skeleton.d.ts +3 -0
- package/dist/ui/skeleton.js +7 -0
- package/dist/ui/slider.d.ts +18 -0
- package/dist/ui/slider.js +94 -0
- package/dist/ui/slot.d.ts +27 -0
- package/dist/ui/slot.js +62 -0
- package/dist/ui/spinner.d.ts +3 -0
- package/dist/ui/spinner.js +8 -0
- package/dist/ui/switch.d.ts +17 -0
- package/dist/ui/switch.js +23 -0
- package/dist/ui/table.d.ts +10 -0
- package/dist/ui/table.js +29 -0
- package/dist/ui/tabs.d.ts +29 -0
- package/dist/ui/tabs.js +96 -0
- package/dist/ui/textarea.d.ts +3 -0
- package/dist/ui/textarea.js +7 -0
- package/dist/ui/toggle-group.d.ts +23 -0
- package/dist/ui/toggle-group.js +52 -0
- package/dist/ui/toggle.d.ts +25 -0
- package/dist/ui/toggle.js +41 -0
- package/dist/ui/tooltip.d.ts +25 -0
- package/dist/ui/tooltip.js +90 -0
- package/dist/ui/use-controllable-state.d.ts +10 -0
- package/dist/ui/use-controllable-state.js +17 -0
- package/dist/ui/use-dismiss.d.ts +10 -0
- package/dist/ui/use-dismiss.js +51 -0
- package/dist/ui/use-floating.d.ts +42 -0
- package/dist/ui/use-floating.js +136 -0
- package/dist/ui/use-presence.d.ts +8 -0
- package/dist/ui/use-presence.js +48 -0
- package/dist/ui/use-typeahead.d.ts +19 -0
- package/dist/ui/use-typeahead.js +64 -0
- package/package.json +6 -1
- package/dist/shadcn/lib/base-ui/LICENSE +0 -21
- package/dist/shadcn/lib/base-ui/_chunk-000kmre8.js +0 -150
- package/dist/shadcn/lib/base-ui/_chunk-1vw45v38.js +0 -64
- package/dist/shadcn/lib/base-ui/_chunk-23rx7haq.js +0 -81
- package/dist/shadcn/lib/base-ui/_chunk-242gh8ph.js +0 -230
- package/dist/shadcn/lib/base-ui/_chunk-26cc610z.js +0 -6
- package/dist/shadcn/lib/base-ui/_chunk-2z044bba.js +0 -5890
- package/dist/shadcn/lib/base-ui/_chunk-3cpd1vjz.js +0 -13
- package/dist/shadcn/lib/base-ui/_chunk-3enq1vat.js +0 -82
- package/dist/shadcn/lib/base-ui/_chunk-3xpke33f.js +0 -23
- package/dist/shadcn/lib/base-ui/_chunk-451nqgsa.js +0 -6
- package/dist/shadcn/lib/base-ui/_chunk-4maf6pas.js +0 -11
- package/dist/shadcn/lib/base-ui/_chunk-4zhfq4d3.js +0 -16
- package/dist/shadcn/lib/base-ui/_chunk-5gaqyne5.js +0 -21
- package/dist/shadcn/lib/base-ui/_chunk-5tt5hk59.js +0 -4
- package/dist/shadcn/lib/base-ui/_chunk-5tze5c8q.js +0 -13
- package/dist/shadcn/lib/base-ui/_chunk-5xmdvndx.js +0 -225
- package/dist/shadcn/lib/base-ui/_chunk-6adaer33.js +0 -435
- package/dist/shadcn/lib/base-ui/_chunk-6ejf1z1r.js +0 -9
- package/dist/shadcn/lib/base-ui/_chunk-6kqramh9.js +0 -27
- package/dist/shadcn/lib/base-ui/_chunk-7b9dc493.js +0 -14
- package/dist/shadcn/lib/base-ui/_chunk-8a9vv8am.js +0 -89
- package/dist/shadcn/lib/base-ui/_chunk-8ctgmf06.js +0 -129
- package/dist/shadcn/lib/base-ui/_chunk-8ganmsbg.js +0 -54
- package/dist/shadcn/lib/base-ui/_chunk-8xaqxgck.js +0 -15
- package/dist/shadcn/lib/base-ui/_chunk-95tf2rxq.js +0 -62
- package/dist/shadcn/lib/base-ui/_chunk-9x63vfqj.js +0 -70
- package/dist/shadcn/lib/base-ui/_chunk-ase0ydtt.js +0 -9
- package/dist/shadcn/lib/base-ui/_chunk-b0nc8wq7.js +0 -34
- package/dist/shadcn/lib/base-ui/_chunk-b5ya6xds.js +0 -10
- package/dist/shadcn/lib/base-ui/_chunk-b6dkjkbw.js +0 -43
- package/dist/shadcn/lib/base-ui/_chunk-c2bz952e.js +0 -19
- package/dist/shadcn/lib/base-ui/_chunk-cdgfsr3q.js +0 -15
- package/dist/shadcn/lib/base-ui/_chunk-cdj8cpx5.js +0 -347
- package/dist/shadcn/lib/base-ui/_chunk-cgptgywc.js +0 -104
- package/dist/shadcn/lib/base-ui/_chunk-cwvtvwc7.js +0 -35
- package/dist/shadcn/lib/base-ui/_chunk-dan0mva4.js +0 -23
- package/dist/shadcn/lib/base-ui/_chunk-dzvjwv25.js +0 -0
- package/dist/shadcn/lib/base-ui/_chunk-e13rsb6b.js +0 -184
- package/dist/shadcn/lib/base-ui/_chunk-e56mpvk1.js +0 -118
- package/dist/shadcn/lib/base-ui/_chunk-e6k2ecs7.js +0 -48
- package/dist/shadcn/lib/base-ui/_chunk-ebyxgtb4.js +0 -29
- package/dist/shadcn/lib/base-ui/_chunk-f2wttwrf.js +0 -39
- package/dist/shadcn/lib/base-ui/_chunk-fdzctasg.js +0 -38
- package/dist/shadcn/lib/base-ui/_chunk-ffpjy0ta.js +0 -39
- package/dist/shadcn/lib/base-ui/_chunk-fqry7pew.js +0 -603
- package/dist/shadcn/lib/base-ui/_chunk-ghn1tzt8.js +0 -84
- package/dist/shadcn/lib/base-ui/_chunk-gy0bpkmx.js +0 -12
- package/dist/shadcn/lib/base-ui/_chunk-hm5h9vsk.js +0 -16
- package/dist/shadcn/lib/base-ui/_chunk-htdj1jps.js +0 -833
- package/dist/shadcn/lib/base-ui/_chunk-j29xjete.js +0 -146
- package/dist/shadcn/lib/base-ui/_chunk-j3qkyd10.js +0 -50
- package/dist/shadcn/lib/base-ui/_chunk-ktvsd5k6.js +0 -2386
- package/dist/shadcn/lib/base-ui/_chunk-kw8nnq00.js +0 -546
- package/dist/shadcn/lib/base-ui/_chunk-m307wpdj.js +0 -18
- package/dist/shadcn/lib/base-ui/_chunk-mnd0j7v9.js +0 -15
- package/dist/shadcn/lib/base-ui/_chunk-n11h505c.js +0 -32
- package/dist/shadcn/lib/base-ui/_chunk-p0e2qacz.js +0 -26
- package/dist/shadcn/lib/base-ui/_chunk-pv7b791x.js +0 -106
- package/dist/shadcn/lib/base-ui/_chunk-q5cg71p7.js +0 -83
- package/dist/shadcn/lib/base-ui/_chunk-qbezxj1g.js +0 -385
- package/dist/shadcn/lib/base-ui/_chunk-qmsqz6nt.js +0 -15
- package/dist/shadcn/lib/base-ui/_chunk-rrh8rt4v.js +0 -65
- package/dist/shadcn/lib/base-ui/_chunk-s5pwkz8v.js +0 -25
- package/dist/shadcn/lib/base-ui/_chunk-svxv97ph.js +0 -218
- package/dist/shadcn/lib/base-ui/_chunk-t7ppm3t0.js +0 -68
- package/dist/shadcn/lib/base-ui/_chunk-vg16xxmb.js +0 -52
- package/dist/shadcn/lib/base-ui/_chunk-vgkfmtbe.js +0 -21
- package/dist/shadcn/lib/base-ui/_chunk-watha94s.js +0 -14
- package/dist/shadcn/lib/base-ui/_chunk-wdqynnjf.js +0 -35
- package/dist/shadcn/lib/base-ui/_chunk-wx2nxg0p.js +0 -15
- package/dist/shadcn/lib/base-ui/_chunk-x11e1k9r.js +0 -0
- package/dist/shadcn/lib/base-ui/_chunk-x8xehj6d.js +0 -302
- package/dist/shadcn/lib/base-ui/_chunk-xcqbtm2f.js +0 -28
- package/dist/shadcn/lib/base-ui/_chunk-ytnp24gq.js +0 -328
- package/dist/shadcn/lib/base-ui/_chunk-yzr7eg4b.js +0 -6
- package/dist/shadcn/lib/base-ui/_chunk-zk4mtm9m.js +0 -9
- package/dist/shadcn/lib/base-ui/accordion.d.ts +0 -447
- package/dist/shadcn/lib/base-ui/accordion.js +0 -630
- package/dist/shadcn/lib/base-ui/alert-dialog.d.ts +0 -1467
- package/dist/shadcn/lib/base-ui/alert-dialog.js +0 -98
- package/dist/shadcn/lib/base-ui/avatar.d.ts +0 -123
- package/dist/shadcn/lib/base-ui/avatar.js +0 -235
- package/dist/shadcn/lib/base-ui/button.d.ts +0 -84
- package/dist/shadcn/lib/base-ui/button.js +0 -51
- package/dist/shadcn/lib/base-ui/checkbox.d.ts +0 -341
- package/dist/shadcn/lib/base-ui/checkbox.js +0 -501
- package/dist/shadcn/lib/base-ui/collapsible.d.ts +0 -291
- package/dist/shadcn/lib/base-ui/collapsible.js +0 -264
- package/dist/shadcn/lib/base-ui/context-menu.d.ts +0 -2213
- package/dist/shadcn/lib/base-ui/context-menu.js +0 -323
- package/dist/shadcn/lib/base-ui/dialog.d.ts +0 -1448
- package/dist/shadcn/lib/base-ui/dialog.js +0 -79
- package/dist/shadcn/lib/base-ui/input.d.ts +0 -506
- package/dist/shadcn/lib/base-ui/input.js +0 -1027
- package/dist/shadcn/lib/base-ui/menu.d.ts +0 -2275
- package/dist/shadcn/lib/base-ui/menu.js +0 -60
- package/dist/shadcn/lib/base-ui/menubar.d.ts +0 -48
- package/dist/shadcn/lib/base-ui/menubar.js +0 -156
- package/dist/shadcn/lib/base-ui/merge-props.d.ts +0 -70
- package/dist/shadcn/lib/base-ui/merge-props.js +0 -15
- package/dist/shadcn/lib/base-ui/navigation-menu.d.ts +0 -825
- package/dist/shadcn/lib/base-ui/navigation-menu.js +0 -1849
- package/dist/shadcn/lib/base-ui/popover.d.ts +0 -1743
- package/dist/shadcn/lib/base-ui/popover.js +0 -1089
- package/dist/shadcn/lib/base-ui/preview-card.d.ts +0 -1608
- package/dist/shadcn/lib/base-ui/preview-card.js +0 -919
- package/dist/shadcn/lib/base-ui/progress.d.ts +0 -172
- package/dist/shadcn/lib/base-ui/progress.js +0 -272
- package/dist/shadcn/lib/base-ui/radio-group.d.ts +0 -260
- package/dist/shadcn/lib/base-ui/radio-group.js +0 -239
- package/dist/shadcn/lib/base-ui/radio.d.ts +0 -176
- package/dist/shadcn/lib/base-ui/radio.js +0 -387
- package/dist/shadcn/lib/base-ui/scroll-area.d.ts +0 -241
- package/dist/shadcn/lib/base-ui/scroll-area.js +0 -1055
- package/dist/shadcn/lib/base-ui/select.d.ts +0 -1266
- package/dist/shadcn/lib/base-ui/select.js +0 -2450
- package/dist/shadcn/lib/base-ui/separator.d.ts +0 -76
- package/dist/shadcn/lib/base-ui/separator.js +0 -11
- package/dist/shadcn/lib/base-ui/slider.d.ts +0 -551
- package/dist/shadcn/lib/base-ui/slider.js +0 -1583
- package/dist/shadcn/lib/base-ui/switch.d.ts +0 -313
- package/dist/shadcn/lib/base-ui/switch.js +0 -326
- package/dist/shadcn/lib/base-ui/tabs.d.ts +0 -406
- package/dist/shadcn/lib/base-ui/tabs.js +0 -915
- package/dist/shadcn/lib/base-ui/toggle-group.d.ts +0 -235
- package/dist/shadcn/lib/base-ui/toggle-group.js +0 -145
- package/dist/shadcn/lib/base-ui/toggle.d.ts +0 -224
- package/dist/shadcn/lib/base-ui/toggle.js +0 -127
- package/dist/shadcn/lib/base-ui/tooltip.d.ts +0 -1656
- package/dist/shadcn/lib/base-ui/tooltip.js +0 -920
- package/dist/shadcn/lib/base-ui/use-render.d.ts +0 -87
- package/dist/shadcn/lib/base-ui/use-render.js +0 -15
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cva } from "../shadcn/lib/cva.js";
|
|
5
|
+
import { useIsMobile } from "../shadcn/hooks/use-mobile.js";
|
|
6
|
+
import { cn } from "../shadcn/lib/utils.js";
|
|
7
|
+
import { Slot, resolveRender } from "./slot.js";
|
|
8
|
+
import { Button } from "./button.js";
|
|
9
|
+
import { Input } from "./input.js";
|
|
10
|
+
import { Separator } from "./separator.js";
|
|
11
|
+
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle, } from "./sheet.js";
|
|
12
|
+
import { Skeleton } from "./skeleton.js";
|
|
13
|
+
import { Tooltip, TooltipContent, TooltipTrigger, } from "./tooltip.js";
|
|
14
|
+
import { PanelLeftIcon } from "../icons/index.js";
|
|
15
|
+
const SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
16
|
+
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
17
|
+
const SIDEBAR_WIDTH = "12rem";
|
|
18
|
+
const SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
19
|
+
const SIDEBAR_WIDTH_ICON = "3rem";
|
|
20
|
+
const SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
21
|
+
const SidebarContext = React.createContext(null);
|
|
22
|
+
function useSidebar() {
|
|
23
|
+
const context = React.useContext(SidebarContext);
|
|
24
|
+
if (!context) {
|
|
25
|
+
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
26
|
+
}
|
|
27
|
+
return context;
|
|
28
|
+
}
|
|
29
|
+
function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }) {
|
|
30
|
+
const isMobile = useIsMobile();
|
|
31
|
+
const [openMobile, setOpenMobile] = React.useState(false);
|
|
32
|
+
// This is the internal state of the sidebar.
|
|
33
|
+
// We use openProp and setOpenProp for control from outside the component.
|
|
34
|
+
const [_open, _setOpen] = React.useState(defaultOpen);
|
|
35
|
+
const open = openProp ?? _open;
|
|
36
|
+
const setOpen = React.useCallback((value) => {
|
|
37
|
+
const openState = typeof value === "function" ? value(open) : value;
|
|
38
|
+
if (setOpenProp) {
|
|
39
|
+
setOpenProp(openState);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
_setOpen(openState);
|
|
43
|
+
}
|
|
44
|
+
// This sets the cookie to keep the sidebar state.
|
|
45
|
+
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
46
|
+
}, [setOpenProp, open]);
|
|
47
|
+
// Helper to toggle the sidebar.
|
|
48
|
+
const toggleSidebar = React.useCallback(() => {
|
|
49
|
+
return isMobile ? setOpenMobile((open) => !open) : setOpen((open) => !open);
|
|
50
|
+
}, [isMobile, setOpen, setOpenMobile]);
|
|
51
|
+
// Adds a keyboard shortcut to toggle the sidebar.
|
|
52
|
+
React.useEffect(() => {
|
|
53
|
+
const handleKeyDown = (event) => {
|
|
54
|
+
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT &&
|
|
55
|
+
(event.metaKey || event.ctrlKey)) {
|
|
56
|
+
event.preventDefault();
|
|
57
|
+
toggleSidebar();
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
61
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
62
|
+
}, [toggleSidebar]);
|
|
63
|
+
// We add a state so that we can do data-state="expanded" or "collapsed".
|
|
64
|
+
// This makes it easier to style the sidebar with Tailwind classes.
|
|
65
|
+
const state = open ? "expanded" : "collapsed";
|
|
66
|
+
const contextValue = React.useMemo(() => ({
|
|
67
|
+
state,
|
|
68
|
+
open,
|
|
69
|
+
setOpen,
|
|
70
|
+
isMobile,
|
|
71
|
+
openMobile,
|
|
72
|
+
setOpenMobile,
|
|
73
|
+
toggleSidebar,
|
|
74
|
+
}), [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]);
|
|
75
|
+
return (_jsx(SidebarContext.Provider, { value: contextValue, children: _jsx("div", { "data-slot": "sidebar-wrapper", style: {
|
|
76
|
+
"--sidebar-width": SIDEBAR_WIDTH,
|
|
77
|
+
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
|
78
|
+
...style,
|
|
79
|
+
}, className: cn("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar", className), ...props, children: children }) }));
|
|
80
|
+
}
|
|
81
|
+
function Sidebar({ side = "left", variant = "sidebar", collapsible = "offcanvas", className, children, dir, ...props }) {
|
|
82
|
+
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
83
|
+
if (collapsible === "none") {
|
|
84
|
+
return (_jsx("div", { "data-slot": "sidebar", className: cn("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground", className), ...props, children: children }));
|
|
85
|
+
}
|
|
86
|
+
if (isMobile) {
|
|
87
|
+
return (_jsx(Sheet, { open: openMobile, onOpenChange: setOpenMobile, children: _jsxs(SheetContent, { dir: dir, "data-sidebar": "sidebar", "data-slot": "sidebar", "data-mobile": "true", showCloseButton: false, className: "w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden", style: {
|
|
88
|
+
"--sidebar-width": SIDEBAR_WIDTH_MOBILE,
|
|
89
|
+
}, side: side, children: [_jsxs(SheetHeader, { className: "sr-only", children: [_jsx(SheetTitle, { children: "Sidebar" }), _jsx(SheetDescription, { children: "Displays the mobile sidebar." })] }), _jsx("div", { className: "flex h-full w-full flex-col", children: children })] }) }));
|
|
90
|
+
}
|
|
91
|
+
return (_jsxs("div", { className: "group peer hidden text-sidebar-foreground md:block", "data-state": state, "data-collapsible": state === "collapsed" ? collapsible : "", "data-variant": variant, "data-side": side, "data-slot": "sidebar", children: [_jsx("div", { "data-slot": "sidebar-gap", className: cn("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear", "group-data-[collapsible=offcanvas]:w-0", "group-data-[side=right]:rotate-180", variant === "floating" || variant === "inset"
|
|
92
|
+
? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]"
|
|
93
|
+
: "group-data-[collapsible=icon]:w-(--sidebar-width-icon)") }), _jsx("div", { "data-slot": "sidebar-container", "data-side": side, className: cn("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",
|
|
94
|
+
// Adjust the padding for floating and inset variants.
|
|
95
|
+
variant === "floating" || variant === "inset"
|
|
96
|
+
? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]"
|
|
97
|
+
: "group-data-[collapsible=icon]:w-(--sidebar-width-icon)", className), ...props, children: _jsx("div", { "data-sidebar": "sidebar", "data-slot": "sidebar-inner", className: "flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border", children: children }) })] }));
|
|
98
|
+
}
|
|
99
|
+
function SidebarTrigger({ className, onClick, ...props }) {
|
|
100
|
+
const { toggleSidebar } = useSidebar();
|
|
101
|
+
return (_jsxs(Button, { "data-sidebar": "trigger", "data-slot": "sidebar-trigger", variant: "ghost", size: "icon-sm", className: cn(className), onClick: (event) => {
|
|
102
|
+
onClick?.(event);
|
|
103
|
+
toggleSidebar();
|
|
104
|
+
}, ...props, children: [_jsx(PanelLeftIcon, {}), _jsx("span", { className: "sr-only", children: "Toggle Sidebar" })] }));
|
|
105
|
+
}
|
|
106
|
+
function SidebarRail({ className, ...props }) {
|
|
107
|
+
const { toggleSidebar } = useSidebar();
|
|
108
|
+
return (_jsx("button", { "data-sidebar": "rail", "data-slot": "sidebar-rail", "aria-label": "Toggle Sidebar", tabIndex: -1, onClick: toggleSidebar, title: "Toggle Sidebar", className: cn("cursor-pointer absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2", "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize", "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize", "group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar", "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2", "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2", className), ...props }));
|
|
109
|
+
}
|
|
110
|
+
function SidebarInset({ className, ...props }) {
|
|
111
|
+
return (_jsx("main", { "data-slot": "sidebar-inset", className: cn("relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2", className), ...props }));
|
|
112
|
+
}
|
|
113
|
+
function SidebarInput({ className, ...props }) {
|
|
114
|
+
return (_jsx(Input, { "data-slot": "sidebar-input", "data-sidebar": "input", className: cn("h-8 w-full bg-background shadow-none", className), ...props }));
|
|
115
|
+
}
|
|
116
|
+
function SidebarHeader({ className, ...props }) {
|
|
117
|
+
return (_jsx("div", { "data-slot": "sidebar-header", "data-sidebar": "header", className: cn("gap-2 px-2 pb-2 flex flex-col", className), ...props }));
|
|
118
|
+
}
|
|
119
|
+
function SidebarFooter({ className, ...props }) {
|
|
120
|
+
return (_jsx("div", { "data-slot": "sidebar-footer", "data-sidebar": "footer", className: cn("flex flex-col gap-2 p-2", className), ...props }));
|
|
121
|
+
}
|
|
122
|
+
function SidebarSeparator({ className, ...props }) {
|
|
123
|
+
return (_jsx(Separator, { "data-slot": "sidebar-separator", "data-sidebar": "separator", className: cn("mx-2 w-auto bg-sidebar-border", className), ...props }));
|
|
124
|
+
}
|
|
125
|
+
function SidebarContent({ className, ...props }) {
|
|
126
|
+
return (_jsx("div", { "data-slot": "sidebar-content", "data-sidebar": "content", className: cn("no-scrollbar flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden", className), ...props }));
|
|
127
|
+
}
|
|
128
|
+
function SidebarGroup({ className, ...props }) {
|
|
129
|
+
return (_jsx("div", { "data-slot": "sidebar-group", "data-sidebar": "group", className: cn("relative flex w-full min-w-0 flex-col p-2", className), ...props }));
|
|
130
|
+
}
|
|
131
|
+
function SidebarGroupLabel({ className, asChild = false, render, nativeButton: _nativeButton, children, ...props }) {
|
|
132
|
+
const { useSlot, slotChild } = resolveRender(asChild, render, children);
|
|
133
|
+
const Comp = useSlot ? Slot : "div";
|
|
134
|
+
return (_jsx(Comp, { "data-slot": "sidebar-group-label", "data-sidebar": "group-label", className: cn("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0", className), ...props, children: slotChild }));
|
|
135
|
+
}
|
|
136
|
+
function SidebarGroupAction({ className, asChild = false, render, nativeButton: _nativeButton, children, ...props }) {
|
|
137
|
+
const { useSlot, slotChild } = resolveRender(asChild, render, children);
|
|
138
|
+
const Comp = useSlot ? Slot : "button";
|
|
139
|
+
return (_jsx(Comp, { "data-slot": "sidebar-group-action", "data-sidebar": "group-action", className: cn("absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0", className), ...props, children: slotChild }));
|
|
140
|
+
}
|
|
141
|
+
function SidebarGroupContent({ className, ...props }) {
|
|
142
|
+
return (_jsx("div", { "data-slot": "sidebar-group-content", "data-sidebar": "group-content", className: cn("w-full text-sm", className), ...props }));
|
|
143
|
+
}
|
|
144
|
+
function SidebarMenu({ className, ...props }) {
|
|
145
|
+
return (_jsx("ul", { "data-slot": "sidebar-menu", "data-sidebar": "menu", className: cn("flex w-full min-w-0 flex-col gap-1", className), ...props }));
|
|
146
|
+
}
|
|
147
|
+
function SidebarMenuItem({ className, ...props }) {
|
|
148
|
+
return (_jsx("li", { "data-slot": "sidebar-menu-item", "data-sidebar": "menu-item", className: cn("group/menu-item relative", className), ...props }));
|
|
149
|
+
}
|
|
150
|
+
const sidebarMenuButtonVariants = cva("cursor-pointer peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate", {
|
|
151
|
+
variants: {
|
|
152
|
+
variant: {
|
|
153
|
+
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
154
|
+
outline: "bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]",
|
|
155
|
+
},
|
|
156
|
+
size: {
|
|
157
|
+
default: "h-10 text-base",
|
|
158
|
+
sm: "h-8 text-sm",
|
|
159
|
+
lg: "h-14 text-base group-data-[collapsible=icon]:p-0!",
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
defaultVariants: {
|
|
163
|
+
variant: "default",
|
|
164
|
+
size: "default",
|
|
165
|
+
},
|
|
166
|
+
});
|
|
167
|
+
function SidebarMenuButton({ asChild = false, render, nativeButton: _nativeButton, children, isActive = false, variant = "default", size = "default", tooltip, className, ...props }) {
|
|
168
|
+
const { isMobile, state } = useSidebar();
|
|
169
|
+
const { useSlot, slotChild } = resolveRender(asChild, render, children);
|
|
170
|
+
const Comp = useSlot ? Slot : "button";
|
|
171
|
+
const button = (_jsx(Comp, { "data-slot": "sidebar-menu-button", "data-sidebar": "menu-button", "data-size": size, "data-active": isActive ? "" : undefined, className: cn(sidebarMenuButtonVariants({ variant, size }), className), ...props, children: slotChild }));
|
|
172
|
+
if (!tooltip) {
|
|
173
|
+
return button;
|
|
174
|
+
}
|
|
175
|
+
if (typeof tooltip === "string") {
|
|
176
|
+
tooltip = {
|
|
177
|
+
children: tooltip,
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: button }), state === "collapsed" && !isMobile && (_jsx(TooltipContent, { side: "right", align: "center", ...tooltip }))] }));
|
|
181
|
+
}
|
|
182
|
+
function SidebarMenuAction({ className, asChild = false, render, nativeButton: _nativeButton, children, showOnHover = false, ...props }) {
|
|
183
|
+
const { useSlot, slotChild } = resolveRender(asChild, render, children);
|
|
184
|
+
const Comp = useSlot ? Slot : "button";
|
|
185
|
+
return (_jsx(Comp, { "data-slot": "sidebar-menu-action", "data-sidebar": "menu-action", className: cn("cursor-pointer absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0", showOnHover &&
|
|
186
|
+
"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100 md:opacity-0", className), ...props, children: slotChild }));
|
|
187
|
+
}
|
|
188
|
+
function SidebarMenuBadge({ className, ...props }) {
|
|
189
|
+
return (_jsx("div", { "data-slot": "sidebar-menu-badge", "data-sidebar": "menu-badge", className: cn("pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 peer-data-active/menu-button:text-sidebar-accent-foreground", className), ...props }));
|
|
190
|
+
}
|
|
191
|
+
function SidebarMenuSkeleton({ className, showIcon = false, ...props }) {
|
|
192
|
+
// Random width between 50 to 90%.
|
|
193
|
+
const [width] = React.useState(() => {
|
|
194
|
+
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
195
|
+
});
|
|
196
|
+
return (_jsxs("div", { "data-slot": "sidebar-menu-skeleton", "data-sidebar": "menu-skeleton", className: cn("flex h-8 items-center gap-2 rounded-md px-2", className), ...props, children: [showIcon && (_jsx(Skeleton, { className: "size-4 rounded-md", "data-sidebar": "menu-skeleton-icon" })), _jsx(Skeleton, { className: "h-4 max-w-(--skeleton-width) flex-1", "data-sidebar": "menu-skeleton-text", style: {
|
|
197
|
+
"--skeleton-width": width,
|
|
198
|
+
} })] }));
|
|
199
|
+
}
|
|
200
|
+
function SidebarMenuSub({ className, ...props }) {
|
|
201
|
+
return (_jsx("ul", { "data-slot": "sidebar-menu-sub", "data-sidebar": "menu-sub", className: cn("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5 group-data-[collapsible=icon]:hidden", className), ...props }));
|
|
202
|
+
}
|
|
203
|
+
function SidebarMenuSubItem({ className, ...props }) {
|
|
204
|
+
return (_jsx("li", { "data-slot": "sidebar-menu-sub-item", "data-sidebar": "menu-sub-item", className: cn("group/menu-sub-item relative", className), ...props }));
|
|
205
|
+
}
|
|
206
|
+
function SidebarMenuSubButton({ asChild = false, render, nativeButton: _nativeButton, children, size = "md", isActive = false, className, ...props }) {
|
|
207
|
+
const { useSlot, slotChild } = resolveRender(asChild, render, children);
|
|
208
|
+
const Comp = useSlot ? Slot : "a";
|
|
209
|
+
return (_jsx(Comp, { "data-slot": "sidebar-menu-sub-button", "data-sidebar": "menu-sub-button", "data-size": size, "data-active": isActive ? "" : undefined, className: cn("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden group-data-[collapsible=icon]:hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-sm data-[size=sm]:text-xs data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground", className), ...props, children: slotChild }));
|
|
210
|
+
}
|
|
211
|
+
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar, };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../shadcn/lib/utils.js";
|
|
4
|
+
function Skeleton({ className, ...props }) {
|
|
5
|
+
return (_jsx("div", { "data-slot": "skeleton", className: cn("animate-pulse rounded-md bg-muted", className), ...props }));
|
|
6
|
+
}
|
|
7
|
+
export { Skeleton };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface SliderProps extends Omit<React.ComponentProps<"div">, "defaultValue" | "onChange"> {
|
|
3
|
+
value?: number[];
|
|
4
|
+
defaultValue?: number[];
|
|
5
|
+
onValueChange?: (value: number[]) => void;
|
|
6
|
+
min?: number;
|
|
7
|
+
max?: number;
|
|
8
|
+
step?: number;
|
|
9
|
+
orientation?: "horizontal" | "vertical";
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Self-contained slider with pointer drag and keyboard control. Supports one or
|
|
14
|
+
* more thumbs (the nearest thumb to the pointer is the one that moves). Track,
|
|
15
|
+
* range, and thumbs mirror the shadcn structure/classes.
|
|
16
|
+
*/
|
|
17
|
+
declare function Slider({ className, value, defaultValue, onValueChange, min, max, step, orientation, disabled, ...props }: SliderProps): React.JSX.Element;
|
|
18
|
+
export { Slider };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../shadcn/lib/utils.js";
|
|
5
|
+
import { useControllableState } from "./use-controllable-state.js";
|
|
6
|
+
const clamp = (v, lo, hi) => Math.min(hi, Math.max(lo, v));
|
|
7
|
+
/**
|
|
8
|
+
* Self-contained slider with pointer drag and keyboard control. Supports one or
|
|
9
|
+
* more thumbs (the nearest thumb to the pointer is the one that moves). Track,
|
|
10
|
+
* range, and thumbs mirror the shadcn structure/classes.
|
|
11
|
+
*/
|
|
12
|
+
function Slider({ className, value, defaultValue, onValueChange, min = 0, max = 100, step = 1, orientation = "horizontal", disabled = false, ...props }) {
|
|
13
|
+
const [values, setValues] = useControllableState({
|
|
14
|
+
value,
|
|
15
|
+
defaultValue: defaultValue ?? [min],
|
|
16
|
+
onChange: onValueChange,
|
|
17
|
+
});
|
|
18
|
+
const trackRef = React.useRef(null);
|
|
19
|
+
const activeThumb = React.useRef(0);
|
|
20
|
+
const vertical = orientation === "vertical";
|
|
21
|
+
const percent = (v) => ((v - min) / (max - min)) * 100;
|
|
22
|
+
const valueFromPointer = (clientX, clientY) => {
|
|
23
|
+
const track = trackRef.current;
|
|
24
|
+
if (!track)
|
|
25
|
+
return min;
|
|
26
|
+
const rect = track.getBoundingClientRect();
|
|
27
|
+
const ratio = vertical
|
|
28
|
+
? (rect.bottom - clientY) / rect.height
|
|
29
|
+
: (clientX - rect.left) / rect.width;
|
|
30
|
+
const raw = min + clamp(ratio, 0, 1) * (max - min);
|
|
31
|
+
return clamp(Math.round(raw / step) * step, min, max);
|
|
32
|
+
};
|
|
33
|
+
const updateThumb = (index, next) => {
|
|
34
|
+
setValues(values.map((v, i) => (i === index ? next : v)));
|
|
35
|
+
};
|
|
36
|
+
const nearestThumb = (v) => {
|
|
37
|
+
let best = 0;
|
|
38
|
+
let bestDist = Infinity;
|
|
39
|
+
values.forEach((tv, i) => {
|
|
40
|
+
const d = Math.abs(tv - v);
|
|
41
|
+
if (d < bestDist) {
|
|
42
|
+
bestDist = d;
|
|
43
|
+
best = i;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
return best;
|
|
47
|
+
};
|
|
48
|
+
const onPointerDown = (e) => {
|
|
49
|
+
if (disabled)
|
|
50
|
+
return;
|
|
51
|
+
const v = valueFromPointer(e.clientX, e.clientY);
|
|
52
|
+
const idx = nearestThumb(v);
|
|
53
|
+
activeThumb.current = idx;
|
|
54
|
+
updateThumb(idx, v);
|
|
55
|
+
const target = e.currentTarget;
|
|
56
|
+
target.setPointerCapture(e.pointerId);
|
|
57
|
+
const onMove = (ev) => {
|
|
58
|
+
updateThumb(activeThumb.current, valueFromPointer(ev.clientX, ev.clientY));
|
|
59
|
+
};
|
|
60
|
+
const onUp = (ev) => {
|
|
61
|
+
target.releasePointerCapture(ev.pointerId);
|
|
62
|
+
target.removeEventListener("pointermove", onMove);
|
|
63
|
+
target.removeEventListener("pointerup", onUp);
|
|
64
|
+
};
|
|
65
|
+
target.addEventListener("pointermove", onMove);
|
|
66
|
+
target.addEventListener("pointerup", onUp);
|
|
67
|
+
};
|
|
68
|
+
const onThumbKeyDown = (index) => (e) => {
|
|
69
|
+
if (disabled)
|
|
70
|
+
return;
|
|
71
|
+
let next = null;
|
|
72
|
+
const cur = values[index];
|
|
73
|
+
if (e.key === "ArrowRight" || e.key === "ArrowUp")
|
|
74
|
+
next = cur + step;
|
|
75
|
+
else if (e.key === "ArrowLeft" || e.key === "ArrowDown")
|
|
76
|
+
next = cur - step;
|
|
77
|
+
else if (e.key === "Home")
|
|
78
|
+
next = min;
|
|
79
|
+
else if (e.key === "End")
|
|
80
|
+
next = max;
|
|
81
|
+
if (next !== null) {
|
|
82
|
+
e.preventDefault();
|
|
83
|
+
updateThumb(index, clamp(next, min, max));
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
const rangeStart = values.length > 1 ? Math.min(...values.map(percent)) : 0;
|
|
87
|
+
const rangeEnd = Math.max(...values.map(percent));
|
|
88
|
+
return (_jsx("div", { "data-slot": "slider", "data-orientation": orientation, "data-disabled": disabled ? "" : undefined, className: cn("data-horizontal:w-full data-vertical:h-full", className), ...props, children: _jsxs("div", { "data-orientation": orientation, onPointerDown: onPointerDown, className: "relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col", children: [_jsx("div", { ref: trackRef, "data-slot": "slider-track", "data-orientation": orientation, className: "relative grow overflow-hidden rounded-full bg-muted select-none data-horizontal:h-1.5 data-horizontal:w-full data-vertical:h-full data-vertical:w-1.5", children: _jsx("div", { "data-slot": "slider-range", "data-orientation": orientation, className: "absolute bg-primary select-none data-horizontal:h-full data-vertical:w-full", style: vertical
|
|
89
|
+
? { bottom: `${rangeStart}%`, height: `${rangeEnd - rangeStart}%` }
|
|
90
|
+
: { left: `${rangeStart}%`, width: `${rangeEnd - rangeStart}%` } }) }), values.map((v, index) => (_jsx("span", { role: "slider", tabIndex: disabled ? -1 : 0, "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": v, "aria-orientation": orientation, "aria-disabled": disabled || undefined, "data-slot": "slider-thumb", onKeyDown: onThumbKeyDown(index), className: "absolute block size-4 shrink-0 -translate-x-1/2 cursor-pointer rounded-full border border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] select-none hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50 data-vertical:translate-x-0 data-vertical:-translate-y-1/2", "data-orientation": orientation, style: vertical
|
|
91
|
+
? { bottom: `${percent(v)}%` }
|
|
92
|
+
: { left: `${percent(v)}%` } }, index)))] }) }));
|
|
93
|
+
}
|
|
94
|
+
export { Slider };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Minimal `asChild` Slot — self-contained replacement for Radix Slot / Base UI's
|
|
4
|
+
* `render` prop. Merges this slot's props onto its single child element:
|
|
5
|
+
* `className` is class-merged, refs are composed, and the child's own props win
|
|
6
|
+
* on any other collision (the child is the concrete element).
|
|
7
|
+
*
|
|
8
|
+
* This is the only behavioral helper the self-contained `ui/` tier depends on;
|
|
9
|
+
* it carries no primitive framework. React 19 ref-as-prop, no forwardRef.
|
|
10
|
+
*/
|
|
11
|
+
declare function mergeRefs<T>(...refs: (React.Ref<T> | undefined)[]): (node: T | null) => void;
|
|
12
|
+
type SlotProps = React.HTMLAttributes<HTMLElement> & {
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
ref?: React.Ref<HTMLElement>;
|
|
15
|
+
};
|
|
16
|
+
declare function Slot({ children, className, style, ref, ...props }: SlotProps): React.ReactElement<Record<string, unknown>, string | React.JSXElementConstructor<any>>;
|
|
17
|
+
/**
|
|
18
|
+
* Base UI `render={<El/>}` compatibility. The old shadcn tier passed a React
|
|
19
|
+
* element to `render` to control the rendered element; here that maps onto the
|
|
20
|
+
* `asChild` + Slot mechanism. Returns whether to use the Slot and what child to
|
|
21
|
+
* render through it, so `render={<Button/>}` keeps working on the new components.
|
|
22
|
+
*/
|
|
23
|
+
declare function resolveRender(asChild: boolean | undefined, render: React.ReactElement | undefined, children: React.ReactNode): {
|
|
24
|
+
useSlot: boolean;
|
|
25
|
+
slotChild: React.ReactNode;
|
|
26
|
+
};
|
|
27
|
+
export { Slot, mergeRefs, resolveRender };
|
package/dist/ui/slot.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { cn } from "../shadcn/lib/utils.js";
|
|
3
|
+
/**
|
|
4
|
+
* Minimal `asChild` Slot — self-contained replacement for Radix Slot / Base UI's
|
|
5
|
+
* `render` prop. Merges this slot's props onto its single child element:
|
|
6
|
+
* `className` is class-merged, refs are composed, and the child's own props win
|
|
7
|
+
* on any other collision (the child is the concrete element).
|
|
8
|
+
*
|
|
9
|
+
* This is the only behavioral helper the self-contained `ui/` tier depends on;
|
|
10
|
+
* it carries no primitive framework. React 19 ref-as-prop, no forwardRef.
|
|
11
|
+
*/
|
|
12
|
+
function mergeRefs(...refs) {
|
|
13
|
+
return (node) => {
|
|
14
|
+
for (const ref of refs) {
|
|
15
|
+
if (typeof ref === "function")
|
|
16
|
+
ref(node);
|
|
17
|
+
else if (ref)
|
|
18
|
+
ref.current = node;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function Slot({ children, className, style, ref, ...props }) {
|
|
23
|
+
const child = React.Children.only(children);
|
|
24
|
+
const childProps = child.props;
|
|
25
|
+
// Child props win on plain values, but event handlers (on*) are COMPOSED so
|
|
26
|
+
// the slot-injected behavior (open/close/etc.) runs alongside the child's own
|
|
27
|
+
// handler — matching Radix Slot / Base UI mergeProps instead of clobbering it.
|
|
28
|
+
const merged = { ...props, ...childProps };
|
|
29
|
+
for (const key of Object.keys(props)) {
|
|
30
|
+
const slotHandler = props[key];
|
|
31
|
+
const childHandler = childProps[key];
|
|
32
|
+
if (key.startsWith("on") &&
|
|
33
|
+
typeof slotHandler === "function" &&
|
|
34
|
+
typeof childHandler === "function") {
|
|
35
|
+
merged[key] = (...args) => {
|
|
36
|
+
;
|
|
37
|
+
slotHandler(...args);
|
|
38
|
+
const event = args[0];
|
|
39
|
+
if (!event?.defaultPrevented) {
|
|
40
|
+
;
|
|
41
|
+
childHandler(...args);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
merged.className = cn(className, childProps.className);
|
|
47
|
+
merged.style = { ...style, ...childProps.style };
|
|
48
|
+
merged.ref = mergeRefs(childProps.ref, ref);
|
|
49
|
+
return React.cloneElement(child, merged);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Base UI `render={<El/>}` compatibility. The old shadcn tier passed a React
|
|
53
|
+
* element to `render` to control the rendered element; here that maps onto the
|
|
54
|
+
* `asChild` + Slot mechanism. Returns whether to use the Slot and what child to
|
|
55
|
+
* render through it, so `render={<Button/>}` keeps working on the new components.
|
|
56
|
+
*/
|
|
57
|
+
function resolveRender(asChild, render, children) {
|
|
58
|
+
if (React.isValidElement(render))
|
|
59
|
+
return { useSlot: true, slotChild: render };
|
|
60
|
+
return { useSlot: !!asChild, slotChild: children };
|
|
61
|
+
}
|
|
62
|
+
export { Slot, mergeRefs, resolveRender };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../shadcn/lib/utils.js";
|
|
4
|
+
import { Loader2Icon } from "../icons/index.js";
|
|
5
|
+
function Spinner({ className, ...props }) {
|
|
6
|
+
return (_jsx(Loader2Icon, { role: "status", "aria-label": "Loading", className: cn("size-4 animate-spin", className), ...props }));
|
|
7
|
+
}
|
|
8
|
+
export { Spinner };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface SwitchProps extends Omit<React.ComponentProps<"button">, "onChange" | "value"> {
|
|
3
|
+
size?: "sm" | "default";
|
|
4
|
+
checked?: boolean;
|
|
5
|
+
defaultChecked?: boolean;
|
|
6
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
7
|
+
/** When set, a hidden checkbox of this name mirrors the state for form posts. */
|
|
8
|
+
name?: string;
|
|
9
|
+
value?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Self-contained switch: a `role="switch"` button with controlled/uncontrolled
|
|
13
|
+
* checked state. Emits `data-checked`/`data-unchecked`/`data-disabled` so the
|
|
14
|
+
* shared classes apply. Pass `name` to include a hidden checkbox for forms.
|
|
15
|
+
*/
|
|
16
|
+
declare function Switch({ className, size, checked, defaultChecked, onCheckedChange, disabled, name, value, onClick, ...props }: SwitchProps): React.JSX.Element;
|
|
17
|
+
export { Switch };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../shadcn/lib/utils.js";
|
|
5
|
+
import { useControllableState } from "./use-controllable-state.js";
|
|
6
|
+
/**
|
|
7
|
+
* Self-contained switch: a `role="switch"` button with controlled/uncontrolled
|
|
8
|
+
* checked state. Emits `data-checked`/`data-unchecked`/`data-disabled` so the
|
|
9
|
+
* shared classes apply. Pass `name` to include a hidden checkbox for forms.
|
|
10
|
+
*/
|
|
11
|
+
function Switch({ className, size = "default", checked, defaultChecked = false, onCheckedChange, disabled, name, value = "on", onClick, ...props }) {
|
|
12
|
+
const [on, setOn] = useControllableState({
|
|
13
|
+
value: checked,
|
|
14
|
+
defaultValue: defaultChecked,
|
|
15
|
+
onChange: onCheckedChange,
|
|
16
|
+
});
|
|
17
|
+
return (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", role: "switch", "aria-checked": on, disabled: disabled, "data-slot": "switch", "data-size": size, "data-state": on ? "checked" : "unchecked", "data-checked": on ? "" : undefined, "data-unchecked": on ? undefined : "", "data-disabled": disabled ? "" : undefined, className: cn("cursor-pointer peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50", className), onClick: (e) => {
|
|
18
|
+
onClick?.(e);
|
|
19
|
+
if (!e.defaultPrevented)
|
|
20
|
+
setOn(!on);
|
|
21
|
+
}, ...props, children: _jsx("span", { "data-slot": "switch-thumb", "data-checked": on ? "" : undefined, "data-unchecked": on ? undefined : "", className: "pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground" }) }), name ? (_jsx("input", { type: "checkbox", "aria-hidden": true, tabIndex: -1, name: name, value: value, checked: on, disabled: disabled, readOnly: true, className: "sr-only" })) : null] }));
|
|
22
|
+
}
|
|
23
|
+
export { Switch };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare function Table({ className, ...props }: React.ComponentProps<"table">): React.JSX.Element;
|
|
3
|
+
declare function TableHeader({ className, ...props }: React.ComponentProps<"thead">): React.JSX.Element;
|
|
4
|
+
declare function TableBody({ className, ...props }: React.ComponentProps<"tbody">): React.JSX.Element;
|
|
5
|
+
declare function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">): React.JSX.Element;
|
|
6
|
+
declare function TableRow({ className, ...props }: React.ComponentProps<"tr">): React.JSX.Element;
|
|
7
|
+
declare function TableHead({ className, ...props }: React.ComponentProps<"th">): React.JSX.Element;
|
|
8
|
+
declare function TableCell({ className, ...props }: React.ComponentProps<"td">): React.JSX.Element;
|
|
9
|
+
declare function TableCaption({ className, ...props }: React.ComponentProps<"caption">): React.JSX.Element;
|
|
10
|
+
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, };
|
package/dist/ui/table.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../shadcn/lib/utils.js";
|
|
5
|
+
function Table({ className, ...props }) {
|
|
6
|
+
return (_jsx("div", { "data-slot": "table-container", className: "relative w-full overflow-x-auto", children: _jsx("table", { "data-slot": "table", className: cn("w-full caption-bottom text-sm", className), ...props }) }));
|
|
7
|
+
}
|
|
8
|
+
function TableHeader({ className, ...props }) {
|
|
9
|
+
return (_jsx("thead", { "data-slot": "table-header", className: cn("[&_tr]:border-b", className), ...props }));
|
|
10
|
+
}
|
|
11
|
+
function TableBody({ className, ...props }) {
|
|
12
|
+
return (_jsx("tbody", { "data-slot": "table-body", className: cn("[&_tr:last-child]:border-0", className), ...props }));
|
|
13
|
+
}
|
|
14
|
+
function TableFooter({ className, ...props }) {
|
|
15
|
+
return (_jsx("tfoot", { "data-slot": "table-footer", className: cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className), ...props }));
|
|
16
|
+
}
|
|
17
|
+
function TableRow({ className, ...props }) {
|
|
18
|
+
return (_jsx("tr", { "data-slot": "table-row", className: cn("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted", className), ...props }));
|
|
19
|
+
}
|
|
20
|
+
function TableHead({ className, ...props }) {
|
|
21
|
+
return (_jsx("th", { "data-slot": "table-head", className: cn("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0", className), ...props }));
|
|
22
|
+
}
|
|
23
|
+
function TableCell({ className, ...props }) {
|
|
24
|
+
return (_jsx("td", { "data-slot": "table-cell", className: cn("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0", className), ...props }));
|
|
25
|
+
}
|
|
26
|
+
function TableCaption({ className, ...props }) {
|
|
27
|
+
return (_jsx("caption", { "data-slot": "table-caption", className: cn("mt-4 text-sm text-muted-foreground", className), ...props }));
|
|
28
|
+
}
|
|
29
|
+
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "../shadcn/lib/cva.js";
|
|
3
|
+
export interface TabsProps extends Omit<React.ComponentProps<"div">, "onChange" | "defaultValue"> {
|
|
4
|
+
value?: string;
|
|
5
|
+
defaultValue?: string;
|
|
6
|
+
onValueChange?: (value: string) => void;
|
|
7
|
+
orientation?: "horizontal" | "vertical";
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Self-contained tabs. Controlled/uncontrolled active value; the list provides
|
|
11
|
+
* roving arrow-key navigation with automatic activation (WAI-ARIA tabs pattern).
|
|
12
|
+
*/
|
|
13
|
+
declare function Tabs({ className, value, defaultValue, onValueChange, orientation, ...props }: TabsProps): React.JSX.Element;
|
|
14
|
+
declare const tabsListVariants: (props?: import("../shadcn/lib/cva.js").CvaProps<{
|
|
15
|
+
variant: {
|
|
16
|
+
default: string;
|
|
17
|
+
line: string;
|
|
18
|
+
};
|
|
19
|
+
}> | undefined) => string;
|
|
20
|
+
declare function TabsList({ className, variant, onKeyDown, ...props }: React.ComponentProps<"div"> & VariantProps<typeof tabsListVariants>): React.JSX.Element;
|
|
21
|
+
export interface TabsTriggerProps extends Omit<React.ComponentProps<"button">, "value"> {
|
|
22
|
+
value: string;
|
|
23
|
+
}
|
|
24
|
+
declare function TabsTrigger({ className, value, onClick, ref, ...props }: TabsTriggerProps): React.JSX.Element;
|
|
25
|
+
export interface TabsContentProps extends Omit<React.ComponentProps<"div">, "value"> {
|
|
26
|
+
value: string;
|
|
27
|
+
}
|
|
28
|
+
declare function TabsContent({ className, value, ...props }: TabsContentProps): React.JSX.Element;
|
|
29
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants };
|