@antadesign/anta 0.3.2 → 0.3.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/anta_helpers.d.ts +101 -0
- package/dist/anta_helpers.js +77 -0
- package/dist/calendar-core.d.ts +126 -0
- package/dist/calendar-core.js +289 -0
- package/dist/components/Button.d.ts +9 -1
- package/dist/components/Button.js +5 -2
- package/dist/components/Calendar.d.ts +80 -0
- package/dist/components/Calendar.js +220 -0
- package/dist/components/Checkbox.d.ts +16 -11
- package/dist/components/Checkbox.js +13 -7
- package/dist/components/Expander.d.ts +7 -1
- package/dist/components/Expander.js +4 -2
- package/dist/components/Input.d.ts +13 -5
- package/dist/components/Input.js +14 -6
- package/dist/components/InputDate.d.ts +87 -0
- package/dist/components/InputDate.js +278 -0
- package/dist/components/InputDate.module.css +1 -0
- package/dist/components/Menu.d.ts +5 -1
- package/dist/components/Menu.js +6 -2
- package/dist/components/MenuItem.d.ts +48 -7
- package/dist/components/MenuItem.js +71 -7
- package/dist/components/MenuSeparator.d.ts +13 -2
- package/dist/components/MenuSeparator.js +12 -2
- package/dist/components/Progress.d.ts +4 -1
- package/dist/components/Progress.js +4 -3
- package/dist/components/RadioGroup.d.ts +12 -10
- package/dist/components/RadioGroup.js +5 -5
- package/dist/components/Select.d.ts +255 -0
- package/dist/components/Select.js +290 -0
- package/dist/components/Select.module.css +1 -0
- package/dist/components/Tab.d.ts +3 -0
- package/dist/components/Tab.js +2 -1
- package/dist/components/TabPanel.js +2 -1
- package/dist/components/Tabs.d.ts +18 -1
- package/dist/components/Tabs.js +8 -6
- package/dist/components/Tag.d.ts +10 -9
- package/dist/components/Tag.js +2 -2
- package/dist/components/Text.d.ts +6 -5
- package/dist/components/Title.d.ts +4 -2
- package/dist/components/Tooltip.d.ts +4 -1
- package/dist/components/Tooltip.js +5 -0
- package/dist/elements/a-button.css +1 -1
- package/dist/elements/a-calendar.css +1 -0
- package/dist/elements/a-calendar.d.ts +76 -0
- package/dist/elements/a-calendar.js +190 -0
- package/dist/elements/a-checkbox.css +1 -1
- package/dist/elements/a-checkbox.d.ts +1 -2
- package/dist/elements/a-checkbox.js +5 -5
- package/dist/elements/a-expander.css +1 -1
- package/dist/elements/a-expander.d.ts +16 -5
- package/dist/elements/a-expander.js +59 -8
- package/dist/elements/a-icon.shapes.css +1 -1
- package/dist/elements/a-icon.shapes.d.ts +6 -1
- package/dist/elements/a-icon.shapes.js +9 -0
- package/dist/elements/a-input.css +1 -1
- package/dist/elements/a-input.d.ts +6 -0
- package/dist/elements/a-input.js +27 -8
- package/dist/elements/a-menu-group.css +1 -1
- package/dist/elements/a-menu-item.css +1 -1
- package/dist/elements/a-menu-item.d.ts +14 -4
- package/dist/elements/a-menu-item.js +17 -0
- package/dist/elements/a-menu-separator.css +1 -1
- package/dist/elements/a-menu.css +1 -1
- package/dist/elements/a-menu.d.ts +51 -8
- package/dist/elements/a-menu.js +285 -42
- package/dist/elements/a-progress.css +1 -1
- package/dist/elements/a-radio-group.d.ts +1 -3
- package/dist/elements/a-radio-group.js +13 -13
- package/dist/elements/a-radio.css +1 -1
- package/dist/elements/a-radio.d.ts +3 -11
- package/dist/elements/a-radio.js +3 -34
- package/dist/elements/a-tab.css +1 -1
- package/dist/elements/a-tab.d.ts +3 -11
- package/dist/elements/a-tab.js +3 -34
- package/dist/elements/a-tabs.css +1 -1
- package/dist/elements/a-tabs.d.ts +1 -4
- package/dist/elements/a-tabs.js +14 -14
- package/dist/elements/a-tag.css +1 -1
- package/dist/elements/a-text.d.ts +14 -13
- package/dist/elements/a-text.js +53 -23
- package/dist/elements/a-tooltip.css +1 -1
- package/dist/elements/a-tooltip.d.ts +1 -11
- package/dist/elements/a-tooltip.js +20 -19
- package/dist/elements/index.d.ts +1 -0
- package/dist/elements/index.js +3 -0
- package/dist/general_types.d.ts +127 -31
- package/dist/index.d.ts +9 -1
- package/dist/index.js +37 -1
- package/dist/jsx-runtime.d.ts +16 -7
- package/dist/jsx-runtime.js +6 -0
- package/dist/reset.css +1 -1
- package/package.json +4 -2
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "@antadesign/anta/jsx-runtime";
|
|
2
|
+
import { useState, useId } from "../jsx-runtime";
|
|
3
|
+
import { Input } from "./Input";
|
|
4
|
+
import { Icon } from "./Icon";
|
|
5
|
+
import { Menu } from "./Menu";
|
|
6
|
+
import { MenuItem } from "./MenuItem";
|
|
7
|
+
import { MenuGroup } from "./MenuGroup";
|
|
8
|
+
import { MenuSeparator } from "./MenuSeparator";
|
|
9
|
+
import styles from "./Select.module.css";
|
|
10
|
+
const normalize = (o) => typeof o === "string" ? { value: o, label: o } : o;
|
|
11
|
+
const Select = (props) => {
|
|
12
|
+
const {
|
|
13
|
+
options,
|
|
14
|
+
selection,
|
|
15
|
+
indicator,
|
|
16
|
+
value,
|
|
17
|
+
defaultValue,
|
|
18
|
+
onValueChange,
|
|
19
|
+
placeholder,
|
|
20
|
+
icon,
|
|
21
|
+
label,
|
|
22
|
+
hint,
|
|
23
|
+
size,
|
|
24
|
+
status,
|
|
25
|
+
statusIcon,
|
|
26
|
+
round,
|
|
27
|
+
disabled,
|
|
28
|
+
toneSelected,
|
|
29
|
+
filter,
|
|
30
|
+
selectAll,
|
|
31
|
+
selectAllLabel = "Select all",
|
|
32
|
+
renderOption,
|
|
33
|
+
renderIndicator,
|
|
34
|
+
renderTrigger,
|
|
35
|
+
renderEmpty,
|
|
36
|
+
className,
|
|
37
|
+
style,
|
|
38
|
+
...rest
|
|
39
|
+
} = props;
|
|
40
|
+
const multiple = selection === "multiple";
|
|
41
|
+
const statusColor = status && status !== "neutral" ? `var(--text-2-${status})` : void 0;
|
|
42
|
+
const mark = multiple ? "checkbox" : indicator ?? "none";
|
|
43
|
+
const menuItemIndicator = mark === "none" ? void 0 : mark;
|
|
44
|
+
const emit = onValueChange;
|
|
45
|
+
const controlled = value !== void 0;
|
|
46
|
+
const [internal, setInternal] = useState(defaultValue);
|
|
47
|
+
const currentRaw = controlled ? value : internal;
|
|
48
|
+
const [open, setOpen] = useState(false);
|
|
49
|
+
const [query, setQuery] = useState("");
|
|
50
|
+
const uid = useId();
|
|
51
|
+
const isSubmenu = (it) => typeof it === "object" && Array.isArray(it.submenu);
|
|
52
|
+
const isGroup = (it) => typeof it === "object" && Array.isArray(it.options);
|
|
53
|
+
const collectLeaves = (items, group, disabled2, out) => {
|
|
54
|
+
for (const raw of items) {
|
|
55
|
+
if (typeof raw !== "string" && isSubmenu(raw)) collectLeaves(raw.submenu, raw.label, disabled2 || !!raw.disabled, out);
|
|
56
|
+
else if (typeof raw !== "string" && isGroup(raw)) collectLeaves(raw.options, raw.label, disabled2 || !!raw.disabled, out);
|
|
57
|
+
else {
|
|
58
|
+
const o = normalize(raw);
|
|
59
|
+
out.push({ opt: o, disabled: disabled2 || !!o.disabled, group });
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
const allLeaves = [];
|
|
64
|
+
collectLeaves(options, void 0, false, allLeaves);
|
|
65
|
+
const byValue = new Map(allLeaves.map((l) => [l.opt.value, l.opt]));
|
|
66
|
+
const filtering = filter !== void 0 && filter !== false;
|
|
67
|
+
const q = query.trim();
|
|
68
|
+
const escapeRe = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
69
|
+
const queryRe = filtering && typeof filter !== "function" && q ? new RegExp(q.split(/\s+/).map(escapeRe).join("\\s+"), "i") : null;
|
|
70
|
+
const matches = (o) => typeof filter === "function" ? filter(o, q) : !queryRe || [o.value, o.label ?? "", o.hint ?? ""].some((s) => queryRe.test(s));
|
|
71
|
+
const prune = typeof filter === "function" || filtering && !!q;
|
|
72
|
+
const visibleLeaves = prune ? allLeaves.filter((l) => matches(l.opt)) : allLeaves;
|
|
73
|
+
const flattening = filtering && !!q;
|
|
74
|
+
const highlight = (text) => {
|
|
75
|
+
if (!queryRe) return text;
|
|
76
|
+
const re = new RegExp(queryRe.source, "gi");
|
|
77
|
+
const out = [];
|
|
78
|
+
let last = 0;
|
|
79
|
+
let m;
|
|
80
|
+
while ((m = re.exec(text)) !== null) {
|
|
81
|
+
if (m.index > last) out.push(text.slice(last, m.index));
|
|
82
|
+
out.push(/* @__PURE__ */ jsx("b", { children: m[0] }, out.length));
|
|
83
|
+
last = m.index + m[0].length;
|
|
84
|
+
if (m[0].length === 0) re.lastIndex++;
|
|
85
|
+
}
|
|
86
|
+
if (out.length === 0) return text;
|
|
87
|
+
if (last < text.length) out.push(text.slice(last));
|
|
88
|
+
return out;
|
|
89
|
+
};
|
|
90
|
+
const selectedValues = Array.isArray(currentRaw) ? currentRaw : currentRaw != null ? [currentRaw] : [];
|
|
91
|
+
const isSelected = (v) => selectedValues.includes(v);
|
|
92
|
+
const selectedOptions = selectedValues.map((v) => byValue.get(v)).filter(Boolean);
|
|
93
|
+
let display = "";
|
|
94
|
+
if (multiple) {
|
|
95
|
+
if (selectedOptions.length === 1) display = selectedOptions[0].label ?? selectedOptions[0].value;
|
|
96
|
+
else if (selectedOptions.length > 1) display = `${selectedOptions.length} selected`;
|
|
97
|
+
} else if (currentRaw != null) {
|
|
98
|
+
const o = byValue.get(currentRaw);
|
|
99
|
+
display = o ? o.label ?? o.value : "";
|
|
100
|
+
}
|
|
101
|
+
const choose = (o) => {
|
|
102
|
+
if (multiple) {
|
|
103
|
+
const has = selectedValues.includes(o.value);
|
|
104
|
+
const next = has ? selectedValues.filter((v) => v !== o.value) : [...selectedValues, o.value];
|
|
105
|
+
if (!controlled) setInternal(next);
|
|
106
|
+
emit?.(next, { value: o.value, option: o, selected: !has });
|
|
107
|
+
} else {
|
|
108
|
+
if (!controlled) setInternal(o.value);
|
|
109
|
+
emit?.(o.value, { value: o.value, option: o });
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
const enabledValues = multiple ? visibleLeaves.filter((l) => !l.disabled).map((l) => l.opt.value) : [];
|
|
113
|
+
const enabledSelected = enabledValues.filter((v) => selectedValues.includes(v));
|
|
114
|
+
const allSelected = enabledValues.length > 0 && enabledSelected.length === enabledValues.length;
|
|
115
|
+
const someSelected = enabledSelected.length > 0 && !allSelected;
|
|
116
|
+
const toggleAll = () => {
|
|
117
|
+
const keep = selectedValues.filter((v) => !enabledValues.includes(v));
|
|
118
|
+
const next = allSelected ? keep : [...keep, ...enabledValues];
|
|
119
|
+
if (!controlled) setInternal(next);
|
|
120
|
+
emit?.(next, { all: true, selected: !allSelected });
|
|
121
|
+
};
|
|
122
|
+
const renderOptionRow = (o, disabled2) => {
|
|
123
|
+
const optState = { value: o.value, selected: isSelected(o.value), disabled: disabled2 };
|
|
124
|
+
const custom = renderOption?.(o, optState);
|
|
125
|
+
const customMark = renderIndicator?.(optState);
|
|
126
|
+
const ariaSelectable = !multiple && mark === "none" ? { role: "menuitemradio", "aria-checked": isSelected(o.value) ? "true" : "false" } : void 0;
|
|
127
|
+
return /* @__PURE__ */ jsx(
|
|
128
|
+
MenuItem,
|
|
129
|
+
{
|
|
130
|
+
id: `${uid}-opt-${o.value}`,
|
|
131
|
+
selectionIndicator: menuItemIndicator,
|
|
132
|
+
...ariaSelectable,
|
|
133
|
+
indicator: customMark ?? void 0,
|
|
134
|
+
label: custom ? void 0 : queryRe ? highlight(o.label ?? o.value) : o.label ?? o.value,
|
|
135
|
+
hint: custom ? void 0 : queryRe && o.hint ? highlight(o.hint) : o.hint,
|
|
136
|
+
icon: custom ? void 0 : o.icon,
|
|
137
|
+
tone: o.tone,
|
|
138
|
+
toneSelected,
|
|
139
|
+
selected: isSelected(o.value),
|
|
140
|
+
disabled: disabled2 || void 0,
|
|
141
|
+
"data-menu-open": multiple ? "" : void 0,
|
|
142
|
+
onSelect: () => choose(o),
|
|
143
|
+
children: custom
|
|
144
|
+
},
|
|
145
|
+
o.value
|
|
146
|
+
);
|
|
147
|
+
};
|
|
148
|
+
const renderTree = (items, disabled2) => {
|
|
149
|
+
const out = [];
|
|
150
|
+
items.forEach((raw, i) => {
|
|
151
|
+
if (typeof raw !== "string" && isSubmenu(raw)) {
|
|
152
|
+
const dis = disabled2 || !!raw.disabled;
|
|
153
|
+
const inner = renderTree(raw.submenu, dis);
|
|
154
|
+
if (inner.length)
|
|
155
|
+
out.push(
|
|
156
|
+
/* @__PURE__ */ jsx(
|
|
157
|
+
MenuItem,
|
|
158
|
+
{
|
|
159
|
+
submenu: true,
|
|
160
|
+
label: raw.label,
|
|
161
|
+
icon: raw.icon,
|
|
162
|
+
disabled: dis || void 0,
|
|
163
|
+
"data-menu-open": multiple ? "" : void 0,
|
|
164
|
+
children: /* @__PURE__ */ jsx(Menu, { children: inner })
|
|
165
|
+
},
|
|
166
|
+
`sub-${i}-${raw.label}`
|
|
167
|
+
)
|
|
168
|
+
);
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
if (typeof raw !== "string" && isGroup(raw)) {
|
|
172
|
+
const dis = disabled2 || !!raw.disabled;
|
|
173
|
+
const inner = renderTree(raw.options, dis);
|
|
174
|
+
if (inner.length) out.push(/* @__PURE__ */ jsx(MenuGroup, { label: raw.label, children: inner }, `grp-${i}-${raw.label}`));
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
const o = normalize(raw);
|
|
178
|
+
if (typeof filter === "function" && !matches(o)) return;
|
|
179
|
+
out.push(renderOptionRow(o, disabled2 || !!o.disabled));
|
|
180
|
+
});
|
|
181
|
+
return out;
|
|
182
|
+
};
|
|
183
|
+
const renderFlat = () => {
|
|
184
|
+
const shown = allLeaves.filter((l) => matches(l.opt));
|
|
185
|
+
const out = [];
|
|
186
|
+
for (let i = 0; i < shown.length; ) {
|
|
187
|
+
const label2 = shown[i].group;
|
|
188
|
+
if (label2 === void 0) {
|
|
189
|
+
out.push(renderOptionRow(shown[i].opt, shown[i].disabled));
|
|
190
|
+
i++;
|
|
191
|
+
continue;
|
|
192
|
+
}
|
|
193
|
+
const rows = [];
|
|
194
|
+
const start = i;
|
|
195
|
+
while (i < shown.length && shown[i].group === label2) {
|
|
196
|
+
rows.push(renderOptionRow(shown[i].opt, shown[i].disabled));
|
|
197
|
+
i++;
|
|
198
|
+
}
|
|
199
|
+
out.push(/* @__PURE__ */ jsx(MenuGroup, { label: label2, children: rows }, `flat-${start}-${label2}`));
|
|
200
|
+
}
|
|
201
|
+
return out;
|
|
202
|
+
};
|
|
203
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
204
|
+
renderTrigger ? renderTrigger({ open, value: currentRaw, selected: selectedOptions, disabled: !!disabled, icon }) : /* @__PURE__ */ jsx(
|
|
205
|
+
Input,
|
|
206
|
+
{
|
|
207
|
+
label,
|
|
208
|
+
hint,
|
|
209
|
+
placeholder,
|
|
210
|
+
value: display,
|
|
211
|
+
readOnly: true,
|
|
212
|
+
dimActions: true,
|
|
213
|
+
disabled,
|
|
214
|
+
leading: icon ? /* @__PURE__ */ jsx(Icon, { shape: icon }) : void 0,
|
|
215
|
+
size,
|
|
216
|
+
status,
|
|
217
|
+
statusIcon,
|
|
218
|
+
round,
|
|
219
|
+
"aria-haspopup": "menu",
|
|
220
|
+
"aria-expanded": open ? "true" : "false",
|
|
221
|
+
onKeyDown: (e) => {
|
|
222
|
+
if (!open && (e.key === "Enter" || e.key === " " || e.key === "ArrowDown")) {
|
|
223
|
+
e.preventDefault();
|
|
224
|
+
e.currentTarget.click();
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
trailing: (
|
|
228
|
+
// Chevron rotates down → up when open (spacing + rotation in the CSS
|
|
229
|
+
// module, matching the Input "Select dropdown" example).
|
|
230
|
+
/* @__PURE__ */ jsx(
|
|
231
|
+
Icon,
|
|
232
|
+
{
|
|
233
|
+
shape: "chevron-down",
|
|
234
|
+
className: open ? `${styles.chevron} ${styles.open}` : styles.chevron,
|
|
235
|
+
style: statusColor ? { color: statusColor } : void 0
|
|
236
|
+
}
|
|
237
|
+
)
|
|
238
|
+
),
|
|
239
|
+
className,
|
|
240
|
+
style,
|
|
241
|
+
...rest
|
|
242
|
+
}
|
|
243
|
+
),
|
|
244
|
+
/* @__PURE__ */ jsxs(
|
|
245
|
+
Menu,
|
|
246
|
+
{
|
|
247
|
+
onStateChange: (_e, { next }) => {
|
|
248
|
+
setOpen(next);
|
|
249
|
+
if (!next) setQuery("");
|
|
250
|
+
},
|
|
251
|
+
children: [
|
|
252
|
+
filtering && // `slot="header"` pins the field in the Menu's fixed header region (above
|
|
253
|
+
// the scrolling options); `data-menu-search` puts the menu in combobox
|
|
254
|
+
// mode — it focuses this field on open and drives an active-option cursor.
|
|
255
|
+
/* @__PURE__ */ jsx("div", { className: styles.filter, slot: "header", "data-menu-open": "", children: /* @__PURE__ */ jsx(
|
|
256
|
+
Input,
|
|
257
|
+
{
|
|
258
|
+
"data-menu-search": "",
|
|
259
|
+
size: "small",
|
|
260
|
+
value: query,
|
|
261
|
+
placeholder: "Filter\u2026",
|
|
262
|
+
"aria-label": "Filter options",
|
|
263
|
+
"aria-autocomplete": "list",
|
|
264
|
+
onInput: (e) => setQuery(e.currentTarget.value)
|
|
265
|
+
}
|
|
266
|
+
) }),
|
|
267
|
+
multiple && selectAll && visibleLeaves.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
268
|
+
/* @__PURE__ */ jsx(
|
|
269
|
+
MenuItem,
|
|
270
|
+
{
|
|
271
|
+
selectionIndicator: "checkbox",
|
|
272
|
+
selected: allSelected,
|
|
273
|
+
indeterminate: someSelected,
|
|
274
|
+
label: selectAllLabel,
|
|
275
|
+
"data-menu-open": "",
|
|
276
|
+
"data-menu-skip-active": "",
|
|
277
|
+
onSelect: toggleAll
|
|
278
|
+
}
|
|
279
|
+
),
|
|
280
|
+
/* @__PURE__ */ jsx(MenuSeparator, {})
|
|
281
|
+
] }),
|
|
282
|
+
visibleLeaves.length === 0 ? renderEmpty?.({ query: q }) : flattening ? renderFlat() : renderTree(options, false)
|
|
283
|
+
]
|
|
284
|
+
}
|
|
285
|
+
)
|
|
286
|
+
] });
|
|
287
|
+
};
|
|
288
|
+
export {
|
|
289
|
+
Select
|
|
290
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.chevron{margin-inline-end:7px;transition:transform .15s ease}.chevron.open{transform:rotate(180deg)}.filter{padding:4px 4px 0}
|
package/dist/components/Tab.d.ts
CHANGED
|
@@ -14,6 +14,9 @@ export interface TabProps {
|
|
|
14
14
|
icon?: IconShape;
|
|
15
15
|
/** Trailing icon shape, rendered after the label. */
|
|
16
16
|
iconTrailing?: IconShape;
|
|
17
|
+
/** Fully-round just this tab's box. `<Tabs round>` rounds the whole strip
|
|
18
|
+
* (tabs + sliding indicator) instead. */
|
|
19
|
+
round?: boolean;
|
|
17
20
|
/** Per-tab tone override, same vocabulary as `<Tabs tone>` — colours this one tab's
|
|
18
21
|
* label + icons (all priorities/modes, named or custom colour) and, when it's the
|
|
19
22
|
* active tab, its indicator. For a **custom literal colour** the sliding indicator can't
|
package/dist/components/Tab.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BaseProps } from "../general_types";
|
|
2
|
+
import type { TabProps } from "./Tab";
|
|
2
3
|
/** The element's `statechange` payload — `next`/`prev` are tab values (`null` = none). */
|
|
3
4
|
type StateDetail = {
|
|
4
5
|
next: string | null;
|
|
@@ -9,6 +10,11 @@ type StateChangeEvent = CustomEvent<StateDetail>;
|
|
|
9
10
|
export interface TabsChangeAttrs {
|
|
10
11
|
value: string | null;
|
|
11
12
|
}
|
|
13
|
+
/** One tab as a plain data object for the `options` prop — the array-driven
|
|
14
|
+
* alternative to `<Tab>` children (mirrors `RadioGroup`'s `options`). Same
|
|
15
|
+
* fields as `<Tab>` minus `children` (use `label`); `icon` / `iconTrailing`
|
|
16
|
+
* are icon-shape strings. */
|
|
17
|
+
export type TabOption = Omit<TabProps, "children">;
|
|
12
18
|
/**
|
|
13
19
|
* How `<TabPanel>`s that aren't the active one are handled.
|
|
14
20
|
* - `'display'` *(default)* — all panels mounted; inactive ones hidden via
|
|
@@ -28,6 +34,12 @@ export interface TabsProps extends Omit<BaseProps, "onChange"> {
|
|
|
28
34
|
* panel's body when its tab is active. Omit the panels to use `Tabs` as a bare
|
|
29
35
|
* selectable strip. Order is free; tabs and panels can interleave. */
|
|
30
36
|
children?: React.ReactNode;
|
|
37
|
+
/** Tabs as a data array instead of `<Tab>` children (like `RadioGroup`'s
|
|
38
|
+
* `options`). When set, the strip renders from these and `<Tab>` children are
|
|
39
|
+
* ignored; `<TabPanel>` children still supply panel bodies (matched by `value`).
|
|
40
|
+
* Each entry is a `TabOption` (`value`, `label`, `icon`, `iconTrailing`,
|
|
41
|
+
* `tone`, `disabled`, `round`). */
|
|
42
|
+
options?: TabOption[];
|
|
31
43
|
/** Controlled active value — the `value` of the `<Tab>` to mark selected (and, when a
|
|
32
44
|
* `<TabPanel value="…">` shares it, the panel to reveal). When set, you own selection:
|
|
33
45
|
* the strip renders exactly what this says, and a user pick only *requests* a change
|
|
@@ -79,6 +91,11 @@ export interface TabsProps extends Omit<BaseProps, "onChange"> {
|
|
|
79
91
|
* per tab so it snaps with no movement. (Browsers without anchor positioning get that
|
|
80
92
|
* per-tab paint automatically — `noslide` is the explicit opt-out.) */
|
|
81
93
|
noslide?: boolean;
|
|
94
|
+
/** Fully-round the tabs and the sliding indicator (and the primary track
|
|
95
|
+
* well). Applies strip-wide; a single `<Tab round>` rounds just that tab. A
|
|
96
|
+
* `number` (px) or CSS length string sets a custom radius on the top-level
|
|
97
|
+
* track well only — the tab pills + indicator stay fully round. */
|
|
98
|
+
round?: boolean | number | string;
|
|
82
99
|
/** Disable the whole strip. */
|
|
83
100
|
disabled?: boolean;
|
|
84
101
|
}
|
|
@@ -108,5 +125,5 @@ export interface TabsProps extends Omit<BaseProps, "onChange"> {
|
|
|
108
125
|
* </Tabs>
|
|
109
126
|
* ```
|
|
110
127
|
*/
|
|
111
|
-
export declare const Tabs: ({ children, value, defaultValue, onStateChange, onChange, onValueChange, onFocus, onBlur, label, priority, tone, size, orientation, mounting, noslide, disabled, className, style, id, ...rest }: TabsProps) => any;
|
|
128
|
+
export declare const Tabs: ({ children, options, value, defaultValue, onStateChange, onChange, onValueChange, onFocus, onBlur, label, priority, tone, size, orientation, mounting, noslide, round, disabled, className, style, id, ...rest }: TabsProps) => any;
|
|
112
129
|
export {};
|
package/dist/components/Tabs.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "@antadesign/anta/jsx-runtime";
|
|
2
2
|
import { useId, useState, Fragment } from "../jsx-runtime";
|
|
3
|
-
import { nativeStateChange, toneStyle, wrapLabel } from "../anta_helpers";
|
|
4
|
-
import { Tab } from "./Tab";
|
|
5
|
-
import { TabPanel } from "./TabPanel";
|
|
3
|
+
import { nativeStateChange, toneStyle, roundStyle, wrapLabel, TABS_KIND } from "../anta_helpers";
|
|
6
4
|
import styles from "./Tabs.module.css";
|
|
7
5
|
const flattenChildren = (nodes) => {
|
|
8
6
|
const out = [];
|
|
@@ -23,6 +21,7 @@ const flattenChildren = (nodes) => {
|
|
|
23
21
|
};
|
|
24
22
|
const Tabs = ({
|
|
25
23
|
children,
|
|
24
|
+
options,
|
|
26
25
|
value,
|
|
27
26
|
defaultValue,
|
|
28
27
|
onStateChange,
|
|
@@ -37,6 +36,7 @@ const Tabs = ({
|
|
|
37
36
|
orientation,
|
|
38
37
|
mounting = "display",
|
|
39
38
|
noslide,
|
|
39
|
+
round,
|
|
40
40
|
disabled,
|
|
41
41
|
className,
|
|
42
42
|
style,
|
|
@@ -56,8 +56,8 @@ const Tabs = ({
|
|
|
56
56
|
const tabId = (v) => `${baseId}-tab-${v}`;
|
|
57
57
|
const panelId = (v) => `${baseId}-panel-${v}`;
|
|
58
58
|
const items = flattenChildren(children);
|
|
59
|
-
const tabs = items.filter((c) => c?.type ===
|
|
60
|
-
const panels = items.filter((c) => c?.type ===
|
|
59
|
+
const tabs = options ? options.map((o) => ({ props: o })) : items.filter((c) => c?.type?.[TABS_KIND] === "tab");
|
|
60
|
+
const panels = items.filter((c) => c?.type?.[TABS_KIND] === "panel");
|
|
61
61
|
const panelValues = new Set(panels.map((pan) => pan.props.value));
|
|
62
62
|
const seen = /* @__PURE__ */ new Set();
|
|
63
63
|
for (const t of tabs) {
|
|
@@ -93,6 +93,7 @@ const Tabs = ({
|
|
|
93
93
|
size: size && size !== "medium" ? size : void 0,
|
|
94
94
|
orientation: vertical ? "vertical" : void 0,
|
|
95
95
|
noslide: noslide ? "" : void 0,
|
|
96
|
+
round: round ? "" : void 0,
|
|
96
97
|
disabled: disabled ? "" : void 0,
|
|
97
98
|
onstatechange,
|
|
98
99
|
onchange,
|
|
@@ -100,7 +101,7 @@ const Tabs = ({
|
|
|
100
101
|
onfocusout: onBlur,
|
|
101
102
|
class: needsContainer ? void 0 : className,
|
|
102
103
|
id: needsContainer ? void 0 : id,
|
|
103
|
-
style: toneStyle(tone, "--tabs-tone-source", style),
|
|
104
|
+
style: roundStyle(round, "--tabs-round", toneStyle(tone, "--tabs-tone-source", style)),
|
|
104
105
|
...needsContainer ? {} : rest,
|
|
105
106
|
children: tabs.map((t) => {
|
|
106
107
|
const p = t.props;
|
|
@@ -119,6 +120,7 @@ const Tabs = ({
|
|
|
119
120
|
"aria-disabled": tabDisabled ? "true" : void 0,
|
|
120
121
|
tabIndex: tabDisabled && !isSelected ? -1 : 0,
|
|
121
122
|
disabled: tabDisabled ? "" : void 0,
|
|
123
|
+
round: round || p.round ? "" : void 0,
|
|
122
124
|
children: [
|
|
123
125
|
p.icon && /* @__PURE__ */ jsx("a-icon", { shape: p.icon, "aria-hidden": "true" }),
|
|
124
126
|
wrapLabel(p.label != null ? p.label : p.children, "a-tab-label"),
|
package/dist/components/Tag.d.ts
CHANGED
|
@@ -28,9 +28,9 @@ export interface TagProps extends BaseProps {
|
|
|
28
28
|
* default — both render identically and emit no DOM attribute.
|
|
29
29
|
* @defaultValue medium */
|
|
30
30
|
size?: 'small' | 'medium' | 'large';
|
|
31
|
-
/** Render in
|
|
32
|
-
* (
|
|
33
|
-
|
|
31
|
+
/** Render in all-caps instead of the default normal (mixed) case
|
|
32
|
+
* (uppercase tracks wider than the default body-text letter-spacing). */
|
|
33
|
+
allcaps?: boolean;
|
|
34
34
|
/** Leading icon shape. Sits flush before the label, scaled to the pill. */
|
|
35
35
|
icon?: IconShape;
|
|
36
36
|
/** Trailing icon shape. Renders last, after the value. */
|
|
@@ -73,16 +73,17 @@ export interface TagProps extends BaseProps {
|
|
|
73
73
|
* are the only numbers to tune and the `.dark` block re-tunes them. The
|
|
74
74
|
* wrapper writes `--tag-tone-source` inline; a typed `attr()` fallback
|
|
75
75
|
* picks up raw `<a-tag tone="…">` on Chrome 133+/Safari 18.2+.
|
|
76
|
-
* - `
|
|
77
|
-
*
|
|
78
|
-
* stay on.
|
|
79
|
-
*
|
|
76
|
+
* - `allcaps` switches on the uppercase transform and widens tracking to
|
|
77
|
+
* 0.08ch (the default mixed case uses the body-text 0.02ch); tabular
|
|
78
|
+
* figures + `ss05` stay on. Each size steps down 1px under `allcaps`
|
|
79
|
+
* (uppercase reads larger than mixed case at the same px), with height
|
|
80
|
+
* unchanged.
|
|
80
81
|
*
|
|
81
82
|
* @example Basic usage
|
|
82
83
|
* ```tsx
|
|
83
84
|
* <Tag tone="success" label="Running" />
|
|
84
85
|
* <Tag tone="info" icon="hourglass" label="Build" value="2m 14s" />
|
|
85
|
-
* <Tag tone="brand" size="small"
|
|
86
|
+
* <Tag tone="brand" size="small" allcaps label="Status" />
|
|
86
87
|
* ```
|
|
87
88
|
*/
|
|
88
|
-
export declare const Tag: ({ icon, iconTrailing, label, value, tone, priority, size,
|
|
89
|
+
export declare const Tag: ({ icon, iconTrailing, label, value, tone, priority, size, allcaps, className, style, children, ...rest }: TagProps) => any;
|
package/dist/components/Tag.js
CHANGED
|
@@ -9,7 +9,7 @@ const Tag = ({
|
|
|
9
9
|
tone,
|
|
10
10
|
priority,
|
|
11
11
|
size,
|
|
12
|
-
|
|
12
|
+
allcaps,
|
|
13
13
|
className,
|
|
14
14
|
style,
|
|
15
15
|
children,
|
|
@@ -25,7 +25,7 @@ const Tag = ({
|
|
|
25
25
|
"aria-label": isIconOnly ? `${icon} tag` : void 0,
|
|
26
26
|
priority: priority && priority !== "secondary" ? priority : void 0,
|
|
27
27
|
size: size && size !== "medium" ? size : void 0,
|
|
28
|
-
|
|
28
|
+
allcaps: allcaps ? "" : void 0,
|
|
29
29
|
class: className,
|
|
30
30
|
style: computedStyle,
|
|
31
31
|
...rest,
|
|
@@ -2,8 +2,8 @@ import type { BaseProps } from "../general_types";
|
|
|
2
2
|
/** Truncation / expansion axis. `expandable` only takes effect with `truncate`;
|
|
3
3
|
* `collapsible` only with `expandable` — so the type forbids `collapsible`
|
|
4
4
|
* unless `expandable` is set (a dynamic `expandable={cond}` is still allowed). */
|
|
5
|
-
type ExpandMode = {
|
|
6
|
-
expandable?:
|
|
5
|
+
export type ExpandMode = {
|
|
6
|
+
expandable?: never;
|
|
7
7
|
collapsible?: never;
|
|
8
8
|
} | {
|
|
9
9
|
/** Show a fade hint and chevron over the truncated text and let the user
|
|
@@ -23,8 +23,10 @@ export type TextProps = BaseProps & {
|
|
|
23
23
|
* step softer than the strongest foreground; pass `primary` for emphasis.
|
|
24
24
|
* @defaultValue secondary */
|
|
25
25
|
priority?: 'primary' | 'secondary' | 'tertiary' | 'quaternary' | 'quinary';
|
|
26
|
-
/** Color tint.
|
|
27
|
-
|
|
26
|
+
/** Color tint. `neutral` (the default) is the untinted `--text-{N}` scale;
|
|
27
|
+
* the others apply the matching `--text-{N}-{tone}` palette.
|
|
28
|
+
* @defaultValue neutral */
|
|
29
|
+
tone?: 'neutral' | 'brand' | 'info' | 'success' | 'warning' | 'critical';
|
|
28
30
|
/** Type scale. `small` = 13/16, `medium` = 15/20, `large` = 17/24.
|
|
29
31
|
* @defaultValue medium */
|
|
30
32
|
size?: 'small' | 'medium' | 'large';
|
|
@@ -60,4 +62,3 @@ export type TextProps = BaseProps & {
|
|
|
60
62
|
* ```
|
|
61
63
|
*/
|
|
62
64
|
export declare const Text: ({ priority, tone, size, inline, truncate, expandable, collapsible, className, style, children, ...rest }: TextProps) => any;
|
|
63
|
-
export {};
|
|
@@ -8,8 +8,10 @@ export interface TitleProps extends BaseProps {
|
|
|
8
8
|
/** Visual priority. Maps to text-1..text-5 (`primary` = text-1).
|
|
9
9
|
* @defaultValue primary */
|
|
10
10
|
priority?: 'primary' | 'secondary' | 'tertiary' | 'quaternary' | 'quinary';
|
|
11
|
-
/** Color tint.
|
|
12
|
-
|
|
11
|
+
/** Color tint. `neutral` (the default) is the untinted `--text-{N}` scale;
|
|
12
|
+
* the others apply the matching `--text-{N}-{tone}` palette.
|
|
13
|
+
* @defaultValue neutral */
|
|
14
|
+
tone?: 'neutral' | 'brand' | 'info' | 'success' | 'warning' | 'critical';
|
|
13
15
|
}
|
|
14
16
|
/**
|
|
15
17
|
* Block-level heading with level 1-6, priority, and tone.
|
|
@@ -11,6 +11,9 @@ export interface TooltipProps extends BaseProps {
|
|
|
11
11
|
* side when there isn't room.
|
|
12
12
|
* @defaultValue bottom */
|
|
13
13
|
placement?: 'top' | 'bottom';
|
|
14
|
+
/** Round the bubble to a 20px radius (matching a round menu). Pass a `number`
|
|
15
|
+
* (px) or a CSS length string for a custom radius. */
|
|
16
|
+
round?: boolean | number | string;
|
|
14
17
|
/** Follow the cursor instead of pinning under the anchor. The bubble is
|
|
15
18
|
* pinned (anchored beneath the target) by default; pass `follow` for the
|
|
16
19
|
* cursor-tracking behaviour, which fades by distance as the cursor leaves. */
|
|
@@ -73,4 +76,4 @@ export interface TooltipProps extends BaseProps {
|
|
|
73
76
|
* </button>
|
|
74
77
|
* ```
|
|
75
78
|
*/
|
|
76
|
-
export declare const Tooltip: ({ delay, placement, follow, interactive, truncatedOnly, truncatedSelector, className, children, ...rest }: TooltipProps) => any;
|
|
79
|
+
export declare const Tooltip: ({ delay, placement, round, follow, interactive, truncatedOnly, truncatedSelector, className, style, children, ...rest }: TooltipProps) => any;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { jsx } from "@antadesign/anta/jsx-runtime";
|
|
2
|
+
import { roundStyle } from "../anta_helpers";
|
|
2
3
|
const Tooltip = ({
|
|
3
4
|
delay,
|
|
4
5
|
placement,
|
|
6
|
+
round,
|
|
5
7
|
follow,
|
|
6
8
|
interactive,
|
|
7
9
|
truncatedOnly,
|
|
8
10
|
truncatedSelector,
|
|
9
11
|
className,
|
|
12
|
+
style,
|
|
10
13
|
children,
|
|
11
14
|
...rest
|
|
12
15
|
}) => {
|
|
@@ -15,11 +18,13 @@ const Tooltip = ({
|
|
|
15
18
|
{
|
|
16
19
|
delay: delay != null ? String(delay) : void 0,
|
|
17
20
|
placement: placement === "top" ? "top" : void 0,
|
|
21
|
+
round: round ? "" : void 0,
|
|
18
22
|
follow: follow ? "" : void 0,
|
|
19
23
|
interactive: interactive ? "" : void 0,
|
|
20
24
|
"truncated-only": truncatedOnly ? "" : void 0,
|
|
21
25
|
"truncated-selector": truncatedSelector || void 0,
|
|
22
26
|
class: className,
|
|
27
|
+
style: roundStyle(round, "--tooltip-round", style),
|
|
23
28
|
...rest,
|
|
24
29
|
children
|
|
25
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer anta{a-button,a[role=button]{--button-primary-fg: #ffffff;--bg-primary-disabled: #ece9ec;--bg-secondary-disabled: #f6f4f6;--fg-disabled-primary: #afa9b1;--fg-disabled: #afa9b1;--button-loading-stripe: 14px;--button-loading-stripe-gap: 16px;--button-loading-period: 30px;--button-loading-angle: 125deg;--button-loading-x-period: calc( var(--button-loading-period) / cos(var(--button-loading-angle) - 90deg) );--button-loading-opacity: .15;--button-loading-blur: 2.5px;--button-bg-primary-rest: #635b65;--button-bg-primary-hover: #534c57;--button-bg-primary-active: #49424c;--button-fg-primary-rest: var(--button-primary-fg);--button-bg-secondary-rest: #45374c12;--button-bg-secondary-hover: #44374b1a;--button-bg-secondary-active: #44374b26;--button-fg-secondary-rest: #534c57;--button-fg-secondary-hover: #49424c;--button-fg-secondary-l-shift: .05;--button-fg-tertiary-rest: #635b65;--button-fg-tertiary-hover: #534c57;--button-bg-tertiary-hover: #44374b0d;--button-bg-tertiary-active: #44374b1a;--button-fg-quaternary-rest: #635b65;--button-fg-quaternary-hover: #49424c;--_fs: 15px;--_lh: 20px;--_pb: 1px;--button-padding-x: 9px;--button-padding-y: calc((8px - var(--_pb)) / 2);--button-max-width: 100%;--button-max-height: 100%;--button-timing-in: 75ms ease-in;--button-timing-active: 50ms linear;--button-timing-out: .15s ease-out;--button-loading-duration: .5s}a-button[tone=brand],a[role=button][tone=brand]{--button-bg-primary-rest: #5f4bc3;--button-bg-primary-hover: #503cb4;--button-bg-primary-active: #483493;--button-fg-primary-rest: var(--button-primary-fg);--button-bg-secondary-rest: #7460d71a;--button-bg-secondary-hover: #7460d726;--button-bg-secondary-active: #7460d733;--button-fg-secondary-rest: #5f4bc3;--button-fg-secondary-hover: #503cb4;--button-fg-tertiary-rest: #5f4bc3;--button-fg-tertiary-hover: #503cb4;--button-bg-tertiary-hover: #7460d71a;--button-bg-tertiary-active: #7460d726;--button-fg-quaternary-rest: #5f4bc3;--button-fg-quaternary-hover: #483493}a-button[tone=critical],a[role=button][tone=critical]{--button-bg-primary-rest: #c9302c;--button-bg-primary-hover: #b02120;--button-bg-primary-active: #a01c1c;--button-fg-primary-rest: var(--button-primary-fg);--button-bg-secondary-rest: #de45451a;--button-bg-secondary-hover: #de454526;--button-bg-secondary-active: #de454533;--button-fg-secondary-rest: #c9302c;--button-fg-secondary-hover: #b02120;--button-fg-tertiary-rest: #c9302c;--button-fg-tertiary-hover: #b02120;--button-bg-tertiary-hover: #de45451a;--button-bg-tertiary-active: #de454533;--button-fg-quaternary-rest: #c9302c;--button-fg-quaternary-hover: #a01c1c}a-button[tone=info],a[role=button][tone=info]{--button-bg-primary-rest: #1f6eb2;--button-bg-primary-hover: #1a5b93;--button-bg-primary-active: #175082;--button-fg-primary-rest: var(--button-primary-fg);--button-bg-secondary-rest: #2686d91a;--button-bg-secondary-hover: #2686d926;--button-bg-secondary-active: #2686d933;--button-fg-secondary-rest: #1f6eb2;--button-fg-secondary-hover: #1a5b93;--button-fg-tertiary-rest: #1f6eb2;--button-fg-tertiary-hover: #1a5b93;--button-bg-tertiary-hover: #2686d91a;--button-bg-tertiary-active: #2686d926;--button-fg-quaternary-rest: #1f6eb2;--button-fg-quaternary-hover: #175082}a-button[tone=success],a[role=button][tone=success]{--button-bg-primary-rest: #2a7e43;--button-bg-primary-hover: #226737;--button-bg-primary-active: #1f5c31;--button-fg-primary-rest: var(--button-primary-fg);--button-bg-secondary-rest: #3295501a;--button-bg-secondary-hover: #32955026;--button-bg-secondary-active: #32955033;--button-fg-secondary-rest: #2a7e43;--button-fg-secondary-hover: #226737;--button-fg-tertiary-rest: #2a7e43;--button-fg-tertiary-hover: #226737;--button-bg-tertiary-hover: #3295501a;--button-bg-tertiary-active: #32955026;--button-fg-quaternary-rest: #2a7e43;--button-fg-quaternary-hover: #1f5c31}a-button[tone=warning],a[role=button][tone=warning]{--button-bg-primary-rest: #c37416;--button-bg-primary-hover: #ae6613;--button-bg-primary-active: #995200;--button-fg-primary-rest: var(--button-primary-fg);--button-bg-secondary-rest: #c374161a;--button-bg-secondary-hover: #c3741626;--button-bg-secondary-active: #c3741633;--button-fg-secondary-rest: #c37416;--button-fg-secondary-hover: #ae6613;--button-fg-tertiary-rest: #c37416;--button-fg-tertiary-hover: #ae6613;--button-bg-tertiary-hover: #c374161a;--button-bg-tertiary-active: #c3741633;--button-fg-quaternary-rest: #c37416;--button-fg-quaternary-hover: #995200}.dark a-button,.dark a[role=button]{--bg-primary-disabled: #272329;--bg-secondary-disabled: #1d1a1e;--fg-disabled-primary: #776e77;--fg-disabled: #635b65;--button-bg-primary-rest: #534c57;--button-bg-primary-hover: #635b65;--button-bg-primary-active: #938d96;--button-bg-secondary-rest: #e4d1ef1c;--button-bg-secondary-hover: #e4d1ef24;--button-bg-secondary-active: #e4d1ef2e;--button-fg-secondary-rest: #c1b9c1;--button-fg-secondary-hover: #d4ced4;--button-fg-secondary-l-shift: 0;--button-fg-tertiary-rest: #afa9b1;--button-fg-tertiary-hover: #afa9b1;--button-bg-tertiary-hover: #e4d1ef14;--button-bg-tertiary-active: #e4d1ef21;--button-fg-quaternary-rest: #afa9b1;--button-fg-quaternary-hover: #cac4ca}.dark a-button[tone=brand],.dark a[role=button][tone=brand]{--button-bg-primary-rest: #503cb4;--button-bg-primary-hover: #5f4bc3;--button-bg-primary-active: #7460d7;--button-bg-secondary-rest: #7460d73b;--button-bg-secondary-hover: #7460d747;--button-bg-secondary-active: #7460d754;--button-fg-secondary-rest: #c5baff;--button-fg-secondary-hover: #d2cbf6;--button-fg-tertiary-rest: #ada0ee;--button-fg-tertiary-hover: #bcb1f1;--button-bg-tertiary-hover: #7460d73b;--button-bg-tertiary-active: #7460d747;--button-fg-quaternary-rest: #ada0ee;--button-fg-quaternary-hover: #c7bef4}.dark a-button[tone=critical],.dark a[role=button][tone=critical]{--button-bg-primary-rest: #b02120;--button-bg-primary-hover: #c9302c;--button-bg-primary-active: #de4545;--button-bg-secondary-rest: #de45453b;--button-bg-secondary-hover: #de454547;--button-bg-secondary-active: #de454554;--button-fg-secondary-rest: #ffabac;--button-fg-secondary-hover: #f4c2c2;--button-fg-tertiary-rest: #e78e90;--button-fg-tertiary-hover: #efa4a4;--button-bg-tertiary-hover: #de45453b;--button-bg-tertiary-active: #de454547;--button-fg-quaternary-rest: #e78e90;--button-fg-quaternary-hover: #ffabac}.dark a-button[tone=info],.dark a[role=button][tone=info]{--button-bg-primary-rest: #1a5b93;--button-bg-primary-hover: #1f6eb2;--button-bg-primary-active: #2686d9;--button-bg-secondary-rest: #2686d93b;--button-bg-secondary-hover: #2686d947;--button-bg-secondary-active: #2686d954;--button-fg-secondary-rest: #9ed2ff;--button-fg-secondary-hover: #bad6f3;--button-fg-tertiary-rest: #7db6e8;--button-fg-tertiary-hover: #93c5ec;--button-bg-tertiary-hover: #2686d93b;--button-bg-tertiary-active: #2686d947;--button-fg-quaternary-rest: #7db6e8;--button-fg-quaternary-hover: #a6cdef}.dark a-button[tone=success],.dark a[role=button][tone=success]{--button-bg-primary-rest: #226737;--button-bg-primary-hover: #2a7e43;--button-bg-primary-active: #329550;--button-bg-secondary-rest: #3295503b;--button-bg-secondary-hover: #32955047;--button-bg-secondary-active: #32955054;--button-fg-secondary-rest: #8ceca9;--button-fg-secondary-hover: #b3e5c2;--button-fg-tertiary-rest: #74cd8e;--button-fg-tertiary-hover: #88d7a0;--button-bg-tertiary-hover: #3295503b;--button-bg-tertiary-active: #32955047;--button-fg-quaternary-rest: #74cd8e;--button-fg-quaternary-hover: #9ddeb1}.dark a-button[tone=warning],.dark a[role=button][tone=warning]{--button-bg-primary-rest: #7f410b;--button-bg-primary-hover: #995200;--button-bg-primary-active: #ae6613;--button-bg-secondary-rest: #c374163b;--button-bg-secondary-hover: #c3741647;--button-bg-secondary-active: #c3741654;--button-fg-secondary-rest: #f7c06e;--button-fg-secondary-hover: #f3cc91;--button-fg-tertiary-rest: #e1a452;--button-fg-tertiary-hover: #edb25a;--button-bg-tertiary-hover: #c374163b;--button-bg-tertiary-active: #c3741647;--button-fg-quaternary-rest: #e1a452;--button-fg-quaternary-hover: #f0bf75}a-button,a[role=button]{user-select:none;display:inline-flex;align-items:center;gap:.5ch;overflow:hidden;cursor:pointer;flex-shrink:0;color:var(--button-fg);background-color:var(--button-bg);border-radius:4px;text-decoration:none;box-shadow:inset 0 0 1px color-mix(in oklch,currentColor,transparent 70%);font-size:var(--_fs);font-family:var(--sans-serif);font-weight:450;font-variation-settings:"wdth" 88,"slnt" 0,"ital" 0;font-feature-settings:"ss02","ss05","tnum";line-height:var(--_lh);letter-spacing:.05ch;text-overflow:ellipsis;text-wrap:nowrap;white-space:nowrap;max-width:var(--button-max-width);max-height:var(--button-max-height);padding-inline:var(--button-padding-x);padding-block:var(--button-padding-y);>a-button-label{display:inline-block;text-overflow:ellipsis;text-wrap:nowrap;white-space:nowrap;overflow:hidden;min-width:0;line-height:var(--_lh);padding-bottom:var(--_pb);&:has(>*){display:inline-flex;gap:.25ch}}>*{pointer-events:none}& a-icon{transition:color var(--button-timing-out)}transition:color var(--button-timing-out),background-color var(--button-timing-out);&:hover,&:focus-visible{transition:color var(--button-timing-in),background-color var(--button-timing-in);& a-icon{transition:color var(--button-timing-in)}}&:active,&[selected]{transition:color var(--button-timing-active),background-color var(--button-timing-active);& a-icon{transition:color var(--button-timing-active)}}&[disabled]{pointer-events:none;cursor:not-allowed;transition:none;& a-icon{transition:none}}&:focus-visible{outline:1px solid var(--focus-ring);outline-offset:1px}&[priority=quaternary]{--button-timing-in: 0s;--button-timing-active: 0s;--button-timing-out: 0s}&[size=small]{--button-padding-x: 7px;--_fs: 13px;--_lh: 16px;--_pb: .5px;& a-icon{--icon-size: 14px}}&[size=large]{--button-padding-x: 13px;--_fs: 17px;--_lh: 24px;--_pb: 1.5px;& a-icon{--icon-size: 18px}}&[priority=tertiary],&[priority=quaternary]{&[underline=solid]{text-decoration:underline solid}&[underline=dashed]{text-decoration:underline dashed}&[underline=dotted]{text-decoration:underline dotted}&[underline]{text-decoration-color:color-mix(in srgb,currentColor 75%,transparent);text-decoration-thickness:1px;text-underline-offset:3px;&[selected]{text-decoration-color:var(--button-fg);text-decoration-thickness:1px}@media(hover:hover)and (pointer:fine){&:hover{text-decoration-color:var(--button-fg);text-decoration-thickness:1px}}}}&[priority=quaternary][paddingless]{--button-padding-x: 0;--button-padding-y: 0}&:has(>a-icon):not(:has(>a-icon~a-icon)):not(:has(>:not(a-icon):not(a-tooltip))){--button-padding-y: 5px;--button-padding-x: 5px;min-width:28px;min-height:28px;justify-content:center;&[size=small]{--button-padding-y: 3px;--button-padding-x: 3px;min-width:24px;min-height:24px}&[size=large]{--button-padding-y: 7px;--button-padding-x: 7px;min-width:32px;min-height:32px}}&:is(:has(>a-icon:first-child),:has(>a-tooltip:first-child+a-icon)):is(:has(>a-icon~a-icon),:has(>:not(a-icon):not(a-tooltip))){padding-inline-start:max(0px,var(--button-padding-x) - 2px)}&:is(:has(>a-icon:last-child),:has(>a-icon+a-tooltip:last-child)):is(:has(>a-icon~a-icon),:has(>:not(a-icon):not(a-tooltip))){padding-inline-end:max(0px,var(--button-padding-x) - 2px)}&[loading]{position:relative;pointer-events:none;cursor:wait;&:before{content:"";position:absolute;top:0;bottom:0;left:calc(0px - var(--button-loading-x-period));right:0;pointer-events:none;background:repeating-linear-gradient(var(--button-loading-angle),transparent 0,transparent var(--button-loading-stripe-gap),currentColor var(--button-loading-stripe-gap),currentColor calc(var(--button-loading-stripe-gap) + var(--button-loading-stripe)));opacity:var(--button-loading-opacity);filter:blur(var(--button-loading-blur));will-change:transform;animation:btn-loading-slide var(--button-loading-duration) linear infinite;animation-delay:-9999s}}&[tone]:not([tone=""],[tone=brand],[tone=neutral],[tone=critical],[tone=info],[tone=success],[tone=warning]){--button-tone-source: attr(tone type(<color>), transparent);--_tone-fg-l: .46;--_tone-fg-strong-l: .4;--_tone-fg-c: .17;--_tone-bg-l: .54;--_tone-bg-c: .16;--_tone-bg-a-rest: .1;--_tone-bg-a-hover: .15;--_tone-bg-a-active: .2;--_tone-primary-l-rest: .5;--_tone-primary-l-hover: .45;--_tone-primary-l-active: .4;--button-bg-primary-rest: oklch(from var(--button-tone-source) var(--_tone-primary-l-rest) c h);--button-bg-primary-hover: oklch(from var(--button-tone-source) var(--_tone-primary-l-hover) c h);--button-bg-primary-active: oklch(from var(--button-tone-source) var(--_tone-primary-l-active) c h);--button-fg-primary-rest: var(--button-primary-fg);--button-fg-secondary-rest: oklch(from var(--button-tone-source) var(--_tone-fg-l) var(--_tone-fg-c) h);--button-fg-secondary-hover: oklch(from var(--button-tone-source) var(--_tone-fg-strong-l) var(--_tone-fg-c) h);--button-fg-tertiary-rest: oklch(from var(--button-tone-source) var(--_tone-fg-l) var(--_tone-fg-c) h);--button-fg-tertiary-hover: oklch(from var(--button-tone-source) var(--_tone-fg-strong-l) var(--_tone-fg-c) h);--button-fg-quaternary-rest: oklch(from var(--button-tone-source) var(--_tone-fg-l) var(--_tone-fg-c) h);--button-fg-quaternary-hover: oklch(from var(--button-tone-source) var(--_tone-fg-strong-l) var(--_tone-fg-c) h);--button-bg-secondary-rest: oklch(from var(--button-tone-source) var(--_tone-bg-l) var(--_tone-bg-c) h / var(--_tone-bg-a-rest));--button-bg-secondary-hover: oklch(from var(--button-tone-source) var(--_tone-bg-l) var(--_tone-bg-c) h / var(--_tone-bg-a-hover));--button-bg-secondary-active: oklch(from var(--button-tone-source) var(--_tone-bg-l) var(--_tone-bg-c) h / var(--_tone-bg-a-active));--button-bg-tertiary-hover: oklch(from var(--button-tone-source) var(--_tone-bg-l) var(--_tone-bg-c) h / var(--_tone-bg-a-rest));--button-bg-tertiary-active: oklch(from var(--button-tone-source) var(--_tone-bg-l) var(--_tone-bg-c) h / var(--_tone-bg-a-hover))}.dark &[tone]:not([tone=""],[tone=brand],[tone=neutral],[tone=critical],[tone=info],[tone=success],[tone=warning]){--_tone-fg-l: .78;--_tone-fg-strong-l: .85;--_tone-fg-c: .11;--_tone-bg-l: .58;--_tone-bg-a-rest: .23;--_tone-bg-a-hover: .28;--_tone-bg-a-active: .33;--_tone-primary-l-rest: .45;--_tone-primary-l-hover: .5;--_tone-primary-l-active: .57}--button-fg: oklch(from var(--button-fg-secondary-rest) calc(l - var(--button-fg-secondary-l-shift)) c h);--button-bg: var(--button-bg-secondary-rest);@media(hover:hover)and (pointer:fine){&:hover{--button-fg: var(--button-fg-secondary-hover);--button-bg: var(--button-bg-secondary-hover)}}&:active,&[selected]{--button-fg: var(--button-fg-secondary-hover);--button-bg: var(--button-bg-secondary-active)}&[priority=primary]{--button-fg: var(--button-fg-primary-rest);--button-bg: var(--button-bg-primary-rest);box-shadow:none;@media(hover:hover)and (pointer:fine){&:hover{--button-bg: var(--button-bg-primary-hover)}}&:active,&[selected]{--button-bg: var(--button-bg-primary-active)}}&[priority=tertiary]{--button-fg: var(--button-fg-tertiary-rest);--button-bg: transparent;box-shadow:none;@media(hover:hover)and (pointer:fine){&:hover{--button-fg: var(--button-fg-tertiary-hover);--button-bg: var(--button-bg-tertiary-hover)}}&:active,&[selected]{--button-fg: var(--button-fg-tertiary-hover);--button-bg: var(--button-bg-tertiary-active)}}&[priority=quaternary]{--button-fg: var(--button-fg-quaternary-rest);--button-bg: transparent;box-shadow:none;font-weight:400;letter-spacing:.06ch;@media(hover:hover)and (pointer:fine){&:hover{--button-fg: var(--button-fg-quaternary-hover)}}&[selected]{--button-fg: var(--button-fg-quaternary-hover)}&:active{--button-fg: oklch(from var(--button-fg-quaternary-rest) calc(l + .05) c h)}.dark &:active{--button-fg: var(--button-fg-quaternary-rest)}}&[selected]{box-shadow:inset 0 0 0 1px currentColor}&[disabled]{background-color:var(--bg-secondary-disabled);color:var(--fg-disabled);&[priority=primary]{background-color:var(--bg-primary-disabled);color:var(--fg-disabled-primary)}&[priority=tertiary],&[priority=quaternary]{background-color:transparent;color:var(--fg-disabled)}}}}@keyframes btn-loading-slide{to{transform:translate(var(--button-loading-x-period))}}
|
|
1
|
+
@layer anta{a-button,a[role=button][data-anta]{--button-primary-fg: #ffffff;--bg-primary-disabled: #ece9ec;--bg-secondary-disabled: #f6f4f6;--fg-disabled-primary: #afa9b1;--fg-disabled: #afa9b1;--button-loading-stripe: 14px;--button-loading-stripe-gap: 16px;--button-loading-period: 30px;--button-loading-angle: 125deg;--button-loading-x-period: calc( var(--button-loading-period) / cos(var(--button-loading-angle) - 90deg) );--button-loading-opacity: .15;--button-loading-blur: 2.5px;--button-bg-primary-rest: #635b65;--button-bg-primary-hover: #534c57;--button-bg-primary-active: #49424c;--button-fg-primary-rest: var(--button-primary-fg);--button-bg-secondary-rest: #45374c12;--button-bg-secondary-hover: #44374b1a;--button-bg-secondary-active: #44374b26;--button-fg-secondary-rest: #534c57;--button-fg-secondary-hover: #49424c;--button-fg-secondary-l-shift: .05;--button-fg-tertiary-rest: #635b65;--button-fg-tertiary-hover: #534c57;--button-bg-tertiary-hover: #44374b0d;--button-bg-tertiary-active: #44374b1a;--button-fg-quaternary-rest: #635b65;--button-fg-quaternary-hover: #49424c;--_fs: 15px;--_lh: 20px;--_pb: 1px;--button-padding-x: 9px;--button-padding-y: calc((8px - var(--_pb)) / 2);--button-max-width: 100%;--button-max-height: 100%;--button-timing-in: 75ms ease-in;--button-timing-active: 50ms linear;--button-timing-out: .15s ease-out;--button-loading-duration: .5s}a-button[round],a[role=button][data-anta][round]{--button-round: attr(round type(<length>), 999px);border-radius:var(--button-round, 999px)}a-button[tone=brand],a[role=button][data-anta][tone=brand]{--button-bg-primary-rest: #5f4bc3;--button-bg-primary-hover: #503cb4;--button-bg-primary-active: #483493;--button-fg-primary-rest: var(--button-primary-fg);--button-bg-secondary-rest: #7460d71a;--button-bg-secondary-hover: #7460d726;--button-bg-secondary-active: #7460d733;--button-fg-secondary-rest: #5f4bc3;--button-fg-secondary-hover: #503cb4;--button-fg-tertiary-rest: #5f4bc3;--button-fg-tertiary-hover: #503cb4;--button-bg-tertiary-hover: #7460d71a;--button-bg-tertiary-active: #7460d726;--button-fg-quaternary-rest: #5f4bc3;--button-fg-quaternary-hover: #483493}a-button[tone=critical],a[role=button][data-anta][tone=critical]{--button-bg-primary-rest: #c9302c;--button-bg-primary-hover: #b02120;--button-bg-primary-active: #a01c1c;--button-fg-primary-rest: var(--button-primary-fg);--button-bg-secondary-rest: #de45451a;--button-bg-secondary-hover: #de454526;--button-bg-secondary-active: #de454533;--button-fg-secondary-rest: #c9302c;--button-fg-secondary-hover: #b02120;--button-fg-tertiary-rest: #c9302c;--button-fg-tertiary-hover: #b02120;--button-bg-tertiary-hover: #de45451a;--button-bg-tertiary-active: #de454533;--button-fg-quaternary-rest: #c9302c;--button-fg-quaternary-hover: #a01c1c}a-button[tone=info],a[role=button][data-anta][tone=info]{--button-bg-primary-rest: #1f6eb2;--button-bg-primary-hover: #1a5b93;--button-bg-primary-active: #175082;--button-fg-primary-rest: var(--button-primary-fg);--button-bg-secondary-rest: #2686d91a;--button-bg-secondary-hover: #2686d926;--button-bg-secondary-active: #2686d933;--button-fg-secondary-rest: #1f6eb2;--button-fg-secondary-hover: #1a5b93;--button-fg-tertiary-rest: #1f6eb2;--button-fg-tertiary-hover: #1a5b93;--button-bg-tertiary-hover: #2686d91a;--button-bg-tertiary-active: #2686d926;--button-fg-quaternary-rest: #1f6eb2;--button-fg-quaternary-hover: #175082}a-button[tone=success],a[role=button][data-anta][tone=success]{--button-bg-primary-rest: #2a7e43;--button-bg-primary-hover: #226737;--button-bg-primary-active: #1f5c31;--button-fg-primary-rest: var(--button-primary-fg);--button-bg-secondary-rest: #3295501a;--button-bg-secondary-hover: #32955026;--button-bg-secondary-active: #32955033;--button-fg-secondary-rest: #2a7e43;--button-fg-secondary-hover: #226737;--button-fg-tertiary-rest: #2a7e43;--button-fg-tertiary-hover: #226737;--button-bg-tertiary-hover: #3295501a;--button-bg-tertiary-active: #32955026;--button-fg-quaternary-rest: #2a7e43;--button-fg-quaternary-hover: #1f5c31}a-button[tone=warning],a[role=button][data-anta][tone=warning]{--button-bg-primary-rest: #c37416;--button-bg-primary-hover: #ae6613;--button-bg-primary-active: #995200;--button-fg-primary-rest: var(--button-primary-fg);--button-bg-secondary-rest: #c374161a;--button-bg-secondary-hover: #c3741626;--button-bg-secondary-active: #c3741633;--button-fg-secondary-rest: #c37416;--button-fg-secondary-hover: #ae6613;--button-fg-tertiary-rest: #c37416;--button-fg-tertiary-hover: #ae6613;--button-bg-tertiary-hover: #c374161a;--button-bg-tertiary-active: #c3741633;--button-fg-quaternary-rest: #c37416;--button-fg-quaternary-hover: #995200}.dark a-button,.dark a[role=button][data-anta]{--bg-primary-disabled: #272329;--bg-secondary-disabled: #1d1a1e;--fg-disabled-primary: #776e77;--fg-disabled: #635b65;--button-bg-primary-rest: #534c57;--button-bg-primary-hover: #635b65;--button-bg-primary-active: #938d96;--button-bg-secondary-rest: #e4d1ef1c;--button-bg-secondary-hover: #e4d1ef24;--button-bg-secondary-active: #e4d1ef2e;--button-fg-secondary-rest: #c1b9c1;--button-fg-secondary-hover: #d4ced4;--button-fg-secondary-l-shift: 0;--button-fg-tertiary-rest: #afa9b1;--button-fg-tertiary-hover: #afa9b1;--button-bg-tertiary-hover: #e4d1ef14;--button-bg-tertiary-active: #e4d1ef21;--button-fg-quaternary-rest: #afa9b1;--button-fg-quaternary-hover: #cac4ca}.dark a-button[tone=brand],.dark a[role=button][data-anta][tone=brand]{--button-bg-primary-rest: #503cb4;--button-bg-primary-hover: #5f4bc3;--button-bg-primary-active: #7460d7;--button-bg-secondary-rest: #7460d73b;--button-bg-secondary-hover: #7460d747;--button-bg-secondary-active: #7460d754;--button-fg-secondary-rest: #c5baff;--button-fg-secondary-hover: #d2cbf6;--button-fg-tertiary-rest: #ada0ee;--button-fg-tertiary-hover: #bcb1f1;--button-bg-tertiary-hover: #7460d73b;--button-bg-tertiary-active: #7460d747;--button-fg-quaternary-rest: #ada0ee;--button-fg-quaternary-hover: #c7bef4}.dark a-button[tone=critical],.dark a[role=button][data-anta][tone=critical]{--button-bg-primary-rest: #b02120;--button-bg-primary-hover: #c9302c;--button-bg-primary-active: #de4545;--button-bg-secondary-rest: #de45453b;--button-bg-secondary-hover: #de454547;--button-bg-secondary-active: #de454554;--button-fg-secondary-rest: #ffabac;--button-fg-secondary-hover: #f4c2c2;--button-fg-tertiary-rest: #e78e90;--button-fg-tertiary-hover: #efa4a4;--button-bg-tertiary-hover: #de45453b;--button-bg-tertiary-active: #de454547;--button-fg-quaternary-rest: #e78e90;--button-fg-quaternary-hover: #ffabac}.dark a-button[tone=info],.dark a[role=button][data-anta][tone=info]{--button-bg-primary-rest: #1a5b93;--button-bg-primary-hover: #1f6eb2;--button-bg-primary-active: #2686d9;--button-bg-secondary-rest: #2686d93b;--button-bg-secondary-hover: #2686d947;--button-bg-secondary-active: #2686d954;--button-fg-secondary-rest: #9ed2ff;--button-fg-secondary-hover: #bad6f3;--button-fg-tertiary-rest: #7db6e8;--button-fg-tertiary-hover: #93c5ec;--button-bg-tertiary-hover: #2686d93b;--button-bg-tertiary-active: #2686d947;--button-fg-quaternary-rest: #7db6e8;--button-fg-quaternary-hover: #a6cdef}.dark a-button[tone=success],.dark a[role=button][data-anta][tone=success]{--button-bg-primary-rest: #226737;--button-bg-primary-hover: #2a7e43;--button-bg-primary-active: #329550;--button-bg-secondary-rest: #3295503b;--button-bg-secondary-hover: #32955047;--button-bg-secondary-active: #32955054;--button-fg-secondary-rest: #8ceca9;--button-fg-secondary-hover: #b3e5c2;--button-fg-tertiary-rest: #74cd8e;--button-fg-tertiary-hover: #88d7a0;--button-bg-tertiary-hover: #3295503b;--button-bg-tertiary-active: #32955047;--button-fg-quaternary-rest: #74cd8e;--button-fg-quaternary-hover: #9ddeb1}.dark a-button[tone=warning],.dark a[role=button][data-anta][tone=warning]{--button-bg-primary-rest: #7f410b;--button-bg-primary-hover: #995200;--button-bg-primary-active: #ae6613;--button-bg-secondary-rest: #c374163b;--button-bg-secondary-hover: #c3741647;--button-bg-secondary-active: #c3741654;--button-fg-secondary-rest: #f7c06e;--button-fg-secondary-hover: #f3cc91;--button-fg-tertiary-rest: #e1a452;--button-fg-tertiary-hover: #edb25a;--button-bg-tertiary-hover: #c374163b;--button-bg-tertiary-active: #c3741647;--button-fg-quaternary-rest: #e1a452;--button-fg-quaternary-hover: #f0bf75}a-button,a[role=button][data-anta]{user-select:none;display:inline-flex;align-items:center;gap:.5ch;overflow:hidden;cursor:pointer;flex-shrink:0;color:var(--button-fg);background-color:var(--button-bg);border-radius:4px;text-decoration:none;box-shadow:inset 0 0 1px color-mix(in oklch,currentColor,transparent 90%);font-size:var(--_fs);font-family:var(--sans-serif);font-weight:450;font-variation-settings:"wdth" 88,"slnt" 0,"ital" 0;font-feature-settings:"ss02","ss05","tnum";line-height:var(--_lh);letter-spacing:.05ch;text-overflow:ellipsis;text-wrap:nowrap;white-space:nowrap;max-width:var(--button-max-width);max-height:var(--button-max-height);padding-inline:var(--button-padding-x);padding-block:var(--button-padding-y);min-height:28px;>a-button-label{display:inline-block;text-overflow:ellipsis;text-wrap:nowrap;white-space:nowrap;overflow:hidden;min-width:0;line-height:var(--_lh);padding-bottom:var(--_pb);&:has(>*){display:inline-flex;gap:.25ch}}>*{pointer-events:none}& a-icon{transition:color var(--button-timing-out)}transition:color var(--button-timing-out),background-color var(--button-timing-out);&:hover,&:focus-visible{transition:color var(--button-timing-in),background-color var(--button-timing-in);& a-icon{transition:color var(--button-timing-in)}}&:active,&[selected]{transition:color var(--button-timing-active),background-color var(--button-timing-active);& a-icon{transition:color var(--button-timing-active)}}&[disabled]{pointer-events:none;cursor:not-allowed;transition:none;& a-icon{transition:none}}&:focus-visible{outline:1px solid var(--focus-ring);outline-offset:1px}&[priority=quaternary]{--button-timing-in: 0s;--button-timing-active: 0s;--button-timing-out: 0s}&[size=small]{--button-padding-x: 7px;--_fs: 13px;--_lh: 16px;--_pb: .5px;min-height:24px;& a-icon{--icon-size: 14px}}&[size=large]{--button-padding-x: 13px;--_fs: 17px;--_lh: 24px;--_pb: 1.5px;min-height:32px;& a-icon{--icon-size: 18px}}&[priority=tertiary],&[priority=quaternary]{&[underline=solid]{text-decoration:underline solid}&[underline=dashed]{text-decoration:underline dashed}&[underline=dotted]{text-decoration:underline dotted}&[underline]{text-decoration-color:color-mix(in srgb,currentColor 75%,transparent);text-decoration-thickness:1px;text-underline-offset:3px;&[selected]{text-decoration-color:var(--button-fg);text-decoration-thickness:1px}@media(hover:hover)and (pointer:fine){&:hover{text-decoration-color:var(--button-fg);text-decoration-thickness:1px}}}}&[priority=quaternary][paddingless]{--button-padding-x: 0;--button-padding-y: 0;min-height:0}&:has(>a-icon):not(:has(>a-icon~a-icon)):not(:has(>:not(a-icon):not(a-tooltip))){--button-padding-y: 5px;--button-padding-x: 5px;min-width:28px;justify-content:center;&[size=small]{--button-padding-y: 3px;--button-padding-x: 3px;min-width:24px}&[size=large]{--button-padding-y: 7px;--button-padding-x: 7px;min-width:32px}}&:is(:has(>a-icon:first-child),:has(>a-tooltip:first-child+a-icon)):is(:has(>a-icon~a-icon),:has(>:not(a-icon):not(a-tooltip))){padding-inline-start:max(0px,var(--button-padding-x) - 2px)}&:is(:has(>a-icon:last-child),:has(>a-icon+a-tooltip:last-child)):is(:has(>a-icon~a-icon),:has(>:not(a-icon):not(a-tooltip))){padding-inline-end:max(0px,var(--button-padding-x) - 2px)}&[loading]{position:relative;pointer-events:none;cursor:wait;&:before{content:"";position:absolute;top:0;bottom:0;left:calc(0px - var(--button-loading-x-period));right:0;pointer-events:none;background:repeating-linear-gradient(var(--button-loading-angle),transparent 0,transparent var(--button-loading-stripe-gap),currentColor var(--button-loading-stripe-gap),currentColor calc(var(--button-loading-stripe-gap) + var(--button-loading-stripe)));opacity:var(--button-loading-opacity);filter:blur(var(--button-loading-blur));will-change:transform;animation:btn-loading-slide var(--button-loading-duration) linear infinite;animation-delay:-9999s}}&[tone]:not([tone=""],[tone=brand],[tone=neutral],[tone=critical],[tone=info],[tone=success],[tone=warning]){--button-tone-source: attr(tone type(<color>), transparent);--_tone-fg-l: .46;--_tone-fg-strong-l: .4;--_tone-fg-c: .17;--_tone-bg-l: .54;--_tone-bg-c: .16;--_tone-bg-a-rest: .1;--_tone-bg-a-hover: .15;--_tone-bg-a-active: .2;--_tone-primary-l-rest: .5;--_tone-primary-l-hover: .45;--_tone-primary-l-active: .4;--button-bg-primary-rest: oklch(from var(--button-tone-source) var(--_tone-primary-l-rest) c h);--button-bg-primary-hover: oklch(from var(--button-tone-source) var(--_tone-primary-l-hover) c h);--button-bg-primary-active: oklch(from var(--button-tone-source) var(--_tone-primary-l-active) c h);--button-fg-primary-rest: var(--button-primary-fg);--button-fg-secondary-rest: oklch(from var(--button-tone-source) var(--_tone-fg-l) var(--_tone-fg-c) h);--button-fg-secondary-hover: oklch(from var(--button-tone-source) var(--_tone-fg-strong-l) var(--_tone-fg-c) h);--button-fg-tertiary-rest: oklch(from var(--button-tone-source) var(--_tone-fg-l) var(--_tone-fg-c) h);--button-fg-tertiary-hover: oklch(from var(--button-tone-source) var(--_tone-fg-strong-l) var(--_tone-fg-c) h);--button-fg-quaternary-rest: oklch(from var(--button-tone-source) var(--_tone-fg-l) var(--_tone-fg-c) h);--button-fg-quaternary-hover: oklch(from var(--button-tone-source) var(--_tone-fg-strong-l) var(--_tone-fg-c) h);--button-bg-secondary-rest: oklch(from var(--button-tone-source) var(--_tone-bg-l) var(--_tone-bg-c) h / var(--_tone-bg-a-rest));--button-bg-secondary-hover: oklch(from var(--button-tone-source) var(--_tone-bg-l) var(--_tone-bg-c) h / var(--_tone-bg-a-hover));--button-bg-secondary-active: oklch(from var(--button-tone-source) var(--_tone-bg-l) var(--_tone-bg-c) h / var(--_tone-bg-a-active));--button-bg-tertiary-hover: oklch(from var(--button-tone-source) var(--_tone-bg-l) var(--_tone-bg-c) h / var(--_tone-bg-a-rest));--button-bg-tertiary-active: oklch(from var(--button-tone-source) var(--_tone-bg-l) var(--_tone-bg-c) h / var(--_tone-bg-a-hover))}.dark &[tone]:not([tone=""],[tone=brand],[tone=neutral],[tone=critical],[tone=info],[tone=success],[tone=warning]){--_tone-fg-l: .78;--_tone-fg-strong-l: .85;--_tone-fg-c: .11;--_tone-bg-l: .58;--_tone-bg-a-rest: .23;--_tone-bg-a-hover: .28;--_tone-bg-a-active: .33;--_tone-primary-l-rest: .45;--_tone-primary-l-hover: .5;--_tone-primary-l-active: .57}--button-fg: oklch(from var(--button-fg-secondary-rest) calc(l - var(--button-fg-secondary-l-shift)) c h);--button-bg: var(--button-bg-secondary-rest);@media(hover:hover)and (pointer:fine){&:hover{--button-fg: var(--button-fg-secondary-hover);--button-bg: var(--button-bg-secondary-hover)}}&:active,&[selected]{--button-fg: var(--button-fg-secondary-hover);--button-bg: var(--button-bg-secondary-active)}&[priority=primary]{--button-fg: var(--button-fg-primary-rest);--button-bg: var(--button-bg-primary-rest);box-shadow:none;@media(hover:hover)and (pointer:fine){&:hover{--button-bg: var(--button-bg-primary-hover)}}&:active,&[selected]{--button-bg: var(--button-bg-primary-active)}}&[priority=tertiary]{--button-fg: var(--button-fg-tertiary-rest);--button-bg: transparent;box-shadow:none;@media(hover:hover)and (pointer:fine){&:hover{--button-fg: var(--button-fg-tertiary-hover);--button-bg: var(--button-bg-tertiary-hover)}}&:active,&[selected]{--button-fg: var(--button-fg-tertiary-hover);--button-bg: var(--button-bg-tertiary-active)}}&[priority=quaternary]{--button-fg: var(--button-fg-quaternary-rest);--button-bg: transparent;box-shadow:none;font-weight:400;letter-spacing:.06ch;@media(hover:hover)and (pointer:fine){&:hover{--button-fg: var(--button-fg-quaternary-hover)}}&[selected]{--button-fg: var(--button-fg-quaternary-hover)}&:active{--button-fg: oklch(from var(--button-fg-quaternary-rest) calc(l + .05) c h)}.dark &:active{--button-fg: var(--button-fg-quaternary-rest)}}&[selected]{box-shadow:inset 0 0 0 1px currentColor}&[disabled]{background-color:var(--bg-secondary-disabled);color:var(--fg-disabled);&[priority=primary]{background-color:var(--bg-primary-disabled);color:var(--fg-disabled-primary)}&[priority=tertiary],&[priority=quaternary]{background-color:transparent;color:var(--fg-disabled)}}}}@keyframes btn-loading-slide{to{transform:translate(var(--button-loading-x-period))}}
|