@webstrail/ui-library 1.0.2 → 1.0.3
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/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -6
- package/dist/index.js +1248 -817
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +3 -19
- package/dist/UIProvider-C3ae0nQV.cjs +0 -2
- package/dist/UIProvider-C3ae0nQV.cjs.map +0 -1
- package/dist/UIProvider-CHECrDaZ.js +0 -466
- package/dist/UIProvider-CHECrDaZ.js.map +0 -1
- package/dist/core/config/globalConfig.d.ts +0 -54
- package/dist/core/config/index.d.ts +0 -1
- package/dist/core/index.d.ts +0 -4
- package/dist/core/theme/defaultTheme.d.ts +0 -7
- package/dist/core/theme/deriveTokens.d.ts +0 -16
- package/dist/core/theme/index.d.ts +0 -2
- package/dist/core/types/common.d.ts +0 -32
- package/dist/core/types/config.d.ts +0 -70
- package/dist/core/types/index.d.ts +0 -3
- package/dist/core/types/tokens.d.ts +0 -65
- package/dist/core/utils/styles.d.ts +0 -19
- package/dist/core.cjs +0 -2
- package/dist/core.cjs.map +0 -1
- package/dist/core.js +0 -344
- package/dist/core.js.map +0 -1
- package/dist/react/components/Button/Button.d.ts +0 -2
- package/dist/react/components/Button/Button.types.d.ts +0 -52
- package/dist/react/components/Button/index.d.ts +0 -2
- package/dist/react/index.d.ts +0 -6
- package/dist/react.cjs +0 -2
- package/dist/react.cjs.map +0 -1
- package/dist/react.js +0 -9
- package/dist/react.js.map +0 -1
- package/dist/web-components/button/button.element.d.ts +0 -59
- package/dist/web-components/button/button.styles.d.ts +0 -1
- package/dist/web-components/button/button.types.d.ts +0 -21
- package/dist/web-components/button/index.d.ts +0 -3
- package/dist/web-components/index.d.ts +0 -1
- package/dist/web-components.cjs +0 -269
- package/dist/web-components.cjs.map +0 -1
- package/dist/web-components.js +0 -503
- package/dist/web-components.js.map +0 -1
package/dist/core.js
DELETED
|
@@ -1,344 +0,0 @@
|
|
|
1
|
-
function $(o) {
|
|
2
|
-
if (!o) return "medium";
|
|
3
|
-
switch (o) {
|
|
4
|
-
case "sm":
|
|
5
|
-
case "small":
|
|
6
|
-
return "small";
|
|
7
|
-
case "lg":
|
|
8
|
-
case "large":
|
|
9
|
-
return "large";
|
|
10
|
-
case "md":
|
|
11
|
-
case "medium":
|
|
12
|
-
default:
|
|
13
|
-
return "medium";
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
const R = {
|
|
17
|
-
primary: "#2491eb",
|
|
18
|
-
secondary: "#406993",
|
|
19
|
-
text: "#1f2937",
|
|
20
|
-
textSecondary: "#6b7280",
|
|
21
|
-
border: "#d1d5db",
|
|
22
|
-
background: "#ffffff",
|
|
23
|
-
error: "#dc2626",
|
|
24
|
-
success: "#16a34a",
|
|
25
|
-
disabled: "#9ca3af",
|
|
26
|
-
disabledBackground: "#f3f4f6",
|
|
27
|
-
disabledText: "#9ca3af",
|
|
28
|
-
focusRing: "rgba(36, 145, 235, 0.35)"
|
|
29
|
-
}, m = {
|
|
30
|
-
fontFamily: 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif',
|
|
31
|
-
fontSizeSmall: "12px",
|
|
32
|
-
fontSizeMedium: "14px",
|
|
33
|
-
fontSizeLarge: "16px",
|
|
34
|
-
fontWeightNormal: 400,
|
|
35
|
-
fontWeightMedium: 500,
|
|
36
|
-
fontWeightBold: 600
|
|
37
|
-
}, I = {
|
|
38
|
-
borderRadiusSmall: "6px",
|
|
39
|
-
borderRadiusMedium: "8px",
|
|
40
|
-
borderRadiusLarge: "12px"
|
|
41
|
-
}, y = {
|
|
42
|
-
height: "40px",
|
|
43
|
-
borderRadius: "8px",
|
|
44
|
-
fontSize: "14px",
|
|
45
|
-
fontWeight: 500,
|
|
46
|
-
backgroundColor: "#2491eb",
|
|
47
|
-
textColor: "#ffffff",
|
|
48
|
-
borderColor: "transparent",
|
|
49
|
-
hoverBackgroundColor: "#1d78c4",
|
|
50
|
-
hoverTextColor: "#ffffff",
|
|
51
|
-
activeBackgroundColor: "#1565a0",
|
|
52
|
-
disabledBackgroundColor: "#f3f4f6",
|
|
53
|
-
disabledTextColor: "#9ca3af",
|
|
54
|
-
disabledBorderColor: "#e5e7eb",
|
|
55
|
-
focusRingColor: "rgba(36, 145, 235, 0.35)",
|
|
56
|
-
padding: "0 16px",
|
|
57
|
-
transition: "all 0.15s ease-in-out",
|
|
58
|
-
outlineColor: "#2491eb",
|
|
59
|
-
outlineBorderColor: "#2491eb",
|
|
60
|
-
outlineHoverBackgroundColor: "rgba(36, 145, 235, 0.08)",
|
|
61
|
-
ghostColor: "#2491eb",
|
|
62
|
-
ghostHoverBackgroundColor: "rgba(36, 145, 235, 0.08)"
|
|
63
|
-
}, S = {
|
|
64
|
-
theme: {
|
|
65
|
-
primaryColor: "#2491eb",
|
|
66
|
-
secondaryColor: "#406993",
|
|
67
|
-
fontFamily: m.fontFamily,
|
|
68
|
-
borderRadius: "8px",
|
|
69
|
-
colors: R,
|
|
70
|
-
typography: m,
|
|
71
|
-
layout: I
|
|
72
|
-
},
|
|
73
|
-
components: {
|
|
74
|
-
button: {
|
|
75
|
-
variant: "primary",
|
|
76
|
-
size: "medium",
|
|
77
|
-
fullWidth: !1,
|
|
78
|
-
styles: y
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
function g(o, e = 0.1) {
|
|
83
|
-
if (!o || typeof o != "string") return "rgba(36, 145, 235, 0.1)";
|
|
84
|
-
const s = o.trim(), n = s.match(/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/);
|
|
85
|
-
if (n) {
|
|
86
|
-
const r = parseInt(n[1], 16), c = parseInt(n[2], 16), i = parseInt(n[3], 16);
|
|
87
|
-
return `rgba(${r}, ${c}, ${i}, ${e})`;
|
|
88
|
-
}
|
|
89
|
-
const t = s.match(/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/);
|
|
90
|
-
if (t) {
|
|
91
|
-
const r = parseInt(t[1] + t[1], 16), c = parseInt(t[2] + t[2], 16), i = parseInt(t[3] + t[3], 16);
|
|
92
|
-
return `rgba(${r}, ${c}, ${i}, ${e})`;
|
|
93
|
-
}
|
|
94
|
-
const a = Math.round(e * 100);
|
|
95
|
-
return `color-mix(in srgb, ${s} ${a}%, #ffffff)`;
|
|
96
|
-
}
|
|
97
|
-
function k(o, e = 0.25) {
|
|
98
|
-
if (!o || typeof o != "string") return "rgba(36, 145, 235, 0.25)";
|
|
99
|
-
const s = o.trim(), n = s.match(/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/);
|
|
100
|
-
if (n) {
|
|
101
|
-
const r = parseInt(n[1], 16), c = parseInt(n[2], 16), i = parseInt(n[3], 16);
|
|
102
|
-
return `rgba(${r}, ${c}, ${i}, ${e})`;
|
|
103
|
-
}
|
|
104
|
-
const t = s.match(/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/);
|
|
105
|
-
if (t) {
|
|
106
|
-
const r = parseInt(t[1] + t[1], 16), c = parseInt(t[2] + t[2], 16), i = parseInt(t[3] + t[3], 16);
|
|
107
|
-
return `rgba(${r}, ${c}, ${i}, ${e})`;
|
|
108
|
-
}
|
|
109
|
-
const a = Math.round(e * 100);
|
|
110
|
-
return `color-mix(in srgb, ${s} ${a}%, transparent)`;
|
|
111
|
-
}
|
|
112
|
-
function b(o, e = 0.12) {
|
|
113
|
-
if (!o || typeof o != "string") return "#1d78c4";
|
|
114
|
-
const s = o.trim(), n = s.match(/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/);
|
|
115
|
-
if (n) {
|
|
116
|
-
const r = Math.max(0, 1 - e), c = Math.round(parseInt(n[1], 16) * r), i = Math.round(parseInt(n[2], 16) * r), d = Math.round(parseInt(n[3], 16) * r), u = (f) => f.toString(16).padStart(2, "0");
|
|
117
|
-
return `#${u(c)}${u(i)}${u(d)}`;
|
|
118
|
-
}
|
|
119
|
-
const t = s.match(/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/);
|
|
120
|
-
if (t) {
|
|
121
|
-
const r = Math.max(0, 1 - e), c = Math.round(parseInt(t[1] + t[1], 16) * r), i = Math.round(parseInt(t[2] + t[2], 16) * r), d = Math.round(parseInt(t[3] + t[3], 16) * r), u = (f) => f.toString(16).padStart(2, "0");
|
|
122
|
-
return `#${u(c)}${u(i)}${u(d)}`;
|
|
123
|
-
}
|
|
124
|
-
const a = Math.round((1 - e) * 100);
|
|
125
|
-
return `color-mix(in srgb, ${s} ${a}%, #000000)`;
|
|
126
|
-
}
|
|
127
|
-
function M(o) {
|
|
128
|
-
const e = g(o, 0.1), s = g(o, 0.18), n = k(o, 0.25), t = b(o, 0.12), a = b(o, 0.22), r = g(o, 0.08);
|
|
129
|
-
return {
|
|
130
|
-
colors: {
|
|
131
|
-
primary: o,
|
|
132
|
-
focusRing: n
|
|
133
|
-
},
|
|
134
|
-
button: {
|
|
135
|
-
backgroundColor: o,
|
|
136
|
-
hoverBackgroundColor: t,
|
|
137
|
-
activeBackgroundColor: a,
|
|
138
|
-
focusRingColor: n,
|
|
139
|
-
outlineColor: o,
|
|
140
|
-
outlineBorderColor: o,
|
|
141
|
-
outlineHoverBackgroundColor: r,
|
|
142
|
-
ghostColor: o,
|
|
143
|
-
ghostHoverBackgroundColor: r
|
|
144
|
-
},
|
|
145
|
-
select: {
|
|
146
|
-
focusBorderColor: o,
|
|
147
|
-
focusRingColor: n,
|
|
148
|
-
optionSelectedTextColor: o,
|
|
149
|
-
optionCheckColor: o,
|
|
150
|
-
optionSelectedBackgroundColor: e,
|
|
151
|
-
optionSelectedHoverBackgroundColor: s
|
|
152
|
-
},
|
|
153
|
-
input: {
|
|
154
|
-
focusBorderColor: o,
|
|
155
|
-
focusRingColor: n
|
|
156
|
-
},
|
|
157
|
-
checkbox: {
|
|
158
|
-
checkedColor: o,
|
|
159
|
-
focusRingColor: n
|
|
160
|
-
},
|
|
161
|
-
textarea: {
|
|
162
|
-
focusBorderColor: o,
|
|
163
|
-
focusRingColor: n
|
|
164
|
-
},
|
|
165
|
-
radio: {
|
|
166
|
-
color: o,
|
|
167
|
-
checkedColor: o,
|
|
168
|
-
focusRingColor: n
|
|
169
|
-
},
|
|
170
|
-
switch: {
|
|
171
|
-
trackCheckedColor: o,
|
|
172
|
-
focusRingColor: n
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
const A = /* @__PURE__ */ new Set([
|
|
177
|
-
"fontWeight",
|
|
178
|
-
"opacity",
|
|
179
|
-
"zIndex",
|
|
180
|
-
"lineHeight",
|
|
181
|
-
"flex",
|
|
182
|
-
"flexGrow",
|
|
183
|
-
"flexShrink",
|
|
184
|
-
"order"
|
|
185
|
-
]);
|
|
186
|
-
function W(o) {
|
|
187
|
-
return o.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
188
|
-
}
|
|
189
|
-
function z(o, e) {
|
|
190
|
-
return typeof e == "number" && !A.has(o) ? `${e}px` : String(e);
|
|
191
|
-
}
|
|
192
|
-
function p(o) {
|
|
193
|
-
return typeof o == "object" && o !== null && !Array.isArray(o);
|
|
194
|
-
}
|
|
195
|
-
function h(o, ...e) {
|
|
196
|
-
let s = { ...o };
|
|
197
|
-
for (const n of e) {
|
|
198
|
-
if (!n || !p(n))
|
|
199
|
-
continue;
|
|
200
|
-
const t = { ...s };
|
|
201
|
-
for (const a of Object.keys(n)) {
|
|
202
|
-
const r = n[a];
|
|
203
|
-
if (r === void 0)
|
|
204
|
-
continue;
|
|
205
|
-
const c = t[a];
|
|
206
|
-
p(c) && p(r) ? t[a] = h(
|
|
207
|
-
c,
|
|
208
|
-
r
|
|
209
|
-
) : t[a] = r;
|
|
210
|
-
}
|
|
211
|
-
s = t;
|
|
212
|
-
}
|
|
213
|
-
return s;
|
|
214
|
-
}
|
|
215
|
-
function B(o, e) {
|
|
216
|
-
if (!o)
|
|
217
|
-
return {};
|
|
218
|
-
const s = {};
|
|
219
|
-
for (const [n, t] of Object.entries(o))
|
|
220
|
-
if (!(t == null || t === "") && (typeof t == "string" || typeof t == "number")) {
|
|
221
|
-
const a = `--${e}-${W(n)}`;
|
|
222
|
-
s[a] = z(n, t);
|
|
223
|
-
}
|
|
224
|
-
return s;
|
|
225
|
-
}
|
|
226
|
-
let l = JSON.parse(JSON.stringify(S));
|
|
227
|
-
const C = /* @__PURE__ */ new Set();
|
|
228
|
-
function v() {
|
|
229
|
-
return l;
|
|
230
|
-
}
|
|
231
|
-
function w(o) {
|
|
232
|
-
return C.add(o), () => {
|
|
233
|
-
C.delete(o);
|
|
234
|
-
};
|
|
235
|
-
}
|
|
236
|
-
function T(o) {
|
|
237
|
-
var c, i, d;
|
|
238
|
-
const e = ((c = o.theme) == null ? void 0 : c.primaryColor) || ((i = o.colors) == null ? void 0 : i.primary) || l.theme.primaryColor;
|
|
239
|
-
let s = {};
|
|
240
|
-
if (e) {
|
|
241
|
-
const u = b(e, 0.12), f = b(e, 0.22), F = k(e, 0.35), x = g(e, 0.08);
|
|
242
|
-
s = {
|
|
243
|
-
backgroundColor: e,
|
|
244
|
-
hoverBackgroundColor: u,
|
|
245
|
-
activeBackgroundColor: f,
|
|
246
|
-
focusRingColor: F,
|
|
247
|
-
outlineColor: e,
|
|
248
|
-
outlineBorderColor: e,
|
|
249
|
-
outlineHoverBackgroundColor: x,
|
|
250
|
-
ghostColor: e,
|
|
251
|
-
ghostHoverBackgroundColor: x
|
|
252
|
-
};
|
|
253
|
-
}
|
|
254
|
-
const n = h(
|
|
255
|
-
l.theme,
|
|
256
|
-
o.theme || {},
|
|
257
|
-
o.colors ? { colors: o.colors } : {},
|
|
258
|
-
o.typography ? { typography: o.typography } : {},
|
|
259
|
-
o.layout ? { layout: o.layout } : {}
|
|
260
|
-
), t = {
|
|
261
|
-
...((d = o.components) == null ? void 0 : d.button) || {},
|
|
262
|
-
...o.button ? { styles: o.button } : {}
|
|
263
|
-
}, a = t.size ? $(t.size) : l.components.button.size, r = h(
|
|
264
|
-
y,
|
|
265
|
-
l.components.button.styles,
|
|
266
|
-
s,
|
|
267
|
-
t.styles || {}
|
|
268
|
-
);
|
|
269
|
-
if (l = {
|
|
270
|
-
theme: n,
|
|
271
|
-
components: {
|
|
272
|
-
...l.components,
|
|
273
|
-
button: {
|
|
274
|
-
variant: t.variant ?? l.components.button.variant,
|
|
275
|
-
size: a,
|
|
276
|
-
fullWidth: t.fullWidth ?? l.components.button.fullWidth,
|
|
277
|
-
styles: r
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
}, C.forEach((u) => {
|
|
281
|
-
try {
|
|
282
|
-
u(l);
|
|
283
|
-
} catch (f) {
|
|
284
|
-
console.error("Error notifying Webstrail config listener:", f);
|
|
285
|
-
}
|
|
286
|
-
}), typeof window < "u")
|
|
287
|
-
try {
|
|
288
|
-
window.dispatchEvent(
|
|
289
|
-
new CustomEvent("webstrail-config-change", {
|
|
290
|
-
detail: l
|
|
291
|
-
})
|
|
292
|
-
);
|
|
293
|
-
} catch {
|
|
294
|
-
}
|
|
295
|
-
return l;
|
|
296
|
-
}
|
|
297
|
-
function H() {
|
|
298
|
-
l = JSON.parse(JSON.stringify(S)), C.forEach((o) => {
|
|
299
|
-
try {
|
|
300
|
-
o(l);
|
|
301
|
-
} catch (e) {
|
|
302
|
-
console.error("Error notifying Webstrail config listener:", e);
|
|
303
|
-
}
|
|
304
|
-
});
|
|
305
|
-
}
|
|
306
|
-
function E(o) {
|
|
307
|
-
const e = l.components.button, s = (o == null ? void 0 : o.variant) || e.variant || "primary", n = o != null && o.size ? $(o.size) : e.size || "medium", t = (o == null ? void 0 : o.fullWidth) ?? e.fullWidth ?? !1, a = h(
|
|
308
|
-
y,
|
|
309
|
-
e.styles,
|
|
310
|
-
(o == null ? void 0 : o.styles) || {}
|
|
311
|
-
), r = {
|
|
312
|
-
...B(a, "wui-button"),
|
|
313
|
-
...B(a, "wb-button")
|
|
314
|
-
};
|
|
315
|
-
return {
|
|
316
|
-
variant: s,
|
|
317
|
-
size: n,
|
|
318
|
-
fullWidth: t,
|
|
319
|
-
styles: a,
|
|
320
|
-
cssVars: r
|
|
321
|
-
};
|
|
322
|
-
}
|
|
323
|
-
export {
|
|
324
|
-
W as camelToKebab,
|
|
325
|
-
T as configureWebstrail,
|
|
326
|
-
h as deepMerge,
|
|
327
|
-
y as defaultButtonStyles,
|
|
328
|
-
R as defaultColors,
|
|
329
|
-
I as defaultLayout,
|
|
330
|
-
S as defaultResolvedConfig,
|
|
331
|
-
m as defaultTypography,
|
|
332
|
-
M as deriveTokensFromPrimary,
|
|
333
|
-
b as getDarkerShade,
|
|
334
|
-
k as getFocusRingColor,
|
|
335
|
-
g as getSubtleBackgroundColor,
|
|
336
|
-
v as getWebstrailConfig,
|
|
337
|
-
$ as normalizeButtonSize,
|
|
338
|
-
z as normalizeDimension,
|
|
339
|
-
H as resetWebstrailConfig,
|
|
340
|
-
E as resolveEffectiveButtonConfig,
|
|
341
|
-
B as stylesToCssVars,
|
|
342
|
-
w as subscribeWebstrailConfig
|
|
343
|
-
};
|
|
344
|
-
//# sourceMappingURL=core.js.map
|
package/dist/core.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"core.js","sources":["../src/core/types/common.ts","../src/core/theme/defaultTheme.ts","../src/core/theme/deriveTokens.ts","../src/core/utils/styles.ts","../src/core/config/globalConfig.ts"],"sourcesContent":["/**\n * Standard size variants supported across components.\n */\nexport type ComponentSize = 'small' | 'medium' | 'large';\n\n/**\n * Size aliases supported for developer convenience.\n */\nexport type SizeAlias = 'sm' | 'md' | 'lg';\n\n/**\n * Size type for Button (accepts standard full names or aliases).\n */\nexport type ButtonSize = ComponentSize | SizeAlias;\n\n/**\n * Standard semantic color intent variants.\n */\nexport type ComponentVariant = 'primary' | 'secondary' | 'outline' | 'ghost' | 'danger';\n\n/**\n * Variant type alias for Button.\n */\nexport type ButtonVariant = ComponentVariant;\n\n/**\n * Supported HTML button types.\n */\nexport type ButtonType = 'button' | 'submit' | 'reset';\n\n/**\n * Helper to accept string or number for dimension properties (adds 'px' if number).\n */\nexport type DimensionValue = string | number;\n\n/**\n * Normalizes size aliases ('sm' -> 'small', 'md' -> 'medium', 'lg' -> 'large').\n */\nexport function normalizeButtonSize(size?: ButtonSize | string): ComponentSize {\n if (!size) return 'medium';\n switch (size) {\n case 'sm':\n case 'small':\n return 'small';\n case 'lg':\n case 'large':\n return 'large';\n case 'md':\n case 'medium':\n default:\n return 'medium';\n }\n}\n","import type {\n ButtonStyles,\n GlobalColorTokens,\n GlobalLayoutTokens,\n GlobalTypographyTokens,\n} from '../types/tokens';\nimport type { ResolvedWebstrailConfig } from '../types/config';\n\nexport const defaultColors: GlobalColorTokens = {\n primary: '#2491eb',\n secondary: '#406993',\n text: '#1f2937',\n textSecondary: '#6b7280',\n border: '#d1d5db',\n background: '#ffffff',\n error: '#dc2626',\n success: '#16a34a',\n disabled: '#9ca3af',\n disabledBackground: '#f3f4f6',\n disabledText: '#9ca3af',\n focusRing: 'rgba(36, 145, 235, 0.35)',\n};\n\nexport const defaultTypography: GlobalTypographyTokens = {\n fontFamily:\n 'system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif',\n fontSizeSmall: '12px',\n fontSizeMedium: '14px',\n fontSizeLarge: '16px',\n fontWeightNormal: 400,\n fontWeightMedium: 500,\n fontWeightBold: 600,\n};\n\nexport const defaultLayout: GlobalLayoutTokens = {\n borderRadiusSmall: '6px',\n borderRadiusMedium: '8px',\n borderRadiusLarge: '12px',\n};\n\nexport const defaultButtonStyles: ButtonStyles = {\n height: '40px',\n borderRadius: '8px',\n fontSize: '14px',\n fontWeight: 500,\n backgroundColor: '#2491eb',\n textColor: '#ffffff',\n borderColor: 'transparent',\n hoverBackgroundColor: '#1d78c4',\n hoverTextColor: '#ffffff',\n activeBackgroundColor: '#1565a0',\n disabledBackgroundColor: '#f3f4f6',\n disabledTextColor: '#9ca3af',\n disabledBorderColor: '#e5e7eb',\n focusRingColor: 'rgba(36, 145, 235, 0.35)',\n padding: '0 16px',\n transition: 'all 0.15s ease-in-out',\n outlineColor: '#2491eb',\n outlineBorderColor: '#2491eb',\n outlineHoverBackgroundColor: 'rgba(36, 145, 235, 0.08)',\n ghostColor: '#2491eb',\n ghostHoverBackgroundColor: 'rgba(36, 145, 235, 0.08)',\n};\n\nexport const defaultResolvedConfig: ResolvedWebstrailConfig = {\n theme: {\n primaryColor: '#2491eb',\n secondaryColor: '#406993',\n fontFamily: defaultTypography.fontFamily,\n borderRadius: '8px',\n colors: defaultColors,\n typography: defaultTypography,\n layout: defaultLayout,\n },\n components: {\n button: {\n variant: 'primary',\n size: 'medium',\n fullWidth: false,\n styles: defaultButtonStyles,\n },\n },\n};\n","/**\n * Derives a subtle transparent background color (e.g., for selected options, hover chips).\n */\nexport function getSubtleBackgroundColor(color: string, opacity = 0.1): string {\n if (!color || typeof color !== 'string') return 'rgba(36, 145, 235, 0.1)';\n const trimmed = color.trim();\n const hex6 = trimmed.match(/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/);\n if (hex6) {\n const r = parseInt(hex6[1]!, 16);\n const g = parseInt(hex6[2]!, 16);\n const b = parseInt(hex6[3]!, 16);\n return `rgba(${r}, ${g}, ${b}, ${opacity})`;\n }\n const hex3 = trimmed.match(/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/);\n if (hex3) {\n const r = parseInt(hex3[1]! + hex3[1]!, 16);\n const g = parseInt(hex3[2]! + hex3[2]!, 16);\n const b = parseInt(hex3[3]! + hex3[3]!, 16);\n return `rgba(${r}, ${g}, ${b}, ${opacity})`;\n }\n const percentage = Math.round(opacity * 100);\n return `color-mix(in srgb, ${trimmed} ${percentage}%, #ffffff)`;\n}\n\n/**\n * Derives a focus ring color with alpha transparency.\n */\nexport function getFocusRingColor(color: string, opacity = 0.25): string {\n if (!color || typeof color !== 'string') return 'rgba(36, 145, 235, 0.25)';\n const trimmed = color.trim();\n const hex6 = trimmed.match(/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/);\n if (hex6) {\n const r = parseInt(hex6[1]!, 16);\n const g = parseInt(hex6[2]!, 16);\n const b = parseInt(hex6[3]!, 16);\n return `rgba(${r}, ${g}, ${b}, ${opacity})`;\n }\n const hex3 = trimmed.match(/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/);\n if (hex3) {\n const r = parseInt(hex3[1]! + hex3[1]!, 16);\n const g = parseInt(hex3[2]! + hex3[2]!, 16);\n const b = parseInt(hex3[3]! + hex3[3]!, 16);\n return `rgba(${r}, ${g}, ${b}, ${opacity})`;\n }\n const percentage = Math.round(opacity * 100);\n return `color-mix(in srgb, ${trimmed} ${percentage}%, transparent)`;\n}\n\n/**\n * Derives a darker shade of a color (e.g. for button hover and active states).\n */\nexport function getDarkerShade(color: string, amount = 0.12): string {\n if (!color || typeof color !== 'string') return '#1d78c4';\n const trimmed = color.trim();\n const hex6 = trimmed.match(/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/);\n if (hex6) {\n const factor = Math.max(0, 1 - amount);\n const r = Math.round(parseInt(hex6[1]!, 16) * factor);\n const g = Math.round(parseInt(hex6[2]!, 16) * factor);\n const b = Math.round(parseInt(hex6[3]!, 16) * factor);\n const toHex = (n: number) => n.toString(16).padStart(2, '0');\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n }\n const hex3 = trimmed.match(/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/);\n if (hex3) {\n const factor = Math.max(0, 1 - amount);\n const r = Math.round(parseInt(hex3[1]! + hex3[1]!, 16) * factor);\n const g = Math.round(parseInt(hex3[2]! + hex3[2]!, 16) * factor);\n const b = Math.round(parseInt(hex3[3]! + hex3[3]!, 16) * factor);\n const toHex = (n: number) => n.toString(16).padStart(2, '0');\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n }\n const percentage = Math.round((1 - amount) * 100);\n return `color-mix(in srgb, ${trimmed} ${percentage}%, #000000)`;\n}\n\n/**\n * Derives default component styling tokens based on a primary color.\n */\nexport function deriveTokensFromPrimary(primary: string): Record<string, unknown> {\n const selectedBg = getSubtleBackgroundColor(primary, 0.1);\n const selectedHoverBg = getSubtleBackgroundColor(primary, 0.18);\n const ring = getFocusRingColor(primary, 0.25);\n const hoverBg = getDarkerShade(primary, 0.12);\n const activeBg = getDarkerShade(primary, 0.22);\n const outlineTint = getSubtleBackgroundColor(primary, 0.08);\n\n return {\n colors: {\n primary,\n focusRing: ring,\n },\n button: {\n backgroundColor: primary,\n hoverBackgroundColor: hoverBg,\n activeBackgroundColor: activeBg,\n focusRingColor: ring,\n outlineColor: primary,\n outlineBorderColor: primary,\n outlineHoverBackgroundColor: outlineTint,\n ghostColor: primary,\n ghostHoverBackgroundColor: outlineTint,\n },\n select: {\n focusBorderColor: primary,\n focusRingColor: ring,\n optionSelectedTextColor: primary,\n optionCheckColor: primary,\n optionSelectedBackgroundColor: selectedBg,\n optionSelectedHoverBackgroundColor: selectedHoverBg,\n },\n input: {\n focusBorderColor: primary,\n focusRingColor: ring,\n },\n checkbox: {\n checkedColor: primary,\n focusRingColor: ring,\n },\n textarea: {\n focusBorderColor: primary,\n focusRingColor: ring,\n },\n radio: {\n color: primary,\n checkedColor: primary,\n focusRingColor: ring,\n },\n switch: {\n trackCheckedColor: primary,\n focusRingColor: ring,\n },\n };\n}\n","import type { DeepPartial } from '../types/config';\n\nconst UNITLESS_PROPERTIES = new Set([\n 'fontWeight',\n 'opacity',\n 'zIndex',\n 'lineHeight',\n 'flex',\n 'flexGrow',\n 'flexShrink',\n 'order',\n]);\n\n/**\n * Converts camelCase to kebab-case (e.g. borderRadius -> border-radius).\n */\nexport function camelToKebab(str: string): string {\n return str.replace(/([A-Z])/g, '-$1').toLowerCase();\n}\n\n/**\n * Normalizes dimension values (appends 'px' to numbers where appropriate).\n */\nexport function normalizeDimension(propName: string, value: string | number): string {\n if (typeof value === 'number' && !UNITLESS_PROPERTIES.has(propName)) {\n return `${value}px`;\n }\n return String(value);\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/**\n * Immutably deep-merges objects from left to right.\n * Undefined values in overrides are ignored to preserve defaults.\n */\nexport function deepMerge<T extends object>(\n target: T,\n ...sources: Array<DeepPartial<T> | Record<string, unknown> | undefined | null>\n): T {\n let result: Record<string, unknown> = { ...(target as Record<string, unknown>) };\n\n for (const source of sources) {\n if (!source || !isRecord(source)) {\n continue;\n }\n\n const nextResult: Record<string, unknown> = { ...result };\n\n for (const key of Object.keys(source)) {\n const sourceValue = (source as Record<string, unknown>)[key];\n\n if (sourceValue === undefined) {\n continue;\n }\n\n const existingValue = nextResult[key];\n\n if (isRecord(existingValue) && isRecord(sourceValue)) {\n nextResult[key] = deepMerge(\n existingValue as Record<string, unknown>,\n sourceValue as Record<string, unknown>\n );\n } else {\n nextResult[key] = sourceValue;\n }\n }\n\n result = nextResult;\n }\n\n return result as T;\n}\n\n/**\n * Transforms a flat semantic styles object into scoped CSS custom properties.\n * Framework-independent: returns Record<string, string>.\n */\nexport function stylesToCssVars(\n styles: Record<string, unknown> | object | undefined,\n prefix: string\n): Record<string, string> {\n if (!styles) {\n return {};\n }\n\n const vars: Record<string, string> = {};\n\n for (const [key, value] of Object.entries(styles as Record<string, unknown>)) {\n if (value === undefined || value === null || value === '') {\n continue;\n }\n\n if (typeof value === 'string' || typeof value === 'number') {\n const varName = `--${prefix}-${camelToKebab(key)}`;\n vars[varName] = normalizeDimension(key, value);\n }\n }\n\n return vars;\n}\n","import type { ButtonSize, ButtonVariant } from '../types/common';\nimport type {\n ResolvedWebstrailConfig,\n WebstrailButtonConfig,\n WebstrailConfig,\n} from '../types/config';\nimport type { ButtonStyles } from '../types/tokens';\nimport { defaultButtonStyles, defaultResolvedConfig } from '../theme/defaultTheme';\nimport { getFocusRingColor, getDarkerShade, getSubtleBackgroundColor } from '../theme/deriveTokens';\nimport { deepMerge, stylesToCssVars } from '../utils/styles';\nimport { normalizeButtonSize } from '../types/common';\n\nlet currentConfig: ResolvedWebstrailConfig = JSON.parse(JSON.stringify(defaultResolvedConfig));\nconst listeners = new Set<(config: ResolvedWebstrailConfig) => void>();\n\n/**\n * Returns the current resolved global Webstrail configuration.\n */\nexport function getWebstrailConfig(): ResolvedWebstrailConfig {\n return currentConfig;\n}\n\n/**\n * Subscribes to global configuration changes.\n * Returns an unsubscribe callback function.\n */\nexport function subscribeWebstrailConfig(\n listener: (config: ResolvedWebstrailConfig) => void\n): () => void {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n}\n\n/**\n * Configures the global Webstrail library settings (theme, component defaults).\n * Notifies all subscribers and active components.\n *\n * @example\n * ```ts\n * configureWebstrail({\n * theme: {\n * primaryColor: '#2491eb',\n * },\n * components: {\n * button: {\n * variant: 'primary',\n * size: 'md',\n * },\n * },\n * });\n * ```\n */\nexport function configureWebstrail(userConfig: WebstrailConfig): ResolvedWebstrailConfig {\n const primaryColor =\n userConfig.theme?.primaryColor ||\n userConfig.colors?.primary ||\n currentConfig.theme.primaryColor;\n\n let derivedButtonStyles: Partial<ButtonStyles> = {};\n if (primaryColor) {\n const hoverBg = getDarkerShade(primaryColor, 0.12);\n const activeBg = getDarkerShade(primaryColor, 0.22);\n const ring = getFocusRingColor(primaryColor, 0.35);\n const outlineTint = getSubtleBackgroundColor(primaryColor, 0.08);\n\n derivedButtonStyles = {\n backgroundColor: primaryColor,\n hoverBackgroundColor: hoverBg,\n activeBackgroundColor: activeBg,\n focusRingColor: ring,\n outlineColor: primaryColor,\n outlineBorderColor: primaryColor,\n outlineHoverBackgroundColor: outlineTint,\n ghostColor: primaryColor,\n ghostHoverBackgroundColor: outlineTint,\n };\n }\n\n // Merge theme\n const mergedTheme = deepMerge(\n currentConfig.theme,\n userConfig.theme || {},\n userConfig.colors ? { colors: userConfig.colors } : {},\n userConfig.typography ? { typography: userConfig.typography } : {},\n userConfig.layout ? { layout: userConfig.layout } : {}\n );\n\n // Normalize component button config\n const rawButtonConfig: WebstrailButtonConfig = {\n ...(userConfig.components?.button || {}),\n ...(userConfig.button ? { styles: userConfig.button } : {}),\n };\n\n const buttonSize = rawButtonConfig.size\n ? normalizeButtonSize(rawButtonConfig.size)\n : currentConfig.components.button.size;\n\n const mergedButtonStyles = deepMerge(\n defaultButtonStyles,\n currentConfig.components.button.styles,\n derivedButtonStyles,\n rawButtonConfig.styles || {}\n );\n\n currentConfig = {\n theme: mergedTheme,\n components: {\n ...currentConfig.components,\n button: {\n variant: rawButtonConfig.variant ?? currentConfig.components.button.variant,\n size: buttonSize,\n fullWidth: rawButtonConfig.fullWidth ?? currentConfig.components.button.fullWidth,\n styles: mergedButtonStyles,\n },\n },\n };\n\n // Notify registered listeners\n listeners.forEach((listener) => {\n try {\n listener(currentConfig);\n } catch (e) {\n console.error('Error notifying Webstrail config listener:', e);\n }\n });\n\n // Dispatch browser DOM event if window is defined\n if (typeof window !== 'undefined') {\n try {\n window.dispatchEvent(\n new CustomEvent('webstrail-config-change', {\n detail: currentConfig,\n })\n );\n } catch {\n // Ignore if event dispatch fails in restricted environments\n }\n }\n\n return currentConfig;\n}\n\n/**\n * Resets global configuration to library defaults.\n */\nexport function resetWebstrailConfig(): void {\n currentConfig = JSON.parse(JSON.stringify(defaultResolvedConfig));\n listeners.forEach((listener) => {\n try {\n listener(currentConfig);\n } catch (e) {\n console.error('Error notifying Webstrail config listener:', e);\n }\n });\n}\n\n/**\n * Resolves effective Button properties and styles using 3-tier priority:\n * 1. Component-level properties / styles\n * 2. Global configuration\n * 3. Built-in default configuration\n */\nexport function resolveEffectiveButtonConfig(componentOverrides?: {\n variant?: ButtonVariant | string;\n size?: ButtonSize | string;\n fullWidth?: boolean;\n styles?: ButtonStyles;\n}): {\n variant: ButtonVariant;\n size: ButtonSize;\n fullWidth: boolean;\n styles: ButtonStyles;\n cssVars: Record<string, string>;\n} {\n const globalBtn = currentConfig.components.button;\n\n const variant = (componentOverrides?.variant as ButtonVariant) || globalBtn.variant || 'primary';\n const size = componentOverrides?.size\n ? normalizeButtonSize(componentOverrides.size)\n : globalBtn.size || 'medium';\n const fullWidth = componentOverrides?.fullWidth ?? globalBtn.fullWidth ?? false;\n\n const resolvedStyles = deepMerge(\n defaultButtonStyles,\n globalBtn.styles,\n componentOverrides?.styles || {}\n );\n\n const cssVars = {\n ...stylesToCssVars(resolvedStyles, 'wui-button'),\n ...stylesToCssVars(resolvedStyles, 'wb-button'),\n };\n\n return {\n variant,\n size,\n fullWidth,\n styles: resolvedStyles,\n cssVars,\n };\n}\n"],"names":["normalizeButtonSize","size","defaultColors","defaultTypography","defaultLayout","defaultButtonStyles","defaultResolvedConfig","getSubtleBackgroundColor","color","opacity","trimmed","hex6","g","b","hex3","percentage","getFocusRingColor","getDarkerShade","amount","factor","r","toHex","n","deriveTokensFromPrimary","primary","selectedBg","selectedHoverBg","ring","hoverBg","activeBg","outlineTint","UNITLESS_PROPERTIES","camelToKebab","str","normalizeDimension","propName","value","isRecord","deepMerge","target","sources","result","source","nextResult","key","sourceValue","existingValue","stylesToCssVars","styles","prefix","vars","varName","currentConfig","listeners","getWebstrailConfig","subscribeWebstrailConfig","listener","configureWebstrail","userConfig","_a","_b","_c","primaryColor","derivedButtonStyles","mergedTheme","rawButtonConfig","buttonSize","mergedButtonStyles","e","resetWebstrailConfig","resolveEffectiveButtonConfig","componentOverrides","globalBtn","variant","fullWidth","resolvedStyles","cssVars"],"mappings":"AAsCO,SAASA,EAAoBC,GAA2C;AAC7E,MAAI,CAACA,EAAM,QAAO;AAClB,UAAQA,GAAA;AAAA,IACN,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AAAA,IAC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;AACpB,QAAI;AACF,aAAO;AAAA,QACL,IAAI,YAAY,2BAA2B;AAAA,UACzC,QAAQhB;AAAA,QAAA,CACT;AAAA,MAAA;AAAA,IAEL,QAAQ;AAAA,IAER;AAGF,SAAOA;AACT;AAKO,SAASiB,IAA6B;AAC3C,EAAAjB,IAAgB,KAAK,MAAM,KAAK,UAAU9C,CAAqB,CAAC,GAChE+C,EAAU,QAAQ,CAACG,MAAa;AAC9B,QAAI;AACF,MAAAA,EAASJ,CAAa;AAAA,IACxB,SAAS,GAAG;AACV,cAAQ,MAAM,8CAA8C,CAAC;AAAA,IAC/D;AAAA,EACF,CAAC;AACH;AAQO,SAASkB,EAA6BC,GAW3C;AACA,QAAMC,IAAYpB,EAAc,WAAW,QAErCqB,KAAWF,KAAA,gBAAAA,EAAoB,YAA6BC,EAAU,WAAW,WACjFvE,IAAOsE,KAAA,QAAAA,EAAoB,OAC7BvE,EAAoBuE,EAAmB,IAAI,IAC3CC,EAAU,QAAQ,UAChBE,KAAYH,KAAA,gBAAAA,EAAoB,cAAaC,EAAU,aAAa,IAEpEG,IAAiBrC;AAAA,IACrBjC;AAAA,IACAmE,EAAU;AAAA,KACVD,KAAA,gBAAAA,EAAoB,WAAU,CAAA;AAAA,EAAC,GAG3BK,IAAU;AAAA,IACd,GAAG7B,EAAgB4B,GAAgB,YAAY;AAAA,IAC/C,GAAG5B,EAAgB4B,GAAgB,WAAW;AAAA,EAAA;AAGhD,SAAO;AAAA,IACL,SAAAF;AAAA,IACA,MAAAxE;AAAA,IACA,WAAAyE;AAAA,IACA,QAAQC;AAAA,IACR,SAAAC;AAAA,EAAA;AAEJ;"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import { BaseComponentProps, ComponentSize, ComponentVariant } from '../../../types/common';
|
|
3
|
-
import { ButtonStyles } from '../../../core/types/tokens';
|
|
4
|
-
import { ButtonSize, ButtonVariant } from '../../../core/types/common';
|
|
5
|
-
import { WbClickEventDetail } from '../../../web-components/button/button.types';
|
|
6
|
-
export interface ButtonProps extends BaseComponentProps, Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'style' | 'className'> {
|
|
7
|
-
/**
|
|
8
|
-
* Visual variant style.
|
|
9
|
-
* @default 'primary'
|
|
10
|
-
*/
|
|
11
|
-
variant?: ComponentVariant | ButtonVariant;
|
|
12
|
-
/**
|
|
13
|
-
* Size of the button. Accepts standard names ('small' | 'medium' | 'large')
|
|
14
|
-
* or shorthand aliases ('sm' | 'md' | 'lg').
|
|
15
|
-
* @default 'medium'
|
|
16
|
-
*/
|
|
17
|
-
size?: ComponentSize | ButtonSize;
|
|
18
|
-
/**
|
|
19
|
-
* Optional label text or node (children can also be used).
|
|
20
|
-
*/
|
|
21
|
-
label?: ReactNode;
|
|
22
|
-
/**
|
|
23
|
-
* Loading state. Replaces startIcon with an animated spinner and disables clicking.
|
|
24
|
-
* @default false
|
|
25
|
-
*/
|
|
26
|
-
loading?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Text to display alongside the spinner when loading (optional).
|
|
29
|
-
*/
|
|
30
|
-
loadingText?: ReactNode;
|
|
31
|
-
/**
|
|
32
|
-
* Icon displayed before children or label.
|
|
33
|
-
*/
|
|
34
|
-
startIcon?: ReactNode;
|
|
35
|
-
/**
|
|
36
|
-
* Icon displayed after children or label.
|
|
37
|
-
*/
|
|
38
|
-
endIcon?: ReactNode;
|
|
39
|
-
/**
|
|
40
|
-
* Whether button expands to 100% of parent width.
|
|
41
|
-
* @default false
|
|
42
|
-
*/
|
|
43
|
-
fullWidth?: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* Semantic styles override specific to this Button instance.
|
|
46
|
-
*/
|
|
47
|
-
styles?: ButtonStyles;
|
|
48
|
-
/**
|
|
49
|
-
* Optional listener for the custom 'wb-click' Web Component event.
|
|
50
|
-
*/
|
|
51
|
-
onWbClick?: (event: CustomEvent<WbClickEventDetail>) => void;
|
|
52
|
-
}
|
package/dist/react/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export * from './components/Button';
|
|
2
|
-
export { UIProvider } from '../providers';
|
|
3
|
-
export type { UIProviderProps } from '../providers';
|
|
4
|
-
export { UIContext } from '../context';
|
|
5
|
-
export { useUI, useComponentStyles } from '../hooks';
|
|
6
|
-
export type { UseComponentStylesResult } from '../hooks';
|
package/dist/react.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./UIProvider-C3ae0nQV.cjs");exports.Button=e.Button;exports.UIContext=e.UIContext;exports.UIProvider=e.UIProvider;exports.useComponentStyles=e.useComponentStyles;exports.useUI=e.useUI;
|
|
2
|
-
//# sourceMappingURL=react.cjs.map
|
package/dist/react.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/react.js
DELETED
package/dist/react.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { ButtonSize, ButtonType, ButtonVariant, ComponentSize } from '../../core/types/common';
|
|
2
|
-
import { ButtonStyles } from '../../core/types/tokens';
|
|
3
|
-
export declare class WbButton extends HTMLElement {
|
|
4
|
-
static readonly formAssociated = true;
|
|
5
|
-
private _internals?;
|
|
6
|
-
private _buttonElement;
|
|
7
|
-
private _spinnerElement;
|
|
8
|
-
private _startIconWrapper;
|
|
9
|
-
private _startIconSlot;
|
|
10
|
-
private _endIconWrapper;
|
|
11
|
-
private _endIconSlot;
|
|
12
|
-
private _labelWrapper;
|
|
13
|
-
private _defaultSlot;
|
|
14
|
-
private _unsubscribeConfig?;
|
|
15
|
-
private _stylesObj?;
|
|
16
|
-
static get observedAttributes(): string[];
|
|
17
|
-
constructor();
|
|
18
|
-
connectedCallback(): void;
|
|
19
|
-
disconnectedCallback(): void;
|
|
20
|
-
attributeChangedCallback(_name: string, oldValue: string | null, newValue: string | null): void;
|
|
21
|
-
get variant(): ButtonVariant;
|
|
22
|
-
set variant(value: ButtonVariant);
|
|
23
|
-
get size(): ComponentSize;
|
|
24
|
-
set size(value: ButtonSize);
|
|
25
|
-
get disabled(): boolean;
|
|
26
|
-
set disabled(value: boolean);
|
|
27
|
-
get loading(): boolean;
|
|
28
|
-
set loading(value: boolean);
|
|
29
|
-
get loadingText(): string | null;
|
|
30
|
-
set loadingText(value: string | null);
|
|
31
|
-
get label(): string | null;
|
|
32
|
-
set label(value: string | null);
|
|
33
|
-
get fullWidth(): boolean;
|
|
34
|
-
set fullWidth(value: boolean);
|
|
35
|
-
get type(): ButtonType;
|
|
36
|
-
set type(value: ButtonType);
|
|
37
|
-
get styles(): ButtonStyles | undefined;
|
|
38
|
-
set styles(value: ButtonStyles | string | undefined);
|
|
39
|
-
/**
|
|
40
|
-
* Reference to inner button for focus/blur integration.
|
|
41
|
-
*/
|
|
42
|
-
get button(): HTMLButtonElement;
|
|
43
|
-
focus(options?: FocusOptions): void;
|
|
44
|
-
blur(): void;
|
|
45
|
-
private _handleSlotChange;
|
|
46
|
-
private _handleInternalClick;
|
|
47
|
-
private _submitAssociatedForm;
|
|
48
|
-
private _resetAssociatedForm;
|
|
49
|
-
private _render;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Registers the 'wb-button' custom element if not already registered.
|
|
53
|
-
*/
|
|
54
|
-
export declare function registerWbButton(): void;
|
|
55
|
-
declare global {
|
|
56
|
-
interface HTMLElementTagNameMap {
|
|
57
|
-
'wb-button': WbButton;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const buttonStyles = "\n:host {\n display: inline-block;\n vertical-align: middle;\n box-sizing: border-box;\n font-family: var(\n --wb-button-font-family,\n var(\n --wui-button-font-family,\n var(\n --wui-font-family,\n system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif\n )\n )\n );\n outline: none;\n}\n\n:host([full-width]),\n:host([fullwidth]) {\n display: block;\n width: 100%;\n}\n\n:host([hidden]) {\n display: none !important;\n}\n\n*, *::before, *::after {\n box-sizing: border-box;\n}\n\n.button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n position: relative;\n font-family: inherit;\n font-size: var(--wb-button-font-size, var(--wui-button-font-size, 14px));\n font-weight: var(--wb-button-font-weight, var(--wui-button-font-weight, 500));\n line-height: 1;\n text-decoration: none;\n white-space: nowrap;\n vertical-align: middle;\n cursor: pointer;\n user-select: none;\n border: 1px solid transparent;\n border-radius: var(--wb-button-radius, var(--wb-button-border-radius, var(--wui-button-border-radius, 8px)));\n padding: var(--wb-button-padding, var(--wui-button-padding, 0 16px));\n height: var(--wb-button-height, var(--wui-button-height, 40px));\n transition: var(--wb-button-transition, var(--wui-button-transition, all 0.15s ease-in-out));\n outline: none;\n width: 100%;\n}\n\n:host(:not([full-width]):not([fullwidth])) .button {\n width: auto;\n}\n\n.button:focus-visible {\n box-shadow: var(--wb-button-focus-shadow, var(--wui-button-focus-shadow, 0 0 0 3px var(--wb-button-focus-ring, var(--wui-button-focus-ring-color, rgba(36, 145, 235, 0.35)))));\n}\n\n/* Sizes */\n.sizeSmall {\n height: var(--wb-button-height-sm, 32px);\n padding: var(--wb-button-padding-sm, 0 12px);\n font-size: var(--wb-button-font-size-sm, 12px);\n gap: 6px;\n}\n\n.sizeMedium {\n height: var(--wb-button-height, var(--wui-button-height, 40px));\n padding: var(--wb-button-padding, var(--wui-button-padding, 0 16px));\n font-size: var(--wb-button-font-size, var(--wui-button-font-size, 14px));\n gap: 8px;\n}\n\n.sizeLarge {\n height: var(--wb-button-height-lg, 48px);\n padding: var(--wb-button-padding-lg, 0 24px);\n font-size: var(--wb-button-font-size-lg, 16px);\n gap: 10px;\n}\n\n/* Variants */\n.variantPrimary {\n background-color: var(--wb-button-primary, var(--wb-button-background-color, var(--wui-button-background-color, #2491eb)));\n color: var(--wb-button-text-color, var(--wui-button-text-color, #ffffff));\n border-color: var(--wb-button-border-color, var(--wui-button-border-color, transparent));\n}\n\n.variantPrimary:hover:not(:disabled):not(.loading) {\n background-color: var(\n --wb-button-hover-background-color,\n var(\n --wui-button-hover-background-color,\n color-mix(in srgb, var(--wb-button-primary, var(--wb-button-background-color, var(--wui-button-background-color, #2491eb))) 88%, #000000)\n )\n );\n color: var(--wb-button-hover-text-color, var(--wui-button-hover-text-color, #ffffff));\n}\n\n.variantPrimary:active:not(:disabled):not(.loading) {\n background-color: var(\n --wb-button-active-background-color,\n var(\n --wui-button-active-background-color,\n color-mix(in srgb, var(--wb-button-primary, var(--wb-button-background-color, var(--wui-button-background-color, #2491eb))) 78%, #000000)\n )\n );\n}\n\n.variantSecondary {\n background-color: var(--wb-button-secondary, var(--wb-button-secondary-background-color, #406993));\n color: #ffffff;\n border-color: transparent;\n}\n\n.variantSecondary:hover:not(:disabled):not(.loading) {\n background-color: var(--wb-button-secondary-hover-background-color, #345679);\n}\n\n.variantSecondary:active:not(:disabled):not(.loading) {\n background-color: var(--wb-button-secondary-active-background-color, #284460);\n}\n\n.variantOutline {\n background-color: transparent;\n color: var(\n --wb-button-outline-color,\n var(\n --wui-button-outline-color,\n var(--wb-button-primary, var(--wb-button-background-color, var(--wui-button-background-color, var(--wui-color-primary, #2491eb))))\n )\n );\n border: 1.5px solid\n var(\n --wb-button-outline-border-color,\n var(\n --wui-button-outline-border-color,\n var(--wb-button-primary, var(--wb-button-background-color, var(--wui-button-background-color, var(--wui-color-primary, #2491eb))))\n )\n );\n}\n\n.variantOutline:hover:not(:disabled):not(.loading) {\n background-color: var(\n --wb-button-outline-hover-background-color,\n var(\n --wui-button-outline-hover-background-color,\n color-mix(in srgb, var(--wb-button-primary, var(--wb-button-background-color, var(--wui-button-background-color, #2491eb))) 10%, transparent)\n )\n );\n}\n\n.variantOutline:active:not(:disabled):not(.loading) {\n background-color: color-mix(\n in srgb,\n var(--wb-button-primary, var(--wb-button-background-color, var(--wui-button-background-color, #2491eb))) 18%,\n transparent\n );\n}\n\n.variantGhost {\n background-color: transparent;\n color: var(\n --wb-button-ghost-color,\n var(\n --wui-button-ghost-color,\n var(--wb-button-primary, var(--wb-button-background-color, var(--wui-button-background-color, var(--wui-color-primary, #2491eb))))\n )\n );\n border-color: transparent;\n}\n\n.variantGhost:hover:not(:disabled):not(.loading) {\n background-color: var(\n --wb-button-ghost-hover-background-color,\n var(\n --wui-button-ghost-hover-background-color,\n color-mix(in srgb, var(--wb-button-primary, var(--wb-button-background-color, var(--wui-button-background-color, #2491eb))) 10%, transparent)\n )\n );\n}\n\n.variantGhost:active:not(:disabled):not(.loading) {\n background-color: color-mix(\n in srgb,\n var(--wb-button-primary, var(--wb-button-background-color, var(--wui-button-background-color, #2491eb))) 18%,\n transparent\n );\n}\n\n.variantDanger {\n background-color: var(--wb-button-danger, #dc2626);\n color: #ffffff;\n border-color: transparent;\n}\n\n.variantDanger:hover:not(:disabled):not(.loading) {\n background-color: var(--wb-button-danger-hover, #b91c1c);\n}\n\n.variantDanger:active:not(:disabled):not(.loading) {\n background-color: var(--wb-button-danger-active, #991b1b);\n}\n\n/* Full Width */\n.fullWidth {\n width: 100%;\n}\n\n/* Disabled */\n.disabled,\n.button:disabled {\n cursor: not-allowed;\n opacity: 0.65;\n background-color: var(--wb-button-disabled-background-color, var(--wui-button-disabled-background-color, #f3f4f6));\n color: var(--wb-button-disabled-text-color, var(--wui-button-disabled-text-color, #9ca3af));\n border-color: var(--wb-button-disabled-border-color, var(--wui-button-disabled-border-color, #e5e7eb));\n box-shadow: none;\n}\n\n/* Loading */\n.loading {\n cursor: wait;\n pointer-events: none;\n}\n\n/* Spinner */\n.spinner {\n display: inline-block;\n width: 1em;\n height: 1em;\n border: 2px solid currentColor;\n border-right-color: transparent;\n border-radius: 50%;\n animation: spin 0.75s linear infinite;\n}\n\n.icon {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n font-size: 1.1em;\n}\n\n.label {\n display: inline-flex;\n align-items: center;\n}\n\n.hidden {\n display: none !important;\n}\n\n@keyframes spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n";
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ButtonSize, ButtonType, ButtonVariant, ComponentSize } from '../../core/types/common';
|
|
2
|
-
import { ButtonStyles } from '../../core/types/tokens';
|
|
3
|
-
export interface WbClickEventDetail {
|
|
4
|
-
originalEvent: MouseEvent;
|
|
5
|
-
target: HTMLElement;
|
|
6
|
-
variant: ButtonVariant;
|
|
7
|
-
size: ComponentSize;
|
|
8
|
-
}
|
|
9
|
-
export interface WbButtonProps {
|
|
10
|
-
variant?: ButtonVariant;
|
|
11
|
-
size?: ButtonSize;
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
loading?: boolean;
|
|
14
|
-
loadingText?: string;
|
|
15
|
-
label?: string;
|
|
16
|
-
fullWidth?: boolean;
|
|
17
|
-
type?: ButtonType;
|
|
18
|
-
styles?: ButtonStyles | string;
|
|
19
|
-
startIcon?: HTMLElement | string;
|
|
20
|
-
endIcon?: HTMLElement | string;
|
|
21
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './button';
|