@jfrader/ui 0.1.1 → 0.2.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.
Files changed (167) hide show
  1. package/README.md +3 -1
  2. package/dist/accordion-CkOZ-tvs.js +178 -0
  3. package/dist/accordion.js +2 -1
  4. package/dist/alert-Dsjx14UW.js +131 -0
  5. package/dist/alert.js +2 -1
  6. package/dist/avatar-BRGKkoSr.js +127 -0
  7. package/dist/avatar.js +2 -1
  8. package/dist/badge-DLxUMsCx.js +104 -0
  9. package/dist/badge.js +2 -1
  10. package/dist/breadcrumbs-694hF_hm.js +131 -0
  11. package/dist/breadcrumbs.js +2 -1
  12. package/dist/button-CoaIcykB.js +190 -0
  13. package/dist/button.js +2 -1
  14. package/dist/calendar-Doj7PTdG.js +379 -0
  15. package/dist/calendar.js +2 -1
  16. package/dist/card-2IM71XZj.js +134 -0
  17. package/dist/card.js +2 -1
  18. package/dist/checkbox-B7xGNFzp.js +136 -0
  19. package/dist/checkbox.js +2 -1
  20. package/dist/{choice-control-DCyQ_hVw.js → choice-control-ByFogYcT.js} +2 -1
  21. package/dist/{collection-registry-C2jnQa7X.js → collection-registry-1l9f3XJZ.js} +3 -2
  22. package/dist/combobox-Bjhxv5U3.js +311 -0
  23. package/dist/combobox.js +2 -1
  24. package/dist/command-palette-BhJwm6cS.js +344 -0
  25. package/dist/command-palette.js +2 -1
  26. package/dist/container-BhnrGPu-.js +36 -0
  27. package/dist/container.js +2 -1
  28. package/dist/{css-CW_HG55W.js → css-Cgj6sCHn.js} +1 -0
  29. package/dist/date-picker-Jk8SpoiO.js +245 -0
  30. package/dist/date-picker.js +2 -1
  31. package/dist/dialog-fhS07G41.js +187 -0
  32. package/dist/dialog.js +2 -1
  33. package/dist/{disclosure-caret-BC6P8AsM.js → disclosure-caret-C5T3fcl6.js} +1 -0
  34. package/dist/divider-v_78HYF5.js +79 -0
  35. package/dist/divider.js +2 -1
  36. package/dist/{field-anatomy-DKkB268x.js → field-anatomy-BzGw1Ch9.js} +4 -3
  37. package/dist/flex-COZzFqI8.js +22 -0
  38. package/dist/flex.js +2 -1
  39. package/dist/{focus-ring-qOS3rPlM.js → focus-ring-BK5W5_NY.js} +1 -0
  40. package/dist/{icon-wrapper-BKo4FI-O.js → icon-wrapper-CFWzew5m.js} +2 -1
  41. package/dist/index.js +37 -36
  42. package/dist/kbd-CeP8Kfvp.js +61 -0
  43. package/dist/kbd.js +2 -1
  44. package/dist/{layout-style-B_6YHQ6Q.js → layout-style-7ZTOiWGR.js} +2 -1
  45. package/dist/{loading-ring-CTpT-IrT.js → loading-ring-BpdB0aFi.js} +2 -1
  46. package/dist/{media-8K3xDAxM.js → media-D_eA_I-e.js} +1 -0
  47. package/dist/menu-B6KCbLCr.js +196 -0
  48. package/dist/menu.js +2 -1
  49. package/dist/navigation-BDht6S2-.js +182 -0
  50. package/dist/navigation.js +2 -1
  51. package/dist/pagination-B50PCaDU.js +151 -0
  52. package/dist/pagination.js +2 -1
  53. package/dist/{part-id-Bg1LSlk7.js → part-id-D0zksy32.js} +1 -0
  54. package/dist/pill-2_XzBdkD.js +51 -0
  55. package/dist/pill.js +2 -1
  56. package/dist/popover-DRHbeIVq.js +103 -0
  57. package/dist/popover.js +2 -1
  58. package/dist/progress-CpsskKTD.js +85 -0
  59. package/dist/progress.js +2 -1
  60. package/dist/radio-group-DPI5KUCj.js +136 -0
  61. package/dist/radio-group.js +2 -1
  62. package/dist/{renderable-DwPvt1I8.js → renderable-DzcIj1Lo.js} +1 -0
  63. package/dist/{roving-focus-DeEZ55-T.js → roving-focus-CYlo_Kf8.js} +1 -0
  64. package/dist/select-C1xGrOhT.js +266 -0
  65. package/dist/select.js +2 -1
  66. package/dist/skeleton-DitdP-yz.js +49 -0
  67. package/dist/skeleton.js +2 -1
  68. package/dist/spinner-CFq5HPoo.js +51 -0
  69. package/dist/spinner.js +2 -1
  70. package/dist/stack-D_g6NJzo.js +21 -0
  71. package/dist/stack.js +2 -1
  72. package/dist/{surface-Bo_aSQOb.js → surface-DZ4d-2aL.js} +1 -0
  73. package/dist/switch-B5TTU-oJ.js +138 -0
  74. package/dist/switch.js +2 -1
  75. package/dist/tabs-C26PWl2c.js +183 -0
  76. package/dist/tabs.js +2 -1
  77. package/dist/text-field-8PQAqRpM.js +75 -0
  78. package/dist/text-field.js +2 -1
  79. package/dist/textarea-CcGWuntL.js +85 -0
  80. package/dist/textarea.js +2 -1
  81. package/dist/theme-root-BRLIA4eb.js +22 -0
  82. package/dist/theme-root.js +2 -1
  83. package/dist/toast-B1PXuwZ4.js +277 -0
  84. package/dist/toast.js +2 -1
  85. package/dist/toggle-group-N_owicT0.js +156 -0
  86. package/dist/toggle-group.js +2 -1
  87. package/dist/tooltip-BJPisf60.js +98 -0
  88. package/dist/tooltip.js +2 -1
  89. package/dist/{trigger-style-f54idgjT.js → trigger-style-B1GFmH7M.js} +2 -1
  90. package/dist/types/components/accordion/accordion.d.ts +13 -9
  91. package/dist/types/components/alert/alert.d.ts +6 -3
  92. package/dist/types/components/avatar/avatar.d.ts +6 -3
  93. package/dist/types/components/badge/badge.d.ts +6 -3
  94. package/dist/types/components/breadcrumbs/breadcrumbs.d.ts +8 -5
  95. package/dist/types/components/button/button.d.ts +6 -3
  96. package/dist/types/components/calendar/calendar.d.ts +11 -7
  97. package/dist/types/components/card/card.d.ts +20 -13
  98. package/dist/types/components/checkbox/checkbox.d.ts +6 -3
  99. package/dist/types/components/combobox/combobox.d.ts +12 -8
  100. package/dist/types/components/command-palette/command-palette.d.ts +22 -15
  101. package/dist/types/components/container/container.d.ts +6 -3
  102. package/dist/types/components/date-picker/date-picker.d.ts +6 -4
  103. package/dist/types/components/dialog/dialog.d.ts +16 -11
  104. package/dist/types/components/divider/divider.d.ts +6 -3
  105. package/dist/types/components/flex/flex.d.ts +6 -3
  106. package/dist/types/components/kbd/kbd.d.ts +8 -5
  107. package/dist/types/components/menu/menu.d.ts +13 -9
  108. package/dist/types/components/navigation/navigation.d.ts +11 -7
  109. package/dist/types/components/pagination/pagination.d.ts +6 -3
  110. package/dist/types/components/pill/pill.d.ts +6 -3
  111. package/dist/types/components/popover/popover.d.ts +7 -5
  112. package/dist/types/components/progress/progress.d.ts +6 -3
  113. package/dist/types/components/radio-group/radio-group.d.ts +8 -5
  114. package/dist/types/components/select/select.d.ts +13 -9
  115. package/dist/types/components/skeleton/skeleton.d.ts +6 -3
  116. package/dist/types/components/spinner/spinner.d.ts +6 -3
  117. package/dist/types/components/stack/stack.d.ts +4 -1
  118. package/dist/types/components/switch/switch.d.ts +6 -3
  119. package/dist/types/components/tabs/tabs.d.ts +14 -9
  120. package/dist/types/components/text-field/text-field.d.ts +6 -3
  121. package/dist/types/components/textarea/textarea.d.ts +6 -3
  122. package/dist/types/components/theme-root/theme-root.d.ts +6 -3
  123. package/dist/types/components/toast/toast.d.ts +6 -4
  124. package/dist/types/components/toggle-group/toggle-group.d.ts +7 -5
  125. package/dist/types/components/tooltip/tooltip.d.ts +7 -5
  126. package/dist/types/overlay/use-native-dialog.d.ts +2 -2
  127. package/dist/{use-controlled-state-DQXkiTQI.js → use-controlled-state-CVXDa-qM.js} +1 -0
  128. package/dist/{use-native-dialog-BCp1chwO.js → use-native-dialog-DWpIUVO1.js} +1 -0
  129. package/dist/{use-overlay-floating-CsZd3qxa.js → use-overlay-floating-efeqppiw.js} +1 -0
  130. package/dist/{visually-hidden-BXVyhj0y.js → visually-hidden-DCWhf0Cb.js} +2 -1
  131. package/package.json +4 -4
  132. package/dist/accordion-Dl-kvgPQ.js +0 -168
  133. package/dist/alert-BzntPa_5.js +0 -129
  134. package/dist/avatar-Dk2ES3ru.js +0 -124
  135. package/dist/badge-DZefC7rm.js +0 -102
  136. package/dist/breadcrumbs-5MCZ_Jr3.js +0 -125
  137. package/dist/button-qy-50NPd.js +0 -187
  138. package/dist/calendar-DcCAiN3b.js +0 -372
  139. package/dist/card-L-Z_1vZN.js +0 -120
  140. package/dist/checkbox-B7em7B-6.js +0 -134
  141. package/dist/combobox-DQcXR94r.js +0 -301
  142. package/dist/command-palette-BRJ8A5De.js +0 -328
  143. package/dist/container-COHiEjI8.js +0 -34
  144. package/dist/date-picker-D1GwiRB9.js +0 -239
  145. package/dist/dialog-CYf9fCZO.js +0 -175
  146. package/dist/divider-bi7OgCI5.js +0 -76
  147. package/dist/flex-CDFDDaiu.js +0 -21
  148. package/dist/kbd-DpiJgDJ2.js +0 -55
  149. package/dist/menu-A9fZUaAG.js +0 -186
  150. package/dist/navigation-Cemnmc_J.js +0 -174
  151. package/dist/pagination-orCjUsn_.js +0 -148
  152. package/dist/pill-Dg2JJHHW.js +0 -49
  153. package/dist/popover-D_YU34WS.js +0 -97
  154. package/dist/progress-XdvBG0Vv.js +0 -83
  155. package/dist/radio-group-CxMJ2Vq7.js +0 -130
  156. package/dist/select-mwFbmzsn.js +0 -256
  157. package/dist/skeleton-qas9ZKK9.js +0 -47
  158. package/dist/spinner-ros2CfIf.js +0 -49
  159. package/dist/stack-Hs8THnIL.js +0 -20
  160. package/dist/switch-E375Bz4X.js +0 -135
  161. package/dist/tabs-CBwRiuul.js +0 -173
  162. package/dist/text-field-BlP8qGn_.js +0 -73
  163. package/dist/textarea-CUG26CH2.js +0 -83
  164. package/dist/theme-root-CrdzwfSo.js +0 -20
  165. package/dist/toast-D_dnqnn-.js +0 -270
  166. package/dist/toggle-group-B7gXCea8.js +0 -150
  167. package/dist/tooltip-BJ2hLV1b.js +0 -92
