@jfrader/ui 0.4.0 → 0.5.1
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-DLul6vIl.js +205 -0
- 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-Dlbq5-9D.js +382 -0
- package/dist/announcement-bar.js +2 -0
- package/dist/avatar-CaGJHy1N.js +145 -0
- package/dist/avatar-group-M1opAQEG.js +138 -0
- package/dist/avatar-group.js +2 -0
- package/dist/avatar.js +1 -1
- package/dist/badge-CjM5Agqk.js +119 -0
- package/dist/badge.js +1 -1
- package/dist/bottom-sheet-DjZOPq4k.js +674 -0
- package/dist/bottom-sheet.js +2 -0
- package/dist/{breadcrumbs-DVAOxfvL.js → breadcrumbs-BDK_LiwH.js} +11 -4
- package/dist/breadcrumbs.js +1 -1
- package/dist/{button-P2e7_44z.js → button-NLY0h6EJ.js} +8 -8
- package/dist/button.js +1 -1
- package/dist/calendar-BzJdv_SZ.js +449 -0
- package/dist/calendar.js +1 -1
- package/dist/card-Ca4KQKYQ.js +154 -0
- package/dist/card.js +1 -1
- package/dist/carousel-B7OrvD6J.js +474 -0
- package/dist/carousel.js +2 -0
- package/dist/{checkbox-COYG6L7d.js → checkbox-DKSzExj2.js} +17 -16
- package/dist/checkbox.js +1 -1
- package/dist/chip-group-DjQ0_6Y9.js +290 -0
- package/dist/chip-group.js +2 -0
- package/dist/code-block/shiki.js +147 -0
- package/dist/code-block-B5we2lZa.js +293 -0
- package/dist/code-block.js +2 -0
- package/dist/collection-registry-k6JcD3Jr.js +44 -0
- package/dist/combobox-DFFqOBCi.js +339 -0
- package/dist/combobox.js +1 -1
- package/dist/command-palette-BmQu2w4H.js +391 -0
- package/dist/command-palette.js +1 -1
- package/dist/comment-thread-ASaXDcGo.js +1410 -0
- package/dist/comment-thread.js +2 -0
- package/dist/context-menu-__1c2Dk9.js +370 -0
- package/dist/context-menu.js +2 -0
- package/dist/copy-button-DCSLcYS-.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-BiPN7yeK.js +255 -0
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker-DQpUeKqV.js +570 -0
- package/dist/date-range-picker.js +2 -0
- package/dist/{dialog-xaydbXl2.js → dialog-BX1zYMs-.js} +21 -20
- package/dist/dialog.js +1 -1
- package/dist/{divider-DYoJf0I_.js → divider-Cp7aNbhM.js} +21 -20
- package/dist/divider.js +1 -1
- package/dist/drawer-DsASTiP-.js +553 -0
- package/dist/drawer.js +2 -0
- package/dist/elastic-slider-BG6K019r.js +395 -0
- package/dist/elastic-slider.js +2 -0
- package/dist/empty-state-CDgrjPPf.js +142 -0
- package/dist/empty-state.js +2 -0
- package/dist/expandable-card-rUATve0o.js +347 -0
- package/dist/expandable-card.js +2 -0
- package/dist/expanding-search-BxOwtdwt.js +238 -0
- package/dist/expanding-search.js +2 -0
- package/dist/field-anatomy-COVdNpf5.js +84 -0
- package/dist/file-dropzone-BuXm3Tea.js +457 -0
- package/dist/file-dropzone.js +2 -0
- package/dist/filter-toolbar-Cy5Hqur-.js +314 -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-CoMJKg1g.js +347 -0
- package/dist/hover-card.js +2 -0
- package/dist/image-compare-BxY8Ykzt.js +415 -0
- package/dist/image-compare.js +2 -0
- package/dist/index.js +84 -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-DgWqyU75.js +802 -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-sq61si9L.js +600 -0
- package/dist/mention-input.js +2 -0
- package/dist/menu-DDKgmK2F.js +295 -0
- package/dist/menu.js +1 -1
- package/dist/metric-card--lVTz5Wn.js +118 -0
- package/dist/metric-card.js +2 -0
- package/dist/multi-select-DG1BCFX7.js +598 -0
- package/dist/multi-select.js +2 -0
- package/dist/{navigation-DhnKriOp.js → navigation-CC26JDr-.js} +24 -18
- package/dist/navigation.js +1 -1
- package/dist/overlay-layer-qEbpEtb8.js +78 -0
- package/dist/overlay-portal-C4JZFq2M.js +15 -0
- package/dist/{pagination-DYdwsxwe.js → pagination-BfkeWbmP.js} +24 -23
- package/dist/pagination.js +1 -1
- package/dist/password-field-03pWRkuY.js +250 -0
- package/dist/password-field.js +2 -0
- package/dist/pill-BaS-uIbn.js +58 -0
- package/dist/pill.js +1 -1
- package/dist/popover-CErIw2q3.js +125 -0
- package/dist/popover.js +1 -1
- package/dist/{progress-BpJswTG4.js → progress-DAQkfhPd.js} +5 -5
- package/dist/progress.js +1 -1
- package/dist/radio-cards-Cu9cBssN.js +456 -0
- package/dist/radio-cards.js +2 -0
- package/dist/{radio-group-Ce0_IWQr.js → radio-group-TIK0-iPX.js} +22 -19
- package/dist/radio-group.js +1 -1
- package/dist/resizable-panels-DUpQEpwG.js +520 -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-DMvho0KQ.js +274 -0
- package/dist/search-field.js +2 -0
- package/dist/segmented-control-8ZUGnsZm.js +327 -0
- package/dist/segmented-control.js +2 -0
- package/dist/select-D5rhJ8gi.js +293 -0
- package/dist/select.js +1 -1
- package/dist/signature-pad-_bTeguN9.js +645 -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-DVG6-Awh.js +308 -0
- package/dist/slider.js +2 -0
- package/dist/sortable-data-table-CYKT_Ng7.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-BCw4zZom.js +262 -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-CBuJREU1.js +420 -0
- package/dist/swipe-actions.js +2 -0
- package/dist/switch-C1WrKrf-.js +145 -0
- package/dist/switch.js +1 -1
- package/dist/tabs-XluwRjgg.js +210 -0
- 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-hU72iSVS.js} +20 -17
- package/dist/text-field.js +1 -1
- package/dist/{textarea-DyfjtP0A.js → textarea-3k4Y0QQ3.js} +23 -20
- package/dist/textarea.js +1 -1
- package/dist/theme-root.js +1 -1
- package/dist/theme-switch-C505TtU8.js +166 -0
- package/dist/theme-switch.js +2 -0
- package/dist/time-picker-CPlhW0tr.js +311 -0
- package/dist/time-picker.js +2 -0
- package/dist/timeline-B0uAAVfT.js +624 -0
- package/dist/timeline.js +2 -0
- package/dist/toast-B7wo3sX1.js +371 -0
- package/dist/toast-stack-B40VpS4M.js +197 -0
- package/dist/toast-stack.js +2 -0
- package/dist/toast.js +1 -1
- package/dist/{toggle-group-CI0e7hFm.js → toggle-group-B2fpFZwV.js} +5 -5
- package/dist/toggle-group.js +1 -1
- package/dist/tooltip-BvgVTCTN.js +120 -0
- package/dist/tooltip.js +1 -1
- package/dist/tree-view-j8qLqkb_.js +364 -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/checkbox/checkbox.d.ts +1 -1
- 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 +2 -2
- package/dist/types/components/comment-thread/comment-thread.d.ts +118 -0
- package/dist/types/components/comment-thread/index.d.ts +1 -0
- package/dist/types/components/comment-thread/thread-core.d.ts +96 -0
- package/dist/types/components/comment-thread/thread-parts.d.ts +114 -0
- package/dist/types/components/context-menu/context-menu.d.ts +55 -0
- package/dist/types/components/context-menu/index.d.ts +2 -0
- 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/elastic-slider/elastic-slider.d.ts +53 -0
- package/dist/types/components/elastic-slider/index.d.ts +1 -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/expanding-search/expanding-search.d.ts +22 -0
- package/dist/types/components/expanding-search/index.d.ts +1 -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 +68 -7
- 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/pagination/pagination.d.ts +1 -1
- 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/radio-group/radio-group.d.ts +1 -1
- 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-style.d.ts +14 -0
- package/dist/types/components/slider/slider.d.ts +62 -0
- package/dist/types/components/slider/use-slider-interaction.d.ts +79 -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/tabs/tabs.d.ts +1 -1
- 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/text-field/text-field.d.ts +1 -1
- package/dist/types/components/textarea/textarea.d.ts +1 -1
- package/dist/types/components/theme-switch/index.d.ts +1 -0
- package/dist/types/components/theme-switch/theme-switch.d.ts +33 -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 +2 -2
- 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 +45 -0
- package/dist/types/overlay/overlay-layer.d.ts +53 -0
- package/dist/types/overlay/use-overlay-floating.d.ts +19 -2
- 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-Bx2jBKAA.js +33 -0
- package/dist/use-slider-interaction-ChL-208h.js +234 -0
- package/package.json +195 -3
- package/dist/accordion-Bd-j04hW.js +0 -198
- package/dist/avatar-BahDVO9t.js +0 -132
- package/dist/badge-B_sLygxU.js +0 -108
- package/dist/calendar-C9Yad_-w.js +0 -394
- package/dist/card-D-aI2QHx.js +0 -158
- 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/pill-DO2gHzMb.js +0 -56
- package/dist/popover-CdRXjQqI.js +0 -113
- package/dist/select-BgG7WgSh.js +0 -286
- package/dist/switch-Dr-qjmT4.js +0 -142
- package/dist/tabs-CK_g1RKa.js +0 -203
- 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
- package/dist/{theme-root-BbTBuLMQ.js → theme-root-Bs1U3uPA.js} +2 -2
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { t as n } from "./disclosure-caret-C5T3fcl6.js";
|
|
4
|
+
import { t as r } from "./focus-ring-BK5W5_NY.js";
|
|
5
|
+
import { n as i, r as a } from "./media-8yrN85VT.js";
|
|
6
|
+
import { t as o } from "./use-controlled-state-DpeVQZNR.js";
|
|
7
|
+
import { t as s } from "./renderable-DzcIj1Lo.js";
|
|
8
|
+
import { n as c } from "./surface-DZ4d-2aL.js";
|
|
9
|
+
import { createContext as l, useContext as u, useEffect as d, useId as f, useLayoutEffect as p, useMemo as m, useRef as h, useState as g } from "react";
|
|
10
|
+
import { vars as _ } from "@jfrader/tokens/vars";
|
|
11
|
+
import { jsx as v, jsxs as y } from "@emotion/react/jsx-runtime";
|
|
12
|
+
import { useMergeRefs as b } from "@floating-ui/react";
|
|
13
|
+
import { MotionConfig as x, animate as S, useMotionValue as C, useReducedMotion as w } from "motion/react";
|
|
14
|
+
import { base as T } from "@jfrader/tokens";
|
|
15
|
+
//#region src/components/expandable-card/expandable-card.tsx
|
|
16
|
+
var E = l(null);
|
|
17
|
+
function D(e) {
|
|
18
|
+
let t = u(E);
|
|
19
|
+
if (!t) throw Error(`ExpandableCard.${e} must be rendered inside <ExpandableCard>.`);
|
|
20
|
+
return t;
|
|
21
|
+
}
|
|
22
|
+
var O = {
|
|
23
|
+
type: "spring",
|
|
24
|
+
stiffness: 400,
|
|
25
|
+
damping: 40,
|
|
26
|
+
mass: 1
|
|
27
|
+
}, k = {
|
|
28
|
+
duration: Number.parseFloat(T.motion.duration.fast) / 1e3,
|
|
29
|
+
ease: [
|
|
30
|
+
.2,
|
|
31
|
+
.6,
|
|
32
|
+
.2,
|
|
33
|
+
1
|
|
34
|
+
]
|
|
35
|
+
}, A = e({
|
|
36
|
+
...c,
|
|
37
|
+
borderColor: _.color.borderControl,
|
|
38
|
+
borderRadius: _.radius.lg,
|
|
39
|
+
boxShadow: _.shadow.raised,
|
|
40
|
+
minInlineSize: 0,
|
|
41
|
+
maxInlineSize: "100%",
|
|
42
|
+
marginInline: "auto",
|
|
43
|
+
overflow: "clip"
|
|
44
|
+
}), j = e({
|
|
45
|
+
inlineSize: "100%",
|
|
46
|
+
minInlineSize: 0
|
|
47
|
+
}), M = e({
|
|
48
|
+
margin: 0,
|
|
49
|
+
font: "inherit"
|
|
50
|
+
}), N = e({
|
|
51
|
+
appearance: "none",
|
|
52
|
+
display: "grid",
|
|
53
|
+
gridTemplateColumns: "minmax(0, 1fr) auto",
|
|
54
|
+
alignItems: "center",
|
|
55
|
+
gap: _.space[2],
|
|
56
|
+
inlineSize: "100%",
|
|
57
|
+
boxSizing: "border-box",
|
|
58
|
+
minBlockSize: `calc(${_.space[12]} + ${_.space[4]})`,
|
|
59
|
+
padding: _.space[4],
|
|
60
|
+
border: 0,
|
|
61
|
+
background: "transparent",
|
|
62
|
+
color: "inherit",
|
|
63
|
+
font: "inherit",
|
|
64
|
+
textAlign: "start",
|
|
65
|
+
cursor: "pointer",
|
|
66
|
+
"& > span": {
|
|
67
|
+
gridColumn: 1,
|
|
68
|
+
overflowWrap: "anywhere"
|
|
69
|
+
},
|
|
70
|
+
"&::after": {
|
|
71
|
+
...n,
|
|
72
|
+
gridColumn: 2,
|
|
73
|
+
gridRow: "1 / span 2"
|
|
74
|
+
},
|
|
75
|
+
"&[aria-expanded=\"true\"]::after": { transform: "rotate(90deg)" },
|
|
76
|
+
"&[aria-expanded=\"true\"]:dir(rtl)::after": { transform: "rotate(-90deg)" },
|
|
77
|
+
"&:focus-visible": r,
|
|
78
|
+
"&:hover:not(:disabled)": { backgroundColor: _.color.surfaceHover },
|
|
79
|
+
"&:disabled": {
|
|
80
|
+
cursor: "not-allowed",
|
|
81
|
+
opacity: .55
|
|
82
|
+
},
|
|
83
|
+
"[data-size=\"sm\"] &": {
|
|
84
|
+
minBlockSize: _.space[12],
|
|
85
|
+
padding: _.space[3]
|
|
86
|
+
},
|
|
87
|
+
[a]: { "&::after": { transitionDuration: "0s" } },
|
|
88
|
+
[i]: {
|
|
89
|
+
"&:focus-visible": { outlineColor: "Highlight" },
|
|
90
|
+
"&::after": {
|
|
91
|
+
forcedColorAdjust: "none",
|
|
92
|
+
borderInlineStartColor: "ButtonText"
|
|
93
|
+
},
|
|
94
|
+
"&:disabled::after": { borderInlineStartColor: "GrayText" }
|
|
95
|
+
}
|
|
96
|
+
}), P = e({
|
|
97
|
+
fontSize: _.textSize.md,
|
|
98
|
+
fontWeight: _.fontWeight.medium
|
|
99
|
+
}), F = e({
|
|
100
|
+
fontSize: _.textSize.sm,
|
|
101
|
+
color: _.color.textMuted
|
|
102
|
+
}), I = e({
|
|
103
|
+
overflow: "clip",
|
|
104
|
+
minInlineSize: 0,
|
|
105
|
+
"&[hidden]": { display: "none" }
|
|
106
|
+
}), L = e({
|
|
107
|
+
boxSizing: "border-box",
|
|
108
|
+
maxInlineSize: "none",
|
|
109
|
+
padding: _.space[4],
|
|
110
|
+
borderBlockStart: `1px solid ${_.color.border}`,
|
|
111
|
+
fontSize: _.textSize.sm,
|
|
112
|
+
overflowWrap: "anywhere",
|
|
113
|
+
"& :where(input, select, textarea, img, video, canvas, svg, iframe)": {
|
|
114
|
+
maxInlineSize: "100%",
|
|
115
|
+
boxSizing: "border-box"
|
|
116
|
+
},
|
|
117
|
+
"[data-size=\"sm\"] &": { padding: _.space[3] }
|
|
118
|
+
});
|
|
119
|
+
function R(e) {
|
|
120
|
+
return e !== void 0 && Number.isFinite(e) && e > 0 ? e : void 0;
|
|
121
|
+
}
|
|
122
|
+
function z(...e) {
|
|
123
|
+
return e.filter(Boolean).join(" ") || void 0;
|
|
124
|
+
}
|
|
125
|
+
function B({ ref: e, open: n, defaultOpen: r = !1, onOpenChange: i, collapsedInlineSize: a, expandedInlineSize: s, size: c = "md", disabled: l = !1, headingLevel: u = 3, className: d, sx: _, onKeyDown: y, children: T, ...D }) {
|
|
126
|
+
let [k, M] = o(n, r, i), N = !!k, P = f(), F = h(null), I = h(null), L = h(null), z = b([I, e]), [B, V] = g(!1), [H, U] = g(!1), [W, G] = g(), [K, ee] = g(0), q = w(), J = C(0), Y = h(!1), X = R(a), Z = R(s) ?? X, Q = W === void 0 ? void 0 : Math.min(W, (N ? Z : X) ?? W), $ = W === void 0 ? void 0 : Math.max(0, Math.min(W, Z ?? W) - K);
|
|
127
|
+
p(() => {
|
|
128
|
+
let e = L.current;
|
|
129
|
+
if (!e) return;
|
|
130
|
+
let t = () => {
|
|
131
|
+
G(e.getBoundingClientRect().width);
|
|
132
|
+
let t = I.current;
|
|
133
|
+
if (!t) return;
|
|
134
|
+
let n = getComputedStyle(t);
|
|
135
|
+
ee(Number.parseFloat(n.borderInlineStartWidth) + Number.parseFloat(n.borderInlineEndWidth) + Number.parseFloat(n.paddingInlineStart) + Number.parseFloat(n.paddingInlineEnd));
|
|
136
|
+
};
|
|
137
|
+
t();
|
|
138
|
+
let n = new ResizeObserver(t);
|
|
139
|
+
return n.observe(e), () => n.disconnect();
|
|
140
|
+
}, []), p(() => {
|
|
141
|
+
let e = I.current;
|
|
142
|
+
if (!e || Q === void 0) return;
|
|
143
|
+
let t = (t) => {
|
|
144
|
+
e.style.inlineSize = `${t}px`;
|
|
145
|
+
}, n = J.on("change", t);
|
|
146
|
+
return !Y.current || q ? (J.jump(Q), t(Q), Y.current = !0) : S(J, Q, O), () => {
|
|
147
|
+
n(), J.stop();
|
|
148
|
+
};
|
|
149
|
+
}, [
|
|
150
|
+
Q,
|
|
151
|
+
q,
|
|
152
|
+
J
|
|
153
|
+
]);
|
|
154
|
+
let te = m(() => ({
|
|
155
|
+
open: N,
|
|
156
|
+
request: M,
|
|
157
|
+
disabled: l,
|
|
158
|
+
headingLevel: u,
|
|
159
|
+
triggerId: `${P}-trigger`,
|
|
160
|
+
panelId: `${P}-panel`,
|
|
161
|
+
titleId: `${P}-title`,
|
|
162
|
+
descriptionId: `${P}-description`,
|
|
163
|
+
hasTitle: B,
|
|
164
|
+
hasDescription: H,
|
|
165
|
+
setHasTitle: V,
|
|
166
|
+
setHasDescription: U,
|
|
167
|
+
triggerRef: F,
|
|
168
|
+
expandedWidth: $
|
|
169
|
+
}), [
|
|
170
|
+
N,
|
|
171
|
+
M,
|
|
172
|
+
l,
|
|
173
|
+
u,
|
|
174
|
+
P,
|
|
175
|
+
B,
|
|
176
|
+
H,
|
|
177
|
+
$
|
|
178
|
+
]);
|
|
179
|
+
return /* @__PURE__ */ v(x, {
|
|
180
|
+
reducedMotion: "user",
|
|
181
|
+
children: /* @__PURE__ */ v(E.Provider, {
|
|
182
|
+
value: te,
|
|
183
|
+
children: /* @__PURE__ */ v("div", {
|
|
184
|
+
ref: L,
|
|
185
|
+
css: j,
|
|
186
|
+
children: /* @__PURE__ */ v(t, {
|
|
187
|
+
className: d,
|
|
188
|
+
styles: A,
|
|
189
|
+
sx: _,
|
|
190
|
+
children: (e) => /* @__PURE__ */ v("article", {
|
|
191
|
+
...D,
|
|
192
|
+
ref: z,
|
|
193
|
+
"data-ui": "expandable-card",
|
|
194
|
+
"data-size": c,
|
|
195
|
+
"data-state": N ? "open" : "closed",
|
|
196
|
+
className: e,
|
|
197
|
+
onKeyDown: (e) => {
|
|
198
|
+
if (y?.(e), e.defaultPrevented || e.key !== "Escape" || !N) return;
|
|
199
|
+
let t = e.target, n = t.closest("dialog, [role=\"dialog\"], [role=\"menu\"], [role=\"listbox\"]");
|
|
200
|
+
t.closest("[data-ui=\"expandable-card\"]") !== e.currentTarget || n && e.currentTarget.contains(n) || (e.preventDefault(), M(!1));
|
|
201
|
+
},
|
|
202
|
+
children: T
|
|
203
|
+
})
|
|
204
|
+
})
|
|
205
|
+
})
|
|
206
|
+
})
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
B.displayName = "ExpandableCard";
|
|
210
|
+
function V({ ref: e, className: n, sx: r, onClick: i, disabled: a, "aria-labelledby": o, "aria-describedby": s, ...c }) {
|
|
211
|
+
let l = D("Trigger"), u = b([l.triggerRef, e]), d = `h${l.headingLevel}`;
|
|
212
|
+
return /* @__PURE__ */ v(d, {
|
|
213
|
+
css: M,
|
|
214
|
+
"aria-labelledby": l.triggerId,
|
|
215
|
+
children: /* @__PURE__ */ v(t, {
|
|
216
|
+
className: n,
|
|
217
|
+
styles: N,
|
|
218
|
+
sx: r,
|
|
219
|
+
children: (e) => /* @__PURE__ */ v("button", {
|
|
220
|
+
...c,
|
|
221
|
+
ref: u,
|
|
222
|
+
type: "button",
|
|
223
|
+
id: l.triggerId,
|
|
224
|
+
"data-ui": "expandable-card-trigger",
|
|
225
|
+
className: e,
|
|
226
|
+
disabled: l.disabled || a,
|
|
227
|
+
"aria-expanded": l.open,
|
|
228
|
+
"aria-controls": l.panelId,
|
|
229
|
+
"aria-labelledby": z(o, l.hasTitle && l.titleId, l.hasDescription && l.descriptionId),
|
|
230
|
+
"aria-describedby": z(s),
|
|
231
|
+
onClick: (e) => {
|
|
232
|
+
i?.(e), e.defaultPrevented || l.request(!l.open);
|
|
233
|
+
}
|
|
234
|
+
})
|
|
235
|
+
})
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
V.displayName = "ExpandableCard.Trigger";
|
|
239
|
+
function H({ ref: e, className: n, sx: r, children: i, ...a }) {
|
|
240
|
+
let { titleId: o, setHasTitle: c } = D("Title"), l = s(i);
|
|
241
|
+
return d(() => (c(l), () => c(!1)), [l, c]), l ? /* @__PURE__ */ v(t, {
|
|
242
|
+
className: n,
|
|
243
|
+
styles: P,
|
|
244
|
+
sx: r,
|
|
245
|
+
children: (t) => /* @__PURE__ */ v("span", {
|
|
246
|
+
...a,
|
|
247
|
+
ref: e,
|
|
248
|
+
id: o,
|
|
249
|
+
className: t,
|
|
250
|
+
"data-ui": "expandable-card-title",
|
|
251
|
+
children: i
|
|
252
|
+
})
|
|
253
|
+
}) : null;
|
|
254
|
+
}
|
|
255
|
+
H.displayName = "ExpandableCard.Title";
|
|
256
|
+
function U({ ref: e, className: n, sx: r, children: i, ...a }) {
|
|
257
|
+
let { descriptionId: o, setHasDescription: c } = D("Description"), l = s(i);
|
|
258
|
+
return d(() => (c(l), () => c(!1)), [l, c]), l ? /* @__PURE__ */ v(t, {
|
|
259
|
+
className: n,
|
|
260
|
+
styles: F,
|
|
261
|
+
sx: r,
|
|
262
|
+
children: (t) => /* @__PURE__ */ y("span", {
|
|
263
|
+
...a,
|
|
264
|
+
ref: e,
|
|
265
|
+
id: o,
|
|
266
|
+
className: t,
|
|
267
|
+
"data-ui": "expandable-card-description",
|
|
268
|
+
children: [" ", i]
|
|
269
|
+
})
|
|
270
|
+
}) : null;
|
|
271
|
+
}
|
|
272
|
+
U.displayName = "ExpandableCard.Description";
|
|
273
|
+
function W({ ref: e, className: n, sx: r, children: i, "aria-labelledby": a, "aria-describedby": o, ...s }) {
|
|
274
|
+
let c = D("Content"), l = h(null), u = h(null), d = b([l, e]), f = C(0), m = C(+!!c.open), g = w(), _ = h(!1);
|
|
275
|
+
return p(() => {
|
|
276
|
+
let e = l.current, t = u.current;
|
|
277
|
+
if (!e || !t) return;
|
|
278
|
+
let n = 0, r = !1;
|
|
279
|
+
if (!c.open && e.contains(e.ownerDocument.activeElement) && c.triggerRef.current?.focus(), e.inert = !c.open, e.hidden = !c.open && !_.current, c.expandedWidth === void 0) return;
|
|
280
|
+
let i = (t) => {
|
|
281
|
+
e.style.blockSize = `${t}px`, c.open && t > 0 && m.get() === 0 && !m.isAnimating() && S(m, 1, k);
|
|
282
|
+
}, a = f.on("change", i), o = m.on("change", (t) => {
|
|
283
|
+
e.style.opacity = String(t);
|
|
284
|
+
}), s = () => {
|
|
285
|
+
let a = ++n, o = c.open ? t.getBoundingClientRect().height : 0;
|
|
286
|
+
f.stop();
|
|
287
|
+
let s = () => {
|
|
288
|
+
!r && a === n && !c.open && (e.hidden = !0);
|
|
289
|
+
};
|
|
290
|
+
!_.current || g ? (m.jump(+!!c.open), e.style.opacity = String(m.get()), f.jump(o), i(o), s(), _.current = !0) : c.open ? (f.get() > 0 && S(m, 1, k), S(f, o, {
|
|
291
|
+
...O,
|
|
292
|
+
onComplete: s
|
|
293
|
+
})) : S(m, 0, {
|
|
294
|
+
...k,
|
|
295
|
+
onComplete: () => {
|
|
296
|
+
!r && a === n && S(f, o, {
|
|
297
|
+
...O,
|
|
298
|
+
onComplete: s
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
};
|
|
303
|
+
s();
|
|
304
|
+
let d = new ResizeObserver(s);
|
|
305
|
+
return d.observe(t), () => {
|
|
306
|
+
r = !0, n++, d.disconnect(), a(), o(), f.stop(), m.stop();
|
|
307
|
+
};
|
|
308
|
+
}, [
|
|
309
|
+
c.open,
|
|
310
|
+
c.expandedWidth,
|
|
311
|
+
c.triggerRef,
|
|
312
|
+
f,
|
|
313
|
+
m,
|
|
314
|
+
g
|
|
315
|
+
]), /* @__PURE__ */ v(t, {
|
|
316
|
+
className: n,
|
|
317
|
+
styles: I,
|
|
318
|
+
sx: r,
|
|
319
|
+
children: (e) => /* @__PURE__ */ v("div", {
|
|
320
|
+
...s,
|
|
321
|
+
ref: d,
|
|
322
|
+
id: c.panelId,
|
|
323
|
+
role: "region",
|
|
324
|
+
className: e,
|
|
325
|
+
"data-ui": "expandable-card-content",
|
|
326
|
+
hidden: !c.open,
|
|
327
|
+
"aria-hidden": !c.open || void 0,
|
|
328
|
+
"aria-labelledby": z(a, c.hasTitle ? c.titleId : c.triggerId),
|
|
329
|
+
"aria-describedby": z(o, c.hasDescription && c.descriptionId),
|
|
330
|
+
children: /* @__PURE__ */ v("div", {
|
|
331
|
+
ref: u,
|
|
332
|
+
css: L,
|
|
333
|
+
style: { inlineSize: c.expandedWidth },
|
|
334
|
+
children: i
|
|
335
|
+
})
|
|
336
|
+
})
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
W.displayName = "ExpandableCard.Content";
|
|
340
|
+
var G = Object.assign(B, {
|
|
341
|
+
Trigger: V,
|
|
342
|
+
Title: H,
|
|
343
|
+
Description: U,
|
|
344
|
+
Content: W
|
|
345
|
+
});
|
|
346
|
+
//#endregion
|
|
347
|
+
export { G as t };
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { n } from "./media-8yrN85VT.js";
|
|
4
|
+
import { t as r } from "./use-controlled-state-DpeVQZNR.js";
|
|
5
|
+
import { t as i } from "./renderable-DzcIj1Lo.js";
|
|
6
|
+
import { t as a } from "./button-NLY0h6EJ.js";
|
|
7
|
+
import { t as o } from "./search-field-DMvho0KQ.js";
|
|
8
|
+
import { useId as ee, useLayoutEffect as s, useRef as c, useState as te } from "react";
|
|
9
|
+
import { vars as l } from "@jfrader/tokens/vars";
|
|
10
|
+
import { jsx as u, jsxs as d } from "@emotion/react/jsx-runtime";
|
|
11
|
+
import { useMergeRefs as f } from "@floating-ui/react";
|
|
12
|
+
import { animate as p, useMotionValue as m } from "motion/react";
|
|
13
|
+
import { base as h } from "@jfrader/tokens";
|
|
14
|
+
//#region src/components/expanding-search/expanding-search.tsx
|
|
15
|
+
var g = {
|
|
16
|
+
type: "spring",
|
|
17
|
+
visualDuration: Number.parseFloat(h.motion.duration.slow) / 1e3,
|
|
18
|
+
bounce: 0
|
|
19
|
+
}, ne = "(prefers-reduced-motion: reduce)", re = e({
|
|
20
|
+
position: "relative",
|
|
21
|
+
inlineSize: "100%",
|
|
22
|
+
minInlineSize: 0,
|
|
23
|
+
minBlockSize: "var(--expanding-search-size)",
|
|
24
|
+
pointerEvents: "none"
|
|
25
|
+
}), ie = {
|
|
26
|
+
sm: e({ "--expanding-search-size": l.space[8] }),
|
|
27
|
+
md: e({ "--expanding-search-size": l.space[10] }),
|
|
28
|
+
lg: e({ "--expanding-search-size": l.space[12] })
|
|
29
|
+
}, _ = e({
|
|
30
|
+
position: "relative",
|
|
31
|
+
marginInlineStart: "auto",
|
|
32
|
+
inlineSize: "var(--expanding-search-size)",
|
|
33
|
+
"--expanding-search-radius": l.radius.full,
|
|
34
|
+
minInlineSize: 0,
|
|
35
|
+
maxInlineSize: "100%",
|
|
36
|
+
pointerEvents: "auto",
|
|
37
|
+
overflow: "clip",
|
|
38
|
+
overflowClipMargin: l.space[1],
|
|
39
|
+
"&[data-state=\"open\"]": {
|
|
40
|
+
inlineSize: "var(--expanding-search-width)",
|
|
41
|
+
"--expanding-search-radius": l.radius.sm
|
|
42
|
+
},
|
|
43
|
+
"&[data-anchor=\"start\"]": {
|
|
44
|
+
marginInlineStart: 0,
|
|
45
|
+
marginInlineEnd: "auto"
|
|
46
|
+
}
|
|
47
|
+
}), v = e({
|
|
48
|
+
position: "absolute",
|
|
49
|
+
insetBlockStart: 0,
|
|
50
|
+
insetInline: 0
|
|
51
|
+
}), ae = e({
|
|
52
|
+
position: "absolute",
|
|
53
|
+
inlineSize: "var(--expanding-search-width)",
|
|
54
|
+
maxInlineSize: "100%",
|
|
55
|
+
blockSize: "var(--expanding-search-size)",
|
|
56
|
+
borderStartStartRadius: l.radius.sm,
|
|
57
|
+
visibility: "hidden",
|
|
58
|
+
pointerEvents: "none"
|
|
59
|
+
}), oe = e({
|
|
60
|
+
inlineSize: "100%",
|
|
61
|
+
paddingInline: 0,
|
|
62
|
+
borderRadius: "var(--expanding-search-radius)",
|
|
63
|
+
borderColor: l.color.borderControl,
|
|
64
|
+
backgroundColor: l.color.surfaceRaised,
|
|
65
|
+
[n]: {
|
|
66
|
+
borderColor: "ButtonText",
|
|
67
|
+
color: "ButtonText"
|
|
68
|
+
}
|
|
69
|
+
}), se = e({
|
|
70
|
+
borderRadius: "var(--expanding-search-radius)",
|
|
71
|
+
overflow: "clip"
|
|
72
|
+
}), ce = e({
|
|
73
|
+
display: "flex",
|
|
74
|
+
inlineSize: l.space[4],
|
|
75
|
+
blockSize: l.space[4],
|
|
76
|
+
"& > svg": {
|
|
77
|
+
inlineSize: "100%",
|
|
78
|
+
blockSize: "100%"
|
|
79
|
+
}
|
|
80
|
+
}), y = /* @__PURE__ */ d("svg", {
|
|
81
|
+
viewBox: "0 0 24 24",
|
|
82
|
+
fill: "none",
|
|
83
|
+
stroke: "currentColor",
|
|
84
|
+
strokeWidth: "2",
|
|
85
|
+
children: [/* @__PURE__ */ u("circle", {
|
|
86
|
+
cx: "10.5",
|
|
87
|
+
cy: "10.5",
|
|
88
|
+
r: "6.5"
|
|
89
|
+
}), /* @__PURE__ */ u("path", { d: "m16 16 5 5" })]
|
|
90
|
+
}), le = (e, t) => e?.expanded === t.expanded && e.size === t.size && e.radius === t.radius;
|
|
91
|
+
function b({ ref: e, inputRef: n, triggerLabel: h, open: b, defaultOpen: ue = !1, onOpenChange: x, anchor: S = "end", expandedWidth: C = `calc(${l.space[12]} * 8)`, size: w = "md", disabled: T, value: de, defaultValue: fe, onValueChange: pe, label: E, description: D, error: O, clearable: k, messages: A, searchIcon: j = y, clearIcon: M, slotProps: N, inputProps: P, className: F, sx: I, dir: L, style: R, onKeyDown: z, onBlur: B, ...me }) {
|
|
92
|
+
let [V = !1, H] = r(b, ue, x), U = c(null), W = c(null), G = c(null), K = c(null), q = c(null), he = f([U, e]), ge = f([G, n]), J = ee(), Y = c(null), [X, _e] = te(), Z = m(0), Q = m(0), $ = c(void 0);
|
|
93
|
+
s(() => {
|
|
94
|
+
let e = U.current, t = q.current;
|
|
95
|
+
if (!e || !t) return;
|
|
96
|
+
let n = () => {
|
|
97
|
+
let e = t.getBoundingClientRect(), n = {
|
|
98
|
+
expanded: e.width,
|
|
99
|
+
size: e.height,
|
|
100
|
+
radius: Number.parseFloat(getComputedStyle(t).borderStartStartRadius)
|
|
101
|
+
};
|
|
102
|
+
_e((e) => le(e, n) ? e : n);
|
|
103
|
+
};
|
|
104
|
+
n();
|
|
105
|
+
let r = e.ownerDocument.defaultView?.ResizeObserver;
|
|
106
|
+
if (!r) return;
|
|
107
|
+
let i = new r(n);
|
|
108
|
+
return i.observe(e), i.observe(t), () => i.disconnect();
|
|
109
|
+
}, [C]), s(() => {
|
|
110
|
+
let e = W.current;
|
|
111
|
+
if (!e || !X) return;
|
|
112
|
+
let t = V ? {
|
|
113
|
+
width: X.expanded,
|
|
114
|
+
radius: X.radius
|
|
115
|
+
} : {
|
|
116
|
+
width: X.size,
|
|
117
|
+
radius: X.size / 2
|
|
118
|
+
}, n = () => {
|
|
119
|
+
e.style.inlineSize = `${Z.get()}px`, e.style.setProperty("--expanding-search-radius", `${Q.get()}px`);
|
|
120
|
+
}, r = () => {
|
|
121
|
+
Z.jump(t.width), Q.jump(t.radius), n();
|
|
122
|
+
}, i = [Z.on("change", n), Q.on("change", n)], a = e.ownerDocument.defaultView?.matchMedia(ne);
|
|
123
|
+
$.current === void 0 || $.current === V || a?.matches ? r() : (p(Z, t.width, g), p(Q, t.radius, g)), $.current = V;
|
|
124
|
+
let o = () => {
|
|
125
|
+
a?.matches && r();
|
|
126
|
+
};
|
|
127
|
+
return a?.addEventListener("change", o), () => {
|
|
128
|
+
i.forEach((e) => e()), a?.removeEventListener("change", o), Z.stop(), Q.stop();
|
|
129
|
+
};
|
|
130
|
+
}, [
|
|
131
|
+
V,
|
|
132
|
+
X,
|
|
133
|
+
Z,
|
|
134
|
+
Q
|
|
135
|
+
]), s(() => {
|
|
136
|
+
let e = U.current;
|
|
137
|
+
if (!e) return;
|
|
138
|
+
let t = e.ownerDocument.activeElement;
|
|
139
|
+
V && Y.current === "input" ? (Y.current = null, (e.contains(t) || t === e.ownerDocument.body) && G.current?.focus()) : !V && Y.current === "trigger" && (Y.current = null, (e.contains(t) || t === e.ownerDocument.body) && K.current?.focus());
|
|
140
|
+
}, [V]);
|
|
141
|
+
let ve = P?.["aria-label"] ?? (!i(E) || E === "" ? h : void 0);
|
|
142
|
+
return /* @__PURE__ */ u(t, {
|
|
143
|
+
className: F,
|
|
144
|
+
styles: [re, ie[w]],
|
|
145
|
+
sx: I,
|
|
146
|
+
children: (e) => /* @__PURE__ */ d("div", {
|
|
147
|
+
...me,
|
|
148
|
+
ref: he,
|
|
149
|
+
className: e,
|
|
150
|
+
dir: L,
|
|
151
|
+
"data-ui": "expanding-search",
|
|
152
|
+
"data-state": V ? "open" : "closed",
|
|
153
|
+
style: {
|
|
154
|
+
"--expanding-search-width": C,
|
|
155
|
+
...R
|
|
156
|
+
},
|
|
157
|
+
onKeyDown: (e) => {
|
|
158
|
+
z?.(e), !(e.defaultPrevented || !V || T || e.key !== "Escape" || e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229) && (e.preventDefault(), Y.current = "trigger", H(!1));
|
|
159
|
+
},
|
|
160
|
+
onBlur: (e) => {
|
|
161
|
+
if (B?.(e), e.defaultPrevented || !V) return;
|
|
162
|
+
let t = e.currentTarget, n = e.relatedTarget;
|
|
163
|
+
n && !t.contains(n) ? (Y.current = null, H(!1)) : n || queueMicrotask(() => {
|
|
164
|
+
t.isConnected && t.ownerDocument.hasFocus() && !t.contains(t.ownerDocument.activeElement) && (Y.current = null, H(!1));
|
|
165
|
+
});
|
|
166
|
+
},
|
|
167
|
+
children: [/* @__PURE__ */ u("span", {
|
|
168
|
+
ref: q,
|
|
169
|
+
"aria-hidden": !0,
|
|
170
|
+
css: ae
|
|
171
|
+
}), /* @__PURE__ */ d("div", {
|
|
172
|
+
ref: W,
|
|
173
|
+
css: _,
|
|
174
|
+
"data-anchor": S,
|
|
175
|
+
"data-state": V ? "open" : "closed",
|
|
176
|
+
children: [/* @__PURE__ */ u("div", {
|
|
177
|
+
hidden: V,
|
|
178
|
+
inert: V,
|
|
179
|
+
css: v,
|
|
180
|
+
children: /* @__PURE__ */ u(a, {
|
|
181
|
+
ref: K,
|
|
182
|
+
size: w,
|
|
183
|
+
variant: "outline",
|
|
184
|
+
disabled: T,
|
|
185
|
+
"aria-label": h,
|
|
186
|
+
"aria-expanded": V,
|
|
187
|
+
"aria-controls": J,
|
|
188
|
+
css: oe,
|
|
189
|
+
onClick: () => {
|
|
190
|
+
Y.current = "input", H(!0);
|
|
191
|
+
},
|
|
192
|
+
children: /* @__PURE__ */ u("span", {
|
|
193
|
+
"aria-hidden": !0,
|
|
194
|
+
css: ce,
|
|
195
|
+
children: j
|
|
196
|
+
})
|
|
197
|
+
})
|
|
198
|
+
}), /* @__PURE__ */ u("div", {
|
|
199
|
+
id: J,
|
|
200
|
+
"aria-hidden": !V || void 0,
|
|
201
|
+
inert: !V,
|
|
202
|
+
style: { visibility: V ? "visible" : "hidden" },
|
|
203
|
+
children: /* @__PURE__ */ u(o, {
|
|
204
|
+
...P,
|
|
205
|
+
ref: ge,
|
|
206
|
+
size: w,
|
|
207
|
+
dir: L,
|
|
208
|
+
disabled: T,
|
|
209
|
+
value: de,
|
|
210
|
+
defaultValue: fe,
|
|
211
|
+
onValueChange: pe,
|
|
212
|
+
label: E,
|
|
213
|
+
description: D,
|
|
214
|
+
error: O,
|
|
215
|
+
clearable: k,
|
|
216
|
+
messages: A,
|
|
217
|
+
searchIcon: j,
|
|
218
|
+
clearIcon: M,
|
|
219
|
+
"aria-label": ve,
|
|
220
|
+
slotProps: {
|
|
221
|
+
...N,
|
|
222
|
+
shell: {
|
|
223
|
+
...N?.shell,
|
|
224
|
+
css: [se, N?.shell?.css]
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
onKeyDown: (e) => {
|
|
228
|
+
P?.onKeyDown?.(e), !(e.defaultPrevented || T || e.key !== "Escape" || e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229) && (e.preventDefault(), Y.current = "trigger", H(!1));
|
|
229
|
+
}
|
|
230
|
+
})
|
|
231
|
+
})]
|
|
232
|
+
})]
|
|
233
|
+
})
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
b.displayName = "ExpandingSearch";
|
|
237
|
+
//#endregion
|
|
238
|
+
export { b as t };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { t as n } from "./renderable-DzcIj1Lo.js";
|
|
4
|
+
import { useId as r } from "react";
|
|
5
|
+
import { vars as i } from "@jfrader/tokens/vars";
|
|
6
|
+
import { jsx as a, jsxs as o } from "@emotion/react/jsx-runtime";
|
|
7
|
+
//#region src/components/field/field-anatomy.tsx
|
|
8
|
+
var s = e({
|
|
9
|
+
display: "grid",
|
|
10
|
+
gap: i.space[1],
|
|
11
|
+
inlineSize: "100%"
|
|
12
|
+
}), c = e({
|
|
13
|
+
display: "inline-flex",
|
|
14
|
+
gap: i.space[1],
|
|
15
|
+
fontSize: i.textSize.sm,
|
|
16
|
+
fontWeight: i.fontWeight.medium,
|
|
17
|
+
color: i.color.text
|
|
18
|
+
}), l = e({ color: i.color.dangerText }), u = e({
|
|
19
|
+
fontSize: i.textSize.sm,
|
|
20
|
+
color: i.color.textMuted
|
|
21
|
+
}), d = e({
|
|
22
|
+
fontSize: i.textSize.sm,
|
|
23
|
+
color: i.color.dangerText
|
|
24
|
+
});
|
|
25
|
+
function f({ id: e, description: t, error: i, "aria-describedby": a, "aria-invalid": o }) {
|
|
26
|
+
let s = r(), c = e ?? s, l = `${c}-description`, u = `${c}-error`, d = n(t), f = n(i);
|
|
27
|
+
return {
|
|
28
|
+
id: c,
|
|
29
|
+
descriptionId: l,
|
|
30
|
+
errorId: u,
|
|
31
|
+
describedBy: [
|
|
32
|
+
a,
|
|
33
|
+
d && l,
|
|
34
|
+
f && u
|
|
35
|
+
].filter(Boolean).join(" ") || void 0,
|
|
36
|
+
ariaInvalid: f ? !0 : o
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function p({ "data-ui": e, className: n, dir: r, sx: i, part: o, children: c }) {
|
|
40
|
+
let l = [n, o?.className].filter(Boolean).join(" ") || void 0;
|
|
41
|
+
return /* @__PURE__ */ a(t, {
|
|
42
|
+
className: l,
|
|
43
|
+
styles: [s, o?.css],
|
|
44
|
+
sx: i,
|
|
45
|
+
children: (t) => /* @__PURE__ */ a("div", {
|
|
46
|
+
"data-ui": e,
|
|
47
|
+
dir: r,
|
|
48
|
+
className: t,
|
|
49
|
+
children: c
|
|
50
|
+
})
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function m({ id: e, htmlFor: t, required: r, part: i, children: s }) {
|
|
54
|
+
return n(s) ? /* @__PURE__ */ o("label", {
|
|
55
|
+
id: e,
|
|
56
|
+
htmlFor: t,
|
|
57
|
+
className: i?.className,
|
|
58
|
+
css: [c, i?.css],
|
|
59
|
+
children: [s, r && /* @__PURE__ */ a("span", {
|
|
60
|
+
"aria-hidden": !0,
|
|
61
|
+
css: l,
|
|
62
|
+
children: " *"
|
|
63
|
+
})]
|
|
64
|
+
}) : null;
|
|
65
|
+
}
|
|
66
|
+
function h({ id: e, part: t, children: r }) {
|
|
67
|
+
return n(r) ? /* @__PURE__ */ a("span", {
|
|
68
|
+
id: e,
|
|
69
|
+
className: t?.className,
|
|
70
|
+
css: [u, t?.css],
|
|
71
|
+
children: r
|
|
72
|
+
}) : null;
|
|
73
|
+
}
|
|
74
|
+
function g({ id: e, part: t, children: r }) {
|
|
75
|
+
return n(r) ? /* @__PURE__ */ a("span", {
|
|
76
|
+
id: e,
|
|
77
|
+
role: "alert",
|
|
78
|
+
className: t?.className,
|
|
79
|
+
css: [d, t?.css],
|
|
80
|
+
children: r
|
|
81
|
+
}) : null;
|
|
82
|
+
}
|
|
83
|
+
//#endregion
|
|
84
|
+
export { f as a, p as i, g as n, m as r, h as t };
|