@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,455 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { n, r } from "./media-8yrN85VT.js";
|
|
4
|
+
import { t as i } from "./use-controlled-state-DpeVQZNR.js";
|
|
5
|
+
import { t as a } from "./renderable-DzcIj1Lo.js";
|
|
6
|
+
import { n as o, t as s } from "./choice-control-5kJkLXgv.js";
|
|
7
|
+
import { createContext as c, useCallback as l, useContext as u, useEffect as d, useId as f, useImperativeHandle as p, useMemo as m, useRef as h, useState as g } from "react";
|
|
8
|
+
import { vars as _ } from "@jfrader/tokens/vars";
|
|
9
|
+
import { jsx as v, jsxs as y } from "@emotion/react/jsx-runtime";
|
|
10
|
+
import { MotionConfig as b, animate as x, motion as S, useMotionValue as C, useReducedMotion as w } from "motion/react";
|
|
11
|
+
//#region src/components/radio-cards/radio-cards.tsx
|
|
12
|
+
var T = c(null), E = "12rem", D = {
|
|
13
|
+
type: "spring",
|
|
14
|
+
stiffness: 500,
|
|
15
|
+
damping: 45
|
|
16
|
+
}, O = "input[data-ui=\"radio-cards-input\"]";
|
|
17
|
+
function k(e) {
|
|
18
|
+
let t = u(T);
|
|
19
|
+
if (!t) throw Error(`RadioCards.${e} must be rendered inside <RadioCards>.`);
|
|
20
|
+
return t;
|
|
21
|
+
}
|
|
22
|
+
function A(e) {
|
|
23
|
+
return Array.from(e.querySelectorAll(O)).filter((t) => t.closest("[data-ui=\"radio-cards\"]") === e);
|
|
24
|
+
}
|
|
25
|
+
function j(...e) {
|
|
26
|
+
return e.filter(Boolean).join(" ") || void 0;
|
|
27
|
+
}
|
|
28
|
+
var M = e({
|
|
29
|
+
position: "relative",
|
|
30
|
+
display: "grid",
|
|
31
|
+
gap: _.space[3],
|
|
32
|
+
minInlineSize: 0,
|
|
33
|
+
fontFamily: _.font.sans,
|
|
34
|
+
lineHeight: _.lineHeight.base,
|
|
35
|
+
color: _.color.text
|
|
36
|
+
}), N = {
|
|
37
|
+
grid: e({ gridTemplateColumns: "repeat(auto-fill, minmax(min(100%, var(--radio-cards-column)), 1fr))" }),
|
|
38
|
+
list: e({ gridTemplateColumns: "minmax(0, 1fr)" })
|
|
39
|
+
}, P = e({
|
|
40
|
+
position: "relative",
|
|
41
|
+
display: "flex",
|
|
42
|
+
minInlineSize: 0,
|
|
43
|
+
cursor: "pointer",
|
|
44
|
+
"input:checked + span": {
|
|
45
|
+
borderColor: _.color.accent,
|
|
46
|
+
backgroundColor: _.color.accentSoft
|
|
47
|
+
},
|
|
48
|
+
"input:checked + span [data-ui=\"radio-cards-indicator\"]": { borderColor: _.color.accent },
|
|
49
|
+
"input:checked + span [data-ui=\"radio-cards-indicator\"]::after": { transform: "scale(1)" },
|
|
50
|
+
"&:hover:not(:has(input:disabled)) input:not(:checked) + span": { backgroundColor: _.color.surfaceHover },
|
|
51
|
+
"&:has(input:disabled)": {
|
|
52
|
+
opacity: 1,
|
|
53
|
+
cursor: "not-allowed"
|
|
54
|
+
},
|
|
55
|
+
"&:has(input:disabled) > span": { borderStyle: "dashed" },
|
|
56
|
+
[n]: {
|
|
57
|
+
"input:checked + span": {
|
|
58
|
+
borderColor: "Highlight",
|
|
59
|
+
backgroundColor: "Canvas"
|
|
60
|
+
},
|
|
61
|
+
"input:checked + span [data-ui=\"radio-cards-indicator\"]": { borderColor: "Highlight" },
|
|
62
|
+
"input:focus-visible + span": { outlineColor: "Highlight" },
|
|
63
|
+
"&:has(input:disabled) > span": { borderColor: "GrayText" }
|
|
64
|
+
}
|
|
65
|
+
}), F = e({
|
|
66
|
+
inset: 0,
|
|
67
|
+
inlineSize: "100%",
|
|
68
|
+
blockSize: "100%",
|
|
69
|
+
cursor: "inherit"
|
|
70
|
+
}), I = e({
|
|
71
|
+
display: "flex",
|
|
72
|
+
flexWrap: "wrap",
|
|
73
|
+
alignItems: "flex-start",
|
|
74
|
+
gap: _.space[2],
|
|
75
|
+
inlineSize: "100%",
|
|
76
|
+
minInlineSize: 0,
|
|
77
|
+
minBlockSize: _.space[8],
|
|
78
|
+
boxSizing: "border-box",
|
|
79
|
+
border: `2px solid ${_.color.borderControl}`,
|
|
80
|
+
borderRadius: _.radius.lg,
|
|
81
|
+
backgroundColor: _.color.surfaceRaised,
|
|
82
|
+
color: _.color.text,
|
|
83
|
+
transitionProperty: "background-color, border-color",
|
|
84
|
+
transitionDuration: _.motion.duration.fast,
|
|
85
|
+
transitionTimingFunction: _.motion.easeStandard,
|
|
86
|
+
[r]: { transitionDuration: "0s" },
|
|
87
|
+
[n]: { borderColor: "CanvasText" }
|
|
88
|
+
}), L = {
|
|
89
|
+
sm: e({
|
|
90
|
+
padding: _.space[3],
|
|
91
|
+
fontSize: _.textSize.sm
|
|
92
|
+
}),
|
|
93
|
+
md: e({
|
|
94
|
+
padding: _.space[4],
|
|
95
|
+
fontSize: _.textSize.md
|
|
96
|
+
})
|
|
97
|
+
}, R = e({
|
|
98
|
+
display: "inline-flex",
|
|
99
|
+
alignItems: "center",
|
|
100
|
+
justifyContent: "center",
|
|
101
|
+
flexShrink: 0,
|
|
102
|
+
inlineSize: _.space[4],
|
|
103
|
+
blockSize: _.space[4],
|
|
104
|
+
marginBlockStart: _.space[1],
|
|
105
|
+
border: `1px solid ${_.color.borderControl}`,
|
|
106
|
+
borderRadius: _.radius.full,
|
|
107
|
+
"&::after": {
|
|
108
|
+
content: "\"\"",
|
|
109
|
+
inlineSize: "50%",
|
|
110
|
+
blockSize: "50%",
|
|
111
|
+
borderRadius: _.radius.full,
|
|
112
|
+
backgroundColor: _.color.accent,
|
|
113
|
+
transform: "scale(0)",
|
|
114
|
+
transitionProperty: "transform",
|
|
115
|
+
transitionDuration: _.motion.duration.fast,
|
|
116
|
+
transitionTimingFunction: _.motion.easeStandard
|
|
117
|
+
},
|
|
118
|
+
[r]: { "&::after": { transitionDuration: "0s" } },
|
|
119
|
+
[n]: {
|
|
120
|
+
borderColor: "CanvasText",
|
|
121
|
+
"&::after": { backgroundColor: "Highlight" }
|
|
122
|
+
}
|
|
123
|
+
}), z = e({
|
|
124
|
+
display: "grid",
|
|
125
|
+
gap: _.space[1],
|
|
126
|
+
flex: "1 1 8rem",
|
|
127
|
+
minInlineSize: 0,
|
|
128
|
+
overflowWrap: "anywhere"
|
|
129
|
+
}), B = e({ fontWeight: _.fontWeight.medium }), V = e({
|
|
130
|
+
fontSize: _.textSize.sm,
|
|
131
|
+
color: _.color.textMuted
|
|
132
|
+
}), H = e({
|
|
133
|
+
marginInlineStart: "auto",
|
|
134
|
+
minInlineSize: 0,
|
|
135
|
+
maxInlineSize: "100%",
|
|
136
|
+
overflowWrap: "anywhere",
|
|
137
|
+
fontSize: _.textSize.sm
|
|
138
|
+
}), U = e({
|
|
139
|
+
display: "inline-flex",
|
|
140
|
+
flexShrink: 0,
|
|
141
|
+
fontSize: _.textSize.lg,
|
|
142
|
+
"& > svg": {
|
|
143
|
+
inlineSize: "1em",
|
|
144
|
+
blockSize: "1em"
|
|
145
|
+
}
|
|
146
|
+
}), W = e({
|
|
147
|
+
gridColumn: "1 / -1",
|
|
148
|
+
minInlineSize: 0,
|
|
149
|
+
overflowWrap: "anywhere"
|
|
150
|
+
}), G = e({
|
|
151
|
+
gridColumn: "1 / -1",
|
|
152
|
+
color: _.color.dangerText,
|
|
153
|
+
fontSize: _.textSize.sm
|
|
154
|
+
}), K = e({
|
|
155
|
+
position: "absolute",
|
|
156
|
+
top: 0,
|
|
157
|
+
left: 0,
|
|
158
|
+
boxSizing: "border-box",
|
|
159
|
+
pointerEvents: "none",
|
|
160
|
+
border: `2px solid ${_.color.accent}`,
|
|
161
|
+
borderRadius: _.radius.lg,
|
|
162
|
+
[n]: { borderColor: "Highlight" }
|
|
163
|
+
});
|
|
164
|
+
function q({ root: e, value: t, content: n }) {
|
|
165
|
+
let r = w(), i = C(0), a = C(0), o = C(0), s = C(0), [c, l] = g(!1), u = h(void 0), f = h(!1);
|
|
166
|
+
return d(() => {
|
|
167
|
+
let n = e.current;
|
|
168
|
+
if (!n) return;
|
|
169
|
+
let c = A(n).find((e) => e.value === t)?.nextElementSibling, d = [], p = () => {
|
|
170
|
+
d.splice(0).forEach((e) => e.stop());
|
|
171
|
+
};
|
|
172
|
+
if (!c) {
|
|
173
|
+
l(!1), f.current = !1, u.current = t;
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
let m = [], h = (e) => {
|
|
177
|
+
let t = c.getBoundingClientRect(), u = n.getBoundingClientRect(), f = [
|
|
178
|
+
t.left - u.left - n.clientLeft + n.scrollLeft,
|
|
179
|
+
t.top - u.top - n.clientTop + n.scrollTop,
|
|
180
|
+
t.width,
|
|
181
|
+
t.height
|
|
182
|
+
];
|
|
183
|
+
f.every((e, t) => e === m[t]) || (m = f, p(), [
|
|
184
|
+
i,
|
|
185
|
+
a,
|
|
186
|
+
o,
|
|
187
|
+
s
|
|
188
|
+
].forEach((t, n) => {
|
|
189
|
+
e && !r ? d.push(x(t, f[n], D)) : t.set(f[n]);
|
|
190
|
+
}), l(!0));
|
|
191
|
+
};
|
|
192
|
+
h(f.current && u.current !== t), f.current = !0, u.current = t;
|
|
193
|
+
let g = new ResizeObserver(() => h(!1));
|
|
194
|
+
return g.observe(n), A(n).forEach((e) => {
|
|
195
|
+
e.nextElementSibling && g.observe(e.nextElementSibling);
|
|
196
|
+
}), () => {
|
|
197
|
+
g.disconnect(), p();
|
|
198
|
+
};
|
|
199
|
+
}, [
|
|
200
|
+
e,
|
|
201
|
+
t,
|
|
202
|
+
n,
|
|
203
|
+
r,
|
|
204
|
+
i,
|
|
205
|
+
a,
|
|
206
|
+
o,
|
|
207
|
+
s
|
|
208
|
+
]), /* @__PURE__ */ v(S.span, {
|
|
209
|
+
"aria-hidden": "true",
|
|
210
|
+
"data-ui": "radio-cards-ring",
|
|
211
|
+
hidden: !c,
|
|
212
|
+
style: {
|
|
213
|
+
x: i,
|
|
214
|
+
y: a,
|
|
215
|
+
width: o,
|
|
216
|
+
height: s
|
|
217
|
+
},
|
|
218
|
+
css: K
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
function J({ ref: e, value: n, defaultValue: r, onValueChange: o, name: s, required: c = !1, disabled: u = !1, invalid: _ = !1, error: x, layout: S = "grid", minColumnWidth: C = E, size: w = "md", className: D, sx: O, style: k, children: P, onKeyDown: F, "aria-labelledby": I, "aria-describedby": L, "aria-invalid": R, ...z }) {
|
|
222
|
+
let B = f(), V = h(null);
|
|
223
|
+
p(e, () => V.current, []);
|
|
224
|
+
let [H, U, W] = i(n, r, o), [K, J] = g({
|
|
225
|
+
label: [],
|
|
226
|
+
description: []
|
|
227
|
+
}), Y = a(x), X = l((e, t) => (J((n) => ({
|
|
228
|
+
...n,
|
|
229
|
+
[e]: [...n[e], t]
|
|
230
|
+
})), () => J((n) => ({
|
|
231
|
+
...n,
|
|
232
|
+
[e]: n[e].filter((e) => e !== t)
|
|
233
|
+
}))), []), Z = m(() => ({
|
|
234
|
+
value: H,
|
|
235
|
+
requestChange: U,
|
|
236
|
+
name: s ?? B,
|
|
237
|
+
disabled: u,
|
|
238
|
+
required: c,
|
|
239
|
+
invalid: _ || Y,
|
|
240
|
+
size: w,
|
|
241
|
+
register: X
|
|
242
|
+
}), [
|
|
243
|
+
H,
|
|
244
|
+
U,
|
|
245
|
+
s,
|
|
246
|
+
B,
|
|
247
|
+
u,
|
|
248
|
+
c,
|
|
249
|
+
_,
|
|
250
|
+
Y,
|
|
251
|
+
w,
|
|
252
|
+
X
|
|
253
|
+
]);
|
|
254
|
+
d(() => {
|
|
255
|
+
let e = V.current;
|
|
256
|
+
if (!e) return;
|
|
257
|
+
let t = new Set(A(e).map((e) => e.form).filter((e) => e !== null)), i = (t) => {
|
|
258
|
+
queueMicrotask(() => {
|
|
259
|
+
if (t.defaultPrevented) return;
|
|
260
|
+
W();
|
|
261
|
+
let i = n === void 0 ? r : n;
|
|
262
|
+
A(e).forEach((e) => {
|
|
263
|
+
e.checked = e.value === i;
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
};
|
|
267
|
+
return t.forEach((e) => e.addEventListener("reset", i)), () => t.forEach((e) => e.removeEventListener("reset", i));
|
|
268
|
+
}, [
|
|
269
|
+
W,
|
|
270
|
+
n,
|
|
271
|
+
r
|
|
272
|
+
]);
|
|
273
|
+
let Q = (e) => {
|
|
274
|
+
if (F?.(e), e.defaultPrevented || u) return;
|
|
275
|
+
let t = A(e.currentTarget).filter((e) => !e.disabled), n = t.indexOf(e.target);
|
|
276
|
+
if (n < 0) return;
|
|
277
|
+
let r = getComputedStyle(e.currentTarget).direction === "rtl", i = {
|
|
278
|
+
ArrowRight: n + (r ? -1 : 1),
|
|
279
|
+
ArrowLeft: n + (r ? 1 : -1),
|
|
280
|
+
ArrowDown: n + 1,
|
|
281
|
+
ArrowUp: n - 1,
|
|
282
|
+
Home: 0,
|
|
283
|
+
End: t.length - 1,
|
|
284
|
+
Enter: n
|
|
285
|
+
}[e.key];
|
|
286
|
+
if (i === void 0) return;
|
|
287
|
+
e.preventDefault();
|
|
288
|
+
let a = t[(i + t.length) % t.length];
|
|
289
|
+
a.focus(), a.click();
|
|
290
|
+
};
|
|
291
|
+
return /* @__PURE__ */ v(T.Provider, {
|
|
292
|
+
value: Z,
|
|
293
|
+
children: /* @__PURE__ */ v(t, {
|
|
294
|
+
className: D,
|
|
295
|
+
styles: [M, N[S]],
|
|
296
|
+
sx: O,
|
|
297
|
+
children: (e) => /* @__PURE__ */ y("div", {
|
|
298
|
+
...z,
|
|
299
|
+
ref: V,
|
|
300
|
+
role: "radiogroup",
|
|
301
|
+
"data-ui": "radio-cards",
|
|
302
|
+
"data-layout": S,
|
|
303
|
+
"aria-labelledby": j(I, ...K.label),
|
|
304
|
+
"aria-describedby": j(L, ...K.description, Y && `${B}-error`),
|
|
305
|
+
"aria-required": c || void 0,
|
|
306
|
+
"aria-disabled": u || void 0,
|
|
307
|
+
"aria-invalid": _ || Y ? !0 : R,
|
|
308
|
+
onKeyDown: Q,
|
|
309
|
+
className: e,
|
|
310
|
+
style: {
|
|
311
|
+
...k,
|
|
312
|
+
"--radio-cards-column": typeof C == "number" ? `${C}px` : C
|
|
313
|
+
},
|
|
314
|
+
children: [
|
|
315
|
+
P,
|
|
316
|
+
Y && /* @__PURE__ */ v("span", {
|
|
317
|
+
id: `${B}-error`,
|
|
318
|
+
role: "alert",
|
|
319
|
+
"data-ui": "radio-cards-error",
|
|
320
|
+
css: G,
|
|
321
|
+
children: x
|
|
322
|
+
}),
|
|
323
|
+
/* @__PURE__ */ v(b, {
|
|
324
|
+
reducedMotion: "user",
|
|
325
|
+
children: /* @__PURE__ */ v(q, {
|
|
326
|
+
root: V,
|
|
327
|
+
value: H,
|
|
328
|
+
content: P
|
|
329
|
+
})
|
|
330
|
+
})
|
|
331
|
+
]
|
|
332
|
+
})
|
|
333
|
+
})
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
J.displayName = "RadioCards";
|
|
337
|
+
function Y({ ref: e, value: n, label: r, description: i, meta: c, icon: l, disabledReason: u, disabled: d, required: p, onChange: m, slotProps: h, className: g, sx: _, "aria-label": b, "aria-labelledby": x, "aria-describedby": S, "aria-invalid": C, ...w }) {
|
|
338
|
+
let T = k("Item"), E = f(), D = T.disabled || d, O = D && a(u) ? u : i, A = a(r), M = a(O);
|
|
339
|
+
return /* @__PURE__ */ v(t, {
|
|
340
|
+
className: g,
|
|
341
|
+
styles: [o, P],
|
|
342
|
+
sx: _,
|
|
343
|
+
children: (t) => /* @__PURE__ */ y("label", {
|
|
344
|
+
"data-ui": "radio-cards-item",
|
|
345
|
+
"data-state": T.value === n ? "checked" : "unchecked",
|
|
346
|
+
className: t,
|
|
347
|
+
children: [/* @__PURE__ */ v("input", {
|
|
348
|
+
...w,
|
|
349
|
+
ref: e,
|
|
350
|
+
type: "radio",
|
|
351
|
+
"data-ui": "radio-cards-input",
|
|
352
|
+
name: T.name,
|
|
353
|
+
value: n,
|
|
354
|
+
checked: T.value === n,
|
|
355
|
+
disabled: D,
|
|
356
|
+
required: T.required || p,
|
|
357
|
+
"aria-label": b,
|
|
358
|
+
"aria-labelledby": j(x, !b && A && `${E}-label`),
|
|
359
|
+
"aria-describedby": j(S, M && `${E}-description`),
|
|
360
|
+
"aria-invalid": T.invalid ? !0 : C,
|
|
361
|
+
onChange: (e) => {
|
|
362
|
+
m?.(e), e.currentTarget.checked && T.requestChange(n);
|
|
363
|
+
},
|
|
364
|
+
css: [s, F]
|
|
365
|
+
}), /* @__PURE__ */ y("span", {
|
|
366
|
+
...h?.control,
|
|
367
|
+
"data-ui": "radio-cards-control",
|
|
368
|
+
css: [
|
|
369
|
+
I,
|
|
370
|
+
L[T.size],
|
|
371
|
+
h?.control?.css
|
|
372
|
+
],
|
|
373
|
+
children: [
|
|
374
|
+
/* @__PURE__ */ v("span", {
|
|
375
|
+
...h?.indicator,
|
|
376
|
+
"aria-hidden": "true",
|
|
377
|
+
"data-ui": "radio-cards-indicator",
|
|
378
|
+
css: [R, h?.indicator?.css]
|
|
379
|
+
}),
|
|
380
|
+
a(l) && /* @__PURE__ */ v("span", {
|
|
381
|
+
...h?.icon,
|
|
382
|
+
"aria-hidden": "true",
|
|
383
|
+
"data-ui": "radio-cards-icon",
|
|
384
|
+
css: [U, h?.icon?.css],
|
|
385
|
+
children: l
|
|
386
|
+
}),
|
|
387
|
+
(A || M) && /* @__PURE__ */ y("span", {
|
|
388
|
+
css: z,
|
|
389
|
+
children: [A && /* @__PURE__ */ v("span", {
|
|
390
|
+
...h?.label,
|
|
391
|
+
id: `${E}-label`,
|
|
392
|
+
"data-ui": "radio-cards-item-label",
|
|
393
|
+
css: [B, h?.label?.css],
|
|
394
|
+
children: r
|
|
395
|
+
}), M && /* @__PURE__ */ v("span", {
|
|
396
|
+
...h?.description,
|
|
397
|
+
id: `${E}-description`,
|
|
398
|
+
"data-ui": "radio-cards-item-description",
|
|
399
|
+
css: [V, h?.description?.css],
|
|
400
|
+
children: O
|
|
401
|
+
})]
|
|
402
|
+
}),
|
|
403
|
+
a(c) && /* @__PURE__ */ v("span", {
|
|
404
|
+
...h?.meta,
|
|
405
|
+
"data-ui": "radio-cards-meta",
|
|
406
|
+
css: [H, h?.meta?.css],
|
|
407
|
+
children: c
|
|
408
|
+
})
|
|
409
|
+
]
|
|
410
|
+
})]
|
|
411
|
+
})
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
Y.displayName = "RadioCards.Item";
|
|
415
|
+
function X({ kind: e, ref: n, id: r, children: i, className: o, sx: s, ...c }) {
|
|
416
|
+
let { register: l } = k(e === "label" ? "Label" : "Description"), u = f(), p = r ?? u, m = a(i);
|
|
417
|
+
return d(() => m ? l(e, p) : void 0, [
|
|
418
|
+
l,
|
|
419
|
+
e,
|
|
420
|
+
p,
|
|
421
|
+
m
|
|
422
|
+
]), m ? /* @__PURE__ */ v(t, {
|
|
423
|
+
className: o,
|
|
424
|
+
styles: [W, e === "label" ? B : V],
|
|
425
|
+
sx: s,
|
|
426
|
+
children: (t) => /* @__PURE__ */ v("span", {
|
|
427
|
+
...c,
|
|
428
|
+
ref: n,
|
|
429
|
+
id: p,
|
|
430
|
+
"data-ui": `radio-cards-${e}`,
|
|
431
|
+
className: t,
|
|
432
|
+
children: i
|
|
433
|
+
})
|
|
434
|
+
}) : null;
|
|
435
|
+
}
|
|
436
|
+
function Z(e) {
|
|
437
|
+
return /* @__PURE__ */ v(X, {
|
|
438
|
+
...e,
|
|
439
|
+
kind: "label"
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
function Q(e) {
|
|
443
|
+
return /* @__PURE__ */ v(X, {
|
|
444
|
+
...e,
|
|
445
|
+
kind: "description"
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
Z.displayName = "RadioCards.Label", Q.displayName = "RadioCards.Description";
|
|
449
|
+
var $ = Object.assign(J, {
|
|
450
|
+
Item: Y,
|
|
451
|
+
Label: Z,
|
|
452
|
+
Description: Q
|
|
453
|
+
});
|
|
454
|
+
//#endregion
|
|
455
|
+
export { $ as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
-
import { n,
|
|
4
|
-
import { t as i } from "./use-controlled-state-
|
|
3
|
+
import { n, r } from "./media-8yrN85VT.js";
|
|
4
|
+
import { t as i } from "./use-controlled-state-DpeVQZNR.js";
|
|
5
5
|
import { t as a } from "./renderable-DzcIj1Lo.js";
|
|
6
6
|
import { i as o, n as s, r as c, t as l } from "./choice-control-5kJkLXgv.js";
|
|
7
7
|
import { createContext as u, useContext as d, useId as f, useMemo as p } from "react";
|
|
@@ -48,8 +48,8 @@ var y = "16px", b = {
|
|
|
48
48
|
backgroundColor: m.color.accentContrast,
|
|
49
49
|
opacity: 0
|
|
50
50
|
},
|
|
51
|
-
[
|
|
52
|
-
[
|
|
51
|
+
[r]: { transitionDuration: "0s" },
|
|
52
|
+
[n]: { "&::after": { backgroundColor: "CanvasText" } }
|
|
53
53
|
}), w = e({ fontSize: m.textSize.sm }), T = e({
|
|
54
54
|
marginInlineStart: `calc(${y} + ${m.space[2]})`,
|
|
55
55
|
fontSize: m.textSize.sm,
|
package/dist/radio-group.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as RadioGroup } from "./radio-group-
|
|
2
|
+
export { t as RadioGroup } from "./radio-group-E6mMRgo7.js";
|