@jfrader/ui 0.2.0 → 0.4.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/dist/accordion-Bd-j04hW.js +198 -0
  2. package/dist/accordion.js +1 -1
  3. package/dist/alert-BBqaKI4k.js +135 -0
  4. package/dist/alert.js +1 -1
  5. package/dist/avatar-BahDVO9t.js +132 -0
  6. package/dist/avatar.js +1 -1
  7. package/dist/badge-B_sLygxU.js +108 -0
  8. package/dist/badge.js +1 -1
  9. package/dist/breadcrumbs-DVAOxfvL.js +141 -0
  10. package/dist/breadcrumbs.js +1 -1
  11. package/dist/button-P2e7_44z.js +200 -0
  12. package/dist/button.js +1 -1
  13. package/dist/calendar-C9Yad_-w.js +394 -0
  14. package/dist/calendar.js +1 -1
  15. package/dist/card-D-aI2QHx.js +158 -0
  16. package/dist/card.js +1 -1
  17. package/dist/checkbox-COYG6L7d.js +140 -0
  18. package/dist/checkbox.js +1 -1
  19. package/dist/{choice-control-ByFogYcT.js → choice-control-5kJkLXgv.js} +1 -1
  20. package/dist/{collection-registry-1l9f3XJZ.js → collection-registry-BTYi6zGh.js} +1 -1
  21. package/dist/combobox-DiMC2g_u.js +327 -0
  22. package/dist/combobox.js +1 -1
  23. package/dist/command-palette-V_2pEay7.js +379 -0
  24. package/dist/command-palette.js +1 -1
  25. package/dist/container-BOaSptJa.js +41 -0
  26. package/dist/container.js +1 -1
  27. package/dist/date-picker-C29Uo4Tx.js +250 -0
  28. package/dist/date-picker.js +1 -1
  29. package/dist/dialog-xaydbXl2.js +218 -0
  30. package/dist/dialog.js +1 -1
  31. package/dist/divider-DYoJf0I_.js +84 -0
  32. package/dist/divider.js +1 -1
  33. package/dist/field-anatomy-D2ToMeRa.js +109 -0
  34. package/dist/flex-Dh-_J5-U.js +28 -0
  35. package/dist/flex.js +1 -1
  36. package/dist/{icon-wrapper-CFWzew5m.js → icon-wrapper-stN8sD7R.js} +1 -1
  37. package/dist/index.js +38 -37
  38. package/dist/kbd-C3ACoMoE.js +71 -0
  39. package/dist/kbd.js +1 -1
  40. package/dist/{layout-style-7ZTOiWGR.js → layout-style-Cbd1Vilw.js} +1 -1
  41. package/dist/{loading-ring-BpdB0aFi.js → loading-ring-B8-30Dl1.js} +1 -1
  42. package/dist/menu-CGPTNRnF.js +216 -0
  43. package/dist/menu.js +1 -1
  44. package/dist/navigation-DhnKriOp.js +197 -0
  45. package/dist/navigation.js +1 -1
  46. package/dist/pagination-DYdwsxwe.js +156 -0
  47. package/dist/pagination.js +1 -1
  48. package/dist/pill-DO2gHzMb.js +56 -0
  49. package/dist/pill.js +1 -1
  50. package/dist/popover-CdRXjQqI.js +113 -0
  51. package/dist/popover.js +1 -1
  52. package/dist/progress-BpJswTG4.js +90 -0
  53. package/dist/progress.js +1 -1
  54. package/dist/radio-group-Ce0_IWQr.js +145 -0
  55. package/dist/radio-group.js +1 -1
  56. package/dist/select-BgG7WgSh.js +286 -0
  57. package/dist/select.js +1 -1
  58. package/dist/skeleton-OoFlOEXO.js +54 -0
  59. package/dist/skeleton.js +1 -1
  60. package/dist/spinner-C2YDoiMn.js +56 -0
  61. package/dist/spinner.js +1 -1
  62. package/dist/stack-DC3IbtWk.js +27 -0
  63. package/dist/stack.js +1 -1
  64. package/dist/switch-Dr-qjmT4.js +142 -0
  65. package/dist/switch.js +1 -1
  66. package/dist/sx-Dx9JUKp5.js +23 -0
  67. package/dist/tabs-CK_g1RKa.js +203 -0
  68. package/dist/tabs.js +1 -1
  69. package/dist/{text-field-8PQAqRpM.js → text-field-D60ok14S.js} +19 -18
  70. package/dist/text-field.js +1 -1
  71. package/dist/{textarea-CcGWuntL.js → textarea-DyfjtP0A.js} +19 -18
  72. package/dist/textarea.js +1 -1
  73. package/dist/theme-root-BbTBuLMQ.js +46 -0
  74. package/dist/theme-root.js +1 -1
  75. package/dist/theme-scope-t7nAKc2c.js +27 -0
  76. package/dist/toast-CjmELMZZ.js +283 -0
  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-CaL3rKbV.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 +9 -8
  84. package/dist/types/components/alert/alert.d.ts +3 -2
  85. package/dist/types/components/avatar/avatar.d.ts +3 -2
  86. package/dist/types/components/badge/badge.d.ts +3 -2
  87. package/dist/types/components/breadcrumbs/breadcrumbs.d.ts +5 -4
  88. package/dist/types/components/button/button.d.ts +3 -2
  89. package/dist/types/components/calendar/calendar.d.ts +7 -6
  90. package/dist/types/components/card/card.d.ts +13 -12
  91. package/dist/types/components/checkbox/checkbox.d.ts +3 -2
  92. package/dist/types/components/combobox/combobox.d.ts +8 -7
  93. package/dist/types/components/command-palette/command-palette.d.ts +15 -14
  94. package/dist/types/components/container/container.d.ts +3 -2
  95. package/dist/types/components/date-picker/date-picker.d.ts +3 -2
  96. package/dist/types/components/dialog/dialog.d.ts +11 -10
  97. package/dist/types/components/divider/divider.d.ts +3 -2
  98. package/dist/types/components/field/field-anatomy.d.ts +3 -2
  99. package/dist/types/components/flex/flex.d.ts +3 -2
  100. package/dist/types/components/kbd/kbd.d.ts +5 -4
  101. package/dist/types/components/menu/menu.d.ts +9 -8
  102. package/dist/types/components/navigation/navigation.d.ts +7 -6
  103. package/dist/types/components/pagination/pagination.d.ts +3 -2
  104. package/dist/types/components/pill/pill.d.ts +3 -2
  105. package/dist/types/components/popover/popover.d.ts +5 -4
  106. package/dist/types/components/progress/progress.d.ts +3 -2
  107. package/dist/types/components/radio-group/radio-group.d.ts +5 -4
  108. package/dist/types/components/select/select.d.ts +9 -8
  109. package/dist/types/components/skeleton/skeleton.d.ts +3 -2
  110. package/dist/types/components/spinner/spinner.d.ts +3 -2
  111. package/dist/types/components/stack/stack.d.ts +1 -1
  112. package/dist/types/components/switch/switch.d.ts +3 -2
  113. package/dist/types/components/tabs/tabs.d.ts +9 -8
  114. package/dist/types/components/text-field/text-field.d.ts +3 -2
  115. package/dist/types/components/textarea/textarea.d.ts +3 -2
  116. package/dist/types/components/theme-provider/theme-provider.d.ts +11 -0
  117. package/dist/types/components/theme-root/theme-root.d.ts +11 -4
  118. package/dist/types/components/toast/toast.d.ts +3 -2
  119. package/dist/types/components/toggle-group/toggle-group.d.ts +5 -4
  120. package/dist/types/components/tooltip/tooltip.d.ts +5 -4
  121. package/dist/types/index.d.ts +4 -0
  122. package/dist/types/overlay/overlay-portal.d.ts +7 -0
  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-scope.d.ts +19 -0
  127. package/dist/types/styling/theme.d.ts +98 -0
  128. package/dist/use-overlay-floating-Bit-f0FU.js +31 -0
  129. package/dist/{visually-hidden-DCWhf0Cb.js → visually-hidden-BJdvqqvn.js} +1 -1
  130. package/package.json +3 -2
  131. package/dist/accordion-CkOZ-tvs.js +0 -178
  132. package/dist/alert-Dsjx14UW.js +0 -131
  133. package/dist/avatar-BRGKkoSr.js +0 -127
  134. package/dist/badge-DLxUMsCx.js +0 -104
  135. package/dist/breadcrumbs-694hF_hm.js +0 -131
  136. package/dist/button-CoaIcykB.js +0 -190
  137. package/dist/calendar-Doj7PTdG.js +0 -379
  138. package/dist/card-2IM71XZj.js +0 -134
  139. package/dist/checkbox-B7xGNFzp.js +0 -136
  140. package/dist/combobox-Bjhxv5U3.js +0 -311
  141. package/dist/command-palette-BhJwm6cS.js +0 -344
  142. package/dist/container-BhnrGPu-.js +0 -36
  143. package/dist/css-Cgj6sCHn.js +0 -2
  144. package/dist/date-picker-Jk8SpoiO.js +0 -245
  145. package/dist/dialog-fhS07G41.js +0 -187
  146. package/dist/divider-v_78HYF5.js +0 -79
  147. package/dist/field-anatomy-BzGw1Ch9.js +0 -105
  148. package/dist/flex-COZzFqI8.js +0 -22
  149. package/dist/kbd-CeP8Kfvp.js +0 -61
  150. package/dist/menu-B6KCbLCr.js +0 -196
  151. package/dist/navigation-BDht6S2-.js +0 -182
  152. package/dist/pagination-B50PCaDU.js +0 -151
  153. package/dist/pill-2_XzBdkD.js +0 -51
  154. package/dist/popover-DRHbeIVq.js +0 -103
  155. package/dist/progress-CpsskKTD.js +0 -85
  156. package/dist/radio-group-DPI5KUCj.js +0 -136
  157. package/dist/select-C1xGrOhT.js +0 -266
  158. package/dist/skeleton-DitdP-yz.js +0 -49
  159. package/dist/spinner-CFq5HPoo.js +0 -51
  160. package/dist/stack-D_g6NJzo.js +0 -21
  161. package/dist/switch-B5TTU-oJ.js +0 -138
  162. package/dist/tabs-C26PWl2c.js +0 -183
  163. package/dist/theme-root-BRLIA4eb.js +0 -22
  164. package/dist/toast-B1PXuwZ4.js +0 -277
  165. package/dist/toggle-group-N_owicT0.js +0 -156
  166. package/dist/tooltip-BJPisf60.js +0 -98
  167. package/dist/use-overlay-floating-efeqppiw.js +0 -19
