@jfrader/ui 0.1.2 → 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 (144) hide show
  1. package/README.md +1 -1
  2. package/dist/accordion-CkOZ-tvs.js +178 -0
  3. package/dist/accordion.js +1 -1
  4. package/dist/alert-Dsjx14UW.js +131 -0
  5. package/dist/alert.js +1 -1
  6. package/dist/avatar-BRGKkoSr.js +127 -0
  7. package/dist/avatar.js +1 -1
  8. package/dist/badge-DLxUMsCx.js +104 -0
  9. package/dist/badge.js +1 -1
  10. package/dist/breadcrumbs-694hF_hm.js +131 -0
  11. package/dist/breadcrumbs.js +1 -1
  12. package/dist/button-CoaIcykB.js +190 -0
  13. package/dist/button.js +1 -1
  14. package/dist/calendar-Doj7PTdG.js +379 -0
  15. package/dist/calendar.js +1 -1
  16. package/dist/card-2IM71XZj.js +134 -0
  17. package/dist/card.js +1 -1
  18. package/dist/checkbox-B7xGNFzp.js +136 -0
  19. package/dist/checkbox.js +1 -1
  20. package/dist/combobox-Bjhxv5U3.js +311 -0
  21. package/dist/combobox.js +1 -1
  22. package/dist/{command-palette-6c158eH1.js → command-palette-BhJwm6cS.js} +144 -129
  23. package/dist/command-palette.js +1 -1
  24. package/dist/container-BhnrGPu-.js +36 -0
  25. package/dist/container.js +1 -1
  26. package/dist/date-picker-Jk8SpoiO.js +245 -0
  27. package/dist/date-picker.js +1 -1
  28. package/dist/dialog-fhS07G41.js +187 -0
  29. package/dist/dialog.js +1 -1
  30. package/dist/divider-v_78HYF5.js +79 -0
  31. package/dist/divider.js +1 -1
  32. package/dist/flex-COZzFqI8.js +22 -0
  33. package/dist/flex.js +1 -1
  34. package/dist/index.js +36 -36
  35. package/dist/kbd-CeP8Kfvp.js +61 -0
  36. package/dist/kbd.js +1 -1
  37. package/dist/menu-B6KCbLCr.js +196 -0
  38. package/dist/menu.js +1 -1
  39. package/dist/navigation-BDht6S2-.js +182 -0
  40. package/dist/navigation.js +1 -1
  41. package/dist/{pagination-BIKYsxK1.js → pagination-B50PCaDU.js} +58 -56
  42. package/dist/pagination.js +1 -1
  43. package/dist/pill-2_XzBdkD.js +51 -0
  44. package/dist/pill.js +1 -1
  45. package/dist/popover-DRHbeIVq.js +103 -0
  46. package/dist/popover.js +1 -1
  47. package/dist/{progress-C8bgujFI.js → progress-CpsskKTD.js} +37 -36
  48. package/dist/progress.js +1 -1
  49. package/dist/radio-group-DPI5KUCj.js +136 -0
  50. package/dist/radio-group.js +1 -1
  51. package/dist/select-C1xGrOhT.js +266 -0
  52. package/dist/select.js +1 -1
  53. package/dist/skeleton-DitdP-yz.js +49 -0
  54. package/dist/skeleton.js +1 -1
  55. package/dist/{spinner-CSFiP0Oi.js → spinner-CFq5HPoo.js} +24 -23
  56. package/dist/spinner.js +1 -1
  57. package/dist/stack-D_g6NJzo.js +21 -0
  58. package/dist/stack.js +1 -1
  59. package/dist/switch-B5TTU-oJ.js +138 -0
  60. package/dist/switch.js +1 -1
  61. package/dist/tabs-C26PWl2c.js +183 -0
  62. package/dist/tabs.js +1 -1
  63. package/dist/text-field-8PQAqRpM.js +75 -0
  64. package/dist/text-field.js +1 -1
  65. package/dist/textarea-CcGWuntL.js +85 -0
  66. package/dist/textarea.js +1 -1
  67. package/dist/theme-root-BRLIA4eb.js +22 -0
  68. package/dist/theme-root.js +1 -1
  69. package/dist/toast-B1PXuwZ4.js +277 -0
  70. package/dist/toast.js +1 -1
  71. package/dist/toggle-group-N_owicT0.js +156 -0
  72. package/dist/toggle-group.js +1 -1
  73. package/dist/tooltip-BJPisf60.js +98 -0
  74. package/dist/tooltip.js +1 -1
  75. package/dist/types/components/accordion/accordion.d.ts +13 -9
  76. package/dist/types/components/alert/alert.d.ts +6 -3
  77. package/dist/types/components/avatar/avatar.d.ts +6 -3
  78. package/dist/types/components/badge/badge.d.ts +6 -3
  79. package/dist/types/components/breadcrumbs/breadcrumbs.d.ts +8 -5
  80. package/dist/types/components/button/button.d.ts +6 -3
  81. package/dist/types/components/calendar/calendar.d.ts +11 -7
  82. package/dist/types/components/card/card.d.ts +20 -13
  83. package/dist/types/components/checkbox/checkbox.d.ts +6 -3
  84. package/dist/types/components/combobox/combobox.d.ts +12 -8
  85. package/dist/types/components/command-palette/command-palette.d.ts +22 -15
  86. package/dist/types/components/container/container.d.ts +6 -3
  87. package/dist/types/components/date-picker/date-picker.d.ts +6 -4
  88. package/dist/types/components/dialog/dialog.d.ts +16 -11
  89. package/dist/types/components/divider/divider.d.ts +6 -3
  90. package/dist/types/components/flex/flex.d.ts +6 -3
  91. package/dist/types/components/kbd/kbd.d.ts +8 -5
  92. package/dist/types/components/menu/menu.d.ts +13 -9
  93. package/dist/types/components/navigation/navigation.d.ts +11 -7
  94. package/dist/types/components/pagination/pagination.d.ts +6 -3
  95. package/dist/types/components/pill/pill.d.ts +6 -3
  96. package/dist/types/components/popover/popover.d.ts +7 -5
  97. package/dist/types/components/progress/progress.d.ts +6 -3
  98. package/dist/types/components/radio-group/radio-group.d.ts +8 -5
  99. package/dist/types/components/select/select.d.ts +13 -9
  100. package/dist/types/components/skeleton/skeleton.d.ts +6 -3
  101. package/dist/types/components/spinner/spinner.d.ts +6 -3
  102. package/dist/types/components/stack/stack.d.ts +4 -1
  103. package/dist/types/components/switch/switch.d.ts +6 -3
  104. package/dist/types/components/tabs/tabs.d.ts +14 -9
  105. package/dist/types/components/text-field/text-field.d.ts +6 -3
  106. package/dist/types/components/textarea/textarea.d.ts +6 -3
  107. package/dist/types/components/theme-root/theme-root.d.ts +6 -3
  108. package/dist/types/components/toast/toast.d.ts +6 -4
  109. package/dist/types/components/toggle-group/toggle-group.d.ts +7 -5
  110. package/dist/types/components/tooltip/tooltip.d.ts +7 -5
  111. package/dist/types/overlay/use-native-dialog.d.ts +2 -2
  112. package/package.json +4 -4
  113. package/dist/accordion-C3YbYFBi.js +0 -169
  114. package/dist/alert-CA9ZlIZp.js +0 -130
  115. package/dist/avatar-IUW4yJl0.js +0 -125
  116. package/dist/badge-Bru30HEn.js +0 -103
  117. package/dist/breadcrumbs-CQaviWRc.js +0 -126
  118. package/dist/button-Cmixur4Q.js +0 -188
  119. package/dist/calendar-DUgS0xmp.js +0 -373
  120. package/dist/card-D9CHtouU.js +0 -121
  121. package/dist/checkbox-DKa5BCdy.js +0 -135
  122. package/dist/combobox-Dq3V88Zt.js +0 -302
  123. package/dist/container-xUEIoZzj.js +0 -35
  124. package/dist/date-picker-DrHJMt2p.js +0 -240
  125. package/dist/dialog-C2NSOOP-.js +0 -176
  126. package/dist/divider-yF5EmhhT.js +0 -77
  127. package/dist/flex-5-NI5SSy.js +0 -22
  128. package/dist/kbd-B03_qIwQ.js +0 -56
  129. package/dist/menu-bvKRJOhJ.js +0 -187
  130. package/dist/navigation-xPoqh_Iz.js +0 -175
  131. package/dist/pill-CrVqffKM.js +0 -50
  132. package/dist/popover-CVAZ_C1a.js +0 -98
  133. package/dist/radio-group-CvQ4x8ii.js +0 -131
  134. package/dist/select-CNNiUhKB.js +0 -257
  135. package/dist/skeleton-gJ4ImO5u.js +0 -48
  136. package/dist/stack-mEAryjKz.js +0 -21
  137. package/dist/switch-2hm2WnWt.js +0 -136
  138. package/dist/tabs-GBppQabg.js +0 -174
  139. package/dist/text-field-DDPqQu29.js +0 -74
  140. package/dist/textarea-OP8_3IUR.js +0 -84
  141. package/dist/theme-root-eLka0ZP1.js +0 -21
  142. package/dist/toast-D3Y6OAsg.js +0 -271
  143. package/dist/toggle-group-BxzJ-6Cp.js +0 -151
  144. package/dist/tooltip-CVl8HS4S.js +0 -93
