@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,54 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getNextTabbable,
|
|
3
|
-
getTabbableAfterElement,
|
|
4
|
-
getTabbableBeforeElement,
|
|
5
|
-
isOutsideEvent
|
|
6
|
-
} from "./_chunk-2z044bba.js";
|
|
7
|
-
import {
|
|
8
|
-
contains
|
|
9
|
-
} from "./_chunk-cgptgywc.js";
|
|
10
|
-
import {
|
|
11
|
-
createChangeEventDetails,
|
|
12
|
-
exports_reason_parts
|
|
13
|
-
} from "./_chunk-e56mpvk1.js";
|
|
14
|
-
|
|
15
|
-
// node_modules/@base-ui/react/esm/utils/popups/useTriggerFocusGuards.js
|
|
16
|
-
import * as React from "react";
|
|
17
|
-
import * as ReactDOM from "react-dom";
|
|
18
|
-
"use client";
|
|
19
|
-
function useTriggerFocusGuards(store, triggerElementRef) {
|
|
20
|
-
const preFocusGuardRef = React.useRef(null);
|
|
21
|
-
function handlePreFocusGuardFocus(event) {
|
|
22
|
-
ReactDOM.flushSync(() => {
|
|
23
|
-
store.setOpen(false, createChangeEventDetails(exports_reason_parts.focusOut, event.nativeEvent, event.currentTarget));
|
|
24
|
-
});
|
|
25
|
-
const previousTabbable = getTabbableBeforeElement(preFocusGuardRef.current);
|
|
26
|
-
previousTabbable?.focus();
|
|
27
|
-
}
|
|
28
|
-
function handleFocusTargetFocus(event) {
|
|
29
|
-
const positionerElement = store.select("positionerElement");
|
|
30
|
-
if (positionerElement && isOutsideEvent(event, positionerElement)) {
|
|
31
|
-
store.context.beforeContentFocusGuardRef.current?.focus();
|
|
32
|
-
} else {
|
|
33
|
-
ReactDOM.flushSync(() => {
|
|
34
|
-
store.setOpen(false, createChangeEventDetails(exports_reason_parts.focusOut, event.nativeEvent, event.currentTarget));
|
|
35
|
-
});
|
|
36
|
-
let nextTabbable = getTabbableAfterElement(store.context.triggerFocusTargetRef.current || triggerElementRef.current);
|
|
37
|
-
while (nextTabbable !== null && contains(positionerElement, nextTabbable)) {
|
|
38
|
-
const prevTabbable = nextTabbable;
|
|
39
|
-
nextTabbable = getNextTabbable(nextTabbable);
|
|
40
|
-
if (nextTabbable === prevTabbable) {
|
|
41
|
-
break;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
nextTabbable?.focus();
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return {
|
|
48
|
-
preFocusGuardRef,
|
|
49
|
-
handlePreFocusGuardFocus,
|
|
50
|
-
handleFocusTargetFocus
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export { useTriggerFocusGuards };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// node_modules/@base-ui/react/esm/checkbox-group/CheckboxGroupContext.js
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
"use client";
|
|
4
|
-
var CheckboxGroupContext = /* @__PURE__ */ React.createContext(undefined);
|
|
5
|
-
if (true)
|
|
6
|
-
CheckboxGroupContext.displayName = "CheckboxGroupContext";
|
|
7
|
-
function useCheckboxGroupContext(optional = true) {
|
|
8
|
-
const context = React.useContext(CheckboxGroupContext);
|
|
9
|
-
if (context === undefined && !optional) {
|
|
10
|
-
throw new Error("Base UI: CheckboxGroupContext is missing. CheckboxGroup parts must be placed within <CheckboxGroup>.");
|
|
11
|
-
}
|
|
12
|
-
return context;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export { useCheckboxGroupContext };
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useFieldRootContext
|
|
3
|
-
} from "./_chunk-8ctgmf06.js";
|
|
4
|
-
import {
|
|
5
|
-
useIsoLayoutEffect
|
|
6
|
-
} from "./_chunk-5tze5c8q.js";
|
|
7
|
-
import {
|
|
8
|
-
NOOP
|
|
9
|
-
} from "./_chunk-x8xehj6d.js";
|
|
10
|
-
|
|
11
|
-
// node_modules/@base-ui/react/esm/internals/field-register-control/useRegisterFieldControl.js
|
|
12
|
-
import * as React from "react";
|
|
13
|
-
"use client";
|
|
14
|
-
function useRegisterFieldControl(controlRef, id, value, getFormValueOverride, enabled = true) {
|
|
15
|
-
const {
|
|
16
|
-
registerFieldControl
|
|
17
|
-
} = useFieldRootContext();
|
|
18
|
-
const sourceRef = React.useRef(null);
|
|
19
|
-
if (!sourceRef.current) {
|
|
20
|
-
sourceRef.current = Symbol();
|
|
21
|
-
}
|
|
22
|
-
useIsoLayoutEffect(() => {
|
|
23
|
-
const source = sourceRef.current;
|
|
24
|
-
if (!source || !enabled) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
const registration = {
|
|
28
|
-
controlRef,
|
|
29
|
-
getValue: getFormValueOverride,
|
|
30
|
-
id,
|
|
31
|
-
value
|
|
32
|
-
};
|
|
33
|
-
registerFieldControl(source, registration);
|
|
34
|
-
return () => {
|
|
35
|
-
registerFieldControl(source, undefined);
|
|
36
|
-
};
|
|
37
|
-
}, [controlRef, enabled, getFormValueOverride, id, registerFieldControl, value]);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// node_modules/@base-ui/react/esm/internals/form-context/FormContext.js
|
|
41
|
-
import * as React2 from "react";
|
|
42
|
-
"use client";
|
|
43
|
-
var FormContext = /* @__PURE__ */ React2.createContext({
|
|
44
|
-
formRef: {
|
|
45
|
-
current: {
|
|
46
|
-
fields: new Map
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
errors: {},
|
|
50
|
-
clearErrors: NOOP,
|
|
51
|
-
validationMode: "onSubmit",
|
|
52
|
-
submitAttemptedRef: {
|
|
53
|
-
current: false
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
if (true)
|
|
57
|
-
FormContext.displayName = "FormContext";
|
|
58
|
-
function useFormContext() {
|
|
59
|
-
return React2.useContext(FormContext);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export { useRegisterFieldControl, useFormContext };
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
error
|
|
3
|
-
} from "./_chunk-hm5h9vsk.js";
|
|
4
|
-
|
|
5
|
-
// node_modules/@base-ui/utils/esm/useControlled.js
|
|
6
|
-
import * as React from "react";
|
|
7
|
-
"use client";
|
|
8
|
-
function useControlled({
|
|
9
|
-
controlled,
|
|
10
|
-
default: defaultProp,
|
|
11
|
-
name,
|
|
12
|
-
state = "value"
|
|
13
|
-
}) {
|
|
14
|
-
const {
|
|
15
|
-
current: isControlled
|
|
16
|
-
} = React.useRef(controlled !== undefined);
|
|
17
|
-
const [valueState, setValue] = React.useState(defaultProp);
|
|
18
|
-
const value = isControlled ? controlled : valueState;
|
|
19
|
-
if (true) {
|
|
20
|
-
React.useEffect(() => {
|
|
21
|
-
if (isControlled !== (controlled !== undefined)) {
|
|
22
|
-
error([`A component is changing the ${isControlled ? "" : "un"}controlled ${state} state of ${name} to be ${isControlled ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${name} ` + "element for the lifetime of the component.", "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", "More info: https://fb.me/react-controlled-components"].join(`
|
|
23
|
-
`));
|
|
24
|
-
}
|
|
25
|
-
}, [state, name, controlled]);
|
|
26
|
-
const {
|
|
27
|
-
current: defaultValue
|
|
28
|
-
} = React.useRef(defaultProp);
|
|
29
|
-
React.useEffect(() => {
|
|
30
|
-
if (!isControlled && serializeToDevModeString(defaultValue) !== serializeToDevModeString(defaultProp)) {
|
|
31
|
-
error([`A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. ` + `To suppress this warning opt to use a controlled ${name}.`].join(`
|
|
32
|
-
`));
|
|
33
|
-
}
|
|
34
|
-
}, [defaultProp]);
|
|
35
|
-
}
|
|
36
|
-
const setValueIfUncontrolled = React.useCallback((newValue) => {
|
|
37
|
-
if (!isControlled) {
|
|
38
|
-
setValue(newValue);
|
|
39
|
-
}
|
|
40
|
-
}, []);
|
|
41
|
-
return [value, setValueIfUncontrolled];
|
|
42
|
-
}
|
|
43
|
-
function serializeToDevModeString(input) {
|
|
44
|
-
let nextId = 0;
|
|
45
|
-
const seen = new WeakMap;
|
|
46
|
-
try {
|
|
47
|
-
const result = JSON.stringify(input, function replacer(key, value) {
|
|
48
|
-
if (key === "_owner" && this != null && typeof this === "object" && "$$typeof" in this) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
if (typeof value === "bigint") {
|
|
52
|
-
return `__bigint__:${value}`;
|
|
53
|
-
}
|
|
54
|
-
if (value !== null && typeof value === "object") {
|
|
55
|
-
const id = seen.get(value);
|
|
56
|
-
if (id !== undefined) {
|
|
57
|
-
return `__object__:${id}`;
|
|
58
|
-
}
|
|
59
|
-
seen.set(value, nextId);
|
|
60
|
-
nextId += 1;
|
|
61
|
-
}
|
|
62
|
-
return value;
|
|
63
|
-
});
|
|
64
|
-
return result ?? `__top__:${typeof input}`;
|
|
65
|
-
} catch {
|
|
66
|
-
return "__unserializable__";
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export { useControlled };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// node_modules/@base-ui/utils/esm/addEventListener.js
|
|
2
|
-
function addEventListener(target, type, listener, options) {
|
|
3
|
-
target.addEventListener(type, listener, options);
|
|
4
|
-
return () => {
|
|
5
|
-
target.removeEventListener(type, listener, options);
|
|
6
|
-
};
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export { addEventListener };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getWindow
|
|
3
|
-
} from "./_chunk-000kmre8.js";
|
|
4
|
-
|
|
5
|
-
// node_modules/@base-ui/react/esm/utils/getPseudoElementBounds.js
|
|
6
|
-
function getPseudoElementBounds(element) {
|
|
7
|
-
const elementRect = element.getBoundingClientRect();
|
|
8
|
-
if (true) {
|
|
9
|
-
return elementRect;
|
|
10
|
-
}
|
|
11
|
-
const win = getWindow(element);
|
|
12
|
-
const beforeStyles = win.getComputedStyle(element, "::before");
|
|
13
|
-
const afterStyles = win.getComputedStyle(element, "::after");
|
|
14
|
-
const hasPseudoElements = beforeStyles.content !== "none" || afterStyles.content !== "none";
|
|
15
|
-
if (!hasPseudoElements) {
|
|
16
|
-
return elementRect;
|
|
17
|
-
}
|
|
18
|
-
const beforeWidth = parseFloat(beforeStyles.width) || 0;
|
|
19
|
-
const beforeHeight = parseFloat(beforeStyles.height) || 0;
|
|
20
|
-
const afterWidth = parseFloat(afterStyles.width) || 0;
|
|
21
|
-
const afterHeight = parseFloat(afterStyles.height) || 0;
|
|
22
|
-
const totalWidth = Math.max(elementRect.width, beforeWidth, afterWidth);
|
|
23
|
-
const totalHeight = Math.max(elementRect.height, beforeHeight, afterHeight);
|
|
24
|
-
const widthDiff = totalWidth - elementRect.width;
|
|
25
|
-
const heightDiff = totalHeight - elementRect.height;
|
|
26
|
-
return {
|
|
27
|
-
left: elementRect.left - widthDiff / 2,
|
|
28
|
-
right: elementRect.right + widthDiff / 2,
|
|
29
|
-
top: elementRect.top - heightDiff / 2,
|
|
30
|
-
bottom: elementRect.bottom + heightDiff / 2
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export { getPseudoElementBounds };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// node_modules/@base-ui/react/esm/utils/resolveAriaLabelledBy.js
|
|
2
|
-
"use client";
|
|
3
|
-
function getDefaultLabelId(id) {
|
|
4
|
-
return id == null ? undefined : `${id}-label`;
|
|
5
|
-
}
|
|
6
|
-
function resolveAriaLabelledBy(fieldLabelId, localLabelId) {
|
|
7
|
-
return fieldLabelId ?? localLabelId;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export { getDefaultLabelId, resolveAriaLabelledBy };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useOnMount
|
|
3
|
-
} from "./_chunk-6ejf1z1r.js";
|
|
4
|
-
import {
|
|
5
|
-
useRefWithInit
|
|
6
|
-
} from "./_chunk-x8xehj6d.js";
|
|
7
|
-
|
|
8
|
-
// node_modules/@base-ui/utils/esm/useTimeout.js
|
|
9
|
-
"use client";
|
|
10
|
-
var EMPTY = 0;
|
|
11
|
-
|
|
12
|
-
class Timeout {
|
|
13
|
-
static create() {
|
|
14
|
-
return new Timeout;
|
|
15
|
-
}
|
|
16
|
-
currentId = EMPTY;
|
|
17
|
-
start(delay, fn) {
|
|
18
|
-
this.clear();
|
|
19
|
-
this.currentId = setTimeout(() => {
|
|
20
|
-
this.currentId = EMPTY;
|
|
21
|
-
fn();
|
|
22
|
-
}, delay);
|
|
23
|
-
}
|
|
24
|
-
isStarted() {
|
|
25
|
-
return this.currentId !== EMPTY;
|
|
26
|
-
}
|
|
27
|
-
clear = () => {
|
|
28
|
-
if (this.currentId !== EMPTY) {
|
|
29
|
-
clearTimeout(this.currentId);
|
|
30
|
-
this.currentId = EMPTY;
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
disposeEffect = () => {
|
|
34
|
-
return this.clear;
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
function useTimeout() {
|
|
38
|
-
const timeout = useRefWithInit(Timeout.create).current;
|
|
39
|
-
useOnMount(timeout.disposeEffect);
|
|
40
|
-
return timeout;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export { Timeout, useTimeout };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// node_modules/@base-ui/react/esm/fieldset/root/FieldsetRootContext.js
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
"use client";
|
|
4
|
-
var FieldsetRootContext = /* @__PURE__ */ React.createContext({
|
|
5
|
-
legendId: undefined,
|
|
6
|
-
setLegendId: () => {},
|
|
7
|
-
disabled: undefined
|
|
8
|
-
});
|
|
9
|
-
if (true)
|
|
10
|
-
FieldsetRootContext.displayName = "FieldsetRootContext";
|
|
11
|
-
function useFieldsetRootContext(optional = false) {
|
|
12
|
-
const context = React.useContext(FieldsetRootContext);
|
|
13
|
-
if (!context && !optional) {
|
|
14
|
-
throw new Error("Base UI: FieldsetRootContext is missing. Fieldset parts must be placed within <Fieldset.Root>.");
|
|
15
|
-
}
|
|
16
|
-
return context;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export { useFieldsetRootContext };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// node_modules/@base-ui/react/esm/internals/composite/root/CompositeRootContext.js
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
"use client";
|
|
4
|
-
var CompositeRootContext = /* @__PURE__ */ React.createContext(undefined);
|
|
5
|
-
if (true)
|
|
6
|
-
CompositeRootContext.displayName = "CompositeRootContext";
|
|
7
|
-
function useCompositeRootContext(optional = false) {
|
|
8
|
-
const context = React.useContext(CompositeRootContext);
|
|
9
|
-
if (context === undefined && !optional) {
|
|
10
|
-
throw new Error("Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.");
|
|
11
|
-
}
|
|
12
|
-
return context;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export { CompositeRootContext, useCompositeRootContext };
|
|
@@ -1,347 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ACTIVE_COMPOSITE_ITEM
|
|
3
|
-
} from "./_chunk-5tt5hk59.js";
|
|
4
|
-
import {
|
|
5
|
-
isElementDisabled
|
|
6
|
-
} from "./_chunk-26cc610z.js";
|
|
7
|
-
import {
|
|
8
|
-
CompositeList
|
|
9
|
-
} from "./_chunk-j29xjete.js";
|
|
10
|
-
import {
|
|
11
|
-
useDirection
|
|
12
|
-
} from "./_chunk-gy0bpkmx.js";
|
|
13
|
-
import {
|
|
14
|
-
getTarget
|
|
15
|
-
} from "./_chunk-cgptgywc.js";
|
|
16
|
-
import {
|
|
17
|
-
ARROW_DOWN,
|
|
18
|
-
ARROW_KEYS,
|
|
19
|
-
ARROW_LEFT,
|
|
20
|
-
ARROW_RIGHT,
|
|
21
|
-
ARROW_UP,
|
|
22
|
-
COMPOSITE_KEYS,
|
|
23
|
-
END,
|
|
24
|
-
HOME,
|
|
25
|
-
HORIZONTAL_KEYS,
|
|
26
|
-
HORIZONTAL_KEYS_WITH_EXTRA_KEYS,
|
|
27
|
-
MODIFIER_KEYS,
|
|
28
|
-
VERTICAL_KEYS,
|
|
29
|
-
VERTICAL_KEYS_WITH_EXTRA_KEYS,
|
|
30
|
-
isNativeInput,
|
|
31
|
-
scrollIntoViewIfNeeded
|
|
32
|
-
} from "./_chunk-pv7b791x.js";
|
|
33
|
-
import {
|
|
34
|
-
createGridCellMap,
|
|
35
|
-
findNonDisabledListIndex,
|
|
36
|
-
getGridCellIndexOfCorner,
|
|
37
|
-
getGridCellIndices,
|
|
38
|
-
getGridNavigatedIndex,
|
|
39
|
-
getMaxListIndex,
|
|
40
|
-
getMinListIndex,
|
|
41
|
-
isIndexOutOfListBounds,
|
|
42
|
-
isListIndexDisabled
|
|
43
|
-
} from "./_chunk-kw8nnq00.js";
|
|
44
|
-
import {
|
|
45
|
-
CompositeRootContext
|
|
46
|
-
} from "./_chunk-cdgfsr3q.js";
|
|
47
|
-
import {
|
|
48
|
-
useStableCallback
|
|
49
|
-
} from "./_chunk-cwvtvwc7.js";
|
|
50
|
-
import {
|
|
51
|
-
EMPTY_ARRAY,
|
|
52
|
-
EMPTY_OBJECT,
|
|
53
|
-
useMergedRefs,
|
|
54
|
-
useRenderElement
|
|
55
|
-
} from "./_chunk-x8xehj6d.js";
|
|
56
|
-
|
|
57
|
-
// node_modules/@base-ui/react/esm/internals/composite/root/CompositeRoot.js
|
|
58
|
-
import * as React2 from "react";
|
|
59
|
-
|
|
60
|
-
// node_modules/@base-ui/react/esm/internals/composite/root/useCompositeRoot.js
|
|
61
|
-
import * as React from "react";
|
|
62
|
-
"use client";
|
|
63
|
-
var EMPTY_ARRAY2 = [];
|
|
64
|
-
function useCompositeRoot(params) {
|
|
65
|
-
const {
|
|
66
|
-
itemSizes,
|
|
67
|
-
cols = 1,
|
|
68
|
-
loopFocus = true,
|
|
69
|
-
onLoop,
|
|
70
|
-
dense = false,
|
|
71
|
-
orientation = "both",
|
|
72
|
-
direction,
|
|
73
|
-
highlightedIndex: externalHighlightedIndex,
|
|
74
|
-
onHighlightedIndexChange: externalSetHighlightedIndex,
|
|
75
|
-
rootRef: externalRef,
|
|
76
|
-
enableHomeAndEndKeys = false,
|
|
77
|
-
stopEventPropagation = false,
|
|
78
|
-
disabledIndices,
|
|
79
|
-
modifierKeys = EMPTY_ARRAY2
|
|
80
|
-
} = params;
|
|
81
|
-
const [internalHighlightedIndex, internalSetHighlightedIndex] = React.useState(0);
|
|
82
|
-
const isGrid = cols > 1;
|
|
83
|
-
const rootRef = React.useRef(null);
|
|
84
|
-
const mergedRef = useMergedRefs(rootRef, externalRef);
|
|
85
|
-
const elementsRef = React.useRef([]);
|
|
86
|
-
const hasSetDefaultIndexRef = React.useRef(false);
|
|
87
|
-
const highlightedIndex = externalHighlightedIndex ?? internalHighlightedIndex;
|
|
88
|
-
const onHighlightedIndexChange = useStableCallback((index, shouldScrollIntoView = false) => {
|
|
89
|
-
(externalSetHighlightedIndex ?? internalSetHighlightedIndex)(index);
|
|
90
|
-
if (shouldScrollIntoView) {
|
|
91
|
-
const newActiveItem = elementsRef.current[index];
|
|
92
|
-
scrollIntoViewIfNeeded(rootRef.current, newActiveItem, direction, orientation);
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
const onMapChange = useStableCallback((map) => {
|
|
96
|
-
if (map.size === 0 || hasSetDefaultIndexRef.current) {
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
hasSetDefaultIndexRef.current = true;
|
|
100
|
-
const sortedElements = Array.from(map.keys());
|
|
101
|
-
const activeItem = sortedElements.find((compositeElement) => compositeElement?.hasAttribute(ACTIVE_COMPOSITE_ITEM)) ?? null;
|
|
102
|
-
const activeIndex = activeItem ? sortedElements.indexOf(activeItem) : -1;
|
|
103
|
-
if (activeIndex !== -1) {
|
|
104
|
-
onHighlightedIndexChange(activeIndex);
|
|
105
|
-
}
|
|
106
|
-
scrollIntoViewIfNeeded(rootRef.current, activeItem, direction, orientation);
|
|
107
|
-
});
|
|
108
|
-
const wrappedOnLoop = useStableCallback((event, prevIndex, nextIndex) => {
|
|
109
|
-
if (!onLoop) {
|
|
110
|
-
return nextIndex;
|
|
111
|
-
}
|
|
112
|
-
return onLoop?.(event, prevIndex, nextIndex, elementsRef);
|
|
113
|
-
});
|
|
114
|
-
const props = React.useMemo(() => ({
|
|
115
|
-
"aria-orientation": orientation === "both" ? undefined : orientation,
|
|
116
|
-
ref: mergedRef,
|
|
117
|
-
onFocus(event) {
|
|
118
|
-
const element = rootRef.current;
|
|
119
|
-
const target = getTarget(event.nativeEvent);
|
|
120
|
-
if (!element || target == null || !isNativeInput(target)) {
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
target.setSelectionRange(0, target.value.length ?? 0);
|
|
124
|
-
},
|
|
125
|
-
onKeyDown(event) {
|
|
126
|
-
const RELEVANT_KEYS = enableHomeAndEndKeys ? COMPOSITE_KEYS : ARROW_KEYS;
|
|
127
|
-
if (!RELEVANT_KEYS.has(event.key)) {
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
if (isModifierKeySet(event, modifierKeys)) {
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
const element = rootRef.current;
|
|
134
|
-
if (!element) {
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
const isRtl = direction === "rtl";
|
|
138
|
-
const horizontalForwardKey = isRtl ? ARROW_LEFT : ARROW_RIGHT;
|
|
139
|
-
const forwardKey = {
|
|
140
|
-
horizontal: horizontalForwardKey,
|
|
141
|
-
vertical: ARROW_DOWN,
|
|
142
|
-
both: horizontalForwardKey
|
|
143
|
-
}[orientation];
|
|
144
|
-
const horizontalBackwardKey = isRtl ? ARROW_RIGHT : ARROW_LEFT;
|
|
145
|
-
const backwardKey = {
|
|
146
|
-
horizontal: horizontalBackwardKey,
|
|
147
|
-
vertical: ARROW_UP,
|
|
148
|
-
both: horizontalBackwardKey
|
|
149
|
-
}[orientation];
|
|
150
|
-
const target = getTarget(event.nativeEvent);
|
|
151
|
-
if (target != null && isNativeInput(target) && !isElementDisabled(target)) {
|
|
152
|
-
const selectionStart = target.selectionStart;
|
|
153
|
-
const selectionEnd = target.selectionEnd;
|
|
154
|
-
const textContent = target.value ?? "";
|
|
155
|
-
if (selectionStart == null || event.shiftKey || selectionStart !== selectionEnd) {
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
if (event.key !== backwardKey && selectionStart < textContent.length) {
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
if (event.key !== forwardKey && selectionStart > 0) {
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
let nextIndex = highlightedIndex;
|
|
166
|
-
const minIndex = getMinListIndex(elementsRef, disabledIndices);
|
|
167
|
-
const maxIndex = getMaxListIndex(elementsRef, disabledIndices);
|
|
168
|
-
if (isGrid) {
|
|
169
|
-
const sizes = itemSizes || Array.from({
|
|
170
|
-
length: elementsRef.current.length
|
|
171
|
-
}, () => ({
|
|
172
|
-
width: 1,
|
|
173
|
-
height: 1
|
|
174
|
-
}));
|
|
175
|
-
const cellMap = createGridCellMap(sizes, cols, dense);
|
|
176
|
-
const minGridIndex = cellMap.findIndex((index) => index != null && !isListIndexDisabled(elementsRef.current, index, disabledIndices));
|
|
177
|
-
const maxGridIndex = cellMap.reduce((foundIndex, index, cellIndex) => index != null && !isListIndexDisabled(elementsRef.current, index, disabledIndices) ? cellIndex : foundIndex, -1);
|
|
178
|
-
nextIndex = cellMap[getGridNavigatedIndex(cellMap.map((itemIndex) => itemIndex != null ? elementsRef.current[itemIndex] : null), {
|
|
179
|
-
event,
|
|
180
|
-
orientation,
|
|
181
|
-
loopFocus,
|
|
182
|
-
onLoop: wrappedOnLoop,
|
|
183
|
-
cols,
|
|
184
|
-
disabledIndices: getGridCellIndices([...disabledIndices || elementsRef.current.map((_, index) => isListIndexDisabled(elementsRef.current, index) ? index : undefined), undefined], cellMap),
|
|
185
|
-
minIndex: minGridIndex,
|
|
186
|
-
maxIndex: maxGridIndex,
|
|
187
|
-
prevIndex: getGridCellIndexOfCorner(highlightedIndex > maxIndex ? minIndex : highlightedIndex, sizes, cellMap, cols, event.key === ARROW_DOWN ? "bl" : event.key === ARROW_RIGHT ? "tr" : "tl"),
|
|
188
|
-
rtl: isRtl
|
|
189
|
-
})];
|
|
190
|
-
}
|
|
191
|
-
const forwardKeys = {
|
|
192
|
-
horizontal: [horizontalForwardKey],
|
|
193
|
-
vertical: [ARROW_DOWN],
|
|
194
|
-
both: [horizontalForwardKey, ARROW_DOWN]
|
|
195
|
-
}[orientation];
|
|
196
|
-
const backwardKeys = {
|
|
197
|
-
horizontal: [horizontalBackwardKey],
|
|
198
|
-
vertical: [ARROW_UP],
|
|
199
|
-
both: [horizontalBackwardKey, ARROW_UP]
|
|
200
|
-
}[orientation];
|
|
201
|
-
const preventedKeys = isGrid ? RELEVANT_KEYS : {
|
|
202
|
-
horizontal: enableHomeAndEndKeys ? HORIZONTAL_KEYS_WITH_EXTRA_KEYS : HORIZONTAL_KEYS,
|
|
203
|
-
vertical: enableHomeAndEndKeys ? VERTICAL_KEYS_WITH_EXTRA_KEYS : VERTICAL_KEYS,
|
|
204
|
-
both: RELEVANT_KEYS
|
|
205
|
-
}[orientation];
|
|
206
|
-
if (enableHomeAndEndKeys) {
|
|
207
|
-
if (event.key === HOME) {
|
|
208
|
-
nextIndex = minIndex;
|
|
209
|
-
} else if (event.key === END) {
|
|
210
|
-
nextIndex = maxIndex;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
if (nextIndex === highlightedIndex && (forwardKeys.includes(event.key) || backwardKeys.includes(event.key))) {
|
|
214
|
-
if (loopFocus && nextIndex === maxIndex && forwardKeys.includes(event.key)) {
|
|
215
|
-
nextIndex = minIndex;
|
|
216
|
-
if (onLoop) {
|
|
217
|
-
nextIndex = onLoop(event, highlightedIndex, nextIndex, elementsRef);
|
|
218
|
-
}
|
|
219
|
-
} else if (loopFocus && nextIndex === minIndex && backwardKeys.includes(event.key)) {
|
|
220
|
-
nextIndex = maxIndex;
|
|
221
|
-
if (onLoop) {
|
|
222
|
-
nextIndex = onLoop(event, highlightedIndex, nextIndex, elementsRef);
|
|
223
|
-
}
|
|
224
|
-
} else {
|
|
225
|
-
nextIndex = findNonDisabledListIndex(elementsRef.current, {
|
|
226
|
-
startingIndex: nextIndex,
|
|
227
|
-
decrement: backwardKeys.includes(event.key),
|
|
228
|
-
disabledIndices
|
|
229
|
-
});
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
if (nextIndex !== highlightedIndex && !isIndexOutOfListBounds(elementsRef.current, nextIndex)) {
|
|
233
|
-
if (stopEventPropagation) {
|
|
234
|
-
event.stopPropagation();
|
|
235
|
-
}
|
|
236
|
-
if (preventedKeys.has(event.key)) {
|
|
237
|
-
event.preventDefault();
|
|
238
|
-
}
|
|
239
|
-
onHighlightedIndexChange(nextIndex, true);
|
|
240
|
-
queueMicrotask(() => {
|
|
241
|
-
elementsRef.current[nextIndex]?.focus();
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}), [cols, dense, direction, disabledIndices, elementsRef, enableHomeAndEndKeys, highlightedIndex, isGrid, itemSizes, loopFocus, onLoop, wrappedOnLoop, mergedRef, modifierKeys, onHighlightedIndexChange, orientation, stopEventPropagation]);
|
|
246
|
-
return React.useMemo(() => ({
|
|
247
|
-
props,
|
|
248
|
-
highlightedIndex,
|
|
249
|
-
onHighlightedIndexChange,
|
|
250
|
-
elementsRef,
|
|
251
|
-
disabledIndices,
|
|
252
|
-
onMapChange,
|
|
253
|
-
relayKeyboardEvent: props.onKeyDown
|
|
254
|
-
}), [props, highlightedIndex, onHighlightedIndexChange, elementsRef, disabledIndices, onMapChange]);
|
|
255
|
-
}
|
|
256
|
-
function isModifierKeySet(event, ignoredModifierKeys) {
|
|
257
|
-
for (const key of MODIFIER_KEYS.values()) {
|
|
258
|
-
if (ignoredModifierKeys.includes(key)) {
|
|
259
|
-
continue;
|
|
260
|
-
}
|
|
261
|
-
if (event.getModifierState(key)) {
|
|
262
|
-
return true;
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
return false;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
// node_modules/@base-ui/react/esm/internals/composite/root/CompositeRoot.js
|
|
269
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
270
|
-
"use client";
|
|
271
|
-
function CompositeRoot(componentProps) {
|
|
272
|
-
const {
|
|
273
|
-
render,
|
|
274
|
-
className,
|
|
275
|
-
style,
|
|
276
|
-
refs = EMPTY_ARRAY,
|
|
277
|
-
props = EMPTY_ARRAY,
|
|
278
|
-
state = EMPTY_OBJECT,
|
|
279
|
-
stateAttributesMapping,
|
|
280
|
-
highlightedIndex: highlightedIndexProp,
|
|
281
|
-
onHighlightedIndexChange: onHighlightedIndexChangeProp,
|
|
282
|
-
orientation,
|
|
283
|
-
dense,
|
|
284
|
-
itemSizes,
|
|
285
|
-
loopFocus,
|
|
286
|
-
onLoop,
|
|
287
|
-
cols,
|
|
288
|
-
enableHomeAndEndKeys,
|
|
289
|
-
onMapChange: onMapChangeProp,
|
|
290
|
-
stopEventPropagation = true,
|
|
291
|
-
rootRef,
|
|
292
|
-
disabledIndices,
|
|
293
|
-
modifierKeys,
|
|
294
|
-
highlightItemOnHover = false,
|
|
295
|
-
tag = "div",
|
|
296
|
-
...elementProps
|
|
297
|
-
} = componentProps;
|
|
298
|
-
const direction = useDirection();
|
|
299
|
-
const {
|
|
300
|
-
props: defaultProps,
|
|
301
|
-
highlightedIndex,
|
|
302
|
-
onHighlightedIndexChange,
|
|
303
|
-
elementsRef,
|
|
304
|
-
onMapChange: onMapChangeUnwrapped,
|
|
305
|
-
relayKeyboardEvent
|
|
306
|
-
} = useCompositeRoot({
|
|
307
|
-
itemSizes,
|
|
308
|
-
cols,
|
|
309
|
-
loopFocus,
|
|
310
|
-
onLoop,
|
|
311
|
-
dense,
|
|
312
|
-
orientation,
|
|
313
|
-
highlightedIndex: highlightedIndexProp,
|
|
314
|
-
onHighlightedIndexChange: onHighlightedIndexChangeProp,
|
|
315
|
-
rootRef,
|
|
316
|
-
stopEventPropagation,
|
|
317
|
-
enableHomeAndEndKeys,
|
|
318
|
-
direction,
|
|
319
|
-
disabledIndices,
|
|
320
|
-
modifierKeys
|
|
321
|
-
});
|
|
322
|
-
const element = useRenderElement(tag, componentProps, {
|
|
323
|
-
state,
|
|
324
|
-
ref: refs,
|
|
325
|
-
props: [defaultProps, ...props, elementProps],
|
|
326
|
-
stateAttributesMapping
|
|
327
|
-
});
|
|
328
|
-
const contextValue = React2.useMemo(() => ({
|
|
329
|
-
highlightedIndex,
|
|
330
|
-
onHighlightedIndexChange,
|
|
331
|
-
highlightItemOnHover,
|
|
332
|
-
relayKeyboardEvent
|
|
333
|
-
}), [highlightedIndex, onHighlightedIndexChange, highlightItemOnHover, relayKeyboardEvent]);
|
|
334
|
-
return /* @__PURE__ */ _jsx(CompositeRootContext.Provider, {
|
|
335
|
-
value: contextValue,
|
|
336
|
-
children: /* @__PURE__ */ _jsx(CompositeList, {
|
|
337
|
-
elementsRef,
|
|
338
|
-
onMapChange: (newMap) => {
|
|
339
|
-
onMapChangeProp?.(newMap);
|
|
340
|
-
onMapChangeUnwrapped(newMap);
|
|
341
|
-
},
|
|
342
|
-
children: element
|
|
343
|
-
})
|
|
344
|
-
});
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
export { CompositeRoot };
|