@stevederico/skateboard-ui 3.12.0 → 4.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/CHANGELOG.md +12 -0
- package/README.md +37 -31
- 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 +345 -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 +234 -0
- package/dist/ui/dropdown-menu.d.ts +61 -0
- package/dist/ui/dropdown-menu.js +323 -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 +384 -0
- package/dist/ui/navigation-menu.d.ts +24 -0
- package/dist/ui/navigation-menu.js +134 -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 +68 -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 +54 -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 +216 -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 +82 -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 +38 -0
- package/dist/ui/use-floating.js +128 -0
- package/dist/ui/use-presence.d.ts +8 -0
- package/dist/ui/use-presence.js +48 -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
|
@@ -1,313 +0,0 @@
|
|
|
1
|
-
/* @base-ui/react 1.5.0 — vendored (MIT — MUI Inc).
|
|
2
|
-
* Refresh: scripts/vendor-base-ui.js (see header for instructions).
|
|
3
|
-
* Do not edit by hand. */
|
|
4
|
-
import * as React$1 from 'react';
|
|
5
|
-
|
|
6
|
-
declare const none: "none";
|
|
7
|
-
declare const triggerPress: "trigger-press";
|
|
8
|
-
declare const triggerHover: "trigger-hover";
|
|
9
|
-
declare const triggerFocus: "trigger-focus";
|
|
10
|
-
declare const outsidePress: "outside-press";
|
|
11
|
-
declare const itemPress: "item-press";
|
|
12
|
-
declare const closePress: "close-press";
|
|
13
|
-
declare const linkPress: "link-press";
|
|
14
|
-
declare const clearPress: "clear-press";
|
|
15
|
-
declare const chipRemovePress: "chip-remove-press";
|
|
16
|
-
declare const trackPress: "track-press";
|
|
17
|
-
declare const incrementPress: "increment-press";
|
|
18
|
-
declare const decrementPress: "decrement-press";
|
|
19
|
-
declare const inputChange: "input-change";
|
|
20
|
-
declare const inputClear: "input-clear";
|
|
21
|
-
declare const inputBlur: "input-blur";
|
|
22
|
-
declare const inputPaste: "input-paste";
|
|
23
|
-
declare const inputPress: "input-press";
|
|
24
|
-
declare const focusOut: "focus-out";
|
|
25
|
-
declare const escapeKey: "escape-key";
|
|
26
|
-
declare const closeWatcher: "close-watcher";
|
|
27
|
-
declare const listNavigation: "list-navigation";
|
|
28
|
-
declare const keyboard: "keyboard";
|
|
29
|
-
declare const pointer: "pointer";
|
|
30
|
-
declare const drag: "drag";
|
|
31
|
-
declare const wheel: "wheel";
|
|
32
|
-
declare const scrub: "scrub";
|
|
33
|
-
declare const cancelOpen: "cancel-open";
|
|
34
|
-
declare const siblingOpen: "sibling-open";
|
|
35
|
-
declare const disabled: "disabled";
|
|
36
|
-
declare const missing: "missing";
|
|
37
|
-
declare const initial: "initial";
|
|
38
|
-
declare const imperativeAction: "imperative-action";
|
|
39
|
-
declare const swipe: "swipe";
|
|
40
|
-
declare const windowResize: "window-resize";
|
|
41
|
-
export interface ReasonToEventMap {
|
|
42
|
-
[none]: Event;
|
|
43
|
-
[triggerPress]: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent;
|
|
44
|
-
[triggerHover]: MouseEvent;
|
|
45
|
-
[triggerFocus]: FocusEvent;
|
|
46
|
-
[outsidePress]: MouseEvent | PointerEvent | TouchEvent;
|
|
47
|
-
[itemPress]: MouseEvent | KeyboardEvent | PointerEvent;
|
|
48
|
-
[closePress]: MouseEvent | KeyboardEvent | PointerEvent;
|
|
49
|
-
[linkPress]: MouseEvent | PointerEvent;
|
|
50
|
-
[clearPress]: PointerEvent | MouseEvent | KeyboardEvent;
|
|
51
|
-
[chipRemovePress]: PointerEvent | MouseEvent | KeyboardEvent;
|
|
52
|
-
[trackPress]: PointerEvent | MouseEvent | TouchEvent;
|
|
53
|
-
[incrementPress]: PointerEvent | MouseEvent | TouchEvent;
|
|
54
|
-
[decrementPress]: PointerEvent | MouseEvent | TouchEvent;
|
|
55
|
-
[inputChange]: InputEvent | Event;
|
|
56
|
-
[inputClear]: InputEvent | FocusEvent | Event;
|
|
57
|
-
[inputBlur]: FocusEvent;
|
|
58
|
-
[inputPaste]: ClipboardEvent;
|
|
59
|
-
[inputPress]: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent;
|
|
60
|
-
[focusOut]: FocusEvent | KeyboardEvent;
|
|
61
|
-
[escapeKey]: KeyboardEvent;
|
|
62
|
-
[closeWatcher]: Event;
|
|
63
|
-
[listNavigation]: KeyboardEvent;
|
|
64
|
-
[keyboard]: KeyboardEvent;
|
|
65
|
-
[pointer]: PointerEvent;
|
|
66
|
-
[drag]: PointerEvent | TouchEvent;
|
|
67
|
-
[swipe]: PointerEvent | TouchEvent;
|
|
68
|
-
[wheel]: WheelEvent;
|
|
69
|
-
[scrub]: PointerEvent;
|
|
70
|
-
[cancelOpen]: MouseEvent;
|
|
71
|
-
[siblingOpen]: Event;
|
|
72
|
-
[disabled]: Event;
|
|
73
|
-
[missing]: Event;
|
|
74
|
-
[initial]: Event;
|
|
75
|
-
[imperativeAction]: Event;
|
|
76
|
-
[windowResize]: UIEvent;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Maps a change `reason` string to the corresponding native event type.
|
|
80
|
-
*/
|
|
81
|
-
export type ReasonToEvent<Reason extends string> = Reason extends keyof ReasonToEventMap ? ReasonToEventMap[Reason] : Event;
|
|
82
|
-
export type BaseUIChangeEventDetail<Reason extends string, CustomProperties extends object> = {
|
|
83
|
-
/**
|
|
84
|
-
* The reason for the event.
|
|
85
|
-
*/
|
|
86
|
-
reason: Reason;
|
|
87
|
-
/**
|
|
88
|
-
* The native event associated with the custom event.
|
|
89
|
-
*/
|
|
90
|
-
event: ReasonToEvent<Reason>;
|
|
91
|
-
/**
|
|
92
|
-
* Cancels Base UI from handling the event.
|
|
93
|
-
*/
|
|
94
|
-
cancel: () => void;
|
|
95
|
-
/**
|
|
96
|
-
* Allows the event to propagate in cases where Base UI will stop the propagation.
|
|
97
|
-
*/
|
|
98
|
-
allowPropagation: () => void;
|
|
99
|
-
/**
|
|
100
|
-
* Indicates whether the event has been canceled.
|
|
101
|
-
*/
|
|
102
|
-
isCanceled: boolean;
|
|
103
|
-
/**
|
|
104
|
-
* Indicates whether the event is allowed to propagate.
|
|
105
|
-
*/
|
|
106
|
-
isPropagationAllowed: boolean;
|
|
107
|
-
/**
|
|
108
|
-
* The element that triggered the event, if applicable.
|
|
109
|
-
*/
|
|
110
|
-
trigger: Element | undefined;
|
|
111
|
-
} & CustomProperties;
|
|
112
|
-
/**
|
|
113
|
-
* Details of custom change events emitted by Base UI components.
|
|
114
|
-
*/
|
|
115
|
-
export type BaseUIChangeEventDetails<Reason extends string, CustomProperties extends object = {}> = Reason extends string ? BaseUIChangeEventDetail<Reason, CustomProperties> & {} : never;
|
|
116
|
-
export type HTMLProps<T = any> = React$1.HTMLAttributes<T> & {
|
|
117
|
-
ref?: React$1.Ref<T> | undefined;
|
|
118
|
-
};
|
|
119
|
-
/**
|
|
120
|
-
* Shape of the render prop: a function that takes props to be spread on the element and component's state and returns a React element.
|
|
121
|
-
*
|
|
122
|
-
* @template Props Props to be spread on the rendered element.
|
|
123
|
-
* @template State Component's internal state.
|
|
124
|
-
*/
|
|
125
|
-
export type ComponentRenderFn<Props, State> = (props: Props, state: State) => React$1.ReactElement<unknown>;
|
|
126
|
-
export type BaseUIEvent<E extends React$1.SyntheticEvent<Element, Event>> = E & {
|
|
127
|
-
preventBaseUIHandler: () => void;
|
|
128
|
-
readonly baseUIHandlerPrevented?: boolean | undefined;
|
|
129
|
-
};
|
|
130
|
-
export type WithPreventBaseUIHandler<T> = T extends ((event: infer E) => any) ? E extends React$1.SyntheticEvent<Element, Event> ? (event: BaseUIEvent<E>) => ReturnType<T> : T : T extends undefined ? undefined : T;
|
|
131
|
-
/**
|
|
132
|
-
* Adds a `preventBaseUIHandler` method to all event handlers.
|
|
133
|
-
*/
|
|
134
|
-
export type WithBaseUIEvent<T> = {
|
|
135
|
-
[K in keyof T]: WithPreventBaseUIHandler<T[K]>;
|
|
136
|
-
};
|
|
137
|
-
/**
|
|
138
|
-
* Props shared by all Base UI components.
|
|
139
|
-
* Contains `className` (string or callback taking the component's state as an argument) and `render` (function to customize rendering).
|
|
140
|
-
*/
|
|
141
|
-
export type BaseUIComponentProps<ElementType extends React$1.ElementType, State, RenderFunctionProps = HTMLProps> = Omit<WithBaseUIEvent<React$1.ComponentPropsWithRef<ElementType>>, "className" | "color" | "defaultValue" | "defaultChecked" | "style"> & {
|
|
142
|
-
/**
|
|
143
|
-
* CSS class applied to the element, or a function that
|
|
144
|
-
* returns a class based on the component's state.
|
|
145
|
-
*/
|
|
146
|
-
className?: string | ((state: State) => string | undefined) | undefined;
|
|
147
|
-
/**
|
|
148
|
-
* Allows you to replace the component's HTML element
|
|
149
|
-
* with a different tag, or compose it with another component.
|
|
150
|
-
*
|
|
151
|
-
* Accepts a `ReactElement` or a function that returns the element to render.
|
|
152
|
-
*/
|
|
153
|
-
render?: React$1.ReactElement | ComponentRenderFn<RenderFunctionProps, State> | undefined;
|
|
154
|
-
/**
|
|
155
|
-
* Style applied to the element, or a function that
|
|
156
|
-
* returns a style object based on the component's state.
|
|
157
|
-
*/
|
|
158
|
-
style?: React$1.CSSProperties | ((state: State) => React$1.CSSProperties | undefined) | undefined;
|
|
159
|
-
};
|
|
160
|
-
export interface NonNativeButtonProps {
|
|
161
|
-
/**
|
|
162
|
-
* Whether the component renders a native `<button>` element when replacing it
|
|
163
|
-
* via the `render` prop.
|
|
164
|
-
* Set to `true` if the rendered element is a native button.
|
|
165
|
-
* @default false
|
|
166
|
-
*/
|
|
167
|
-
nativeButton?: boolean | undefined;
|
|
168
|
-
}
|
|
169
|
-
export interface FieldRootState {
|
|
170
|
-
/**
|
|
171
|
-
* Whether the component should ignore user interaction.
|
|
172
|
-
*/
|
|
173
|
-
disabled: boolean;
|
|
174
|
-
/**
|
|
175
|
-
* Whether the field has been touched.
|
|
176
|
-
*/
|
|
177
|
-
touched: boolean;
|
|
178
|
-
/**
|
|
179
|
-
* Whether the field value has changed from its initial value.
|
|
180
|
-
*/
|
|
181
|
-
dirty: boolean;
|
|
182
|
-
/**
|
|
183
|
-
* Whether the field is valid.
|
|
184
|
-
*/
|
|
185
|
-
valid: boolean | null;
|
|
186
|
-
/**
|
|
187
|
-
* Whether the field has a value.
|
|
188
|
-
*/
|
|
189
|
-
filled: boolean;
|
|
190
|
-
/**
|
|
191
|
-
* Whether the field is focused.
|
|
192
|
-
*/
|
|
193
|
-
focused: boolean;
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Represents the switch itself.
|
|
197
|
-
* Renders a `<span>` element and a hidden `<input>` beside.
|
|
198
|
-
*
|
|
199
|
-
* Documentation: [Base UI Switch](https://base-ui.com/react/components/switch)
|
|
200
|
-
*/
|
|
201
|
-
export declare const SwitchRoot: React$1.ForwardRefExoticComponent<Omit<SwitchRootProps, "ref"> & React$1.RefAttributes<HTMLElement>>;
|
|
202
|
-
export interface SwitchRootState extends FieldRootState {
|
|
203
|
-
/**
|
|
204
|
-
* Whether the switch is currently active.
|
|
205
|
-
*/
|
|
206
|
-
checked: boolean;
|
|
207
|
-
/**
|
|
208
|
-
* Whether the component should ignore user interaction.
|
|
209
|
-
*/
|
|
210
|
-
disabled: boolean;
|
|
211
|
-
/**
|
|
212
|
-
* Whether the user should be unable to activate or deactivate the switch.
|
|
213
|
-
*/
|
|
214
|
-
readOnly: boolean;
|
|
215
|
-
/**
|
|
216
|
-
* Whether the user must activate the switch before submitting a form.
|
|
217
|
-
*/
|
|
218
|
-
required: boolean;
|
|
219
|
-
}
|
|
220
|
-
export interface SwitchRootProps extends NonNativeButtonProps, Omit<BaseUIComponentProps<"span", SwitchRootState>, "onChange"> {
|
|
221
|
-
/**
|
|
222
|
-
* The id of the switch element.
|
|
223
|
-
*/
|
|
224
|
-
id?: string | undefined;
|
|
225
|
-
/**
|
|
226
|
-
* Whether the switch is currently active.
|
|
227
|
-
*
|
|
228
|
-
* To render an uncontrolled switch, use the `defaultChecked` prop instead.
|
|
229
|
-
*/
|
|
230
|
-
checked?: boolean | undefined;
|
|
231
|
-
/**
|
|
232
|
-
* Whether the switch is initially active.
|
|
233
|
-
*
|
|
234
|
-
* To render a controlled switch, use the `checked` prop instead.
|
|
235
|
-
* @default false
|
|
236
|
-
*/
|
|
237
|
-
defaultChecked?: boolean | undefined;
|
|
238
|
-
/**
|
|
239
|
-
* Whether the component should ignore user interaction.
|
|
240
|
-
* @default false
|
|
241
|
-
*/
|
|
242
|
-
disabled?: boolean | undefined;
|
|
243
|
-
/**
|
|
244
|
-
* A ref to access the hidden `<input>` element.
|
|
245
|
-
*/
|
|
246
|
-
inputRef?: React$1.Ref<HTMLInputElement> | undefined;
|
|
247
|
-
/**
|
|
248
|
-
* Identifies the field when a form is submitted.
|
|
249
|
-
*/
|
|
250
|
-
name?: string | undefined;
|
|
251
|
-
/**
|
|
252
|
-
* Identifies the form that owns the hidden input.
|
|
253
|
-
* Useful when the switch is rendered outside the form.
|
|
254
|
-
*/
|
|
255
|
-
form?: string | undefined;
|
|
256
|
-
/**
|
|
257
|
-
* Event handler called when the switch is activated or deactivated.
|
|
258
|
-
*/
|
|
259
|
-
onCheckedChange?: ((checked: boolean, eventDetails: SwitchRoot.ChangeEventDetails) => void) | undefined;
|
|
260
|
-
/**
|
|
261
|
-
* Whether the user should be unable to activate or deactivate the switch.
|
|
262
|
-
* @default false
|
|
263
|
-
*/
|
|
264
|
-
readOnly?: boolean | undefined;
|
|
265
|
-
/**
|
|
266
|
-
* Whether the user must activate the switch before submitting a form.
|
|
267
|
-
* @default false
|
|
268
|
-
*/
|
|
269
|
-
required?: boolean | undefined;
|
|
270
|
-
/**
|
|
271
|
-
* The value submitted with the form when the switch is on.
|
|
272
|
-
* By default, switch submits the "on" value, matching native checkbox behavior.
|
|
273
|
-
*/
|
|
274
|
-
value?: string | undefined;
|
|
275
|
-
/**
|
|
276
|
-
* The value submitted with the form when the switch is off.
|
|
277
|
-
* By default, unchecked switches do not submit any value, matching native checkbox behavior.
|
|
278
|
-
*/
|
|
279
|
-
uncheckedValue?: string | undefined;
|
|
280
|
-
}
|
|
281
|
-
export type SwitchRootChangeEventReason = typeof none;
|
|
282
|
-
export type SwitchRootChangeEventDetails = BaseUIChangeEventDetails<SwitchRoot.ChangeEventReason>;
|
|
283
|
-
export declare namespace SwitchRoot {
|
|
284
|
-
type State = SwitchRootState;
|
|
285
|
-
type Props = SwitchRootProps;
|
|
286
|
-
type ChangeEventReason = SwitchRootChangeEventReason;
|
|
287
|
-
type ChangeEventDetails = SwitchRootChangeEventDetails;
|
|
288
|
-
}
|
|
289
|
-
/**
|
|
290
|
-
* The movable part of the switch that indicates whether the switch is on or off.
|
|
291
|
-
* Renders a `<span>`.
|
|
292
|
-
*
|
|
293
|
-
* Documentation: [Base UI Switch](https://base-ui.com/react/components/switch)
|
|
294
|
-
*/
|
|
295
|
-
export declare const SwitchThumb: React$1.ForwardRefExoticComponent<Omit<SwitchThumbProps, "ref"> & React$1.RefAttributes<HTMLSpanElement>>;
|
|
296
|
-
export interface SwitchThumbProps extends BaseUIComponentProps<"span", SwitchThumbState> {
|
|
297
|
-
}
|
|
298
|
-
export interface SwitchThumbState extends SwitchRootState {
|
|
299
|
-
}
|
|
300
|
-
export declare namespace SwitchThumb {
|
|
301
|
-
type Props = SwitchThumbProps;
|
|
302
|
-
type State = SwitchThumbState;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
declare namespace Switch {
|
|
306
|
-
export { SwitchRoot as Root, SwitchThumb as Thumb };
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
export {
|
|
310
|
-
Switch,
|
|
311
|
-
};
|
|
312
|
-
|
|
313
|
-
export {};
|
|
@@ -1,326 +0,0 @@
|
|
|
1
|
-
/* @base-ui/react 1.5.0 — vendored (MIT — MUI Inc).
|
|
2
|
-
* Refresh: scripts/vendor-base-ui.js (see header for instructions).
|
|
3
|
-
* Do not edit by hand. */
|
|
4
|
-
import {
|
|
5
|
-
useLabelableId
|
|
6
|
-
} from "./_chunk-23rx7haq.js";
|
|
7
|
-
import {
|
|
8
|
-
useAriaLabelledBy
|
|
9
|
-
} from "./_chunk-vg16xxmb.js";
|
|
10
|
-
import {
|
|
11
|
-
useFormContext,
|
|
12
|
-
useRegisterFieldControl
|
|
13
|
-
} from "./_chunk-95tf2rxq.js";
|
|
14
|
-
import {
|
|
15
|
-
fieldValidityMapping,
|
|
16
|
-
useFieldRootContext,
|
|
17
|
-
useLabelableContext
|
|
18
|
-
} from "./_chunk-8ctgmf06.js";
|
|
19
|
-
import"./_chunk-dzvjwv25.js";
|
|
20
|
-
import {
|
|
21
|
-
useControlled
|
|
22
|
-
} from "./_chunk-9x63vfqj.js";
|
|
23
|
-
import {
|
|
24
|
-
useValueChanged
|
|
25
|
-
} from "./_chunk-s5pwkz8v.js";
|
|
26
|
-
import {
|
|
27
|
-
visuallyHidden,
|
|
28
|
-
visuallyHiddenInput
|
|
29
|
-
} from "./_chunk-dan0mva4.js";
|
|
30
|
-
import"./_chunk-x11e1k9r.js";
|
|
31
|
-
import"./_chunk-451nqgsa.js";
|
|
32
|
-
import {
|
|
33
|
-
createChangeEventDetails,
|
|
34
|
-
exports_reason_parts
|
|
35
|
-
} from "./_chunk-e56mpvk1.js";
|
|
36
|
-
import {
|
|
37
|
-
useBaseUiId
|
|
38
|
-
} from "./_chunk-wdqynnjf.js";
|
|
39
|
-
import {
|
|
40
|
-
useButton
|
|
41
|
-
} from "./_chunk-5xmdvndx.js";
|
|
42
|
-
import"./_chunk-hm5h9vsk.js";
|
|
43
|
-
import"./_chunk-cdgfsr3q.js";
|
|
44
|
-
import {
|
|
45
|
-
getWindow
|
|
46
|
-
} from "./_chunk-000kmre8.js";
|
|
47
|
-
import"./_chunk-cwvtvwc7.js";
|
|
48
|
-
import {
|
|
49
|
-
useIsoLayoutEffect
|
|
50
|
-
} from "./_chunk-5tze5c8q.js";
|
|
51
|
-
import {
|
|
52
|
-
EMPTY_OBJECT,
|
|
53
|
-
useMergedRefs,
|
|
54
|
-
useRenderElement
|
|
55
|
-
} from "./_chunk-x8xehj6d.js";
|
|
56
|
-
import {
|
|
57
|
-
__export,
|
|
58
|
-
mergeProps
|
|
59
|
-
} from "./_chunk-svxv97ph.js";
|
|
60
|
-
|
|
61
|
-
// node_modules/@base-ui/react/esm/switch/index.parts.js
|
|
62
|
-
var exports_index_parts = {};
|
|
63
|
-
__export(exports_index_parts, {
|
|
64
|
-
Thumb: () => SwitchThumb,
|
|
65
|
-
Root: () => SwitchRoot
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
// node_modules/@base-ui/react/esm/switch/root/SwitchRoot.js
|
|
69
|
-
import * as React2 from "react";
|
|
70
|
-
|
|
71
|
-
// node_modules/@base-ui/react/esm/switch/root/SwitchRootContext.js
|
|
72
|
-
import * as React from "react";
|
|
73
|
-
"use client";
|
|
74
|
-
var SwitchRootContext = /* @__PURE__ */ React.createContext(undefined);
|
|
75
|
-
if (true)
|
|
76
|
-
SwitchRootContext.displayName = "SwitchRootContext";
|
|
77
|
-
function useSwitchRootContext() {
|
|
78
|
-
const context = React.useContext(SwitchRootContext);
|
|
79
|
-
if (context === undefined) {
|
|
80
|
-
throw new Error("Base UI: SwitchRootContext is missing. Switch parts must be placed within <Switch.Root>.");
|
|
81
|
-
}
|
|
82
|
-
return context;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// node_modules/@base-ui/react/esm/switch/root/SwitchRootDataAttributes.js
|
|
86
|
-
var SwitchRootDataAttributes = /* @__PURE__ */ function(SwitchRootDataAttributes2) {
|
|
87
|
-
SwitchRootDataAttributes2["checked"] = "data-checked";
|
|
88
|
-
SwitchRootDataAttributes2["unchecked"] = "data-unchecked";
|
|
89
|
-
SwitchRootDataAttributes2["disabled"] = "data-disabled";
|
|
90
|
-
SwitchRootDataAttributes2["readonly"] = "data-readonly";
|
|
91
|
-
SwitchRootDataAttributes2["required"] = "data-required";
|
|
92
|
-
SwitchRootDataAttributes2["valid"] = "data-valid";
|
|
93
|
-
SwitchRootDataAttributes2["invalid"] = "data-invalid";
|
|
94
|
-
SwitchRootDataAttributes2["touched"] = "data-touched";
|
|
95
|
-
SwitchRootDataAttributes2["dirty"] = "data-dirty";
|
|
96
|
-
SwitchRootDataAttributes2["filled"] = "data-filled";
|
|
97
|
-
SwitchRootDataAttributes2["focused"] = "data-focused";
|
|
98
|
-
return SwitchRootDataAttributes2;
|
|
99
|
-
}({});
|
|
100
|
-
|
|
101
|
-
// node_modules/@base-ui/react/esm/switch/stateAttributesMapping.js
|
|
102
|
-
var stateAttributesMapping = {
|
|
103
|
-
...fieldValidityMapping,
|
|
104
|
-
checked(value) {
|
|
105
|
-
if (value) {
|
|
106
|
-
return {
|
|
107
|
-
[SwitchRootDataAttributes.checked]: ""
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
return {
|
|
111
|
-
[SwitchRootDataAttributes.unchecked]: ""
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
// node_modules/@base-ui/react/esm/switch/root/SwitchRoot.js
|
|
117
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
118
|
-
"use client";
|
|
119
|
-
var SwitchRoot = /* @__PURE__ */ React2.forwardRef(function SwitchRoot2(componentProps, forwardedRef) {
|
|
120
|
-
const {
|
|
121
|
-
checked: checkedProp,
|
|
122
|
-
className,
|
|
123
|
-
defaultChecked,
|
|
124
|
-
"aria-labelledby": ariaLabelledByProp,
|
|
125
|
-
form,
|
|
126
|
-
id: idProp,
|
|
127
|
-
inputRef: externalInputRef,
|
|
128
|
-
name: nameProp,
|
|
129
|
-
nativeButton = false,
|
|
130
|
-
onCheckedChange,
|
|
131
|
-
readOnly = false,
|
|
132
|
-
required = false,
|
|
133
|
-
disabled: disabledProp = false,
|
|
134
|
-
render,
|
|
135
|
-
uncheckedValue,
|
|
136
|
-
value,
|
|
137
|
-
style,
|
|
138
|
-
...elementProps
|
|
139
|
-
} = componentProps;
|
|
140
|
-
const {
|
|
141
|
-
clearErrors
|
|
142
|
-
} = useFormContext();
|
|
143
|
-
const {
|
|
144
|
-
state: fieldState,
|
|
145
|
-
setTouched,
|
|
146
|
-
setDirty,
|
|
147
|
-
validityData,
|
|
148
|
-
setFilled,
|
|
149
|
-
setFocused,
|
|
150
|
-
shouldValidateOnChange,
|
|
151
|
-
validationMode,
|
|
152
|
-
disabled: fieldDisabled,
|
|
153
|
-
name: fieldName,
|
|
154
|
-
validation
|
|
155
|
-
} = useFieldRootContext();
|
|
156
|
-
const {
|
|
157
|
-
labelId
|
|
158
|
-
} = useLabelableContext();
|
|
159
|
-
const disabled = fieldDisabled || disabledProp;
|
|
160
|
-
const name = fieldName ?? nameProp;
|
|
161
|
-
const inputRef = React2.useRef(null);
|
|
162
|
-
const handleInputRef = useMergedRefs(inputRef, externalInputRef, validation.inputRef);
|
|
163
|
-
const switchRef = React2.useRef(null);
|
|
164
|
-
const id = useBaseUiId();
|
|
165
|
-
const controlId = useLabelableId({
|
|
166
|
-
id: idProp,
|
|
167
|
-
implicit: false,
|
|
168
|
-
controlRef: switchRef
|
|
169
|
-
});
|
|
170
|
-
const hiddenInputId = nativeButton ? undefined : controlId;
|
|
171
|
-
const [checked, setCheckedState] = useControlled({
|
|
172
|
-
controlled: checkedProp,
|
|
173
|
-
default: Boolean(defaultChecked),
|
|
174
|
-
name: "Switch",
|
|
175
|
-
state: "checked"
|
|
176
|
-
});
|
|
177
|
-
useRegisterFieldControl(switchRef, id, checked);
|
|
178
|
-
useIsoLayoutEffect(() => {
|
|
179
|
-
if (inputRef.current) {
|
|
180
|
-
setFilled(inputRef.current.checked);
|
|
181
|
-
}
|
|
182
|
-
}, [inputRef, setFilled]);
|
|
183
|
-
useValueChanged(checked, () => {
|
|
184
|
-
clearErrors(name);
|
|
185
|
-
setDirty(checked !== validityData.initialValue);
|
|
186
|
-
setFilled(checked);
|
|
187
|
-
if (shouldValidateOnChange()) {
|
|
188
|
-
validation.commit(checked);
|
|
189
|
-
} else {
|
|
190
|
-
validation.commit(checked, true);
|
|
191
|
-
}
|
|
192
|
-
});
|
|
193
|
-
const {
|
|
194
|
-
getButtonProps,
|
|
195
|
-
buttonRef
|
|
196
|
-
} = useButton({
|
|
197
|
-
disabled,
|
|
198
|
-
native: nativeButton
|
|
199
|
-
});
|
|
200
|
-
const ariaLabelledBy = useAriaLabelledBy(ariaLabelledByProp, labelId, inputRef, !nativeButton, hiddenInputId);
|
|
201
|
-
const rootProps = {
|
|
202
|
-
id: nativeButton ? controlId : id,
|
|
203
|
-
role: "switch",
|
|
204
|
-
"aria-checked": checked,
|
|
205
|
-
"aria-readonly": readOnly || undefined,
|
|
206
|
-
"aria-required": required || undefined,
|
|
207
|
-
"aria-labelledby": ariaLabelledBy,
|
|
208
|
-
onFocus() {
|
|
209
|
-
if (!disabled) {
|
|
210
|
-
setFocused(true);
|
|
211
|
-
}
|
|
212
|
-
},
|
|
213
|
-
onBlur() {
|
|
214
|
-
const element2 = inputRef.current;
|
|
215
|
-
if (!element2 || disabled) {
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
setTouched(true);
|
|
219
|
-
setFocused(false);
|
|
220
|
-
if (validationMode === "onBlur") {
|
|
221
|
-
validation.commit(element2.checked);
|
|
222
|
-
}
|
|
223
|
-
},
|
|
224
|
-
onClick(event) {
|
|
225
|
-
if (readOnly || disabled) {
|
|
226
|
-
return;
|
|
227
|
-
}
|
|
228
|
-
event.preventDefault();
|
|
229
|
-
const input = inputRef.current;
|
|
230
|
-
if (!input) {
|
|
231
|
-
return;
|
|
232
|
-
}
|
|
233
|
-
input.dispatchEvent(new (getWindow(input)).PointerEvent("click", {
|
|
234
|
-
bubbles: true,
|
|
235
|
-
shiftKey: event.shiftKey,
|
|
236
|
-
ctrlKey: event.ctrlKey,
|
|
237
|
-
altKey: event.altKey,
|
|
238
|
-
metaKey: event.metaKey
|
|
239
|
-
}));
|
|
240
|
-
}
|
|
241
|
-
};
|
|
242
|
-
const inputProps = mergeProps({
|
|
243
|
-
checked,
|
|
244
|
-
disabled,
|
|
245
|
-
form,
|
|
246
|
-
id: hiddenInputId,
|
|
247
|
-
name,
|
|
248
|
-
required,
|
|
249
|
-
style: name ? visuallyHiddenInput : visuallyHidden,
|
|
250
|
-
tabIndex: -1,
|
|
251
|
-
type: "checkbox",
|
|
252
|
-
"aria-hidden": true,
|
|
253
|
-
ref: handleInputRef,
|
|
254
|
-
onChange(event) {
|
|
255
|
-
if (event.nativeEvent.defaultPrevented) {
|
|
256
|
-
return;
|
|
257
|
-
}
|
|
258
|
-
if (readOnly) {
|
|
259
|
-
event.preventDefault();
|
|
260
|
-
return;
|
|
261
|
-
}
|
|
262
|
-
const nextChecked = event.currentTarget.checked;
|
|
263
|
-
const eventDetails = createChangeEventDetails(exports_reason_parts.none, event.nativeEvent);
|
|
264
|
-
onCheckedChange?.(nextChecked, eventDetails);
|
|
265
|
-
if (eventDetails.isCanceled) {
|
|
266
|
-
return;
|
|
267
|
-
}
|
|
268
|
-
setCheckedState(nextChecked);
|
|
269
|
-
},
|
|
270
|
-
onFocus() {
|
|
271
|
-
switchRef.current?.focus();
|
|
272
|
-
}
|
|
273
|
-
}, validation.getInputValidationProps, value !== undefined ? {
|
|
274
|
-
value
|
|
275
|
-
} : EMPTY_OBJECT);
|
|
276
|
-
const state = React2.useMemo(() => ({
|
|
277
|
-
...fieldState,
|
|
278
|
-
checked,
|
|
279
|
-
disabled,
|
|
280
|
-
readOnly,
|
|
281
|
-
required
|
|
282
|
-
}), [fieldState, checked, disabled, readOnly, required]);
|
|
283
|
-
const element = useRenderElement("span", componentProps, {
|
|
284
|
-
state,
|
|
285
|
-
ref: [forwardedRef, switchRef, buttonRef],
|
|
286
|
-
props: [rootProps, validation.getValidationProps, elementProps, getButtonProps],
|
|
287
|
-
stateAttributesMapping
|
|
288
|
-
});
|
|
289
|
-
return /* @__PURE__ */ _jsxs(SwitchRootContext.Provider, {
|
|
290
|
-
value: state,
|
|
291
|
-
children: [element, !checked && name && uncheckedValue !== undefined && /* @__PURE__ */ _jsx("input", {
|
|
292
|
-
type: "hidden",
|
|
293
|
-
form,
|
|
294
|
-
name,
|
|
295
|
-
value: uncheckedValue
|
|
296
|
-
}), /* @__PURE__ */ _jsx("input", {
|
|
297
|
-
...inputProps,
|
|
298
|
-
suppressHydrationWarning: true
|
|
299
|
-
})]
|
|
300
|
-
});
|
|
301
|
-
});
|
|
302
|
-
if (true)
|
|
303
|
-
SwitchRoot.displayName = "SwitchRoot";
|
|
304
|
-
// node_modules/@base-ui/react/esm/switch/thumb/SwitchThumb.js
|
|
305
|
-
import * as React3 from "react";
|
|
306
|
-
"use client";
|
|
307
|
-
var SwitchThumb = /* @__PURE__ */ React3.forwardRef(function SwitchThumb2(componentProps, forwardedRef) {
|
|
308
|
-
const {
|
|
309
|
-
render,
|
|
310
|
-
className,
|
|
311
|
-
style,
|
|
312
|
-
...elementProps
|
|
313
|
-
} = componentProps;
|
|
314
|
-
const state = useSwitchRootContext();
|
|
315
|
-
return useRenderElement("span", componentProps, {
|
|
316
|
-
state,
|
|
317
|
-
ref: forwardedRef,
|
|
318
|
-
stateAttributesMapping,
|
|
319
|
-
props: elementProps
|
|
320
|
-
});
|
|
321
|
-
});
|
|
322
|
-
if (true)
|
|
323
|
-
SwitchThumb.displayName = "SwitchThumb";
|
|
324
|
-
export {
|
|
325
|
-
exports_index_parts as Switch
|
|
326
|
-
};
|