@goliapkg/gds 2.1.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/a11y-CoNNB_xa.js +6 -0
- package/dist/a11y-CoNNB_xa.js.map +1 -0
- package/dist/{avatar-Ct8OOGx6.js → avatar-oCar1zX6.js} +2 -2
- package/dist/{avatar-Ct8OOGx6.js.map → avatar-oCar1zX6.js.map} +1 -1
- package/dist/{badge-BCvi5RVF.js → badge-B3ijD3ch.js} +2 -2
- package/dist/{badge-BCvi5RVF.js.map → badge-B3ijD3ch.js.map} +1 -1
- package/dist/{button-BD3VHhwq.js → button-fRpdsI_4.js} +15 -41
- package/dist/button-fRpdsI_4.js.map +1 -0
- package/dist/dist-qdXk1a7h.js +35 -0
- package/dist/dist-qdXk1a7h.js.map +1 -0
- package/dist/{dom-17XgfxMq.js → dom-DkPgnDHP.js} +1 -1
- package/dist/{dom-17XgfxMq.js.map → dom-DkPgnDHP.js.map} +1 -1
- package/dist/editor/index.d.ts +11 -0
- package/dist/editor/index.d.ts.map +1 -0
- package/dist/editor/index.js +1250 -0
- package/dist/editor/index.js.map +1 -0
- package/dist/email-composer-field-UoKh5XMX.js +178 -0
- package/dist/email-composer-field-UoKh5XMX.js.map +1 -0
- package/dist/{gesture-I79dlTuS.js → gesture-CVcSA-iZ.js} +1 -1
- package/dist/{gesture-I79dlTuS.js.map → gesture-CVcSA-iZ.js.map} +1 -1
- package/dist/{highlight-BAGZc-4h.js → highlight-pgwGrmcq.js} +1 -1
- package/dist/{highlight-BAGZc-4h.js.map → highlight-pgwGrmcq.js.map} +1 -1
- package/dist/{hooks-BE-_EmDI.js → hooks-CejfTXVD.js} +1 -1
- package/dist/{hooks-BE-_EmDI.js.map → hooks-CejfTXVD.js.map} +1 -1
- package/dist/{icon-button-Bns79124.js → icon-button-CR2GECEZ.js} +3 -3
- package/dist/{icon-button-Bns79124.js.map → icon-button-CR2GECEZ.js.map} +1 -1
- package/dist/index.js +30 -27
- package/dist/l2-primitives/index.js +11 -11
- package/dist/{l2-primitives-Cn0KNxbB.js → l2-primitives-D503ozjH.js} +4 -4
- package/dist/{l2-primitives-Cn0KNxbB.js.map → l2-primitives-D503ozjH.js.map} +1 -1
- package/dist/l3-atoms/index.js +6 -5
- package/dist/{l3-atoms-BCJNqPHk.js → l3-atoms-CumlHlnP.js} +54 -53
- package/dist/{l3-atoms-BCJNqPHk.js.map → l3-atoms-CumlHlnP.js.map} +1 -1
- package/dist/l4-molecules/index.js +5 -4
- package/dist/{l4-molecules-DtNnQaFU.js → l4-molecules-CWwgFWmO.js} +125 -124
- package/dist/{l4-molecules-DtNnQaFU.js.map → l4-molecules-CWwgFWmO.js.map} +1 -1
- package/dist/l5-organisms/index.d.ts +0 -10
- package/dist/l5-organisms/index.d.ts.map +1 -1
- package/dist/l5-organisms/index.js +2 -2
- package/dist/{l5-organisms-Bu2Z8LSj.js → l5-organisms-QcvIAoHr.js} +1310 -2548
- package/dist/l5-organisms-QcvIAoHr.js.map +1 -0
- package/dist/l6-charts/index.js +1 -1
- package/dist/{l6-charts-DEA5DgMy.js → l6-charts-DKNVGuo0.js} +145 -17
- package/dist/l6-charts-DKNVGuo0.js.map +1 -0
- package/dist/l7-patterns/index.js +1 -1
- package/dist/{l7-patterns-CwonNW9o.js → l7-patterns-CM3FUxjA.js} +34 -34
- package/dist/{l7-patterns-CwonNW9o.js.map → l7-patterns-CM3FUxjA.js.map} +1 -1
- package/dist/loading-dots-CjzCz938.js +24 -0
- package/dist/loading-dots-CjzCz938.js.map +1 -0
- package/dist/motion-CKB1OKVd.js +22 -0
- package/dist/motion-CKB1OKVd.js.map +1 -0
- package/dist/{portal-Bbl6F_Wj.js → portal-B7bfstxv.js} +1 -1
- package/dist/{portal-Bbl6F_Wj.js.map → portal-B7bfstxv.js.map} +1 -1
- package/dist/{progress-dZIQEiTw.js → progress-B81FKPw5.js} +2 -2
- package/dist/{progress-dZIQEiTw.js.map → progress-B81FKPw5.js.map} +1 -1
- package/dist/{resize-handle-BjSNhgJK.js → resize-handle-BFffbhyG.js} +2 -2
- package/dist/{resize-handle-BjSNhgJK.js.map → resize-handle-BFffbhyG.js.map} +1 -1
- package/dist/{sanitize-BF45M9xp.js → sanitize-CO5dRqZX.js} +1 -1
- package/dist/{sanitize-BF45M9xp.js.map → sanitize-CO5dRqZX.js.map} +1 -1
- package/dist/{separator-CRll1Ycp.js → separator-wAUWmxji.js} +2 -2
- package/dist/{separator-CRll1Ycp.js.map → separator-wAUWmxji.js.map} +1 -1
- package/dist/{skeleton-C9FFZSYN.js → skeleton-DhqLfA7r.js} +1 -1
- package/dist/{skeleton-C9FFZSYN.js.map → skeleton-DhqLfA7r.js.map} +1 -1
- package/dist/{spinner-C15eER04.js → spinner-BimzKtfC.js} +3 -3
- package/dist/{spinner-C15eER04.js.map → spinner-BimzKtfC.js.map} +1 -1
- package/dist/{stepper-DJ8pn-9D.js → stepper-BINbai2f.js} +4 -4
- package/dist/{stepper-DJ8pn-9D.js.map → stepper-BINbai2f.js.map} +1 -1
- package/dist/{switch-BAS-GXJV.js → switch-COzaggYE.js} +3 -3
- package/dist/{switch-BAS-GXJV.js.map → switch-COzaggYE.js.map} +1 -1
- package/dist/{textarea-Btdu41rY.js → textarea-DD1huKel.js} +3 -3
- package/dist/{textarea-Btdu41rY.js.map → textarea-DD1huKel.js.map} +1 -1
- package/dist/toast-BujeTn1T.js +442 -0
- package/dist/toast-BujeTn1T.js.map +1 -0
- package/dist/{loading-dots-C1LPHGa0.js → tooltip-BlvhLCp0.js} +2 -17
- package/dist/tooltip-BlvhLCp0.js.map +1 -0
- package/dist/utils/index.js +8 -7
- package/package.json +5 -1
- package/dist/button-BD3VHhwq.js.map +0 -1
- package/dist/l5-organisms-Bu2Z8LSj.js.map +0 -1
- package/dist/l6-charts-DEA5DgMy.js.map +0 -1
- package/dist/loading-dots-C1LPHGa0.js.map +0 -1
- package/dist/motion-DUPegem-.js +0 -22
- package/dist/motion-DUPegem-.js.map +0 -1
- package/dist/toast-QxCZG0Oy.js +0 -614
- package/dist/toast-QxCZG0Oy.js.map +0 -1
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
import { r as e, t } from "./glass-CQTlX7IO.js";
|
|
2
|
+
import { t as n } from "./a11y-CoNNB_xa.js";
|
|
3
|
+
import { forwardRef as r, useCallback as i, useState as a } from "react";
|
|
4
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
5
|
+
//#region src/l4-molecules/audit-entry.tsx
|
|
6
|
+
var c = {
|
|
7
|
+
default: "text-fg",
|
|
8
|
+
success: "text-success",
|
|
9
|
+
warning: "text-warning",
|
|
10
|
+
danger: "text-danger"
|
|
11
|
+
}, l = r(function({ action: t, className: n, target: r, timestamp: i, user: a, variant: l = "default", ...u }, d) {
|
|
12
|
+
return /* @__PURE__ */ s("div", {
|
|
13
|
+
className: e("gds-gap gds-text flex items-center justify-between", n),
|
|
14
|
+
"data-component": "audit-entry",
|
|
15
|
+
ref: d,
|
|
16
|
+
...u,
|
|
17
|
+
children: [/* @__PURE__ */ o("span", {
|
|
18
|
+
className: "text-fg-muted shrink-0 text-xs",
|
|
19
|
+
children: i
|
|
20
|
+
}), /* @__PURE__ */ s("span", {
|
|
21
|
+
className: "flex-1 truncate",
|
|
22
|
+
children: [
|
|
23
|
+
/* @__PURE__ */ o("span", {
|
|
24
|
+
className: "text-fg font-medium",
|
|
25
|
+
children: a
|
|
26
|
+
}),
|
|
27
|
+
" ",
|
|
28
|
+
/* @__PURE__ */ o("span", {
|
|
29
|
+
className: c[l],
|
|
30
|
+
children: t
|
|
31
|
+
}),
|
|
32
|
+
r !== void 0 && /* @__PURE__ */ s("span", {
|
|
33
|
+
className: "text-fg-muted",
|
|
34
|
+
children: [" ", r]
|
|
35
|
+
})
|
|
36
|
+
]
|
|
37
|
+
})]
|
|
38
|
+
});
|
|
39
|
+
}), u = /* @__PURE__ */ o("svg", {
|
|
40
|
+
width: "14",
|
|
41
|
+
height: "14",
|
|
42
|
+
viewBox: "0 0 14 14",
|
|
43
|
+
fill: "none",
|
|
44
|
+
stroke: "currentColor",
|
|
45
|
+
strokeWidth: "2",
|
|
46
|
+
strokeLinecap: "round",
|
|
47
|
+
strokeLinejoin: "round",
|
|
48
|
+
children: /* @__PURE__ */ o("path", { d: "M2.5 7.5l3 3 6-6.5" })
|
|
49
|
+
}), d = /* @__PURE__ */ o("svg", {
|
|
50
|
+
width: "14",
|
|
51
|
+
height: "14",
|
|
52
|
+
viewBox: "0 0 14 14",
|
|
53
|
+
fill: "none",
|
|
54
|
+
stroke: "currentColor",
|
|
55
|
+
strokeWidth: "2",
|
|
56
|
+
strokeLinecap: "round",
|
|
57
|
+
children: /* @__PURE__ */ o("path", { d: "M3 3l8 8M11 3l-8 8" })
|
|
58
|
+
}), f = /* @__PURE__ */ o("svg", {
|
|
59
|
+
width: "12",
|
|
60
|
+
height: "12",
|
|
61
|
+
viewBox: "0 0 12 12",
|
|
62
|
+
fill: "none",
|
|
63
|
+
stroke: "currentColor",
|
|
64
|
+
strokeWidth: "1.5",
|
|
65
|
+
strokeLinecap: "round",
|
|
66
|
+
strokeLinejoin: "round",
|
|
67
|
+
children: /* @__PURE__ */ o("path", { d: "M7 2l3 3-7 7H0V9z" })
|
|
68
|
+
}), p = r(function({ value: t, onSave: r, onCancel: c, validate: l, placeholder: p = "Click to edit", disabled: m, className: h }, g) {
|
|
69
|
+
let [_, v] = a(!1), [y, b] = a(t), [x, S] = a(null), C = i(() => {
|
|
70
|
+
m !== !0 && (b(t), S(null), v(!0));
|
|
71
|
+
}, [m, t]), w = i(() => {
|
|
72
|
+
if (l !== void 0) {
|
|
73
|
+
let e = l(y);
|
|
74
|
+
if (e !== null) {
|
|
75
|
+
S(e);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
v(!1), S(null), r(y);
|
|
80
|
+
}, [
|
|
81
|
+
y,
|
|
82
|
+
r,
|
|
83
|
+
l
|
|
84
|
+
]), T = i(() => {
|
|
85
|
+
v(!1), b(t), S(null), c !== void 0 && c();
|
|
86
|
+
}, [c, t]), E = i((e) => {
|
|
87
|
+
e.key === "Enter" && w(), e.key === "Escape" && T();
|
|
88
|
+
}, [w, T]);
|
|
89
|
+
if (_) return /* @__PURE__ */ s("div", {
|
|
90
|
+
ref: g,
|
|
91
|
+
className: e("inline-flex flex-col", h),
|
|
92
|
+
"data-component": "inline-edit",
|
|
93
|
+
"data-state": "editing",
|
|
94
|
+
children: [/* @__PURE__ */ s("div", {
|
|
95
|
+
className: "flex items-center gap-1",
|
|
96
|
+
children: [
|
|
97
|
+
/* @__PURE__ */ o("input", {
|
|
98
|
+
autoFocus: !0,
|
|
99
|
+
className: e("gds-text-body text-fg border-accent/50 border-b bg-transparent px-0.5 outline-none", x !== null && "border-danger/50", n),
|
|
100
|
+
onChange: (e) => {
|
|
101
|
+
b(e.target.value), S(null);
|
|
102
|
+
},
|
|
103
|
+
onKeyDown: E,
|
|
104
|
+
type: "text",
|
|
105
|
+
value: y
|
|
106
|
+
}),
|
|
107
|
+
/* @__PURE__ */ o("button", {
|
|
108
|
+
type: "button",
|
|
109
|
+
onClick: w,
|
|
110
|
+
className: e("text-success hover:text-success/80 shrink-0 p-0.5", n),
|
|
111
|
+
"aria-label": "Save",
|
|
112
|
+
children: u
|
|
113
|
+
}),
|
|
114
|
+
/* @__PURE__ */ o("button", {
|
|
115
|
+
type: "button",
|
|
116
|
+
onClick: T,
|
|
117
|
+
className: e("text-fg-muted hover:text-fg shrink-0 p-0.5", n),
|
|
118
|
+
"aria-label": "Cancel",
|
|
119
|
+
children: d
|
|
120
|
+
})
|
|
121
|
+
]
|
|
122
|
+
}), x !== null && /* @__PURE__ */ o("span", {
|
|
123
|
+
className: "text-danger mt-0.5 text-[10px]",
|
|
124
|
+
children: x
|
|
125
|
+
})]
|
|
126
|
+
});
|
|
127
|
+
let D = t === "";
|
|
128
|
+
return /* @__PURE__ */ s("div", {
|
|
129
|
+
ref: g,
|
|
130
|
+
className: e("group inline-flex cursor-pointer items-center gap-1", m === !0 && "pointer-events-none opacity-50", h),
|
|
131
|
+
"data-component": "inline-edit",
|
|
132
|
+
"data-state": "display",
|
|
133
|
+
onClick: C,
|
|
134
|
+
onKeyDown: (e) => {
|
|
135
|
+
(e.key === "Enter" || e.key === " ") && C();
|
|
136
|
+
},
|
|
137
|
+
role: "button",
|
|
138
|
+
tabIndex: m === !0 ? -1 : 0,
|
|
139
|
+
children: [/* @__PURE__ */ o("span", {
|
|
140
|
+
className: e("gds-text-body", D ? "text-fg-muted" : "text-fg", n),
|
|
141
|
+
children: D ? p : t
|
|
142
|
+
}), /* @__PURE__ */ o("span", {
|
|
143
|
+
className: "text-fg-muted/0 group-hover:text-fg-muted/60 transition-colors",
|
|
144
|
+
children: f
|
|
145
|
+
})]
|
|
146
|
+
});
|
|
147
|
+
}), m = r(function({ icon: t, title: n, description: r, trailing: i, onClick: a, active: c, disabled: l, className: u }, d) {
|
|
148
|
+
let f = a !== void 0 && l !== !0;
|
|
149
|
+
return /* @__PURE__ */ s("div", {
|
|
150
|
+
ref: d,
|
|
151
|
+
role: f ? "button" : void 0,
|
|
152
|
+
tabIndex: f ? 0 : void 0,
|
|
153
|
+
onClick: f ? a : void 0,
|
|
154
|
+
onKeyDown: f ? (e) => {
|
|
155
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), a());
|
|
156
|
+
} : void 0,
|
|
157
|
+
className: e("gds-pad-x gds-pad-y-sm gds-text-body flex items-center gap-3 select-none", f && "hover:bg-bg-tertiary cursor-pointer", c === !0 && "border-l-accent bg-accent/5 border-l-2", l === !0 && "pointer-events-none opacity-50", u),
|
|
158
|
+
"data-component": "list-item",
|
|
159
|
+
"data-state": c === !0 ? "active" : void 0,
|
|
160
|
+
children: [
|
|
161
|
+
t !== void 0 && /* @__PURE__ */ o("span", {
|
|
162
|
+
className: "text-fg-muted shrink-0",
|
|
163
|
+
children: t
|
|
164
|
+
}),
|
|
165
|
+
/* @__PURE__ */ s("div", {
|
|
166
|
+
className: "min-w-0 flex-1",
|
|
167
|
+
children: [/* @__PURE__ */ o("div", {
|
|
168
|
+
className: "text-fg font-medium",
|
|
169
|
+
children: n
|
|
170
|
+
}), r !== void 0 && /* @__PURE__ */ o("div", {
|
|
171
|
+
className: "text-fg-muted gds-text-caption mt-0.5",
|
|
172
|
+
children: r
|
|
173
|
+
})]
|
|
174
|
+
}),
|
|
175
|
+
i !== void 0 && /* @__PURE__ */ o("span", {
|
|
176
|
+
className: "shrink-0",
|
|
177
|
+
children: i
|
|
178
|
+
})
|
|
179
|
+
]
|
|
180
|
+
});
|
|
181
|
+
}), h = {
|
|
182
|
+
info: "border-l-accent",
|
|
183
|
+
success: "border-l-success",
|
|
184
|
+
warning: "border-l-warning",
|
|
185
|
+
danger: "border-l-danger"
|
|
186
|
+
}, g = {
|
|
187
|
+
info: "bg-accent/5",
|
|
188
|
+
success: "bg-success/5",
|
|
189
|
+
warning: "bg-warning/5",
|
|
190
|
+
danger: "bg-danger/5"
|
|
191
|
+
}, _ = {
|
|
192
|
+
info: "text-accent",
|
|
193
|
+
success: "text-success",
|
|
194
|
+
warning: "text-warning",
|
|
195
|
+
danger: "text-danger"
|
|
196
|
+
}, v = {
|
|
197
|
+
info: /* @__PURE__ */ s("svg", {
|
|
198
|
+
width: "16",
|
|
199
|
+
height: "16",
|
|
200
|
+
viewBox: "0 0 16 16",
|
|
201
|
+
fill: "none",
|
|
202
|
+
stroke: "currentColor",
|
|
203
|
+
strokeWidth: "1.5",
|
|
204
|
+
strokeLinecap: "round",
|
|
205
|
+
children: [/* @__PURE__ */ o("circle", {
|
|
206
|
+
cx: "8",
|
|
207
|
+
cy: "8",
|
|
208
|
+
r: "6.5"
|
|
209
|
+
}), /* @__PURE__ */ o("path", { d: "M8 5.5h.01M8 7.5v3" })]
|
|
210
|
+
}),
|
|
211
|
+
success: /* @__PURE__ */ s("svg", {
|
|
212
|
+
width: "16",
|
|
213
|
+
height: "16",
|
|
214
|
+
viewBox: "0 0 16 16",
|
|
215
|
+
fill: "none",
|
|
216
|
+
stroke: "currentColor",
|
|
217
|
+
strokeWidth: "1.5",
|
|
218
|
+
strokeLinecap: "round",
|
|
219
|
+
strokeLinejoin: "round",
|
|
220
|
+
children: [/* @__PURE__ */ o("circle", {
|
|
221
|
+
cx: "8",
|
|
222
|
+
cy: "8",
|
|
223
|
+
r: "6.5"
|
|
224
|
+
}), /* @__PURE__ */ o("path", { d: "M5.5 8l2 2 3-3.5" })]
|
|
225
|
+
}),
|
|
226
|
+
warning: /* @__PURE__ */ s("svg", {
|
|
227
|
+
width: "16",
|
|
228
|
+
height: "16",
|
|
229
|
+
viewBox: "0 0 16 16",
|
|
230
|
+
fill: "none",
|
|
231
|
+
stroke: "currentColor",
|
|
232
|
+
strokeWidth: "1.5",
|
|
233
|
+
strokeLinecap: "round",
|
|
234
|
+
children: [/* @__PURE__ */ o("path", { d: "M7.13 2.5l-5.5 10h11l-5.5-10z" }), /* @__PURE__ */ o("path", { d: "M7.63 6.5v2.5M7.63 11h.01" })]
|
|
235
|
+
}),
|
|
236
|
+
danger: /* @__PURE__ */ s("svg", {
|
|
237
|
+
width: "16",
|
|
238
|
+
height: "16",
|
|
239
|
+
viewBox: "0 0 16 16",
|
|
240
|
+
fill: "none",
|
|
241
|
+
stroke: "currentColor",
|
|
242
|
+
strokeWidth: "1.5",
|
|
243
|
+
strokeLinecap: "round",
|
|
244
|
+
children: [/* @__PURE__ */ o("circle", {
|
|
245
|
+
cx: "8",
|
|
246
|
+
cy: "8",
|
|
247
|
+
r: "6.5"
|
|
248
|
+
}), /* @__PURE__ */ o("path", { d: "M5.5 5.5l5 5M10.5 5.5l-5 5" })]
|
|
249
|
+
})
|
|
250
|
+
}, y = r(function({ title: n, description: r, variant: i = "info", action: a, onClose: c, glass: l, className: u, ...d }, f) {
|
|
251
|
+
let p = i ?? "info";
|
|
252
|
+
return /* @__PURE__ */ s("div", {
|
|
253
|
+
ref: f,
|
|
254
|
+
className: e("gds-gap gds-radius-popover border-border gds-pad-x gds-pad-y flex w-full items-start border border-l-2", h[p], g[p], l === !0 && t(l), u),
|
|
255
|
+
"data-component": "notification",
|
|
256
|
+
"data-variant": p,
|
|
257
|
+
role: "alert",
|
|
258
|
+
...d,
|
|
259
|
+
children: [
|
|
260
|
+
/* @__PURE__ */ o("span", {
|
|
261
|
+
className: e("mt-px shrink-0", _[p]),
|
|
262
|
+
children: v[p]
|
|
263
|
+
}),
|
|
264
|
+
/* @__PURE__ */ s("div", {
|
|
265
|
+
className: "min-w-0 flex-1",
|
|
266
|
+
children: [/* @__PURE__ */ o("p", {
|
|
267
|
+
className: "gds-text-body text-fg font-medium",
|
|
268
|
+
children: n
|
|
269
|
+
}), r !== void 0 && /* @__PURE__ */ o("p", {
|
|
270
|
+
className: "gds-text-label text-fg-muted mt-0.5",
|
|
271
|
+
children: r
|
|
272
|
+
})]
|
|
273
|
+
}),
|
|
274
|
+
a !== void 0 && /* @__PURE__ */ o("div", {
|
|
275
|
+
className: "shrink-0",
|
|
276
|
+
children: a
|
|
277
|
+
}),
|
|
278
|
+
c !== void 0 && /* @__PURE__ */ o("button", {
|
|
279
|
+
type: "button",
|
|
280
|
+
onClick: c,
|
|
281
|
+
className: e("gds-radius-button text-fg-muted shrink-0 p-0.5 opacity-60 hover:opacity-100", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-bg"),
|
|
282
|
+
"aria-label": "Dismiss",
|
|
283
|
+
children: /* @__PURE__ */ o("svg", {
|
|
284
|
+
width: "12",
|
|
285
|
+
height: "12",
|
|
286
|
+
viewBox: "0 0 12 12",
|
|
287
|
+
fill: "none",
|
|
288
|
+
stroke: "currentColor",
|
|
289
|
+
strokeWidth: "2",
|
|
290
|
+
strokeLinecap: "round",
|
|
291
|
+
children: /* @__PURE__ */ o("path", { d: "M2 2l8 8M10 2l-8 8" })
|
|
292
|
+
})
|
|
293
|
+
})
|
|
294
|
+
]
|
|
295
|
+
});
|
|
296
|
+
}), b = {
|
|
297
|
+
low: "bg-success/15 text-success",
|
|
298
|
+
medium: "bg-warning/15 text-warning",
|
|
299
|
+
high: "bg-danger/15 text-danger",
|
|
300
|
+
critical: "bg-danger text-white"
|
|
301
|
+
}, x = r(function({ className: t, completed: n = !1, dueDate: r, onToggle: i, priority: a, title: c, ...l }, u) {
|
|
302
|
+
return /* @__PURE__ */ s("div", {
|
|
303
|
+
className: e("flex items-center gap-2 rounded px-2 py-1.5 text-sm", t),
|
|
304
|
+
"data-component": "task-item",
|
|
305
|
+
"data-completed": n,
|
|
306
|
+
ref: u,
|
|
307
|
+
...l,
|
|
308
|
+
children: [
|
|
309
|
+
/* @__PURE__ */ o("input", {
|
|
310
|
+
checked: n,
|
|
311
|
+
className: "accent-accent shrink-0",
|
|
312
|
+
onChange: i,
|
|
313
|
+
type: "checkbox"
|
|
314
|
+
}),
|
|
315
|
+
/* @__PURE__ */ o("span", {
|
|
316
|
+
className: e("flex-1 truncate", n && "text-fg-muted line-through"),
|
|
317
|
+
children: c
|
|
318
|
+
}),
|
|
319
|
+
a !== void 0 && /* @__PURE__ */ o("span", {
|
|
320
|
+
className: e("rounded px-1.5 py-0.5 text-[10px] font-medium uppercase", b[a]),
|
|
321
|
+
children: a
|
|
322
|
+
}),
|
|
323
|
+
r !== void 0 && /* @__PURE__ */ o("span", {
|
|
324
|
+
className: "text-fg-muted shrink-0 text-xs",
|
|
325
|
+
children: r
|
|
326
|
+
})
|
|
327
|
+
]
|
|
328
|
+
});
|
|
329
|
+
}), S = {
|
|
330
|
+
default: "border-l-accent",
|
|
331
|
+
success: "border-l-success",
|
|
332
|
+
warning: "border-l-warning",
|
|
333
|
+
danger: "border-l-danger"
|
|
334
|
+
}, C = {
|
|
335
|
+
default: /* @__PURE__ */ s("svg", {
|
|
336
|
+
width: "16",
|
|
337
|
+
height: "16",
|
|
338
|
+
viewBox: "0 0 16 16",
|
|
339
|
+
fill: "none",
|
|
340
|
+
stroke: "currentColor",
|
|
341
|
+
strokeWidth: "1.5",
|
|
342
|
+
strokeLinecap: "round",
|
|
343
|
+
children: [/* @__PURE__ */ o("circle", {
|
|
344
|
+
cx: "8",
|
|
345
|
+
cy: "8",
|
|
346
|
+
r: "6.5"
|
|
347
|
+
}), /* @__PURE__ */ o("path", { d: "M8 5.5h.01M8 7.5v3" })]
|
|
348
|
+
}),
|
|
349
|
+
success: /* @__PURE__ */ s("svg", {
|
|
350
|
+
width: "16",
|
|
351
|
+
height: "16",
|
|
352
|
+
viewBox: "0 0 16 16",
|
|
353
|
+
fill: "none",
|
|
354
|
+
stroke: "currentColor",
|
|
355
|
+
strokeWidth: "1.5",
|
|
356
|
+
strokeLinecap: "round",
|
|
357
|
+
strokeLinejoin: "round",
|
|
358
|
+
children: [/* @__PURE__ */ o("circle", {
|
|
359
|
+
cx: "8",
|
|
360
|
+
cy: "8",
|
|
361
|
+
r: "6.5"
|
|
362
|
+
}), /* @__PURE__ */ o("path", { d: "M5.5 8l2 2 3-3.5" })]
|
|
363
|
+
}),
|
|
364
|
+
warning: /* @__PURE__ */ s("svg", {
|
|
365
|
+
width: "16",
|
|
366
|
+
height: "16",
|
|
367
|
+
viewBox: "0 0 16 16",
|
|
368
|
+
fill: "none",
|
|
369
|
+
stroke: "currentColor",
|
|
370
|
+
strokeWidth: "1.5",
|
|
371
|
+
strokeLinecap: "round",
|
|
372
|
+
children: [/* @__PURE__ */ o("path", { d: "M7.13 2.5l-5.5 10h11l-5.5-10z" }), /* @__PURE__ */ o("path", { d: "M7.63 6.5v2.5M7.63 11h.01" })]
|
|
373
|
+
}),
|
|
374
|
+
danger: /* @__PURE__ */ s("svg", {
|
|
375
|
+
width: "16",
|
|
376
|
+
height: "16",
|
|
377
|
+
viewBox: "0 0 16 16",
|
|
378
|
+
fill: "none",
|
|
379
|
+
stroke: "currentColor",
|
|
380
|
+
strokeWidth: "1.5",
|
|
381
|
+
strokeLinecap: "round",
|
|
382
|
+
children: [/* @__PURE__ */ o("circle", {
|
|
383
|
+
cx: "8",
|
|
384
|
+
cy: "8",
|
|
385
|
+
r: "6.5"
|
|
386
|
+
}), /* @__PURE__ */ o("path", { d: "M5.5 5.5l5 5M10.5 5.5l-5 5" })]
|
|
387
|
+
})
|
|
388
|
+
}, w = {
|
|
389
|
+
default: "text-accent",
|
|
390
|
+
success: "text-success",
|
|
391
|
+
warning: "text-warning",
|
|
392
|
+
danger: "text-danger"
|
|
393
|
+
}, T = r(function({ title: t, description: n, variant: r = "default", onClose: i, action: a, className: c, ...l }, u) {
|
|
394
|
+
return /* @__PURE__ */ s("div", {
|
|
395
|
+
ref: u,
|
|
396
|
+
className: e("gds-gap gds-radius-popover border-border bg-surface gds-pad-x gds-pad-y gds-shadow-lg flex items-start border border-l-4", S[r], c),
|
|
397
|
+
"data-component": "toast",
|
|
398
|
+
"data-variant": r,
|
|
399
|
+
role: "status",
|
|
400
|
+
...l,
|
|
401
|
+
children: [
|
|
402
|
+
/* @__PURE__ */ o("span", {
|
|
403
|
+
className: e("mt-px shrink-0", w[r]),
|
|
404
|
+
children: C[r]
|
|
405
|
+
}),
|
|
406
|
+
/* @__PURE__ */ s("div", {
|
|
407
|
+
className: "min-w-0 flex-1",
|
|
408
|
+
children: [/* @__PURE__ */ o("p", {
|
|
409
|
+
className: "gds-text-body text-fg font-medium",
|
|
410
|
+
children: t
|
|
411
|
+
}), n !== void 0 && /* @__PURE__ */ o("p", {
|
|
412
|
+
className: "gds-text-label text-fg-muted mt-0.5",
|
|
413
|
+
children: n
|
|
414
|
+
})]
|
|
415
|
+
}),
|
|
416
|
+
a !== void 0 && /* @__PURE__ */ o("div", {
|
|
417
|
+
className: "shrink-0",
|
|
418
|
+
children: a
|
|
419
|
+
}),
|
|
420
|
+
i !== void 0 && /* @__PURE__ */ o("button", {
|
|
421
|
+
type: "button",
|
|
422
|
+
onClick: i,
|
|
423
|
+
className: e("gds-radius-button text-fg-muted shrink-0 p-0.5 opacity-60 hover:opacity-100", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-bg"),
|
|
424
|
+
"aria-label": "Dismiss",
|
|
425
|
+
children: /* @__PURE__ */ o("svg", {
|
|
426
|
+
width: "12",
|
|
427
|
+
height: "12",
|
|
428
|
+
viewBox: "0 0 12 12",
|
|
429
|
+
fill: "none",
|
|
430
|
+
stroke: "currentColor",
|
|
431
|
+
strokeWidth: "2",
|
|
432
|
+
strokeLinecap: "round",
|
|
433
|
+
children: /* @__PURE__ */ o("path", { d: "M2 2l8 8M10 2l-8 8" })
|
|
434
|
+
})
|
|
435
|
+
})
|
|
436
|
+
]
|
|
437
|
+
});
|
|
438
|
+
});
|
|
439
|
+
//#endregion
|
|
440
|
+
export { p as a, m as i, x as n, l as o, y as r, T as t };
|
|
441
|
+
|
|
442
|
+
//# sourceMappingURL=toast-BujeTn1T.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast-BujeTn1T.js","names":[],"sources":["../src/l4-molecules/audit-entry.tsx","../src/l4-molecules/inline-edit.tsx","../src/l4-molecules/list-item.tsx","../src/l4-molecules/notification.tsx","../src/l4-molecules/task-item.tsx","../src/l4-molecules/toast.tsx"],"sourcesContent":["import { forwardRef } from 'react'\n\nimport { cx } from '../utils/cx'\n\ntype AuditEntryVariant = 'danger' | 'default' | 'success' | 'warning'\n\ntype AuditEntryProps = React.HTMLAttributes<HTMLDivElement> & {\n action: string\n target?: string\n timestamp: string\n user: string\n variant?: AuditEntryVariant\n}\n\nconst variantCls: Record<AuditEntryVariant, string> = {\n default: 'text-fg',\n success: 'text-success',\n warning: 'text-warning',\n danger: 'text-danger',\n}\n\nexport const AuditEntry = forwardRef<HTMLDivElement, AuditEntryProps>(\n function AuditEntry(\n {\n action,\n className,\n target,\n timestamp,\n user,\n variant = 'default',\n ...props\n },\n ref\n ) {\n return (\n <div\n className={cx(\n 'gds-gap gds-text flex items-center justify-between',\n className\n )}\n data-component=\"audit-entry\"\n ref={ref}\n {...props}\n >\n <span className=\"text-fg-muted shrink-0 text-xs\">{timestamp}</span>\n <span className=\"flex-1 truncate\">\n <span className=\"text-fg font-medium\">{user}</span>{' '}\n <span className={variantCls[variant]}>{action}</span>\n {target !== undefined && (\n <span className=\"text-fg-muted\"> {target}</span>\n )}\n </span>\n </div>\n )\n }\n)\n\nexport type { AuditEntryProps, AuditEntryVariant }\n","// inline-edit — editable text with confirm/cancel buttons and validation\nimport { forwardRef, useCallback, useState } from 'react'\n\nimport { focusCls } from '../utils/a11y'\nimport { cx } from '../utils/cx'\n\nexport type InlineEditProps = {\n value: string\n onSave: (value: string) => void\n onCancel?: () => void\n validate?: (value: string) => string | null\n placeholder?: string\n disabled?: boolean\n className?: string\n}\n\nconst checkIcon = (\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 14 14\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M2.5 7.5l3 3 6-6.5\" />\n </svg>\n)\n\nconst cancelIcon = (\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 14 14\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n >\n <path d=\"M3 3l8 8M11 3l-8 8\" />\n </svg>\n)\n\nconst editIcon = (\n <svg\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M7 2l3 3-7 7H0V9z\" />\n </svg>\n)\n\nexport const InlineEdit = forwardRef<HTMLDivElement, InlineEditProps>(\n function InlineEdit(\n {\n value,\n onSave,\n onCancel,\n validate,\n placeholder = 'Click to edit',\n disabled,\n className,\n },\n ref\n ) {\n const [editing, setEditing] = useState(false)\n const [editValue, setEditValue] = useState(value)\n const [error, setError] = useState<string | null>(null)\n\n const startEditing = useCallback(() => {\n if (disabled === true) return\n setEditValue(value)\n setError(null)\n setEditing(true)\n }, [disabled, value])\n\n const save = useCallback(() => {\n if (validate !== undefined) {\n const err = validate(editValue)\n if (err !== null) {\n setError(err)\n return\n }\n }\n setEditing(false)\n setError(null)\n onSave(editValue)\n }, [editValue, onSave, validate])\n\n const cancel = useCallback(() => {\n setEditing(false)\n setEditValue(value)\n setError(null)\n if (onCancel !== undefined) {\n onCancel()\n }\n }, [onCancel, value])\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter') {\n save()\n }\n if (e.key === 'Escape') {\n cancel()\n }\n },\n [save, cancel]\n )\n\n if (editing) {\n return (\n <div\n ref={ref}\n className={cx('inline-flex flex-col', className)}\n data-component=\"inline-edit\"\n data-state=\"editing\"\n >\n <div className=\"flex items-center gap-1\">\n <input\n autoFocus\n className={cx(\n 'gds-text-body text-fg border-accent/50 border-b bg-transparent px-0.5 outline-none',\n error !== null && 'border-danger/50',\n focusCls\n )}\n onChange={(e) => {\n setEditValue(e.target.value)\n setError(null)\n }}\n onKeyDown={handleKeyDown}\n type=\"text\"\n value={editValue}\n />\n <button\n type=\"button\"\n onClick={save}\n className={cx(\n 'text-success hover:text-success/80 shrink-0 p-0.5',\n focusCls\n )}\n aria-label=\"Save\"\n >\n {checkIcon}\n </button>\n <button\n type=\"button\"\n onClick={cancel}\n className={cx(\n 'text-fg-muted hover:text-fg shrink-0 p-0.5',\n focusCls\n )}\n aria-label=\"Cancel\"\n >\n {cancelIcon}\n </button>\n </div>\n {error !== null && (\n <span className=\"text-danger mt-0.5 text-[10px]\">{error}</span>\n )}\n </div>\n )\n }\n\n const isEmpty = value === ''\n\n return (\n <div\n ref={ref}\n className={cx(\n 'group inline-flex cursor-pointer items-center gap-1',\n disabled === true && 'pointer-events-none opacity-50',\n className\n )}\n data-component=\"inline-edit\"\n data-state=\"display\"\n onClick={startEditing}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') startEditing()\n }}\n role=\"button\"\n tabIndex={disabled === true ? -1 : 0}\n >\n <span\n className={cx(\n 'gds-text-body',\n isEmpty ? 'text-fg-muted' : 'text-fg',\n focusCls\n )}\n >\n {isEmpty ? placeholder : value}\n </span>\n <span className=\"text-fg-muted/0 group-hover:text-fg-muted/60 transition-colors\">\n {editIcon}\n </span>\n </div>\n )\n }\n)\n","// list-item — structured list row with icon, title, description, and trailing element\nimport type { ReactNode } from 'react'\nimport { forwardRef } from 'react'\n\nimport { cx } from '../utils/cx'\n\nexport type ListItemProps = {\n icon?: ReactNode\n title: string\n description?: string\n trailing?: ReactNode\n onClick?: () => void\n active?: boolean\n disabled?: boolean\n className?: string\n}\n\nexport const ListItem = forwardRef<HTMLDivElement, ListItemProps>(\n function ListItem(\n {\n icon,\n title,\n description,\n trailing,\n onClick,\n active,\n disabled,\n className,\n },\n ref\n ) {\n const isClickable = onClick !== undefined && disabled !== true\n\n return (\n <div\n ref={ref}\n role={isClickable ? 'button' : undefined}\n tabIndex={isClickable ? 0 : undefined}\n onClick={isClickable ? onClick : undefined}\n onKeyDown={\n isClickable\n ? (e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n onClick()\n }\n }\n : undefined\n }\n className={cx(\n 'gds-pad-x gds-pad-y-sm gds-text-body flex items-center gap-3 select-none',\n isClickable && 'hover:bg-bg-tertiary cursor-pointer',\n active === true && 'border-l-accent bg-accent/5 border-l-2',\n disabled === true && 'pointer-events-none opacity-50',\n className\n )}\n data-component=\"list-item\"\n data-state={active === true ? 'active' : undefined}\n >\n {icon !== undefined && (\n <span className=\"text-fg-muted shrink-0\">{icon}</span>\n )}\n <div className=\"min-w-0 flex-1\">\n <div className=\"text-fg font-medium\">{title}</div>\n {description !== undefined && (\n <div className=\"text-fg-muted gds-text-caption mt-0.5\">\n {description}\n </div>\n )}\n </div>\n {trailing !== undefined && <span className=\"shrink-0\">{trailing}</span>}\n </div>\n )\n }\n)\n","// notification — persistent banner with variant, title, description, and action\nimport type { ReactNode } from 'react'\nimport { forwardRef } from 'react'\n\nimport { focusCls } from '../utils/a11y'\nimport { cx } from '../utils/cx'\nimport { glassClass } from '../utils/glass'\n\ntype NotificationVariant = 'danger' | 'info' | 'success' | 'warning'\n\nconst borderColorMap: Record<NotificationVariant, string> = {\n info: 'border-l-accent',\n success: 'border-l-success',\n warning: 'border-l-warning',\n danger: 'border-l-danger',\n}\n\nconst bgColorMap: Record<NotificationVariant, string> = {\n info: 'bg-accent/5',\n success: 'bg-success/5',\n warning: 'bg-warning/5',\n danger: 'bg-danger/5',\n}\n\nconst iconColorMap: Record<NotificationVariant, string> = {\n info: 'text-accent',\n success: 'text-success',\n warning: 'text-warning',\n danger: 'text-danger',\n}\n\nconst iconMap: Record<NotificationVariant, ReactNode> = {\n info: (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n >\n <circle cx=\"8\" cy=\"8\" r=\"6.5\" />\n <path d=\"M8 5.5h.01M8 7.5v3\" />\n </svg>\n ),\n success: (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"8\" cy=\"8\" r=\"6.5\" />\n <path d=\"M5.5 8l2 2 3-3.5\" />\n </svg>\n ),\n warning: (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n >\n <path d=\"M7.13 2.5l-5.5 10h11l-5.5-10z\" />\n <path d=\"M7.63 6.5v2.5M7.63 11h.01\" />\n </svg>\n ),\n danger: (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n >\n <circle cx=\"8\" cy=\"8\" r=\"6.5\" />\n <path d=\"M5.5 5.5l5 5M10.5 5.5l-5 5\" />\n </svg>\n ),\n}\n\ntype NotificationProps = React.HTMLAttributes<HTMLDivElement> & {\n title: string\n description?: string\n variant?: NotificationVariant\n action?: ReactNode\n onClose?: () => void\n glass?: boolean\n}\n\nconst Notification = forwardRef<HTMLDivElement, NotificationProps>(\n function Notification(\n {\n title,\n description,\n variant = 'info',\n action,\n onClose,\n glass,\n className,\n ...props\n },\n ref\n ) {\n const v = variant ?? 'info'\n\n return (\n <div\n ref={ref}\n className={cx(\n 'gds-gap gds-radius-popover border-border gds-pad-x gds-pad-y flex w-full items-start border border-l-2',\n borderColorMap[v],\n bgColorMap[v],\n glass === true && glassClass(glass),\n className\n )}\n data-component=\"notification\"\n data-variant={v}\n role=\"alert\"\n {...props}\n >\n <span className={cx('mt-px shrink-0', iconColorMap[v])}>\n {iconMap[v]}\n </span>\n <div className=\"min-w-0 flex-1\">\n <p className=\"gds-text-body text-fg font-medium\">{title}</p>\n {description !== undefined && (\n <p className=\"gds-text-label text-fg-muted mt-0.5\">{description}</p>\n )}\n </div>\n {action !== undefined && <div className=\"shrink-0\">{action}</div>}\n {onClose !== undefined && (\n <button\n type=\"button\"\n onClick={onClose}\n className={cx(\n 'gds-radius-button text-fg-muted shrink-0 p-0.5 opacity-60 hover:opacity-100',\n focusCls\n )}\n aria-label=\"Dismiss\"\n >\n <svg\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n >\n <path d=\"M2 2l8 8M10 2l-8 8\" />\n </svg>\n </button>\n )}\n </div>\n )\n }\n)\n\nexport { Notification }\nexport type { NotificationProps, NotificationVariant }\n","import { forwardRef } from 'react'\n\nimport { cx } from '../utils/cx'\n\ntype TaskItemPriority = 'low' | 'medium' | 'high' | 'critical'\n\ntype TaskItemProps = React.HTMLAttributes<HTMLDivElement> & {\n completed?: boolean\n dueDate?: string\n onToggle?: () => void\n priority?: TaskItemPriority\n title: string\n}\n\nconst priorityCls: Record<TaskItemPriority, string> = {\n low: 'bg-success/15 text-success',\n medium: 'bg-warning/15 text-warning',\n high: 'bg-danger/15 text-danger',\n critical: 'bg-danger text-white',\n}\n\nconst TaskItem = forwardRef<HTMLDivElement, TaskItemProps>(function TaskItem(\n {\n className,\n completed = false,\n dueDate,\n onToggle,\n priority,\n title,\n ...props\n },\n ref\n) {\n return (\n <div\n className={cx(\n 'flex items-center gap-2 rounded px-2 py-1.5 text-sm',\n className\n )}\n data-component=\"task-item\"\n data-completed={completed}\n ref={ref}\n {...props}\n >\n <input\n checked={completed}\n className=\"accent-accent shrink-0\"\n onChange={onToggle}\n type=\"checkbox\"\n />\n <span\n className={cx(\n 'flex-1 truncate',\n completed && 'text-fg-muted line-through'\n )}\n >\n {title}\n </span>\n {priority !== undefined && (\n <span\n className={cx(\n 'rounded px-1.5 py-0.5 text-[10px] font-medium uppercase',\n priorityCls[priority]\n )}\n >\n {priority}\n </span>\n )}\n {dueDate !== undefined && (\n <span className=\"text-fg-muted shrink-0 text-xs\">{dueDate}</span>\n )}\n </div>\n )\n})\n\nexport { TaskItem }\nexport type { TaskItemPriority, TaskItemProps }\n","// toast — notification card with variant, title, description, and action\nimport type { ReactNode } from 'react'\nimport { forwardRef } from 'react'\n\nimport { focusCls } from '../utils/a11y'\nimport { cx } from '../utils/cx'\n\nexport type ToastVariant = 'danger' | 'default' | 'success' | 'warning'\n\nconst borderColorMap: Record<ToastVariant, string> = {\n default: 'border-l-accent',\n success: 'border-l-success',\n warning: 'border-l-warning',\n danger: 'border-l-danger',\n}\n\nconst iconMap: Record<ToastVariant, ReactNode> = {\n default: (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n >\n <circle cx=\"8\" cy=\"8\" r=\"6.5\" />\n <path d=\"M8 5.5h.01M8 7.5v3\" />\n </svg>\n ),\n success: (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"8\" cy=\"8\" r=\"6.5\" />\n <path d=\"M5.5 8l2 2 3-3.5\" />\n </svg>\n ),\n warning: (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n >\n <path d=\"M7.13 2.5l-5.5 10h11l-5.5-10z\" />\n <path d=\"M7.63 6.5v2.5M7.63 11h.01\" />\n </svg>\n ),\n danger: (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n >\n <circle cx=\"8\" cy=\"8\" r=\"6.5\" />\n <path d=\"M5.5 5.5l5 5M10.5 5.5l-5 5\" />\n </svg>\n ),\n}\n\nconst iconColorMap: Record<ToastVariant, string> = {\n default: 'text-accent',\n success: 'text-success',\n warning: 'text-warning',\n danger: 'text-danger',\n}\n\nexport type ToastProps = React.HTMLAttributes<HTMLDivElement> & {\n title: string\n description?: string\n variant?: ToastVariant\n onClose?: () => void\n action?: ReactNode\n}\n\nexport const Toast = forwardRef<HTMLDivElement, ToastProps>(function Toast(\n {\n title,\n description,\n variant = 'default',\n onClose,\n action,\n className,\n ...props\n },\n ref\n) {\n return (\n <div\n ref={ref}\n className={cx(\n 'gds-gap gds-radius-popover border-border bg-surface gds-pad-x gds-pad-y gds-shadow-lg flex items-start border border-l-4',\n borderColorMap[variant],\n className\n )}\n data-component=\"toast\"\n data-variant={variant}\n role=\"status\"\n {...props}\n >\n <span className={cx('mt-px shrink-0', iconColorMap[variant])}>\n {iconMap[variant]}\n </span>\n <div className=\"min-w-0 flex-1\">\n <p className=\"gds-text-body text-fg font-medium\">{title}</p>\n {description !== undefined && (\n <p className=\"gds-text-label text-fg-muted mt-0.5\">{description}</p>\n )}\n </div>\n {action !== undefined && <div className=\"shrink-0\">{action}</div>}\n {onClose !== undefined && (\n <button\n type=\"button\"\n onClick={onClose}\n className={cx(\n 'gds-radius-button text-fg-muted shrink-0 p-0.5 opacity-60 hover:opacity-100',\n focusCls\n )}\n aria-label=\"Dismiss\"\n >\n <svg\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n >\n <path d=\"M2 2l8 8M10 2l-8 8\" />\n </svg>\n </button>\n )}\n </div>\n )\n})\n"],"mappings":";;;;;AAcA,IAAM,IAAgD;CACpD,SAAS;CACT,SAAS;CACT,SAAS;CACT,QAAQ;CACT,EAEY,IAAa,EACxB,SACE,EACE,WACA,cACA,WACA,cACA,SACA,aAAU,WACV,GAAG,KAEL,GACA;AACA,QACE,kBAAC,OAAD;EACE,WAAW,EACT,sDACA,EACD;EACD,kBAAe;EACV;EACL,GAAI;YAPN,CASE,kBAAC,QAAD;GAAM,WAAU;aAAkC;GAAiB,CAAA,EACnE,kBAAC,QAAD;GAAM,WAAU;aAAhB;IACE,kBAAC,QAAD;KAAM,WAAU;eAAuB;KAAY,CAAA;IAAC;IACpD,kBAAC,QAAD;KAAM,WAAW,EAAW;eAAW;KAAc,CAAA;IACpD,MAAW,KAAA,KACV,kBAAC,QAAD;KAAM,WAAU;eAAhB,CAAgC,KAAE,EAAc;;IAE7C;KACH;;EAGX,ECvCK,IACJ,kBAAC,OAAD;CACE,OAAM;CACN,QAAO;CACP,SAAQ;CACR,MAAK;CACL,QAAO;CACP,aAAY;CACZ,eAAc;CACd,gBAAe;WAE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23 +40,8 @@ var c = {
|
|
|
40
40
|
})]
|
|
41
41
|
})]
|
|
42
42
|
});
|
|
43
|
-
}), d = {
|
|
44
|
-
default: "h-1.5 w-1.5",
|
|
45
|
-
sm: "h-1 w-1"
|
|
46
|
-
}, f = n(function({ className: t, count: n = 3, size: r = "default", ...i }, a) {
|
|
47
|
-
return /* @__PURE__ */ o("span", {
|
|
48
|
-
className: e("gds-gap-xs inline-flex items-center", t),
|
|
49
|
-
"data-component": "loading-dots",
|
|
50
|
-
ref: a,
|
|
51
|
-
role: "status",
|
|
52
|
-
...i,
|
|
53
|
-
children: Array.from({ length: n }, (t, n) => /* @__PURE__ */ o("span", {
|
|
54
|
-
className: e("gds-radius-badge bg-fg-muted/40 animate-pulse", d[r]),
|
|
55
|
-
style: { animationDelay: `${n * 150}ms` }
|
|
56
|
-
}, n))
|
|
57
|
-
});
|
|
58
43
|
});
|
|
59
44
|
//#endregion
|
|
60
|
-
export { u as
|
|
45
|
+
export { u as t };
|
|
61
46
|
|
|
62
|
-
//# sourceMappingURL=
|
|
47
|
+
//# sourceMappingURL=tooltip-BlvhLCp0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip-BlvhLCp0.js","names":[],"sources":["../src/l3-atoms/tooltip.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { forwardRef, useCallback, useRef, useState } from 'react'\n\nimport { cx } from '../utils/cx'\nimport { glassClass } from '../utils/glass'\n\nconst positionClasses: Record<string, string> = {\n bottom: 'top-full left-1/2 -translate-x-1/2 mt-2',\n left: 'right-full top-1/2 -translate-y-1/2 mr-2',\n right: 'left-full top-1/2 -translate-y-1/2 ml-2',\n top: 'bottom-full left-1/2 -translate-x-1/2 mb-2',\n}\n\nconst arrowClasses: Record<string, string> = {\n bottom:\n 'bottom-full left-1/2 -translate-x-1/2 border-b-bg-tertiary border-x-transparent border-t-transparent border-4',\n left: 'left-full top-1/2 -translate-y-1/2 border-l-bg-tertiary border-y-transparent border-r-transparent border-4',\n right:\n 'right-full top-1/2 -translate-y-1/2 border-r-bg-tertiary border-y-transparent border-l-transparent border-4',\n top: 'top-full left-1/2 -translate-x-1/2 border-t-bg-tertiary border-x-transparent border-b-transparent border-4',\n}\n\ntype TooltipProps = React.HTMLAttributes<HTMLDivElement> & {\n content: ReactNode\n delay?: number\n glass?: boolean\n interactive?: boolean\n maxWidth?: number\n placement?: 'bottom' | 'left' | 'right' | 'top'\n}\n\nexport const Tooltip = forwardRef<HTMLDivElement, TooltipProps>(\n function Tooltip(\n {\n children,\n className,\n content,\n delay = 300,\n glass,\n interactive = false,\n maxWidth,\n placement = 'top',\n ...props\n },\n ref\n ) {\n const [open, setOpen] = useState(false)\n const enterTimer = useRef<ReturnType<typeof setTimeout>>(undefined)\n const leaveTimer = useRef<ReturnType<typeof setTimeout>>(undefined)\n\n const handleEnter = useCallback(() => {\n clearTimeout(leaveTimer.current)\n enterTimer.current = setTimeout(() => setOpen(true), delay)\n }, [delay])\n\n const handleLeave = useCallback(() => {\n clearTimeout(enterTimer.current)\n if (interactive) {\n leaveTimer.current = setTimeout(() => setOpen(false), 150)\n } else {\n setOpen(false)\n }\n }, [interactive])\n\n return (\n <div\n className={cx('relative inline-flex', className)}\n data-component=\"tooltip\"\n data-state={open ? 'open' : 'closed'}\n onMouseEnter={handleEnter}\n onMouseLeave={handleLeave}\n ref={ref}\n {...props}\n >\n {children}\n {open && (\n <div\n className={cx(\n 'animate-popup gds-radius-tooltip gds-pad-x-sm gds-pad-y-sm gds-text-label text-fg pointer-events-none absolute z-50 whitespace-nowrap',\n interactive && 'pointer-events-auto',\n glass === true ? glassClass(glass) : 'bg-bg-tertiary',\n glass === true && 'border border-white/10'\n )}\n onMouseEnter={interactive ? handleEnter : undefined}\n onMouseLeave={interactive ? handleLeave : undefined}\n style={\n maxWidth !== undefined\n ? { maxWidth, whiteSpace: 'normal' }\n : undefined\n }\n >\n <span className={cx('absolute', arrowClasses[placement])} />\n <span className={positionClasses[placement]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KAEJ;;EAGX"}
|
package/dist/utils/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { n as e, r as t, t as n } from "../glass-CQTlX7IO.js";
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { t as
|
|
7
|
-
import { i as
|
|
8
|
-
|
|
2
|
+
import { n as r, t as i } from "../a11y-CoNNB_xa.js";
|
|
3
|
+
import { n as a, t as o } from "../motion-CKB1OKVd.js";
|
|
4
|
+
import { t as s } from "../portal-B7bfstxv.js";
|
|
5
|
+
import { i as c, n as l, r as u, t as d } from "../dom-DkPgnDHP.js";
|
|
6
|
+
import { a as f, i as p, n as m, o as h, r as g, s as _, t as v } from "../hooks-CejfTXVD.js";
|
|
7
|
+
import { i as y, n as b, r as x, t as S } from "../gesture-CVcSA-iZ.js";
|
|
8
|
+
import { t as C } from "../sanitize-CO5dRqZX.js";
|
|
9
|
+
export { S as applyInertia, d as clamp, t as cx, i as focusCls, n as glassClass, e as glassSurface, l as isActivationKey, u as mergeRefs, o as motionClass, a as motionClassWithSpeed, s as renderPortal, C as sanitizeEmailHtml, r as srOnly, c as uid, v as useClickOutside, b as useDrag, m as useEscapeKey, g as useFocusTrap, p as useIsDesktop, f as useIsMobile, x as useLongPress, h as useMediaQuery, _ as useScrollLock, y as useSwipe };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goliapkg/gds",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "GOLIA Design System — enterprise-grade UI component library with contextual depth, glass materials, AI-native structure, and 10 design principles",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -60,6 +60,10 @@
|
|
|
60
60
|
"import": "./dist/l5-organisms/index.js",
|
|
61
61
|
"types": "./dist/l5-organisms/index.d.ts"
|
|
62
62
|
},
|
|
63
|
+
"./editor": {
|
|
64
|
+
"import": "./dist/editor/index.js",
|
|
65
|
+
"types": "./dist/editor/index.d.ts"
|
|
66
|
+
},
|
|
63
67
|
"./charts": {
|
|
64
68
|
"import": "./dist/l6-charts/index.js",
|
|
65
69
|
"types": "./dist/l6-charts/index.d.ts"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button-BD3VHhwq.js","names":[],"sources":["../node_modules/class-variance-authority/dist/index.mjs","../src/l2-primitives/button.tsx"],"sourcesContent":["/**\n * Copyright 2022 Joe Bell. All rights reserved.\n *\n * This file is licensed to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with the\n * License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR REPRESENTATIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations under\n * the License.\n */ import { clsx } from \"clsx\";\nconst falsyToString = (value)=>typeof value === \"boolean\" ? `${value}` : value === 0 ? \"0\" : value;\nexport const cx = clsx;\nexport const cva = (base, config)=>(props)=>{\n var _config_compoundVariants;\n if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n const { variants, defaultVariants } = config;\n const getVariantClassNames = Object.keys(variants).map((variant)=>{\n const variantProp = props === null || props === void 0 ? void 0 : props[variant];\n const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];\n if (variantProp === null) return null;\n const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);\n return variants[variant][variantKey];\n });\n const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{\n let [key, value] = param;\n if (value === undefined) {\n return acc;\n }\n acc[key] = value;\n return acc;\n }, {});\n const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param)=>{\n let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;\n return Object.entries(compoundVariantOptions).every((param)=>{\n let [key, value] = param;\n return Array.isArray(value) ? value.includes({\n ...defaultVariants,\n ...propsWithoutUndefined\n }[key]) : ({\n ...defaultVariants,\n ...propsWithoutUndefined\n })[key] === value;\n }) ? [\n ...acc,\n cvClass,\n cvClassName\n ] : acc;\n }, []);\n return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n };\n\n","import { cva } from 'class-variance-authority'\nimport type { ReactNode } from 'react'\nimport { forwardRef } from 'react'\n\nimport { focusCls } from '../utils/a11y'\nimport { cx } from '../utils/cx'\nimport { glassClass } from '../utils/glass'\nimport { motionClass } from '../utils/motion'\nimport type { VariantProps } from '../utils/types'\n\nconst buttonVariants = cva(\n 'inline-flex select-none items-center justify-center font-medium transition-colors ' +\n focusCls,\n {\n defaultVariants: {\n size: 'default',\n variant: 'primary',\n },\n variants: {\n size: {\n default: 'gds-h gds-gap-sm gds-radius-button gds-pad-x gds-text-body',\n lg: 'gds-h-lg gds-gap gds-radius-button gds-pad-x-lg gds-text-body',\n sm: 'gds-h-sm gds-gap-xs gds-radius-button gds-pad-x-sm gds-text-label',\n },\n variant: {\n danger: 'bg-danger text-accent-fg hover:bg-danger/90',\n ghost:\n 'bg-transparent text-fg-muted hover:bg-bg-tertiary hover:text-fg',\n primary: 'bg-accent text-accent-fg hover:bg-accent-hover',\n secondary:\n 'border border-border bg-transparent text-fg hover:bg-bg-tertiary',\n },\n },\n }\n)\n\ntype ButtonSize = 'default' | 'lg' | 'sm'\ntype ButtonVariant = 'danger' | 'ghost' | 'primary' | 'secondary'\n\ntype ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> &\n VariantProps<typeof buttonVariants> & {\n /** Visual style: primary, secondary, ghost, danger */\n variant?: 'danger' | 'ghost' | 'primary' | 'secondary'\n /** Height and text scale preset */\n size?: 'default' | 'lg' | 'sm'\n fullWidth?: boolean\n /** Enable frosted glass translucency effect */\n glass?: boolean\n /** Icon element rendered before children */\n icon?: ReactNode\n iconRight?: ReactNode\n /** Show spinner and disable interaction */\n loading?: boolean\n /** Animation preset name (e.g. 'fade', 'scale') */\n motion?: string\n }\n\n// inline SVG spinner to avoid circular L2 dependency\nfunction InlineSpinner() {\n return (\n <svg className=\"h-3 w-3 animate-spin\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle\n className=\"opacity-25\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n />\n <path\n className=\"opacity-75\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n function Button(\n {\n children,\n className,\n disabled,\n fullWidth,\n glass,\n icon,\n iconRight,\n loading,\n motion: m,\n size,\n variant,\n ...props\n },\n ref\n ) {\n return (\n <button\n className={cx(\n buttonVariants({ size, variant }),\n (disabled === true || loading === true) &&\n 'cursor-not-allowed opacity-50',\n fullWidth === true && 'w-full',\n glassClass(glass),\n glass === true && 'bg-bg/60 border border-white/10',\n motionClass(m),\n className\n )}\n data-component=\"button\"\n data-variant={variant ?? 'primary'}\n disabled={disabled === true || loading === true}\n ref={ref}\n {...props}\n >\n {loading === true ? (\n <InlineSpinner />\n ) : icon !== undefined ? (\n <span className=\"gds-icon-child-sm\">{icon}</span>\n ) : null}\n {children}\n {iconRight !== undefined && (\n <span className=\"gds-icon-child-sm\">{iconRight}</span>\n )}\n </button>\n )\n }\n)\n\nexport { buttonVariants }\nexport type { ButtonProps, ButtonSize, ButtonVariant }\n"],"x_google_ignoreList":[0],"mappings":";;;;;AAeA,IAAM,KAAiB,MAAQ,OAAO,KAAU,YAAY,GAAG,MAAU,MAA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