@catiarodrigues/goldfinch 1.0.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.
- package/LICENSE +15 -0
- package/README.md +119 -0
- package/dist/alert-Iba34Kfr.js +72 -0
- package/dist/badge-dMKK_Gm2.js +147 -0
- package/dist/breadcrumbs-CHev-E0K.js +148 -0
- package/dist/button-DDhP5P56.js +40 -0
- package/dist/card-CVUWZOar.js +42 -0
- package/dist/checkbox-BubMDtGW.js +149 -0
- package/dist/collapsible-Bk5IP_KI.js +55 -0
- package/dist/components/alert.mjs +2 -0
- package/dist/components/badge.mjs +2 -0
- package/dist/components/breadcrumbs.mjs +2 -0
- package/dist/components/button.mjs +2 -0
- package/dist/components/card.mjs +2 -0
- package/dist/components/checkbox.mjs +2 -0
- package/dist/components/collapsible.mjs +2 -0
- package/dist/components/copy-to-clipboard.mjs +2 -0
- package/dist/components/dropdown.mjs +2 -0
- package/dist/components/empty-state.mjs +2 -0
- package/dist/components/field.mjs +2 -0
- package/dist/components/grid.mjs +2 -0
- package/dist/components/input-group.mjs +2 -0
- package/dist/components/input.mjs +4 -0
- package/dist/components/label.mjs +2 -0
- package/dist/components/link.mjs +58 -0
- package/dist/components/menubar.mjs +2 -0
- package/dist/components/modal.mjs +2 -0
- package/dist/components/page.mjs +2 -0
- package/dist/components/pagination.mjs +2 -0
- package/dist/components/popover.mjs +2 -0
- package/dist/components/progress.mjs +2 -0
- package/dist/components/radio.mjs +2 -0
- package/dist/components/select.mjs +2 -0
- package/dist/components/sensitive-input.mjs +2 -0
- package/dist/components/sidebar.mjs +2 -0
- package/dist/components/spinner.mjs +3 -0
- package/dist/components/table-of-contents.mjs +2 -0
- package/dist/components/table.mjs +2 -0
- package/dist/components/tabs.mjs +2 -0
- package/dist/components/text.mjs +2 -0
- package/dist/components/toast.mjs +2 -0
- package/dist/components/toggle.mjs +2 -0
- package/dist/components/toolbar.mjs +2 -0
- package/dist/components/tooltip.mjs +2 -0
- package/dist/components/top-navigation.mjs +2 -0
- package/dist/copy-to-clipboard-KXU8jo6k.js +139 -0
- package/dist/dropdown-A5hLlUjr.js +172 -0
- package/dist/empty-state-DuugAIN_.js +76 -0
- package/dist/field-CZb7PLTY.js +47 -0
- package/dist/grid-BFkQ5cmR.js +101 -0
- package/dist/index.mjs +47 -0
- package/dist/input-6C_-SelY.js +48 -0
- package/dist/input-Bo8XL6_f.js +43 -0
- package/dist/input-group-Dm4hKEhq.js +302 -0
- package/dist/input-variants-CZevxTd8.js +41 -0
- package/dist/label-7oCakbyx.js +43 -0
- package/dist/link-provider-H0J4aZPH.js +21 -0
- package/dist/menubar-DyXmaeKZ.js +59 -0
- package/dist/modal-BYQ8MRMy.js +132 -0
- package/dist/page-DOevDFqd.js +60 -0
- package/dist/pagination-C3f16UOC.js +239 -0
- package/dist/popover-3kcRy9HX.js +120 -0
- package/dist/portal-provider-CWX8j9O1.js +15 -0
- package/dist/progress-Ac96hU_C.js +26 -0
- package/dist/radio-C8rcmsbS.js +144 -0
- package/dist/resolve-variant-DWiDeQhX.js +7 -0
- package/dist/select-DaJRanrs.js +178 -0
- package/dist/sensitive-input-BEAOu1A6.js +181 -0
- package/dist/sidebar-CkZxFt33.js +703 -0
- package/dist/skeleton-line-Dh4TDbeq.js +32 -0
- package/dist/spinner-DKzSES7b.js +79 -0
- package/dist/src/components/alert/alert.d.ts +105 -0
- package/dist/src/components/alert/index.d.ts +1 -0
- package/dist/src/components/badge/badge.d.ts +204 -0
- package/dist/src/components/badge/index.d.ts +1 -0
- package/dist/src/components/breadcrumbs/breadcrumbs.d.ts +94 -0
- package/dist/src/components/breadcrumbs/index.d.ts +1 -0
- package/dist/src/components/button/button.d.ts +37 -0
- package/dist/src/components/button/index.d.ts +2 -0
- package/dist/src/components/card/card.d.ts +31 -0
- package/dist/src/components/card/index.d.ts +1 -0
- package/dist/src/components/checkbox/checkbox.d.ts +196 -0
- package/dist/src/components/checkbox/index.d.ts +1 -0
- package/dist/src/components/collapsible/collapsible.d.ts +108 -0
- package/dist/src/components/collapsible/index.d.ts +1 -0
- package/dist/src/components/copy-to-clipboard/copy-to-clipboard.d.ts +86 -0
- package/dist/src/components/copy-to-clipboard/index.d.ts +1 -0
- package/dist/src/components/dropdown/dropdown.d.ts +115 -0
- package/dist/src/components/dropdown/index.d.ts +1 -0
- package/dist/src/components/empty-state/empty-state.d.ts +68 -0
- package/dist/src/components/empty-state/index.d.ts +1 -0
- package/dist/src/components/field/field.d.ts +88 -0
- package/dist/src/components/field/index.d.ts +1 -0
- package/dist/src/components/grid/grid.d.ts +134 -0
- package/dist/src/components/grid/index.d.ts +1 -0
- package/dist/src/components/input/index.d.ts +30 -0
- package/dist/src/components/input/input-area.d.ts +64 -0
- package/dist/src/components/input/input-variants.d.ts +58 -0
- package/dist/src/components/input/input.d.ts +67 -0
- package/dist/src/components/input-group/context.d.ts +95 -0
- package/dist/src/components/input-group/index.d.ts +1 -0
- package/dist/src/components/input-group/input-group-addon.d.ts +14 -0
- package/dist/src/components/input-group/input-group-button.d.ts +35 -0
- package/dist/src/components/input-group/input-group-input.d.ts +8 -0
- package/dist/src/components/input-group/input-group-suffix.d.ts +12 -0
- package/dist/src/components/input-group/input-group.d.ts +42 -0
- package/dist/src/components/label/index.d.ts +1 -0
- package/dist/src/components/label/label.d.ts +66 -0
- package/dist/src/components/link/index.d.ts +1 -0
- package/dist/src/components/link/link.d.ts +65 -0
- package/dist/src/components/menubar/index.d.ts +2 -0
- package/dist/src/components/menubar/menubar.d.ts +65 -0
- package/dist/src/components/menubar/use-menu-navigation.d.ts +7 -0
- package/dist/src/components/modal/index.d.ts +1 -0
- package/dist/src/components/modal/modal.d.ts +204 -0
- package/dist/src/components/page/index.d.ts +1 -0
- package/dist/src/components/page/page.d.ts +65 -0
- package/dist/src/components/pagination/index.d.ts +1 -0
- package/dist/src/components/pagination/pagination.d.ts +240 -0
- package/dist/src/components/popover/index.d.ts +2 -0
- package/dist/src/components/popover/popover.d.ts +177 -0
- package/dist/src/components/progress/index.d.ts +1 -0
- package/dist/src/components/progress/progress.d.ts +43 -0
- package/dist/src/components/radio/index.d.ts +1 -0
- package/dist/src/components/radio/radio.d.ts +276 -0
- package/dist/src/components/select/index.d.ts +1 -0
- package/dist/src/components/select/select.d.ts +283 -0
- package/dist/src/components/sensitive-input/index.d.ts +1 -0
- package/dist/src/components/sensitive-input/sensitive-input.d.ts +93 -0
- package/dist/src/components/sidebar/index.d.ts +1 -0
- package/dist/src/components/sidebar/sidebar.d.ts +579 -0
- package/dist/src/components/spinner/index.d.ts +2 -0
- package/dist/src/components/spinner/skeleton-line.d.ts +11 -0
- package/dist/src/components/spinner/spinner.d.ts +69 -0
- package/dist/src/components/table/index.d.ts +1 -0
- package/dist/src/components/table/table.d.ts +137 -0
- package/dist/src/components/table-of-contents/index.d.ts +1 -0
- package/dist/src/components/table-of-contents/table-of-contents.d.ts +71 -0
- package/dist/src/components/tabs/index.d.ts +2 -0
- package/dist/src/components/tabs/tabs.d.ts +115 -0
- package/dist/src/components/text/index.d.ts +1 -0
- package/dist/src/components/text/text.d.ts +213 -0
- package/dist/src/components/toast/index.d.ts +4 -0
- package/dist/src/components/toast/toast.d.ts +196 -0
- package/dist/src/components/toggle/index.d.ts +1 -0
- package/dist/src/components/toggle/toggle.d.ts +101 -0
- package/dist/src/components/toolbar/index.d.ts +1 -0
- package/dist/src/components/toolbar/toolbar.d.ts +49 -0
- package/dist/src/components/tooltip/index.d.ts +1 -0
- package/dist/src/components/tooltip/tooltip.d.ts +107 -0
- package/dist/src/components/top-navigation/index.d.ts +1 -0
- package/dist/src/components/top-navigation/top-navigation.d.ts +47 -0
- package/dist/src/index.d.ts +67 -0
- package/dist/src/utils/cn.d.ts +3 -0
- package/dist/src/utils/index.d.ts +4 -0
- package/dist/src/utils/link-provider.d.ts +11 -0
- package/dist/src/utils/portal-provider.d.ts +7 -0
- package/dist/src/utils/resolve-variant.d.ts +1 -0
- package/dist/styles/index.css +294 -0
- package/dist/table-CKmEd0O5.js +135 -0
- package/dist/table-of-contents-CuE1aDKE.js +91 -0
- package/dist/tabs-JX7xyFcA.js +101 -0
- package/dist/text-B0EvLge5.js +88 -0
- package/dist/toast-pSr7cFVU.js +274 -0
- package/dist/toggle-C72Skv4q.js +179 -0
- package/dist/toolbar-DtT4MUHB.js +109 -0
- package/dist/tooltip-QfSb4wnI.js +59 -0
- package/dist/top-navigation-DoTeFaXD.js +45 -0
- package/dist/utils.mjs +11 -0
- package/package.json +228 -0
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { cn as e } from "./utils.mjs";
|
|
2
|
+
import { r as t } from "./input-group-Dm4hKEhq.js";
|
|
3
|
+
import { t as n } from "./select-DaJRanrs.js";
|
|
4
|
+
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
import { createContext as o, useContext as s, useEffect as c, useMemo as l, useState as u } from "react";
|
|
6
|
+
import { CaretDoubleLeftIcon as d, CaretDoubleRightIcon as f, CaretLeftIcon as p, CaretRightIcon as m } from "@phosphor-icons/react";
|
|
7
|
+
//#region src/components/pagination/pagination.tsx
|
|
8
|
+
var h = [
|
|
9
|
+
25,
|
|
10
|
+
50,
|
|
11
|
+
100,
|
|
12
|
+
250
|
|
13
|
+
], g = (e, t, n) => Math.min(Math.max(e, t), n), _ = {
|
|
14
|
+
navigation: "Pagination",
|
|
15
|
+
firstPage: "First page",
|
|
16
|
+
previousPage: "Previous page",
|
|
17
|
+
nextPage: "Next page",
|
|
18
|
+
lastPage: "Last page",
|
|
19
|
+
pageNumber: "Page number",
|
|
20
|
+
pageSize: "Page size"
|
|
21
|
+
}, v = { controls: "full" }, y = o(null);
|
|
22
|
+
function b() {
|
|
23
|
+
let e = s(y);
|
|
24
|
+
if (!e) throw Error("Pagination compound components must be used within a Pagination component");
|
|
25
|
+
return e;
|
|
26
|
+
}
|
|
27
|
+
function x({ children: t, className: n }) {
|
|
28
|
+
let { page: o, perPage: s, totalCount: c, pageShowingRange: l } = b(), u = t ? t({
|
|
29
|
+
page: o,
|
|
30
|
+
perPage: s,
|
|
31
|
+
totalCount: c,
|
|
32
|
+
pageShowingRange: l
|
|
33
|
+
}) : c && c > 0 ? /* @__PURE__ */ a(r, { children: [
|
|
34
|
+
"Showing ",
|
|
35
|
+
/* @__PURE__ */ i("span", {
|
|
36
|
+
className: "tabular-nums",
|
|
37
|
+
children: l
|
|
38
|
+
}),
|
|
39
|
+
" of",
|
|
40
|
+
" ",
|
|
41
|
+
/* @__PURE__ */ i("span", {
|
|
42
|
+
className: "tabular-nums",
|
|
43
|
+
children: c
|
|
44
|
+
})
|
|
45
|
+
] }) : null;
|
|
46
|
+
return /* @__PURE__ */ i("div", {
|
|
47
|
+
"data-slot": "pagination-info",
|
|
48
|
+
className: e("text-sm text-goldfinch-subtle", n),
|
|
49
|
+
children: u
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
x.displayName = "Pagination.Info";
|
|
53
|
+
function S({ value: t, onChange: r, options: o = h, label: s = "Per page:", className: c }) {
|
|
54
|
+
let { labels: l } = b();
|
|
55
|
+
return /* @__PURE__ */ a("div", {
|
|
56
|
+
"data-slot": "pagination-page-size",
|
|
57
|
+
className: e("flex items-center gap-2", c),
|
|
58
|
+
children: [s && /* @__PURE__ */ i("span", {
|
|
59
|
+
className: "text-sm text-goldfinch-subtle",
|
|
60
|
+
children: s
|
|
61
|
+
}), /* @__PURE__ */ i(n, {
|
|
62
|
+
"aria-label": l.pageSize,
|
|
63
|
+
value: t,
|
|
64
|
+
onValueChange: (e) => r(e),
|
|
65
|
+
children: o.map((e) => /* @__PURE__ */ i(n.Option, {
|
|
66
|
+
value: e,
|
|
67
|
+
children: e
|
|
68
|
+
}, e))
|
|
69
|
+
})]
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
S.displayName = "Pagination.PageSize";
|
|
73
|
+
function C({ controls: r = v.controls, pageSelector: o = "input", className: s }) {
|
|
74
|
+
let { page: c, maxPage: l, setPage: u, editingPage: h, setEditingPage: _, labels: y } = b();
|
|
75
|
+
return /* @__PURE__ */ i("div", {
|
|
76
|
+
"data-slot": "pagination-controls",
|
|
77
|
+
className: e("grow flex flex-col items-end", s),
|
|
78
|
+
children: /* @__PURE__ */ i("nav", {
|
|
79
|
+
"aria-label": y.navigation,
|
|
80
|
+
children: /* @__PURE__ */ a(t, { children: [
|
|
81
|
+
r === "full" && /* @__PURE__ */ i(t.Button, {
|
|
82
|
+
variant: "secondary",
|
|
83
|
+
"aria-label": y.firstPage,
|
|
84
|
+
disabled: c <= 1,
|
|
85
|
+
onClick: () => {
|
|
86
|
+
u(1), _(1);
|
|
87
|
+
},
|
|
88
|
+
children: /* @__PURE__ */ i(d, { size: 16 })
|
|
89
|
+
}),
|
|
90
|
+
/* @__PURE__ */ i(t.Button, {
|
|
91
|
+
variant: "secondary",
|
|
92
|
+
"aria-label": y.previousPage,
|
|
93
|
+
disabled: c <= 1,
|
|
94
|
+
onClick: () => {
|
|
95
|
+
let e = Math.max(c - 1, 1);
|
|
96
|
+
u(e), _(e);
|
|
97
|
+
},
|
|
98
|
+
children: /* @__PURE__ */ i(p, { size: 16 })
|
|
99
|
+
}),
|
|
100
|
+
r === "full" && (o === "dropdown" ? /* @__PURE__ */ i(n, {
|
|
101
|
+
"aria-label": y.pageNumber,
|
|
102
|
+
className: "rounded-none ring-goldfinch-hairline",
|
|
103
|
+
value: c,
|
|
104
|
+
onValueChange: (e) => {
|
|
105
|
+
let t = e;
|
|
106
|
+
u(t), _(t);
|
|
107
|
+
},
|
|
108
|
+
children: Array.from({ length: l }, (e, t) => t + 1).map((e) => /* @__PURE__ */ i(n.Option, {
|
|
109
|
+
value: e,
|
|
110
|
+
children: e
|
|
111
|
+
}, e))
|
|
112
|
+
}) : /* @__PURE__ */ i(t.Input, {
|
|
113
|
+
style: { width: 50 },
|
|
114
|
+
className: "text-center",
|
|
115
|
+
"aria-label": y.pageNumber,
|
|
116
|
+
value: h,
|
|
117
|
+
onValueChange: (e) => {
|
|
118
|
+
_(Number(e));
|
|
119
|
+
},
|
|
120
|
+
onBlur: () => {
|
|
121
|
+
let e = g(h, 1, l);
|
|
122
|
+
u(e), _(e);
|
|
123
|
+
},
|
|
124
|
+
onKeyDown: (e) => {
|
|
125
|
+
if (e.key === "Enter") {
|
|
126
|
+
let e = g(h, 1, l);
|
|
127
|
+
u(e), _(e);
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
autoComplete: "off",
|
|
131
|
+
"data-1p-ignore": !0,
|
|
132
|
+
"data-lpignore": "true",
|
|
133
|
+
"data-form-type": "other"
|
|
134
|
+
})),
|
|
135
|
+
/* @__PURE__ */ i(t.Button, {
|
|
136
|
+
variant: "secondary",
|
|
137
|
+
"aria-label": y.nextPage,
|
|
138
|
+
disabled: c === l,
|
|
139
|
+
onClick: () => {
|
|
140
|
+
let e = Math.min(c + 1, l);
|
|
141
|
+
u(e), _(e);
|
|
142
|
+
},
|
|
143
|
+
children: /* @__PURE__ */ i(m, { size: 16 })
|
|
144
|
+
}),
|
|
145
|
+
r === "full" && /* @__PURE__ */ i(t.Button, {
|
|
146
|
+
variant: "secondary",
|
|
147
|
+
"aria-label": y.lastPage,
|
|
148
|
+
disabled: c === l,
|
|
149
|
+
onClick: () => {
|
|
150
|
+
u(l), _(l);
|
|
151
|
+
},
|
|
152
|
+
children: /* @__PURE__ */ i(f, { size: 16 })
|
|
153
|
+
})
|
|
154
|
+
] })
|
|
155
|
+
})
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
C.displayName = "Pagination.Controls";
|
|
159
|
+
function w({ className: t }) {
|
|
160
|
+
return /* @__PURE__ */ i("div", {
|
|
161
|
+
"data-slot": "pagination-separator",
|
|
162
|
+
className: e("mx-2 h-6 border-l border-goldfinch-hairline", t)
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
w.displayName = "Pagination.Separator";
|
|
166
|
+
function T(t) {
|
|
167
|
+
let { page: n = 1, perPage: o, totalCount: s, setPage: d, children: f, className: p, labels: m } = t, h = "text" in t ? t.text : void 0, g = "controls" in t ? t.controls ?? v.controls : v.controls, [b, x] = u(1), S = l(() => ({
|
|
168
|
+
..._,
|
|
169
|
+
...m
|
|
170
|
+
}), [m]);
|
|
171
|
+
c(() => {
|
|
172
|
+
x(n);
|
|
173
|
+
}, [n]);
|
|
174
|
+
let w = l(() => {
|
|
175
|
+
let e = n * (o ?? 1) - (o ?? 0) + 1, t = Math.min(n * (o ?? 0), s ?? 0);
|
|
176
|
+
return Number.isNaN(e) && (e = 0), Number.isNaN(t) && (t = 0), `${e}-${t}`;
|
|
177
|
+
}, [
|
|
178
|
+
n,
|
|
179
|
+
o,
|
|
180
|
+
s
|
|
181
|
+
]), T = {
|
|
182
|
+
page: n,
|
|
183
|
+
perPage: o,
|
|
184
|
+
totalCount: s,
|
|
185
|
+
maxPage: l(() => Math.ceil((s ?? 1) / (o ?? 1)), [s, o]),
|
|
186
|
+
pageShowingRange: w,
|
|
187
|
+
setPage: d,
|
|
188
|
+
editingPage: b,
|
|
189
|
+
setEditingPage: x,
|
|
190
|
+
labels: S
|
|
191
|
+
};
|
|
192
|
+
return f ? /* @__PURE__ */ i(y.Provider, {
|
|
193
|
+
value: T,
|
|
194
|
+
children: /* @__PURE__ */ i("div", {
|
|
195
|
+
"data-slot": "pagination",
|
|
196
|
+
className: e("flex items-center gap-2 w-full", p),
|
|
197
|
+
children: f
|
|
198
|
+
})
|
|
199
|
+
}) : /* @__PURE__ */ i(y.Provider, {
|
|
200
|
+
value: T,
|
|
201
|
+
children: /* @__PURE__ */ a("div", {
|
|
202
|
+
"data-slot": "pagination",
|
|
203
|
+
className: e("flex items-center gap-2 w-full", p),
|
|
204
|
+
children: [/* @__PURE__ */ i("div", {
|
|
205
|
+
"aria-live": "polite",
|
|
206
|
+
"aria-atomic": "true",
|
|
207
|
+
"data-slot": "pagination-info",
|
|
208
|
+
className: "grow text-sm text-goldfinch-subtle",
|
|
209
|
+
children: h ? h({
|
|
210
|
+
page: n,
|
|
211
|
+
perPage: o,
|
|
212
|
+
totalCount: s,
|
|
213
|
+
pageShowingRange: w
|
|
214
|
+
}) : s && s > 0 ? /* @__PURE__ */ a(r, { children: [
|
|
215
|
+
"Showing ",
|
|
216
|
+
/* @__PURE__ */ i("span", {
|
|
217
|
+
className: "tabular-nums",
|
|
218
|
+
children: w
|
|
219
|
+
}),
|
|
220
|
+
" of",
|
|
221
|
+
" ",
|
|
222
|
+
/* @__PURE__ */ i("span", {
|
|
223
|
+
className: "tabular-nums",
|
|
224
|
+
children: s
|
|
225
|
+
})
|
|
226
|
+
] }) : null
|
|
227
|
+
}), /* @__PURE__ */ i(C, { controls: g })]
|
|
228
|
+
})
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
T.displayName = "Pagination";
|
|
232
|
+
var E = Object.assign(T, {
|
|
233
|
+
Info: x,
|
|
234
|
+
PageSize: S,
|
|
235
|
+
Controls: C,
|
|
236
|
+
Separator: w
|
|
237
|
+
});
|
|
238
|
+
//#endregion
|
|
239
|
+
export { E as t };
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { cn as e } from "./utils.mjs";
|
|
2
|
+
import { n as t } from "./portal-provider-CWX8j9O1.js";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import { Popover as i } from "@base-ui/react/popover";
|
|
5
|
+
//#region src/components/popover/popover.tsx
|
|
6
|
+
var a = { side: {
|
|
7
|
+
top: {
|
|
8
|
+
classes: "",
|
|
9
|
+
description: "Popover appears above the trigger"
|
|
10
|
+
},
|
|
11
|
+
bottom: {
|
|
12
|
+
classes: "",
|
|
13
|
+
description: "Popover appears below the trigger"
|
|
14
|
+
},
|
|
15
|
+
left: {
|
|
16
|
+
classes: "",
|
|
17
|
+
description: "Popover appears to the left of the trigger"
|
|
18
|
+
},
|
|
19
|
+
right: {
|
|
20
|
+
classes: "",
|
|
21
|
+
description: "Popover appears to the right of the trigger"
|
|
22
|
+
}
|
|
23
|
+
} }, o = { side: "bottom" };
|
|
24
|
+
function s({ children: e, ...t }) {
|
|
25
|
+
return /* @__PURE__ */ n(i.Root, {
|
|
26
|
+
...t,
|
|
27
|
+
children: e
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
s.displayName = "Popover";
|
|
31
|
+
function c({ children: e, className: t, asChild: r, render: a, ...o }) {
|
|
32
|
+
let s = a ?? (r ? e : void 0);
|
|
33
|
+
return /* @__PURE__ */ n(i.Trigger, {
|
|
34
|
+
"data-goldfinch-component": "Popover",
|
|
35
|
+
"data-goldfinch-part": "trigger",
|
|
36
|
+
className: t,
|
|
37
|
+
render: s,
|
|
38
|
+
...o,
|
|
39
|
+
children: r ? void 0 : e
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
c.displayName = "Popover.Trigger";
|
|
43
|
+
function l({ children: a, side: s = o.side, align: c = "center", sideOffset: l = 8, alignOffset: u = 0, positionMethod: d = "absolute", anchor: f, className: m, container: h }) {
|
|
44
|
+
let g = t(), _ = h ?? g ?? void 0;
|
|
45
|
+
return /* @__PURE__ */ n(i.Portal, {
|
|
46
|
+
container: _,
|
|
47
|
+
children: /* @__PURE__ */ n(i.Positioner, {
|
|
48
|
+
anchor: f,
|
|
49
|
+
align: c,
|
|
50
|
+
alignOffset: u,
|
|
51
|
+
side: s,
|
|
52
|
+
sideOffset: l,
|
|
53
|
+
positionMethod: d,
|
|
54
|
+
children: /* @__PURE__ */ r(i.Popup, {
|
|
55
|
+
className: e("flex origin-(--transform-origin) flex-col rounded-lg bg-goldfinch-base px-4 py-3 text-sm text-goldfinch-default", "shadow-lg shadow-goldfinch-tip-shadow outline outline-goldfinch-fill", "transition-[transform,scale,opacity] duration-150", "data-starting-style:scale-90 data-starting-style:opacity-0", "data-ending-style:scale-90 data-ending-style:opacity-0", "data-instant:duration-0", "goldfinch-popover-popup", m),
|
|
56
|
+
children: [/* @__PURE__ */ n(i.Arrow, {
|
|
57
|
+
className: e("flex", "data-[side=bottom]:-top-2", "data-[side=left]:right-[-13px] data-[side=left]:rotate-90", "data-[side=right]:left-[-13px] data-[side=right]:-rotate-90", "data-[side=top]:-bottom-2 data-[side=top]:rotate-180"),
|
|
58
|
+
children: /* @__PURE__ */ n(p, {})
|
|
59
|
+
}), a]
|
|
60
|
+
})
|
|
61
|
+
})
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
l.displayName = "Popover.Content";
|
|
65
|
+
function u({ className: t, ...r }) {
|
|
66
|
+
return /* @__PURE__ */ n(i.Title, {
|
|
67
|
+
className: e("m-0 text-base leading-6 font-medium", t),
|
|
68
|
+
...r
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
u.displayName = "Popover.Title";
|
|
72
|
+
function d({ className: t, ...r }) {
|
|
73
|
+
return /* @__PURE__ */ n(i.Description, {
|
|
74
|
+
className: e("m-0 text-base leading-6 text-goldfinch-subtle", t),
|
|
75
|
+
...r
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
d.displayName = "Popover.Description";
|
|
79
|
+
function f({ children: e, className: t, asChild: r, render: a, ...o }) {
|
|
80
|
+
let s = a ?? (r ? e : void 0);
|
|
81
|
+
return /* @__PURE__ */ n(i.Close, {
|
|
82
|
+
className: t,
|
|
83
|
+
render: s,
|
|
84
|
+
...o,
|
|
85
|
+
children: r ? void 0 : e
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
f.displayName = "Popover.Close";
|
|
89
|
+
function p(e) {
|
|
90
|
+
return /* @__PURE__ */ r("svg", {
|
|
91
|
+
width: "20",
|
|
92
|
+
height: "10",
|
|
93
|
+
viewBox: "0 0 20 10",
|
|
94
|
+
fill: "none",
|
|
95
|
+
...e,
|
|
96
|
+
children: [
|
|
97
|
+
/* @__PURE__ */ n("path", {
|
|
98
|
+
d: "M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z",
|
|
99
|
+
className: "fill-goldfinch-base"
|
|
100
|
+
}),
|
|
101
|
+
/* @__PURE__ */ n("path", {
|
|
102
|
+
d: "M8.99542 1.85876C9.75604 1.17425 10.9106 1.17422 11.6713 1.85878L16.5281 6.22989C17.0789 6.72568 17.7938 7.00001 18.5349 7.00001L15.89 7L11.0023 2.60207C10.622 2.2598 10.0447 2.2598 9.66436 2.60207L4.77734 7L2.13171 7.00001C2.87284 7.00001 3.58774 6.72568 4.13861 6.22989L8.99542 1.85876Z",
|
|
103
|
+
className: "fill-goldfinch-tip-shadow"
|
|
104
|
+
}),
|
|
105
|
+
/* @__PURE__ */ n("path", {
|
|
106
|
+
d: "M10.3333 3.34539L5.47654 7.71648C4.55842 8.54279 3.36693 9 2.13172 9H0V8H2.13172C3.11989 8 4.07308 7.63423 4.80758 6.97318L9.66437 2.60207C10.0447 2.25979 10.622 2.2598 11.0023 2.60207L15.8591 6.97318C16.5936 7.63423 17.5468 8 18.5349 8H20V9H18.5349C17.2998 9 16.1083 8.54278 15.1901 7.71648L10.3333 3.34539Z",
|
|
107
|
+
className: "fill-goldfinch-tip-stroke"
|
|
108
|
+
})
|
|
109
|
+
]
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
var m = Object.assign(s, {
|
|
113
|
+
Trigger: c,
|
|
114
|
+
Content: l,
|
|
115
|
+
Title: u,
|
|
116
|
+
Description: d,
|
|
117
|
+
Close: f
|
|
118
|
+
});
|
|
119
|
+
//#endregion
|
|
120
|
+
export { l as a, u as c, f as i, c as l, a as n, d as o, m as r, s, o as t };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as t, useContext as n } from "react";
|
|
3
|
+
//#region src/utils/portal-provider.tsx
|
|
4
|
+
var r = t(null);
|
|
5
|
+
function i({ container: t, children: n }) {
|
|
6
|
+
return /* @__PURE__ */ e(r.Provider, {
|
|
7
|
+
value: t,
|
|
8
|
+
children: n
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
function a() {
|
|
12
|
+
return n(r);
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { a as n, i as t };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { cn as e } from "./utils.mjs";
|
|
2
|
+
import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
3
|
+
import { Meter as i } from "@base-ui/react/meter";
|
|
4
|
+
//#region src/components/progress/progress.tsx
|
|
5
|
+
function a({ value: a, customValue: o, label: s, showValue: c = !0, className: l, trackClassName: u, indicatorClassName: d, ...f }) {
|
|
6
|
+
return /* @__PURE__ */ r(i.Root, {
|
|
7
|
+
value: a,
|
|
8
|
+
...f,
|
|
9
|
+
className: e("flex w-full flex-col gap-2", l),
|
|
10
|
+
children: [/* @__PURE__ */ r("div", {
|
|
11
|
+
className: "flex items-center justify-between gap-4",
|
|
12
|
+
children: [/* @__PURE__ */ n(i.Label, {
|
|
13
|
+
className: "text-xs text-goldfinch-subtle",
|
|
14
|
+
children: s
|
|
15
|
+
}), o ? /* @__PURE__ */ n("span", {
|
|
16
|
+
className: "text-sm font-medium text-goldfinch-default tabular-nums",
|
|
17
|
+
children: o
|
|
18
|
+
}) : /* @__PURE__ */ n(t, { children: c && /* @__PURE__ */ n(i.Value, { className: "text-sm font-medium text-goldfinch-default tabular-nums" }) })]
|
|
19
|
+
}), /* @__PURE__ */ n(i.Track, {
|
|
20
|
+
className: e("relative h-2 w-full overflow-hidden rounded-full bg-goldfinch-fill", u),
|
|
21
|
+
children: /* @__PURE__ */ n(i.Indicator, { className: e("absolute inset-y-0 left-0 rounded-full bg-linear-to-r from-goldfinch-brand via-goldfinch-brand to-goldfinch-brand transition-[width] duration-300 ease-out", d) })
|
|
22
|
+
})]
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { a as t };
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { cn as e } from "./utils.mjs";
|
|
2
|
+
import { t } from "./resolve-variant-DWiDeQhX.js";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import { createContext as i, forwardRef as a, useContext as o } from "react";
|
|
5
|
+
import { Fieldset as s } from "@base-ui/react/fieldset";
|
|
6
|
+
import { RadioGroup as c } from "@base-ui/react/radio-group";
|
|
7
|
+
import { Radio as l } from "@base-ui/react/radio";
|
|
8
|
+
//#region src/components/radio/radio.tsx
|
|
9
|
+
var u = {
|
|
10
|
+
variant: {
|
|
11
|
+
default: {
|
|
12
|
+
classes: "ring-goldfinch-hairline",
|
|
13
|
+
description: "Default radio appearance"
|
|
14
|
+
},
|
|
15
|
+
error: {
|
|
16
|
+
classes: "ring-goldfinch-danger",
|
|
17
|
+
description: "Error state for validation failures"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
appearance: {
|
|
21
|
+
default: {
|
|
22
|
+
classes: "",
|
|
23
|
+
description: "Standard inline radio item"
|
|
24
|
+
},
|
|
25
|
+
card: {
|
|
26
|
+
classes: "rounded-lg border border-goldfinch-hairline bg-goldfinch-base p-3 transition-colors hover:bg-goldfinch-tint has-[[data-checked]]:border-goldfinch-interact has-[[data-checked]]:bg-goldfinch-tint",
|
|
27
|
+
description: "Choice card appearance with border, padding, and highlighted selection state"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}, d = {
|
|
31
|
+
variant: "default",
|
|
32
|
+
appearance: "default"
|
|
33
|
+
};
|
|
34
|
+
function f({ variant: n = d.variant, appearance: r = d.appearance } = {}) {
|
|
35
|
+
return e(t(u.variant, n, d.variant).classes, t(u.appearance, r, d.appearance).classes);
|
|
36
|
+
}
|
|
37
|
+
var p = i({
|
|
38
|
+
controlPosition: void 0,
|
|
39
|
+
appearance: "default"
|
|
40
|
+
});
|
|
41
|
+
function m({ className: t, disabled: i, variant: a = "default", appearance: s, label: c, description: u, value: d }, f) {
|
|
42
|
+
let { controlPosition: m, appearance: h } = o(p), g = (s ?? h) === "card", _ = m ?? (g ? "end" : "start");
|
|
43
|
+
return g ? /* @__PURE__ */ r("label", {
|
|
44
|
+
"data-goldfinch-component": "Radio",
|
|
45
|
+
"data-goldfinch-part": "item-label",
|
|
46
|
+
className: e("m-0 group relative flex items-start gap-3 rounded-lg border border-goldfinch-hairline bg-goldfinch-base p-3 transition-colors has-[[data-checked]]:border-goldfinch-interact has-[[data-checked]]:bg-goldfinch-tint", _ === "start" && "flex-row-reverse", a === "error" && "border-goldfinch-danger has-[[data-checked]]:border-goldfinch-danger has-[[data-checked]]:bg-goldfinch-base", i ? "cursor-not-allowed opacity-50" : e("has-[[data-disabled]]:cursor-not-allowed has-[[data-disabled]]:opacity-50 cursor-pointer", a !== "error" && "hover:not-has-[[data-disabled]]:bg-goldfinch-tint"), t),
|
|
47
|
+
children: [/* @__PURE__ */ r("div", {
|
|
48
|
+
className: "flex min-w-0 flex-1 flex-col gap-0.5",
|
|
49
|
+
children: [/* @__PURE__ */ n("span", {
|
|
50
|
+
className: "text-base font-medium text-goldfinch-default",
|
|
51
|
+
children: c
|
|
52
|
+
}), u && /* @__PURE__ */ n("span", {
|
|
53
|
+
className: "text-sm text-goldfinch-subtle",
|
|
54
|
+
children: u
|
|
55
|
+
})]
|
|
56
|
+
}), /* @__PURE__ */ n(l.Root, {
|
|
57
|
+
ref: f,
|
|
58
|
+
"data-goldfinch-component": "Radio",
|
|
59
|
+
"data-goldfinch-part": "item",
|
|
60
|
+
value: d,
|
|
61
|
+
disabled: i,
|
|
62
|
+
className: e("relative mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full border-0 bg-goldfinch-base ring ring-2 focus:outline-none focus:ring-goldfinch-focus focus-visible:ring-2 focus-visible:ring-goldfinch-brand", a === "error" ? "ring-goldfinch-danger" : "ring-goldfinch-line", !i && a !== "error" && "group-hover:ring-goldfinch-hairline focus-visible:outline-offset-3", !i && a === "error" && "focus-visible:outline-offset-3", "data-[checked]:bg-goldfinch-contrast"),
|
|
63
|
+
children: /* @__PURE__ */ n(l.Indicator, {
|
|
64
|
+
keepMounted: !0,
|
|
65
|
+
className: "flex items-center justify-center",
|
|
66
|
+
children: /* @__PURE__ */ n("span", { className: "h-2 w-2 rounded-full bg-goldfinch-base" })
|
|
67
|
+
})
|
|
68
|
+
})]
|
|
69
|
+
}) : /* @__PURE__ */ r("label", {
|
|
70
|
+
"data-goldfinch-component": "Radio",
|
|
71
|
+
"data-goldfinch-part": "item-label",
|
|
72
|
+
className: e("m-0 group relative inline-flex items-start gap-2", _ === "end" && "flex-row-reverse justify-end", i ? "cursor-not-allowed opacity-50" : "cursor-pointer", t),
|
|
73
|
+
children: [/* @__PURE__ */ n(l.Root, {
|
|
74
|
+
ref: f,
|
|
75
|
+
"data-goldfinch-component": "Radio",
|
|
76
|
+
"data-goldfinch-part": "item",
|
|
77
|
+
value: d,
|
|
78
|
+
disabled: i,
|
|
79
|
+
className: e("relative mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full border-0 bg-goldfinch-base ring focus:outline-none after:absolute after:-inset-x-3 after:-inset-y-2", a === "error" ? "ring-goldfinch-danger" : "ring-goldfinch-line", !i && a !== "error" && "group-hover:ring-goldfinch-hairline focus:ring-goldfinch-focus focus:ring-2 focus-visible:ring-2 focus-visible:ring-goldfinch-brand focus-visible:outline-offset-3", !i && a === "error" && "focus:ring-goldfinch-focus focus:ring-2 focus-visible:ring-2 focus-visible:ring-goldfinch-brand focus-visible:outline-offset-3", "data-[checked]:bg-goldfinch-contrast"),
|
|
80
|
+
children: /* @__PURE__ */ n(l.Indicator, {
|
|
81
|
+
keepMounted: !0,
|
|
82
|
+
className: "flex items-center justify-center",
|
|
83
|
+
children: /* @__PURE__ */ n("span", { className: "h-2 w-2 rounded-full bg-goldfinch-base" })
|
|
84
|
+
})
|
|
85
|
+
}), /* @__PURE__ */ n("span", {
|
|
86
|
+
className: "text-base text-goldfinch-default",
|
|
87
|
+
children: c
|
|
88
|
+
})]
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
var h = a(m);
|
|
92
|
+
h.displayName = "Radio.Item";
|
|
93
|
+
function g({ children: t, className: r }) {
|
|
94
|
+
return /* @__PURE__ */ n(s.Legend, {
|
|
95
|
+
className: e("text-base font-medium text-goldfinch-default", r),
|
|
96
|
+
children: t
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
g.displayName = "Radio.Legend";
|
|
100
|
+
function _({ legend: t, children: i, orientation: a = "vertical", appearance: o = "default", error: l, description: u, defaultValue: d, value: f, onValueChange: m, disabled: h, controlPosition: g, name: _, className: v }) {
|
|
101
|
+
return /* @__PURE__ */ n(p.Provider, {
|
|
102
|
+
value: {
|
|
103
|
+
controlPosition: g,
|
|
104
|
+
appearance: o
|
|
105
|
+
},
|
|
106
|
+
children: /* @__PURE__ */ n(c, {
|
|
107
|
+
defaultValue: d,
|
|
108
|
+
value: f,
|
|
109
|
+
onValueChange: (e, t) => m?.(e, t),
|
|
110
|
+
disabled: h,
|
|
111
|
+
name: _,
|
|
112
|
+
children: /* @__PURE__ */ r(s.Root, {
|
|
113
|
+
disabled: h,
|
|
114
|
+
className: e("flex flex-col gap-4", v),
|
|
115
|
+
children: [
|
|
116
|
+
t && /* @__PURE__ */ n(s.Legend, {
|
|
117
|
+
className: "text-base font-medium text-goldfinch-default",
|
|
118
|
+
children: t
|
|
119
|
+
}),
|
|
120
|
+
/* @__PURE__ */ n("div", {
|
|
121
|
+
className: e(a === "vertical" ? e("flex flex-col", o === "card" ? "gap-3" : "gap-2") : o === "card" ? "grid grid-cols-2 gap-3" : "flex flex-row flex-wrap gap-2"),
|
|
122
|
+
children: i
|
|
123
|
+
}),
|
|
124
|
+
l && /* @__PURE__ */ n("p", {
|
|
125
|
+
className: "text-sm text-goldfinch-danger",
|
|
126
|
+
children: l
|
|
127
|
+
}),
|
|
128
|
+
u && /* @__PURE__ */ n("p", {
|
|
129
|
+
className: "text-sm text-goldfinch-subtle",
|
|
130
|
+
children: u
|
|
131
|
+
})
|
|
132
|
+
]
|
|
133
|
+
})
|
|
134
|
+
})
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
_.displayName = "Radio.Group";
|
|
138
|
+
var v = Object.assign(_, {
|
|
139
|
+
Item: h,
|
|
140
|
+
Group: _,
|
|
141
|
+
Legend: g
|
|
142
|
+
});
|
|
143
|
+
//#endregion
|
|
144
|
+
export { f as a, _ as i, u as n, v as r, d as t };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region src/utils/resolve-variant.ts
|
|
2
|
+
function e(e, t, n) {
|
|
3
|
+
let r = e[t];
|
|
4
|
+
return r === void 0 ? (process.env.NODE_ENV !== "production" && console.warn(`[goldfinch] Unknown variant "${t}". Expected one of: ${Object.keys(e).join(", ")}. Falling back to "${n}".`), e[n]) : r;
|
|
5
|
+
}
|
|
6
|
+
//#endregion
|
|
7
|
+
export { e as t };
|