@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,105 +0,0 @@
1
- 'use client';
2
- import { t as e } from "./css-Cgj6sCHn.js";
3
- import { n as t } from "./media-D_eA_I-e.js";
4
- import { t as n } from "./renderable-DzcIj1Lo.js";
5
- import { useId as r } from "react";
6
- import { vars as i } from "@jfrader/tokens/vars";
7
- import { jsx as a, jsxs as o } from "@emotion/react/jsx-runtime";
8
- //#region src/styling/input-control.ts
9
- var s = e({
10
- display: "block",
11
- inlineSize: "100%",
12
- boxSizing: "border-box",
13
- margin: 0,
14
- backgroundColor: i.color.surfaceRaised,
15
- border: `1px solid ${i.color.borderControl}`,
16
- borderRadius: i.radius.md,
17
- color: i.color.text,
18
- fontFamily: i.font.sans,
19
- transitionProperty: "border-color",
20
- transitionDuration: i.motion.duration.fast,
21
- transitionTimingFunction: i.motion.easeStandard,
22
- "&::placeholder": { color: i.color.textSubtle },
23
- "&:hover:not(:disabled):not(:focus-visible)": { borderColor: i.color.textSubtle },
24
- "&:focus-visible": {
25
- outline: `2px solid ${i.color.focusRing}`,
26
- outlineOffset: "2px",
27
- borderColor: i.color.focusRing
28
- },
29
- "&:disabled": {
30
- opacity: .55,
31
- cursor: "not-allowed"
32
- },
33
- "&[aria-invalid=\"true\"]:not(:focus-visible)": { borderColor: i.color.dangerBorder },
34
- [t]: { transitionDuration: "0s" }
35
- }), c = e({
36
- display: "grid",
37
- gap: i.space[1],
38
- inlineSize: "100%"
39
- }), l = e({
40
- display: "inline-flex",
41
- gap: i.space[1],
42
- fontSize: i.textSize.sm,
43
- fontWeight: i.fontWeight.medium,
44
- color: i.color.text
45
- }), u = e({ color: i.color.dangerText }), d = e({
46
- fontSize: i.textSize.sm,
47
- color: i.color.textMuted
48
- }), f = e({
49
- fontSize: i.textSize.sm,
50
- color: i.color.dangerText
51
- });
52
- function p({ id: e, description: t, error: i, "aria-describedby": a, "aria-invalid": o }) {
53
- let s = r(), c = e ?? s, l = `${c}-description`, u = `${c}-error`, d = n(t), f = n(i);
54
- return {
55
- id: c,
56
- descriptionId: l,
57
- errorId: u,
58
- describedBy: [
59
- a,
60
- d && l,
61
- f && u
62
- ].filter(Boolean).join(" ") || void 0,
63
- ariaInvalid: f ? !0 : o
64
- };
65
- }
66
- function m({ "data-ui": e, className: t, part: n, children: r }) {
67
- let i = [t, n?.className].filter(Boolean).join(" ") || void 0;
68
- return /* @__PURE__ */ a("div", {
69
- "data-ui": e,
70
- className: i,
71
- css: [c, n?.css],
72
- children: r
73
- });
74
- }
75
- function h({ htmlFor: e, required: t, part: r, children: i }) {
76
- return n(i) ? /* @__PURE__ */ o("label", {
77
- htmlFor: e,
78
- className: r?.className,
79
- css: [l, r?.css],
80
- children: [i, t && /* @__PURE__ */ a("span", {
81
- "aria-hidden": !0,
82
- css: u,
83
- children: " *"
84
- })]
85
- }) : null;
86
- }
87
- function g({ id: e, part: t, children: r }) {
88
- return n(r) ? /* @__PURE__ */ a("span", {
89
- id: e,
90
- className: t?.className,
91
- css: [d, t?.css],
92
- children: r
93
- }) : null;
94
- }
95
- function _({ id: e, part: t, children: r }) {
96
- return n(r) ? /* @__PURE__ */ a("span", {
97
- id: e,
98
- role: "alert",
99
- className: t?.className,
100
- css: [f, t?.css],
101
- children: r
102
- }) : null;
103
- }
104
- //#endregion
105
- export { p as a, m as i, _ as n, s as o, h as r, g as t };
@@ -1,22 +0,0 @@
1
- 'use client';
2
- import { t as e } from "./layout-style-7ZTOiWGR.js";
3
- import { forwardRef as t } from "react";
4
- import { jsx as n } from "@emotion/react/jsx-runtime";
5
- //#region src/components/flex/flex.tsx
6
- var r = t(function({ direction: t, wrap: r, inline: i, align: a, justify: o, gap: s, ...c }, l) {
7
- return /* @__PURE__ */ n("div", {
8
- ...c,
9
- ref: l,
10
- "data-ui": "flex",
11
- css: e({
12
- direction: t,
13
- wrap: r,
14
- inline: i,
15
- align: a,
16
- justify: o,
17
- gap: s
18
- })
19
- });
20
- });
21
- //#endregion
22
- export { r as t };
@@ -1,187 +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 { n } from "./media-D_eA_I-e.js";
5
- import { t as r } from "./use-controlled-state-CVXDa-qM.js";
6
- import { f as i, i as a, n as o, o as s } from "./collection-registry-1l9f3XJZ.js";
7
- import { t as c } from "./trigger-style-B1GFmH7M.js";
8
- import { t as l } from "./use-overlay-floating-efeqppiw.js";
9
- import { createContext as u, forwardRef as d, useContext as f, useEffect as p, useMemo as m, useRef as h, useState as g } from "react";
10
- import { vars as _ } from "@jfrader/tokens/vars";
11
- import { jsx as v } from "@emotion/react/jsx-runtime";
12
- import { FloatingFocusManager as y, FloatingList as b, FloatingPortal 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 = u(null), j = u(!1);
15
- function M(e) {
16
- let t = f(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 (!f(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: _.radius.sm,
34
- backgroundColor: "transparent",
35
- paddingBlock: _.space[1],
36
- paddingInline: _.space[2],
37
- font: "inherit",
38
- fontSize: _.textSize.sm,
39
- color: _.color.text,
40
- textAlign: "start",
41
- cursor: "pointer",
42
- transitionProperty: "background-color",
43
- transitionDuration: _.motion.duration.fast,
44
- transitionTimingFunction: _.motion.easeStandard,
45
- "&:focus-visible": { ...t },
46
- [n]: { transitionDuration: "0s" }
47
- }), F = e({
48
- blockSize: "1px",
49
- marginBlock: _.space[1],
50
- backgroundColor: _.color.border
51
- });
52
- function I({ open: e, defaultOpen: t = !1, onOpenChange: n, placement: i = "bottom-start", children: a }) {
53
- let [o = !1, s] = r(e, t, n), [c, u] = g(null), d = h([]), f = h([]), _ = h(/* @__PURE__ */ new Set()), y = h(!1), { refs: b, floatingStyles: x, context: E } = l({
54
- open: o,
55
- placement: i,
56
- onOpenChange: (e, t, n) => {
57
- e || (y.current = n === "escape-key"), s(e);
58
- }
59
- });
60
- p(() => {
61
- !o && y.current && (y.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: d,
68
- activeIndex: c,
69
- onNavigate: u,
70
- loop: !0,
71
- orientation: "vertical",
72
- disabledIndices: (e) => _.current.has(e),
73
- focusItemOnOpen: !0
74
- }), F = O(E, {
75
- listRef: f,
76
- activeIndex: c,
77
- onMatch: o ? u : 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 = m(() => ({
86
- open: o,
87
- requestClose: (e = !1) => {
88
- e && (y.current = !0), s(!1);
89
- },
90
- activeIndex: c,
91
- refs: b,
92
- floatingContext: E,
93
- floatingStyles: x,
94
- elementsRef: d,
95
- labelsRef: f,
96
- disabledIndices: _.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__ */ v(A.Provider, {
112
- value: z,
113
- children: a
114
- });
115
- }
116
- var L = d(function(e, t) {
117
- let { refs: n, getReferenceProps: r } = M("Trigger"), i = E([n.setReference, t]);
118
- return /* @__PURE__ */ v("button", {
119
- type: "button",
120
- ...r(e),
121
- ref: i,
122
- "data-ui": "menu-trigger",
123
- css: c
124
- });
125
- }), R = d(function({ style: e, children: t, ...n }, r) {
126
- let { open: a, refs: o, floatingContext: s, floatingStyles: c, elementsRef: l, labelsRef: u, getFloatingProps: d } = M("Content"), f = E([o.setFloating, r]);
127
- return a ? /* @__PURE__ */ v(x, { children: /* @__PURE__ */ v(y, {
128
- context: s,
129
- modal: !1,
130
- initialFocus: -1,
131
- returnFocus: !1,
132
- restoreFocus: !0,
133
- children: /* @__PURE__ */ v("div", {
134
- ...d(n),
135
- ref: f,
136
- "data-ui": "menu",
137
- style: {
138
- ...e,
139
- ...c
140
- },
141
- css: i,
142
- children: /* @__PURE__ */ v(b, {
143
- elementsRef: l,
144
- labelsRef: u,
145
- children: /* @__PURE__ */ v(j.Provider, {
146
- value: !0,
147
- children: t
148
- })
149
- })
150
- })
151
- }) }) : null;
152
- }), z = d(function({ onSelect: e, disabled: t = !1, onClick: n, ...r }, i) {
153
- let { activeIndex: c, requestClose: l, disabledIndices: u, getItemProps: d } = N(), { ref: f, index: p } = a({ label: t ? null : void 0 }), m = E([f, i]), h = p !== -1 && c === p;
154
- o(p, t, u);
155
- let g = (r) => {
156
- t || (n?.(r), e?.(), r.defaultPrevented || l(!0));
157
- };
158
- return /* @__PURE__ */ v("button", {
159
- type: "button",
160
- ...d({
161
- ...r,
162
- onClick: g
163
- }),
164
- ref: m,
165
- role: "menuitem",
166
- tabIndex: h ? 0 : -1,
167
- "aria-disabled": t || void 0,
168
- "data-active": h || void 0,
169
- "data-ui": "menu-item",
170
- css: [P, s]
171
- });
172
- }), B = d(function(e, t) {
173
- return /* @__PURE__ */ v("div", {
174
- ...e,
175
- ref: t,
176
- role: "separator",
177
- "data-ui": "menu-separator",
178
- css: F
179
- });
180
- }), V = Object.assign(I, {
181
- Trigger: L,
182
- Content: R,
183
- Item: z,
184
- Separator: B
185
- });
186
- //#endregion
187
- export { V as t };
@@ -1,175 +0,0 @@
1
- 'use client';
2
- import { t as e } from "./css-Cgj6sCHn.js";
3
- import { t } from "./disclosure-caret-C5T3fcl6.js";
4
- import { t as n } from "./focus-ring-BK5W5_NY.js";
5
- import { n as r, t as i } from "./media-D_eA_I-e.js";
6
- import { t as a } from "./renderable-DzcIj1Lo.js";
7
- import { t as o } from "./icon-wrapper-CFWzew5m.js";
8
- import { forwardRef as s, 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": { ...t },
47
- "&:hover": {
48
- backgroundColor: l.color.surfaceHover,
49
- color: l.color.text
50
- },
51
- "&:focus-visible": { ...n },
52
- [r]: {
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": { ...n },
90
- [r]: { transitionDuration: "0s" },
91
- [i]: { "&[aria-current=\"page\"]": {
92
- forcedColorAdjust: "none",
93
- backgroundColor: "SelectedItem",
94
- color: "SelectedItemText"
95
- } }
96
- }), x = s(function({ label: e = "Main", ...t }, n) {
97
- return /* @__PURE__ */ d("nav", {
98
- ...t,
99
- ref: n,
100
- "aria-label": e,
101
- "data-ui": "navigation",
102
- css: h
103
- });
104
- }), S = s(function({ label: e, collapsible: t = !1, defaultOpen: n, children: r, ...i }, o) {
105
- let s = c(), l = a(e);
106
- if (t && !l) throw Error("Navigation.Group requires a renderable label when collapsible is true.");
107
- let u = /* @__PURE__ */ d("ul", {
108
- "aria-labelledby": l ? s : void 0,
109
- css: y,
110
- children: r
111
- });
112
- return t ? /* @__PURE__ */ f("details", {
113
- ...i,
114
- ref: o,
115
- open: n,
116
- "data-ui": "navigation-group",
117
- css: g,
118
- children: [/* @__PURE__ */ d("summary", {
119
- id: s,
120
- "data-ui": "navigation-group-summary",
121
- css: [_, v],
122
- children: e
123
- }), u]
124
- }) : /* @__PURE__ */ f("section", {
125
- ...i,
126
- ref: o,
127
- "data-ui": "navigation-group",
128
- css: g,
129
- children: [l && /* @__PURE__ */ d("h2", {
130
- id: s,
131
- "data-ui": "navigation-group-label",
132
- css: _,
133
- children: e
134
- }), u]
135
- });
136
- }), C = s(function({ href: e, active: t = !1, disabled: n = !1, icon: r, children: i, ...s }, c) {
137
- let l = /* @__PURE__ */ f(u, { children: [a(r) && /* @__PURE__ */ d("span", {
138
- "aria-hidden": "true",
139
- "data-ui": "navigation-item-icon",
140
- css: o,
141
- children: r
142
- }), i] }), p = {
143
- "aria-current": t ? "page" : void 0,
144
- "aria-disabled": n || void 0,
145
- tabIndex: n ? -1 : s.tabIndex,
146
- onClick: n ? (e) => {
147
- e.preventDefault();
148
- } : s.onClick
149
- };
150
- return /* @__PURE__ */ d("li", {
151
- "data-ui": "navigation-list-item",
152
- children: e === void 0 ? /* @__PURE__ */ d("span", {
153
- ...s,
154
- ...p,
155
- ref: c,
156
- "data-ui": "navigation-item",
157
- css: b,
158
- children: l
159
- }) : /* @__PURE__ */ d("a", {
160
- ...s,
161
- ...p,
162
- ref: c,
163
- href: n ? void 0 : e,
164
- role: n ? "link" : void 0,
165
- "data-ui": "navigation-item",
166
- css: b,
167
- children: l
168
- })
169
- });
170
- }), w = Object.assign(x, {
171
- Group: S,
172
- Item: C
173
- });
174
- //#endregion
175
- export { w as t };
@@ -1,149 +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 "./visually-hidden-DCWhf0Cb.js";
6
- import { forwardRef as i, 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": { ...t },
74
- [n]: { transitionDuration: "0s" }
75
- }), b = e({ color: l.color.textMuted }), x = e({
76
- display: "inline-block",
77
- "&:dir(rtl)": { transform: "scaleX(-1)" }
78
- }), S = i(function({ page: e, totalPages: t, onPageChange: n, siblingCount: i = 1, label: l = "Pagination", previousLabel: p = "Previous page", nextLabel: h = "Next page", locale: S = typeof navigator > "u" ? void 0 : navigator.language, ...C }, w) {
79
- let T = m(t), E = Math.min(Math.max(m(e), 1), Math.max(T, 1)), D = g(E, T, Math.min(m(i), f)), O = s(() => new Intl.NumberFormat(S), [S]), k = c(null);
80
- a(w, () => k.current, []);
81
- let A = c(!1);
82
- o(() => {
83
- let e = k.current;
84
- if (!A.current || !e) return;
85
- A.current = !1;
86
- let t = e.ownerDocument.activeElement;
87
- (t === e.ownerDocument.body || t && e.contains(t) && t.matches(":disabled")) && e.querySelector("[aria-current=\"page\"]")?.focus();
88
- }, [E]);
89
- let j = (e, t = !1) => {
90
- A.current = t && (e <= 1 || e >= T), e !== E && n?.(e);
91
- };
92
- return /* @__PURE__ */ u("nav", {
93
- ...C,
94
- ref: k,
95
- "aria-label": l,
96
- "data-ui": "pagination",
97
- children: /* @__PURE__ */ d("ul", {
98
- css: _,
99
- children: [
100
- /* @__PURE__ */ u("li", { children: /* @__PURE__ */ d("button", {
101
- type: "button",
102
- disabled: E <= 1,
103
- onClick: () => j(E - 1, !0),
104
- "data-ui": "pagination-previous",
105
- css: [v, y],
106
- children: [/* @__PURE__ */ u("span", {
107
- "aria-hidden": "true",
108
- css: x,
109
- children: "‹"
110
- }), /* @__PURE__ */ u("span", {
111
- css: r,
112
- children: p
113
- })]
114
- }) }),
115
- D.map((e) => typeof e == "number" ? /* @__PURE__ */ u("li", { children: /* @__PURE__ */ u("button", {
116
- type: "button",
117
- "aria-current": e === E ? "page" : void 0,
118
- "aria-label": O.format(e),
119
- onClick: () => j(e),
120
- "data-ui": "pagination-page",
121
- css: [v, y],
122
- children: O.format(e)
123
- }) }, e) : /* @__PURE__ */ u("li", { children: /* @__PURE__ */ u("span", {
124
- "aria-hidden": "true",
125
- "data-ui": "pagination-ellipsis",
126
- css: [v, b],
127
- children: "…"
128
- }) }, e)),
129
- /* @__PURE__ */ u("li", { children: /* @__PURE__ */ d("button", {
130
- type: "button",
131
- disabled: E >= T,
132
- onClick: () => j(E + 1, !0),
133
- "data-ui": "pagination-next",
134
- css: [v, y],
135
- children: [/* @__PURE__ */ u("span", {
136
- "aria-hidden": "true",
137
- css: x,
138
- children: "›"
139
- }), /* @__PURE__ */ u("span", {
140
- css: r,
141
- children: h
142
- })]
143
- }) })
144
- ]
145
- })
146
- });
147
- });
148
- //#endregion
149
- export { S as t };