@@ -0,0 +1,216 @@
1
+ 'use client';
2
+ import { r as e, t } from "./sx-Dx9JUKp5.js";
3
+ import { t as n } from "./focus-ring-BK5W5_NY.js";
4
+ import { n as r } from "./media-D_eA_I-e.js";
5
+ import { t as i } from "./use-controlled-state-CVXDa-qM.js";
6
+ import { f as a, i as o, n as s, o as c } from "./collection-registry-BTYi6zGh.js";
7
+ import { t as l } from "./trigger-style-B1KVC8O1.js";
8
+ import { n as u, t as d } from "./use-overlay-floating-Bit-f0FU.js";
9
+ import { createContext as f, useContext as p, useEffect as m, useMemo as h, useRef as g, useState as _ } from "react";
10
+ import { vars as v } from "@jfrader/tokens/vars";
11
+ import { jsx as y } from "@emotion/react/jsx-runtime";
12
+ import { FloatingFocusManager as b, FloatingList as x, useClick as S, useDismiss as C, useInteractions as w, useListNavigation as T, useMergeRefs as E, useRole as D, useTypeahead as O } from "@floating-ui/react";
13
+ //#region src/components/menu/menu.tsx
14
+ var k = 500, A = f(null), j = f(!1);
15
+ function M(e) {
16
+ let t = p(A);
17
+ if (!t) throw Error(`Menu.${e} must be rendered inside <Menu>.`);
18
+ return t;
19
+ }
20
+ function N() {
21
+ let e = M("Item");
22
+ if (!p(j)) throw Error("Menu.Item must be rendered inside <Menu.Content>.");
23
+ return e;
24
+ }
25
+ var P = e({
26
+ appearance: "none",
27
+ boxSizing: "border-box",
28
+ display: "flex",
29
+ alignItems: "center",
30
+ inlineSize: "100%",
31
+ minBlockSize: "32px",
32
+ border: 0,
33
+ borderRadius: v.radius.sm,
34
+ backgroundColor: "transparent",
35
+ paddingBlock: v.space[1],
36
+ paddingInline: v.space[2],
37
+ font: "inherit",
38
+ fontSize: v.textSize.sm,
39
+ color: v.color.text,
40
+ textAlign: "start",
41
+ cursor: "pointer",
42
+ transitionProperty: "background-color",
43
+ transitionDuration: v.motion.duration.fast,
44
+ transitionTimingFunction: v.motion.easeStandard,
45
+ "&:focus-visible": { ...n },
46
+ [r]: { transitionDuration: "0s" }
47
+ }), F = e({
48
+ blockSize: "1px",
49
+ marginBlock: v.space[1],
50
+ backgroundColor: v.color.border
51
+ });
52
+ function I({ open: e, defaultOpen: t = !1, onOpenChange: n, placement: r = "bottom-start", children: a }) {
53
+ let [o = !1, s] = i(e, t, n), [c, l] = _(null), u = g([]), f = g([]), p = g(/* @__PURE__ */ new Set()), v = g(!1), { refs: b, floatingStyles: x, context: E } = d({
54
+ open: o,
55
+ placement: r,
56
+ onOpenChange: (e, t, n) => {
57
+ e || (v.current = n === "escape-key"), s(e);
58
+ }
59
+ });
60
+ m(() => {
61
+ !o && v.current && (v.current = !1, b.domReference.current?.focus());
62
+ }, [o, b]);
63
+ let j = S(E), M = D(E, { role: "menu" }), N = C(E, {
64
+ escapeKey: !0,
65
+ outsidePress: !0
66
+ }), P = T(E, {
67
+ listRef: u,
68
+ activeIndex: c,
69
+ onNavigate: l,
70
+ loop: !0,
71
+ orientation: "vertical",
72
+ disabledIndices: (e) => p.current.has(e),
73
+ focusItemOnOpen: !0
74
+ }), F = O(E, {
75
+ listRef: f,
76
+ activeIndex: c,
77
+ onMatch: o ? l : void 0,
78
+ resetMs: k
79
+ }), { getReferenceProps: I, getFloatingProps: L, getItemProps: R } = w([
80
+ j,
81
+ M,
82
+ N,
83
+ P,
84
+ F
85
+ ]), z = h(() => ({
86
+ open: o,
87
+ requestClose: (e = !1) => {
88
+ e && (v.current = !0), s(!1);
89
+ },
90
+ activeIndex: c,
91
+ refs: b,
92
+ floatingContext: E,
93
+ floatingStyles: x,
94
+ elementsRef: u,
95
+ labelsRef: f,
96
+ disabledIndices: p.current,
97
+ getReferenceProps: I,
98
+ getFloatingProps: L,
99
+ getItemProps: R
100
+ }), [
101
+ o,
102
+ s,
103
+ c,
104
+ b,
105
+ E,
106
+ x,
107
+ I,
108
+ L,
109
+ R
110
+ ]);
111
+ return /* @__PURE__ */ y(A.Provider, {
112
+ value: z,
113
+ children: a
114
+ });
115
+ }
116
+ I.displayName = "Menu";
117
+ function L({ ref: e, className: n, sx: r, ...i }) {
118
+ let { refs: a, getReferenceProps: o } = M("Trigger"), s = E([a.setReference, e]);
119
+ return /* @__PURE__ */ y(t, {
120
+ className: n,
121
+ styles: l,
122
+ sx: r,
123
+ children: (e) => /* @__PURE__ */ y("button", {
124
+ type: "button",
125
+ ...o(i),
126
+ ref: s,
127
+ "data-ui": "menu-trigger",
128
+ className: e
129
+ })
130
+ });
131
+ }
132
+ L.displayName = "Menu.Trigger";
133
+ function R({ ref: e, style: n, children: r, className: i, sx: o, ...s }) {
134
+ let { open: c, refs: l, floatingContext: d, floatingStyles: f, elementsRef: p, labelsRef: m, getFloatingProps: h } = M("Content"), g = E([l.setFloating, e]);
135
+ return c ? /* @__PURE__ */ y(u, { children: /* @__PURE__ */ y(b, {
136
+ context: d,
137
+ modal: !1,
138
+ initialFocus: -1,
139
+ returnFocus: !1,
140
+ restoreFocus: !0,
141
+ children: /* @__PURE__ */ y(t, {
142
+ className: i,
143
+ styles: a,
144
+ sx: o,
145
+ children: (e) => /* @__PURE__ */ y("div", {
146
+ ...h(s),
147
+ ref: g,
148
+ "data-ui": "menu",
149
+ style: {
150
+ ...n,
151
+ ...f
152
+ },
153
+ className: e,
154
+ children: /* @__PURE__ */ y(x, {
155
+ elementsRef: p,
156
+ labelsRef: m,
157
+ children: /* @__PURE__ */ y(j.Provider, {
158
+ value: !0,
159
+ children: r
160
+ })
161
+ })
162
+ })
163
+ })
164
+ }) }) : null;
165
+ }
166
+ R.displayName = "Menu.Content";
167
+ function z({ ref: e, onSelect: n, disabled: r = !1, onClick: i, className: a, sx: l, ...u }) {
168
+ let { activeIndex: d, requestClose: f, disabledIndices: p, getItemProps: m } = N(), { ref: h, index: g } = o({ label: r ? null : void 0 }), _ = E([h, e]), v = g !== -1 && d === g;
169
+ s(g, r, p);
170
+ let b = (e) => {
171
+ r || (i?.(e), n?.(), e.defaultPrevented || f(!0));
172
+ };
173
+ return /* @__PURE__ */ y(t, {
174
+ className: a,
175
+ styles: [P, c],
176
+ sx: l,
177
+ children: (e) => /* @__PURE__ */ y("button", {
178
+ type: "button",
179
+ ...m({
180
+ ...u,
181
+ onClick: b
182
+ }),
183
+ ref: _,
184
+ role: "menuitem",
185
+ tabIndex: v ? 0 : -1,
186
+ "aria-disabled": r || void 0,
187
+ "data-active": v || void 0,
188
+ "data-ui": "menu-item",
189
+ className: e
190
+ })
191
+ });
192
+ }
193
+ z.displayName = "Menu.Item";
194
+ function B({ ref: e, className: n, sx: r, ...i }) {
195
+ return /* @__PURE__ */ y(t, {
196
+ className: n,
197
+ styles: F,
198
+ sx: r,
199
+ children: (t) => /* @__PURE__ */ y("div", {
200
+ ...i,
201
+ ref: e,
202
+ role: "separator",
203
+ "data-ui": "menu-separator",
204
+ className: t
205
+ })
206
+ });
207
+ }
208
+ B.displayName = "Menu.Separator";
209
+ var V = Object.assign(I, {
210
+ Trigger: L,
211
+ Content: R,
212
+ Item: z,
213
+ Separator: B
214
+ });
215
+ //#endregion
216
+ export { V as t };
package/dist/menu.js CHANGED
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- export { t as Menu } from "./menu-B6KCbLCr.js";
2
+ export { t as Menu } from "./menu-CGPTNRnF.js";
@@ -0,0 +1,197 @@
1
+ 'use client';
2
+ import { r as e, t } from "./sx-Dx9JUKp5.js";
3
+ import { t as n } from "./disclosure-caret-C5T3fcl6.js";
4
+ import { t as r } from "./focus-ring-BK5W5_NY.js";
5
+ import { n as i, t as a } from "./media-D_eA_I-e.js";
6
+ import { t as o } from "./renderable-DzcIj1Lo.js";
7
+ import { t as s } from "./icon-wrapper-stN8sD7R.js";
8
+ import { useId as c } from "react";
9
+ import { vars as l } from "@jfrader/tokens/vars";
10
+ import { Fragment as u, jsx as d, jsxs as f } from "@emotion/react/jsx-runtime";
11
+ //#region src/components/navigation/navigation.tsx
12
+ var p = l.space[8], m = "0.06em", h = e({
13
+ display: "grid",
14
+ gap: l.space[4],
15
+ fontFamily: l.font.sans
16
+ }), g = e({
17
+ display: "grid",
18
+ gap: l.space[1],
19
+ "&[open] > summary::after": { transform: "rotate(90deg)" },
20
+ "&[open]:dir(rtl) > summary::after": { transform: "rotate(-90deg)" }
21
+ }), _ = e({
22
+ margin: 0,
23
+ paddingBlock: l.space[1],
24
+ paddingInline: l.space[3],
25
+ fontSize: l.textSize.xs,
26
+ fontWeight: l.fontWeight.medium,
27
+ lineHeight: l.lineHeight.tight,
28
+ letterSpacing: m,
29
+ textTransform: "uppercase",
30
+ color: l.color.textMuted
31
+ }), v = e({
32
+ display: "flex",
33
+ alignItems: "center",
34
+ justifyContent: "space-between",
35
+ gap: l.space[2],
36
+ inlineSize: "100%",
37
+ boxSizing: "border-box",
38
+ minBlockSize: p,
39
+ borderRadius: l.radius.sm,
40
+ cursor: "pointer",
41
+ listStyle: "none",
42
+ transitionProperty: "background-color, color",
43
+ transitionDuration: l.motion.duration.fast,
44
+ transitionTimingFunction: l.motion.easeStandard,
45
+ "&::-webkit-details-marker": { display: "none" },
46
+ "&::after": { ...n },
47
+ "&:hover": {
48
+ backgroundColor: l.color.surfaceHover,
49
+ color: l.color.text
50
+ },
51
+ "&:focus-visible": { ...r },
52
+ [i]: {
53
+ transitionDuration: "0s",
54
+ "&::after": { transitionDuration: "0s" }
55
+ }
56
+ }), y = e({
57
+ display: "grid",
58
+ gap: l.space[1],
59
+ margin: 0,
60
+ padding: 0,
61
+ listStyle: "none"
62
+ }), b = e({
63
+ display: "flex",
64
+ alignItems: "center",
65
+ gap: l.space[2],
66
+ minBlockSize: p,
67
+ paddingInline: l.space[3],
68
+ borderRadius: l.radius.sm,
69
+ fontSize: l.textSize.sm,
70
+ lineHeight: l.lineHeight.tight,
71
+ color: l.color.textMuted,
72
+ textDecoration: "none",
73
+ transitionProperty: "background-color, color",
74
+ transitionDuration: l.motion.duration.fast,
75
+ transitionTimingFunction: l.motion.easeStandard,
76
+ "&:hover:not([aria-current=\"page\"])": {
77
+ backgroundColor: l.color.surfaceHover,
78
+ color: l.color.text
79
+ },
80
+ "&[aria-current=\"page\"]": {
81
+ backgroundColor: l.color.accentSoft,
82
+ color: l.color.accentText,
83
+ fontWeight: l.fontWeight.medium
84
+ },
85
+ "&[aria-disabled=\"true\"]": {
86
+ opacity: .55,
87
+ pointerEvents: "none"
88
+ },
89
+ "&:focus-visible": { ...r },
90
+ [i]: { transitionDuration: "0s" },
91
+ [a]: { "&[aria-current=\"page\"]": {
92
+ forcedColorAdjust: "none",
93
+ backgroundColor: "SelectedItem",
94
+ color: "SelectedItemText"
95
+ } }
96
+ });
97
+ function x({ ref: e, label: n = "Main", className: r, sx: i, ...a }) {
98
+ return /* @__PURE__ */ d(t, {
99
+ className: r,
100
+ styles: h,
101
+ sx: i,
102
+ children: (t) => /* @__PURE__ */ d("nav", {
103
+ ...a,
104
+ ref: e,
105
+ "aria-label": n,
106
+ "data-ui": "navigation",
107
+ className: t
108
+ })
109
+ });
110
+ }
111
+ x.displayName = "Navigation";
112
+ function S({ ref: e, label: n, collapsible: r = !1, defaultOpen: i, children: a, className: s, sx: l, ...u }) {
113
+ let p = c(), m = o(n);
114
+ if (r && !m) throw Error("Navigation.Group requires a renderable label when collapsible is true.");
115
+ let h = /* @__PURE__ */ d("ul", {
116
+ "aria-labelledby": m ? p : void 0,
117
+ css: y,
118
+ children: a
119
+ });
120
+ return /* @__PURE__ */ d(t, {
121
+ className: s,
122
+ styles: g,
123
+ sx: l,
124
+ children: (t) => r ? /* @__PURE__ */ f("details", {
125
+ ...u,
126
+ ref: e,
127
+ open: i,
128
+ "data-ui": "navigation-group",
129
+ className: t,
130
+ children: [/* @__PURE__ */ d("summary", {
131
+ id: p,
132
+ "data-ui": "navigation-group-summary",
133
+ css: [_, v],
134
+ children: n
135
+ }), h]
136
+ }) : /* @__PURE__ */ f("section", {
137
+ ...u,
138
+ ref: e,
139
+ "data-ui": "navigation-group",
140
+ className: t,
141
+ children: [m && /* @__PURE__ */ d("h2", {
142
+ id: p,
143
+ "data-ui": "navigation-group-label",
144
+ css: _,
145
+ children: n
146
+ }), h]
147
+ })
148
+ });
149
+ }
150
+ S.displayName = "Navigation.Group";
151
+ function C({ ref: e, href: n, active: r = !1, disabled: i = !1, icon: a, children: c, className: l, sx: p, ...m }) {
152
+ let h = /* @__PURE__ */ f(u, { children: [o(a) && /* @__PURE__ */ d("span", {
153
+ "aria-hidden": "true",
154
+ "data-ui": "navigation-item-icon",
155
+ css: s,
156
+ children: a
157
+ }), c] }), g = {
158
+ "aria-current": r ? "page" : void 0,
159
+ "aria-disabled": i || void 0,
160
+ tabIndex: i ? -1 : m.tabIndex,
161
+ onClick: i ? (e) => {
162
+ e.preventDefault();
163
+ } : m.onClick
164
+ };
165
+ return /* @__PURE__ */ d("li", {
166
+ "data-ui": "navigation-list-item",
167
+ children: /* @__PURE__ */ d(t, {
168
+ className: l,
169
+ styles: b,
170
+ sx: p,
171
+ children: (t) => n === void 0 ? /* @__PURE__ */ d("span", {
172
+ ...m,
173
+ ...g,
174
+ ref: e,
175
+ "data-ui": "navigation-item",
176
+ className: t,
177
+ children: h
178
+ }) : /* @__PURE__ */ d("a", {
179
+ ...m,
180
+ ...g,
181
+ ref: e,
182
+ href: i ? void 0 : n,
183
+ role: i ? "link" : void 0,
184
+ "data-ui": "navigation-item",
185
+ className: t,
186
+ children: h
187
+ })
188
+ })
189
+ });
190
+ }
191
+ C.displayName = "Navigation.Item";
192
+ var w = Object.assign(x, {
193
+ Group: S,
194
+ Item: C
195
+ });
196
+ //#endregion
197
+ export { w as t };
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- export { t as Navigation } from "./navigation-BDht6S2-.js";
2
+ export { t as Navigation } from "./navigation-DhnKriOp.js";
@@ -0,0 +1,156 @@
1
+ 'use client';
2
+ import { r as e, t } from "./sx-Dx9JUKp5.js";
3
+ import { n } from "./focus-ring-BK5W5_NY.js";
4
+ import { n as r } from "./media-D_eA_I-e.js";
5
+ import { t as i } from "./visually-hidden-BJdvqqvn.js";
6
+ import { useImperativeHandle as a, useLayoutEffect as o, useMemo as s, useRef as c } from "react";
7
+ import { vars as l } from "@jfrader/tokens/vars";
8
+ import { jsx as u, jsxs as d } from "@emotion/react/jsx-runtime";
9
+ //#region src/components/pagination/pagination.tsx
10
+ var f = 50, p = 105, m = (e) => Math.max(0, Math.floor(Number.isFinite(e) ? e : 0)), h = (e, t) => Array.from({ length: Math.min(p, Math.max(0, t - e + 1)) }, (t, n) => e + n);
11
+ function g(e, t, n) {
12
+ let r = n * 2 + 5;
13
+ if (t <= r) return h(1, t);
14
+ let i = Math.max(e - n, 1), a = Math.min(e + n, t), o = i > 3, s = a < t - 2, c = r - 2;
15
+ return o ? s ? [
16
+ 1,
17
+ "start-ellipsis",
18
+ ...h(i, a),
19
+ "end-ellipsis",
20
+ t
21
+ ] : [
22
+ 1,
23
+ "start-ellipsis",
24
+ ...h(t - c + 1, t)
25
+ ] : [
26
+ ...h(1, c),
27
+ "end-ellipsis",
28
+ t
29
+ ];
30
+ }
31
+ var _ = e({
32
+ display: "flex",
33
+ flexWrap: "wrap",
34
+ alignItems: "center",
35
+ gap: l.space[1],
36
+ margin: 0,
37
+ padding: 0,
38
+ listStyle: "none",
39
+ fontFamily: l.font.sans,
40
+ fontSize: l.textSize.sm,
41
+ lineHeight: l.lineHeight.tight
42
+ }), v = e({
43
+ display: "inline-flex",
44
+ alignItems: "center",
45
+ justifyContent: "center",
46
+ minInlineSize: "32px",
47
+ blockSize: "32px"
48
+ }), y = e({
49
+ position: "relative",
50
+ appearance: "none",
51
+ paddingInline: l.space[2],
52
+ border: "1px solid transparent",
53
+ borderRadius: l.radius.md,
54
+ background: "transparent",
55
+ color: l.color.text,
56
+ font: "inherit",
57
+ fontVariantNumeric: "tabular-nums",
58
+ cursor: "pointer",
59
+ transitionProperty: "background-color, border-color, color",
60
+ transitionDuration: l.motion.duration.fast,
61
+ transitionTimingFunction: l.motion.easeStandard,
62
+ "&:hover:not(:disabled):not([aria-current=\"page\"])": { backgroundColor: l.color.surfaceHover },
63
+ "&[aria-current=\"page\"]": {
64
+ backgroundColor: l.color.accentSoft,
65
+ borderColor: l.color.accentBorder,
66
+ color: l.color.accentText,
67
+ fontWeight: l.fontWeight.semibold
68
+ },
69
+ "&:disabled": {
70
+ cursor: "not-allowed",
71
+ opacity: .55
72
+ },
73
+ "&:focus-visible": { ...n },
74
+ [r]: { transitionDuration: "0s" }
75
+ }), b = e({ color: l.color.textMuted }), x = e({
76
+ display: "inline-block",
77
+ "&:dir(rtl)": { transform: "scaleX(-1)" }
78
+ });
79
+ function S({ ref: e, page: n, totalPages: r, onPageChange: l, siblingCount: p = 1, label: h = "Pagination", previousLabel: S = "Previous page", nextLabel: C = "Next page", locale: w = typeof navigator > "u" ? void 0 : navigator.language, className: T, sx: E, ...D }) {
80
+ let O = m(r), k = Math.min(Math.max(m(n), 1), Math.max(O, 1)), A = g(k, O, Math.min(m(p), f)), j = s(() => new Intl.NumberFormat(w), [w]), M = c(null);
81
+ a(e, () => M.current, []);
82
+ let N = c(!1);
83
+ o(() => {
84
+ let e = M.current;
85
+ if (!N.current || !e) return;
86
+ N.current = !1;
87
+ let t = e.ownerDocument.activeElement;
88
+ (t === e.ownerDocument.body || t && e.contains(t) && t.matches(":disabled")) && e.querySelector("[aria-current=\"page\"]")?.focus();
89
+ }, [k]);
90
+ let P = (e, t = !1) => {
91
+ N.current = t && (e <= 1 || e >= O), e !== k && l?.(e);
92
+ };
93
+ return /* @__PURE__ */ u(t, {
94
+ className: T,
95
+ sx: E,
96
+ children: (e) => /* @__PURE__ */ u("nav", {
97
+ ...D,
98
+ ref: M,
99
+ "aria-label": h,
100
+ "data-ui": "pagination",
101
+ className: e,
102
+ children: /* @__PURE__ */ d("ul", {
103
+ css: _,
104
+ children: [
105
+ /* @__PURE__ */ u("li", { children: /* @__PURE__ */ d("button", {
106
+ type: "button",
107
+ disabled: k <= 1,
108
+ onClick: () => P(k - 1, !0),
109
+ "data-ui": "pagination-previous",
110
+ css: [v, y],
111
+ children: [/* @__PURE__ */ u("span", {
112
+ "aria-hidden": "true",
113
+ css: x,
114
+ children: "‹"
115
+ }), /* @__PURE__ */ u("span", {
116
+ css: i,
117
+ children: S
118
+ })]
119
+ }) }),
120
+ A.map((e) => typeof e == "number" ? /* @__PURE__ */ u("li", { children: /* @__PURE__ */ u("button", {
121
+ type: "button",
122
+ "aria-current": e === k ? "page" : void 0,
123
+ "aria-label": j.format(e),
124
+ onClick: () => P(e),
125
+ "data-ui": "pagination-page",
126
+ css: [v, y],
127
+ children: j.format(e)
128
+ }) }, e) : /* @__PURE__ */ u("li", { children: /* @__PURE__ */ u("span", {
129
+ "aria-hidden": "true",
130
+ "data-ui": "pagination-ellipsis",
131
+ css: [v, b],
132
+ children: "…"
133
+ }) }, e)),
134
+ /* @__PURE__ */ u("li", { children: /* @__PURE__ */ d("button", {
135
+ type: "button",
136
+ disabled: k >= O,
137
+ onClick: () => P(k + 1, !0),
138
+ "data-ui": "pagination-next",
139
+ css: [v, y],
140
+ children: [/* @__PURE__ */ u("span", {
141
+ "aria-hidden": "true",
142
+ css: x,
143
+ children: "›"
144
+ }), /* @__PURE__ */ u("span", {
145
+ css: i,
146
+ children: C
147
+ })]
148
+ }) })
149
+ ]
150
+ })
151
+ })
152
+ });
153
+ }
154
+ S.displayName = "Pagination";
155
+ //#endregion
156
+ export { S as t };
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- export { t as Pagination } from "./pagination-B50PCaDU.js";
2
+ export { t as Pagination } from "./pagination-DYdwsxwe.js";
@@ -0,0 +1,56 @@
1
+ 'use client';
2
+ import { r as e, t } from "./sx-Dx9JUKp5.js";
3
+ import { vars as n } from "@jfrader/tokens/vars";
4
+ import { jsx as r } from "@emotion/react/jsx-runtime";
5
+ //#region src/components/pill/pill.tsx
6
+ var i = e({
7
+ display: "inline-flex",
8
+ alignItems: "center",
9
+ boxSizing: "border-box",
10
+ blockSize: n.space[5],
11
+ paddingInline: n.space[2],
12
+ borderRadius: n.radius.full,
13
+ fontSize: n.textSize.xs,
14
+ fontWeight: n.fontWeight.medium,
15
+ lineHeight: 1,
16
+ whiteSpace: "nowrap",
17
+ verticalAlign: "middle"
18
+ }), a = {
19
+ neutral: e({
20
+ backgroundColor: n.color.surfaceHover,
21
+ color: n.color.textMuted
22
+ }),
23
+ accent: e({
24
+ backgroundColor: n.color.accentSoft,
25
+ color: n.color.accentText
26
+ }),
27
+ success: e({
28
+ backgroundColor: n.color.successSoft,
29
+ color: n.color.success
30
+ }),
31
+ warning: e({
32
+ backgroundColor: n.color.warningSoft,
33
+ color: n.color.warning
34
+ }),
35
+ danger: e({
36
+ backgroundColor: n.color.dangerSoft,
37
+ color: n.color.dangerText
38
+ })
39
+ };
40
+ function o({ ref: e, tone: n = "neutral", className: o, sx: s, ...c }) {
41
+ return /* @__PURE__ */ r(t, {
42
+ className: o,
43
+ styles: [i, a[n]],
44
+ sx: s,
45
+ children: (t) => /* @__PURE__ */ r("span", {
46
+ ...c,
47
+ ref: e,
48
+ "data-ui": "pill",
49
+ "data-tone": n,
50
+ className: t
51
+ })
52
+ });
53
+ }
54
+ o.displayName = "Pill";
55
+ //#endregion
56
+ export { o as t };
package/dist/pill.js CHANGED
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- export { t as Pill } from "./pill-2_XzBdkD.js";
2
+ export { t as Pill } from "./pill-DO2gHzMb.js";