@jfrader/ui 0.4.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/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/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/use-overlay-floating.d.ts +11 -1
- package/dist/types/styling/media.d.ts +1 -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-DiMC2g_u.js +0 -327
- package/dist/command-palette-V_2pEay7.js +0 -379
- package/dist/date-picker-C29Uo4Tx.js +0 -250
- package/dist/field-anatomy-D2ToMeRa.js +0 -109
- package/dist/menu-CGPTNRnF.js +0 -216
- package/dist/popover-CdRXjQqI.js +0 -113
- package/dist/select-BgG7WgSh.js +0 -286
- package/dist/toast-CjmELMZZ.js +0 -283
- package/dist/tooltip-CaL3rKbV.js +0 -108
- package/dist/use-controlled-state-CVXDa-qM.js +0 -21
- package/dist/use-overlay-floating-Bit-f0FU.js +0 -31
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { t as n } from "./focus-ring-BK5W5_NY.js";
|
|
4
|
+
import { n as r, r as i } from "./media-8yrN85VT.js";
|
|
5
|
+
import { t as a } from "./use-latest-callback-cj1OOQL6.js";
|
|
6
|
+
import { useCallback as o, useEffect as s, useRef as c } from "react";
|
|
7
|
+
import { vars as l } from "@jfrader/tokens/vars";
|
|
8
|
+
import { createElement as u } from "@emotion/react";
|
|
9
|
+
import { jsx as d, jsxs as f } from "@emotion/react/jsx-runtime";
|
|
10
|
+
//#region src/components/scroll-area/scroll-area.tsx
|
|
11
|
+
var p = 900, m = .9, h = 1, g = e({
|
|
12
|
+
label: "scroll-area",
|
|
13
|
+
position: "relative",
|
|
14
|
+
display: "grid",
|
|
15
|
+
minInlineSize: 0,
|
|
16
|
+
minBlockSize: 0,
|
|
17
|
+
"--scroll-area-hit": l.space[8],
|
|
18
|
+
"--scroll-area-min-thumb": l.space[8],
|
|
19
|
+
"--scroll-area-fade": l.space[6],
|
|
20
|
+
"&:hover > [data-ui=\"scroll-area-track\"], &:focus-within > [data-ui=\"scroll-area-track\"], &[data-scrolling] > [data-ui=\"scroll-area-track\"], &[data-dragging] > [data-ui=\"scroll-area-track\"], &[data-scrollbars=\"always\"] > [data-ui=\"scroll-area-track\"]": { opacity: 1 },
|
|
21
|
+
"&:focus-within > [data-ui=\"scroll-area-viewport\"]": { maskImage: "none" },
|
|
22
|
+
[r]: { "& > [data-ui=\"scroll-area-track\"]": { display: "none" } }
|
|
23
|
+
}), _ = e({
|
|
24
|
+
label: "scroll-area-viewport",
|
|
25
|
+
minInlineSize: 0,
|
|
26
|
+
minBlockSize: 0,
|
|
27
|
+
maxBlockSize: "100%",
|
|
28
|
+
overflowX: "hidden",
|
|
29
|
+
overflowY: "auto",
|
|
30
|
+
"&:focus-visible": n,
|
|
31
|
+
maskImage: "linear-gradient(to bottom, transparent, black var(--fade-top), black calc(100% - var(--fade-bottom)), transparent), linear-gradient(to right, transparent, black var(--fade-left), black calc(100% - var(--fade-right)), transparent)",
|
|
32
|
+
maskComposite: "intersect",
|
|
33
|
+
"&[data-orientation=\"horizontal\"]": {
|
|
34
|
+
overflowX: "auto",
|
|
35
|
+
overflowY: "hidden"
|
|
36
|
+
},
|
|
37
|
+
"&[data-orientation=\"both\"]": {
|
|
38
|
+
overflowX: "auto",
|
|
39
|
+
overflowY: "auto"
|
|
40
|
+
},
|
|
41
|
+
"&[data-scrollbars=\"native\"]": { scrollbarWidth: "auto" },
|
|
42
|
+
"&:not([data-scrollbars=\"native\"])": {
|
|
43
|
+
scrollbarWidth: "none",
|
|
44
|
+
"&::-webkit-scrollbar": { display: "none" }
|
|
45
|
+
},
|
|
46
|
+
[r]: {
|
|
47
|
+
maskImage: "none",
|
|
48
|
+
"&:not([data-scrollbars=\"native\"])": {
|
|
49
|
+
scrollbarWidth: "auto",
|
|
50
|
+
"&::-webkit-scrollbar": { display: "block" }
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}), v = e({
|
|
54
|
+
display: "flow-root",
|
|
55
|
+
minInlineSize: "100%",
|
|
56
|
+
"&[data-orientation=\"horizontal\"], &[data-orientation=\"both\"]": { inlineSize: "max-content" }
|
|
57
|
+
}), y = e({
|
|
58
|
+
label: "scroll-area-track",
|
|
59
|
+
opacity: 0,
|
|
60
|
+
touchAction: "none",
|
|
61
|
+
userSelect: "none",
|
|
62
|
+
transition: `opacity ${l.motion.duration.base} ${l.motion.easeStandard}`,
|
|
63
|
+
"&[hidden]": { display: "none" },
|
|
64
|
+
[i]: { transition: "none" }
|
|
65
|
+
}), b = e({
|
|
66
|
+
label: "scroll-area-thumb",
|
|
67
|
+
"&::after": {
|
|
68
|
+
content: "\"\"",
|
|
69
|
+
position: "absolute",
|
|
70
|
+
backgroundColor: l.color.borderControl,
|
|
71
|
+
borderRadius: l.radius.full,
|
|
72
|
+
transition: `background-color ${l.motion.duration.fast} ${l.motion.easeStandard}`
|
|
73
|
+
},
|
|
74
|
+
"&[data-axis=\"block\"]::after": {
|
|
75
|
+
insetBlock: 0,
|
|
76
|
+
inlineSize: l.space[2],
|
|
77
|
+
insetInlineStart: `calc(50% - ${l.space[2]} / 2)`
|
|
78
|
+
},
|
|
79
|
+
"&[data-axis=\"inline\"]::after": {
|
|
80
|
+
insetInline: 0,
|
|
81
|
+
blockSize: l.space[2],
|
|
82
|
+
insetBlockStart: `calc(50% - ${l.space[2]} / 2)`
|
|
83
|
+
},
|
|
84
|
+
"&:hover::after": { backgroundColor: l.color.text },
|
|
85
|
+
[i]: { "&::after": { transition: "none" } }
|
|
86
|
+
}), x = {
|
|
87
|
+
block: {
|
|
88
|
+
position: "absolute",
|
|
89
|
+
insetInlineStart: "auto",
|
|
90
|
+
insetInlineEnd: 0,
|
|
91
|
+
insetBlockStart: 0,
|
|
92
|
+
insetBlockEnd: "auto",
|
|
93
|
+
inlineSize: "var(--scroll-area-hit)",
|
|
94
|
+
blockSize: "var(--track-size)",
|
|
95
|
+
transform: "none"
|
|
96
|
+
},
|
|
97
|
+
inline: {
|
|
98
|
+
position: "absolute",
|
|
99
|
+
insetInlineStart: 0,
|
|
100
|
+
insetInlineEnd: "auto",
|
|
101
|
+
insetBlockStart: "auto",
|
|
102
|
+
insetBlockEnd: 0,
|
|
103
|
+
blockSize: "var(--scroll-area-hit)",
|
|
104
|
+
inlineSize: "var(--track-size)",
|
|
105
|
+
transform: "none"
|
|
106
|
+
}
|
|
107
|
+
}, S = {
|
|
108
|
+
block: {
|
|
109
|
+
position: "absolute",
|
|
110
|
+
insetBlockStart: 0,
|
|
111
|
+
insetBlockEnd: "auto",
|
|
112
|
+
insetInlineStart: 0,
|
|
113
|
+
insetInlineEnd: "auto",
|
|
114
|
+
inlineSize: "100%",
|
|
115
|
+
blockSize: "var(--thumb-size)",
|
|
116
|
+
transform: "translateY(var(--thumb-position))"
|
|
117
|
+
},
|
|
118
|
+
inline: {
|
|
119
|
+
position: "absolute",
|
|
120
|
+
insetBlockStart: 0,
|
|
121
|
+
insetBlockEnd: "auto",
|
|
122
|
+
left: 0,
|
|
123
|
+
right: "auto",
|
|
124
|
+
blockSize: "100%",
|
|
125
|
+
inlineSize: "var(--thumb-size)",
|
|
126
|
+
transform: "translateX(var(--thumb-position))"
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
function C(e, t) {
|
|
130
|
+
let n = typeof e == "function" ? e(t) : void 0;
|
|
131
|
+
return e && typeof e != "function" && (e.current = t), () => {
|
|
132
|
+
typeof n == "function" ? n() : typeof e == "function" ? e(null) : e && (e.current = null);
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
function w({ ref: e, children: n, className: r, sx: i, orientation: l = "vertical", fade: w, scrollbars: T = "auto", hideDelay: E = p, maxBlockSize: D, snap: O, wheelToHorizontal: k = !1, onScroll: A, onEdgeChange: j, slotProps: M, ...N }) {
|
|
136
|
+
let P = c(null), F = c(null), I = c(/* @__PURE__ */ new WeakSet()), L = c({}), R = c({}), z = c(null), B = a(j), V = M?.viewport?.ref, H = o((e) => {
|
|
137
|
+
P.current = e;
|
|
138
|
+
let t = C(V, e);
|
|
139
|
+
return () => {
|
|
140
|
+
P.current = null, t();
|
|
141
|
+
};
|
|
142
|
+
}, [V]);
|
|
143
|
+
s(() => {
|
|
144
|
+
let e = P.current, t = F.current, n = e?.ownerDocument.defaultView, r = e?.parentElement;
|
|
145
|
+
if (!e || !t || !n || !r) return;
|
|
146
|
+
let i = 0, a = 0, o, s, c = {
|
|
147
|
+
block: {
|
|
148
|
+
length: 0,
|
|
149
|
+
thumb: 0,
|
|
150
|
+
offset: 0,
|
|
151
|
+
maximum: 0
|
|
152
|
+
},
|
|
153
|
+
inline: {
|
|
154
|
+
length: 0,
|
|
155
|
+
thumb: 0,
|
|
156
|
+
offset: 0,
|
|
157
|
+
maximum: 0
|
|
158
|
+
}
|
|
159
|
+
}, u = () => n.getComputedStyle(e).direction === "rtl", d = () => {
|
|
160
|
+
r.setAttribute("data-scrolling", ""), n.clearTimeout(a), a = n.setTimeout(() => r.removeAttribute("data-scrolling"), Number.isFinite(E) ? Math.max(0, E) : p);
|
|
161
|
+
}, f = () => {
|
|
162
|
+
n.cancelAnimationFrame(i), i = 0;
|
|
163
|
+
let t = l === "horizontal" ? 0 : Math.max(0, e.scrollHeight - e.clientHeight), a = l === "vertical" ? 0 : Math.max(0, e.scrollWidth - e.clientWidth), s = Math.max(0, Math.min(a, u() ? a + e.scrollLeft : e.scrollLeft)), d = Math.max(0, Math.min(t, e.scrollTop)), f = {
|
|
164
|
+
top: d > h,
|
|
165
|
+
bottom: t - d > h,
|
|
166
|
+
left: s > h,
|
|
167
|
+
right: a - s > h
|
|
168
|
+
};
|
|
169
|
+
(!o || Object.keys(f).some((e) => f[e] !== o?.[e])) && (o = f, B(f));
|
|
170
|
+
for (let t of Object.keys(f)) e.style.setProperty(`--fade-${t}`, f[t] ? "var(--scroll-area-fade)" : "0px");
|
|
171
|
+
let p = parseFloat(n.getComputedStyle(L.current.block).width) || 0, m = parseFloat(n.getComputedStyle(r).getPropertyValue("--scroll-area-min-thumb")) || p;
|
|
172
|
+
for (let n of ["block", "inline"]) {
|
|
173
|
+
let r = n === "block", i = r ? e.clientHeight : e.clientWidth, o = r ? t : a, l = Math.max(0, i - ((r ? a : t) > 0 ? p : 0)), u = Math.min(l, Math.max(m, l * i / (i + o || 1))), f = r ? d : s, h = o > 0 ? f / o * (l - u) : 0;
|
|
174
|
+
c[n] = {
|
|
175
|
+
length: l,
|
|
176
|
+
thumb: u,
|
|
177
|
+
maximum: o,
|
|
178
|
+
offset: f
|
|
179
|
+
};
|
|
180
|
+
let g = L.current[n], _ = R.current[n];
|
|
181
|
+
g && _ && (g.hidden = o <= 0 || T === "native", g.style.setProperty("--track-size", `${l}px`), _.style.setProperty("--thumb-size", `${u}px`), _.style.setProperty("--thumb-position", `${h}px`));
|
|
182
|
+
}
|
|
183
|
+
}, g = () => {
|
|
184
|
+
i ||= n.requestAnimationFrame(f);
|
|
185
|
+
}, _ = (t, n, r = "auto") => {
|
|
186
|
+
let i = Math.max(0, Math.min(c[t].maximum, n));
|
|
187
|
+
e.scrollTo(t === "block" ? {
|
|
188
|
+
top: i,
|
|
189
|
+
behavior: r
|
|
190
|
+
} : {
|
|
191
|
+
left: u() ? i - c.inline.maximum : i,
|
|
192
|
+
behavior: r
|
|
193
|
+
});
|
|
194
|
+
}, v = (t) => {
|
|
195
|
+
if (!s || t && t.pointerId !== s.pointerId) return;
|
|
196
|
+
let n = s;
|
|
197
|
+
s = void 0, e.style.scrollSnapType = n.snap, r.removeAttribute("data-dragging"), n.track.hasPointerCapture(n.pointerId) && n.track.releasePointerCapture(n.pointerId), d();
|
|
198
|
+
};
|
|
199
|
+
z.current = {
|
|
200
|
+
end: v,
|
|
201
|
+
press: (t, i) => {
|
|
202
|
+
if (i.defaultPrevented || i.button !== 0 || i.isPrimary === !1 || T === "native") return;
|
|
203
|
+
f();
|
|
204
|
+
let a = L.current[t], o = R.current[t];
|
|
205
|
+
if (!a || !o || a.hidden) return;
|
|
206
|
+
i.preventDefault(), d();
|
|
207
|
+
let l = t === "block" ? i.clientY : i.clientX;
|
|
208
|
+
if (o.contains(i.target)) v(), s = {
|
|
209
|
+
axis: t,
|
|
210
|
+
pointerId: i.pointerId,
|
|
211
|
+
start: l,
|
|
212
|
+
offset: c[t].offset,
|
|
213
|
+
track: a,
|
|
214
|
+
snap: e.style.scrollSnapType
|
|
215
|
+
}, e.style.scrollSnapType = "none", r.setAttribute("data-dragging", ""), a.setPointerCapture(i.pointerId);
|
|
216
|
+
else {
|
|
217
|
+
let r = o.getBoundingClientRect(), i = l < (t === "block" ? r.top : r.left) ? -1 : 1;
|
|
218
|
+
_(t, c[t].offset + i * m * (t === "block" ? e.clientHeight : e.clientWidth), n.matchMedia("(prefers-reduced-motion: reduce)").matches ? "auto" : "smooth");
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
move: (e) => {
|
|
222
|
+
if (!s || e.pointerId !== s.pointerId || e.defaultPrevented) return;
|
|
223
|
+
let t = c[s.axis], n = t.length - t.thumb;
|
|
224
|
+
n <= 0 || _(s.axis, s.offset + ((s.axis === "block" ? e.clientY : e.clientX) - s.start) / n * t.maximum);
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
let y = (t) => {
|
|
228
|
+
if (I.current.has(t)) {
|
|
229
|
+
t.preventDefault();
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
if (!k || l !== "horizontal" || !e.contains(t.target) || t.defaultPrevented || t.ctrlKey || t.metaKey || t.deltaX !== 0 || t.deltaY === 0) return;
|
|
233
|
+
f();
|
|
234
|
+
let r = parseFloat(n.getComputedStyle(e).lineHeight) || parseFloat(n.getComputedStyle(e).fontSize), i = t.deltaY * ([
|
|
235
|
+
1,
|
|
236
|
+
r,
|
|
237
|
+
e.clientWidth
|
|
238
|
+
][t.deltaMode] ?? 1) * (u() ? -1 : 1), { offset: a, maximum: o } = c.inline;
|
|
239
|
+
i < 0 && a <= 0 || i > 0 && a >= o || (t.preventDefault(), _("inline", a + i));
|
|
240
|
+
}, b = () => {
|
|
241
|
+
g(), d();
|
|
242
|
+
}, x = new n.ResizeObserver(g);
|
|
243
|
+
x.observe(e), x.observe(t);
|
|
244
|
+
let S = new n.MutationObserver(g);
|
|
245
|
+
return S.observe(t, {
|
|
246
|
+
subtree: !0,
|
|
247
|
+
childList: !0,
|
|
248
|
+
characterData: !0,
|
|
249
|
+
attributes: !0
|
|
250
|
+
}), e.addEventListener("scroll", b), k && l === "horizontal" && e.ownerDocument.addEventListener("wheel", y, { passive: !1 }), g(), () => {
|
|
251
|
+
v(), x.disconnect(), S.disconnect(), e.removeEventListener("scroll", b), e.ownerDocument.removeEventListener("wheel", y), n.cancelAnimationFrame(i), n.clearTimeout(a), r.removeAttribute("data-scrolling"), z.current = null;
|
|
252
|
+
};
|
|
253
|
+
}, [
|
|
254
|
+
l,
|
|
255
|
+
T,
|
|
256
|
+
E,
|
|
257
|
+
k,
|
|
258
|
+
B
|
|
259
|
+
]);
|
|
260
|
+
let { ref: U, css: W, className: G, style: K, onScroll: q, onWheel: J, onWheelCapture: Y, ...X } = M?.viewport ?? {}, Z = M?.track, Q = M?.thumb, $ = w !== void 0 && Number.isFinite(w) ? { "--scroll-area-fade": `${Math.max(0, w)}px` } : void 0;
|
|
261
|
+
return /* @__PURE__ */ d(t, {
|
|
262
|
+
className: r,
|
|
263
|
+
styles: g,
|
|
264
|
+
sx: i,
|
|
265
|
+
children: (t) => /* @__PURE__ */ f("div", {
|
|
266
|
+
...N,
|
|
267
|
+
ref: e,
|
|
268
|
+
"data-ui": "scroll-area",
|
|
269
|
+
"data-scrollbars": T,
|
|
270
|
+
className: t,
|
|
271
|
+
style: {
|
|
272
|
+
...$,
|
|
273
|
+
...N.style
|
|
274
|
+
},
|
|
275
|
+
onWheel: (e) => {
|
|
276
|
+
N.onWheel?.(e), e.defaultPrevented && I.current.add(e.nativeEvent);
|
|
277
|
+
},
|
|
278
|
+
onWheelCapture: (e) => {
|
|
279
|
+
N.onWheelCapture?.(e), e.defaultPrevented && I.current.add(e.nativeEvent);
|
|
280
|
+
},
|
|
281
|
+
children: [/* @__PURE__ */ d("div", {
|
|
282
|
+
...X,
|
|
283
|
+
ref: H,
|
|
284
|
+
css: [_, W],
|
|
285
|
+
className: G,
|
|
286
|
+
"data-ui": "scroll-area-viewport",
|
|
287
|
+
"data-orientation": l,
|
|
288
|
+
"data-scrollbars": T,
|
|
289
|
+
tabIndex: X.tabIndex ?? 0,
|
|
290
|
+
role: X.role ?? (X["aria-label"] || X["aria-labelledby"] ? "region" : void 0),
|
|
291
|
+
style: {
|
|
292
|
+
...K,
|
|
293
|
+
...D === void 0 ? {} : { maxBlockSize: D },
|
|
294
|
+
...O === void 0 ? {} : { scrollSnapType: O }
|
|
295
|
+
},
|
|
296
|
+
onScroll: (e) => {
|
|
297
|
+
q?.(e), A?.(e);
|
|
298
|
+
},
|
|
299
|
+
onWheel: (e) => {
|
|
300
|
+
J?.(e), e.defaultPrevented && I.current.add(e.nativeEvent);
|
|
301
|
+
},
|
|
302
|
+
onWheelCapture: (e) => {
|
|
303
|
+
Y?.(e), e.defaultPrevented && I.current.add(e.nativeEvent);
|
|
304
|
+
},
|
|
305
|
+
children: /* @__PURE__ */ d("div", {
|
|
306
|
+
ref: F,
|
|
307
|
+
css: v,
|
|
308
|
+
"data-orientation": l,
|
|
309
|
+
"data-ui": "scroll-area-content",
|
|
310
|
+
children: n
|
|
311
|
+
})
|
|
312
|
+
}), ["block", "inline"].map((e) => /* @__PURE__ */ u("div", {
|
|
313
|
+
...Z,
|
|
314
|
+
key: e,
|
|
315
|
+
ref: (t) => {
|
|
316
|
+
t && (L.current[e] = t);
|
|
317
|
+
let n = C(Z?.ref, t);
|
|
318
|
+
return () => {
|
|
319
|
+
delete L.current[e], n();
|
|
320
|
+
};
|
|
321
|
+
},
|
|
322
|
+
css: [y, Z?.css],
|
|
323
|
+
style: {
|
|
324
|
+
...Z?.style,
|
|
325
|
+
...x[e]
|
|
326
|
+
},
|
|
327
|
+
"data-ui": "scroll-area-track",
|
|
328
|
+
"data-axis": e,
|
|
329
|
+
"aria-hidden": "true",
|
|
330
|
+
tabIndex: void 0,
|
|
331
|
+
hidden: !0,
|
|
332
|
+
onPointerDown: (t) => {
|
|
333
|
+
Z?.onPointerDown?.(t), z.current?.press(e, t);
|
|
334
|
+
},
|
|
335
|
+
onPointerMove: (e) => {
|
|
336
|
+
Z?.onPointerMove?.(e), z.current?.move(e);
|
|
337
|
+
},
|
|
338
|
+
onPointerUp: (e) => {
|
|
339
|
+
Z?.onPointerUp?.(e), z.current?.end(e);
|
|
340
|
+
},
|
|
341
|
+
onPointerCancel: (e) => {
|
|
342
|
+
Z?.onPointerCancel?.(e), z.current?.end(e);
|
|
343
|
+
},
|
|
344
|
+
onLostPointerCapture: (e) => {
|
|
345
|
+
Z?.onLostPointerCapture?.(e), z.current?.end(e);
|
|
346
|
+
}
|
|
347
|
+
}, /* @__PURE__ */ d("div", {
|
|
348
|
+
...Q,
|
|
349
|
+
ref: (t) => {
|
|
350
|
+
t && (R.current[e] = t);
|
|
351
|
+
let n = C(Q?.ref, t);
|
|
352
|
+
return () => {
|
|
353
|
+
delete R.current[e], n();
|
|
354
|
+
};
|
|
355
|
+
},
|
|
356
|
+
css: [b, Q?.css],
|
|
357
|
+
style: {
|
|
358
|
+
...Q?.style,
|
|
359
|
+
...S[e]
|
|
360
|
+
},
|
|
361
|
+
"data-ui": "scroll-area-thumb",
|
|
362
|
+
"data-axis": e,
|
|
363
|
+
"aria-hidden": "true",
|
|
364
|
+
tabIndex: void 0
|
|
365
|
+
})))]
|
|
366
|
+
})
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
w.displayName = "ScrollArea";
|
|
370
|
+
//#endregion
|
|
371
|
+
export { w as t };
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { t as n } from "./focus-ring-BK5W5_NY.js";
|
|
4
|
+
import { n as r, r as i } from "./media-8yrN85VT.js";
|
|
5
|
+
import { t as a } from "./use-controlled-state-DpeVQZNR.js";
|
|
6
|
+
import { t as o } from "./input-control-DmMuAuPS.js";
|
|
7
|
+
import { a as s, n as c, r as ee, t as l } from "./field-anatomy-COVdNpf5.js";
|
|
8
|
+
import { useEffect as u, useRef as d } from "react";
|
|
9
|
+
import { vars as f } from "@jfrader/tokens/vars";
|
|
10
|
+
import { jsx as p, jsxs as m } from "@emotion/react/jsx-runtime";
|
|
11
|
+
import { useMergeRefs as h } from "@floating-ui/react";
|
|
12
|
+
//#region src/components/search-field/search-field.tsx
|
|
13
|
+
var g = e({
|
|
14
|
+
display: "grid",
|
|
15
|
+
gap: f.space[1],
|
|
16
|
+
inlineSize: "100%",
|
|
17
|
+
minInlineSize: 0
|
|
18
|
+
}), te = e({
|
|
19
|
+
display: "flex",
|
|
20
|
+
alignItems: "center",
|
|
21
|
+
minInlineSize: 0,
|
|
22
|
+
paddingInline: f.space[2],
|
|
23
|
+
borderRadius: f.radius.sm,
|
|
24
|
+
"&[data-disabled]": {
|
|
25
|
+
opacity: .55,
|
|
26
|
+
cursor: "not-allowed"
|
|
27
|
+
},
|
|
28
|
+
"&[aria-invalid=\"true\"]:not(:focus-within)": { borderColor: f.color.dangerText },
|
|
29
|
+
[r]: { borderColor: "CanvasText" }
|
|
30
|
+
}), _ = {
|
|
31
|
+
sm: e({
|
|
32
|
+
blockSize: f.space[8],
|
|
33
|
+
fontSize: f.textSize.sm,
|
|
34
|
+
"--search-action-size": f.space[6],
|
|
35
|
+
"--search-control-size": f.space[8]
|
|
36
|
+
}),
|
|
37
|
+
md: e({
|
|
38
|
+
blockSize: f.space[10],
|
|
39
|
+
fontSize: f.textSize.sm,
|
|
40
|
+
"--search-action-size": f.space[8],
|
|
41
|
+
"--search-control-size": f.space[10]
|
|
42
|
+
}),
|
|
43
|
+
lg: e({
|
|
44
|
+
blockSize: f.space[12],
|
|
45
|
+
fontSize: f.textSize.md,
|
|
46
|
+
"--search-action-size": f.space[8],
|
|
47
|
+
"--search-control-size": f.space[12]
|
|
48
|
+
})
|
|
49
|
+
}, v = e({
|
|
50
|
+
display: "inline-flex",
|
|
51
|
+
flexShrink: 0,
|
|
52
|
+
inlineSize: f.space[4],
|
|
53
|
+
blockSize: f.space[4],
|
|
54
|
+
color: f.color.textMuted,
|
|
55
|
+
"& > svg": {
|
|
56
|
+
inlineSize: "100%",
|
|
57
|
+
blockSize: "100%"
|
|
58
|
+
}
|
|
59
|
+
}), y = e({
|
|
60
|
+
flex: "1 1 0%",
|
|
61
|
+
minInlineSize: 0,
|
|
62
|
+
blockSize: "var(--search-control-size)",
|
|
63
|
+
margin: 0,
|
|
64
|
+
paddingInline: f.space[2],
|
|
65
|
+
border: 0,
|
|
66
|
+
outline: "none",
|
|
67
|
+
backgroundColor: "transparent",
|
|
68
|
+
color: f.color.text,
|
|
69
|
+
fontFamily: f.font.sans,
|
|
70
|
+
fontSize: "inherit",
|
|
71
|
+
lineHeight: f.lineHeight.base,
|
|
72
|
+
"&::placeholder": { color: f.color.textSubtle },
|
|
73
|
+
"&:disabled": { cursor: "not-allowed" },
|
|
74
|
+
"&::-webkit-search-cancel-button, &::-webkit-search-decoration": {
|
|
75
|
+
appearance: "none",
|
|
76
|
+
display: "none"
|
|
77
|
+
},
|
|
78
|
+
"@media (pointer: coarse)": { fontSize: f.textSize.md }
|
|
79
|
+
}), b = e({
|
|
80
|
+
display: "flex",
|
|
81
|
+
alignItems: "center",
|
|
82
|
+
justifyContent: "center",
|
|
83
|
+
flexShrink: 0,
|
|
84
|
+
inlineSize: "var(--search-action-size)",
|
|
85
|
+
blockSize: "var(--search-action-size)"
|
|
86
|
+
}), x = e({
|
|
87
|
+
display: "inline-flex",
|
|
88
|
+
alignItems: "center",
|
|
89
|
+
justifyContent: "center",
|
|
90
|
+
inlineSize: "100%",
|
|
91
|
+
blockSize: "100%",
|
|
92
|
+
padding: 0,
|
|
93
|
+
border: "1px solid transparent",
|
|
94
|
+
borderRadius: f.radius.sm,
|
|
95
|
+
color: f.color.textMuted,
|
|
96
|
+
backgroundColor: "transparent",
|
|
97
|
+
cursor: "pointer",
|
|
98
|
+
transitionProperty: "background-color, color, opacity, transform",
|
|
99
|
+
transitionDuration: f.motion.duration.fast,
|
|
100
|
+
transitionTimingFunction: f.motion.easeStandard,
|
|
101
|
+
"&:hover:not(:disabled)": {
|
|
102
|
+
backgroundColor: f.color.surfaceHover,
|
|
103
|
+
color: f.color.text
|
|
104
|
+
},
|
|
105
|
+
"&:focus-visible": n,
|
|
106
|
+
"&:disabled": { cursor: "not-allowed" },
|
|
107
|
+
"&[data-enter]": { "@starting-style": {
|
|
108
|
+
opacity: 0,
|
|
109
|
+
transform: "scale(0.9)"
|
|
110
|
+
} },
|
|
111
|
+
[i]: {
|
|
112
|
+
transitionDuration: "0s",
|
|
113
|
+
transform: "none",
|
|
114
|
+
"&[data-enter]": { "@starting-style": {
|
|
115
|
+
opacity: 1,
|
|
116
|
+
transform: "none"
|
|
117
|
+
} }
|
|
118
|
+
},
|
|
119
|
+
[r]: {
|
|
120
|
+
borderColor: "ButtonText",
|
|
121
|
+
color: "ButtonText"
|
|
122
|
+
}
|
|
123
|
+
}), S = { clear: "Clear search" }, C = /* @__PURE__ */ m("svg", {
|
|
124
|
+
"aria-hidden": !0,
|
|
125
|
+
viewBox: "0 0 24 24",
|
|
126
|
+
fill: "none",
|
|
127
|
+
stroke: "currentColor",
|
|
128
|
+
strokeWidth: "2",
|
|
129
|
+
children: [/* @__PURE__ */ p("circle", {
|
|
130
|
+
cx: "10.5",
|
|
131
|
+
cy: "10.5",
|
|
132
|
+
r: "6.5"
|
|
133
|
+
}), /* @__PURE__ */ p("path", { d: "m16 16 5 5" })]
|
|
134
|
+
}), w = /* @__PURE__ */ p("svg", {
|
|
135
|
+
"aria-hidden": !0,
|
|
136
|
+
viewBox: "0 0 24 24",
|
|
137
|
+
fill: "none",
|
|
138
|
+
stroke: "currentColor",
|
|
139
|
+
strokeWidth: "2",
|
|
140
|
+
children: /* @__PURE__ */ p("path", { d: "m6 6 12 12M18 6 6 18" })
|
|
141
|
+
});
|
|
142
|
+
function T({ ref: e, value: n, defaultValue: r = "", onValueChange: i, label: f, description: T, error: E, size: ne = "md", clearable: D = !0, messages: O, searchIcon: k = C, clearIcon: A = w, slotProps: j, className: M, sx: N, dir: P, required: F, disabled: I, readOnly: L, onChange: R, onKeyDown: z, id: B, "aria-describedby": V, "aria-invalid": H, ...U }) {
|
|
143
|
+
let W = s({
|
|
144
|
+
id: B,
|
|
145
|
+
description: T,
|
|
146
|
+
error: E,
|
|
147
|
+
"aria-describedby": V,
|
|
148
|
+
"aria-invalid": H
|
|
149
|
+
}), G = d(null), K = h([G, e]), q = d(r), J = d(!1), [Y = "", X] = a(n, q.current, (e) => {
|
|
150
|
+
J.current || i?.(e);
|
|
151
|
+
}), Z = d({
|
|
152
|
+
value: n,
|
|
153
|
+
query: Y
|
|
154
|
+
});
|
|
155
|
+
Z.current = {
|
|
156
|
+
value: n,
|
|
157
|
+
query: Y
|
|
158
|
+
};
|
|
159
|
+
let Q = d(!1);
|
|
160
|
+
u(() => {
|
|
161
|
+
Q.current = !0;
|
|
162
|
+
}, []), u(() => {
|
|
163
|
+
let e = G.current, t = e?.form;
|
|
164
|
+
if (!t || !e) return;
|
|
165
|
+
let n = !0, r = (t) => {
|
|
166
|
+
queueMicrotask(() => {
|
|
167
|
+
if (!n || t.defaultPrevented) return;
|
|
168
|
+
let r = Z.current.value === void 0 ? q.current : Z.current.query;
|
|
169
|
+
e.value = r, J.current = !0;
|
|
170
|
+
try {
|
|
171
|
+
X(r);
|
|
172
|
+
} finally {
|
|
173
|
+
J.current = !1;
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
};
|
|
177
|
+
return t.addEventListener("reset", r), () => {
|
|
178
|
+
n = !1, t.removeEventListener("reset", r);
|
|
179
|
+
};
|
|
180
|
+
}, [X, U.form]);
|
|
181
|
+
let $ = () => {
|
|
182
|
+
X(""), G.current?.focus();
|
|
183
|
+
}, re = [M, j?.root?.className].filter(Boolean).join(" ") || void 0;
|
|
184
|
+
return /* @__PURE__ */ p(t, {
|
|
185
|
+
className: re,
|
|
186
|
+
styles: [g, j?.root?.css],
|
|
187
|
+
sx: N,
|
|
188
|
+
children: (e) => /* @__PURE__ */ m("div", {
|
|
189
|
+
"data-ui": "search-field",
|
|
190
|
+
dir: P,
|
|
191
|
+
className: e,
|
|
192
|
+
children: [
|
|
193
|
+
/* @__PURE__ */ p(ee, {
|
|
194
|
+
htmlFor: W.id,
|
|
195
|
+
required: F,
|
|
196
|
+
part: j?.label,
|
|
197
|
+
children: f
|
|
198
|
+
}),
|
|
199
|
+
/* @__PURE__ */ m("div", {
|
|
200
|
+
"aria-invalid": W.ariaInvalid,
|
|
201
|
+
"data-disabled": I ? "" : void 0,
|
|
202
|
+
className: j?.shell?.className,
|
|
203
|
+
css: [
|
|
204
|
+
o,
|
|
205
|
+
te,
|
|
206
|
+
_[ne],
|
|
207
|
+
j?.shell?.css
|
|
208
|
+
],
|
|
209
|
+
children: [
|
|
210
|
+
/* @__PURE__ */ p("span", {
|
|
211
|
+
"aria-hidden": !0,
|
|
212
|
+
className: j?.icon?.className,
|
|
213
|
+
css: [v, j?.icon?.css],
|
|
214
|
+
children: k
|
|
215
|
+
}),
|
|
216
|
+
/* @__PURE__ */ p("input", {
|
|
217
|
+
...U,
|
|
218
|
+
ref: K,
|
|
219
|
+
type: "search",
|
|
220
|
+
id: W.id,
|
|
221
|
+
dir: P,
|
|
222
|
+
value: Y,
|
|
223
|
+
required: F,
|
|
224
|
+
disabled: I,
|
|
225
|
+
readOnly: L,
|
|
226
|
+
"aria-describedby": W.describedBy,
|
|
227
|
+
"aria-invalid": W.ariaInvalid,
|
|
228
|
+
className: j?.control?.className,
|
|
229
|
+
css: [y, j?.control?.css],
|
|
230
|
+
onChange: (e) => {
|
|
231
|
+
R?.(e), !I && !L && X(e.currentTarget.value);
|
|
232
|
+
},
|
|
233
|
+
onKeyDown: (e) => {
|
|
234
|
+
z?.(e), !(e.defaultPrevented || e.key !== "Escape" || e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229 || Y === "") && (e.preventDefault(), D && !I && !L && $());
|
|
235
|
+
}
|
|
236
|
+
}),
|
|
237
|
+
/* @__PURE__ */ p("span", {
|
|
238
|
+
className: j?.clearSlot?.className,
|
|
239
|
+
css: [b, j?.clearSlot?.css],
|
|
240
|
+
children: D && !L && Y !== "" && /* @__PURE__ */ p("button", {
|
|
241
|
+
type: "button",
|
|
242
|
+
disabled: I,
|
|
243
|
+
"data-enter": Q.current ? "" : void 0,
|
|
244
|
+
"aria-label": O?.clear ?? S.clear,
|
|
245
|
+
"aria-controls": W.id,
|
|
246
|
+
onClick: $,
|
|
247
|
+
className: j?.clear?.className,
|
|
248
|
+
css: [x, j?.clear?.css],
|
|
249
|
+
children: /* @__PURE__ */ p("span", {
|
|
250
|
+
"aria-hidden": !0,
|
|
251
|
+
css: v,
|
|
252
|
+
children: A
|
|
253
|
+
})
|
|
254
|
+
})
|
|
255
|
+
})
|
|
256
|
+
]
|
|
257
|
+
}),
|
|
258
|
+
/* @__PURE__ */ p(l, {
|
|
259
|
+
id: W.descriptionId,
|
|
260
|
+
part: j?.description,
|
|
261
|
+
children: T
|
|
262
|
+
}),
|
|
263
|
+
/* @__PURE__ */ p(c, {
|
|
264
|
+
id: W.errorId,
|
|
265
|
+
part: j?.error,
|
|
266
|
+
children: E
|
|
267
|
+
})
|
|
268
|
+
]
|
|
269
|
+
})
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
T.displayName = "SearchField";
|
|
273
|
+
//#endregion
|
|
274
|
+
export { T as t };
|