@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,172 @@
|
|
|
1
|
+
import { cn as e } from "./utils.mjs";
|
|
2
|
+
import { t } from "./resolve-variant-DWiDeQhX.js";
|
|
3
|
+
import { n } from "./portal-provider-CWX8j9O1.js";
|
|
4
|
+
import { n as r } from "./link-provider-H0J4aZPH.js";
|
|
5
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
import * as s from "react";
|
|
7
|
+
import { CaretRightIcon as c } from "@phosphor-icons/react";
|
|
8
|
+
import { Menu as l } from "@base-ui/react/menu";
|
|
9
|
+
//#region src/components/dropdown/dropdown.tsx
|
|
10
|
+
var u = { variant: {
|
|
11
|
+
default: {
|
|
12
|
+
classes: "",
|
|
13
|
+
description: "Default dropdown item appearance"
|
|
14
|
+
},
|
|
15
|
+
danger: {
|
|
16
|
+
classes: "text-goldfinch-danger data-highlighted:bg-goldfinch-danger/5 data-highlighted:text-goldfinch-danger",
|
|
17
|
+
description: "Destructive action item"
|
|
18
|
+
}
|
|
19
|
+
} }, d = { variant: "default" };
|
|
20
|
+
function f({ variant: n = d.variant } = {}) {
|
|
21
|
+
return e(t(u.variant, n, d.variant).classes);
|
|
22
|
+
}
|
|
23
|
+
var p = s.forwardRef(({ className: t, inset: n, children: r, icon: i, ...s }, u) => /* @__PURE__ */ o(l.SubmenuTrigger, {
|
|
24
|
+
ref: u,
|
|
25
|
+
"data-goldfinch-component": "DropdownMenu",
|
|
26
|
+
"data-goldfinch-part": "submenu-trigger",
|
|
27
|
+
className: e("flex cursor-default items-center rounded-sm text-base outline-hidden select-none", "px-2 py-1.5", "focus:bg-goldfinch-tint focus:ring-goldfinch-focus/50 focus-visible:ring-2 focus-visible:ring-goldfinch-brand", "data-[state=open]:bg-goldfinch-tint", n && "pl-8", t),
|
|
28
|
+
...s,
|
|
29
|
+
children: [
|
|
30
|
+
i && /* @__PURE__ */ a(i, { className: "mr-2 h-4 w-4" }),
|
|
31
|
+
r,
|
|
32
|
+
/* @__PURE__ */ a(c, { className: "ml-auto h-4 w-4" })
|
|
33
|
+
]
|
|
34
|
+
}));
|
|
35
|
+
p.displayName = l.SubmenuTrigger.displayName;
|
|
36
|
+
var m = s.forwardRef(({ className: t, sideOffset: r = 8, children: i, container: o, ...s }, c) => {
|
|
37
|
+
let u = n(), d = o ?? u ?? void 0;
|
|
38
|
+
return /* @__PURE__ */ a(l.Portal, {
|
|
39
|
+
container: d,
|
|
40
|
+
children: /* @__PURE__ */ a(l.Positioner, {
|
|
41
|
+
ref: c,
|
|
42
|
+
sideOffset: r,
|
|
43
|
+
...s,
|
|
44
|
+
children: /* @__PURE__ */ a(l.Popup, {
|
|
45
|
+
className: e("overflow-hidden bg-goldfinch-control text-goldfinch-default", "rounded-lg shadow-lg ring ring-goldfinch-line", "min-w-36 p-1.5", "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", "data-[side=bottom]:slide-in-from-top-2", "data-[side=left]:slide-in-from-right-2", "data-[side=right]:slide-in-from-left-2", "data-[side=top]:slide-in-from-bottom-2", "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95", t),
|
|
46
|
+
children: i
|
|
47
|
+
})
|
|
48
|
+
})
|
|
49
|
+
});
|
|
50
|
+
}), h = (e) => e ? s.isValidElement(e) ? e : /* @__PURE__ */ a(e, { className: "mr-2 h-4 w-4" }) : null, g = s.forwardRef(({ className: t, inset: n, icon: c, children: u, selected: d, render: p, href: m, variant: g = "default", ..._ }, v) => {
|
|
51
|
+
let y = r(), b = s.useMemo(() => /* @__PURE__ */ o(i, { children: [c && h(c), u] }), [c, u]), x = s.useMemo(() => {
|
|
52
|
+
if (!m) return;
|
|
53
|
+
let t = /^(https?:)?\/\//.test(m), n = e("flex items-center", g === "danger" && "text-goldfinch-danger data-highlighted:bg-goldfinch-danger/5 data-highlighted:text-goldfinch-danger");
|
|
54
|
+
return t ? /* @__PURE__ */ a("a", {
|
|
55
|
+
className: e(n, "w-full text-inherit! no-underline!"),
|
|
56
|
+
href: m,
|
|
57
|
+
target: "_blank",
|
|
58
|
+
rel: "noreferrer",
|
|
59
|
+
onClick: (e) => e.stopPropagation(),
|
|
60
|
+
children: b
|
|
61
|
+
}) : /* @__PURE__ */ a(y, {
|
|
62
|
+
className: e(n, "w-full text-inherit! no-underline!"),
|
|
63
|
+
href: m,
|
|
64
|
+
to: m,
|
|
65
|
+
onClick: (e) => e.stopPropagation(),
|
|
66
|
+
children: b
|
|
67
|
+
});
|
|
68
|
+
}, [
|
|
69
|
+
m,
|
|
70
|
+
b,
|
|
71
|
+
g,
|
|
72
|
+
y
|
|
73
|
+
]), S = m || p;
|
|
74
|
+
return /* @__PURE__ */ a(l.Item, {
|
|
75
|
+
ref: v,
|
|
76
|
+
"data-goldfinch-component": "DropdownMenu",
|
|
77
|
+
"data-goldfinch-part": "item",
|
|
78
|
+
className: e("relative flex cursor-default items-center rounded-md px-2 py-1.5 text-base outline-hidden select-none focus:text-goldfinch-default focus:ring-goldfinch-focus/50 focus-visible:ring-2 focus-visible:ring-goldfinch-brand data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-goldfinch-overlay", d && "bg-goldfinch-tint", n && "pl-8", f({ variant: g }), t),
|
|
79
|
+
render: m ? x : p,
|
|
80
|
+
..._,
|
|
81
|
+
children: S ? void 0 : b
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
g.displayName = l.Item.displayName;
|
|
85
|
+
var _ = s.forwardRef(({ className: t, inset: n, icon: r, children: i, variant: a = "default", ...s }, c) => /* @__PURE__ */ o(l.LinkItem, {
|
|
86
|
+
ref: c,
|
|
87
|
+
"data-goldfinch-component": "DropdownMenu",
|
|
88
|
+
"data-goldfinch-part": "link-item",
|
|
89
|
+
className: e("relative flex cursor-default items-center rounded-md px-2 py-1.5 text-base outline-hidden select-none", "focus:text-goldfinch-default focus:ring-goldfinch-focus/50 focus-visible:ring-2 focus-visible:ring-goldfinch-brand data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-goldfinch-overlay", "text-inherit no-underline", n && "pl-8", f({ variant: a }), t),
|
|
90
|
+
...s,
|
|
91
|
+
children: [r && h(r), i]
|
|
92
|
+
}));
|
|
93
|
+
_.displayName = "DropdownMenuLinkItem";
|
|
94
|
+
var v = s.forwardRef(({ className: t, children: n, checked: r, ...i }, s) => /* @__PURE__ */ o(l.CheckboxItem, {
|
|
95
|
+
ref: s,
|
|
96
|
+
"data-goldfinch-component": "DropdownMenu",
|
|
97
|
+
"data-goldfinch-part": "checkbox-item",
|
|
98
|
+
className: e("relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-base outline-hidden transition-colors select-none focus:bg-goldfinch-tint focus:text-goldfinch-default focus:ring-goldfinch-focus/50 focus-visible:ring-2 focus-visible:ring-goldfinch-brand data-disabled:pointer-events-none data-disabled:opacity-50", t),
|
|
99
|
+
checked: r,
|
|
100
|
+
...i,
|
|
101
|
+
children: [/* @__PURE__ */ a(l.CheckboxItemIndicator, { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center bg-goldfinch-contrast rounded-sm" }), n]
|
|
102
|
+
}));
|
|
103
|
+
v.displayName = l.CheckboxItem.displayName;
|
|
104
|
+
var y = s.forwardRef(({ className: t, inset: n, ...r }, i) => /* @__PURE__ */ a(l.GroupLabel, {
|
|
105
|
+
ref: i,
|
|
106
|
+
className: e("px-2 py-1.5 text-base font-semibold", n && "pl-8", t),
|
|
107
|
+
...r
|
|
108
|
+
}));
|
|
109
|
+
y.displayName = l.GroupLabel.displayName;
|
|
110
|
+
var b = s.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ a(l.Separator, {
|
|
111
|
+
ref: r,
|
|
112
|
+
className: e("-mx-1 my-1 h-px bg-goldfinch-hairline", t),
|
|
113
|
+
...n
|
|
114
|
+
}));
|
|
115
|
+
b.displayName = l.Separator.displayName;
|
|
116
|
+
var x = ({ className: t, ...n }) => /* @__PURE__ */ a("span", {
|
|
117
|
+
className: e("ml-auto text-xs tracking-widest opacity-60", t),
|
|
118
|
+
...n
|
|
119
|
+
});
|
|
120
|
+
x.displayName = "DropdownMenuShortcut";
|
|
121
|
+
var S = s.forwardRef(({ className: t, children: n, inset: r, icon: i, ...a }, s) => /* @__PURE__ */ o(l.RadioItem, {
|
|
122
|
+
ref: s,
|
|
123
|
+
"data-goldfinch-component": "DropdownMenu",
|
|
124
|
+
"data-goldfinch-part": "radio-item",
|
|
125
|
+
className: e("relative flex cursor-default items-center rounded-md px-2 py-1.5 text-base outline-hidden select-none", "data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-goldfinch-tint", r && "pl-8", t),
|
|
126
|
+
...a,
|
|
127
|
+
children: [i && h(i), n]
|
|
128
|
+
}));
|
|
129
|
+
S.displayName = "DropdownMenuRadioItem";
|
|
130
|
+
var C = s.forwardRef(({ className: t, children: n, ...r }, i) => /* @__PURE__ */ a(l.RadioItemIndicator, {
|
|
131
|
+
ref: i,
|
|
132
|
+
className: e("ml-auto flex items-center justify-center", t),
|
|
133
|
+
...r,
|
|
134
|
+
children: n ?? /* @__PURE__ */ a("span", { className: "h-2 w-2 rounded-full bg-goldfinch-contrast" })
|
|
135
|
+
}));
|
|
136
|
+
C.displayName = "DropdownMenuRadioItemIndicator";
|
|
137
|
+
var w = s.forwardRef(({ children: e, render: t, ...n }, r) => {
|
|
138
|
+
if (t) return /* @__PURE__ */ a(l.Trigger, {
|
|
139
|
+
ref: r,
|
|
140
|
+
...n,
|
|
141
|
+
render: t,
|
|
142
|
+
children: e
|
|
143
|
+
});
|
|
144
|
+
let i = s.isValidElement(e) ? e : null;
|
|
145
|
+
return /* @__PURE__ */ a(l.Trigger, {
|
|
146
|
+
ref: r,
|
|
147
|
+
...n,
|
|
148
|
+
...i && { render: i },
|
|
149
|
+
children: i ? void 0 : e
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
w.displayName = "DropdownMenuTrigger";
|
|
153
|
+
var T = Object.assign(l.Root, {
|
|
154
|
+
Trigger: w,
|
|
155
|
+
Portal: l.Portal,
|
|
156
|
+
Sub: l.SubmenuRoot,
|
|
157
|
+
SubTrigger: p,
|
|
158
|
+
SubContent: m,
|
|
159
|
+
Content: m,
|
|
160
|
+
Item: g,
|
|
161
|
+
LinkItem: _,
|
|
162
|
+
CheckboxItem: v,
|
|
163
|
+
RadioGroup: l.RadioGroup,
|
|
164
|
+
RadioItem: S,
|
|
165
|
+
RadioItemIndicator: C,
|
|
166
|
+
Label: y,
|
|
167
|
+
Separator: b,
|
|
168
|
+
Shortcut: x,
|
|
169
|
+
Group: l.Group
|
|
170
|
+
});
|
|
171
|
+
//#endregion
|
|
172
|
+
export { T as t };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { cn as e } from "./utils.mjs";
|
|
2
|
+
import { t } from "./resolve-variant-DWiDeQhX.js";
|
|
3
|
+
import { t as n } from "./button-DDhP5P56.js";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
import { useState as a } from "react";
|
|
6
|
+
import { CheckIcon as o, CopyIcon as s } from "@phosphor-icons/react";
|
|
7
|
+
//#region src/components/empty-state/empty-state.tsx
|
|
8
|
+
var c = { size: {
|
|
9
|
+
sm: {
|
|
10
|
+
classes: "px-6 py-8 gap-4",
|
|
11
|
+
description: "Compact empty state for smaller containers"
|
|
12
|
+
},
|
|
13
|
+
base: {
|
|
14
|
+
classes: "px-10 py-16 gap-6",
|
|
15
|
+
description: "Default empty state size"
|
|
16
|
+
},
|
|
17
|
+
lg: {
|
|
18
|
+
classes: "px-12 py-20 gap-8",
|
|
19
|
+
description: "Large empty state for prominent placement"
|
|
20
|
+
}
|
|
21
|
+
} }, l = { size: "base" };
|
|
22
|
+
function u({ size: n = l.size } = {}) {
|
|
23
|
+
return e("flex w-full flex-col items-center rounded-xl border border-goldfinch-fill bg-goldfinch-control text-goldfinch-default", t(c.size, n, l.size).classes);
|
|
24
|
+
}
|
|
25
|
+
function d({ icon: t, title: c, description: l, commandLine: d, contents: f, size: p = "base", className: m }) {
|
|
26
|
+
let [h, g] = a(!1);
|
|
27
|
+
return /* @__PURE__ */ i("div", {
|
|
28
|
+
className: e(u({ size: p }), m),
|
|
29
|
+
children: [
|
|
30
|
+
t,
|
|
31
|
+
/* @__PURE__ */ r("h2", {
|
|
32
|
+
className: "text-2xl font-semibold",
|
|
33
|
+
children: c
|
|
34
|
+
}),
|
|
35
|
+
l && /* @__PURE__ */ r("p", {
|
|
36
|
+
className: "max-w-140 text-center text-goldfinch-subtle",
|
|
37
|
+
children: l
|
|
38
|
+
}),
|
|
39
|
+
d && /* @__PURE__ */ i("div", {
|
|
40
|
+
className: e("group/cmd relative inline-flex h-10 max-w-8/10 transform-gpu items-center gap-2 rounded-lg font-mono shadow-sm", "bg-goldfinch-overlay pr-2 pl-3", "transition-all duration-300 hover:border-goldfinch-interact/80 hover:shadow-md", "border border-goldfinch-fill/60"),
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ r("span", {
|
|
43
|
+
className: "text-xs text-goldfinch-inactive select-none",
|
|
44
|
+
children: "$"
|
|
45
|
+
}),
|
|
46
|
+
/* @__PURE__ */ r("span", {
|
|
47
|
+
className: "no-scrollbar overflow-scroll text-base whitespace-nowrap text-goldfinch-brand",
|
|
48
|
+
children: d
|
|
49
|
+
}),
|
|
50
|
+
/* @__PURE__ */ r(n, {
|
|
51
|
+
className: "group",
|
|
52
|
+
size: "sm",
|
|
53
|
+
variant: "ghost",
|
|
54
|
+
shape: "square",
|
|
55
|
+
"aria-label": "Copy command",
|
|
56
|
+
onClick: async () => {
|
|
57
|
+
g(!0), setTimeout(() => {
|
|
58
|
+
g(!1);
|
|
59
|
+
}, 1e3), await navigator.clipboard.writeText(d);
|
|
60
|
+
},
|
|
61
|
+
children: h ? /* @__PURE__ */ r(o, {
|
|
62
|
+
size: 16,
|
|
63
|
+
className: "animate-bounce-in text-goldfinch-success"
|
|
64
|
+
}) : /* @__PURE__ */ r(s, {
|
|
65
|
+
size: 16,
|
|
66
|
+
className: "text-goldfinch-inactive group-hover:text-goldfinch-brand"
|
|
67
|
+
})
|
|
68
|
+
})
|
|
69
|
+
]
|
|
70
|
+
}),
|
|
71
|
+
f
|
|
72
|
+
]
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
76
|
+
export { u as i, l as n, c as r, d as t };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { cn as e } from "./utils.mjs";
|
|
2
|
+
import { r as t } from "./label-7oCakbyx.js";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import { Field as i } from "@base-ui/react/field";
|
|
5
|
+
//#region src/components/field/field.tsx
|
|
6
|
+
function a(e) {
|
|
7
|
+
if (e) return typeof e == "string" ? {
|
|
8
|
+
message: e,
|
|
9
|
+
match: !0
|
|
10
|
+
} : e;
|
|
11
|
+
}
|
|
12
|
+
var o = {}, s = {};
|
|
13
|
+
function c({ controlFirst: t = !1 } = {}) {
|
|
14
|
+
return e("grid gap-2", "has-[input[type=checkbox]]:grid-cols-[auto_1fr] has-[input[type=checkbox]]:items-center", "has-[[role=switch]]:grid-cols-[auto_1fr] has-[[role=switch]]:items-center", t && [
|
|
15
|
+
"has-[input[type=checkbox]]:flex has-[input[type=checkbox]]:flex-row-reverse has-[input[type=checkbox]]:flex-wrap has-[input[type=checkbox]]:items-center",
|
|
16
|
+
"has-[[role=switch]]:flex has-[[role=switch]]:flex-row-reverse has-[[role=switch]]:flex-wrap has-[[role=switch]]:items-center",
|
|
17
|
+
"[&>label]:flex-1"
|
|
18
|
+
]);
|
|
19
|
+
}
|
|
20
|
+
function l({ children: a, label: o, required: s, labelTooltip: l, error: u, description: d, controlFirst: f = !1, hideLabel: p = !1 }) {
|
|
21
|
+
let m = s === !1;
|
|
22
|
+
return /* @__PURE__ */ r(i.Root, {
|
|
23
|
+
className: c({ controlFirst: f }),
|
|
24
|
+
children: [
|
|
25
|
+
!p && /* @__PURE__ */ n(i.Label, {
|
|
26
|
+
className: "m-0 select-none text-base font-medium text-goldfinch-default",
|
|
27
|
+
children: /* @__PURE__ */ n(t, {
|
|
28
|
+
showOptional: m,
|
|
29
|
+
tooltip: l,
|
|
30
|
+
asContent: !0,
|
|
31
|
+
children: o
|
|
32
|
+
})
|
|
33
|
+
}),
|
|
34
|
+
a,
|
|
35
|
+
u ? /* @__PURE__ */ n(i.Error, {
|
|
36
|
+
className: e("text-sm leading-snug text-goldfinch-danger", "col-span-full"),
|
|
37
|
+
match: u.match,
|
|
38
|
+
children: u.message
|
|
39
|
+
}) : d && /* @__PURE__ */ n(i.Description, {
|
|
40
|
+
className: e("text-sm leading-snug text-goldfinch-subtle", "col-span-full"),
|
|
41
|
+
children: d
|
|
42
|
+
})
|
|
43
|
+
]
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { a, c as i, s as n, o as r, l as t };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { cn as e } from "./utils.mjs";
|
|
2
|
+
import { t } from "./resolve-variant-DWiDeQhX.js";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
import r from "react";
|
|
5
|
+
//#region src/components/grid/grid.tsx
|
|
6
|
+
var i = {
|
|
7
|
+
variant: {
|
|
8
|
+
"2up": {
|
|
9
|
+
classes: "grid-cols-1 md:grid-cols-2",
|
|
10
|
+
description: "Grid items stack on small screens, display side-by-side on medium screens and up"
|
|
11
|
+
},
|
|
12
|
+
"side-by-side": {
|
|
13
|
+
classes: "grid-cols-2",
|
|
14
|
+
description: "Grid items always displayed side-by-side"
|
|
15
|
+
},
|
|
16
|
+
"2-1": {
|
|
17
|
+
classes: "grid-cols-1 md:grid-cols-[2fr_1fr]",
|
|
18
|
+
description: "Two-thirds / one-third split (66%/33%) on medium screens and up"
|
|
19
|
+
},
|
|
20
|
+
"1-2": {
|
|
21
|
+
classes: "grid-cols-1 md:grid-cols-[1fr_2fr]",
|
|
22
|
+
description: "One-third / two-thirds split (33%/66%) on medium screens and up"
|
|
23
|
+
},
|
|
24
|
+
"1-3up": {
|
|
25
|
+
classes: "grid-cols-1 lg:grid-cols-3",
|
|
26
|
+
description: "Grid items stack on small screens, expand to 3 across on large screens"
|
|
27
|
+
},
|
|
28
|
+
"3up": {
|
|
29
|
+
classes: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3",
|
|
30
|
+
description: "Grid items stack on small screens, 2 across on medium, 3 across on large"
|
|
31
|
+
},
|
|
32
|
+
"4up": {
|
|
33
|
+
classes: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",
|
|
34
|
+
description: "Grid items stack on small screens, progressively increase columns at larger breakpoints"
|
|
35
|
+
},
|
|
36
|
+
"6up": {
|
|
37
|
+
classes: "grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6",
|
|
38
|
+
description: "Grid items start at 2 across, expand to 6 across on XL"
|
|
39
|
+
},
|
|
40
|
+
"1-2-4up": {
|
|
41
|
+
classes: "grid-cols-1 md:grid-cols-2 lg:grid-cols-4",
|
|
42
|
+
description: "Grid items stack on small screens, 2 across on medium, 4 across on large"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
gap: {
|
|
46
|
+
none: {
|
|
47
|
+
classes: "gap-0",
|
|
48
|
+
description: "No gap between grid items"
|
|
49
|
+
},
|
|
50
|
+
sm: {
|
|
51
|
+
classes: "gap-3",
|
|
52
|
+
description: "Small gap between grid items"
|
|
53
|
+
},
|
|
54
|
+
base: {
|
|
55
|
+
classes: "gap-2 md:gap-6 lg:gap-8",
|
|
56
|
+
description: "Default responsive gap between grid items"
|
|
57
|
+
},
|
|
58
|
+
lg: {
|
|
59
|
+
classes: "gap-8",
|
|
60
|
+
description: "Large gap between grid items"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}, a = { gap: "base" }, o = r.createContext({ gap: "base" });
|
|
64
|
+
function s({ variant: n, gap: r = a.gap } = {}) {
|
|
65
|
+
return e("grid", n && t(i.variant, n, "2up").classes, t(i.gap, r, a.gap).classes);
|
|
66
|
+
}
|
|
67
|
+
function c({ variant: t, mobileDivider: n } = {}) {
|
|
68
|
+
return e(n && t === "4up" && "border-b border-goldfinch-hairline pb-8 md:border-b-0 md:pb-0");
|
|
69
|
+
}
|
|
70
|
+
var l = r.forwardRef(({ children: t, className: r, mobileDivider: i, gap: c = a.gap, variant: l, ...u }, d) => /* @__PURE__ */ n(o.Provider, {
|
|
71
|
+
value: {
|
|
72
|
+
variant: l,
|
|
73
|
+
gap: c,
|
|
74
|
+
mobileDivider: i
|
|
75
|
+
},
|
|
76
|
+
children: /* @__PURE__ */ n("div", {
|
|
77
|
+
ref: d,
|
|
78
|
+
className: e(s({
|
|
79
|
+
variant: l,
|
|
80
|
+
gap: c
|
|
81
|
+
}), r),
|
|
82
|
+
...u,
|
|
83
|
+
children: t
|
|
84
|
+
})
|
|
85
|
+
}));
|
|
86
|
+
l.displayName = "Grid";
|
|
87
|
+
var u = r.forwardRef(({ children: t, className: i, ...a }, s) => {
|
|
88
|
+
let { variant: l, mobileDivider: u } = r.useContext(o);
|
|
89
|
+
return /* @__PURE__ */ n("div", {
|
|
90
|
+
ref: s,
|
|
91
|
+
className: e(c({
|
|
92
|
+
variant: l,
|
|
93
|
+
mobileDivider: u
|
|
94
|
+
}), i),
|
|
95
|
+
...a,
|
|
96
|
+
children: t
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
u.displayName = "GridItem";
|
|
100
|
+
//#endregion
|
|
101
|
+
export { c as a, u as i, i as n, s as o, l as r, a as t };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { cn as e, safeRandomId as t } from "./utils.mjs";
|
|
2
|
+
import { t as n } from "./resolve-variant-DWiDeQhX.js";
|
|
3
|
+
import { t as r } from "./badge-dMKK_Gm2.js";
|
|
4
|
+
import { t as i } from "./alert-Iba34Kfr.js";
|
|
5
|
+
import { r as a, t as o } from "./button-DDhP5P56.js";
|
|
6
|
+
import { n as s, t as c } from "./portal-provider-CWX8j9O1.js";
|
|
7
|
+
import { n as l, t as u } from "./tooltip-QfSb4wnI.js";
|
|
8
|
+
import { r as d } from "./label-7oCakbyx.js";
|
|
9
|
+
import { t as f } from "./checkbox-BubMDtGW.js";
|
|
10
|
+
import { t as p } from "./field-CZb7PLTY.js";
|
|
11
|
+
import { r as m } from "./input-group-Dm4hKEhq.js";
|
|
12
|
+
import { r as h } from "./sensitive-input-BEAOu1A6.js";
|
|
13
|
+
import { n as g, r as _, t as v } from "./input-6C_-SelY.js";
|
|
14
|
+
import { t as y } from "./copy-to-clipboard-KXU8jo6k.js";
|
|
15
|
+
import { t as b } from "./collapsible-Bk5IP_KI.js";
|
|
16
|
+
import { t as x } from "./card-CVUWZOar.js";
|
|
17
|
+
import { a as S, i as C, n as w, o as T, r as E, t as D } from "./modal-BYQ8MRMy.js";
|
|
18
|
+
import { n as O, t as k } from "./link-provider-H0J4aZPH.js";
|
|
19
|
+
import { t as A } from "./dropdown-A5hLlUjr.js";
|
|
20
|
+
import { t as j } from "./empty-state-DuugAIN_.js";
|
|
21
|
+
import "./components/field.mjs";
|
|
22
|
+
import { t as M } from "./top-navigation-DoTeFaXD.js";
|
|
23
|
+
import { i as N, r as P } from "./grid-BFkQ5cmR.js";
|
|
24
|
+
import { Link as F } from "./components/link.mjs";
|
|
25
|
+
import { t as I } from "./skeleton-line-Dh4TDbeq.js";
|
|
26
|
+
import { t as L } from "./breadcrumbs-CHev-E0K.js";
|
|
27
|
+
import { t as R } from "./spinner-DKzSES7b.js";
|
|
28
|
+
import { n as z, t as B } from "./menubar-DyXmaeKZ.js";
|
|
29
|
+
import { t as V } from "./progress-Ac96hU_C.js";
|
|
30
|
+
import { r as H } from "./page-DOevDFqd.js";
|
|
31
|
+
import { t as U } from "./select-DaJRanrs.js";
|
|
32
|
+
import { t as W } from "./pagination-C3f16UOC.js";
|
|
33
|
+
import { r as G } from "./popover-3kcRy9HX.js";
|
|
34
|
+
import { i as K, r as q } from "./radio-C8rcmsbS.js";
|
|
35
|
+
import "./components/sensitive-input.mjs";
|
|
36
|
+
import { C as J, D as Y, E as X, O as Z, S as Q, T as $, _ as ee, a as te, b as ne, c as re, d as ie, f as ae, g as oe, h as se, i as ce, k as le, l as ue, m as de, o as fe, p as pe, s as me, u as he, v as ge, w as _e, x as ve, y as ye } from "./sidebar-CkZxFt33.js";
|
|
37
|
+
import { r as be } from "./toggle-C72Skv4q.js";
|
|
38
|
+
import { r as xe } from "./table-CKmEd0O5.js";
|
|
39
|
+
import { r as Se } from "./table-of-contents-CuE1aDKE.js";
|
|
40
|
+
import { t as Ce } from "./tabs-JX7xyFcA.js";
|
|
41
|
+
import { t as we } from "./text-B0EvLge5.js";
|
|
42
|
+
import { a as Te, i as Ee, n as De, r as Oe, t as ke } from "./toast-pSr7cFVU.js";
|
|
43
|
+
import { r as Ae } from "./toolbar-DtT4MUHB.js";
|
|
44
|
+
//#region src/index.ts
|
|
45
|
+
var je = "0.0.0";
|
|
46
|
+
//#endregion
|
|
47
|
+
export { i as Alert, r as Badge, L as Breadcrumbs, o as Button, x as Card, f as Checkbox, b as Collapsible, y as CopyToClipboard, A as DropdownMenu, j as EmptyState, p as Field, c as GoldfinchPortalProvider, P as Grid, N as GridItem, v as Input, g as InputArea, m as InputGroup, d as Label, F as Link, k as LinkProvider, B as MenuBar, D as Modal, w as ModalClose, E as ModalDescription, C as ModalRoot, S as ModalTitle, T as ModalTrigger, H as Page, W as Pagination, G as Popover, V as Progress, q as Radio, K as RadioGroup, U as Select, h as SensitiveInput, ce as Sidebar, te as SidebarCollapsible, fe as SidebarCollapsibleContent, me as SidebarCollapsibleTrigger, re as SidebarContent, ue as SidebarFooter, he as SidebarGroup, ie as SidebarGroupLabel, ae as SidebarHeader, pe as SidebarMenu, de as SidebarMenuBadge, se as SidebarMenuButton, oe as SidebarMenuChevron, ee as SidebarMenuItem, ge as SidebarMenuSub, ye as SidebarMenuSubButton, ne as SidebarMenuSubItem, ve as SidebarProvider, Q as SidebarRail, J as SidebarResizeHandle, _e as SidebarRoot, $ as SidebarSeparator, X as SidebarSlidingView, Y as SidebarSlidingViews, Z as SidebarTrigger, I as SkeletonLine, R as Spinner, xe as Table, Se as TableOfContents, Ce as Tabs, we as Text, _ as Textarea, ke as Toast, De as ToastProvider, Oe as Toasty, be as Toggle, Ae as Toolbar, u as Tooltip, l as TooltipProvider, M as TopNavigation, e as cn, Ee as createGoldfinchToastManager, a as goldfinchButtonVariants, n as resolveVariant, t as safeRandomId, Te as useGoldfinchToastManager, O as useLinkComponent, z as useMenuNavigation, s as usePortalContainer, le as useSidebar, je as version };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { cn as e } from "./utils.mjs";
|
|
2
|
+
import { a as t, t as n } from "./field-CZb7PLTY.js";
|
|
3
|
+
import { n as r } from "./input-variants-CZevxTd8.js";
|
|
4
|
+
import { t as i } from "./input-Bo8XL6_f.js";
|
|
5
|
+
import { r as a } from "./input-group-Dm4hKEhq.js";
|
|
6
|
+
import { r as o } from "./sensitive-input-BEAOu1A6.js";
|
|
7
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
8
|
+
import * as c from "react";
|
|
9
|
+
import { useCallback as l } from "react";
|
|
10
|
+
import { Field as u } from "@base-ui/react/field";
|
|
11
|
+
//#region src/components/input/input-area.tsx
|
|
12
|
+
var d = c.forwardRef((i, a) => {
|
|
13
|
+
let { className: o, onValueChange: c, size: d = "base", variant: f, onChange: p, label: m, labelTooltip: h, description: g, error: _, ...v } = i;
|
|
14
|
+
process.env.NODE_ENV !== "production" && f === "error" && console.warn("[Goldfinch InputArea]: variant=\"error\" is deprecated. Error styling is now automatically applied when the `error` prop is truthy. Simply remove the variant prop and pass an error message instead.");
|
|
15
|
+
let y = f ?? (_ ? "error" : "default"), { required: b } = v, x = l((e) => {
|
|
16
|
+
p?.(e), c?.(e.target.value);
|
|
17
|
+
}, [p, c]), S = e(r({
|
|
18
|
+
size: d,
|
|
19
|
+
variant: y,
|
|
20
|
+
focusIndicator: !0
|
|
21
|
+
}), "h-auto py-2", o);
|
|
22
|
+
return m || _ || g ? /* @__PURE__ */ s(n, {
|
|
23
|
+
label: m,
|
|
24
|
+
required: b,
|
|
25
|
+
labelTooltip: h,
|
|
26
|
+
description: g,
|
|
27
|
+
error: t(_),
|
|
28
|
+
children: /* @__PURE__ */ s(u.Control, { render: (e) => /* @__PURE__ */ s("textarea", {
|
|
29
|
+
...e,
|
|
30
|
+
ref: a,
|
|
31
|
+
className: S,
|
|
32
|
+
onChange: x,
|
|
33
|
+
...v
|
|
34
|
+
}) })
|
|
35
|
+
}) : /* @__PURE__ */ s("textarea", {
|
|
36
|
+
ref: a,
|
|
37
|
+
className: S,
|
|
38
|
+
onChange: x,
|
|
39
|
+
...v
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
d.displayName = "InputArea";
|
|
43
|
+
var f = d, p = Object.assign(i, {
|
|
44
|
+
Group: a,
|
|
45
|
+
Sensitive: o
|
|
46
|
+
});
|
|
47
|
+
//#endregion
|
|
48
|
+
export { d as n, f as r, p as t };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { cn as e } from "./utils.mjs";
|
|
2
|
+
import { a as t, t as n } from "./field-CZb7PLTY.js";
|
|
3
|
+
import { n as r } from "./input-variants-CZevxTd8.js";
|
|
4
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
5
|
+
import { forwardRef as a } from "react";
|
|
6
|
+
import { Input as o } from "@base-ui/react/input";
|
|
7
|
+
//#region src/components/input/input.tsx
|
|
8
|
+
var s = a((a, s) => {
|
|
9
|
+
let { className: c, size: l = "base", variant: u, label: d, labelTooltip: f, description: p, error: m, passwordManagerIgnore: h = !1, ...g } = a;
|
|
10
|
+
process.env.NODE_ENV !== "production" && u === "error" && console.warn("[Goldfinch Input]: variant=\"error\" is deprecated. Error styling is now automatically applied when the `error` prop is truthy. Simply remove the variant prop and pass an error message instead.");
|
|
11
|
+
let _ = u ?? (m ? "error" : "default"), { required: v } = g;
|
|
12
|
+
if (process.env.NODE_ENV !== "production") {
|
|
13
|
+
let e = !!d, t = !!g["aria-label"], n = !!g["aria-labelledby"];
|
|
14
|
+
!e && !t && !n && console.warn("[Goldfinch Input]: Input must have an accessible name. Provide either:\n - label prop: <Input label='Email' />\n - aria-label: <Input aria-label='Email address' />\n - aria-labelledby for custom label association");
|
|
15
|
+
}
|
|
16
|
+
let y = /* @__PURE__ */ i(o, {
|
|
17
|
+
ref: s,
|
|
18
|
+
className: e(r({
|
|
19
|
+
size: l,
|
|
20
|
+
variant: _,
|
|
21
|
+
focusIndicator: !0
|
|
22
|
+
}), h && "keeper-ignore", c),
|
|
23
|
+
...h ? {
|
|
24
|
+
"data-1p-ignore": "true",
|
|
25
|
+
"data-bwignore": "true",
|
|
26
|
+
"data-form-type": "other",
|
|
27
|
+
"data-lpignore": "true"
|
|
28
|
+
} : {},
|
|
29
|
+
...g
|
|
30
|
+
});
|
|
31
|
+
return d || m || p ? /* @__PURE__ */ i(n, {
|
|
32
|
+
label: d,
|
|
33
|
+
required: v,
|
|
34
|
+
labelTooltip: f,
|
|
35
|
+
description: p,
|
|
36
|
+
error: t(m),
|
|
37
|
+
children: y
|
|
38
|
+
}) : y;
|
|
39
|
+
});
|
|
40
|
+
s.displayName = "Input";
|
|
41
|
+
var c = s;
|
|
42
|
+
//#endregion
|
|
43
|
+
export { c as t };
|