@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,360 @@
|
|
|
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 { useEffect as c, useId as ee, useLayoutEffect as te, useMemo as ne, useRef as l, useState as u } from "react";
|
|
9
|
+
import { vars as d } from "@jfrader/tokens/vars";
|
|
10
|
+
import { jsx as f, jsxs as p } from "@emotion/react/jsx-runtime";
|
|
11
|
+
//#region src/components/tree-view/tree-view.tsx
|
|
12
|
+
var re = 500, ie = {
|
|
13
|
+
loading: (e) => `Loading ${e}…`,
|
|
14
|
+
error: (e) => `Could not load ${e}. Press Enter to retry.`,
|
|
15
|
+
empty: "No items"
|
|
16
|
+
}, ae = e({
|
|
17
|
+
minInlineSize: 0,
|
|
18
|
+
background: d.color.surface,
|
|
19
|
+
color: d.color.text,
|
|
20
|
+
borderRadius: d.radius.md,
|
|
21
|
+
fontFamily: d.font.sans,
|
|
22
|
+
fontSize: d.textSize.sm,
|
|
23
|
+
lineHeight: d.lineHeight.base
|
|
24
|
+
}), oe = e({
|
|
25
|
+
listStyle: "none",
|
|
26
|
+
margin: 0,
|
|
27
|
+
padding: d.space[1],
|
|
28
|
+
overflowX: "auto",
|
|
29
|
+
"&:focus-visible": r
|
|
30
|
+
}), se = e({
|
|
31
|
+
outline: "none",
|
|
32
|
+
display: "flex",
|
|
33
|
+
alignItems: "center",
|
|
34
|
+
flex: 1,
|
|
35
|
+
minInlineSize: 0,
|
|
36
|
+
minBlockSize: d.space[8]
|
|
37
|
+
}), ce = e({
|
|
38
|
+
display: "flex",
|
|
39
|
+
alignItems: "center",
|
|
40
|
+
gap: d.space[2],
|
|
41
|
+
minBlockSize: d.space[8],
|
|
42
|
+
paddingInline: d.space[2],
|
|
43
|
+
paddingInlineStart: `calc(var(--tree-level) * ${d.space[4]} + ${d.space[2]})`,
|
|
44
|
+
borderInlineStart: "2px solid transparent",
|
|
45
|
+
borderRadius: d.radius.sm,
|
|
46
|
+
cursor: "pointer",
|
|
47
|
+
transitionProperty: "background-color, color",
|
|
48
|
+
transitionDuration: d.motion.duration.fast,
|
|
49
|
+
transitionTimingFunction: d.motion.easeStandard,
|
|
50
|
+
"&:hover": { background: d.color.surfaceHover },
|
|
51
|
+
"&:has(> [aria-selected=\"true\"])": {
|
|
52
|
+
borderInlineStartColor: d.color.accentText,
|
|
53
|
+
background: d.color.surfaceHover
|
|
54
|
+
},
|
|
55
|
+
"&:has(> [aria-disabled=\"true\"])": {
|
|
56
|
+
color: d.color.textMuted,
|
|
57
|
+
cursor: "default"
|
|
58
|
+
},
|
|
59
|
+
"&:has(> [role=\"treeitem\"]:focus-visible)": r,
|
|
60
|
+
[a]: { transitionDuration: "0s" },
|
|
61
|
+
[i]: {
|
|
62
|
+
borderInlineStartColor: "Canvas",
|
|
63
|
+
"&:has(> [aria-selected=\"true\"])": { borderInlineStartColor: "Highlight" }
|
|
64
|
+
}
|
|
65
|
+
}), le = e({
|
|
66
|
+
minInlineSize: 0,
|
|
67
|
+
overflowWrap: "anywhere"
|
|
68
|
+
}), ue = e({
|
|
69
|
+
display: "inline-flex",
|
|
70
|
+
flexShrink: 0,
|
|
71
|
+
alignItems: "center",
|
|
72
|
+
justifyContent: "center"
|
|
73
|
+
}), de = e({
|
|
74
|
+
display: "inline-flex",
|
|
75
|
+
flexShrink: 0,
|
|
76
|
+
inlineSize: d.space[8],
|
|
77
|
+
blockSize: d.space[8],
|
|
78
|
+
alignItems: "center",
|
|
79
|
+
justifyContent: "center",
|
|
80
|
+
color: "currentColor",
|
|
81
|
+
"&[data-branch=\"true\"]::after": {
|
|
82
|
+
...n,
|
|
83
|
+
transitionDuration: d.motion.duration.fast
|
|
84
|
+
},
|
|
85
|
+
"&[data-open=\"true\"]::after": { transform: "rotate(90deg)" },
|
|
86
|
+
"&:dir(rtl)[data-open=\"true\"]::after": { transform: "rotate(-90deg)" },
|
|
87
|
+
[a]: { "&[data-branch=\"true\"]::after": { transitionDuration: "0s" } }
|
|
88
|
+
}), fe = e({
|
|
89
|
+
listStyle: "none",
|
|
90
|
+
margin: 0,
|
|
91
|
+
padding: 0,
|
|
92
|
+
position: "relative",
|
|
93
|
+
"&::before": {
|
|
94
|
+
content: "\"\"",
|
|
95
|
+
position: "absolute",
|
|
96
|
+
insetBlock: 0,
|
|
97
|
+
insetInlineStart: `calc(var(--tree-level) * ${d.space[4]})`,
|
|
98
|
+
borderInlineStart: `1px solid ${d.color.border}`,
|
|
99
|
+
pointerEvents: "none"
|
|
100
|
+
}
|
|
101
|
+
}), m = e({
|
|
102
|
+
margin: 0,
|
|
103
|
+
paddingInline: d.space[2],
|
|
104
|
+
"&:empty": { padding: 0 }
|
|
105
|
+
});
|
|
106
|
+
function h({ nodes: e, value: n, defaultValue: r = null, onValueChange: i, open: a, defaultOpen: d = [], onOpenChange: h, loadChildren: g, onLoadError: pe, label: me = "Tree", messages: he, empty: _, treeRef: v, locale: y, slotProps: b, ref: ge, className: _e, sx: ve, onKeyDown: ye, onClick: be, onBlur: xe, "aria-label": Se, "aria-labelledby": x, "aria-describedby": Ce, ...we }) {
|
|
107
|
+
let S = ee(), C = l(null), w = l(/* @__PURE__ */ new Map()), T = l(null), E = l(/* @__PURE__ */ new Map()), D = l(/* @__PURE__ */ new Map()), [Te, Ee] = u(/* @__PURE__ */ new Map()), [O, k] = u(/* @__PURE__ */ new Set()), [A, j] = u(/* @__PURE__ */ new Set()), [M, De] = o(n, r, i), [N = [], P] = o(a, d, h), [F, I] = u(n ?? r), L = l({
|
|
108
|
+
text: "",
|
|
109
|
+
time: 0
|
|
110
|
+
}), R = ne(() => new Intl.Collator(y, {
|
|
111
|
+
usage: "search",
|
|
112
|
+
sensitivity: "base"
|
|
113
|
+
}), [y]), z = {
|
|
114
|
+
...ie,
|
|
115
|
+
...he
|
|
116
|
+
}, B = /* @__PURE__ */ new Map(), V = [], H = new Set(N), U = (e, t, n = 1, r = !0) => {
|
|
117
|
+
e.forEach((i, a) => {
|
|
118
|
+
let o = i.children ?? Te.get(i.id), s = {
|
|
119
|
+
node: i,
|
|
120
|
+
children: o,
|
|
121
|
+
parent: t,
|
|
122
|
+
level: n,
|
|
123
|
+
position: a + 1,
|
|
124
|
+
size: e.length,
|
|
125
|
+
branch: o === void 0 ? i.hasChildren === !0 : o.length > 0
|
|
126
|
+
};
|
|
127
|
+
B.set(i.id, s), r && V.push(s), o && U(o, i.id, n + 1, r && H.has(i.id));
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
U(e);
|
|
131
|
+
let W = V.filter((e) => !e.node.disabled), G = (e) => {
|
|
132
|
+
let t = /* @__PURE__ */ new Set();
|
|
133
|
+
for (; e != null && !t.has(e);) {
|
|
134
|
+
if (t.add(e), W.some((t) => t.node.id === e)) return e;
|
|
135
|
+
e = B.get(e)?.parent ?? E.current.get(e)?.parent;
|
|
136
|
+
}
|
|
137
|
+
return W[0]?.node.id ?? null;
|
|
138
|
+
}, K = G(F ?? M), q = (e) => {
|
|
139
|
+
I(e);
|
|
140
|
+
let t = e === null ? C.current : w.current.get(e);
|
|
141
|
+
t?.focus(), t?.scrollIntoView({
|
|
142
|
+
block: "nearest",
|
|
143
|
+
inline: "nearest"
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
te(() => {
|
|
147
|
+
if (F !== K) {
|
|
148
|
+
let e = T.current, t = C.current?.ownerDocument, n = e && t && (t.activeElement === e || !e.isConnected && t.activeElement === t.body);
|
|
149
|
+
I(K), n && q(K);
|
|
150
|
+
}
|
|
151
|
+
E.current = B;
|
|
152
|
+
}), c(() => () => {
|
|
153
|
+
for (let e of D.current.values()) e.controller.abort();
|
|
154
|
+
D.current.clear();
|
|
155
|
+
}, []), c(() => {
|
|
156
|
+
let e = new Map(V.filter((e) => H.has(e.node.id) && e.branch && !e.node.disabled && e.children === void 0).map((e) => [e.node.id, e.node]));
|
|
157
|
+
for (let [t, n] of D.current) (!e.has(t) || !g) && (n.controller.abort(), D.current.delete(t), j((e) => {
|
|
158
|
+
let n = new Set(e);
|
|
159
|
+
return n.delete(t), n;
|
|
160
|
+
}));
|
|
161
|
+
if (g) for (let [t, n] of e) {
|
|
162
|
+
if (D.current.has(t) || O.has(t)) continue;
|
|
163
|
+
let e = { controller: new AbortController() };
|
|
164
|
+
D.current.set(t, e), j((e) => new Set(e).add(t)), Promise.resolve().then(() => {
|
|
165
|
+
if (!e.controller.signal.aborted) return g(n, { signal: e.controller.signal });
|
|
166
|
+
}).then((n) => {
|
|
167
|
+
e.controller.signal.aborted || D.current.get(t) !== e || n === void 0 || (D.current.delete(t), Ee((e) => new Map(e).set(t, n)), j((e) => {
|
|
168
|
+
let n = new Set(e);
|
|
169
|
+
return n.delete(t), n;
|
|
170
|
+
}));
|
|
171
|
+
}, (r) => {
|
|
172
|
+
e.controller.signal.aborted || D.current.get(t) !== e || (D.current.delete(t), k((e) => new Set(e).add(t)), j((e) => {
|
|
173
|
+
let n = new Set(e);
|
|
174
|
+
return n.delete(t), n;
|
|
175
|
+
}), pe?.(r, n));
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
let J = (e) => k((t) => {
|
|
180
|
+
let n = new Set(t);
|
|
181
|
+
return n.delete(e), n;
|
|
182
|
+
}), Y = (e) => {
|
|
183
|
+
let t = e.node.id;
|
|
184
|
+
if (!e.branch || e.node.disabled) return;
|
|
185
|
+
if (H.has(t) && O.has(t)) {
|
|
186
|
+
J(t);
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
let n = new Set(N);
|
|
190
|
+
n.has(t) ? n.delete(t) : n.add(t), (n.size !== H.size || [...n].some((e) => !H.has(e))) && P([...n]);
|
|
191
|
+
}, X = (e) => {
|
|
192
|
+
e.node.disabled || De(e.node.id);
|
|
193
|
+
}, Oe = (e, t) => {
|
|
194
|
+
if (t.node.disabled || e.defaultPrevented || e.nativeEvent.isComposing || e.altKey || e.ctrlKey || e.metaKey) return;
|
|
195
|
+
let n = t.node.id, r = W.findIndex((e) => e.node.id === n), i = {
|
|
196
|
+
ArrowDown: () => q(W[Math.min(r + 1, W.length - 1)]?.node.id ?? null),
|
|
197
|
+
ArrowUp: () => q(W[Math.max(r - 1, 0)]?.node.id ?? null),
|
|
198
|
+
Home: () => q(W[0]?.node.id ?? null),
|
|
199
|
+
End: () => q(W.at(-1)?.node.id ?? null),
|
|
200
|
+
ArrowRight: () => {
|
|
201
|
+
if (t.branch && !A.has(n)) {
|
|
202
|
+
if (!H.has(n)) Y(t);
|
|
203
|
+
else if (O.has(n)) J(n);
|
|
204
|
+
else {
|
|
205
|
+
let e = t.children?.find((e) => !e.disabled);
|
|
206
|
+
e && q(e.id);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
ArrowLeft: () => {
|
|
211
|
+
t.branch && H.has(n) ? P([...H].filter((e) => e !== n)) : t.parent && q(G(t.parent));
|
|
212
|
+
},
|
|
213
|
+
Enter: () => H.has(n) && O.has(n) ? J(n) : X(t),
|
|
214
|
+
" ": () => X(t)
|
|
215
|
+
};
|
|
216
|
+
if (i[e.key]) {
|
|
217
|
+
e.preventDefault(), i[e.key]();
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
if (e.key.length !== 1 || e.key === "*") return;
|
|
221
|
+
let a = Date.now(), o = a - L.current.time < re ? L.current.text + e.key : e.key;
|
|
222
|
+
L.current = {
|
|
223
|
+
text: o,
|
|
224
|
+
time: a
|
|
225
|
+
};
|
|
226
|
+
let s = [...o].every((e) => R.compare(e, o[0]) === 0) ? o[0] : o;
|
|
227
|
+
for (let t = +(s.length === 1); t < W.length + 1; t++) {
|
|
228
|
+
let n = W[(r + t) % W.length];
|
|
229
|
+
if (R.compare(n.node.label.slice(0, s.length), s) === 0) {
|
|
230
|
+
e.preventDefault(), q(n.node.id);
|
|
231
|
+
break;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}, Z = (e) => `${S}-${Array.from(e, (e) => e.codePointAt(0).toString(16)).join("-")}`, Q = (e) => e.map((e) => {
|
|
235
|
+
let t = B.get(e.id), n = `${Z(e.id)}-error`, r = `${Z(e.id)}-label`, i = t.branch && H.has(e.id);
|
|
236
|
+
return /* @__PURE__ */ p("li", {
|
|
237
|
+
role: "none",
|
|
238
|
+
children: [/* @__PURE__ */ p("div", {
|
|
239
|
+
"data-ui": "tree-view-row",
|
|
240
|
+
className: b?.row?.className,
|
|
241
|
+
css: [ce, b?.row?.css],
|
|
242
|
+
style: { "--tree-level": t.level - 1 },
|
|
243
|
+
children: [
|
|
244
|
+
/* @__PURE__ */ f("span", {
|
|
245
|
+
"data-ui": "tree-view-disclosure",
|
|
246
|
+
"aria-hidden": "true",
|
|
247
|
+
"data-branch": t.branch,
|
|
248
|
+
"data-open": i,
|
|
249
|
+
className: b?.disclosure?.className,
|
|
250
|
+
css: [de, b?.disclosure?.css]
|
|
251
|
+
}),
|
|
252
|
+
s(e.icon) && /* @__PURE__ */ f("span", {
|
|
253
|
+
"data-ui": "tree-view-icon",
|
|
254
|
+
"aria-hidden": "true",
|
|
255
|
+
className: b?.icon?.className,
|
|
256
|
+
css: [ue, b?.icon?.css],
|
|
257
|
+
children: e.icon
|
|
258
|
+
}),
|
|
259
|
+
/* @__PURE__ */ f("div", {
|
|
260
|
+
ref: (t) => {
|
|
261
|
+
t ? w.current.set(e.id, t) : w.current.delete(e.id);
|
|
262
|
+
},
|
|
263
|
+
role: "treeitem",
|
|
264
|
+
css: se,
|
|
265
|
+
tabIndex: !e.disabled && K === e.id ? 0 : -1,
|
|
266
|
+
"aria-labelledby": r,
|
|
267
|
+
"aria-level": t.level,
|
|
268
|
+
"aria-posinset": t.position,
|
|
269
|
+
"aria-setsize": t.size,
|
|
270
|
+
"aria-expanded": t.branch ? i : void 0,
|
|
271
|
+
"aria-selected": e.disabled ? void 0 : M === e.id,
|
|
272
|
+
"aria-disabled": e.disabled || void 0,
|
|
273
|
+
"aria-busy": A.has(e.id) || void 0,
|
|
274
|
+
"aria-describedby": O.has(e.id) && i ? n : void 0,
|
|
275
|
+
"aria-owns": i && t.children && t.children.length > 0 ? `${Z(e.id)}-group` : void 0,
|
|
276
|
+
onFocus: (t) => {
|
|
277
|
+
t.target === t.currentTarget && (T.current = t.currentTarget, I(e.id));
|
|
278
|
+
},
|
|
279
|
+
children: /* @__PURE__ */ f("span", {
|
|
280
|
+
id: r,
|
|
281
|
+
"data-ui": "tree-view-label",
|
|
282
|
+
className: b?.label?.className,
|
|
283
|
+
css: [le, b?.label?.css],
|
|
284
|
+
children: e.label
|
|
285
|
+
})
|
|
286
|
+
})
|
|
287
|
+
]
|
|
288
|
+
}), i && t.children && t.children.length > 0 && /* @__PURE__ */ f("ul", {
|
|
289
|
+
id: `${Z(e.id)}-group`,
|
|
290
|
+
role: "group",
|
|
291
|
+
"data-ui": "tree-view-group",
|
|
292
|
+
className: b?.group?.className,
|
|
293
|
+
css: [fe, b?.group?.css],
|
|
294
|
+
style: { "--tree-level": t.level },
|
|
295
|
+
children: Q(t.children)
|
|
296
|
+
})]
|
|
297
|
+
}, e.id);
|
|
298
|
+
}), $ = _ === void 0 ? z.empty : _;
|
|
299
|
+
return /* @__PURE__ */ f(t, {
|
|
300
|
+
className: _e,
|
|
301
|
+
styles: [ae],
|
|
302
|
+
sx: ve,
|
|
303
|
+
children: (t) => /* @__PURE__ */ p("div", {
|
|
304
|
+
...we,
|
|
305
|
+
ref: ge,
|
|
306
|
+
className: t,
|
|
307
|
+
"data-ui": "tree-view",
|
|
308
|
+
onClick: (e) => {
|
|
309
|
+
if (be?.(e), e.defaultPrevented) return;
|
|
310
|
+
let t = e.target, n = t.closest("[data-ui=\"tree-view-row\"]"), r = W.find((e) => w.current.get(e.node.id)?.parentElement === n);
|
|
311
|
+
r && (q(r.node.id), t.closest("[data-ui=\"tree-view-disclosure\"]") ? Y(r) : X(r));
|
|
312
|
+
},
|
|
313
|
+
onKeyDown: (e) => {
|
|
314
|
+
if (ye?.(e), e.defaultPrevented) return;
|
|
315
|
+
let t = W.find((t) => w.current.get(t.node.id) === e.target);
|
|
316
|
+
t && Oe(e, t);
|
|
317
|
+
},
|
|
318
|
+
onBlur: (e) => {
|
|
319
|
+
xe?.(e), e.currentTarget.contains(e.relatedTarget) || I(G(M));
|
|
320
|
+
},
|
|
321
|
+
children: [
|
|
322
|
+
/* @__PURE__ */ f("ul", {
|
|
323
|
+
role: "tree",
|
|
324
|
+
"data-ui": "tree-view-tree",
|
|
325
|
+
ref: (e) => {
|
|
326
|
+
if (C.current = e, typeof v == "function") return v(e);
|
|
327
|
+
v && (v.current = e);
|
|
328
|
+
},
|
|
329
|
+
className: b?.tree?.className,
|
|
330
|
+
css: [oe, b?.tree?.css],
|
|
331
|
+
tabIndex: W.length ? void 0 : 0,
|
|
332
|
+
"aria-label": Se ?? (x ? void 0 : me),
|
|
333
|
+
"aria-labelledby": x,
|
|
334
|
+
"aria-describedby": [Ce, W.length ? void 0 : `${S}-empty`].filter(Boolean).join(" ") || void 0,
|
|
335
|
+
children: Q(e)
|
|
336
|
+
}),
|
|
337
|
+
!W.length && /* @__PURE__ */ f("p", {
|
|
338
|
+
id: `${S}-empty`,
|
|
339
|
+
css: m,
|
|
340
|
+
children: e.length ? z.empty : s($) ? $ : null
|
|
341
|
+
}),
|
|
342
|
+
/* @__PURE__ */ f("div", {
|
|
343
|
+
role: "status",
|
|
344
|
+
"aria-live": "polite",
|
|
345
|
+
"aria-atomic": "true",
|
|
346
|
+
"data-ui": "tree-view-status",
|
|
347
|
+
className: b?.status?.className,
|
|
348
|
+
css: [m, b?.status?.css],
|
|
349
|
+
children: V.filter((e) => H.has(e.node.id)).map(({ node: e }) => A.has(e.id) ? /* @__PURE__ */ f("p", { children: z.loading(e.label) }, e.id) : O.has(e.id) ? /* @__PURE__ */ f("p", {
|
|
350
|
+
id: `${Z(e.id)}-error`,
|
|
351
|
+
children: z.error(e.label)
|
|
352
|
+
}, e.id) : null)
|
|
353
|
+
})
|
|
354
|
+
]
|
|
355
|
+
})
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
h.displayName = "TreeView";
|
|
359
|
+
//#endregion
|
|
360
|
+
export { h as t };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef, type MouseEvent, type ReactNode, type RefObject } from 'react';
|
|
2
|
+
import { type Interpolation, type Theme } from '../../styling/css';
|
|
3
|
+
import { type SxProps } from '../../styling/sx';
|
|
4
|
+
import { type CountdownProps } from '../countdown';
|
|
5
|
+
export interface Announcement {
|
|
6
|
+
id: string;
|
|
7
|
+
message: ReactNode;
|
|
8
|
+
action?: {
|
|
9
|
+
label: ReactNode;
|
|
10
|
+
href?: string;
|
|
11
|
+
onClick?: (event: MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void;
|
|
12
|
+
};
|
|
13
|
+
countdown?: Pick<CountdownProps, 'target' | 'label' | 'completeLabel' | 'units' | 'clock'>;
|
|
14
|
+
}
|
|
15
|
+
export type AnnouncementBarVariant = 'subtle' | 'inverted';
|
|
16
|
+
export type AnnouncementBarTone = 'neutral' | 'info' | 'warning' | 'danger';
|
|
17
|
+
export interface AnnouncementBarLabels {
|
|
18
|
+
previous: string;
|
|
19
|
+
next: string;
|
|
20
|
+
pause: string;
|
|
21
|
+
resume: string;
|
|
22
|
+
dismiss: string;
|
|
23
|
+
slide: string;
|
|
24
|
+
carousel: string;
|
|
25
|
+
}
|
|
26
|
+
type Slot<E extends 'section' | 'div' | 'span' | 'button' | 'a'> = Omit<ComponentPropsWithRef<E>, 'ref' | 'children' | 'dangerouslySetInnerHTML'> & {
|
|
27
|
+
css?: Interpolation<Theme>;
|
|
28
|
+
};
|
|
29
|
+
export interface AnnouncementBarProps extends Omit<ComponentPropsWithRef<'section'>, 'children' | 'dangerouslySetInnerHTML'>, SxProps {
|
|
30
|
+
messages: readonly Announcement[];
|
|
31
|
+
open?: boolean;
|
|
32
|
+
defaultOpen?: boolean;
|
|
33
|
+
onOpenChange?: (open: boolean) => void;
|
|
34
|
+
value?: number;
|
|
35
|
+
defaultValue?: number;
|
|
36
|
+
onValueChange?: (index: number) => void;
|
|
37
|
+
autoPlay?: boolean;
|
|
38
|
+
paused?: boolean;
|
|
39
|
+
defaultPaused?: boolean;
|
|
40
|
+
onPausedChange?: (paused: boolean) => void;
|
|
41
|
+
interval?: number;
|
|
42
|
+
controls?: boolean;
|
|
43
|
+
dismissible?: boolean;
|
|
44
|
+
variant?: AnnouncementBarVariant;
|
|
45
|
+
tone?: AnnouncementBarTone;
|
|
46
|
+
label?: string;
|
|
47
|
+
live?: 'off' | 'polite';
|
|
48
|
+
locale?: Intl.LocalesArgument;
|
|
49
|
+
labels?: Partial<AnnouncementBarLabels>;
|
|
50
|
+
getMessageLabel?: (index: number, total: number) => string;
|
|
51
|
+
onAction?: (announcement: Announcement) => void;
|
|
52
|
+
onCountdownEnd?: (announcement: Announcement) => void;
|
|
53
|
+
dismissFocusRef?: RefObject<HTMLElement | null>;
|
|
54
|
+
slotProps?: {
|
|
55
|
+
root?: Slot<'section'>;
|
|
56
|
+
content?: Slot<'div'>;
|
|
57
|
+
message?: Slot<'span'>;
|
|
58
|
+
action?: Omit<Slot<'a'> & Slot<'button'>, 'onClick'> & {
|
|
59
|
+
onClick?: (event: MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void;
|
|
60
|
+
};
|
|
61
|
+
previous?: Slot<'button'>;
|
|
62
|
+
next?: Slot<'button'>;
|
|
63
|
+
rotation?: Slot<'button'>;
|
|
64
|
+
dismiss?: Slot<'button'>;
|
|
65
|
+
countdown?: Omit<Slot<'div'>, 'onClick'>;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/** APG basic carousel: native Tab/Enter/Space; focus stops rotation until Resume. No custom arrow/Escape keys.
|
|
69
|
+
* State modes must not change during an instance. The app owns persistence and keyboard dismissal destinations.
|
|
70
|
+
*/
|
|
71
|
+
export declare function AnnouncementBar({ ref, messages, open: openProp, defaultOpen, onOpenChange, value, defaultValue, onValueChange, autoPlay, paused: pausedProp, defaultPaused, onPausedChange, interval, controls, dismissible, variant, tone, label, live, locale, labels: labelsProp, getMessageLabel, onAction, onCountdownEnd, dismissFocusRef, slotProps, className, sx, ...rest }: AnnouncementBarProps): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
72
|
+
export declare namespace AnnouncementBar {
|
|
73
|
+
var displayName: string;
|
|
74
|
+
}
|
|
75
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef } from 'react';
|
|
2
|
+
import { type Interpolation, type Theme } from '../../styling/css';
|
|
3
|
+
import { type SxProps } from '../../styling/sx';
|
|
4
|
+
import { type AvatarProps, type AvatarSize, type AvatarStatus } from '../avatar';
|
|
5
|
+
export interface AvatarGroupMember {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
src?: string;
|
|
9
|
+
status?: AvatarStatus;
|
|
10
|
+
statusLabel?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface AvatarGroupPartProps {
|
|
13
|
+
className?: string;
|
|
14
|
+
css?: Interpolation<Theme>;
|
|
15
|
+
}
|
|
16
|
+
export interface AvatarGroupProps extends Omit<ComponentPropsWithRef<'div'>, 'children' | 'role'>, SxProps {
|
|
17
|
+
/** Stable display order of people; immutable input. */
|
|
18
|
+
members: readonly AvatarGroupMember[];
|
|
19
|
+
/** Maximum number of visible people; overflow does not consume a person slot. Defaults to 4. */
|
|
20
|
+
max?: number;
|
|
21
|
+
/** Size for avatars and the overflow count circle. Defaults to 'md'. */
|
|
22
|
+
size?: AvatarSize;
|
|
23
|
+
/** Fallback accessible name for the group landmark. Defaults to 'Team members'. */
|
|
24
|
+
label?: string;
|
|
25
|
+
/** Locale for formatting count numerals; pin for deterministic SSR. Defaults to ambient Intl locale. */
|
|
26
|
+
locale?: Intl.LocalesArgument;
|
|
27
|
+
/** Formats the accessible name of the overflow image. Defaults to English plural wording. */
|
|
28
|
+
getOverflowLabel?: (hidden: number, formatted: string) => string;
|
|
29
|
+
/** Formats the total count summary description. Defaults to English plural wording. */
|
|
30
|
+
getSummaryLabel?: (total: number, formatted: string) => string;
|
|
31
|
+
/** Style overrides for internal parts. */
|
|
32
|
+
slotProps?: {
|
|
33
|
+
member?: AvatarGroupPartProps;
|
|
34
|
+
overflow?: AvatarGroupPartProps;
|
|
35
|
+
summary?: AvatarGroupPartProps;
|
|
36
|
+
};
|
|
37
|
+
/** Shared styling overrides passed down to each child Avatar. Cannot override id/name/status. */
|
|
38
|
+
avatarProps?: Pick<AvatarProps, 'slotProps' | 'sx' | 'className'>;
|
|
39
|
+
}
|
|
40
|
+
export declare function AvatarGroup({ ref, members, max, size, label, locale, getOverflowLabel, getSummaryLabel, slotProps, avatarProps, className, sx, ...rest }: AvatarGroupProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
41
|
+
export declare namespace AvatarGroup {
|
|
42
|
+
var displayName: string;
|
|
43
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef, type ReactNode } from 'react';
|
|
2
|
+
import { type SxProps } from '../../styling/sx';
|
|
3
|
+
export interface BottomSheetProps {
|
|
4
|
+
open?: boolean;
|
|
5
|
+
defaultOpen?: boolean;
|
|
6
|
+
onOpenChange?: (open: boolean) => void;
|
|
7
|
+
/** Nonempty ascending unique fractions in (0, 1]. Numeric contents require remount to change. */
|
|
8
|
+
detents?: readonly number[];
|
|
9
|
+
value?: number;
|
|
10
|
+
defaultValue?: number;
|
|
11
|
+
onValueChange?: (index: number) => void;
|
|
12
|
+
locale?: Intl.LocalesArgument;
|
|
13
|
+
getValueText?: (fraction: number, index: number) => string;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
export interface BottomSheetTriggerProps extends ComponentPropsWithRef<'button'>, SxProps {
|
|
17
|
+
}
|
|
18
|
+
export interface BottomSheetContentProps extends Omit<ComponentPropsWithRef<'dialog'>, 'open'>, SxProps {
|
|
19
|
+
withDescription?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface BottomSheetPanelProps extends ComponentPropsWithRef<'div'>, SxProps {
|
|
22
|
+
}
|
|
23
|
+
export interface BottomSheetHeaderProps extends ComponentPropsWithRef<'div'>, SxProps {
|
|
24
|
+
}
|
|
25
|
+
export interface BottomSheetBodyProps extends ComponentPropsWithRef<'div'>, SxProps {
|
|
26
|
+
}
|
|
27
|
+
export interface BottomSheetFooterProps extends ComponentPropsWithRef<'div'>, SxProps {
|
|
28
|
+
}
|
|
29
|
+
export interface BottomSheetTitleProps extends ComponentPropsWithRef<'h2'>, SxProps {
|
|
30
|
+
}
|
|
31
|
+
export interface BottomSheetDescriptionProps extends ComponentPropsWithRef<'p'>, SxProps {
|
|
32
|
+
}
|
|
33
|
+
export interface BottomSheetHandleProps extends ComponentPropsWithRef<'button'>, SxProps {
|
|
34
|
+
}
|
|
35
|
+
export interface BottomSheetCloseProps extends ComponentPropsWithRef<'button'>, SxProps {
|
|
36
|
+
}
|
|
37
|
+
declare function BottomSheetRoot(props: BottomSheetProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
38
|
+
declare function BottomSheetTrigger({ ref, onClick, className, sx, ...props }: BottomSheetTriggerProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
39
|
+
declare function BottomSheetContent({ ref, sx, className, ...props }: BottomSheetContentProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
40
|
+
declare function BottomSheetPanel({ ref, sx, className, autoFocus, ...props }: BottomSheetPanelProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
41
|
+
declare function BottomSheetHeader({ ref, sx, className, ...props }: BottomSheetHeaderProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
42
|
+
declare function BottomSheetBody({ ref, sx, className, onKeyDown, onFocusCapture, ...props }: BottomSheetBodyProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
43
|
+
declare function BottomSheetFooter({ ref, sx, className, ...props }: BottomSheetFooterProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
44
|
+
declare function BottomSheetTitle({ ref, sx, className, children, ...props }: BottomSheetTitleProps): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
45
|
+
declare function BottomSheetDescription({ ref, sx, className, children, ...props }: BottomSheetDescriptionProps): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
46
|
+
declare function BottomSheetHandle({ ref, sx, className, onClick, onKeyDown, 'aria-describedby': described, ...props }: BottomSheetHandleProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
47
|
+
declare function BottomSheetClose({ ref, sx, className, onClick, ...props }: BottomSheetCloseProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
48
|
+
export declare const BottomSheet: typeof BottomSheetRoot & {
|
|
49
|
+
Trigger: typeof BottomSheetTrigger;
|
|
50
|
+
Content: typeof BottomSheetContent;
|
|
51
|
+
Panel: typeof BottomSheetPanel;
|
|
52
|
+
Header: typeof BottomSheetHeader;
|
|
53
|
+
Body: typeof BottomSheetBody;
|
|
54
|
+
Footer: typeof BottomSheetFooter;
|
|
55
|
+
Title: typeof BottomSheetTitle;
|
|
56
|
+
Description: typeof BottomSheetDescription;
|
|
57
|
+
Handle: typeof BottomSheetHandle;
|
|
58
|
+
Close: typeof BottomSheetClose;
|
|
59
|
+
};
|
|
60
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { BottomSheet } from './bottom-sheet';
|
|
2
|
+
export type { BottomSheetProps, BottomSheetTriggerProps, BottomSheetContentProps, BottomSheetPanelProps, BottomSheetHeaderProps, BottomSheetBodyProps, BottomSheetFooterProps, BottomSheetTitleProps, BottomSheetDescriptionProps, BottomSheetHandleProps, BottomSheetCloseProps, } from './bottom-sheet';
|
|
@@ -2,6 +2,16 @@ import { type ComponentPropsWithRef } from 'react';
|
|
|
2
2
|
import { type SxProps } from '../../styling/sx';
|
|
3
3
|
/** Day of the week as counted by `Date#getUTCDay`: 0 is Sunday, 6 is Saturday. */
|
|
4
4
|
export type CalendarWeekday = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
5
|
+
/** Inclusive interval of 'YYYY-MM-DD' dates, start ≤ end. */
|
|
6
|
+
export interface CalendarRange {
|
|
7
|
+
start: string;
|
|
8
|
+
end: string;
|
|
9
|
+
}
|
|
10
|
+
/** Descriptions read on the first and last day of `selectionRange`. */
|
|
11
|
+
export interface CalendarRangeLabels {
|
|
12
|
+
start: string;
|
|
13
|
+
end: string;
|
|
14
|
+
}
|
|
5
15
|
export interface CalendarProps extends Omit<ComponentPropsWithRef<'div'>, 'defaultValue' | 'onChange'>, SxProps {
|
|
6
16
|
/** Selected date, 'YYYY-MM-DD'. */
|
|
7
17
|
value?: string;
|
|
@@ -19,11 +29,25 @@ export interface CalendarProps extends Omit<ComponentPropsWithRef<'div'>, 'defau
|
|
|
19
29
|
locale?: string;
|
|
20
30
|
/** Defaults to the locale's week start. */
|
|
21
31
|
firstDayOfWeek?: CalendarWeekday;
|
|
32
|
+
/** 'YYYY-MM-DD' marked as today. Defaults to the local civil date at render time. */
|
|
33
|
+
today?: string;
|
|
34
|
+
/** Range mode: the selected interval (null for none). Replaces `value` as the selection. */
|
|
35
|
+
selectionRange?: CalendarRange | null;
|
|
36
|
+
/** Tentative interval, decorated but not selected. */
|
|
37
|
+
previewRange?: CalendarRange | null;
|
|
38
|
+
/** Parent-owned roving tab stop; null or a date outside the shown month leaves no day tab stop. */
|
|
39
|
+
tabStopDate?: string | null;
|
|
40
|
+
/** Every native day activation (click, Enter, Space), including the selected day. */
|
|
41
|
+
onDayActivate?: (date: string) => void;
|
|
42
|
+
/** A day received focus, or a keyboard move chose its destination (possibly in another month). */
|
|
43
|
+
onFocusedDateChange?: (date: string) => void;
|
|
44
|
+
/** Range mode: endpoint descriptions for screen readers. */
|
|
45
|
+
rangeLabels?: CalendarRangeLabels;
|
|
22
46
|
}
|
|
23
47
|
/** The header renders its own month buttons and label. */
|
|
24
48
|
export type CalendarHeaderProps = Omit<ComponentPropsWithRef<'div'>, 'children'> & SxProps;
|
|
25
49
|
export type CalendarGridProps = ComponentPropsWithRef<'table'> & SxProps;
|
|
26
|
-
declare function CalendarRoot({ ref, value: valueProp, defaultValue, onValueChange, visibleMonth: visibleMonthProp, defaultVisibleMonth, onVisibleMonthChange, min: minProp, max: maxProp, locale: localeProp, firstDayOfWeek: firstDayOfWeekProp, className, sx, ...rest }: CalendarProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
50
|
+
declare function CalendarRoot({ ref, value: valueProp, defaultValue, onValueChange, visibleMonth: visibleMonthProp, defaultVisibleMonth, onVisibleMonthChange, min: minProp, max: maxProp, locale: localeProp, firstDayOfWeek: firstDayOfWeekProp, today: todayProp, selectionRange, previewRange, tabStopDate, onDayActivate: onDayActivateProp, onFocusedDateChange: onFocusedDateChangeProp, rangeLabels, className, sx, children, ...rest }: CalendarProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
27
51
|
declare function CalendarHeader({ ref, className, sx, ...props }: CalendarHeaderProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
28
52
|
declare function CalendarGrid({ ref, onKeyDown, 'aria-labelledby': ariaLabelledByProp, 'aria-label': ariaLabelProp, className, sx, ...rest }: CalendarGridProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
29
53
|
export declare const Calendar: typeof CalendarRoot & {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Calendar } from './calendar';
|
|
2
|
-
export type { CalendarGridProps, CalendarHeaderProps, CalendarProps, CalendarWeekday } from './calendar';
|
|
2
|
+
export type { CalendarGridProps, CalendarHeaderProps, CalendarProps, CalendarRange, CalendarRangeLabels, CalendarWeekday, } from './calendar';
|