@@ -1,372 +0,0 @@
1
- import { t as e } from "./css-CW_HG55W.js";
2
- import { n as t } from "./focus-ring-qOS3rPlM.js";
3
- import { n, t as r } from "./media-8K3xDAxM.js";
4
- import { t as i } from "./use-controlled-state-DQXkiTQI.js";
5
- import { createContext as a, forwardRef as o, useContext as s, useEffect as c, useId as l, useImperativeHandle as u, useLayoutEffect as d, useMemo as f, useRef as p, useState as m } from "react";
6
- import { vars as h } from "@jfrader/tokens/vars";
7
- import { jsx as g, jsxs as _ } from "@emotion/react/jsx-runtime";
8
- //#region src/components/calendar/calendar.styles.ts
9
- var v = e({
10
- display: "inline-flex",
11
- flexDirection: "column",
12
- gap: h.space[2],
13
- fontFamily: h.font.sans,
14
- color: h.color.text
15
- }), y = e({
16
- display: "flex",
17
- alignItems: "center",
18
- gap: h.space[2]
19
- }), b = e({
20
- flex: 1,
21
- textAlign: "center",
22
- fontSize: h.textSize.sm,
23
- fontWeight: h.fontWeight.semibold
24
- }), x = {
25
- transitionDuration: h.motion.duration.fast,
26
- transitionTimingFunction: h.motion.easeStandard,
27
- [n]: { transitionDuration: "0s" }
28
- }, S = e({
29
- appearance: "none",
30
- display: "inline-flex",
31
- alignItems: "center",
32
- justifyContent: "center",
33
- inlineSize: "32px",
34
- blockSize: "32px",
35
- padding: 0,
36
- border: `1px solid ${h.color.borderControl}`,
37
- borderRadius: h.radius.sm,
38
- backgroundColor: "transparent",
39
- font: "inherit",
40
- fontSize: h.textSize.lg,
41
- lineHeight: 1,
42
- color: h.color.text,
43
- cursor: "pointer",
44
- transitionProperty: "background-color",
45
- ...x,
46
- "&:hover:not([aria-disabled=\"true\"])": { backgroundColor: h.color.surfaceHover },
47
- "&[aria-disabled=\"true\"]": {
48
- opacity: .55,
49
- cursor: "not-allowed"
50
- },
51
- "&:focus-visible": { ...t }
52
- }), C = e({
53
- display: "inline-block",
54
- "&:dir(rtl)": { transform: "scaleX(-1)" }
55
- }), w = e({
56
- borderCollapse: "separate",
57
- borderSpacing: h.space[1],
58
- marginInline: `calc(-1 * ${h.space[1]})`
59
- }), T = e({
60
- paddingBlock: h.space[1],
61
- fontSize: h.textSize.xs,
62
- fontWeight: h.fontWeight.medium,
63
- color: h.color.textMuted,
64
- textAlign: "center"
65
- }), E = e({ padding: 0 }), D = e({
66
- appearance: "none",
67
- display: "inline-flex",
68
- alignItems: "center",
69
- justifyContent: "center",
70
- inlineSize: "36px",
71
- blockSize: "36px",
72
- padding: 0,
73
- border: "1px solid transparent",
74
- borderRadius: h.radius.sm,
75
- backgroundColor: "transparent",
76
- font: "inherit",
77
- fontSize: h.textSize.sm,
78
- fontVariantNumeric: "tabular-nums",
79
- color: h.color.text,
80
- cursor: "pointer",
81
- transitionProperty: "background-color, border-color, color",
82
- ...x,
83
- "&:hover:not(:disabled):not([data-selected])": { backgroundColor: h.color.surfaceHover },
84
- "&[data-today]": {
85
- borderColor: h.color.borderControl,
86
- fontWeight: h.fontWeight.semibold
87
- },
88
- "&[data-selected]": {
89
- backgroundColor: h.color.accent,
90
- borderColor: h.color.accent,
91
- color: h.color.accentContrast,
92
- fontWeight: h.fontWeight.semibold
93
- },
94
- "&[data-selected]:hover": { backgroundColor: h.color.accentHover },
95
- "&:disabled": {
96
- opacity: .55,
97
- cursor: "not-allowed",
98
- textDecoration: "line-through"
99
- },
100
- "&:focus-visible": { ...t },
101
- [r]: { "&[data-selected]": {
102
- forcedColorAdjust: "none",
103
- backgroundColor: "Highlight",
104
- borderColor: "Highlight",
105
- color: "HighlightText"
106
- } }
107
- }), O = /^\d{4}-\d{2}-\d{2}$/, k = /^\d{4}-\d{2}$/, A = 12, j = 0, M = "2026-01-04", N = (e, t) => String(e).padStart(t, "0");
108
- function P(e, t, n) {
109
- let r = new Date(Date.UTC(0, 0, 1));
110
- return r.setUTCFullYear(e, t, n), r;
111
- }
112
- function F(e) {
113
- let [t = NaN, n = NaN, r = 1] = e.split("-").map(Number);
114
- return P(t, n - 1, r);
115
- }
116
- var I = (e) => `${N(e.getUTCFullYear(), 4)}-${N(e.getUTCMonth() + 1, 2)}-${N(e.getUTCDate(), 2)}`, L = (e) => e !== void 0 && O.test(e) && I(F(e)) === e, R = (e) => e !== void 0 && k.test(e) && L(`${e}-01`), z = (e) => e.slice(0, 7), B = (e) => `${e}-01`;
117
- function V(e, t) {
118
- let n = F(e);
119
- return I(P(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate() + t));
120
- }
121
- function H(e, t) {
122
- let n = F(e), r = P(n.getUTCFullYear(), n.getUTCMonth() + t, 1), i = P(r.getUTCFullYear(), r.getUTCMonth() + 1, 0).getUTCDate();
123
- return I(P(r.getUTCFullYear(), r.getUTCMonth(), Math.min(n.getUTCDate(), i)));
124
- }
125
- var U = (e, t) => z(H(B(e), t)), W = (e) => V(B(U(e, 1)), -1), G = (e, t, n) => (t === void 0 || e >= t) && (n === void 0 || e <= n);
126
- function ee(e, t, n) {
127
- return t !== void 0 && e < t ? t : n !== void 0 && e > n ? n : e;
128
- }
129
- var K = (e, t) => (F(e).getUTCDay() - t + 7) % 7;
130
- function te(e) {
131
- let t = new Intl.Locale(e), n = t.getWeekInfo?.() ?? t.weekInfo;
132
- return n ? n.firstDay % 7 : j;
133
- }
134
- var q = {
135
- calendar: "gregory",
136
- timeZone: "UTC"
137
- };
138
- function ne(e) {
139
- return {
140
- month: new Intl.DateTimeFormat(e, {
141
- ...q,
142
- month: "long",
143
- year: "numeric"
144
- }),
145
- day: new Intl.DateTimeFormat(e, {
146
- ...q,
147
- day: "numeric"
148
- }),
149
- date: new Intl.DateTimeFormat(e, {
150
- ...q,
151
- dateStyle: "long"
152
- }),
153
- weekdayShort: new Intl.DateTimeFormat(e, {
154
- ...q,
155
- weekday: "short"
156
- }),
157
- weekdayLong: new Intl.DateTimeFormat(e, {
158
- ...q,
159
- weekday: "long"
160
- })
161
- };
162
- }
163
- var re = () => typeof navigator > "u" ? void 0 : navigator.language, J = (e) => (t) => V(t, e), Y = (e) => (t, { shiftKey: n }) => H(t, n ? e * A : e), X = {
164
- ArrowDown: J(7),
165
- ArrowUp: J(-7),
166
- Home: (e, { firstDayOfWeek: t }) => V(e, -K(e, t)),
167
- End: (e, { firstDayOfWeek: t }) => V(e, 6 - K(e, t)),
168
- PageUp: Y(-1),
169
- PageDown: Y(1)
170
- }, ie = {
171
- ltr: {
172
- ...X,
173
- ArrowRight: J(1),
174
- ArrowLeft: J(-1)
175
- },
176
- rtl: {
177
- ...X,
178
- ArrowRight: J(-1),
179
- ArrowLeft: J(1)
180
- }
181
- }, Z = a(null);
182
- function Q(e) {
183
- let t = s(Z);
184
- if (!t) throw Error(`Calendar.${e} must be rendered inside <Calendar>.`);
185
- return t;
186
- }
187
- var $ = "‹", ae = "›", oe = o(function({ value: e, defaultValue: t, onValueChange: n, visibleMonth: r, defaultVisibleMonth: a, onVisibleMonthChange: o, min: s, max: c, locale: u, firstDayOfWeek: d, ...p }, h) {
188
- let _ = `${l()}-label`, y = /* @__PURE__ */ new Date(), b = I(P(y.getFullYear(), y.getMonth(), y.getDate())), x = f(() => new Intl.DateTimeFormat(u ?? re(), q).resolvedOptions().locale, [u]), S = f(() => ne(x), [x]), C = f(() => te(x), [x]), w = d ?? C, [T, E] = i(e, t, n), D = e ?? t, [O, k] = i(r, a ?? z(L(D) ? D : b), o), A = R(O) ? O : z(b), j = L(s) ? s : void 0, M = L(c) ? c : void 0, [N, F] = m(null), [B, V] = m(!1), H = f(() => ({
189
- value: T,
190
- visibleMonth: A,
191
- today: b,
192
- min: j,
193
- max: M,
194
- firstDayOfWeek: w,
195
- formatters: S,
196
- focus: N,
197
- setFocus: F,
198
- requestValue: E,
199
- requestVisibleMonth: k,
200
- labelId: _,
201
- hasHeader: B,
202
- setHasHeader: V
203
- }), [
204
- T,
205
- A,
206
- b,
207
- j,
208
- M,
209
- w,
210
- S,
211
- N,
212
- E,
213
- k,
214
- _,
215
- B
216
- ]);
217
- return /* @__PURE__ */ g(Z.Provider, {
218
- value: H,
219
- children: /* @__PURE__ */ g("div", {
220
- ...p,
221
- ref: h,
222
- "data-ui": "calendar",
223
- css: v
224
- })
225
- });
226
- }), se = o(function(e, t) {
227
- let { visibleMonth: n, min: r, max: i, formatters: a, requestVisibleMonth: o, labelId: s, setHasHeader: c } = Q("Header");
228
- d(() => (c(!0), () => c(!1)), [c]);
229
- let l = U(n, -1), u = U(n, 1), f = r !== void 0 && W(l) < r, p = i !== void 0 && B(u) > i, m = (e) => a.month.format(F(B(e)));
230
- return /* @__PURE__ */ _("div", {
231
- ...e,
232
- ref: t,
233
- "data-ui": "calendar-header",
234
- css: y,
235
- children: [
236
- /* @__PURE__ */ g("button", {
237
- type: "button",
238
- "data-ui": "calendar-previous",
239
- "aria-label": m(l),
240
- "aria-disabled": f || void 0,
241
- onClick: () => {
242
- f || o(l);
243
- },
244
- css: S,
245
- children: /* @__PURE__ */ g("span", {
246
- "aria-hidden": "true",
247
- css: C,
248
- children: $
249
- })
250
- }),
251
- /* @__PURE__ */ g("span", {
252
- id: s,
253
- "aria-live": "polite",
254
- "aria-atomic": "true",
255
- "data-ui": "calendar-label",
256
- css: b,
257
- children: m(n)
258
- }),
259
- /* @__PURE__ */ g("button", {
260
- type: "button",
261
- "data-ui": "calendar-next",
262
- "aria-label": m(u),
263
- "aria-disabled": p || void 0,
264
- onClick: () => {
265
- p || o(u);
266
- },
267
- css: S,
268
- children: /* @__PURE__ */ g("span", {
269
- "aria-hidden": "true",
270
- css: C,
271
- children: ae
272
- })
273
- })
274
- ]
275
- });
276
- });
277
- function ce({ date: e, isTabStop: t }) {
278
- let { value: n, today: r, min: i, max: a, formatters: o, setFocus: s, requestValue: c } = Q("Grid"), l = n === e, u = r === e, d = F(e);
279
- return /* @__PURE__ */ g("td", {
280
- role: "gridcell",
281
- "aria-selected": l || void 0,
282
- css: E,
283
- children: /* @__PURE__ */ g("button", {
284
- type: "button",
285
- "data-ui": "calendar-day",
286
- "data-date": e,
287
- "data-today": u || void 0,
288
- "data-selected": l || void 0,
289
- "aria-current": u ? "date" : void 0,
290
- "aria-label": o.date.format(d),
291
- tabIndex: t ? 0 : -1,
292
- disabled: !G(e, i, a),
293
- onFocus: () => s({
294
- date: e,
295
- fallback: e
296
- }),
297
- onClick: () => {
298
- s({
299
- date: e,
300
- fallback: e
301
- }), c(e);
302
- },
303
- css: D,
304
- children: o.day.format(d)
305
- })
306
- });
307
- }
308
- var le = o(function({ onKeyDown: e, "aria-labelledby": t, "aria-label": n, ...r }, i) {
309
- let { value: a, visibleMonth: o, today: s, min: l, max: d, firstDayOfWeek: f, formatters: m, focus: h, setFocus: v, requestVisibleMonth: y, labelId: b, hasHeader: x } = Q("Grid"), S = p(null);
310
- u(i, () => S.current, []);
311
- let C = p(!1), D = B(o), O = F(W(o)).getUTCDate(), k = Array.from({ length: O }, (e, t) => V(D, t)), A = (e) => e !== void 0 && k.includes(e) && G(e, l, d), j = [
312
- h?.date,
313
- h?.fallback,
314
- a,
315
- s
316
- ].find(A) ?? k.find((e) => G(e, l, d)), N = [...Array(K(D, f)).fill(null), ...k], P = Array.from({ length: Math.ceil(N.length / 7) }, (e, t) => Array.from({ length: 7 }, (e, n) => N[t * 7 + n] ?? null)), I = Array.from({ length: 7 }, (e, t) => F(V(M, (f + t) % 7)));
317
- c(() => {
318
- C.current && (C.current = !1, S.current?.querySelector(`[data-date="${j}"]`)?.focus());
319
- });
320
- let L = (t) => {
321
- e?.(t);
322
- let n = S.current;
323
- if (t.defaultPrevented || !n) return;
324
- let r = t.target.dataset.date;
325
- if (!A(r)) return;
326
- let i = ie[getComputedStyle(n).direction === "rtl" ? "rtl" : "ltr"][t.key];
327
- if (!i) return;
328
- t.preventDefault();
329
- let a = ee(i(r, {
330
- firstDayOfWeek: f,
331
- shiftKey: t.shiftKey
332
- }), l, d);
333
- a !== r && (v({
334
- date: a,
335
- fallback: r
336
- }), C.current = !0, z(a) !== o && y(z(a)));
337
- }, R = [t, x ? b : void 0].filter(Boolean).join(" ") || void 0, H = m.month.format(F(D));
338
- return /* @__PURE__ */ _("table", {
339
- ...r,
340
- ref: S,
341
- role: "grid",
342
- "aria-labelledby": R,
343
- "aria-label": R === void 0 ? n ?? H : n,
344
- "data-ui": "calendar-grid",
345
- onKeyDown: L,
346
- css: w,
347
- children: [/* @__PURE__ */ g("thead", { children: /* @__PURE__ */ g("tr", {
348
- role: "row",
349
- children: I.map((e) => /* @__PURE__ */ g("th", {
350
- role: "columnheader",
351
- scope: "col",
352
- abbr: m.weekdayLong.format(e),
353
- css: T,
354
- children: m.weekdayShort.format(e)
355
- }, e.getUTCDay()))
356
- }) }), /* @__PURE__ */ g("tbody", { children: P.map((e, t) => /* @__PURE__ */ g("tr", {
357
- role: "row",
358
- children: e.map((e, t) => e === null ? /* @__PURE__ */ g("td", {
359
- role: "gridcell",
360
- css: E
361
- }, `empty-${t}`) : /* @__PURE__ */ g(ce, {
362
- date: e,
363
- isTabStop: e === j
364
- }, e))
365
- }, t)) })]
366
- });
367
- }), ue = Object.assign(oe, {
368
- Header: se,
369
- Grid: le
370
- });
371
- //#endregion
372
- export { ue as t };
@@ -1,120 +0,0 @@
1
- import { t as e } from "./css-CW_HG55W.js";
2
- import { createContext as t, forwardRef as n, useContext as r } from "react";
3
- import { vars as i } from "@jfrader/tokens/vars";
4
- import { jsx as a } from "@emotion/react/jsx-runtime";
5
- //#region src/components/card/card.tsx
6
- var o = t(void 0);
7
- function s(...e) {
8
- return e.filter(Boolean).join(" ") || void 0;
9
- }
10
- var c = e({
11
- boxSizing: "border-box",
12
- minInlineSize: 0,
13
- backgroundColor: i.color.surfaceRaised,
14
- border: `1px solid ${i.color.border}`,
15
- borderRadius: i.radius.lg,
16
- paddingBlock: i.space[4],
17
- paddingInline: i.space[5],
18
- fontFamily: i.font.sans,
19
- lineHeight: i.lineHeight.base,
20
- color: i.color.text
21
- }), l = {
22
- flat: e({ boxShadow: "none" }),
23
- raised: e({ boxShadow: i.shadow.raised })
24
- }, u = e({
25
- display: "grid",
26
- gap: i.space[1],
27
- marginBlockEnd: i.space[4]
28
- }), d = e({
29
- margin: 0,
30
- fontSize: i.textSize.md,
31
- fontWeight: i.fontWeight.semibold,
32
- lineHeight: i.lineHeight.tight,
33
- color: i.color.text
34
- }), f = e({
35
- margin: 0,
36
- fontSize: i.textSize.sm,
37
- color: i.color.textMuted
38
- }), p = e({
39
- fontSize: i.textSize.sm,
40
- color: i.color.text
41
- }), m = e({
42
- display: "flex",
43
- flexWrap: "wrap",
44
- alignItems: "center",
45
- justifyContent: "space-between",
46
- gap: i.space[2],
47
- marginBlockStart: i.space[4],
48
- paddingBlockStart: i.space[4],
49
- borderBlockStart: `1px solid ${i.color.borderSubtle}`,
50
- "& > :only-child": { marginInlineStart: "auto" }
51
- }), h = n(function({ variant: e = "raised", slotProps: t, className: n, ...r }, i) {
52
- return /* @__PURE__ */ a(o.Provider, {
53
- value: t,
54
- children: /* @__PURE__ */ a("div", {
55
- ...r,
56
- ref: i,
57
- "data-ui": "card",
58
- "data-variant": e,
59
- className: s(t?.root?.className, n),
60
- css: [
61
- c,
62
- l[e],
63
- t?.root?.css
64
- ]
65
- })
66
- });
67
- }), g = n(function({ className: e, ...t }, n) {
68
- let i = r(o)?.header;
69
- return /* @__PURE__ */ a("div", {
70
- ...t,
71
- ref: n,
72
- "data-ui": "card-header",
73
- className: s(i?.className, e),
74
- css: [u, i?.css]
75
- });
76
- }), _ = n(function({ level: e = 3, className: t, ...n }, i) {
77
- let c = r(o)?.title, l = `h${e}`;
78
- return /* @__PURE__ */ a(l, {
79
- ...n,
80
- ref: i,
81
- "data-ui": "card-title",
82
- className: s(c?.className, t),
83
- css: [d, c?.css]
84
- });
85
- }), v = n(function({ className: e, ...t }, n) {
86
- let i = r(o)?.description;
87
- return /* @__PURE__ */ a("p", {
88
- ...t,
89
- ref: n,
90
- "data-ui": "card-description",
91
- className: s(i?.className, e),
92
- css: [f, i?.css]
93
- });
94
- }), y = n(function({ className: e, ...t }, n) {
95
- let i = r(o)?.content;
96
- return /* @__PURE__ */ a("div", {
97
- ...t,
98
- ref: n,
99
- "data-ui": "card-content",
100
- className: s(i?.className, e),
101
- css: [p, i?.css]
102
- });
103
- }), b = n(function({ className: e, ...t }, n) {
104
- let i = r(o)?.footer;
105
- return /* @__PURE__ */ a("div", {
106
- ...t,
107
- ref: n,
108
- "data-ui": "card-footer",
109
- className: s(i?.className, e),
110
- css: [m, i?.css]
111
- });
112
- }), x = Object.assign(h, {
113
- Header: g,
114
- Title: _,
115
- Description: v,
116
- Content: y,
117
- Footer: b
118
- });
119
- //#endregion
120
- export { x as t };
@@ -1,134 +0,0 @@
1
- import { t as e } from "./css-CW_HG55W.js";
2
- import { n as t } from "./media-8K3xDAxM.js";
3
- import { t as n } from "./renderable-DwPvt1I8.js";
4
- import { i as r, n as i, r as a, t as o } from "./choice-control-DCyQ_hVw.js";
5
- import { forwardRef as s, useEffect as c, useId as l, useImperativeHandle as u, useRef as d } from "react";
6
- import { vars as f } from "@jfrader/tokens/vars";
7
- import { jsx as p, jsxs as m } from "@emotion/react/jsx-runtime";
8
- //#region src/components/checkbox/checkbox.tsx
9
- var h = {
10
- sm: "16px",
11
- md: "20px"
12
- }, g = e({
13
- "input:checked + span svg": { opacity: 1 },
14
- "&[data-indeterminate] input + span": {
15
- backgroundColor: f.color.accent,
16
- borderColor: f.color.accent
17
- },
18
- "&[data-indeterminate] input + span svg": { opacity: 1 }
19
- }), _ = e({
20
- display: "inline-flex",
21
- alignItems: "center",
22
- justifyContent: "center",
23
- flexShrink: 0,
24
- boxSizing: "border-box",
25
- border: `1px solid ${f.color.borderControl}`,
26
- borderRadius: f.radius.sm,
27
- backgroundColor: f.color.surfaceRaised,
28
- color: f.color.accentContrast,
29
- transitionProperty: "background-color, border-color",
30
- transitionDuration: f.motion.duration.fast,
31
- transitionTimingFunction: f.motion.easeStandard,
32
- "& svg": {
33
- inlineSize: "75%",
34
- blockSize: "75%",
35
- opacity: 0
36
- },
37
- [t]: { transitionDuration: "0s" }
38
- }), v = {
39
- sm: e({
40
- inlineSize: h.sm,
41
- blockSize: h.sm
42
- }),
43
- md: e({
44
- inlineSize: h.md,
45
- blockSize: h.md
46
- })
47
- }, y = {
48
- sm: e({ fontSize: f.textSize.sm }),
49
- md: e({ fontSize: f.textSize.md })
50
- }, b = e({
51
- fontSize: f.textSize.sm,
52
- color: f.color.textMuted
53
- }), x = {
54
- sm: e({ marginInlineStart: `calc(${h.sm} + ${f.space[2]})` }),
55
- md: e({ marginInlineStart: `calc(${h.md} + ${f.space[2]})` })
56
- };
57
- function S({ indeterminate: e }) {
58
- return /* @__PURE__ */ p("svg", {
59
- viewBox: "0 0 16 16",
60
- fill: "none",
61
- stroke: "currentColor",
62
- strokeWidth: "2",
63
- strokeLinecap: "round",
64
- strokeLinejoin: "round",
65
- children: e ? /* @__PURE__ */ p("line", {
66
- x1: "4",
67
- y1: "8",
68
- x2: "12",
69
- y2: "8"
70
- }) : /* @__PURE__ */ p("polyline", { points: "3.5 8.5 6.5 11.5 12.5 4.5" })
71
- });
72
- }
73
- var C = s(function({ label: e, description: t, indeterminate: s = !1, size: f = "md", onChange: h, onCheckedChange: C, slotProps: w, className: T, "aria-labelledby": E, "aria-describedby": D, ...O }, k) {
74
- let A = d(null);
75
- u(k, () => A.current, []), c(() => {
76
- A.current && (A.current.indeterminate = s);
77
- }, [s]);
78
- let j = l(), M = `${j}-label`, N = `${j}-description`, P = n(e), F = n(t), I = [E, P && M].filter(Boolean).join(" ") || void 0, L = [D, F && N].filter(Boolean).join(" ") || void 0, R = [T, w?.root?.className].filter(Boolean).join(" ") || void 0, z = (e) => {
79
- s && (e.currentTarget.indeterminate = !0), h?.(e), C?.(e.currentTarget.checked);
80
- };
81
- return /* @__PURE__ */ m("label", {
82
- "data-ui": "checkbox",
83
- "data-indeterminate": s || void 0,
84
- className: R,
85
- css: [
86
- a,
87
- g,
88
- i,
89
- w?.root?.css
90
- ],
91
- children: [/* @__PURE__ */ m("span", {
92
- css: r,
93
- children: [
94
- /* @__PURE__ */ p("input", {
95
- ...O,
96
- ref: A,
97
- type: "checkbox",
98
- "aria-labelledby": I,
99
- "aria-describedby": L,
100
- "aria-checked": s ? "mixed" : void 0,
101
- onChange: z,
102
- css: o
103
- }),
104
- /* @__PURE__ */ p("span", {
105
- "aria-hidden": "true",
106
- className: w?.control?.className,
107
- css: [
108
- _,
109
- v[f],
110
- w?.control?.css
111
- ],
112
- children: /* @__PURE__ */ p(S, { indeterminate: s })
113
- }),
114
- P && /* @__PURE__ */ p("span", {
115
- id: M,
116
- className: w?.label?.className,
117
- css: [y[f], w?.label?.css],
118
- children: e
119
- })
120
- ]
121
- }), F && /* @__PURE__ */ p("span", {
122
- id: N,
123
- className: w?.description?.className,
124
- css: [
125
- b,
126
- x[f],
127
- w?.description?.css
128
- ],
129
- children: t
130
- })]
131
- });
132
- });
133
- //#endregion
134
- export { C as t };