@jfrader/ui 0.5.0 → 0.5.1

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 (179) hide show
  1. package/dist/accordion-DLul6vIl.js +205 -0
  2. package/dist/accordion.js +1 -1
  3. package/dist/{announcement-bar-B58xempt.js → announcement-bar-Dlbq5-9D.js} +1 -1
  4. package/dist/announcement-bar.js +1 -1
  5. package/dist/avatar-CaGJHy1N.js +145 -0
  6. package/dist/{avatar-group-DOQQuV51.js → avatar-group-M1opAQEG.js} +1 -1
  7. package/dist/avatar-group.js +1 -1
  8. package/dist/avatar.js +1 -1
  9. package/dist/badge-CjM5Agqk.js +119 -0
  10. package/dist/badge.js +1 -1
  11. package/dist/{bottom-sheet-DPJBFkie.js → bottom-sheet-DjZOPq4k.js} +10 -9
  12. package/dist/bottom-sheet.js +1 -1
  13. package/dist/{breadcrumbs-Cfw_hgt2.js → breadcrumbs-BDK_LiwH.js} +10 -3
  14. package/dist/breadcrumbs.js +1 -1
  15. package/dist/{button-C92uYFJW.js → button-NLY0h6EJ.js} +7 -7
  16. package/dist/button.js +1 -1
  17. package/dist/{calendar-B3Svu0X2.js → calendar-BzJdv_SZ.js} +3 -1
  18. package/dist/calendar.js +1 -1
  19. package/dist/card-Ca4KQKYQ.js +154 -0
  20. package/dist/card.js +1 -1
  21. package/dist/carousel-B7OrvD6J.js +474 -0
  22. package/dist/carousel.js +1 -1
  23. package/dist/{checkbox-cFquiSdy.js → checkbox-DKSzExj2.js} +16 -15
  24. package/dist/checkbox.js +1 -1
  25. package/dist/{chip-group-DTQd_M-G.js → chip-group-DjQ0_6Y9.js} +2 -1
  26. package/dist/chip-group.js +1 -1
  27. package/dist/{code-block-ahnRi-g8.js → code-block-B5we2lZa.js} +75 -74
  28. package/dist/code-block.js +1 -1
  29. package/dist/{combobox-Bhzvu9ma.js → combobox-DFFqOBCi.js} +114 -109
  30. package/dist/combobox.js +1 -1
  31. package/dist/command-palette-BmQu2w4H.js +391 -0
  32. package/dist/command-palette.js +1 -1
  33. package/dist/comment-thread-ASaXDcGo.js +1410 -0
  34. package/dist/comment-thread.js +2 -0
  35. package/dist/context-menu-__1c2Dk9.js +370 -0
  36. package/dist/context-menu.js +2 -0
  37. package/dist/{copy-button-ByiA6D3R.js → copy-button-DCSLcYS-.js} +1 -1
  38. package/dist/copy-button.js +1 -1
  39. package/dist/{date-picker-5zKSSuFF.js → date-picker-BiPN7yeK.js} +4 -4
  40. package/dist/date-picker.js +1 -1
  41. package/dist/date-range-picker-DQpUeKqV.js +570 -0
  42. package/dist/date-range-picker.js +1 -1
  43. package/dist/{dialog-ciiv9H2b.js → dialog-BX1zYMs-.js} +2 -1
  44. package/dist/dialog.js +1 -1
  45. package/dist/{divider-DYoJf0I_.js → divider-Cp7aNbhM.js} +21 -20
  46. package/dist/divider.js +1 -1
  47. package/dist/elastic-slider-BG6K019r.js +395 -0
  48. package/dist/elastic-slider.js +2 -0
  49. package/dist/{expandable-card-C-qJcZ14.js → expandable-card-rUATve0o.js} +8 -1
  50. package/dist/expandable-card.js +1 -1
  51. package/dist/expanding-search-BxOwtdwt.js +238 -0
  52. package/dist/expanding-search.js +2 -0
  53. package/dist/file-dropzone-BuXm3Tea.js +457 -0
  54. package/dist/file-dropzone.js +1 -1
  55. package/dist/{filter-toolbar-D5KEKTSe.js → filter-toolbar-Cy5Hqur-.js} +4 -2
  56. package/dist/filter-toolbar.js +1 -1
  57. package/dist/{hover-card-B-nrCIy2.js → hover-card-CoMJKg1g.js} +7 -7
  58. package/dist/hover-card.js +1 -1
  59. package/dist/{image-compare-ciuhPtQZ.js → image-compare-BxY8Ykzt.js} +1 -1
  60. package/dist/image-compare.js +1 -1
  61. package/dist/index.js +81 -76
  62. package/dist/{json-viewer-BcySQfjZ.js → json-viewer-DgWqyU75.js} +7 -3
  63. package/dist/json-viewer.js +1 -1
  64. package/dist/mention-input-sq61si9L.js +600 -0
  65. package/dist/mention-input.js +1 -1
  66. package/dist/menu-DDKgmK2F.js +295 -0
  67. package/dist/menu.js +1 -1
  68. package/dist/{metric-card-Bh9K4fZs.js → metric-card--lVTz5Wn.js} +2 -2
  69. package/dist/metric-card.js +1 -1
  70. package/dist/{multi-select-Pce_IYnz.js → multi-select-DG1BCFX7.js} +14 -6
  71. package/dist/multi-select.js +1 -1
  72. package/dist/{navigation-sP5fiuQS.js → navigation-CC26JDr-.js} +20 -14
  73. package/dist/navigation.js +1 -1
  74. package/dist/{overlay-layer-SeUyyEPD.js → overlay-layer-qEbpEtb8.js} +16 -2
  75. package/dist/{pagination-DmXZ8E85.js → pagination-BfkeWbmP.js} +23 -22
  76. package/dist/pagination.js +1 -1
  77. package/dist/pill-BaS-uIbn.js +58 -0
  78. package/dist/pill.js +1 -1
  79. package/dist/popover-CErIw2q3.js +125 -0
  80. package/dist/popover.js +1 -1
  81. package/dist/{progress-CbOWBUdA.js → progress-DAQkfhPd.js} +1 -1
  82. package/dist/progress.js +1 -1
  83. package/dist/{radio-cards-D2QZENI_.js → radio-cards-Cu9cBssN.js} +35 -34
  84. package/dist/radio-cards.js +1 -1
  85. package/dist/{radio-group-E6mMRgo7.js → radio-group-TIK0-iPX.js} +18 -15
  86. package/dist/radio-group.js +1 -1
  87. package/dist/{resizable-panels-BhjUVXZZ.js → resizable-panels-DUpQEpwG.js} +3 -2
  88. package/dist/resizable-panels.js +1 -1
  89. package/dist/{search-field-IxF0IJXm.js → search-field-DMvho0KQ.js} +2 -2
  90. package/dist/search-field.js +1 -1
  91. package/dist/{segmented-control-yO1K1nbi.js → segmented-control-8ZUGnsZm.js} +2 -1
  92. package/dist/segmented-control.js +1 -1
  93. package/dist/{select-n_H52W1Z.js → select-D5rhJ8gi.js} +3 -2
  94. package/dist/select.js +1 -1
  95. package/dist/{signature-pad-q2SAsrdD.js → signature-pad-_bTeguN9.js} +256 -251
  96. package/dist/signature-pad.js +1 -1
  97. package/dist/slider-DVG6-Awh.js +308 -0
  98. package/dist/slider.js +1 -1
  99. package/dist/{sortable-data-table-tirqlLY2.js → sortable-data-table-CYKT_Ng7.js} +2 -2
  100. package/dist/sortable-data-table.js +1 -1
  101. package/dist/{split-button-Cb3EHs64.js → split-button-BCw4zZom.js} +75 -81
  102. package/dist/split-button.js +1 -1
  103. package/dist/{swipe-actions-DiZC57-3.js → swipe-actions-CBuJREU1.js} +4 -2
  104. package/dist/swipe-actions.js +1 -1
  105. package/dist/switch-C1WrKrf-.js +145 -0
  106. package/dist/switch.js +1 -1
  107. package/dist/tabs-XluwRjgg.js +210 -0
  108. package/dist/tabs.js +1 -1
  109. package/dist/{text-field-C8TWG-tY.js → text-field-hU72iSVS.js} +15 -13
  110. package/dist/text-field.js +1 -1
  111. package/dist/{textarea-BrW0XcG_.js → textarea-3k4Y0QQ3.js} +18 -16
  112. package/dist/textarea.js +1 -1
  113. package/dist/theme-root.js +1 -1
  114. package/dist/theme-switch-C505TtU8.js +166 -0
  115. package/dist/theme-switch.js +2 -0
  116. package/dist/{time-picker-Db8D49cP.js → time-picker-CPlhW0tr.js} +26 -20
  117. package/dist/time-picker.js +1 -1
  118. package/dist/{timeline-k3nURuCP.js → timeline-B0uAAVfT.js} +8 -2
  119. package/dist/timeline.js +1 -1
  120. package/dist/{toast-BHxI32ZA.js → toast-B7wo3sX1.js} +98 -79
  121. package/dist/{toast-stack-DqrAzdg5.js → toast-stack-B40VpS4M.js} +18 -4
  122. package/dist/toast-stack.js +1 -1
  123. package/dist/toast.js +1 -1
  124. package/dist/{toggle-group-fcjzpifI.js → toggle-group-B2fpFZwV.js} +1 -1
  125. package/dist/toggle-group.js +1 -1
  126. package/dist/tooltip-BvgVTCTN.js +120 -0
  127. package/dist/tooltip.js +1 -1
  128. package/dist/{tree-view-C2liIxqy.js → tree-view-j8qLqkb_.js} +5 -1
  129. package/dist/tree-view.js +1 -1
  130. package/dist/types/components/checkbox/checkbox.d.ts +1 -1
  131. package/dist/types/components/command-palette/command-palette.d.ts +1 -1
  132. package/dist/types/components/comment-thread/comment-thread.d.ts +118 -0
  133. package/dist/types/components/comment-thread/index.d.ts +1 -0
  134. package/dist/types/components/comment-thread/thread-core.d.ts +96 -0
  135. package/dist/types/components/comment-thread/thread-parts.d.ts +114 -0
  136. package/dist/types/components/context-menu/context-menu.d.ts +55 -0
  137. package/dist/types/components/context-menu/index.d.ts +2 -0
  138. package/dist/types/components/date-range-picker/date-range-picker.d.ts +1 -1
  139. package/dist/types/components/elastic-slider/elastic-slider.d.ts +53 -0
  140. package/dist/types/components/elastic-slider/index.d.ts +1 -0
  141. package/dist/types/components/expanding-search/expanding-search.d.ts +22 -0
  142. package/dist/types/components/expanding-search/index.d.ts +1 -0
  143. package/dist/types/components/menu/menu.d.ts +50 -7
  144. package/dist/types/components/pagination/pagination.d.ts +1 -1
  145. package/dist/types/components/radio-cards/radio-cards.d.ts +1 -1
  146. package/dist/types/components/radio-group/radio-group.d.ts +1 -1
  147. package/dist/types/components/slider/slider-style.d.ts +14 -0
  148. package/dist/types/components/slider/slider.d.ts +2 -10
  149. package/dist/types/components/slider/use-slider-interaction.d.ts +79 -0
  150. package/dist/types/components/split-button/split-button.d.ts +2 -2
  151. package/dist/types/components/tabs/tabs.d.ts +1 -1
  152. package/dist/types/components/text-field/text-field.d.ts +1 -1
  153. package/dist/types/components/textarea/textarea.d.ts +1 -1
  154. package/dist/types/components/theme-switch/index.d.ts +1 -0
  155. package/dist/types/components/theme-switch/theme-switch.d.ts +33 -0
  156. package/dist/types/components/tooltip/tooltip.d.ts +1 -1
  157. package/dist/types/index.d.ts +5 -0
  158. package/dist/types/overlay/overlay-layer.d.ts +20 -0
  159. package/dist/types/overlay/use-overlay-floating.d.ts +9 -2
  160. package/dist/{use-overlay-floating-DvJifLpF.js → use-overlay-floating-Bx2jBKAA.js} +8 -6
  161. package/dist/use-slider-interaction-ChL-208h.js +234 -0
  162. package/package.json +22 -2
  163. package/dist/accordion-xCI_u0BV.js +0 -198
  164. package/dist/avatar-BahDVO9t.js +0 -132
  165. package/dist/badge-B_sLygxU.js +0 -108
  166. package/dist/card-D-aI2QHx.js +0 -158
  167. package/dist/carousel-IvPqN-oM.js +0 -472
  168. package/dist/command-palette-BQ5LleGb.js +0 -384
  169. package/dist/date-range-picker-B5uFWsm-.js +0 -562
  170. package/dist/file-dropzone-pR4v7owg.js +0 -457
  171. package/dist/mention-input-BcQKX2EJ.js +0 -599
  172. package/dist/menu-xwOOUtWP.js +0 -275
  173. package/dist/pill-DO2gHzMb.js +0 -56
  174. package/dist/popover-QHcEvf9c.js +0 -119
  175. package/dist/slider-t0B5cecO.js +0 -477
  176. package/dist/switch-qwv8jQnR.js +0 -142
  177. package/dist/tabs-CAVJndX1.js +0 -203
  178. package/dist/tooltip-CkeiW9C1.js +0 -113
  179. package/dist/{theme-root-BbTBuLMQ.js → theme-root-Bs1U3uPA.js} +2 -2
