@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,186 +0,0 @@
1
- import { t as e } from "./css-CW_HG55W.js";
2
- import { 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 { f as i, i as a, n as o, o as s } from "./collection-registry-C2jnQa7X.js";
6
- import { t as c } from "./trigger-style-f54idgjT.js";
7
- import { t as l } from "./use-overlay-floating-CsZd3qxa.js";
8
- import { createContext as u, forwardRef as d, useContext as f, useEffect as p, useMemo as m, useRef as h, useState as g } from "react";
9
- import { vars as _ } from "@jfrader/tokens/vars";
10
- import { jsx as v } from "@emotion/react/jsx-runtime";
11
- 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";
12
- //#region src/components/menu/menu.tsx
13
- var k = 500, A = u(null), j = u(!1);
14
- function M(e) {
15
- let t = f(A);
16
- if (!t) throw Error(`Menu.${e} must be rendered inside <Menu>.`);
17
- return t;
18
- }
19
- function N() {
20
- let e = M("Item");
21
- if (!f(j)) throw Error("Menu.Item must be rendered inside <Menu.Content>.");
22
- return e;
23
- }
24
- var P = e({
25
- appearance: "none",
26
- boxSizing: "border-box",
27
- display: "flex",
28
- alignItems: "center",
29
- inlineSize: "100%",
30
- minBlockSize: "32px",
31
- border: 0,
32
- borderRadius: _.radius.sm,
33
- backgroundColor: "transparent",
34
- paddingBlock: _.space[1],
35
- paddingInline: _.space[2],
36
- font: "inherit",
37
- fontSize: _.textSize.sm,
38
- color: _.color.text,
39
- textAlign: "start",
40
- cursor: "pointer",
41
- transitionProperty: "background-color",
42
- transitionDuration: _.motion.duration.fast,
43
- transitionTimingFunction: _.motion.easeStandard,
44
- "&:focus-visible": { ...t },
45
- [n]: { transitionDuration: "0s" }
46
- }), F = e({
47
- blockSize: "1px",
48
- marginBlock: _.space[1],
49
- backgroundColor: _.color.border
50
- });
51
- function I({ open: e, defaultOpen: t = !1, onOpenChange: n, placement: i = "bottom-start", children: a }) {
52
- 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({
53
- open: o,
54
- placement: i,
55
- onOpenChange: (e, t, n) => {
56
- e || (y.current = n === "escape-key"), s(e);
57
- }
58
- });
59
- p(() => {
60
- !o && y.current && (y.current = !1, b.domReference.current?.focus());
61
- }, [o, b]);
62
- let j = S(E), M = D(E, { role: "menu" }), N = C(E, {
63
- escapeKey: !0,
64
- outsidePress: !0
65
- }), P = T(E, {
66
- listRef: d,
67
- activeIndex: c,
68
- onNavigate: u,
69
- loop: !0,
70
- orientation: "vertical",
71
- disabledIndices: (e) => _.current.has(e),
72
- focusItemOnOpen: !0
73
- }), F = O(E, {
74
- listRef: f,
75
- activeIndex: c,
76
- onMatch: o ? u : void 0,
77
- resetMs: k
78
- }), { getReferenceProps: I, getFloatingProps: L, getItemProps: R } = w([
79
- j,
80
- M,
81
- N,
82
- P,
83
- F
84
- ]), z = m(() => ({
85
- open: o,
86
- requestClose: (e = !1) => {
87
- e && (y.current = !0), s(!1);
88
- },
89
- activeIndex: c,
90
- refs: b,
91
- floatingContext: E,
92
- floatingStyles: x,
93
- elementsRef: d,
94
- labelsRef: f,
95
- disabledIndices: _.current,
96
- getReferenceProps: I,
97
- getFloatingProps: L,
98
- getItemProps: R
99
- }), [
100
- o,
101
- s,
102
- c,
103
- b,
104
- E,
105
- x,
106
- I,
107
- L,
108
- R
109
- ]);
110
- return /* @__PURE__ */ v(A.Provider, {
111
- value: z,
112
- children: a
113
- });
114
- }
115
- var L = d(function(e, t) {
116
- let { refs: n, getReferenceProps: r } = M("Trigger"), i = E([n.setReference, t]);
117
- return /* @__PURE__ */ v("button", {
118
- type: "button",
119
- ...r(e),
120
- ref: i,
121
- "data-ui": "menu-trigger",
122
- css: c
123
- });
124
- }), R = d(function({ style: e, children: t, ...n }, r) {
125
- let { open: a, refs: o, floatingContext: s, floatingStyles: c, elementsRef: l, labelsRef: u, getFloatingProps: d } = M("Content"), f = E([o.setFloating, r]);
126
- return a ? /* @__PURE__ */ v(x, { children: /* @__PURE__ */ v(y, {
127
- context: s,
128
- modal: !1,
129
- initialFocus: -1,
130
- returnFocus: !1,
131
- restoreFocus: !0,
132
- children: /* @__PURE__ */ v("div", {
133
- ...d(n),
134
- ref: f,
135
- "data-ui": "menu",
136
- style: {
137
- ...e,
138
- ...c
139
- },
140
- css: i,
141
- children: /* @__PURE__ */ v(b, {
142
- elementsRef: l,
143
- labelsRef: u,
144
- children: /* @__PURE__ */ v(j.Provider, {
145
- value: !0,
146
- children: t
147
- })
148
- })
149
- })
150
- }) }) : null;
151
- }), z = d(function({ onSelect: e, disabled: t = !1, onClick: n, ...r }, i) {
152
- 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;
153
- o(p, t, u);
154
- let g = (r) => {
155
- t || (n?.(r), e?.(), r.defaultPrevented || l(!0));
156
- };
157
- return /* @__PURE__ */ v("button", {
158
- type: "button",
159
- ...d({
160
- ...r,
161
- onClick: g
162
- }),
163
- ref: m,
164
- role: "menuitem",
165
- tabIndex: h ? 0 : -1,
166
- "aria-disabled": t || void 0,
167
- "data-active": h || void 0,
168
- "data-ui": "menu-item",
169
- css: [P, s]
170
- });
171
- }), B = d(function(e, t) {
172
- return /* @__PURE__ */ v("div", {
173
- ...e,
174
- ref: t,
175
- role: "separator",
176
- "data-ui": "menu-separator",
177
- css: F
178
- });
179
- }), V = Object.assign(I, {
180
- Trigger: L,
181
- Content: R,
182
- Item: z,
183
- Separator: B
184
- });
185
- //#endregion
186
- export { V as t };
@@ -1,174 +0,0 @@
1
- import { t as e } from "./css-CW_HG55W.js";
2
- import { t } from "./disclosure-caret-BC6P8AsM.js";
3
- import { t as n } from "./focus-ring-qOS3rPlM.js";
4
- import { n as r, t as i } from "./media-8K3xDAxM.js";
5
- import { t as a } from "./renderable-DwPvt1I8.js";
6
- import { t as o } from "./icon-wrapper-BKo4FI-O.js";
7
- import { forwardRef as s, useId as c } from "react";
8
- import { vars as l } from "@jfrader/tokens/vars";
9
- import { Fragment as u, jsx as d, jsxs as f } from "@emotion/react/jsx-runtime";
10
- //#region src/components/navigation/navigation.tsx
11
- var p = l.space[8], m = "0.06em", h = e({
12
- display: "grid",
13
- gap: l.space[4],
14
- fontFamily: l.font.sans
15
- }), g = e({
16
- display: "grid",
17
- gap: l.space[1],
18
- "&[open] > summary::after": { transform: "rotate(90deg)" },
19
- "&[open]:dir(rtl) > summary::after": { transform: "rotate(-90deg)" }
20
- }), _ = e({
21
- margin: 0,
22
- paddingBlock: l.space[1],
23
- paddingInline: l.space[3],
24
- fontSize: l.textSize.xs,
25
- fontWeight: l.fontWeight.medium,
26
- lineHeight: l.lineHeight.tight,
27
- letterSpacing: m,
28
- textTransform: "uppercase",
29
- color: l.color.textMuted
30
- }), v = e({
31
- display: "flex",
32
- alignItems: "center",
33
- justifyContent: "space-between",
34
- gap: l.space[2],
35
- inlineSize: "100%",
36
- boxSizing: "border-box",
37
- minBlockSize: p,
38
- borderRadius: l.radius.sm,
39
- cursor: "pointer",
40
- listStyle: "none",
41
- transitionProperty: "background-color, color",
42
- transitionDuration: l.motion.duration.fast,
43
- transitionTimingFunction: l.motion.easeStandard,
44
- "&::-webkit-details-marker": { display: "none" },
45
- "&::after": { ...t },
46
- "&:hover": {
47
- backgroundColor: l.color.surfaceHover,
48
- color: l.color.text
49
- },
50
- "&:focus-visible": { ...n },
51
- [r]: {
52
- transitionDuration: "0s",
53
- "&::after": { transitionDuration: "0s" }
54
- }
55
- }), y = e({
56
- display: "grid",
57
- gap: l.space[1],
58
- margin: 0,
59
- padding: 0,
60
- listStyle: "none"
61
- }), b = e({
62
- display: "flex",
63
- alignItems: "center",
64
- gap: l.space[2],
65
- minBlockSize: p,
66
- paddingInline: l.space[3],
67
- borderRadius: l.radius.sm,
68
- fontSize: l.textSize.sm,
69
- lineHeight: l.lineHeight.tight,
70
- color: l.color.textMuted,
71
- textDecoration: "none",
72
- transitionProperty: "background-color, color",
73
- transitionDuration: l.motion.duration.fast,
74
- transitionTimingFunction: l.motion.easeStandard,
75
- "&:hover:not([aria-current=\"page\"])": {
76
- backgroundColor: l.color.surfaceHover,
77
- color: l.color.text
78
- },
79
- "&[aria-current=\"page\"]": {
80
- backgroundColor: l.color.accentSoft,
81
- color: l.color.accentText,
82
- fontWeight: l.fontWeight.medium
83
- },
84
- "&[aria-disabled=\"true\"]": {
85
- opacity: .55,
86
- pointerEvents: "none"
87
- },
88
- "&:focus-visible": { ...n },
89
- [r]: { transitionDuration: "0s" },
90
- [i]: { "&[aria-current=\"page\"]": {
91
- forcedColorAdjust: "none",
92
- backgroundColor: "SelectedItem",
93
- color: "SelectedItemText"
94
- } }
95
- }), x = s(function({ label: e = "Main", ...t }, n) {
96
- return /* @__PURE__ */ d("nav", {
97
- ...t,
98
- ref: n,
99
- "aria-label": e,
100
- "data-ui": "navigation",
101
- css: h
102
- });
103
- }), S = s(function({ label: e, collapsible: t = !1, defaultOpen: n, children: r, ...i }, o) {
104
- let s = c(), l = a(e);
105
- if (t && !l) throw Error("Navigation.Group requires a renderable label when collapsible is true.");
106
- let u = /* @__PURE__ */ d("ul", {
107
- "aria-labelledby": l ? s : void 0,
108
- css: y,
109
- children: r
110
- });
111
- return t ? /* @__PURE__ */ f("details", {
112
- ...i,
113
- ref: o,
114
- open: n,
115
- "data-ui": "navigation-group",
116
- css: g,
117
- children: [/* @__PURE__ */ d("summary", {
118
- id: s,
119
- "data-ui": "navigation-group-summary",
120
- css: [_, v],
121
- children: e
122
- }), u]
123
- }) : /* @__PURE__ */ f("section", {
124
- ...i,
125
- ref: o,
126
- "data-ui": "navigation-group",
127
- css: g,
128
- children: [l && /* @__PURE__ */ d("h2", {
129
- id: s,
130
- "data-ui": "navigation-group-label",
131
- css: _,
132
- children: e
133
- }), u]
134
- });
135
- }), C = s(function({ href: e, active: t = !1, disabled: n = !1, icon: r, children: i, ...s }, c) {
136
- let l = /* @__PURE__ */ f(u, { children: [a(r) && /* @__PURE__ */ d("span", {
137
- "aria-hidden": "true",
138
- "data-ui": "navigation-item-icon",
139
- css: o,
140
- children: r
141
- }), i] }), p = {
142
- "aria-current": t ? "page" : void 0,
143
- "aria-disabled": n || void 0,
144
- tabIndex: n ? -1 : s.tabIndex,
145
- onClick: n ? (e) => {
146
- e.preventDefault();
147
- } : s.onClick
148
- };
149
- return /* @__PURE__ */ d("li", {
150
- "data-ui": "navigation-list-item",
151
- children: e === void 0 ? /* @__PURE__ */ d("span", {
152
- ...s,
153
- ...p,
154
- ref: c,
155
- "data-ui": "navigation-item",
156
- css: b,
157
- children: l
158
- }) : /* @__PURE__ */ d("a", {
159
- ...s,
160
- ...p,
161
- ref: c,
162
- href: n ? void 0 : e,
163
- role: n ? "link" : void 0,
164
- "data-ui": "navigation-item",
165
- css: b,
166
- children: l
167
- })
168
- });
169
- }), w = Object.assign(x, {
170
- Group: S,
171
- Item: C
172
- });
173
- //#endregion
174
- export { w as t };
@@ -1,148 +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 "./visually-hidden-BXVyhj0y.js";
5
- import { forwardRef as i, useImperativeHandle as a, useLayoutEffect as o, useMemo as s, useRef as c } from "react";
6
- import { vars as l } from "@jfrader/tokens/vars";
7
- import { jsx as u, jsxs as d } from "@emotion/react/jsx-runtime";
8
- //#region src/components/pagination/pagination.tsx
9
- 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);
10
- function g(e, t, n) {
11
- let r = n * 2 + 5;
12
- if (t <= r) return h(1, t);
13
- let i = Math.max(e - n, 1), a = Math.min(e + n, t), o = i > 3, s = a < t - 2, c = r - 2;
14
- return o ? s ? [
15
- 1,
16
- "start-ellipsis",
17
- ...h(i, a),
18
- "end-ellipsis",
19
- t
20
- ] : [
21
- 1,
22
- "start-ellipsis",
23
- ...h(t - c + 1, t)
24
- ] : [
25
- ...h(1, c),
26
- "end-ellipsis",
27
- t
28
- ];
29
- }
30
- var _ = e({
31
- display: "flex",
32
- flexWrap: "wrap",
33
- alignItems: "center",
34
- gap: l.space[1],
35
- margin: 0,
36
- padding: 0,
37
- listStyle: "none",
38
- fontFamily: l.font.sans,
39
- fontSize: l.textSize.sm,
40
- lineHeight: l.lineHeight.tight
41
- }), v = e({
42
- display: "inline-flex",
43
- alignItems: "center",
44
- justifyContent: "center",
45
- minInlineSize: "32px",
46
- blockSize: "32px"
47
- }), y = e({
48
- position: "relative",
49
- appearance: "none",
50
- paddingInline: l.space[2],
51
- border: "1px solid transparent",
52
- borderRadius: l.radius.md,
53
- background: "transparent",
54
- color: l.color.text,
55
- font: "inherit",
56
- fontVariantNumeric: "tabular-nums",
57
- cursor: "pointer",
58
- transitionProperty: "background-color, border-color, color",
59
- transitionDuration: l.motion.duration.fast,
60
- transitionTimingFunction: l.motion.easeStandard,
61
- "&:hover:not(:disabled):not([aria-current=\"page\"])": { backgroundColor: l.color.surfaceHover },
62
- "&[aria-current=\"page\"]": {
63
- backgroundColor: l.color.accentSoft,
64
- borderColor: l.color.accentBorder,
65
- color: l.color.accentText,
66
- fontWeight: l.fontWeight.semibold
67
- },
68
- "&:disabled": {
69
- cursor: "not-allowed",
70
- opacity: .55
71
- },
72
- "&:focus-visible": { ...t },
73
- [n]: { transitionDuration: "0s" }
74
- }), b = e({ color: l.color.textMuted }), x = e({
75
- display: "inline-block",
76
- "&:dir(rtl)": { transform: "scaleX(-1)" }
77
- }), 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) {
78
- 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);
79
- a(w, () => k.current, []);
80
- let A = c(!1);
81
- o(() => {
82
- let e = k.current;
83
- if (!A.current || !e) return;
84
- A.current = !1;
85
- let t = e.ownerDocument.activeElement;
86
- (t === e.ownerDocument.body || t && e.contains(t) && t.matches(":disabled")) && e.querySelector("[aria-current=\"page\"]")?.focus();
87
- }, [E]);
88
- let j = (e, t = !1) => {
89
- A.current = t && (e <= 1 || e >= T), e !== E && n?.(e);
90
- };
91
- return /* @__PURE__ */ u("nav", {
92
- ...C,
93
- ref: k,
94
- "aria-label": l,
95
- "data-ui": "pagination",
96
- children: /* @__PURE__ */ d("ul", {
97
- css: _,
98
- children: [
99
- /* @__PURE__ */ u("li", { children: /* @__PURE__ */ d("button", {
100
- type: "button",
101
- disabled: E <= 1,
102
- onClick: () => j(E - 1, !0),
103
- "data-ui": "pagination-previous",
104
- css: [v, y],
105
- children: [/* @__PURE__ */ u("span", {
106
- "aria-hidden": "true",
107
- css: x,
108
- children: "‹"
109
- }), /* @__PURE__ */ u("span", {
110
- css: r,
111
- children: p
112
- })]
113
- }) }),
114
- D.map((e) => typeof e == "number" ? /* @__PURE__ */ u("li", { children: /* @__PURE__ */ u("button", {
115
- type: "button",
116
- "aria-current": e === E ? "page" : void 0,
117
- "aria-label": O.format(e),
118
- onClick: () => j(e),
119
- "data-ui": "pagination-page",
120
- css: [v, y],
121
- children: O.format(e)
122
- }) }, e) : /* @__PURE__ */ u("li", { children: /* @__PURE__ */ u("span", {
123
- "aria-hidden": "true",
124
- "data-ui": "pagination-ellipsis",
125
- css: [v, b],
126
- children: "…"
127
- }) }, e)),
128
- /* @__PURE__ */ u("li", { children: /* @__PURE__ */ d("button", {
129
- type: "button",
130
- disabled: E >= T,
131
- onClick: () => j(E + 1, !0),
132
- "data-ui": "pagination-next",
133
- css: [v, y],
134
- children: [/* @__PURE__ */ u("span", {
135
- "aria-hidden": "true",
136
- css: x,
137
- children: "›"
138
- }), /* @__PURE__ */ u("span", {
139
- css: r,
140
- children: h
141
- })]
142
- }) })
143
- ]
144
- })
145
- });
146
- });
147
- //#endregion
148
- export { S as t };
@@ -1,49 +0,0 @@
1
- import { t as e } from "./css-CW_HG55W.js";
2
- import { forwardRef as t } from "react";
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
- }, o = t(function({ tone: e = "neutral", ...t }, n) {
40
- return /* @__PURE__ */ r("span", {
41
- ...t,
42
- ref: n,
43
- "data-ui": "pill",
44
- "data-tone": e,
45
- css: [i, a[e]]
46
- });
47
- });
48
- //#endregion
49
- export { o as t };
@@ -1,97 +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 "./trigger-style-f54idgjT.js";
4
- import { n as r } from "./surface-Bo_aSQOb.js";
5
- import { t as i } from "./use-overlay-floating-CsZd3qxa.js";
6
- import { createContext as a, forwardRef as o, useContext as s, useEffect as c, useMemo as l, useRef as u } from "react";
7
- import { vars as d } from "@jfrader/tokens/vars";
8
- import { jsx as f } from "@emotion/react/jsx-runtime";
9
- import { FloatingFocusManager as p, FloatingPortal as m, useClick as h, useDismiss as g, useInteractions as _, useMergeRefs as v, useRole as y } from "@floating-ui/react";
10
- //#region src/components/popover/popover.tsx
11
- var b = a(null);
12
- function x(e) {
13
- let t = s(b);
14
- if (!t) throw Error(`Popover.${e} must be rendered inside <Popover>.`);
15
- return t;
16
- }
17
- var S = e({
18
- ...r,
19
- borderRadius: d.radius.lg,
20
- boxShadow: d.shadow.overlay,
21
- padding: d.space[4],
22
- minInlineSize: "200px",
23
- maxInlineSize: "min(360px, calc(100vw - 32px))",
24
- fontSize: d.textSize.sm
25
- });
26
- function C({ open: e, defaultOpen: n = !1, onOpenChange: r, placement: a = "bottom", children: o }) {
27
- let [s = !1, d] = t(e, n, r), p = u(!1), { refs: m, floatingStyles: v, context: x } = i({
28
- open: s,
29
- placement: a,
30
- onOpenChange: (e, t, n) => {
31
- e || (p.current = n === "escape-key"), d(e);
32
- }
33
- });
34
- c(() => {
35
- !s && p.current && (p.current = !1, m.domReference.current?.focus());
36
- }, [s, m]);
37
- let S = h(x), C = g(x, {
38
- escapeKey: !0,
39
- outsidePress: !0
40
- }), w = y(x, { role: "dialog" }), { getReferenceProps: T, getFloatingProps: E } = _([
41
- S,
42
- C,
43
- w
44
- ]), D = l(() => ({
45
- open: s,
46
- refs: m,
47
- floatingContext: x,
48
- floatingStyles: v,
49
- getReferenceProps: T,
50
- getFloatingProps: E
51
- }), [
52
- s,
53
- m,
54
- x,
55
- v,
56
- T,
57
- E
58
- ]);
59
- return /* @__PURE__ */ f(b.Provider, {
60
- value: D,
61
- children: o
62
- });
63
- }
64
- var w = o(function(e, t) {
65
- let { refs: r, getReferenceProps: i } = x("Trigger"), a = v([r.setReference, t]);
66
- return /* @__PURE__ */ f("button", {
67
- type: "button",
68
- ...i(e),
69
- ref: a,
70
- "data-ui": "popover-trigger",
71
- css: n
72
- });
73
- }), T = o(function({ style: e, ...t }, n) {
74
- let { open: r, refs: i, floatingContext: a, floatingStyles: o, getFloatingProps: s } = x("Content"), c = v([i.setFloating, n]);
75
- return r ? /* @__PURE__ */ f(m, { children: /* @__PURE__ */ f(p, {
76
- context: a,
77
- modal: !1,
78
- initialFocus: -1,
79
- returnFocus: !1,
80
- closeOnFocusOut: !1,
81
- children: /* @__PURE__ */ f("div", {
82
- ...s(t),
83
- ref: c,
84
- "data-ui": "popover",
85
- style: {
86
- ...e,
87
- ...o
88
- },
89
- css: S
90
- })
91
- }) }) : null;
92
- }), E = Object.assign(C, {
93
- Trigger: w,
94
- Content: T
95
- });
96
- //#endregion
97
- export { E as t };