@jfrader/ui 0.2.0 → 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 (162) 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-DrmjBbo7.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-ClUYBIBh.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-DU60SMdt.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-BtN_0ejj.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-BCS0-LVW.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-BiXXvQvr.js +42 -0
  74. package/dist/theme-root.js +1 -1
  75. package/dist/toast-iqelR-r0.js +282 -0
  76. package/dist/toast.js +1 -1
  77. package/dist/toggle-group-CI0e7hFm.js +166 -0
  78. package/dist/toggle-group.js +1 -1
  79. package/dist/tooltip-CB-HC1js.js +108 -0
  80. package/dist/tooltip.js +1 -1
  81. package/dist/{trigger-style-B1GFmH7M.js → trigger-style-B1KVC8O1.js} +1 -1
  82. package/dist/types/components/accordion/accordion.d.ts +9 -8
  83. package/dist/types/components/alert/alert.d.ts +3 -2
  84. package/dist/types/components/avatar/avatar.d.ts +3 -2
  85. package/dist/types/components/badge/badge.d.ts +3 -2
  86. package/dist/types/components/breadcrumbs/breadcrumbs.d.ts +5 -4
  87. package/dist/types/components/button/button.d.ts +3 -2
  88. package/dist/types/components/calendar/calendar.d.ts +7 -6
  89. package/dist/types/components/card/card.d.ts +13 -12
  90. package/dist/types/components/checkbox/checkbox.d.ts +3 -2
  91. package/dist/types/components/combobox/combobox.d.ts +8 -7
  92. package/dist/types/components/command-palette/command-palette.d.ts +15 -14
  93. package/dist/types/components/container/container.d.ts +3 -2
  94. package/dist/types/components/date-picker/date-picker.d.ts +3 -2
  95. package/dist/types/components/dialog/dialog.d.ts +11 -10
  96. package/dist/types/components/divider/divider.d.ts +3 -2
  97. package/dist/types/components/field/field-anatomy.d.ts +3 -2
  98. package/dist/types/components/flex/flex.d.ts +3 -2
  99. package/dist/types/components/kbd/kbd.d.ts +5 -4
  100. package/dist/types/components/menu/menu.d.ts +9 -8
  101. package/dist/types/components/navigation/navigation.d.ts +7 -6
  102. package/dist/types/components/pagination/pagination.d.ts +3 -2
  103. package/dist/types/components/pill/pill.d.ts +3 -2
  104. package/dist/types/components/popover/popover.d.ts +5 -4
  105. package/dist/types/components/progress/progress.d.ts +3 -2
  106. package/dist/types/components/radio-group/radio-group.d.ts +5 -4
  107. package/dist/types/components/select/select.d.ts +9 -8
  108. package/dist/types/components/skeleton/skeleton.d.ts +3 -2
  109. package/dist/types/components/spinner/spinner.d.ts +3 -2
  110. package/dist/types/components/stack/stack.d.ts +1 -1
  111. package/dist/types/components/switch/switch.d.ts +3 -2
  112. package/dist/types/components/tabs/tabs.d.ts +9 -8
  113. package/dist/types/components/text-field/text-field.d.ts +3 -2
  114. package/dist/types/components/textarea/textarea.d.ts +3 -2
  115. package/dist/types/components/theme-provider/theme-provider.d.ts +11 -0
  116. package/dist/types/components/theme-root/theme-root.d.ts +3 -2
  117. package/dist/types/components/toast/toast.d.ts +3 -2
  118. package/dist/types/components/toggle-group/toggle-group.d.ts +5 -4
  119. package/dist/types/components/tooltip/tooltip.d.ts +5 -4
  120. package/dist/types/index.d.ts +4 -0
  121. package/dist/types/styling/css.d.ts +3 -2
  122. package/dist/types/styling/styled.d.ts +1 -0
  123. package/dist/types/styling/sx.d.ts +16 -0
  124. package/dist/types/styling/theme.d.ts +98 -0
  125. package/dist/{visually-hidden-DCWhf0Cb.js → visually-hidden-BJdvqqvn.js} +1 -1
  126. package/package.json +3 -2
  127. package/dist/accordion-CkOZ-tvs.js +0 -178
  128. package/dist/alert-Dsjx14UW.js +0 -131
  129. package/dist/avatar-BRGKkoSr.js +0 -127
  130. package/dist/badge-DLxUMsCx.js +0 -104
  131. package/dist/breadcrumbs-694hF_hm.js +0 -131
  132. package/dist/button-CoaIcykB.js +0 -190
  133. package/dist/calendar-Doj7PTdG.js +0 -379
  134. package/dist/card-2IM71XZj.js +0 -134
  135. package/dist/checkbox-B7xGNFzp.js +0 -136
  136. package/dist/combobox-Bjhxv5U3.js +0 -311
  137. package/dist/command-palette-BhJwm6cS.js +0 -344
  138. package/dist/container-BhnrGPu-.js +0 -36
  139. package/dist/css-Cgj6sCHn.js +0 -2
  140. package/dist/date-picker-Jk8SpoiO.js +0 -245
  141. package/dist/dialog-fhS07G41.js +0 -187
  142. package/dist/divider-v_78HYF5.js +0 -79
  143. package/dist/field-anatomy-BzGw1Ch9.js +0 -105
  144. package/dist/flex-COZzFqI8.js +0 -22
  145. package/dist/kbd-CeP8Kfvp.js +0 -61
  146. package/dist/menu-B6KCbLCr.js +0 -196
  147. package/dist/navigation-BDht6S2-.js +0 -182
  148. package/dist/pagination-B50PCaDU.js +0 -151
  149. package/dist/pill-2_XzBdkD.js +0 -51
  150. package/dist/popover-DRHbeIVq.js +0 -103
  151. package/dist/progress-CpsskKTD.js +0 -85
  152. package/dist/radio-group-DPI5KUCj.js +0 -136
  153. package/dist/select-C1xGrOhT.js +0 -266
  154. package/dist/skeleton-DitdP-yz.js +0 -49
  155. package/dist/spinner-CFq5HPoo.js +0 -51
  156. package/dist/stack-D_g6NJzo.js +0 -21
  157. package/dist/switch-B5TTU-oJ.js +0 -138
  158. package/dist/tabs-C26PWl2c.js +0 -183
  159. package/dist/theme-root-BRLIA4eb.js +0 -22
  160. package/dist/toast-B1PXuwZ4.js +0 -277
  161. package/dist/toggle-group-N_owicT0.js +0 -156
  162. package/dist/tooltip-BJPisf60.js +0 -98
