@jfrader/ui 0.1.2 → 0.3.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 (156) hide show
  1. package/README.md +1 -1
  2. package/dist/accordion-Bd-j04hW.js +198 -0
  3. package/dist/accordion.js +1 -1
  4. package/dist/{alert-CA9ZlIZp.js → alert-BBqaKI4k.js} +57 -52
  5. package/dist/alert.js +1 -1
  6. package/dist/{avatar-IUW4yJl0.js → avatar-BahDVO9t.js} +40 -33
  7. package/dist/avatar.js +1 -1
  8. package/dist/{badge-Bru30HEn.js → badge-B_sLygxU.js} +32 -27
  9. package/dist/badge.js +1 -1
  10. package/dist/breadcrumbs-DVAOxfvL.js +141 -0
  11. package/dist/breadcrumbs.js +1 -1
  12. package/dist/{button-Cmixur4Q.js → button-P2e7_44z.js} +65 -53
  13. package/dist/button.js +1 -1
  14. package/dist/calendar-C9Yad_-w.js +394 -0
  15. package/dist/calendar.js +1 -1
  16. package/dist/card-D-aI2QHx.js +158 -0
  17. package/dist/card.js +1 -1
  18. package/dist/checkbox-COYG6L7d.js +140 -0
  19. package/dist/checkbox.js +1 -1
  20. package/dist/{choice-control-ByFogYcT.js → choice-control-5kJkLXgv.js} +1 -1
  21. package/dist/{collection-registry-1l9f3XJZ.js → collection-registry-BTYi6zGh.js} +1 -1
  22. package/dist/combobox-DrmjBbo7.js +327 -0
  23. package/dist/combobox.js +1 -1
  24. package/dist/command-palette-V_2pEay7.js +379 -0
  25. package/dist/command-palette.js +1 -1
  26. package/dist/container-BOaSptJa.js +41 -0
  27. package/dist/container.js +1 -1
  28. package/dist/{date-picker-DrHJMt2p.js → date-picker-ClUYBIBh.js} +69 -59
  29. package/dist/date-picker.js +1 -1
  30. package/dist/dialog-xaydbXl2.js +218 -0
  31. package/dist/dialog.js +1 -1
  32. package/dist/divider-DYoJf0I_.js +84 -0
  33. package/dist/divider.js +1 -1
  34. package/dist/field-anatomy-D2ToMeRa.js +109 -0
  35. package/dist/flex-Dh-_J5-U.js +28 -0
  36. package/dist/flex.js +1 -1
  37. package/dist/{icon-wrapper-CFWzew5m.js → icon-wrapper-stN8sD7R.js} +1 -1
  38. package/dist/index.js +38 -37
  39. package/dist/{kbd-B03_qIwQ.js → kbd-C3ACoMoE.js} +36 -21
  40. package/dist/kbd.js +1 -1
  41. package/dist/{layout-style-7ZTOiWGR.js → layout-style-Cbd1Vilw.js} +1 -1
  42. package/dist/{loading-ring-BpdB0aFi.js → loading-ring-B8-30Dl1.js} +1 -1
  43. package/dist/menu-DU60SMdt.js +216 -0
  44. package/dist/menu.js +1 -1
  45. package/dist/navigation-DhnKriOp.js +197 -0
  46. package/dist/navigation.js +1 -1
  47. package/dist/pagination-DYdwsxwe.js +156 -0
  48. package/dist/pagination.js +1 -1
  49. package/dist/{pill-CrVqffKM.js → pill-DO2gHzMb.js} +16 -10
  50. package/dist/pill.js +1 -1
  51. package/dist/popover-BtN_0ejj.js +113 -0
  52. package/dist/popover.js +1 -1
  53. package/dist/progress-BpJswTG4.js +90 -0
  54. package/dist/progress.js +1 -1
  55. package/dist/radio-group-Ce0_IWQr.js +145 -0
  56. package/dist/radio-group.js +1 -1
  57. package/dist/select-BCS0-LVW.js +286 -0
  58. package/dist/select.js +1 -1
  59. package/dist/{skeleton-gJ4ImO5u.js → skeleton-OoFlOEXO.js} +24 -18
  60. package/dist/skeleton.js +1 -1
  61. package/dist/spinner-C2YDoiMn.js +56 -0
  62. package/dist/spinner.js +1 -1
  63. package/dist/stack-DC3IbtWk.js +27 -0
  64. package/dist/stack.js +1 -1
  65. package/dist/{switch-2hm2WnWt.js → switch-Dr-qjmT4.js} +63 -57
  66. package/dist/switch.js +1 -1
  67. package/dist/sx-Dx9JUKp5.js +23 -0
  68. package/dist/tabs-CK_g1RKa.js +203 -0
  69. package/dist/tabs.js +1 -1
  70. package/dist/text-field-D60ok14S.js +76 -0
  71. package/dist/text-field.js +1 -1
  72. package/dist/textarea-DyfjtP0A.js +86 -0
  73. package/dist/textarea.js +1 -1
  74. package/dist/theme-root-BiXXvQvr.js +42 -0
  75. package/dist/theme-root.js +1 -1
  76. package/dist/{toast-D3Y6OAsg.js → toast-iqelR-r0.js} +41 -30
  77. package/dist/toast.js +1 -1
  78. package/dist/toggle-group-CI0e7hFm.js +166 -0
  79. package/dist/toggle-group.js +1 -1
  80. package/dist/tooltip-CB-HC1js.js +108 -0
  81. package/dist/tooltip.js +1 -1
  82. package/dist/{trigger-style-B1GFmH7M.js → trigger-style-B1KVC8O1.js} +1 -1
  83. package/dist/types/components/accordion/accordion.d.ts +14 -9
  84. package/dist/types/components/alert/alert.d.ts +7 -3
  85. package/dist/types/components/avatar/avatar.d.ts +7 -3
  86. package/dist/types/components/badge/badge.d.ts +7 -3
  87. package/dist/types/components/breadcrumbs/breadcrumbs.d.ts +9 -5
  88. package/dist/types/components/button/button.d.ts +7 -3
  89. package/dist/types/components/calendar/calendar.d.ts +12 -7
  90. package/dist/types/components/card/card.d.ts +21 -13
  91. package/dist/types/components/checkbox/checkbox.d.ts +7 -3
  92. package/dist/types/components/combobox/combobox.d.ts +13 -8
  93. package/dist/types/components/command-palette/command-palette.d.ts +23 -15
  94. package/dist/types/components/container/container.d.ts +7 -3
  95. package/dist/types/components/date-picker/date-picker.d.ts +7 -4
  96. package/dist/types/components/dialog/dialog.d.ts +17 -11
  97. package/dist/types/components/divider/divider.d.ts +7 -3
  98. package/dist/types/components/field/field-anatomy.d.ts +3 -2
  99. package/dist/types/components/flex/flex.d.ts +7 -3
  100. package/dist/types/components/kbd/kbd.d.ts +9 -5
  101. package/dist/types/components/menu/menu.d.ts +14 -9
  102. package/dist/types/components/navigation/navigation.d.ts +12 -7
  103. package/dist/types/components/pagination/pagination.d.ts +7 -3
  104. package/dist/types/components/pill/pill.d.ts +7 -3
  105. package/dist/types/components/popover/popover.d.ts +8 -5
  106. package/dist/types/components/progress/progress.d.ts +7 -3
  107. package/dist/types/components/radio-group/radio-group.d.ts +9 -5
  108. package/dist/types/components/select/select.d.ts +14 -9
  109. package/dist/types/components/skeleton/skeleton.d.ts +7 -3
  110. package/dist/types/components/spinner/spinner.d.ts +7 -3
  111. package/dist/types/components/stack/stack.d.ts +4 -1
  112. package/dist/types/components/switch/switch.d.ts +7 -3
  113. package/dist/types/components/tabs/tabs.d.ts +15 -9
  114. package/dist/types/components/text-field/text-field.d.ts +7 -3
  115. package/dist/types/components/textarea/textarea.d.ts +7 -3
  116. package/dist/types/components/theme-provider/theme-provider.d.ts +11 -0
  117. package/dist/types/components/theme-root/theme-root.d.ts +7 -3
  118. package/dist/types/components/toast/toast.d.ts +7 -4
  119. package/dist/types/components/toggle-group/toggle-group.d.ts +8 -5
  120. package/dist/types/components/tooltip/tooltip.d.ts +8 -5
  121. package/dist/types/index.d.ts +4 -0
  122. package/dist/types/overlay/use-native-dialog.d.ts +2 -2
  123. package/dist/types/styling/css.d.ts +3 -2
  124. package/dist/types/styling/styled.d.ts +1 -0
  125. package/dist/types/styling/sx.d.ts +16 -0
  126. package/dist/types/styling/theme.d.ts +98 -0
  127. package/dist/{visually-hidden-DCWhf0Cb.js → visually-hidden-BJdvqqvn.js} +1 -1
  128. package/package.json +5 -4
  129. package/dist/accordion-C3YbYFBi.js +0 -169
  130. package/dist/breadcrumbs-CQaviWRc.js +0 -126
  131. package/dist/calendar-DUgS0xmp.js +0 -373
  132. package/dist/card-D9CHtouU.js +0 -121
  133. package/dist/checkbox-DKa5BCdy.js +0 -135
  134. package/dist/combobox-Dq3V88Zt.js +0 -302
  135. package/dist/command-palette-6c158eH1.js +0 -329
  136. package/dist/container-xUEIoZzj.js +0 -35
  137. package/dist/css-Cgj6sCHn.js +0 -2
  138. package/dist/dialog-C2NSOOP-.js +0 -176
  139. package/dist/divider-yF5EmhhT.js +0 -77
  140. package/dist/field-anatomy-BzGw1Ch9.js +0 -105
  141. package/dist/flex-5-NI5SSy.js +0 -22
  142. package/dist/menu-bvKRJOhJ.js +0 -187
  143. package/dist/navigation-xPoqh_Iz.js +0 -175
  144. package/dist/pagination-BIKYsxK1.js +0 -149
  145. package/dist/popover-CVAZ_C1a.js +0 -98
  146. package/dist/progress-C8bgujFI.js +0 -84
  147. package/dist/radio-group-CvQ4x8ii.js +0 -131
  148. package/dist/select-CNNiUhKB.js +0 -257
  149. package/dist/spinner-CSFiP0Oi.js +0 -50
  150. package/dist/stack-mEAryjKz.js +0 -21
  151. package/dist/tabs-GBppQabg.js +0 -174
  152. package/dist/text-field-DDPqQu29.js +0 -74
  153. package/dist/textarea-OP8_3IUR.js +0 -84
  154. package/dist/theme-root-eLka0ZP1.js +0 -21
  155. package/dist/toggle-group-BxzJ-6Cp.js +0 -151
  156. package/dist/tooltip-CVl8HS4S.js +0 -93
