@jfrader/ui 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/{accordion-Bd-j04hW.js → accordion-xCI_u0BV.js} +2 -2
- package/dist/accordion.js +1 -1
- package/dist/{alert-BBqaKI4k.js → alert-DS_einpy.js} +1 -1
- package/dist/alert.js +1 -1
- package/dist/announcement-bar-B58xempt.js +382 -0
- package/dist/announcement-bar.js +2 -0
- package/dist/avatar-group-DOQQuV51.js +138 -0
- package/dist/avatar-group.js +2 -0
- package/dist/bottom-sheet-DPJBFkie.js +673 -0
- package/dist/bottom-sheet.js +2 -0
- package/dist/{breadcrumbs-DVAOxfvL.js → breadcrumbs-Cfw_hgt2.js} +1 -1
- package/dist/breadcrumbs.js +1 -1
- package/dist/{button-P2e7_44z.js → button-C92uYFJW.js} +1 -1
- package/dist/button.js +1 -1
- package/dist/calendar-B3Svu0X2.js +447 -0
- package/dist/calendar.js +1 -1
- package/dist/carousel-IvPqN-oM.js +472 -0
- package/dist/carousel.js +2 -0
- package/dist/{checkbox-COYG6L7d.js → checkbox-cFquiSdy.js} +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/chip-group-DTQd_M-G.js +289 -0
- package/dist/chip-group.js +2 -0
- package/dist/code-block/shiki.js +147 -0
- package/dist/code-block-ahnRi-g8.js +292 -0
- package/dist/code-block.js +2 -0
- package/dist/collection-registry-k6JcD3Jr.js +44 -0
- package/dist/combobox-Bhzvu9ma.js +334 -0
- package/dist/combobox.js +1 -1
- package/dist/command-palette-BQ5LleGb.js +384 -0
- package/dist/command-palette.js +1 -1
- package/dist/copy-button-ByiA6D3R.js +252 -0
- package/dist/copy-button.js +2 -0
- package/dist/countdown-Dp_TD1VP.js +293 -0
- package/dist/countdown.js +2 -0
- package/dist/date-picker-5zKSSuFF.js +255 -0
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker-B5uFWsm-.js +562 -0
- package/dist/date-range-picker.js +2 -0
- package/dist/{dialog-xaydbXl2.js → dialog-ciiv9H2b.js} +19 -19
- package/dist/dialog.js +1 -1
- package/dist/drawer-DsASTiP-.js +553 -0
- package/dist/drawer.js +2 -0
- package/dist/empty-state-CDgrjPPf.js +142 -0
- package/dist/empty-state.js +2 -0
- package/dist/expandable-card-C-qJcZ14.js +340 -0
- package/dist/expandable-card.js +2 -0
- package/dist/field-anatomy-COVdNpf5.js +84 -0
- package/dist/file-dropzone-pR4v7owg.js +457 -0
- package/dist/file-dropzone.js +2 -0
- package/dist/filter-toolbar-D5KEKTSe.js +312 -0
- package/dist/filter-toolbar.js +2 -0
- package/dist/hold-to-confirm-DjB2EVjM.js +294 -0
- package/dist/hold-to-confirm.js +2 -0
- package/dist/hover-card-B-nrCIy2.js +347 -0
- package/dist/hover-card.js +2 -0
- package/dist/image-compare-ciuhPtQZ.js +415 -0
- package/dist/image-compare.js +2 -0
- package/dist/index.js +79 -38
- package/dist/inline-edit-C0eeml65.js +535 -0
- package/dist/inline-edit.js +2 -0
- package/dist/input-control-DmMuAuPS.js +34 -0
- package/dist/json-viewer-BcySQfjZ.js +798 -0
- package/dist/json-viewer.js +2 -0
- package/dist/listbox-style-WX-RASp1.js +59 -0
- package/dist/{media-D_eA_I-e.js → media-8yrN85VT.js} +2 -2
- package/dist/mention-input-BcQKX2EJ.js +599 -0
- package/dist/mention-input.js +2 -0
- package/dist/menu-xwOOUtWP.js +275 -0
- package/dist/menu.js +1 -1
- package/dist/metric-card-Bh9K4fZs.js +118 -0
- package/dist/metric-card.js +2 -0
- package/dist/multi-select-Pce_IYnz.js +590 -0
- package/dist/multi-select.js +2 -0
- package/dist/{navigation-DhnKriOp.js → navigation-sP5fiuQS.js} +4 -4
- package/dist/navigation.js +1 -1
- package/dist/overlay-layer-SeUyyEPD.js +64 -0
- package/dist/overlay-portal-C4JZFq2M.js +15 -0
- package/dist/{pagination-DYdwsxwe.js → pagination-DmXZ8E85.js} +1 -1
- package/dist/pagination.js +1 -1
- package/dist/password-field-03pWRkuY.js +250 -0
- package/dist/password-field.js +2 -0
- package/dist/popover-QHcEvf9c.js +119 -0
- package/dist/popover.js +1 -1
- package/dist/{progress-BpJswTG4.js → progress-CbOWBUdA.js} +4 -4
- package/dist/progress.js +1 -1
- package/dist/radio-cards-D2QZENI_.js +455 -0
- package/dist/radio-cards.js +2 -0
- package/dist/{radio-group-Ce0_IWQr.js → radio-group-E6mMRgo7.js} +4 -4
- package/dist/radio-group.js +1 -1
- package/dist/resizable-panels-BhjUVXZZ.js +519 -0
- package/dist/resizable-panels.js +2 -0
- package/dist/scroll-area-CcZyiSOQ.js +371 -0
- package/dist/scroll-area.js +2 -0
- package/dist/search-field-IxF0IJXm.js +274 -0
- package/dist/search-field.js +2 -0
- package/dist/segmented-control-yO1K1nbi.js +326 -0
- package/dist/segmented-control.js +2 -0
- package/dist/select-n_H52W1Z.js +292 -0
- package/dist/select.js +1 -1
- package/dist/signature-pad-q2SAsrdD.js +640 -0
- package/dist/signature-pad.js +2 -0
- package/dist/{skeleton-OoFlOEXO.js → skeleton-XQQDkCHd.js} +1 -1
- package/dist/skeleton.js +1 -1
- package/dist/slider-t0B5cecO.js +477 -0
- package/dist/slider.js +2 -0
- package/dist/sortable-data-table-tirqlLY2.js +365 -0
- package/dist/sortable-data-table.js +2 -0
- package/dist/{spinner-C2YDoiMn.js → spinner-DtxvDPdM.js} +1 -1
- package/dist/spinner.js +1 -1
- package/dist/split-button-Cb3EHs64.js +268 -0
- package/dist/split-button.js +2 -0
- package/dist/stepper-CruHbXxX.js +480 -0
- package/dist/stepper.js +2 -0
- package/dist/swipe-actions-DiZC57-3.js +418 -0
- package/dist/swipe-actions.js +2 -0
- package/dist/{switch-Dr-qjmT4.js → switch-qwv8jQnR.js} +1 -1
- package/dist/switch.js +1 -1
- package/dist/{tabs-CK_g1RKa.js → tabs-CAVJndX1.js} +2 -2
- package/dist/tabs.js +1 -1
- package/dist/tag-input-DSRCyrX2.js +418 -0
- package/dist/tag-input.js +2 -0
- package/dist/{text-field-D60ok14S.js → text-field-C8TWG-tY.js} +6 -5
- package/dist/text-field.js +1 -1
- package/dist/{textarea-DyfjtP0A.js → textarea-BrW0XcG_.js} +6 -5
- package/dist/textarea.js +1 -1
- package/dist/theme-root-BbTBuLMQ.js +46 -0
- package/dist/theme-root.js +1 -1
- package/dist/theme-scope-t7nAKc2c.js +27 -0
- package/dist/time-picker-Db8D49cP.js +305 -0
- package/dist/time-picker.js +2 -0
- package/dist/timeline-k3nURuCP.js +618 -0
- package/dist/timeline.js +2 -0
- package/dist/toast-BHxI32ZA.js +352 -0
- package/dist/toast-stack-DqrAzdg5.js +183 -0
- package/dist/toast-stack.js +2 -0
- package/dist/toast.js +1 -1
- package/dist/{toggle-group-CI0e7hFm.js → toggle-group-fcjzpifI.js} +4 -4
- package/dist/toggle-group.js +1 -1
- package/dist/tooltip-CkeiW9C1.js +113 -0
- package/dist/tooltip.js +1 -1
- package/dist/tree-view-C2liIxqy.js +360 -0
- package/dist/tree-view.js +2 -0
- package/dist/types/components/announcement-bar/announcement-bar.d.ts +75 -0
- package/dist/types/components/announcement-bar/index.d.ts +2 -0
- package/dist/types/components/avatar-group/avatar-group.d.ts +43 -0
- package/dist/types/components/avatar-group/index.d.ts +2 -0
- package/dist/types/components/bottom-sheet/bottom-sheet.d.ts +60 -0
- package/dist/types/components/bottom-sheet/index.d.ts +2 -0
- package/dist/types/components/calendar/calendar.d.ts +25 -1
- package/dist/types/components/calendar/index.d.ts +1 -1
- package/dist/types/components/carousel/carousel.d.ts +73 -0
- package/dist/types/components/carousel/index.d.ts +2 -0
- package/dist/types/components/chip-group/chip-group.d.ts +54 -0
- package/dist/types/components/chip-group/index.d.ts +1 -0
- package/dist/types/components/code-block/code-block.d.ts +58 -0
- package/dist/types/components/code-block/index.d.ts +1 -0
- package/dist/types/components/code-block/shiki.d.ts +3 -0
- package/dist/types/components/combobox/combobox.d.ts +1 -1
- package/dist/types/components/command-palette/command-palette.d.ts +1 -1
- package/dist/types/components/copy-button/copy-button.d.ts +49 -0
- package/dist/types/components/copy-button/index.d.ts +2 -0
- package/dist/types/components/countdown/countdown.d.ts +37 -0
- package/dist/types/components/countdown/index.d.ts +1 -0
- package/dist/types/components/date-picker/date-picker.d.ts +1 -1
- package/dist/types/components/date-range-picker/date-range-picker.d.ts +103 -0
- package/dist/types/components/date-range-picker/index.d.ts +2 -0
- package/dist/types/components/drawer/drawer.d.ts +59 -0
- package/dist/types/components/drawer/index.d.ts +2 -0
- package/dist/types/components/empty-state/empty-state.d.ts +36 -0
- package/dist/types/components/empty-state/index.d.ts +2 -0
- package/dist/types/components/expandable-card/expandable-card.d.ts +28 -0
- package/dist/types/components/expandable-card/index.d.ts +2 -0
- package/dist/types/components/field/field-anatomy.d.ts +4 -2
- package/dist/types/components/file-dropzone/file-dropzone.d.ts +93 -0
- package/dist/types/components/file-dropzone/index.d.ts +2 -0
- package/dist/types/components/filter-toolbar/filter-toolbar.d.ts +70 -0
- package/dist/types/components/filter-toolbar/index.d.ts +1 -0
- package/dist/types/components/hold-to-confirm/hold-to-confirm.d.ts +32 -0
- package/dist/types/components/hold-to-confirm/index.d.ts +2 -0
- package/dist/types/components/hover-card/hover-card.d.ts +97 -0
- package/dist/types/components/hover-card/index.d.ts +2 -0
- package/dist/types/components/image-compare/image-compare.d.ts +54 -0
- package/dist/types/components/image-compare/index.d.ts +1 -0
- package/dist/types/components/inline-edit/index.d.ts +2 -0
- package/dist/types/components/inline-edit/inline-edit.d.ts +93 -0
- package/dist/types/components/json-viewer/index.d.ts +2 -0
- package/dist/types/components/json-viewer/json-viewer.d.ts +82 -0
- package/dist/types/components/mention-input/index.d.ts +2 -0
- package/dist/types/components/mention-input/mention-input.d.ts +87 -0
- package/dist/types/components/menu/menu.d.ts +23 -5
- package/dist/types/components/metric-card/index.d.ts +1 -0
- package/dist/types/components/metric-card/metric-card.d.ts +37 -0
- package/dist/types/components/multi-select/index.d.ts +2 -0
- package/dist/types/components/multi-select/multi-select.d.ts +73 -0
- package/dist/types/components/password-field/index.d.ts +2 -0
- package/dist/types/components/password-field/password-field.d.ts +34 -0
- package/dist/types/components/popover/popover.d.ts +1 -1
- package/dist/types/components/radio-cards/index.d.ts +1 -0
- package/dist/types/components/radio-cards/radio-cards.d.ts +42 -0
- package/dist/types/components/resizable-panels/index.d.ts +2 -0
- package/dist/types/components/resizable-panels/resizable-panels.d.ts +42 -0
- package/dist/types/components/scroll-area/index.d.ts +2 -0
- package/dist/types/components/scroll-area/scroll-area.d.ts +34 -0
- package/dist/types/components/search-field/index.d.ts +1 -0
- package/dist/types/components/search-field/search-field.d.ts +31 -0
- package/dist/types/components/segmented-control/index.d.ts +2 -0
- package/dist/types/components/segmented-control/segmented-control.d.ts +32 -0
- package/dist/types/components/select/select.d.ts +1 -1
- package/dist/types/components/signature-pad/index.d.ts +2 -0
- package/dist/types/components/signature-pad/signature-pad.d.ts +104 -0
- package/dist/types/components/slider/index.d.ts +1 -0
- package/dist/types/components/slider/slider.d.ts +70 -0
- package/dist/types/components/sortable-data-table/index.d.ts +1 -0
- package/dist/types/components/sortable-data-table/sortable-data-table.d.ts +76 -0
- package/dist/types/components/split-button/index.d.ts +2 -0
- package/dist/types/components/split-button/split-button.d.ts +55 -0
- package/dist/types/components/stepper/index.d.ts +2 -0
- package/dist/types/components/stepper/stepper.d.ts +85 -0
- package/dist/types/components/swipe-actions/index.d.ts +2 -0
- package/dist/types/components/swipe-actions/swipe-actions.d.ts +44 -0
- package/dist/types/components/tag-input/index.d.ts +2 -0
- package/dist/types/components/tag-input/tag-input.d.ts +66 -0
- package/dist/types/components/theme-root/theme-root.d.ts +9 -3
- package/dist/types/components/time-picker/index.d.ts +2 -0
- package/dist/types/components/time-picker/time-picker.d.ts +48 -0
- package/dist/types/components/timeline/index.d.ts +2 -0
- package/dist/types/components/timeline/timeline.d.ts +66 -0
- package/dist/types/components/toast/toast.d.ts +37 -2
- package/dist/types/components/toast-stack/index.d.ts +2 -0
- package/dist/types/components/toast-stack/toast-stack.d.ts +28 -0
- package/dist/types/components/tooltip/tooltip.d.ts +1 -1
- package/dist/types/components/tree-view/index.d.ts +1 -0
- package/dist/types/components/tree-view/tree-view.d.ts +47 -0
- package/dist/types/components/usage-meter/index.d.ts +2 -0
- package/dist/types/components/usage-meter/usage-meter.d.ts +83 -0
- package/dist/types/index.d.ts +40 -0
- package/dist/types/overlay/overlay-layer.d.ts +33 -0
- package/dist/types/overlay/overlay-portal.d.ts +7 -0
- package/dist/types/overlay/use-overlay-floating.d.ts +11 -1
- package/dist/types/styling/media.d.ts +1 -0
- package/dist/types/styling/theme-scope.d.ts +19 -0
- package/dist/types/styling/theme.d.ts +12 -0
- package/dist/types/utils/use-controlled-state.d.ts +2 -1
- package/dist/usage-meter-qyQ3rYVv.js +463 -0
- package/dist/usage-meter.js +2 -0
- package/dist/use-controlled-state-DpeVQZNR.js +20 -0
- package/dist/use-latest-callback-cj1OOQL6.js +11 -0
- package/dist/use-overlay-floating-DvJifLpF.js +31 -0
- package/package.json +175 -3
- package/dist/calendar-C9Yad_-w.js +0 -394
- package/dist/collection-registry-BTYi6zGh.js +0 -98
- package/dist/combobox-DrmjBbo7.js +0 -327
- package/dist/command-palette-V_2pEay7.js +0 -379
- package/dist/date-picker-ClUYBIBh.js +0 -250
- package/dist/field-anatomy-D2ToMeRa.js +0 -109
- package/dist/menu-DU60SMdt.js +0 -216
- package/dist/popover-BtN_0ejj.js +0 -113
- package/dist/select-BCS0-LVW.js +0 -286
- package/dist/theme-root-BiXXvQvr.js +0 -42
- package/dist/toast-iqelR-r0.js +0 -282
- package/dist/tooltip-CB-HC1js.js +0 -108
- package/dist/use-controlled-state-CVXDa-qM.js +0 -21
- package/dist/use-overlay-floating-efeqppiw.js +0 -19
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { n } from "./focus-ring-BK5W5_NY.js";
|
|
4
|
+
import { n as r, r as i } from "./media-8yrN85VT.js";
|
|
5
|
+
import { n as a, r as o, t as s } from "./roving-focus-CYlo_Kf8.js";
|
|
6
|
+
import { t as c } from "./use-controlled-state-DpeVQZNR.js";
|
|
7
|
+
import { t as l } from "./renderable-DzcIj1Lo.js";
|
|
8
|
+
import { createContext as u, useContext as d, useEffect as f, useId as p, useImperativeHandle as m, useLayoutEffect as h, useMemo as g, useRef as _, useState as v } from "react";
|
|
9
|
+
import { vars as y } from "@jfrader/tokens/vars";
|
|
10
|
+
import { jsx as b, jsxs as x } from "@emotion/react/jsx-runtime";
|
|
11
|
+
import { LayoutGroup as S, MotionConfig as C, motion as w, useReducedMotion as T } from "motion/react";
|
|
12
|
+
//#region src/components/segmented-control/segmented-control.tsx
|
|
13
|
+
var E = u(null), D = {
|
|
14
|
+
itemSelector: "[data-ui=\"segmented-control-item\"]:not([disabled])",
|
|
15
|
+
ownerSelector: "[data-ui=\"segmented-control\"]"
|
|
16
|
+
}, O = {
|
|
17
|
+
...D,
|
|
18
|
+
itemSelector: "[data-ui=\"segmented-control-item\"]"
|
|
19
|
+
}, k = {
|
|
20
|
+
type: "spring",
|
|
21
|
+
stiffness: 500,
|
|
22
|
+
damping: 40
|
|
23
|
+
}, A = e({
|
|
24
|
+
display: "inline-flex",
|
|
25
|
+
minInlineSize: 0,
|
|
26
|
+
maxInlineSize: "100%",
|
|
27
|
+
border: `1px solid ${y.color.borderControl}`,
|
|
28
|
+
borderRadius: y.radius.md,
|
|
29
|
+
backgroundColor: y.color.surfaceInset,
|
|
30
|
+
fontFamily: y.font.sans,
|
|
31
|
+
[r]: { borderColor: "CanvasText" }
|
|
32
|
+
}), j = e({
|
|
33
|
+
display: "flex",
|
|
34
|
+
position: "relative",
|
|
35
|
+
minInlineSize: 0,
|
|
36
|
+
overflowX: "auto",
|
|
37
|
+
padding: y.space[1],
|
|
38
|
+
gap: y.space[1],
|
|
39
|
+
borderRadius: "inherit",
|
|
40
|
+
borderInlineStart: "1px solid transparent",
|
|
41
|
+
borderInlineEnd: "1px solid transparent",
|
|
42
|
+
"&[data-overflow-start=\"true\"]": { borderInlineStartColor: y.color.borderControl },
|
|
43
|
+
"&[data-overflow-end=\"true\"]": { borderInlineEndColor: y.color.borderControl },
|
|
44
|
+
[r]: {
|
|
45
|
+
"&[data-overflow-start=\"true\"]": { borderInlineStartColor: "CanvasText" },
|
|
46
|
+
"&[data-overflow-end=\"true\"]": { borderInlineEndColor: "CanvasText" }
|
|
47
|
+
}
|
|
48
|
+
}), M = e({
|
|
49
|
+
appearance: "none",
|
|
50
|
+
position: "relative",
|
|
51
|
+
isolation: "isolate",
|
|
52
|
+
flexShrink: 0,
|
|
53
|
+
display: "inline-flex",
|
|
54
|
+
alignItems: "center",
|
|
55
|
+
justifyContent: "center",
|
|
56
|
+
gap: y.space[2],
|
|
57
|
+
boxSizing: "border-box",
|
|
58
|
+
border: "1px solid transparent",
|
|
59
|
+
borderRadius: y.radius.sm,
|
|
60
|
+
paddingBlock: y.space[1],
|
|
61
|
+
paddingInline: y.space[3],
|
|
62
|
+
background: "transparent",
|
|
63
|
+
color: y.color.textMuted,
|
|
64
|
+
fontFamily: "inherit",
|
|
65
|
+
fontWeight: y.fontWeight.medium,
|
|
66
|
+
lineHeight: y.lineHeight.base,
|
|
67
|
+
whiteSpace: "nowrap",
|
|
68
|
+
cursor: "pointer",
|
|
69
|
+
transitionProperty: "color, background-color, border-color",
|
|
70
|
+
transitionDuration: y.motion.duration.fast,
|
|
71
|
+
transitionTimingFunction: y.motion.easeStandard,
|
|
72
|
+
"&:hover:not(:disabled):not([aria-checked=\"true\"])": {
|
|
73
|
+
backgroundColor: y.color.surfaceHover,
|
|
74
|
+
color: y.color.text
|
|
75
|
+
},
|
|
76
|
+
"&[aria-checked=\"true\"]": {
|
|
77
|
+
borderColor: y.color.borderControl,
|
|
78
|
+
color: y.color.text
|
|
79
|
+
},
|
|
80
|
+
"&:focus-visible": { ...n },
|
|
81
|
+
"&:disabled": {
|
|
82
|
+
opacity: .55,
|
|
83
|
+
cursor: "not-allowed"
|
|
84
|
+
},
|
|
85
|
+
[i]: { transitionDuration: "0s" },
|
|
86
|
+
[r]: { "&[aria-checked=\"true\"]": {
|
|
87
|
+
borderColor: "Highlight",
|
|
88
|
+
color: "CanvasText"
|
|
89
|
+
} }
|
|
90
|
+
}), N = {
|
|
91
|
+
sm: e({
|
|
92
|
+
minBlockSize: y.space[8],
|
|
93
|
+
fontSize: y.textSize.sm
|
|
94
|
+
}),
|
|
95
|
+
md: e({
|
|
96
|
+
minBlockSize: y.space[10],
|
|
97
|
+
fontSize: y.textSize.sm
|
|
98
|
+
}),
|
|
99
|
+
lg: e({
|
|
100
|
+
minBlockSize: y.space[12],
|
|
101
|
+
fontSize: y.textSize.md
|
|
102
|
+
})
|
|
103
|
+
}, P = e({
|
|
104
|
+
"&[aria-checked=\"true\"]": {
|
|
105
|
+
color: y.color.accentContrast,
|
|
106
|
+
borderColor: y.color.accentContrast
|
|
107
|
+
},
|
|
108
|
+
[r]: { "&[aria-checked=\"true\"]": {
|
|
109
|
+
color: "CanvasText",
|
|
110
|
+
borderColor: "Highlight"
|
|
111
|
+
} }
|
|
112
|
+
}), F = e({
|
|
113
|
+
position: "absolute",
|
|
114
|
+
inset: 0,
|
|
115
|
+
zIndex: -1,
|
|
116
|
+
borderRadius: "inherit",
|
|
117
|
+
pointerEvents: "none",
|
|
118
|
+
[r]: {
|
|
119
|
+
backgroundColor: "Canvas",
|
|
120
|
+
boxShadow: "none"
|
|
121
|
+
}
|
|
122
|
+
}), I = {
|
|
123
|
+
soft: e({
|
|
124
|
+
backgroundColor: y.color.surfaceRaised,
|
|
125
|
+
boxShadow: y.shadow.raised
|
|
126
|
+
}),
|
|
127
|
+
solid: e({ backgroundColor: y.color.accent })
|
|
128
|
+
};
|
|
129
|
+
function L({ ref: e, variant: t, slotProps: n, style: r, ...i }) {
|
|
130
|
+
return /* @__PURE__ */ b("span", {
|
|
131
|
+
...n,
|
|
132
|
+
...i,
|
|
133
|
+
ref: e,
|
|
134
|
+
"aria-hidden": "true",
|
|
135
|
+
hidden: !1,
|
|
136
|
+
role: void 0,
|
|
137
|
+
tabIndex: void 0,
|
|
138
|
+
"data-ui": "segmented-control-selection",
|
|
139
|
+
children: void 0,
|
|
140
|
+
style: {
|
|
141
|
+
...n?.style,
|
|
142
|
+
...r,
|
|
143
|
+
position: "absolute",
|
|
144
|
+
inset: 0,
|
|
145
|
+
inlineSize: "auto",
|
|
146
|
+
blockSize: "auto",
|
|
147
|
+
pointerEvents: "none"
|
|
148
|
+
},
|
|
149
|
+
css: [
|
|
150
|
+
I[t],
|
|
151
|
+
F,
|
|
152
|
+
n?.css
|
|
153
|
+
]
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
var R = w.create(L);
|
|
157
|
+
function z({ ref: e, value: n, defaultValue: r, onValueChange: i, disabled: l = !1, size: u = "md", variant: d = "soft", label: y, onOptionIntent: x, slotProps: w, className: k, sx: M, children: N, onKeyDown: P, ...F }) {
|
|
158
|
+
let [I, L] = c(n, r, i), [R, z] = v(null), [B, V] = v(), H = _(null), U = _(null);
|
|
159
|
+
m(e, () => H.current, []);
|
|
160
|
+
let W = p(), G = T(), K = _(!1);
|
|
161
|
+
h(() => {
|
|
162
|
+
let e = H.current;
|
|
163
|
+
if (!e) return;
|
|
164
|
+
let t = () => {
|
|
165
|
+
let t = o(e, D);
|
|
166
|
+
V((s(t, R) ?? s(t, I) ?? t[0])?.dataset.value);
|
|
167
|
+
};
|
|
168
|
+
t();
|
|
169
|
+
let n = new MutationObserver(t);
|
|
170
|
+
return n.observe(e, {
|
|
171
|
+
subtree: !0,
|
|
172
|
+
childList: !0,
|
|
173
|
+
attributes: !0,
|
|
174
|
+
attributeFilter: ["disabled", "data-value"]
|
|
175
|
+
}), () => n.disconnect();
|
|
176
|
+
}), f(() => {
|
|
177
|
+
let e = H.current, t = U.current;
|
|
178
|
+
if (!e || !t) return;
|
|
179
|
+
let n = () => {
|
|
180
|
+
let n = o(e, O), r = t.getBoundingClientRect(), i = n[0]?.getBoundingClientRect(), a = n.at(-1)?.getBoundingClientRect(), s = getComputedStyle(e).direction === "rtl";
|
|
181
|
+
t.dataset.overflowStart = String(!!(i && (s ? i.right > r.right : i.left < r.left))), t.dataset.overflowEnd = String(!!(a && (s ? a.left < r.left : a.right > r.right)));
|
|
182
|
+
}, r = new ResizeObserver(n);
|
|
183
|
+
return r.observe(t), o(e, O).forEach((e) => r.observe(e)), t.addEventListener("scroll", n, { passive: !0 }), n(), () => {
|
|
184
|
+
r.disconnect(), t.removeEventListener("scroll", n);
|
|
185
|
+
};
|
|
186
|
+
}), f(() => {
|
|
187
|
+
let e = H.current, t = U.current;
|
|
188
|
+
if (!e || !t) return;
|
|
189
|
+
let n = o(e, O), r = e.ownerDocument.activeElement, i = n.includes(r) ? r : s(n, I);
|
|
190
|
+
if (i) {
|
|
191
|
+
let e = t.getBoundingClientRect(), n = i.getBoundingClientRect(), r = parseFloat(getComputedStyle(t).paddingInlineStart), a = e.left + r, o = e.right - r, s = n.left < a ? n.left - a : n.right > o ? n.right - o : 0;
|
|
192
|
+
s && t.scrollBy({
|
|
193
|
+
left: s,
|
|
194
|
+
behavior: G || !K.current ? "instant" : "smooth"
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
K.current = !0;
|
|
198
|
+
}, [
|
|
199
|
+
R,
|
|
200
|
+
I,
|
|
201
|
+
G
|
|
202
|
+
]);
|
|
203
|
+
let q = g(() => ({
|
|
204
|
+
value: I,
|
|
205
|
+
requestChange: L,
|
|
206
|
+
setFocused: z,
|
|
207
|
+
tabStop: B,
|
|
208
|
+
disabled: l,
|
|
209
|
+
size: u,
|
|
210
|
+
variant: d,
|
|
211
|
+
onOptionIntent: x,
|
|
212
|
+
selection: w?.selection,
|
|
213
|
+
reducedMotion: G
|
|
214
|
+
}), [
|
|
215
|
+
I,
|
|
216
|
+
L,
|
|
217
|
+
B,
|
|
218
|
+
l,
|
|
219
|
+
u,
|
|
220
|
+
d,
|
|
221
|
+
x,
|
|
222
|
+
w?.selection,
|
|
223
|
+
G
|
|
224
|
+
]), J = (e) => {
|
|
225
|
+
P?.(e);
|
|
226
|
+
let t = H.current;
|
|
227
|
+
if (!(e.defaultPrevented || !t || l) && (a(e, t, e.key === "ArrowUp" || e.key === "ArrowDown" ? "vertical" : "horizontal", D), e.defaultPrevented)) {
|
|
228
|
+
let e = t.ownerDocument.activeElement;
|
|
229
|
+
o(t, D).includes(e) && e.dataset.value !== void 0 && L(e.dataset.value);
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
return /* @__PURE__ */ b(E.Provider, {
|
|
233
|
+
value: q,
|
|
234
|
+
children: /* @__PURE__ */ b(C, {
|
|
235
|
+
reducedMotion: "user",
|
|
236
|
+
children: /* @__PURE__ */ b(S, {
|
|
237
|
+
id: W,
|
|
238
|
+
children: /* @__PURE__ */ b(t, {
|
|
239
|
+
className: k,
|
|
240
|
+
styles: A,
|
|
241
|
+
sx: M,
|
|
242
|
+
children: (e) => /* @__PURE__ */ b("div", {
|
|
243
|
+
...F,
|
|
244
|
+
ref: H,
|
|
245
|
+
role: "radiogroup",
|
|
246
|
+
"aria-label": y ?? F["aria-label"],
|
|
247
|
+
"aria-disabled": l || F["aria-disabled"],
|
|
248
|
+
"data-ui": "segmented-control",
|
|
249
|
+
onKeyDown: J,
|
|
250
|
+
className: e,
|
|
251
|
+
children: /* @__PURE__ */ b("div", {
|
|
252
|
+
...w?.track,
|
|
253
|
+
ref: U,
|
|
254
|
+
"aria-hidden": void 0,
|
|
255
|
+
hidden: !1,
|
|
256
|
+
role: void 0,
|
|
257
|
+
tabIndex: void 0,
|
|
258
|
+
"data-ui": "segmented-control-track",
|
|
259
|
+
css: [j, w?.track?.css],
|
|
260
|
+
children: N
|
|
261
|
+
})
|
|
262
|
+
})
|
|
263
|
+
})
|
|
264
|
+
})
|
|
265
|
+
})
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
z.displayName = "SegmentedControl";
|
|
269
|
+
function B({ ref: e, value: n, accessory: r, children: i, disabled: a, className: o, sx: s, onClick: c, onFocus: u, onPointerEnter: f, "aria-labelledby": m, "aria-describedby": h, ...g }) {
|
|
270
|
+
let _ = d(E);
|
|
271
|
+
if (!_) throw Error("SegmentedControl.Item must be rendered inside <SegmentedControl>.");
|
|
272
|
+
let v = p(), y = _.disabled || a, S = _.value === n, C = l(i), w = l(r);
|
|
273
|
+
return /* @__PURE__ */ b(t, {
|
|
274
|
+
className: o,
|
|
275
|
+
styles: [
|
|
276
|
+
M,
|
|
277
|
+
N[_.size],
|
|
278
|
+
_.variant === "solid" && P
|
|
279
|
+
],
|
|
280
|
+
sx: s,
|
|
281
|
+
children: (t) => /* @__PURE__ */ x("button", {
|
|
282
|
+
...g,
|
|
283
|
+
ref: e,
|
|
284
|
+
type: "button",
|
|
285
|
+
role: "radio",
|
|
286
|
+
"data-ui": "segmented-control-item",
|
|
287
|
+
"data-value": n,
|
|
288
|
+
"aria-checked": S,
|
|
289
|
+
disabled: y,
|
|
290
|
+
tabIndex: !y && _.tabStop === n ? 0 : -1,
|
|
291
|
+
"aria-labelledby": [m, C && `${v}-label`].filter(Boolean).join(" ") || void 0,
|
|
292
|
+
"aria-describedby": [h, w && `${v}-accessory`].filter(Boolean).join(" ") || void 0,
|
|
293
|
+
onClick: (e) => {
|
|
294
|
+
c?.(e), !e.defaultPrevented && !y && _.requestChange(n);
|
|
295
|
+
},
|
|
296
|
+
onFocus: (e) => {
|
|
297
|
+
u?.(e), y || (_.setFocused(n), _.onOptionIntent?.(n));
|
|
298
|
+
},
|
|
299
|
+
onPointerEnter: (e) => {
|
|
300
|
+
f?.(e), y || _.onOptionIntent?.(n);
|
|
301
|
+
},
|
|
302
|
+
className: t,
|
|
303
|
+
children: [
|
|
304
|
+
S && /* @__PURE__ */ b(R, {
|
|
305
|
+
variant: _.variant,
|
|
306
|
+
slotProps: _.selection,
|
|
307
|
+
layoutId: "selection",
|
|
308
|
+
initial: !1,
|
|
309
|
+
transition: _.reducedMotion ? { duration: 0 } : k
|
|
310
|
+
}),
|
|
311
|
+
C && /* @__PURE__ */ b("span", {
|
|
312
|
+
id: `${v}-label`,
|
|
313
|
+
children: i
|
|
314
|
+
}),
|
|
315
|
+
w && /* @__PURE__ */ b("span", {
|
|
316
|
+
id: `${v}-accessory`,
|
|
317
|
+
children: r
|
|
318
|
+
})
|
|
319
|
+
]
|
|
320
|
+
})
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
B.displayName = "SegmentedControl.Item";
|
|
324
|
+
var V = Object.assign(z, { Item: B });
|
|
325
|
+
//#endregion
|
|
326
|
+
export { V as t };
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { t as n } from "./use-controlled-state-DpeVQZNR.js";
|
|
4
|
+
import { t as r } from "./trigger-style-B1KVC8O1.js";
|
|
5
|
+
import { t as i } from "./overlay-layer-SeUyyEPD.js";
|
|
6
|
+
import { a, i as o, n as s, o as c, r as l, s as u, t as d } from "./listbox-style-WX-RASp1.js";
|
|
7
|
+
import { a as f, r as p, t as m } from "./collection-registry-k6JcD3Jr.js";
|
|
8
|
+
import { t as h } from "./overlay-portal-C4JZFq2M.js";
|
|
9
|
+
import { t as g } from "./use-overlay-floating-DvJifLpF.js";
|
|
10
|
+
import { createContext as _, useContext as v, useId as y, useLayoutEffect as b, useMemo as x, useRef as S, useState as C } from "react";
|
|
11
|
+
import { vars as w } from "@jfrader/tokens/vars";
|
|
12
|
+
import { jsx as T, jsxs as E } from "@emotion/react/jsx-runtime";
|
|
13
|
+
import { FloatingList as D, useClick as O, useDismiss as k, useInteractions as A, useListNavigation as j, useMergeRefs as M, useRole as N } from "@floating-ui/react";
|
|
14
|
+
//#region src/components/select/select.tsx
|
|
15
|
+
var P = 500, F = new Intl.Collator(void 0, {
|
|
16
|
+
usage: "search",
|
|
17
|
+
sensitivity: "base"
|
|
18
|
+
}), I = "✓", L = _(null), R = _(!1);
|
|
19
|
+
function z(e) {
|
|
20
|
+
let t = v(L);
|
|
21
|
+
if (!t) throw Error(`Select.${e} must be rendered inside <Select>.`);
|
|
22
|
+
return t;
|
|
23
|
+
}
|
|
24
|
+
function B() {
|
|
25
|
+
let e = z("Item");
|
|
26
|
+
if (!v(R)) throw Error("Select.Item must be rendered inside <Select.Content>.");
|
|
27
|
+
return e;
|
|
28
|
+
}
|
|
29
|
+
var V = e({
|
|
30
|
+
justifyContent: "flex-start",
|
|
31
|
+
minInlineSize: "180px",
|
|
32
|
+
"&[aria-expanded=\"true\"]": { backgroundColor: w.color.surfaceHover }
|
|
33
|
+
}), H = e({
|
|
34
|
+
overflow: "hidden",
|
|
35
|
+
textOverflow: "ellipsis",
|
|
36
|
+
whiteSpace: "nowrap",
|
|
37
|
+
"&[data-placeholder]": { color: w.color.textMuted }
|
|
38
|
+
});
|
|
39
|
+
function U({ value: e, defaultValue: t, onValueChange: r, open: i, defaultOpen: a = !1, onOpenChange: o, placement: s = "bottom-start", disabled: c = !1, name: l, children: u }) {
|
|
40
|
+
let d = y(), [p, m] = n(e, t, r), [h = !1, _] = n(i, a, o), [v, b] = C(null), [w, D] = C(!1), [M, P] = f(), [I, R] = C(null), z = S([]), B = S([]), V = S(null);
|
|
41
|
+
!h && w && (D(!1), b(null));
|
|
42
|
+
let { valuesByIndex: H, disabledIndices: U } = x(() => {
|
|
43
|
+
let e = [], t = /* @__PURE__ */ new Set();
|
|
44
|
+
return M.forEach((n, r) => {
|
|
45
|
+
n.index !== -1 && (e[n.index] = r, n.disabled && t.add(n.index));
|
|
46
|
+
}), {
|
|
47
|
+
valuesByIndex: e,
|
|
48
|
+
disabledIndices: t
|
|
49
|
+
};
|
|
50
|
+
}, [M]), W = p === void 0 ? void 0 : M.get(p), G = W && W.index !== -1 ? W.index : null, { refs: K, floatingStyles: q, context: J } = g({
|
|
51
|
+
open: h,
|
|
52
|
+
placement: s,
|
|
53
|
+
onOpenChange: (e) => _(e)
|
|
54
|
+
}), Y = O(J), X = N(J, { role: "listbox" }), ee = k(J, {
|
|
55
|
+
escapeKey: !0,
|
|
56
|
+
outsidePress: !0
|
|
57
|
+
}), te = j(J, {
|
|
58
|
+
listRef: z,
|
|
59
|
+
activeIndex: v,
|
|
60
|
+
onNavigate: b,
|
|
61
|
+
virtual: !0,
|
|
62
|
+
virtualItemRef: V,
|
|
63
|
+
loop: !0,
|
|
64
|
+
focusItemOnOpen: !0,
|
|
65
|
+
selectedIndex: w ? null : G,
|
|
66
|
+
disabledIndices: (e) => U.has(e)
|
|
67
|
+
}), { getReferenceProps: Z, getFloatingProps: Q, getItemProps: $ } = A([
|
|
68
|
+
Y,
|
|
69
|
+
X,
|
|
70
|
+
ee,
|
|
71
|
+
te
|
|
72
|
+
]), ne = x(() => {
|
|
73
|
+
let e = (e) => {
|
|
74
|
+
m(e), _(!1);
|
|
75
|
+
};
|
|
76
|
+
return {
|
|
77
|
+
baseId: d,
|
|
78
|
+
open: h,
|
|
79
|
+
disabled: c,
|
|
80
|
+
selectedValue: p,
|
|
81
|
+
activeIndex: v,
|
|
82
|
+
options: M,
|
|
83
|
+
triggerLabelling: I,
|
|
84
|
+
refs: K,
|
|
85
|
+
floatingStyles: q,
|
|
86
|
+
elementsRef: z,
|
|
87
|
+
labelsRef: B,
|
|
88
|
+
getReferenceProps: Z,
|
|
89
|
+
getFloatingProps: Q,
|
|
90
|
+
getItemProps: $,
|
|
91
|
+
selectValue: e,
|
|
92
|
+
matchTypeahead: (e) => {
|
|
93
|
+
let t = B.current, n = v ?? -1;
|
|
94
|
+
for (let r = 1; r <= t.length; r += 1) {
|
|
95
|
+
let i = (n + r) % t.length, a = t[i];
|
|
96
|
+
if (!(a == null || U.has(i)) && F.compare(a.slice(0, e.length), e) === 0) {
|
|
97
|
+
b(i), h || (D(!0), _(!0));
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
selectIndex: (t) => {
|
|
103
|
+
let n = H[t];
|
|
104
|
+
n === void 0 || U.has(t) || e(n);
|
|
105
|
+
},
|
|
106
|
+
requestOpenChange: _,
|
|
107
|
+
registration: P,
|
|
108
|
+
setTriggerLabelling: R
|
|
109
|
+
};
|
|
110
|
+
}, [
|
|
111
|
+
d,
|
|
112
|
+
h,
|
|
113
|
+
c,
|
|
114
|
+
p,
|
|
115
|
+
v,
|
|
116
|
+
M,
|
|
117
|
+
I,
|
|
118
|
+
K,
|
|
119
|
+
q,
|
|
120
|
+
Z,
|
|
121
|
+
Q,
|
|
122
|
+
$,
|
|
123
|
+
H,
|
|
124
|
+
U,
|
|
125
|
+
m,
|
|
126
|
+
_,
|
|
127
|
+
P
|
|
128
|
+
]);
|
|
129
|
+
return /* @__PURE__ */ E(L.Provider, {
|
|
130
|
+
value: ne,
|
|
131
|
+
children: [u, l !== void 0 && /* @__PURE__ */ T("input", {
|
|
132
|
+
type: "hidden",
|
|
133
|
+
name: l,
|
|
134
|
+
value: p ?? "",
|
|
135
|
+
disabled: c
|
|
136
|
+
})]
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
function W(e) {
|
|
140
|
+
return /* @__PURE__ */ T(i, { children: /* @__PURE__ */ T(U, { ...e }) });
|
|
141
|
+
}
|
|
142
|
+
W.displayName = "Select";
|
|
143
|
+
function G({ ref: e, id: n, disabled: i, onKeyDown: a, className: o, sx: s, ...c }) {
|
|
144
|
+
let { baseId: l, open: u, disabled: d, activeIndex: f, refs: p, getReferenceProps: m, selectIndex: h, matchTypeahead: g, requestOpenChange: _, setTriggerLabelling: v } = z("Trigger"), y = M([p.setReference, e]), x = S({
|
|
145
|
+
search: "",
|
|
146
|
+
lastKeyAt: 0
|
|
147
|
+
}), C = n ?? `${l}-trigger`, w = c["aria-labelledby"], E = c["aria-label"];
|
|
148
|
+
b(() => (v({
|
|
149
|
+
id: C,
|
|
150
|
+
labelledBy: w,
|
|
151
|
+
label: E
|
|
152
|
+
}), () => v(null)), [
|
|
153
|
+
C,
|
|
154
|
+
w,
|
|
155
|
+
E,
|
|
156
|
+
v
|
|
157
|
+
]);
|
|
158
|
+
let D = (e) => {
|
|
159
|
+
if (a?.(e), !(e.defaultPrevented || d || i)) {
|
|
160
|
+
if (e.key.length === 1 && e.key !== " " && !e.ctrlKey && !e.altKey && !e.metaKey) {
|
|
161
|
+
let t = performance.now(), n = x.current, r = (t - n.lastKeyAt > P ? "" : n.search) + e.key;
|
|
162
|
+
x.current = {
|
|
163
|
+
search: r,
|
|
164
|
+
lastKeyAt: t
|
|
165
|
+
}, g(r);
|
|
166
|
+
} else u && (e.key === "Tab" ? _(!1) : (e.key === "Enter" || e.key === " ") && f !== null && (e.preventDefault(), h(f)));
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
return /* @__PURE__ */ T(t, {
|
|
170
|
+
className: o,
|
|
171
|
+
styles: [r, V],
|
|
172
|
+
sx: s,
|
|
173
|
+
children: (e) => /* @__PURE__ */ T("button", {
|
|
174
|
+
type: "button",
|
|
175
|
+
...m({
|
|
176
|
+
...c,
|
|
177
|
+
id: C,
|
|
178
|
+
disabled: d || i,
|
|
179
|
+
onKeyDown: D
|
|
180
|
+
}),
|
|
181
|
+
ref: y,
|
|
182
|
+
"data-state": u ? "open" : "closed",
|
|
183
|
+
"data-ui": "select-trigger",
|
|
184
|
+
className: e
|
|
185
|
+
})
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
G.displayName = "Select.Trigger";
|
|
189
|
+
function K({ ref: e, placeholder: n, className: r, sx: i, ...a }) {
|
|
190
|
+
let { selectedValue: o, options: s } = z("Value"), c = o === void 0 ? void 0 : s.get(o)?.label, l = c === void 0;
|
|
191
|
+
return /* @__PURE__ */ T(t, {
|
|
192
|
+
className: r,
|
|
193
|
+
styles: H,
|
|
194
|
+
sx: i,
|
|
195
|
+
children: (t) => /* @__PURE__ */ T("span", {
|
|
196
|
+
...a,
|
|
197
|
+
ref: e,
|
|
198
|
+
"data-placeholder": l || void 0,
|
|
199
|
+
"data-ui": "select-value",
|
|
200
|
+
className: t,
|
|
201
|
+
children: l ? n : c
|
|
202
|
+
})
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
K.displayName = "Select.Value";
|
|
206
|
+
function q({ ref: e, style: n, onMouseDown: r, children: i, className: a, sx: o, ...s }) {
|
|
207
|
+
let { open: l, triggerLabelling: d, refs: f, floatingStyles: p, elementsRef: m, getFloatingProps: g } = z("Content"), _ = M([l ? f.setFloating : null, e]), v = s["aria-labelledby"] !== void 0 || s["aria-label"] !== void 0 ? {} : d?.labelledBy === void 0 ? d?.label === void 0 ? { "aria-labelledby": d?.id } : { "aria-label": d.label } : { "aria-labelledby": d.labelledBy }, y = (e) => {
|
|
208
|
+
r?.(e), e.preventDefault();
|
|
209
|
+
};
|
|
210
|
+
return /* @__PURE__ */ T(h, { children: /* @__PURE__ */ T(t, {
|
|
211
|
+
className: a,
|
|
212
|
+
styles: [u, c],
|
|
213
|
+
sx: o,
|
|
214
|
+
children: (e) => /* @__PURE__ */ T("div", {
|
|
215
|
+
...g({
|
|
216
|
+
...v,
|
|
217
|
+
...s,
|
|
218
|
+
onMouseDown: y
|
|
219
|
+
}),
|
|
220
|
+
ref: _,
|
|
221
|
+
hidden: !l,
|
|
222
|
+
"data-state": l ? "open" : "closed",
|
|
223
|
+
"data-ui": "select-listbox",
|
|
224
|
+
style: {
|
|
225
|
+
...n,
|
|
226
|
+
...p
|
|
227
|
+
},
|
|
228
|
+
className: e,
|
|
229
|
+
children: /* @__PURE__ */ T(D, {
|
|
230
|
+
elementsRef: m,
|
|
231
|
+
children: /* @__PURE__ */ T(R.Provider, {
|
|
232
|
+
value: !0,
|
|
233
|
+
children: i
|
|
234
|
+
})
|
|
235
|
+
})
|
|
236
|
+
})
|
|
237
|
+
}) });
|
|
238
|
+
}
|
|
239
|
+
q.displayName = "Select.Content";
|
|
240
|
+
function J({ ref: e, value: n, disabled: r = !1, onClick: i, children: c, className: u, sx: f, ...h }) {
|
|
241
|
+
let { baseId: g, selectedValue: _, activeIndex: v, labelsRef: y, getItemProps: b, selectValue: x, registration: C } = B(), w = S(null), { ref: D, index: O } = p(n, C, w, (e, t) => ({
|
|
242
|
+
index: e,
|
|
243
|
+
label: t,
|
|
244
|
+
disabled: r
|
|
245
|
+
}), {
|
|
246
|
+
labelsRef: y,
|
|
247
|
+
include: !r
|
|
248
|
+
}), k = M([D, e]), A = O !== -1 && v === O, j = _ === n, N = (e) => {
|
|
249
|
+
i?.(e), !(r || e.defaultPrevented) && x(n);
|
|
250
|
+
};
|
|
251
|
+
return /* @__PURE__ */ T(t, {
|
|
252
|
+
className: u,
|
|
253
|
+
styles: [
|
|
254
|
+
s,
|
|
255
|
+
d,
|
|
256
|
+
o
|
|
257
|
+
],
|
|
258
|
+
sx: f,
|
|
259
|
+
children: (e) => /* @__PURE__ */ E("div", {
|
|
260
|
+
...b({
|
|
261
|
+
id: m(g, n),
|
|
262
|
+
...h,
|
|
263
|
+
onClick: N
|
|
264
|
+
}),
|
|
265
|
+
ref: k,
|
|
266
|
+
role: "option",
|
|
267
|
+
"aria-selected": j,
|
|
268
|
+
"aria-disabled": r || void 0,
|
|
269
|
+
"data-active": A || void 0,
|
|
270
|
+
"data-ui": "select-item",
|
|
271
|
+
className: e,
|
|
272
|
+
children: [/* @__PURE__ */ T("span", {
|
|
273
|
+
ref: w,
|
|
274
|
+
css: a,
|
|
275
|
+
children: c
|
|
276
|
+
}), j && /* @__PURE__ */ T("span", {
|
|
277
|
+
"aria-hidden": "true",
|
|
278
|
+
css: l,
|
|
279
|
+
children: I
|
|
280
|
+
})]
|
|
281
|
+
})
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
J.displayName = "Select.Item";
|
|
285
|
+
var Y = Object.assign(W, {
|
|
286
|
+
Trigger: G,
|
|
287
|
+
Value: K,
|
|
288
|
+
Content: q,
|
|
289
|
+
Item: J
|
|
290
|
+
});
|
|
291
|
+
//#endregion
|
|
292
|
+
export { Y as t };
|
package/dist/select.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as Select } from "./select-
|
|
2
|
+
export { t as Select } from "./select-n_H52W1Z.js";
|