@@ -1,275 +0,0 @@
1
- 'use client';
2
- import { r as e, t } from "./sx-Dx9JUKp5.js";
3
- import { t as n } from "./focus-ring-BK5W5_NY.js";
4
- import { r } from "./media-8yrN85VT.js";
5
- import { t as i } from "./use-controlled-state-DpeVQZNR.js";
6
- import { t as a } from "./trigger-style-B1KVC8O1.js";
7
- import { t as o } from "./overlay-layer-SeUyyEPD.js";
8
- import { s, t as c } from "./listbox-style-WX-RASp1.js";
9
- import { i as l, n as u } from "./collection-registry-k6JcD3Jr.js";
10
- import { t as d } from "./overlay-portal-C4JZFq2M.js";
11
- import { t as f } from "./use-overlay-floating-DvJifLpF.js";
12
- import { createContext as p, useContext as m, useEffect as h, useMemo as g, useRef as _, useState as v } from "react";
13
- import { vars as y } from "@jfrader/tokens/vars";
14
- import { jsx as b } from "@emotion/react/jsx-runtime";
15
- import { FloatingFocusManager as x, FloatingList as S, useClick as C, useDismiss as w, useInteractions as T, useListNavigation as E, useMergeRefs as D, useRole as O, useTypeahead as k } from "@floating-ui/react";
16
- //#region src/components/menu/menu.tsx
17
- var A = 500, j = p(null), M = p(!1);
18
- function N(e, t) {
19
- let n = m(j);
20
- if (!n) throw Error(`${e}.${t} must be rendered inside <${e}>.`);
21
- return n;
22
- }
23
- function P(e) {
24
- let t = N(e, "Item");
25
- if (!m(M)) throw Error(`${e}.Item must be rendered inside <${e}.Content>.`);
26
- return t;
27
- }
28
- var F = (e) => /^on[A-Z]/.test(e);
29
- function I(e, t) {
30
- let n = {}, r = {};
31
- for (let [t, i] of Object.entries(e)) F(t) && typeof i == "function" ? n[t] = i : r[t] = i;
32
- let i = t(r);
33
- for (let [e, t] of Object.entries(n)) {
34
- let n = i[e];
35
- i[e] = (e) => {
36
- t(e), e.defaultPrevented || n?.(e);
37
- };
38
- }
39
- return i;
40
- }
41
- var L = (...e) => e.filter(Boolean).join(" ") || void 0, R = e({
42
- appearance: "none",
43
- boxSizing: "border-box",
44
- display: "flex",
45
- alignItems: "center",
46
- inlineSize: "100%",
47
- minBlockSize: "32px",
48
- border: 0,
49
- borderRadius: y.radius.sm,
50
- backgroundColor: "transparent",
51
- paddingBlock: y.space[1],
52
- paddingInline: y.space[2],
53
- font: "inherit",
54
- fontSize: y.textSize.sm,
55
- color: y.color.text,
56
- textAlign: "start",
57
- cursor: "pointer",
58
- transitionProperty: "background-color",
59
- transitionDuration: y.motion.duration.fast,
60
- transitionTimingFunction: y.motion.easeStandard,
61
- "&:focus-visible": { ...n },
62
- [r]: { transitionDuration: "0s" }
63
- }), z = e({
64
- blockSize: "1px",
65
- marginBlock: y.space[1],
66
- backgroundColor: y.color.border
67
- }), B = [R, c], V = z;
68
- function H({ open: e, defaultOpen: t = !1, onOpenChange: n, placement: r = "bottom-start", children: a }) {
69
- let [o = !1, s] = i(e, t, n), [c, l] = v(null), u = _([]), d = _([]), p = _(/* @__PURE__ */ new Set()), m = _(!1), { refs: y, floatingStyles: x, context: S } = f({
70
- open: o,
71
- placement: r,
72
- onOpenChange: (e, t, n) => {
73
- e || (m.current = n === "escape-key"), s(e);
74
- }
75
- });
76
- h(() => {
77
- if (o || !m.current) return;
78
- m.current = !1;
79
- let e = y.domReference.current;
80
- if (!e?.isConnected || e.closest("[inert]")) return;
81
- let t = e.ownerDocument.activeElement;
82
- t && t !== e.ownerDocument.body || e.focus();
83
- }, [o, y]);
84
- let D = C(S), M = O(S, { role: "menu" }), N = w(S, {
85
- escapeKey: !0,
86
- outsidePress: !0
87
- }), P = E(S, {
88
- listRef: u,
89
- activeIndex: c,
90
- onNavigate: l,
91
- loop: !0,
92
- orientation: "vertical",
93
- disabledIndices: (e) => p.current.has(e),
94
- focusItemOnOpen: !0
95
- }), F = k(S, {
96
- listRef: d,
97
- activeIndex: c,
98
- onMatch: o ? l : void 0,
99
- resetMs: A
100
- }), { getReferenceProps: I, getFloatingProps: L, getItemProps: R } = T([
101
- D,
102
- M,
103
- N,
104
- P,
105
- F
106
- ]), z = g(() => ({
107
- open: o,
108
- requestClose: (e = !1) => {
109
- e && (m.current = !0), s(!1);
110
- },
111
- activeIndex: c,
112
- refs: y,
113
- floatingContext: S,
114
- floatingStyles: x,
115
- elementsRef: u,
116
- labelsRef: d,
117
- disabledIndices: p.current,
118
- getReferenceProps: I,
119
- getFloatingProps: L,
120
- getItemProps: R
121
- }), [
122
- o,
123
- s,
124
- c,
125
- y,
126
- S,
127
- x,
128
- I,
129
- L,
130
- R
131
- ]);
132
- return /* @__PURE__ */ b(j.Provider, {
133
- value: z,
134
- children: a
135
- });
136
- }
137
- function U(e) {
138
- return /* @__PURE__ */ b(o, { children: /* @__PURE__ */ b(H, { ...e }) });
139
- }
140
- U.displayName = "Menu";
141
- function W({ family: e, marker: n, styles: r, ref: i, className: a, sx: o, ...s }) {
142
- let { refs: c, getReferenceProps: l } = N(e, "Trigger"), u = D([c.setReference, i]);
143
- return /* @__PURE__ */ b(t, {
144
- className: a,
145
- styles: r,
146
- sx: o,
147
- children: (e) => /* @__PURE__ */ b("button", {
148
- type: "button",
149
- ...I(s, l),
150
- ref: u,
151
- "data-ui": n,
152
- className: e
153
- })
154
- });
155
- }
156
- function G(e) {
157
- return /* @__PURE__ */ b(W, {
158
- ...e,
159
- family: "Menu",
160
- marker: "menu-trigger",
161
- styles: a
162
- });
163
- }
164
- G.displayName = "Menu.Trigger";
165
- function K({ family: e, marker: n, styles: r, ref: i, style: a, children: o, className: s, sx: c, "aria-label": l, "aria-labelledby": u, ...f }) {
166
- let { open: p, refs: m, floatingContext: h, floatingStyles: g, elementsRef: _, labelsRef: v, getFloatingProps: y } = N(e, "Content"), C = D([m.setFloating, i]);
167
- if (!p) return null;
168
- let w = y(f), T = w["aria-labelledby"], E = u === void 0 ? l === void 0 ? T : void 0 : L(u, T);
169
- return /* @__PURE__ */ b(d, { children: /* @__PURE__ */ b(x, {
170
- context: h,
171
- modal: !1,
172
- initialFocus: -1,
173
- returnFocus: !1,
174
- restoreFocus: !0,
175
- children: /* @__PURE__ */ b(t, {
176
- className: s,
177
- styles: r,
178
- sx: c,
179
- children: (e) => /* @__PURE__ */ b("div", {
180
- ...w,
181
- "aria-label": l,
182
- "aria-labelledby": E,
183
- ref: C,
184
- "data-ui": n,
185
- style: {
186
- ...a,
187
- ...g
188
- },
189
- className: e,
190
- children: /* @__PURE__ */ b(S, {
191
- elementsRef: _,
192
- labelsRef: v,
193
- children: /* @__PURE__ */ b(M.Provider, {
194
- value: !0,
195
- children: o
196
- })
197
- })
198
- })
199
- })
200
- }) });
201
- }
202
- function q(e) {
203
- return /* @__PURE__ */ b(K, {
204
- ...e,
205
- family: "Menu",
206
- marker: "menu",
207
- styles: s
208
- });
209
- }
210
- q.displayName = "Menu.Content";
211
- function J({ family: e, marker: n, styles: r, ref: i, onSelect: a, disabled: o = !1, onClick: s, className: c, sx: d, ...f }) {
212
- let { activeIndex: p, requestClose: m, disabledIndices: h, getItemProps: g } = P(e), { ref: _, index: v } = l({ label: o ? null : void 0 }), y = D([_, i]), x = v !== -1 && p === v;
213
- u(v, o, h);
214
- let S = (e) => {
215
- o || (s?.(e), a?.(), e.defaultPrevented || m(!0));
216
- };
217
- return /* @__PURE__ */ b(t, {
218
- className: c,
219
- styles: r,
220
- sx: d,
221
- children: (e) => /* @__PURE__ */ b("button", {
222
- type: "button",
223
- ...g({
224
- ...f,
225
- onClick: S
226
- }),
227
- ref: y,
228
- role: "menuitem",
229
- tabIndex: x ? 0 : -1,
230
- "aria-disabled": o || void 0,
231
- "data-active": x || void 0,
232
- "data-ui": n,
233
- className: e
234
- })
235
- });
236
- }
237
- function Y(e) {
238
- return /* @__PURE__ */ b(J, {
239
- ...e,
240
- family: "Menu",
241
- marker: "menu-item",
242
- styles: B
243
- });
244
- }
245
- Y.displayName = "Menu.Item";
246
- function X({ marker: e, styles: n, ref: r, className: i, sx: a, ...o }) {
247
- return /* @__PURE__ */ b(t, {
248
- className: i,
249
- styles: n,
250
- sx: a,
251
- children: (t) => /* @__PURE__ */ b("div", {
252
- ...o,
253
- ref: r,
254
- role: "separator",
255
- "data-ui": e,
256
- className: t
257
- })
258
- });
259
- }
260
- function Z(e) {
261
- return /* @__PURE__ */ b(X, {
262
- ...e,
263
- marker: "menu-separator",
264
- styles: z
265
- });
266
- }
267
- Z.displayName = "Menu.Separator";
268
- var Q = Object.assign(U, {
269
- Trigger: G,
270
- Content: q,
271
- Item: Y,
272
- Separator: Z
273
- });
274
- //#endregion
275
- export { W as a, X as i, K as n, B as o, J as r, V as s, Q as t };
@@ -1,56 +0,0 @@
1
- 'use client';
2
- import { r as e, t } from "./sx-Dx9JUKp5.js";
3
- import { vars as n } from "@jfrader/tokens/vars";
4
- import { jsx as r } from "@emotion/react/jsx-runtime";
5
- //#region src/components/pill/pill.tsx
6
- var i = e({
7
- display: "inline-flex",
8
- alignItems: "center",
9
- boxSizing: "border-box",
10
- blockSize: n.space[5],
11
- paddingInline: n.space[2],
12
- borderRadius: n.radius.full,
13
- fontSize: n.textSize.xs,
14
- fontWeight: n.fontWeight.medium,
15
- lineHeight: 1,
16
- whiteSpace: "nowrap",
17
- verticalAlign: "middle"
18
- }), a = {
19
- neutral: e({
20
- backgroundColor: n.color.surfaceHover,
21
- color: n.color.textMuted
22
- }),
23
- accent: e({
24
- backgroundColor: n.color.accentSoft,
25
- color: n.color.accentText
26
- }),
27
- success: e({
28
- backgroundColor: n.color.successSoft,
29
- color: n.color.success
30
- }),
31
- warning: e({
32
- backgroundColor: n.color.warningSoft,
33
- color: n.color.warning
34
- }),
35
- danger: e({
36
- backgroundColor: n.color.dangerSoft,
37
- color: n.color.dangerText
38
- })
39
- };
40
- function o({ ref: e, tone: n = "neutral", className: o, sx: s, ...c }) {
41
- return /* @__PURE__ */ r(t, {
42
- className: o,
43
- styles: [i, a[n]],
44
- sx: s,
45
- children: (t) => /* @__PURE__ */ r("span", {
46
- ...c,
47
- ref: e,
48
- "data-ui": "pill",
49
- "data-tone": n,
50
- className: t
51
- })
52
- });
53
- }
54
- o.displayName = "Pill";
55
- //#endregion
56
- export { o as t };
@@ -1,119 +0,0 @@
1
- 'use client';
2
- import { r as e, t } from "./sx-Dx9JUKp5.js";
3
- import { t as n } from "./use-controlled-state-DpeVQZNR.js";
4
- import { n as r } from "./surface-DZ4d-2aL.js";
5
- import { t as i } from "./trigger-style-B1KVC8O1.js";
6
- import { n as a, r as o } from "./overlay-layer-SeUyyEPD.js";
7
- import { t as s } from "./overlay-portal-C4JZFq2M.js";
8
- import { t as c } from "./use-overlay-floating-DvJifLpF.js";
9
- import { createContext as l, useContext as u, useEffect as d, useMemo as f, useRef as p } from "react";
10
- import { vars as m } from "@jfrader/tokens/vars";
11
- import { jsx as h } from "@emotion/react/jsx-runtime";
12
- import { FloatingFocusManager as g, useClick as _, useInteractions as v, useMergeRefs as y, useRole as b } from "@floating-ui/react";
13
- //#region src/components/popover/popover.tsx
14
- var x = l(null);
15
- function S(e) {
16
- let t = u(x);
17
- if (!t) throw Error(`Popover.${e} must be rendered inside <Popover>.`);
18
- return t;
19
- }
20
- var C = e({
21
- ...r,
22
- borderRadius: m.radius.lg,
23
- boxShadow: m.shadow.overlay,
24
- padding: m.space[4],
25
- minInlineSize: "200px",
26
- maxInlineSize: "min(360px, calc(100vw - 32px))",
27
- fontSize: m.textSize.sm
28
- });
29
- function w({ nodeId: e, open: t, defaultOpen: r = !1, onOpenChange: i, placement: a = "bottom", children: s }) {
30
- let [l = !1, u] = n(t, r, i), m = p(!1), { refs: g, floatingStyles: y, context: S } = c({
31
- open: l,
32
- placement: a,
33
- nodeId: e,
34
- onOpenChange: (e, t, n) => {
35
- e || (m.current = n === "escape-key"), u(e);
36
- }
37
- });
38
- d(() => {
39
- !l && m.current && (m.current = !1, g.domReference.current?.focus());
40
- }, [l, g]);
41
- let C = _(S), w = o(S, "container"), T = b(S, { role: "dialog" }), { getReferenceProps: E, getFloatingProps: D } = v([
42
- C,
43
- ...w,
44
- T
45
- ]), O = f(() => ({
46
- open: l,
47
- refs: g,
48
- floatingContext: S,
49
- floatingStyles: y,
50
- getReferenceProps: E,
51
- getFloatingProps: D
52
- }), [
53
- l,
54
- g,
55
- S,
56
- y,
57
- E,
58
- D
59
- ]);
60
- return /* @__PURE__ */ h(x.Provider, {
61
- value: O,
62
- children: s
63
- });
64
- }
65
- function T(e) {
66
- return /* @__PURE__ */ h(a, { children: (t) => /* @__PURE__ */ h(w, {
67
- ...e,
68
- nodeId: t
69
- }) });
70
- }
71
- T.displayName = "Popover";
72
- function E({ ref: e, className: n, sx: r, ...a }) {
73
- let { refs: o, getReferenceProps: s } = S("Trigger"), c = y([o.setReference, e]);
74
- return /* @__PURE__ */ h(t, {
75
- className: n,
76
- styles: i,
77
- sx: r,
78
- children: (e) => /* @__PURE__ */ h("button", {
79
- type: "button",
80
- ...s(a),
81
- ref: c,
82
- "data-ui": "popover-trigger",
83
- className: e
84
- })
85
- });
86
- }
87
- E.displayName = "Popover.Trigger";
88
- function D({ ref: e, style: n, className: r, sx: i, ...a }) {
89
- let { open: o, refs: c, floatingContext: l, floatingStyles: u, getFloatingProps: d } = S("Content"), f = y([c.setFloating, e]);
90
- return o ? /* @__PURE__ */ h(s, { children: /* @__PURE__ */ h(g, {
91
- context: l,
92
- modal: !1,
93
- initialFocus: -1,
94
- returnFocus: !1,
95
- closeOnFocusOut: !1,
96
- children: /* @__PURE__ */ h(t, {
97
- className: r,
98
- styles: C,
99
- sx: i,
100
- children: (e) => /* @__PURE__ */ h("div", {
101
- ...d(a),
102
- ref: f,
103
- "data-ui": "popover",
104
- style: {
105
- ...n,
106
- ...u
107
- },
108
- className: e
109
- })
110
- })
111
- }) }) : null;
112
- }
113
- D.displayName = "Popover.Content";
114
- var O = Object.assign(T, {
115
- Trigger: E,
116
- Content: D
117
- });
118
- //#endregion
119
- export { O as t };