@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,239 +0,0 @@
1
- import { t as e } from "./css-CW_HG55W.js";
2
- import { t } from "./use-controlled-state-DQXkiTQI.js";
3
- import { t as n } from "./renderable-DwPvt1I8.js";
4
- import { t as r } from "./calendar-DcCAiN3b.js";
5
- import { n as i } from "./surface-Bo_aSQOb.js";
6
- import { t as a } from "./use-overlay-floating-CsZd3qxa.js";
7
- import { t as o } from "./text-field-BlP8qGn_.js";
8
- import { createContext as s, forwardRef as c, useContext as l, useEffect as u, useId as d, useLayoutEffect as f, useMemo as p, useRef as m, useState as h } from "react";
9
- import { vars as g } from "@jfrader/tokens/vars";
10
- import { jsx as _, jsxs as v } from "@emotion/react/jsx-runtime";
11
- import { FloatingFocusManager as y, FloatingPortal as b, useClick as x, useDismiss as S, useInteractions as C, useMergeRefs as w, useRole as T } from "@floating-ui/react";
12
- //#region src/components/date-picker/date-picker.tsx
13
- var E = "bottom-start", D = /* @__PURE__ */ new Set(["Enter", "ArrowDown"]), O = " ", k = "[data-ui=\"calendar-day\"][tabindex=\"0\"]", A = "[data-ui=\"calendar-day\"]", j = /^\d{4}-\d{2}-\d{2}$/, M = {
14
- calendar: "gregory",
15
- timeZone: "UTC",
16
- dateStyle: "medium"
17
- }, N = s(null);
18
- function P(e) {
19
- let t = l(N);
20
- if (!t) throw Error(`DatePicker.${e} must be rendered inside <DatePicker>.`);
21
- return t;
22
- }
23
- var F = (e, t) => String(e).padStart(t, "0"), I = (e, t, n) => `${F(e, 4)}-${F(t, 2)}-${F(n, 2)}`;
24
- function L(e) {
25
- if (e === void 0 || !j.test(e)) return;
26
- let [t = NaN, n = NaN, r = NaN] = e.split("-").map(Number), i = new Date(Date.UTC(0, 0, 1));
27
- return i.setUTCFullYear(t, n - 1, r), I(i.getUTCFullYear(), i.getUTCMonth() + 1, i.getUTCDate()) === e ? i : void 0;
28
- }
29
- var R = (e) => L(e) ? e : void 0;
30
- function ee(e, t, n) {
31
- return t !== void 0 && e < t ? t : n !== void 0 && e > n ? n : e;
32
- }
33
- function te() {
34
- let e = /* @__PURE__ */ new Date();
35
- return I(e.getFullYear(), e.getMonth() + 1, e.getDate());
36
- }
37
- var ne = () => typeof navigator > "u" ? void 0 : navigator.language;
38
- function re(e, t) {
39
- let n = new Intl.DisplayNames(t, { type: "dateTimeField" });
40
- return e.formatToParts(/* @__PURE__ */ new Date(0)).map((e) => e.type === "literal" ? e.value : n.of(e.type) ?? e.value).join("");
41
- }
42
- function z(e) {
43
- let t = e?.querySelector(k) ?? null;
44
- return t?.focus({ preventScroll: !0 }), t;
45
- }
46
- var B = e({
47
- cursor: "pointer",
48
- "&:disabled": { cursor: "not-allowed" }
49
- }), V = e({
50
- ...i,
51
- borderRadius: g.radius.md,
52
- boxShadow: g.shadow.overlay,
53
- padding: g.space[3]
54
- });
55
- function H({ value: e, defaultValue: n, onValueChange: r, open: i, defaultOpen: o = !1, onOpenChange: s, min: c, max: l, locale: d, firstDayOfWeek: f, disabled: g = !1, name: y, placeholder: b, children: w }) {
56
- let [D, O] = t(e, n, r), [k = !1, A] = t(i, o, s), [j, P] = h(!1), F = g || j, I = k && !F, [z, B] = h(null), V = m(null), H = m(!1), U = p(() => new Intl.DateTimeFormat(d ?? ne()).resolvedOptions().locale, [d]), W = p(() => new Intl.DateTimeFormat(U, M), [U]), G = p(() => re(W, U), [W, U]), K = L(D), q = K ? W.format(K) : "", J = R(c), Y = R(l), X = ee(R(D) ?? te(), J, Y).slice(0, 7), { refs: Z, floatingStyles: Q, context: $ } = a({
57
- open: I,
58
- placement: E,
59
- onOpenChange: (e, t, n) => {
60
- F && e || (e || (H.current = n === "escape-key"), A(e));
61
- }
62
- });
63
- u(() => {
64
- F && (H.current = !1, k && A(!1));
65
- }, [
66
- F,
67
- k,
68
- A
69
- ]), u(() => {
70
- !F && !I && H.current && (H.current = !1, Z.domReference.current?.focus());
71
- }, [
72
- F,
73
- I,
74
- Z
75
- ]);
76
- let ie = x($, {
77
- enabled: !F,
78
- keyboardHandlers: !1
79
- }), ae = S($, {
80
- escapeKey: !0,
81
- outsidePress: !0
82
- }), oe = T($, { role: "dialog" }), { getReferenceProps: se, getFloatingProps: ce } = C([
83
- ie,
84
- ae,
85
- oe
86
- ]), le = p(() => ({
87
- open: I,
88
- disabled: F,
89
- value: D,
90
- displayValue: q,
91
- placeholder: b ?? G,
92
- initialMonth: X,
93
- min: J,
94
- max: Y,
95
- locale: U,
96
- firstDayOfWeek: f,
97
- inputLabelling: z,
98
- gridRef: V,
99
- refs: Z,
100
- floatingContext: $,
101
- floatingStyles: Q,
102
- getReferenceProps: se,
103
- getFloatingProps: ce,
104
- requestOpenChange: (e) => {
105
- F && e || A(e);
106
- },
107
- selectDate: (e) => {
108
- F || (O(e), H.current = !0, A(!1));
109
- },
110
- setInputLabelling: B,
111
- setInputDisabled: P
112
- }), [
113
- I,
114
- F,
115
- D,
116
- q,
117
- b,
118
- G,
119
- X,
120
- J,
121
- Y,
122
- U,
123
- f,
124
- z,
125
- Z,
126
- $,
127
- Q,
128
- se,
129
- ce,
130
- A,
131
- O
132
- ]);
133
- return /* @__PURE__ */ v(N.Provider, {
134
- value: le,
135
- children: [w, y !== void 0 && /* @__PURE__ */ _("input", {
136
- type: "hidden",
137
- name: y,
138
- value: D ?? "",
139
- disabled: F
140
- })]
141
- });
142
- }
143
- var U = c(function({ label: e, id: t, disabled: r, slotProps: i, onKeyDown: a, onKeyUp: s, ...c }, l) {
144
- let { open: u, disabled: p, displayValue: m, placeholder: h, gridRef: g, refs: v, getReferenceProps: y, requestOpenChange: b, setInputLabelling: x, setInputDisabled: S } = P("Input"), C = w([v.setReference, l]), T = d(), E = t ?? T, k = `${E}-label`, A = n(e), j = c["aria-labelledby"], M = c["aria-label"], N = M ?? (typeof e == "string" ? e : void 0), F = p || r === !0;
145
- f(() => (S(r === !0), () => S(!1)), [r, S]), f(() => (x(j === void 0 ? M === void 0 ? typeof e == "string" ? { label: e } : { labelledBy: A ? k : void 0 } : { label: M } : { labelledBy: j }), () => x(null)), [
146
- j,
147
- M,
148
- e,
149
- A,
150
- k,
151
- x
152
- ]);
153
- let I = () => {
154
- F || (u ? z(g.current) : b(!0));
155
- }, L = (e) => {
156
- a?.(e), !(e.defaultPrevented || F) && (e.key === O ? e.preventDefault() : D.has(e.key) && (e.preventDefault(), I()));
157
- }, R = (e) => {
158
- s?.(e), !(e.defaultPrevented || F || e.key !== O) && I();
159
- };
160
- return /* @__PURE__ */ _(o, {
161
- ...y({
162
- ...c,
163
- onKeyDown: L,
164
- onKeyUp: R
165
- }),
166
- ref: C,
167
- id: E,
168
- label: A ? /* @__PURE__ */ _("span", {
169
- id: k,
170
- children: e
171
- }) : e,
172
- slotProps: {
173
- ...i,
174
- control: {
175
- ...i?.control,
176
- css: [B, i?.control?.css]
177
- }
178
- },
179
- value: m,
180
- placeholder: h,
181
- disabled: F,
182
- readOnly: !0,
183
- role: "combobox",
184
- "aria-label": N,
185
- "aria-autocomplete": "none",
186
- "data-state": u ? "open" : "closed",
187
- "data-ui": "date-picker-input"
188
- });
189
- }), W = c(function({ style: e, ...t }, n) {
190
- let { open: i, value: a, initialMonth: o, min: s, max: c, locale: l, firstDayOfWeek: u, inputLabelling: d, gridRef: f, refs: p, floatingContext: h, floatingStyles: g, getFloatingProps: x, selectDate: S } = P("Popup"), C = w([p.setFloating, n]), T = m(null), E = w([(e) => {
191
- f.current = e, T.current = z(e);
192
- }]);
193
- if (!i) return null;
194
- let D = t["aria-labelledby"] !== void 0 || t["aria-label"] !== void 0 ? {} : d?.labelledBy === void 0 ? { "aria-label": d?.label } : { "aria-labelledby": d.labelledBy }, O = (e) => {
195
- let t = e.target.closest(A);
196
- if (t?.disabled) return;
197
- let n = t?.dataset.date;
198
- n !== void 0 && S(n);
199
- }, k = (e) => {
200
- e.target.closest(A)?.disabled && e.preventDefault();
201
- };
202
- return /* @__PURE__ */ _(b, { children: /* @__PURE__ */ _(y, {
203
- context: h,
204
- modal: !1,
205
- initialFocus: T,
206
- returnFocus: !1,
207
- children: /* @__PURE__ */ _("div", {
208
- ...x({
209
- ...D,
210
- ...t
211
- }),
212
- ref: C,
213
- "data-ui": "date-picker-popup",
214
- style: {
215
- ...e,
216
- ...g
217
- },
218
- css: V,
219
- children: /* @__PURE__ */ v(r, {
220
- value: a ?? "",
221
- defaultVisibleMonth: o,
222
- min: s,
223
- max: c,
224
- locale: l,
225
- firstDayOfWeek: u,
226
- children: [/* @__PURE__ */ _(r.Header, {}), /* @__PURE__ */ _(r.Grid, {
227
- ref: E,
228
- onClick: O,
229
- onPointerDownCapture: k
230
- })]
231
- })
232
- })
233
- }) });
234
- }), G = Object.assign(H, {
235
- Input: U,
236
- Popup: W
237
- });
238
- //#endregion
239
- export { G as t };
@@ -1,175 +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 } from "./media-8K3xDAxM.js";
4
- import { t as r } from "./use-controlled-state-DQXkiTQI.js";
5
- import { t as i } from "./trigger-style-f54idgjT.js";
6
- import { i as a, n as o, r as s, t as c } from "./use-native-dialog-BCp1chwO.js";
7
- import { n as l, t as u } from "./surface-Bo_aSQOb.js";
8
- import { createContext as d, forwardRef as f, useCallback as p, useContext as m, useEffect as h, useId as g, useMemo as _, useRef as v, useState as y } from "react";
9
- import { vars as b } from "@jfrader/tokens/vars";
10
- import { jsx as x } from "@emotion/react/jsx-runtime";
11
- //#region src/components/dialog/dialog.tsx
12
- var S = d(null), C = d(null);
13
- function w(e) {
14
- let t = m(S);
15
- if (!t) throw Error(`Dialog.${e} must be rendered inside <Dialog>.`);
16
- return t;
17
- }
18
- var T = e(u), E = e({
19
- ...l,
20
- borderRadius: b.radius.lg,
21
- boxShadow: b.shadow.floating,
22
- padding: b.space[5],
23
- minInlineSize: "320px",
24
- maxInlineSize: "min(560px, calc(100vw - 32px))"
25
- }), D = e({
26
- margin: 0,
27
- marginBlockEnd: b.space[2],
28
- fontSize: b.textSize.lg,
29
- fontWeight: b.fontWeight.semibold,
30
- lineHeight: b.lineHeight.tight
31
- }), O = e({
32
- margin: 0,
33
- marginBlockEnd: b.space[4],
34
- fontSize: b.textSize.sm,
35
- color: b.color.textMuted
36
- }), k = e({
37
- appearance: "none",
38
- display: "inline-flex",
39
- alignItems: "center",
40
- border: "1px solid transparent",
41
- borderRadius: b.radius.md,
42
- backgroundColor: "transparent",
43
- paddingBlock: b.space[1],
44
- paddingInline: b.space[3],
45
- font: "inherit",
46
- fontSize: b.textSize.sm,
47
- fontWeight: b.fontWeight.medium,
48
- color: b.color.textMuted,
49
- cursor: "pointer",
50
- transitionProperty: "background-color, color",
51
- transitionDuration: b.motion.duration.fast,
52
- transitionTimingFunction: b.motion.easeStandard,
53
- "&:hover:not(:disabled)": {
54
- backgroundColor: b.color.surfaceHover,
55
- color: b.color.text
56
- },
57
- "&:focus-visible": { ...t },
58
- "&:disabled": {
59
- opacity: .55,
60
- cursor: "not-allowed"
61
- },
62
- [n]: { transitionDuration: "0s" }
63
- });
64
- function A({ open: e, defaultOpen: t = !1, onOpenChange: n, children: i }) {
65
- let o = g(), [s = !1, c] = r(e, t, n), { setDialogElement: l, setOpen: u, requestClose: d, repairToken: f } = a(s, c), [p, m] = y(!1), [h, v] = y(!1), b = _(() => ({
66
- open: s,
67
- setOpen: u,
68
- requestClose: d,
69
- repairToken: f,
70
- setDialogElement: l,
71
- titleId: `${o}-title`,
72
- descriptionId: `${o}-description`,
73
- hasTitle: p,
74
- hasDescription: h,
75
- setHasTitle: m,
76
- setHasDescription: v
77
- }), [
78
- s,
79
- u,
80
- d,
81
- f,
82
- l,
83
- o,
84
- p,
85
- h
86
- ]);
87
- return /* @__PURE__ */ x(S.Provider, {
88
- value: b,
89
- children: i
90
- });
91
- }
92
- var j = f(function({ onClick: e, render: t, ...n }, r) {
93
- let { open: a, setOpen: o } = w("Trigger"), { "data-ui": s, ...c } = n, l = e, u = (e) => {
94
- l?.(e), e.defaultPrevented || o(!0);
95
- }, d = {
96
- type: "button",
97
- ...c,
98
- ref: r,
99
- "data-ui": t && s !== void 0 ? `${s} dialog-trigger` : "dialog-trigger",
100
- "aria-haspopup": "dialog",
101
- "aria-expanded": a,
102
- onClick: u
103
- };
104
- return t ? t(d) : /* @__PURE__ */ x("button", {
105
- ...d,
106
- css: i
107
- });
108
- }), M = f(function(e, t) {
109
- let { children: n, onCancel: r, onClick: i, onClose: a, "aria-labelledby": l, "aria-describedby": u, withDescription: d = !0, ...f } = c(e), m = w("Content"), { setOpen: h, titleId: g, descriptionId: _, hasTitle: y, hasDescription: b } = m, S = v(null), D = p(() => {
110
- o(S.current, h);
111
- }, [h]), O = s({
112
- ...m,
113
- requestClose: D
114
- }, {
115
- onCancel: r,
116
- onClick: i,
117
- onClose: a
118
- }, t, S), k = [l, y && g].filter(Boolean).join(" ") || void 0, A = [u, d && b && _].filter(Boolean).join(" ") || void 0;
119
- return /* @__PURE__ */ x("dialog", {
120
- ...f,
121
- ...O,
122
- "data-ui": "dialog",
123
- "aria-modal": "true",
124
- "aria-labelledby": k,
125
- "aria-describedby": A,
126
- css: T,
127
- children: /* @__PURE__ */ x(C.Provider, {
128
- value: D,
129
- children: /* @__PURE__ */ x("div", {
130
- css: E,
131
- children: n
132
- })
133
- })
134
- });
135
- }), N = f(function(e, t) {
136
- let { titleId: n, setHasTitle: r } = w("Title");
137
- return h(() => (r(!0), () => r(!1)), [r]), /* @__PURE__ */ x("h2", {
138
- ...e,
139
- ref: t,
140
- id: n,
141
- "data-ui": "dialog-title",
142
- css: D
143
- });
144
- }), P = f(function(e, t) {
145
- let { descriptionId: n, setHasDescription: r } = w("Description");
146
- return h(() => (r(!0), () => r(!1)), [r]), /* @__PURE__ */ x("p", {
147
- ...e,
148
- ref: t,
149
- id: n,
150
- "data-ui": "dialog-description",
151
- css: O
152
- });
153
- }), F = f(function({ onClick: e, render: t, ...n }, r) {
154
- let { setOpen: i } = w("Close"), a = m(C), { "data-ui": o, ...s } = n, c = e, l = (e) => {
155
- c?.(e), !e.defaultPrevented && (a ? a() : i(!1));
156
- }, u = {
157
- type: "button",
158
- ...s,
159
- ref: r,
160
- "data-ui": t && o !== void 0 ? `${o} dialog-close` : "dialog-close",
161
- onClick: l
162
- };
163
- return t ? t(u) : /* @__PURE__ */ x("button", {
164
- ...u,
165
- css: k
166
- });
167
- }), I = Object.assign(A, {
168
- Trigger: j,
169
- Content: M,
170
- Title: N,
171
- Description: P,
172
- Close: F
173
- });
174
- //#endregion
175
- export { I as t };
@@ -1,76 +0,0 @@
1
- import { t as e } from "./css-CW_HG55W.js";
2
- import { t } from "./renderable-DwPvt1I8.js";
3
- import { forwardRef as n, useId as r } from "react";
4
- import { vars as i } from "@jfrader/tokens/vars";
5
- import { jsx as a } from "@emotion/react/jsx-runtime";
6
- //#region src/components/divider/divider.tsx
7
- var o = "@media (forced-colors: active)", s = "1px", c = {
8
- backgroundColor: i.color.border,
9
- [o]: {
10
- forcedColorAdjust: "none",
11
- backgroundColor: "CanvasText"
12
- }
13
- }, l = e({
14
- ...c,
15
- boxSizing: "border-box",
16
- alignSelf: "stretch",
17
- blockSize: s,
18
- margin: 0,
19
- border: 0
20
- }), u = e({
21
- ...c,
22
- boxSizing: "border-box",
23
- alignSelf: "stretch",
24
- flexShrink: 0,
25
- inlineSize: s
26
- }), d = e({
27
- display: "flex",
28
- alignItems: "center",
29
- alignSelf: "stretch",
30
- gap: i.space[3],
31
- fontFamily: i.font.sans,
32
- fontSize: i.textSize.sm,
33
- lineHeight: i.lineHeight.tight,
34
- color: i.color.textMuted,
35
- "&::before, &::after": {
36
- ...c,
37
- content: "\"\"",
38
- flex: 1,
39
- blockSize: s
40
- }
41
- }), f = n(function({ orientation: e = "horizontal", label: n, "aria-labelledby": i, ...o }, s) {
42
- let c = r();
43
- return e === "vertical" ? /* @__PURE__ */ a("div", {
44
- ...o,
45
- ref: s,
46
- role: "separator",
47
- "aria-orientation": "vertical",
48
- "aria-labelledby": i,
49
- "data-ui": "divider",
50
- "data-orientation": "vertical",
51
- css: u
52
- }) : t(n) ? /* @__PURE__ */ a("div", {
53
- ...o,
54
- ref: s,
55
- role: "separator",
56
- "aria-orientation": "horizontal",
57
- "aria-labelledby": [c, i].filter(Boolean).join(" "),
58
- "data-ui": "divider",
59
- "data-orientation": "horizontal",
60
- css: d,
61
- children: /* @__PURE__ */ a("span", {
62
- id: c,
63
- "data-ui": "divider-label",
64
- children: n
65
- })
66
- }) : /* @__PURE__ */ a("hr", {
67
- ...o,
68
- ref: s,
69
- "aria-labelledby": i,
70
- "data-ui": "divider",
71
- "data-orientation": "horizontal",
72
- css: l
73
- });
74
- });
75
- //#endregion
76
- export { f as t };
@@ -1,21 +0,0 @@
1
- import { t as e } from "./layout-style-B_6YHQ6Q.js";
2
- import { forwardRef as t } from "react";
3
- import { jsx as n } from "@emotion/react/jsx-runtime";
4
- //#region src/components/flex/flex.tsx
5
- var r = t(function({ direction: t, wrap: r, inline: i, align: a, justify: o, gap: s, ...c }, l) {
6
- return /* @__PURE__ */ n("div", {
7
- ...c,
8
- ref: l,
9
- "data-ui": "flex",
10
- css: e({
11
- direction: t,
12
- wrap: r,
13
- inline: i,
14
- align: a,
15
- justify: o,
16
- gap: s
17
- })
18
- });
19
- });
20
- //#endregion
21
- export { r as t };
@@ -1,55 +0,0 @@
1
- import { t as e } from "./css-CW_HG55W.js";
2
- import { Children as t, Fragment as n, forwardRef as r } from "react";
3
- import { vars as i } from "@jfrader/tokens/vars";
4
- import { jsx as a, jsxs as o } from "@emotion/react/jsx-runtime";
5
- //#region src/components/kbd/kbd.tsx
6
- var s = "+", c = e({
7
- display: "inline-flex",
8
- alignItems: "center",
9
- boxSizing: "border-box",
10
- paddingBlock: "2px",
11
- paddingInline: "6px",
12
- backgroundColor: i.color.surfaceHover,
13
- border: `1px solid ${i.color.borderSubtle}`,
14
- borderBlockEndColor: i.color.borderStrong,
15
- borderBlockEndWidth: "2px",
16
- borderRadius: i.radius.sm,
17
- fontFamily: i.font.mono,
18
- fontSize: i.textSize.xs,
19
- fontWeight: i.fontWeight.medium,
20
- lineHeight: i.lineHeight.tight,
21
- color: i.color.text,
22
- whiteSpace: "nowrap",
23
- verticalAlign: "middle"
24
- }), l = e({
25
- display: "inline-flex",
26
- alignItems: "center",
27
- gap: i.space[1],
28
- verticalAlign: "middle"
29
- }), u = e({
30
- fontFamily: i.font.sans,
31
- fontSize: i.textSize.xs,
32
- color: i.color.textMuted
33
- }), d = r(function(e, t) {
34
- return /* @__PURE__ */ a("kbd", {
35
- ...e,
36
- ref: t,
37
- "data-ui": "kbd",
38
- css: c
39
- });
40
- }), f = r(function({ children: e, ...r }, i) {
41
- return /* @__PURE__ */ a("span", {
42
- ...r,
43
- ref: i,
44
- "data-ui": "kbd-group",
45
- css: l,
46
- children: t.toArray(e).map((e, t) => /* @__PURE__ */ o(n, { children: [t > 0 && /* @__PURE__ */ a("span", {
47
- "aria-hidden": !0,
48
- "data-ui": "kbd-separator",
49
- css: u,
50
- children: s
51
- }), e] }, t))
52
- });
53
- }), p = Object.assign(d, { Group: f });
54
- //#endregion
55
- export { p as t };