@@ -1,329 +0,0 @@
1
- 'use client';
2
- import { t as e } from "./css-Cgj6sCHn.js";
3
- import { t } from "./focus-ring-BK5W5_NY.js";
4
- import { t as n } from "./use-controlled-state-CVXDa-qM.js";
5
- import { t as r } from "./visually-hidden-DCWhf0Cb.js";
6
- import { t as i } from "./renderable-DzcIj1Lo.js";
7
- import { a, r as o, s, t as c } from "./collection-registry-1l9f3XJZ.js";
8
- import { t as l } from "./trigger-style-B1GFmH7M.js";
9
- import { i as u, r as d, t as f } from "./use-native-dialog-DWpIUVO1.js";
10
- import { n as p, t as m } from "./surface-DZ4d-2aL.js";
11
- import { createContext as h, forwardRef as g, useCallback as _, useContext as v, useId as y, useMemo as b, useRef as x, useState as S } from "react";
12
- import { vars as C } from "@jfrader/tokens/vars";
13
- import { jsx as w, jsxs as T } from "@emotion/react/jsx-runtime";
14
- import { FloatingList as E, useFloatingRootContext as ee, useInteractions as te, useListNavigation as ne, useMergeRefs as D } from "@floating-ui/react";
15
- //#region src/components/command-palette/command-palette.styles.ts
16
- var O = e({
17
- ...m,
18
- marginBlockStart: C.space[12]
19
- }), k = e({
20
- ...p,
21
- display: "flex",
22
- flexDirection: "column",
23
- borderRadius: C.radius.lg,
24
- boxShadow: C.shadow.floating,
25
- inlineSize: "min(560px, calc(100vw - 32px))"
26
- }), A = e({
27
- boxSizing: "border-box",
28
- inlineSize: "100%",
29
- blockSize: "48px",
30
- margin: 0,
31
- border: 0,
32
- borderBlockEnd: `1px solid ${C.color.borderControl}`,
33
- borderStartStartRadius: C.radius.lg,
34
- borderStartEndRadius: C.radius.lg,
35
- backgroundColor: "transparent",
36
- paddingInline: C.space[4],
37
- font: "inherit",
38
- fontSize: C.textSize.md,
39
- color: C.color.text,
40
- "&::placeholder": { color: C.color.textSubtle },
41
- "&:focus-visible": { ...t }
42
- }), j = e({
43
- boxSizing: "border-box",
44
- display: "flex",
45
- flexDirection: "column",
46
- maxBlockSize: "320px",
47
- overflow: "auto",
48
- padding: C.space[1],
49
- "&[hidden]": { display: "none" }
50
- }), M = e({
51
- display: "flex",
52
- flexDirection: "column",
53
- "&[hidden]": { display: "none" }
54
- }), N = e({
55
- paddingBlock: C.space[1],
56
- paddingInline: C.space[2],
57
- fontSize: C.textSize.xs,
58
- fontWeight: C.fontWeight.medium,
59
- color: C.color.textMuted
60
- }), P = e({
61
- "&:hover, &[data-active]": { backgroundColor: C.color.surfaceHover },
62
- "&[hidden]": { display: "none" }
63
- }), F = e({
64
- paddingBlock: C.space[6],
65
- paddingInline: C.space[4],
66
- textAlign: "center",
67
- fontSize: C.textSize.sm,
68
- color: C.color.textMuted
69
- }), re = "Command palette", ie = "No results", I = new Intl.PluralRules("en"), ae = (e, t) => e.toLocaleLowerCase().includes(t.toLocaleLowerCase()), oe = (e) => `${e} ${I.select(e) === "one" ? "result" : "results"}`, L = h(null), R = h(null);
70
- function z(e) {
71
- let t = v(L);
72
- if (!t) throw Error(`CommandPalette.${e} must be rendered inside <CommandPalette>.`);
73
- return t;
74
- }
75
- var B = (e) => {
76
- e?.setAttribute("autofocus", "");
77
- };
78
- function V({ open: e, defaultOpen: t = !1, onOpenChange: r, label: i = re, filter: o = ae, emptyMessage: s = ie, formatResultCount: c = oe, children: l }) {
79
- let d = y(), [f = !1, p] = n(e, t, r), { dialogElementRef: m, setDialogElement: h, setOpen: g, requestClose: v, repairToken: C } = u(f, p), [T, E] = S(""), [D, O] = S(!1), [k, A] = S(null), [j, M] = a(), [N, P] = S(null), [F, I] = S(null), [R, z] = S(f), B = x([]);
80
- f !== R && (z(f), f && (E(""), O(!1), A(null)));
81
- let V = _(() => {
82
- g(!(f && m.current?.open));
83
- }, [
84
- f,
85
- g,
86
- m
87
- ]), { matchedValues: H, matchedIndices: U, visibleGroupIds: W } = b(() => {
88
- let e = /* @__PURE__ */ new Set(), t = [], n = /* @__PURE__ */ new Set();
89
- return j.forEach((r, i) => {
90
- r.index !== -1 && (T === "" || o(r.label, T) || r.keywords !== void 0 && o(r.keywords, T)) && (e.add(i), t.push(r.index), r.groupId !== null && n.add(r.groupId));
91
- }), t.sort((e, t) => e - t), {
92
- matchedValues: e,
93
- matchedIndices: t,
94
- visibleGroupIds: n
95
- };
96
- }, [
97
- j,
98
- T,
99
- o
100
- ]), G = b(() => new Set(U), [U]), K = k !== null && G.has(k) ? k : U[0] ?? null, q = ee({
101
- open: f,
102
- onOpenChange: (e) => g(e),
103
- elements: {
104
- reference: N,
105
- floating: F
106
- }
107
- }), J = ne(q, {
108
- listRef: B,
109
- activeIndex: K,
110
- onNavigate: (e) => {
111
- e !== null && A(e);
112
- },
113
- virtual: !0,
114
- loop: !0,
115
- focusItemOnOpen: !1,
116
- disabledIndices: (e) => !G.has(e)
117
- }), { getReferenceProps: Y, getFloatingProps: X, getItemProps: Z } = te([J]), Q = U.length, $ = D ? c(Q) : "", se = b(() => ({
118
- open: f,
119
- setOpen: g,
120
- toggleOpen: V,
121
- requestClose: v,
122
- repairToken: C,
123
- setDialogElement: h,
124
- label: i,
125
- emptyMessage: s,
126
- baseId: d,
127
- listId: `${d}-list`,
128
- query: T,
129
- announcement: $,
130
- matchCount: Q,
131
- matchedValues: H,
132
- visibleGroupIds: W,
133
- activeIndex: K,
134
- elementsRef: B,
135
- setInputElement: P,
136
- setListElement: I,
137
- getReferenceProps: Y,
138
- getFloatingProps: X,
139
- getItemProps: Z,
140
- changeQuery: (e) => {
141
- E(e), O(!0), A(null);
142
- },
143
- moveToEdge: (e) => {
144
- let t = e === "first" ? U[0] : U[U.length - 1];
145
- t !== void 0 && A(t);
146
- },
147
- registration: M
148
- }), [
149
- f,
150
- g,
151
- V,
152
- v,
153
- C,
154
- h,
155
- i,
156
- s,
157
- d,
158
- T,
159
- $,
160
- Q,
161
- H,
162
- U,
163
- W,
164
- K,
165
- Y,
166
- X,
167
- Z,
168
- M
169
- ]);
170
- return /* @__PURE__ */ w(L.Provider, {
171
- value: se,
172
- children: l
173
- });
174
- }
175
- var H = g(function({ onClick: e, ...t }, n) {
176
- let { open: r, toggleOpen: i } = z("Trigger"), a = (t) => {
177
- e?.(t), t.defaultPrevented || i();
178
- };
179
- return /* @__PURE__ */ w("button", {
180
- type: "button",
181
- ...t,
182
- ref: n,
183
- "data-ui": "command-palette-trigger",
184
- "aria-haspopup": "dialog",
185
- "aria-expanded": r,
186
- onClick: a,
187
- css: l
188
- });
189
- }), U = g(function(e, t) {
190
- let { children: n, onCancel: i, onClick: a, onClose: o, ...s } = f(e), c = z("Content"), { label: l, announcement: u } = c, p = d(c, {
191
- onCancel: i,
192
- onClick: a,
193
- onClose: o
194
- }, t);
195
- return /* @__PURE__ */ w("dialog", {
196
- "aria-label": l,
197
- ...s,
198
- ...p,
199
- "data-ui": "command-palette",
200
- "aria-modal": "true",
201
- css: O,
202
- children: /* @__PURE__ */ T("div", {
203
- css: k,
204
- children: [n, /* @__PURE__ */ w("div", {
205
- role: "status",
206
- "aria-live": "polite",
207
- "aria-atomic": "true",
208
- css: r,
209
- children: u
210
- })]
211
- })
212
- });
213
- }), W = g(function({ onChange: e, onKeyDown: t, ...n }, r) {
214
- let { label: i, listId: a, query: o, matchCount: s, activeIndex: c, elementsRef: l, requestClose: u, setInputElement: d, getReferenceProps: f, changeQuery: p, moveToEdge: m } = z("Input"), h = D([
215
- d,
216
- B,
217
- r
218
- ]), g = (t) => {
219
- e?.(t), p(t.currentTarget.value);
220
- }, _ = (e) => {
221
- t?.(e), !(e.defaultPrevented || e.nativeEvent.isComposing) && (e.key === "Escape" ? (e.preventDefault(), u()) : (e.key === "Home" || e.key === "End") && !e.shiftKey && !e.ctrlKey && !e.metaKey && !e.altKey ? (e.preventDefault(), m(e.key === "Home" ? "first" : "last")) : e.key === "Enter" && c !== null && (e.preventDefault(), l.current[c]?.click()));
222
- };
223
- return /* @__PURE__ */ w("input", {
224
- "aria-label": i,
225
- autoComplete: "off",
226
- spellCheck: !1,
227
- ...f({
228
- ...n,
229
- onChange: g,
230
- onKeyDown: _
231
- }),
232
- ref: h,
233
- type: "text",
234
- value: o,
235
- role: "combobox",
236
- "aria-autocomplete": "list",
237
- "aria-expanded": s > 0,
238
- "aria-controls": a,
239
- "data-ui": "command-palette-input",
240
- css: A
241
- });
242
- }), G = g(function({ onMouseDown: e, children: t, ...n }, r) {
243
- let { label: i, listId: a, matchCount: o, elementsRef: s, setListElement: c, getFloatingProps: l } = z("List"), u = D([c, r]), d = (t) => {
244
- e?.(t), t.preventDefault();
245
- };
246
- return /* @__PURE__ */ w("div", {
247
- "aria-label": i,
248
- ...l({
249
- ...n,
250
- onMouseDown: d
251
- }),
252
- ref: u,
253
- id: a,
254
- role: "listbox",
255
- hidden: o === 0,
256
- "data-ui": "command-palette-list",
257
- css: j,
258
- children: /* @__PURE__ */ w(E, {
259
- elementsRef: s,
260
- children: t
261
- })
262
- });
263
- }), K = g(function({ children: e, ...t }, n) {
264
- let { matchCount: r, emptyMessage: a } = z("Empty");
265
- return r > 0 ? null : /* @__PURE__ */ w("div", {
266
- ...t,
267
- ref: n,
268
- "data-ui": "command-palette-empty",
269
- css: F,
270
- children: i(e) ? e : a
271
- });
272
- }), q = g(function({ label: e, children: t, "aria-labelledby": n, ...r }, i) {
273
- let { visibleGroupIds: a } = z("Group"), o = y(), s = `${o}-heading`;
274
- return /* @__PURE__ */ T("div", {
275
- ...r,
276
- ref: i,
277
- role: "group",
278
- "aria-labelledby": [n, s].filter(Boolean).join(" "),
279
- hidden: !a.has(o),
280
- "data-ui": "command-palette-group",
281
- css: M,
282
- children: [/* @__PURE__ */ w("div", {
283
- id: s,
284
- css: N,
285
- children: e
286
- }), /* @__PURE__ */ w(R.Provider, {
287
- value: o,
288
- children: t
289
- })]
290
- });
291
- }), J = g(function({ value: e, onSelect: t, keywords: n, onClick: r, children: i, ...a }, l) {
292
- let { baseId: u, activeIndex: d, matchedValues: f, getItemProps: p, setOpen: m, registration: h } = z("Item"), g = v(R), _ = x(null), { ref: y, index: b } = o(e, h, _, (e, t) => ({
293
- index: e,
294
- label: t,
295
- keywords: n,
296
- groupId: g
297
- })), S = D([
298
- y,
299
- _,
300
- l
301
- ]), C = b !== -1 && d === b, T = (e) => {
302
- r?.(e), !e.defaultPrevented && (t?.(), m(!1));
303
- };
304
- return /* @__PURE__ */ w("div", {
305
- ...p({
306
- id: c(u, e),
307
- ...a,
308
- onClick: T
309
- }),
310
- ref: S,
311
- role: "option",
312
- "aria-selected": C,
313
- hidden: !f.has(e),
314
- "data-active": C || void 0,
315
- "data-ui": "command-palette-item",
316
- css: [s, P],
317
- children: i
318
- });
319
- }), Y = Object.assign(V, {
320
- Trigger: H,
321
- Content: U,
322
- Input: W,
323
- List: G,
324
- Empty: K,
325
- Group: q,
326
- Item: J
327
- });
328
- //#endregion
329
- export { Y as t };
@@ -1,35 +0,0 @@
1
- 'use client';
2
- import { t as e } from "./css-Cgj6sCHn.js";
3
- import { n as t } from "./layout-style-7ZTOiWGR.js";
4
- import { forwardRef as n } from "react";
5
- import { jsx as r } from "@emotion/react/jsx-runtime";
6
- //#region src/components/container/container.tsx
7
- var i = {
8
- sm: "640px",
9
- md: "768px",
10
- lg: "1024px",
11
- xl: "1280px"
12
- }, a = e({
13
- boxSizing: "border-box",
14
- inlineSize: "100%",
15
- marginInline: "auto"
16
- }), o = {
17
- sm: e({ maxInlineSize: i.sm }),
18
- md: e({ maxInlineSize: i.md }),
19
- lg: e({ maxInlineSize: i.lg }),
20
- xl: e({ maxInlineSize: i.xl })
21
- }, s = t("paddingInline"), c = n(function({ size: e = "lg", paddingInline: t = "md", ...n }, i) {
22
- return /* @__PURE__ */ r("div", {
23
- ...n,
24
- ref: i,
25
- "data-ui": "container",
26
- "data-size": e,
27
- css: [
28
- a,
29
- o[e],
30
- s[t]
31
- ]
32
- });
33
- });
34
- //#endregion
35
- export { c as t };
@@ -1,2 +0,0 @@
1
- 'use client';
2
- export { keyframes as n, css as t } from "@emotion/react";
@@ -1,176 +0,0 @@
1
- 'use client';
2
- import { t as e } from "./css-Cgj6sCHn.js";
3
- import { n as t } from "./focus-ring-BK5W5_NY.js";
4
- import { n } from "./media-D_eA_I-e.js";
5
- import { t as r } from "./use-controlled-state-CVXDa-qM.js";
6
- import { t as i } from "./trigger-style-B1GFmH7M.js";
7
- import { i as a, n as o, r as s, t as c } from "./use-native-dialog-DWpIUVO1.js";
8
- import { n as l, t as u } from "./surface-DZ4d-2aL.js";
9
- 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";
10
- import { vars as b } from "@jfrader/tokens/vars";
11
- import { jsx as x } from "@emotion/react/jsx-runtime";
12
- //#region src/components/dialog/dialog.tsx
13
- var S = d(null), C = d(null);
14
- function w(e) {
15
- let t = m(S);
16
- if (!t) throw Error(`Dialog.${e} must be rendered inside <Dialog>.`);
17
- return t;
18
- }
19
- var T = e(u), E = e({
20
- ...l,
21
- borderRadius: b.radius.lg,
22
- boxShadow: b.shadow.floating,
23
- padding: b.space[5],
24
- minInlineSize: "320px",
25
- maxInlineSize: "min(560px, calc(100vw - 32px))"
26
- }), D = e({
27
- margin: 0,
28
- marginBlockEnd: b.space[2],
29
- fontSize: b.textSize.lg,
30
- fontWeight: b.fontWeight.semibold,
31
- lineHeight: b.lineHeight.tight
32
- }), O = e({
33
- margin: 0,
34
- marginBlockEnd: b.space[4],
35
- fontSize: b.textSize.sm,
36
- color: b.color.textMuted
37
- }), k = e({
38
- appearance: "none",
39
- display: "inline-flex",
40
- alignItems: "center",
41
- border: "1px solid transparent",
42
- borderRadius: b.radius.md,
43
- backgroundColor: "transparent",
44
- paddingBlock: b.space[1],
45
- paddingInline: b.space[3],
46
- font: "inherit",
47
- fontSize: b.textSize.sm,
48
- fontWeight: b.fontWeight.medium,
49
- color: b.color.textMuted,
50
- cursor: "pointer",
51
- transitionProperty: "background-color, color",
52
- transitionDuration: b.motion.duration.fast,
53
- transitionTimingFunction: b.motion.easeStandard,
54
- "&:hover:not(:disabled)": {
55
- backgroundColor: b.color.surfaceHover,
56
- color: b.color.text
57
- },
58
- "&:focus-visible": { ...t },
59
- "&:disabled": {
60
- opacity: .55,
61
- cursor: "not-allowed"
62
- },
63
- [n]: { transitionDuration: "0s" }
64
- });
65
- function A({ open: e, defaultOpen: t = !1, onOpenChange: n, children: i }) {
66
- 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 = _(() => ({
67
- open: s,
68
- setOpen: u,
69
- requestClose: d,
70
- repairToken: f,
71
- setDialogElement: l,
72
- titleId: `${o}-title`,
73
- descriptionId: `${o}-description`,
74
- hasTitle: p,
75
- hasDescription: h,
76
- setHasTitle: m,
77
- setHasDescription: v
78
- }), [
79
- s,
80
- u,
81
- d,
82
- f,
83
- l,
84
- o,
85
- p,
86
- h
87
- ]);
88
- return /* @__PURE__ */ x(S.Provider, {
89
- value: b,
90
- children: i
91
- });
92
- }
93
- var j = f(function({ onClick: e, render: t, ...n }, r) {
94
- let { open: a, setOpen: o } = w("Trigger"), { "data-ui": s, ...c } = n, l = e, u = (e) => {
95
- l?.(e), e.defaultPrevented || o(!0);
96
- }, d = {
97
- type: "button",
98
- ...c,
99
- ref: r,
100
- "data-ui": t && s !== void 0 ? `${s} dialog-trigger` : "dialog-trigger",
101
- "aria-haspopup": "dialog",
102
- "aria-expanded": a,
103
- onClick: u
104
- };
105
- return t ? t(d) : /* @__PURE__ */ x("button", {
106
- ...d,
107
- css: i
108
- });
109
- }), M = f(function(e, t) {
110
- 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(() => {
111
- o(S.current, h);
112
- }, [h]), O = s({
113
- ...m,
114
- requestClose: D
115
- }, {
116
- onCancel: r,
117
- onClick: i,
118
- onClose: a
119
- }, t, S), k = [l, y && g].filter(Boolean).join(" ") || void 0, A = [u, d && b && _].filter(Boolean).join(" ") || void 0;
120
- return /* @__PURE__ */ x("dialog", {
121
- ...f,
122
- ...O,
123
- "data-ui": "dialog",
124
- "aria-modal": "true",
125
- "aria-labelledby": k,
126
- "aria-describedby": A,
127
- css: T,
128
- children: /* @__PURE__ */ x(C.Provider, {
129
- value: D,
130
- children: /* @__PURE__ */ x("div", {
131
- css: E,
132
- children: n
133
- })
134
- })
135
- });
136
- }), N = f(function(e, t) {
137
- let { titleId: n, setHasTitle: r } = w("Title");
138
- return h(() => (r(!0), () => r(!1)), [r]), /* @__PURE__ */ x("h2", {
139
- ...e,
140
- ref: t,
141
- id: n,
142
- "data-ui": "dialog-title",
143
- css: D
144
- });
145
- }), P = f(function(e, t) {
146
- let { descriptionId: n, setHasDescription: r } = w("Description");
147
- return h(() => (r(!0), () => r(!1)), [r]), /* @__PURE__ */ x("p", {
148
- ...e,
149
- ref: t,
150
- id: n,
151
- "data-ui": "dialog-description",
152
- css: O
153
- });
154
- }), F = f(function({ onClick: e, render: t, ...n }, r) {
155
- let { setOpen: i } = w("Close"), a = m(C), { "data-ui": o, ...s } = n, c = e, l = (e) => {
156
- c?.(e), !e.defaultPrevented && (a ? a() : i(!1));
157
- }, u = {
158
- type: "button",
159
- ...s,
160
- ref: r,
161
- "data-ui": t && o !== void 0 ? `${o} dialog-close` : "dialog-close",
162
- onClick: l
163
- };
164
- return t ? t(u) : /* @__PURE__ */ x("button", {
165
- ...u,
166
- css: k
167
- });
168
- }), I = Object.assign(A, {
169
- Trigger: j,
170
- Content: M,
171
- Title: N,
172
- Description: P,
173
- Close: F
174
- });
175
- //#endregion
176
- export { I as t };
@@ -1,77 +0,0 @@
1
- 'use client';
2
- import { t as e } from "./css-Cgj6sCHn.js";
3
- import { t } from "./renderable-DzcIj1Lo.js";
4
- import { forwardRef as n, useId as r } from "react";
5
- import { vars as i } from "@jfrader/tokens/vars";
6
- import { jsx as a } from "@emotion/react/jsx-runtime";
7
- //#region src/components/divider/divider.tsx
8
- var o = "@media (forced-colors: active)", s = "1px", c = {
9
- backgroundColor: i.color.border,
10
- [o]: {
11
- forcedColorAdjust: "none",
12
- backgroundColor: "CanvasText"
13
- }
14
- }, l = e({
15
- ...c,
16
- boxSizing: "border-box",
17
- alignSelf: "stretch",
18
- blockSize: s,
19
- margin: 0,
20
- border: 0
21
- }), u = e({
22
- ...c,
23
- boxSizing: "border-box",
24
- alignSelf: "stretch",
25
- flexShrink: 0,
26
- inlineSize: s
27
- }), d = e({
28
- display: "flex",
29
- alignItems: "center",
30
- alignSelf: "stretch",
31
- gap: i.space[3],
32
- fontFamily: i.font.sans,
33
- fontSize: i.textSize.sm,
34
- lineHeight: i.lineHeight.tight,
35
- color: i.color.textMuted,
36
- "&::before, &::after": {
37
- ...c,
38
- content: "\"\"",
39
- flex: 1,
40
- blockSize: s
41
- }
42
- }), f = n(function({ orientation: e = "horizontal", label: n, "aria-labelledby": i, ...o }, s) {
43
- let c = r();
44
- return e === "vertical" ? /* @__PURE__ */ a("div", {
45
- ...o,
46
- ref: s,
47
- role: "separator",
48
- "aria-orientation": "vertical",
49
- "aria-labelledby": i,
50
- "data-ui": "divider",
51
- "data-orientation": "vertical",
52
- css: u
53
- }) : t(n) ? /* @__PURE__ */ a("div", {
54
- ...o,
55
- ref: s,
56
- role: "separator",
57
- "aria-orientation": "horizontal",
58
- "aria-labelledby": [c, i].filter(Boolean).join(" "),
59
- "data-ui": "divider",
60
- "data-orientation": "horizontal",
61
- css: d,
62
- children: /* @__PURE__ */ a("span", {
63
- id: c,
64
- "data-ui": "divider-label",
65
- children: n
66
- })
67
- }) : /* @__PURE__ */ a("hr", {
68
- ...o,
69
- ref: s,
70
- "aria-labelledby": i,
71
- "data-ui": "divider",
72
- "data-orientation": "horizontal",
73
- css: l
74
- });
75
- });
76
- //#endregion
77
- export { f as t };