@@ -1,178 +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 } from "./media-D_eA_I-e.js";
6
- import { n as i } from "./roving-focus-CYlo_Kf8.js";
7
- import { t as a } from "./use-controlled-state-CVXDa-qM.js";
8
- import { createContext as o, useContext as s, useId as c, useMemo as l } from "react";
9
- import { vars as u } from "@jfrader/tokens/vars";
10
- import { jsx as d } from "@emotion/react/jsx-runtime";
11
- //#region src/components/accordion/accordion.tsx
12
- var f = o(null), p = o(null);
13
- function m(e) {
14
- let t = s(f);
15
- if (!t) throw Error(`Accordion.${e} must be rendered inside <Accordion>.`);
16
- return t;
17
- }
18
- function h(e) {
19
- let t = s(p);
20
- if (!t) throw Error(`Accordion.${e} must be rendered inside <Accordion.Item>.`);
21
- return t;
22
- }
23
- var g = "", _ = {
24
- itemSelector: "[data-ui=\"accordion-trigger\"]:not([disabled])",
25
- ownerSelector: "[data-ui=\"accordion\"]"
26
- }, v = (e, t) => {
27
- if (t === "multiple" && Array.isArray(e)) return e;
28
- let n = Array.isArray(e) ? e[0] : e;
29
- return n === void 0 || n === g ? [] : [n];
30
- }, y = e({
31
- borderBlockEnd: `1px solid ${u.color.border}`,
32
- "&:first-of-type": { borderBlockStart: `1px solid ${u.color.border}` }
33
- }), b = e({
34
- margin: 0,
35
- font: "inherit"
36
- }), x = e({
37
- appearance: "none",
38
- display: "flex",
39
- alignItems: "center",
40
- justifyContent: "space-between",
41
- gap: u.space[3],
42
- inlineSize: "100%",
43
- border: 0,
44
- background: "transparent",
45
- cursor: "pointer",
46
- paddingBlock: u.space[3],
47
- paddingInline: u.space[4],
48
- font: "inherit",
49
- fontSize: u.textSize.sm,
50
- fontWeight: u.fontWeight.medium,
51
- color: u.color.text,
52
- textAlign: "start",
53
- transitionProperty: "background-color",
54
- transitionDuration: u.motion.duration.fast,
55
- transitionTimingFunction: u.motion.easeStandard,
56
- "&::after": { ...t },
57
- "&[aria-expanded=\"true\"]::after": { transform: "rotate(90deg)" },
58
- "&[aria-expanded=\"true\"]:dir(rtl)::after": { transform: "rotate(-90deg)" },
59
- "&:hover:not(:disabled):not([aria-disabled=\"true\"])": { backgroundColor: u.color.surfaceHover },
60
- "&[aria-disabled=\"true\"]": { cursor: "default" },
61
- "&:disabled": {
62
- opacity: .55,
63
- cursor: "not-allowed"
64
- },
65
- "&:focus-visible": { ...n },
66
- [r]: {
67
- transitionDuration: "0s",
68
- "&::after": { transitionDuration: "0s" }
69
- }
70
- }), S = e({
71
- paddingBlock: u.space[3],
72
- paddingInline: u.space[4],
73
- color: u.color.textMuted,
74
- lineHeight: u.lineHeight.relaxed,
75
- "&[hidden]": { display: "none" }
76
- });
77
- function C({ ref: e, value: t, defaultValue: n, onValueChange: r, type: o = "single", collapsible: s = !0, onKeyDown: c, ...u }) {
78
- let [p, m] = a(t, n, r), h = l(() => {
79
- let e = v(p, o), t = s || e.length > 1;
80
- return {
81
- openValues: e,
82
- toggle: (n) => {
83
- let r = e.includes(n);
84
- (!r || t) && m(o === "multiple" ? r ? e.filter((e) => e !== n) : [...e, n] : r ? g : n);
85
- },
86
- canCollapse: t
87
- };
88
- }, [
89
- p,
90
- m,
91
- o,
92
- s
93
- ]), y = (e) => {
94
- c?.(e), !e.defaultPrevented && i(e, e.currentTarget, "vertical", _);
95
- };
96
- return /* @__PURE__ */ d(f.Provider, {
97
- value: h,
98
- children: /* @__PURE__ */ d("div", {
99
- ...u,
100
- ref: e,
101
- "data-ui": "accordion",
102
- onKeyDown: y
103
- })
104
- });
105
- }
106
- C.displayName = "Accordion";
107
- function w({ ref: e, value: t, disabled: n = !1, ...r }) {
108
- let { openValues: i } = m("Item"), a = c(), o = i.includes(t), s = l(() => ({
109
- value: t,
110
- disabled: n,
111
- expanded: o,
112
- triggerId: `${a}-trigger`,
113
- panelId: `${a}-panel`
114
- }), [
115
- t,
116
- n,
117
- o,
118
- a
119
- ]);
120
- return /* @__PURE__ */ d(p.Provider, {
121
- value: s,
122
- children: /* @__PURE__ */ d("div", {
123
- ...r,
124
- ref: e,
125
- "data-ui": "accordion-item",
126
- "data-state": o ? "open" : "closed",
127
- "data-disabled": n ? "" : void 0,
128
- css: y
129
- })
130
- });
131
- }
132
- w.displayName = "Accordion.Item";
133
- function T({ ref: e, onClick: t, disabled: n, ...r }) {
134
- let { toggle: i, canCollapse: a } = m("Trigger"), { value: o, disabled: s, expanded: c, triggerId: l, panelId: u } = h("Trigger"), f = c && !a, p = (e) => {
135
- t?.(e), !e.defaultPrevented && i(o);
136
- };
137
- return /* @__PURE__ */ d("h3", {
138
- "data-ui": "accordion-heading",
139
- css: b,
140
- children: /* @__PURE__ */ d("button", {
141
- ...r,
142
- ref: e,
143
- type: "button",
144
- id: l,
145
- "data-ui": "accordion-trigger",
146
- "data-state": c ? "open" : "closed",
147
- "aria-expanded": c,
148
- "aria-controls": u,
149
- "aria-disabled": f || void 0,
150
- disabled: s || n,
151
- onClick: p,
152
- css: x
153
- })
154
- });
155
- }
156
- T.displayName = "Accordion.Trigger";
157
- function E({ ref: e, "aria-labelledby": t, ...n }) {
158
- let { expanded: r, triggerId: i, panelId: a } = h("Panel"), o = [t, i].filter(Boolean).join(" ");
159
- return /* @__PURE__ */ d("div", {
160
- ...n,
161
- ref: e,
162
- role: "region",
163
- id: a,
164
- "aria-labelledby": o,
165
- hidden: !r,
166
- "data-ui": "accordion-panel",
167
- "data-state": r ? "open" : "closed",
168
- css: S
169
- });
170
- }
171
- E.displayName = "Accordion.Panel";
172
- var D = Object.assign(C, {
173
- Item: w,
174
- Trigger: T,
175
- Panel: E
176
- });
177
- //#endregion
178
- export { D as t };
@@ -1,131 +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 { t as i } from "./renderable-DzcIj1Lo.js";
7
- import { vars as a } from "@jfrader/tokens/vars";
8
- import { jsx as o, jsxs as s } from "@emotion/react/jsx-runtime";
9
- //#region src/components/alert/alert.tsx
10
- var c = {
11
- info: "Information",
12
- success: "Success",
13
- warning: "Warning",
14
- danger: "Error"
15
- }, l = e({
16
- display: "grid",
17
- gap: a.space[1],
18
- boxSizing: "border-box",
19
- backgroundColor: a.color.surfaceRaised,
20
- border: `1px solid ${a.color.border}`,
21
- borderInlineStartWidth: "3px",
22
- borderInlineStartStyle: "solid",
23
- borderRadius: a.radius.md,
24
- paddingBlock: a.space[3],
25
- paddingInline: a.space[4],
26
- fontFamily: a.font.sans,
27
- lineHeight: a.lineHeight.base
28
- }), u = e({
29
- gridTemplateColumns: "minmax(0, 1fr) auto",
30
- columnGap: a.space[3]
31
- }), d = e({
32
- display: "grid",
33
- gap: a.space[1],
34
- minInlineSize: 0,
35
- gridColumn: 1,
36
- gridRow: 1
37
- }), f = {
38
- info: e({ borderInlineStartColor: a.color.info }),
39
- success: e({ borderInlineStartColor: a.color.success }),
40
- warning: e({ borderInlineStartColor: a.color.warning }),
41
- danger: e({ borderInlineStartColor: a.color.dangerText })
42
- }, p = e({
43
- gridColumn: 1,
44
- fontSize: a.textSize.sm,
45
- fontWeight: a.fontWeight.semibold,
46
- color: a.color.text
47
- }), m = e({
48
- gridColumn: 1,
49
- fontSize: a.textSize.sm,
50
- color: a.color.textMuted
51
- }), h = e({
52
- gridColumn: 2,
53
- gridRow: 1,
54
- alignSelf: "start",
55
- appearance: "none",
56
- display: "inline-flex",
57
- alignItems: "center",
58
- justifyContent: "center",
59
- minInlineSize: "24px",
60
- minBlockSize: "24px",
61
- margin: 0,
62
- padding: 0,
63
- border: "1px solid transparent",
64
- borderRadius: a.radius.sm,
65
- backgroundColor: "transparent",
66
- fontFamily: "inherit",
67
- fontSize: a.textSize.md,
68
- lineHeight: 1,
69
- color: a.color.textMuted,
70
- cursor: "pointer",
71
- transitionProperty: "background-color, color",
72
- transitionDuration: a.motion.duration.fast,
73
- transitionTimingFunction: a.motion.easeStandard,
74
- "&:hover": {
75
- backgroundColor: a.color.surfaceHover,
76
- color: a.color.text
77
- },
78
- "&:focus-visible": { ...t },
79
- [n]: { transitionDuration: "0s" }
80
- });
81
- function g({ ref: e, tone: t = "info", toneLabel: n = c[t], title: a, children: g, onDismiss: _, dismissLabel: v = "Dismiss", slotProps: y, className: b, ...x }) {
82
- let S = _ !== void 0;
83
- return /* @__PURE__ */ s("div", {
84
- ...x,
85
- ref: e,
86
- "data-ui": "alert",
87
- "data-tone": t,
88
- className: [b, y?.root?.className].filter(Boolean).join(" ") || void 0,
89
- css: [
90
- l,
91
- f[t],
92
- S && u,
93
- y?.root?.css
94
- ],
95
- children: [/* @__PURE__ */ s("div", {
96
- role: t === "danger" ? "alert" : "status",
97
- "aria-atomic": "true",
98
- css: d,
99
- children: [
100
- /* @__PURE__ */ o("span", {
101
- css: r,
102
- children: n
103
- }),
104
- i(a) && /* @__PURE__ */ o("div", {
105
- className: y?.title?.className,
106
- css: [p, y?.title?.css],
107
- children: a
108
- }),
109
- i(g) && /* @__PURE__ */ o("div", {
110
- className: y?.body?.className,
111
- css: [m, y?.body?.css],
112
- children: g
113
- })
114
- ]
115
- }), S && /* @__PURE__ */ o("button", {
116
- type: "button",
117
- "data-ui": "alert-dismiss",
118
- "aria-label": v,
119
- onClick: () => _?.(),
120
- className: y?.dismiss?.className,
121
- css: [h, y?.dismiss?.css],
122
- children: /* @__PURE__ */ o("span", {
123
- "aria-hidden": !0,
124
- children: "×"
125
- })
126
- })]
127
- });
128
- }
129
- g.displayName = "Alert";
130
- //#endregion
131
- export { g as t };
@@ -1,127 +0,0 @@
1
- 'use client';
2
- import { t as e } from "./css-Cgj6sCHn.js";
3
- import { useState as t } from "react";
4
- import { vars as n } from "@jfrader/tokens/vars";
5
- import { jsx as r, jsxs as i } from "@emotion/react/jsx-runtime";
6
- //#region src/components/avatar/avatar.tsx
7
- var a = 2, o = new Intl.Segmenter(void 0, { granularity: "grapheme" });
8
- function s(e) {
9
- let t = Array.from(o.segment(e), ({ segment: e }) => e), n = t[0] ?? "";
10
- if (!/\p{Extended_Pictographic}/u.test(n)) return n;
11
- let r = "";
12
- for (let e of t) {
13
- if (!/\p{Extended_Pictographic}/u.test(e)) break;
14
- r += e;
15
- }
16
- return r;
17
- }
18
- function c(e) {
19
- return e.trim().split(/\s+/).filter(Boolean).slice(0, a).map(s).join("").toLocaleUpperCase();
20
- }
21
- var l = e({
22
- position: "relative",
23
- display: "inline-flex",
24
- alignItems: "center",
25
- justifyContent: "center",
26
- flexShrink: 0,
27
- boxSizing: "border-box",
28
- borderRadius: n.radius.full,
29
- backgroundColor: n.color.surfaceHover,
30
- color: n.color.text,
31
- fontWeight: n.fontWeight.medium,
32
- lineHeight: 1,
33
- userSelect: "none",
34
- verticalAlign: "middle"
35
- }), u = {
36
- sm: e({
37
- inlineSize: n.space[6],
38
- blockSize: n.space[6],
39
- fontSize: n.textSize.xs
40
- }),
41
- md: e({
42
- inlineSize: n.space[8],
43
- blockSize: n.space[8],
44
- fontSize: n.textSize.sm
45
- }),
46
- lg: e({
47
- inlineSize: n.space[10],
48
- blockSize: n.space[10],
49
- fontSize: n.textSize.md
50
- })
51
- }, d = e({
52
- display: "block",
53
- inlineSize: "100%",
54
- blockSize: "100%",
55
- borderRadius: n.radius.full,
56
- objectFit: "cover"
57
- }), f = e({
58
- position: "absolute",
59
- insetBlockEnd: 0,
60
- insetInlineEnd: 0,
61
- inlineSize: "25%",
62
- blockSize: "25%",
63
- "&::before": {
64
- content: "\"\"",
65
- position: "absolute",
66
- insetBlockStart: 0,
67
- insetInlineStart: 0,
68
- inlineSize: "100%",
69
- blockSize: "100%",
70
- boxSizing: "border-box",
71
- borderRadius: n.radius.full,
72
- boxShadow: `0 0 0 2px ${n.color.bg}`
73
- }
74
- }), p = {
75
- online: e({ "&::before": { backgroundColor: n.color.success } }),
76
- away: e({ "&::before": {
77
- border: `2px solid ${n.color.warning}`,
78
- backgroundColor: "transparent"
79
- } }),
80
- busy: e({ "&::before": {
81
- backgroundColor: n.color.danger,
82
- blockSize: "30%",
83
- insetBlockStart: "35%"
84
- } }),
85
- offline: e({ "&::before": {
86
- backgroundColor: n.color.textSubtle,
87
- inlineSize: "60%",
88
- blockSize: "60%",
89
- insetBlockStart: "20%",
90
- insetInlineStart: "20%"
91
- } })
92
- };
93
- function m({ ref: e, name: n, src: a, size: o = "md", status: s, statusLabel: m, slotProps: h, ...g }) {
94
- let [_, v] = t(), y = a !== void 0 && a !== "" && a !== _, b = s === void 0 ? n : `${n}, ${m ?? s}`;
95
- return /* @__PURE__ */ i("span", {
96
- ...g,
97
- ref: e,
98
- "data-ui": "avatar",
99
- role: "img",
100
- "aria-label": b,
101
- css: [l, u[o]],
102
- children: [y ? /* @__PURE__ */ r("img", {
103
- src: a,
104
- alt: "",
105
- onError: () => v(a),
106
- className: h?.image?.className,
107
- css: [d, h?.image?.css]
108
- }) : /* @__PURE__ */ r("span", {
109
- "aria-hidden": "true",
110
- className: h?.fallback?.className,
111
- css: h?.fallback?.css,
112
- children: c(n)
113
- }), s !== void 0 && /* @__PURE__ */ r("span", {
114
- "aria-hidden": "true",
115
- "data-status": s,
116
- className: h?.status?.className,
117
- css: [
118
- f,
119
- p[s],
120
- h?.status?.css
121
- ]
122
- })]
123
- });
124
- }
125
- m.displayName = "Avatar";
126
- //#endregion
127
- export { m as t };
@@ -1,104 +0,0 @@
1
- 'use client';
2
- import { t as e } from "./css-Cgj6sCHn.js";
3
- import { vars as t } from "@jfrader/tokens/vars";
4
- import { jsx as n, jsxs as r } from "@emotion/react/jsx-runtime";
5
- //#region src/components/badge/badge.tsx
6
- var i = 99, a = e({
7
- position: "relative",
8
- display: "inline-flex",
9
- flexShrink: 0,
10
- verticalAlign: "middle"
11
- }), o = e({
12
- position: "absolute",
13
- display: "flex",
14
- alignItems: "center",
15
- justifyContent: "center",
16
- boxSizing: "border-box",
17
- boxShadow: `0 0 0 2px ${t.color.bg}`,
18
- fontWeight: t.fontWeight.medium,
19
- lineHeight: 1,
20
- whiteSpace: "nowrap",
21
- pointerEvents: "none"
22
- }), s = {
23
- standard: e({
24
- blockSize: t.space[5],
25
- minInlineSize: t.space[5],
26
- paddingInline: t.space[1],
27
- fontSize: t.textSize.xs
28
- }),
29
- dot: e({
30
- blockSize: t.space[2],
31
- inlineSize: t.space[2],
32
- borderRadius: t.radius.full
33
- })
34
- }, c = {
35
- rectangular: e({ borderRadius: t.radius.sm }),
36
- circular: e({ borderRadius: t.radius.full })
37
- }, l = {
38
- "top-start": e({
39
- insetBlockStart: 0,
40
- insetInlineStart: 0,
41
- transform: "translate(-50%, -50%)",
42
- "&:dir(rtl)": { transform: "translate(50%, -50%)" }
43
- }),
44
- "top-end": e({
45
- insetBlockStart: 0,
46
- insetInlineEnd: 0,
47
- transform: "translate(50%, -50%)",
48
- "&:dir(rtl)": { transform: "translate(-50%, -50%)" }
49
- }),
50
- "bottom-start": e({
51
- insetBlockEnd: 0,
52
- insetInlineStart: 0,
53
- transform: "translate(-50%, 50%)",
54
- "&:dir(rtl)": { transform: "translate(50%, 50%)" }
55
- }),
56
- "bottom-end": e({
57
- insetBlockEnd: 0,
58
- insetInlineEnd: 0,
59
- transform: "translate(50%, 50%)",
60
- "&:dir(rtl)": { transform: "translate(-50%, 50%)" }
61
- })
62
- }, u = {
63
- accent: e({
64
- backgroundColor: t.color.accent,
65
- color: t.color.accentContrast
66
- }),
67
- danger: e({
68
- backgroundColor: t.color.danger,
69
- color: t.color.dangerContrast
70
- }),
71
- neutral: e({
72
- backgroundColor: t.color.textMuted,
73
- color: t.color.bg
74
- })
75
- };
76
- function d({ ref: e, children: t, badgeContent: d, max: f = i, showZero: p = !1, invisible: m = !1, variant: h = "standard", tone: g = "accent", anchor: _, overlap: v = "rectangular", slotProps: y, className: b, ...x }) {
77
- let S = h === "dot", C = m || h !== "dot" && (d == null || d === !1 || d === 0 && !p), w = typeof d == "number" && d > f ? `${f}+` : d, T = `${_?.vertical ?? "top"}-${_?.horizontal ?? "end"}`, E = [b, y?.root?.className].filter(Boolean).join(" ") || void 0;
78
- return /* @__PURE__ */ r("span", {
79
- ...x,
80
- ref: e,
81
- "data-ui": "badge",
82
- className: E,
83
- css: [a, y?.root?.css],
84
- children: [t, !C && /* @__PURE__ */ n("span", {
85
- "data-ui": "badge-marker",
86
- "data-variant": h,
87
- "data-tone": g,
88
- "aria-hidden": S ? "true" : void 0,
89
- className: y?.badge?.className,
90
- css: [
91
- o,
92
- s[h],
93
- !S && c[v],
94
- l[T],
95
- u[g],
96
- y?.badge?.css
97
- ],
98
- children: S ? null : w
99
- })]
100
- });
101
- }
102
- d.displayName = "Badge";
103
- //#endregion
104
- export { d as t };
@@ -1,131 +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 { createContext as r, useCallback as i, useContext as a, useId as o, useImperativeHandle as s, useLayoutEffect as c, useMemo as l, useRef as u, useState as d } from "react";
6
- import { vars as f } from "@jfrader/tokens/vars";
7
- import { jsx as p, jsxs as m } from "@emotion/react/jsx-runtime";
8
- //#region src/components/breadcrumbs/breadcrumbs.tsx
9
- var h = r(null);
10
- function g(e) {
11
- let t = a(h);
12
- if (!t) throw Error(`Breadcrumbs.${e} must be rendered inside <Breadcrumbs>.`);
13
- return t;
14
- }
15
- var _ = ([, e], [, t]) => e.node.compareDocumentPosition(t.node) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1, v = e({
16
- display: "flex",
17
- flexWrap: "wrap",
18
- alignItems: "center",
19
- gap: f.space[2],
20
- margin: 0,
21
- padding: 0,
22
- listStyle: "none",
23
- fontFamily: f.font.sans,
24
- fontSize: f.textSize.sm,
25
- lineHeight: f.lineHeight.tight
26
- }), y = e({
27
- display: "inline-flex",
28
- alignItems: "center",
29
- gap: f.space[2],
30
- color: f.color.textMuted,
31
- "&:first-of-type > [data-ui=\"breadcrumbs-separator\"]": { display: "none" }
32
- }), b = e({ display: "inline-flex" }), x = e({
33
- display: "inline-flex",
34
- alignItems: "center",
35
- gap: f.space[1],
36
- minBlockSize: "24px",
37
- borderRadius: f.radius.sm,
38
- color: "inherit",
39
- "& svg": {
40
- inlineSize: "1em",
41
- blockSize: "1em",
42
- flexShrink: 0
43
- },
44
- "&[aria-current=\"page\"]": {
45
- color: f.color.text,
46
- fontWeight: f.fontWeight.medium
47
- }
48
- }), S = e({
49
- textDecoration: "underline",
50
- textDecorationColor: "transparent",
51
- textUnderlineOffset: "0.2em",
52
- transitionProperty: "color, text-decoration-color",
53
- transitionDuration: f.motion.duration.fast,
54
- transitionTimingFunction: f.motion.easeStandard,
55
- "&:hover": {
56
- color: f.color.text,
57
- textDecorationColor: "currentColor"
58
- },
59
- "&:focus-visible": { ...t },
60
- [n]: { transitionDuration: "0s" }
61
- });
62
- function C({ ref: e, label: t = "Breadcrumb", separator: n = "/", children: r, ...a }) {
63
- let o = u(/* @__PURE__ */ new Map()), [s, c] = d(null), f = u(null), m = i(() => {
64
- let e = Array.from(o.current).sort(_), t = e.some(([, e]) => e.current === !0) ? null : e.at(-1)?.[0] ?? null;
65
- f.current !== t && (f.current = t, c(t));
66
- }, []), g = i((e, t) => {
67
- o.current.set(e, t), m();
68
- }, [m]), y = i((e) => {
69
- o.current.delete(e), m();
70
- }, [m]), b = l(() => ({
71
- separator: n,
72
- autoCurrentId: s,
73
- register: g,
74
- unregister: y
75
- }), [
76
- n,
77
- s,
78
- g,
79
- y
80
- ]);
81
- return /* @__PURE__ */ p(h.Provider, {
82
- value: b,
83
- children: /* @__PURE__ */ p("nav", {
84
- ...a,
85
- ref: e,
86
- "aria-label": t,
87
- "data-ui": "breadcrumbs",
88
- children: /* @__PURE__ */ p("ol", {
89
- css: v,
90
- children: r
91
- })
92
- })
93
- });
94
- }
95
- C.displayName = "Breadcrumbs";
96
- function w({ ref: e, href: t, current: n, children: r, ...i }) {
97
- let { separator: a, autoCurrentId: l, register: d, unregister: f } = g("Item"), h = o(), _ = u(null);
98
- s(e, () => _.current, []), c(() => {
99
- let e = _.current;
100
- e && d(h, {
101
- node: e,
102
- current: n
103
- });
104
- }), c(() => () => f(h), [h, f]);
105
- let v = n ?? l === h ? "page" : void 0;
106
- return /* @__PURE__ */ m("li", {
107
- ...i,
108
- ref: _,
109
- "data-ui": "breadcrumbs-item",
110
- css: y,
111
- children: [/* @__PURE__ */ p("span", {
112
- "aria-hidden": "true",
113
- "data-ui": "breadcrumbs-separator",
114
- css: b,
115
- children: a
116
- }), t === void 0 ? /* @__PURE__ */ p("span", {
117
- "aria-current": v,
118
- css: x,
119
- children: r
120
- }) : /* @__PURE__ */ p("a", {
121
- href: t,
122
- "aria-current": v,
123
- css: [x, S],
124
- children: r
125
- })]
126
- });
127
- }
128
- w.displayName = "Breadcrumbs.Item";
129
- var T = Object.assign(C, { Item: w });
130
- //#endregion
131
- export { T as t };