@@ -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 };
@@ -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,56 +0,0 @@
1
- 'use client';
2
- import { t as e } from "./css-Cgj6sCHn.js";
3
- import { Children as t, Fragment as n, forwardRef as r } from "react";
4
- import { vars as i } from "@jfrader/tokens/vars";
5
- import { jsx as a, jsxs as o } from "@emotion/react/jsx-runtime";
6
- //#region src/components/kbd/kbd.tsx
7
- var s = "+", c = e({
8
- display: "inline-flex",
9
- alignItems: "center",
10
- boxSizing: "border-box",
11
- paddingBlock: "2px",
12
- paddingInline: "6px",
13
- backgroundColor: i.color.surfaceHover,
14
- border: `1px solid ${i.color.borderSubtle}`,
15
- borderBlockEndColor: i.color.borderStrong,
16
- borderBlockEndWidth: "2px",
17
- borderRadius: i.radius.sm,
18
- fontFamily: i.font.mono,
19
- fontSize: i.textSize.xs,
20
- fontWeight: i.fontWeight.medium,
21
- lineHeight: i.lineHeight.tight,
22
- color: i.color.text,
23
- whiteSpace: "nowrap",
24
- verticalAlign: "middle"
25
- }), l = e({
26
- display: "inline-flex",
27
- alignItems: "center",
28
- gap: i.space[1],
29
- verticalAlign: "middle"
30
- }), u = e({
31
- fontFamily: i.font.sans,
32
- fontSize: i.textSize.xs,
33
- color: i.color.textMuted
34
- }), d = r(function(e, t) {
35
- return /* @__PURE__ */ a("kbd", {
36
- ...e,
37
- ref: t,
38
- "data-ui": "kbd",
39
- css: c
40
- });
41
- }), f = r(function({ children: e, ...r }, i) {
42
- return /* @__PURE__ */ a("span", {
43
- ...r,
44
- ref: i,
45
- "data-ui": "kbd-group",
46
- css: l,
47
- children: t.toArray(e).map((e, t) => /* @__PURE__ */ o(n, { children: [t > 0 && /* @__PURE__ */ a("span", {
48
- "aria-hidden": !0,
49
- "data-ui": "kbd-separator",
50
- css: u,
51
- children: s
52
- }), e] }, t))
53
- });
54
- }), p = Object.assign(d, { Group: f });
55
- //#endregion
56
- export { p 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 };