@antadesign/anta 0.3.3 → 0.3.4
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 +0 -4
- package/dist/anta_helpers.js +0 -7
- package/dist/components/Calendar.d.ts +6 -1
- package/dist/components/Calendar.js +6 -0
- package/dist/components/InputDate.d.ts +7 -5
- package/dist/components/InputDate.js +100 -105
- package/dist/components/Menu.d.ts +9 -0
- package/dist/components/MenuItem.js +1 -7
- package/dist/components/Select.d.ts +72 -8
- package/dist/components/Select.js +57 -6
- package/dist/components/TabPanel.d.ts +21 -13
- package/dist/components/TabPanel.js +13 -2
- package/dist/components/Tabs.d.ts +70 -52
- package/dist/components/Tabs.js +15 -85
- package/dist/elements/a-checkbox.css +1 -1
- package/dist/elements/a-input.css +1 -1
- package/dist/elements/a-input.js +1 -0
- package/dist/elements/a-menu-item.css +1 -1
- package/dist/elements/a-menu-item.d.ts +8 -6
- package/dist/elements/a-menu.d.ts +13 -15
- package/dist/elements/a-menu.js +60 -24
- package/dist/elements/a-radio.css +1 -1
- package/dist/elements/a-tabpanel.css +1 -1
- package/dist/elements/a-tabpanel.d.ts +17 -0
- package/dist/elements/a-tabpanel.js +66 -0
- package/dist/elements/index.d.ts +1 -1
- package/dist/elements/index.js +3 -1
- package/dist/general_types.d.ts +31 -11
- package/dist/index.d.ts +3 -5
- package/dist/index.js +2 -3
- package/package.json +1 -1
|
@@ -1,22 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
*
|
|
1
|
+
/**
|
|
2
|
+
* A tab panel inside `<Tabs>`. Renders a self-managing `<a-tabpanel>` — the element
|
|
3
|
+
* finds its `<a-tabs>` (its flat sibling under the same parent — `Tabs` renders the
|
|
4
|
+
* strip and panels with no wrapper), matches by `value`, and shows/hides itself
|
|
5
|
+
* off-DOM. This wrapper is a pure projection: it sets the static ARIA (`role`,
|
|
6
|
+
* `tabindex`, `value`) and passes `children` straight through; `Tabs` never reads
|
|
7
|
+
* or toggles it.
|
|
8
|
+
*
|
|
9
|
+
* Use it as a direct child of `<Tabs>`, paired to an `options` entry by `value`.
|
|
10
|
+
* For a strip and panels in different layout regions (no shared parent), or to
|
|
11
|
+
* unmount an inactive panel (the old `mounting="active" | "lazy"`), drive selection
|
|
12
|
+
* with a controlled `value` and render the content yourself — see the Tabs docs.
|
|
13
|
+
*/
|
|
5
14
|
export interface TabPanelProps {
|
|
6
|
-
/** Pairs this panel with the
|
|
15
|
+
/** Pairs this panel with the tab (`options` entry) of the same `value`. */
|
|
7
16
|
value: string;
|
|
8
17
|
/** Panel content — arbitrary React/Preact. */
|
|
9
18
|
children?: React.ReactNode;
|
|
10
|
-
/**
|
|
11
|
-
|
|
19
|
+
/** How this panel hides while inactive: `display` (default — removed from layout
|
|
20
|
+
* and the a11y tree) or `visibility` (keeps its layout box, to measure it or
|
|
21
|
+
* avoid reflow). Both stay mounted; to *not render* an inactive panel, render it
|
|
22
|
+
* conditionally off a controlled `value` (see the Tabs docs).
|
|
23
|
+
* @defaultValue display */
|
|
24
|
+
hideMode?: "display" | "visibility";
|
|
12
25
|
/** CSS class on the rendered `<a-tabpanel>`. */
|
|
13
26
|
className?: string;
|
|
14
27
|
/** Inline style on the rendered `<a-tabpanel>`. */
|
|
15
28
|
style?: React.CSSProperties;
|
|
16
29
|
}
|
|
17
|
-
|
|
18
|
-
* A tab panel inside `<Tabs>`. Configuration only — `Tabs` reads its props and renders
|
|
19
|
-
* the real `<a-tabpanel>`, so this component itself produces no DOM. Use it as a direct
|
|
20
|
-
* child of `<Tabs>`; rendering it elsewhere does nothing.
|
|
21
|
-
*/
|
|
22
|
-
export declare const TabPanel: (_props: TabPanelProps) => null;
|
|
30
|
+
export declare const TabPanel: ({ value, children, hideMode, className, style }: TabPanelProps) => any;
|
|
@@ -1,5 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const TabPanel =
|
|
1
|
+
import { jsx } from "@antadesign/anta/jsx-runtime";
|
|
2
|
+
const TabPanel = ({ value, children, hideMode, className, style }) => /* @__PURE__ */ jsx(
|
|
3
|
+
"a-tabpanel",
|
|
4
|
+
{
|
|
5
|
+
value,
|
|
6
|
+
role: "tabpanel",
|
|
7
|
+
tabIndex: 0,
|
|
8
|
+
"hide-mode": hideMode === "visibility" ? "visibility" : void 0,
|
|
9
|
+
class: className,
|
|
10
|
+
style,
|
|
11
|
+
children
|
|
12
|
+
}
|
|
13
|
+
);
|
|
3
14
|
export {
|
|
4
15
|
TabPanel
|
|
5
16
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BaseProps } from "../general_types";
|
|
2
|
-
import type {
|
|
2
|
+
import type { IconShape } from "../elements/a-icon.shapes";
|
|
3
3
|
/** The element's `statechange` payload — `next`/`prev` are tab values (`null` = none). */
|
|
4
4
|
type StateDetail = {
|
|
5
5
|
next: string | null;
|
|
@@ -10,44 +10,58 @@ type StateChangeEvent = CustomEvent<StateDetail>;
|
|
|
10
10
|
export interface TabsChangeAttrs {
|
|
11
11
|
value: string | null;
|
|
12
12
|
}
|
|
13
|
-
/** One tab as a plain data object for the `options`
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
export
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
13
|
+
/** One tab as a plain data object for the `options` array — the single source `Tabs`
|
|
14
|
+
* renders its strip from (like `RadioGroup`'s `options`). `Tabs` reads these fields to
|
|
15
|
+
* render the underlying `<a-tab>` (`tabindex`, `role`, and selection are all `Tabs`'
|
|
16
|
+
* job, published off-DOM by the element). */
|
|
17
|
+
export interface TabOption {
|
|
18
|
+
/** This tab's identity — pairs it with the `<TabPanel value="…">` of the same
|
|
19
|
+
* value, and the value reported by `onStateChange` / `onChange`. Unique per strip. */
|
|
20
|
+
value: string;
|
|
21
|
+
/** Visible label. The string shorthand for the tab's content; for richer content
|
|
22
|
+
* pass `children` instead (`label` wins when both are set). */
|
|
23
|
+
label?: React.ReactNode;
|
|
24
|
+
/** Tab content when you need more than a string — used if `label` is omitted. */
|
|
25
|
+
children?: React.ReactNode;
|
|
26
|
+
/** Leading icon shape, rendered before the label. */
|
|
27
|
+
icon?: IconShape;
|
|
28
|
+
/** Trailing icon shape, rendered after the label. */
|
|
29
|
+
iconTrailing?: IconShape;
|
|
30
|
+
/** Fully-round just this tab's box. `<Tabs round>` rounds the whole strip
|
|
31
|
+
* (tabs + sliding indicator) instead. */
|
|
32
|
+
round?: boolean;
|
|
33
|
+
/** Per-tab tone override, same vocabulary as `<Tabs tone>` — colours this one tab's
|
|
34
|
+
* label + icons (all priorities/modes, named or custom colour) and, when it's the
|
|
35
|
+
* active tab, its indicator. For a **custom literal colour** the sliding indicator can't
|
|
36
|
+
* adopt it (the shared moving element can't read a descendant's colour), so a custom tone
|
|
37
|
+
* colours the label everywhere and the indicator only in `noslide`; the six **named**
|
|
38
|
+
* tones colour both in every mode. Overrides the strip's `tone` for this tab.
|
|
39
|
+
* @defaultValue inherits the strip's `tone` */
|
|
40
|
+
tone?: "neutral" | "brand" | "info" | "success" | "warning" | "critical" | (string & {});
|
|
41
|
+
/** Disable just this tab — skipped by keyboard nav and dropped from the tab order
|
|
42
|
+
* (a disabled-but-selected tab stays reachable, per the ARIA pattern). */
|
|
43
|
+
disabled?: boolean;
|
|
44
|
+
}
|
|
29
45
|
/** Public props for `<Tabs>`. */
|
|
30
46
|
export interface TabsProps extends Omit<BaseProps, "onChange"> {
|
|
31
|
-
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
47
|
+
/** Optional `<TabPanel value="…">` panels, one per tab value. Each is a
|
|
48
|
+
* self-managing `<a-tabpanel>` that shows itself when its `value` is the active
|
|
49
|
+
* tab. Omit them to use `Tabs` as a bare selectable strip. To place panels in a
|
|
50
|
+
* different layout region, or to unmount an inactive panel, drive selection with
|
|
51
|
+
* a controlled `value` and render the content yourself (see the docs). */
|
|
36
52
|
children?: React.ReactNode;
|
|
37
|
-
/**
|
|
38
|
-
* `
|
|
39
|
-
*
|
|
40
|
-
* Each entry is a `TabOption` (`value`, `label`, `icon`, `iconTrailing`,
|
|
41
|
-
* `tone`, `disabled`, `round`). */
|
|
53
|
+
/** The tabs, as a data array (the strip's single source). Each entry is a
|
|
54
|
+
* `TabOption` (`value`, `label` or `children`, `icon`, `iconTrailing`, `tone`,
|
|
55
|
+
* `disabled`, `round`). */
|
|
42
56
|
options?: TabOption[];
|
|
43
|
-
/** Controlled active value — the `value`
|
|
44
|
-
* `<TabPanel value="…">` shares it, the panel to reveal). When set, you own
|
|
45
|
-
* the strip renders exactly what this says, and a user pick only
|
|
46
|
-
* via `onStateChange` — apply it by updating this prop
|
|
47
|
-
*
|
|
57
|
+
/** Controlled active value — the tab `value` to mark selected (and, when a
|
|
58
|
+
* `<TabPanel value="…">` shares it, the panel to reveal). When set, you own
|
|
59
|
+
* selection: the strip renders exactly what this says, and a user pick only
|
|
60
|
+
* *requests* a change via `onStateChange` — apply it by updating this prop.
|
|
61
|
+
* Leave undefined (and use `defaultValue`) for uncontrolled. */
|
|
48
62
|
value?: string;
|
|
49
|
-
/** Initial active value for the uncontrolled case
|
|
50
|
-
*
|
|
63
|
+
/** Initial active value for the uncontrolled case. After first render `Tabs`
|
|
64
|
+
* owns selection itself. */
|
|
51
65
|
defaultValue?: string;
|
|
52
66
|
/** Fired whenever the active tab changes — event-first. `detail` is
|
|
53
67
|
* `{ next, prev }` (values; `null` = none). Cancelable: `event.preventDefault()`
|
|
@@ -83,16 +97,13 @@ export interface TabsProps extends Omit<BaseProps, "onChange"> {
|
|
|
83
97
|
* is opt-in via CSS); vertical stacks them.
|
|
84
98
|
* @defaultValue 'horizontal' */
|
|
85
99
|
orientation?: "horizontal" | "vertical";
|
|
86
|
-
/** How inactive panels are mounted/hidden. Per-panel `<TabPanel mounting>` overrides.
|
|
87
|
-
* @defaultValue 'display' */
|
|
88
|
-
mounting?: TabsMounting;
|
|
89
100
|
/** Disable the sliding indicator. By default the selected-tab indicator animates
|
|
90
101
|
* between tabs (a single rectangle, via CSS anchor positioning); `noslide` paints it
|
|
91
102
|
* per tab so it snaps with no movement. (Browsers without anchor positioning get that
|
|
92
103
|
* per-tab paint automatically — `noslide` is the explicit opt-out.) */
|
|
93
104
|
noslide?: boolean;
|
|
94
105
|
/** Fully-round the tabs and the sliding indicator (and the primary track
|
|
95
|
-
* well). Applies strip-wide; a single
|
|
106
|
+
* well). Applies strip-wide; a single tab's `round` rounds just that tab. A
|
|
96
107
|
* `number` (px) or CSS length string sets a custom radius on the top-level
|
|
97
108
|
* track well only — the tab pills + indicator stay fully round. */
|
|
98
109
|
round?: boolean | number | string;
|
|
@@ -100,30 +111,37 @@ export interface TabsProps extends Omit<BaseProps, "onChange"> {
|
|
|
100
111
|
disabled?: boolean;
|
|
101
112
|
}
|
|
102
113
|
/**
|
|
103
|
-
* `<Tabs>` — a tablist with optional panels
|
|
104
|
-
* children.
|
|
114
|
+
* `<Tabs>` — a tablist with optional panels. The strip renders from the `options`
|
|
115
|
+
* array; panels are `<TabPanel>` children that manage their own visibility.
|
|
105
116
|
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
* reflects the current value into panel visibility on re-render.
|
|
117
|
+
* The strip (`<a-tabs>`) and the panels render as flat siblings — there is no wrapper
|
|
118
|
+
* element, so `className` / `id` / `style` / `...rest` land on the strip. Laying the
|
|
119
|
+
* strip out relative to its panels is the consumer's job: a horizontal strip stacks
|
|
120
|
+
* above the panels in normal flow; for a vertical strip beside them, wrap `<Tabs>` in
|
|
121
|
+
* your own flex container. Any non-`TabPanel` children render verbatim as siblings too.
|
|
112
122
|
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
123
|
+
* `<a-tabs>` owns selection off-DOM (it sets each tab's `selected` property and the
|
|
124
|
+
* roving `aria-activedescendant` via `ElementInternals`, writing no attribute to any
|
|
125
|
+
* tab); this wrapper mirrors the value only to render the strip's roving `tabindex`,
|
|
126
|
+
* and the panels read it straight from `<a-tabs>`. Controlled (`value` + `onStateChange`)
|
|
127
|
+
* or uncontrolled (`defaultValue`).
|
|
115
128
|
*
|
|
116
129
|
* Requires `@antadesign/anta/elements` (client-side only).
|
|
117
130
|
*
|
|
118
131
|
* @example
|
|
119
132
|
* ```tsx
|
|
120
|
-
* <Tabs
|
|
121
|
-
*
|
|
122
|
-
*
|
|
133
|
+
* <Tabs
|
|
134
|
+
* defaultValue="account"
|
|
135
|
+
* label="Settings"
|
|
136
|
+
* options={[
|
|
137
|
+
* { value: "account", label: "Account", icon: "user" },
|
|
138
|
+
* { value: "security", label: "Security" },
|
|
139
|
+
* ]}
|
|
140
|
+
* >
|
|
123
141
|
* <TabPanel value="account"><AccountForm /></TabPanel>
|
|
124
142
|
* <TabPanel value="security"><SecurityForm /></TabPanel>
|
|
125
143
|
* </Tabs>
|
|
126
144
|
* ```
|
|
127
145
|
*/
|
|
128
|
-
export declare const Tabs: ({ children, options, value, defaultValue, onStateChange, onChange, onValueChange, onFocus, onBlur, label, priority, tone, size, orientation,
|
|
146
|
+
export declare const Tabs: ({ children, options, value, defaultValue, onStateChange, onChange, onValueChange, onFocus, onBlur, label, priority, tone, size, orientation, noslide, round, disabled, className, style, id, ...rest }: TabsProps) => any;
|
|
129
147
|
export {};
|
package/dist/components/Tabs.js
CHANGED
|
@@ -1,24 +1,6 @@
|
|
|
1
|
-
import { jsx, jsxs } from "@antadesign/anta/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { nativeStateChange, toneStyle, roundStyle, wrapLabel
|
|
4
|
-
import styles from "./Tabs.module.css";
|
|
5
|
-
const flattenChildren = (nodes) => {
|
|
6
|
-
const out = [];
|
|
7
|
-
const visit = (n) => {
|
|
8
|
-
if (n == null || typeof n === "boolean") return;
|
|
9
|
-
if (Array.isArray(n)) {
|
|
10
|
-
n.forEach(visit);
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
if (n && n.type === Fragment) {
|
|
14
|
-
visit(n.props?.children);
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
out.push(n);
|
|
18
|
-
};
|
|
19
|
-
visit(nodes);
|
|
20
|
-
return out;
|
|
21
|
-
};
|
|
1
|
+
import { Fragment, jsx, jsxs } from "@antadesign/anta/jsx-runtime";
|
|
2
|
+
import { useState } from "../jsx-runtime";
|
|
3
|
+
import { nativeStateChange, toneStyle, roundStyle, wrapLabel } from "../anta_helpers";
|
|
22
4
|
const Tabs = ({
|
|
23
5
|
children,
|
|
24
6
|
options,
|
|
@@ -34,7 +16,6 @@ const Tabs = ({
|
|
|
34
16
|
tone,
|
|
35
17
|
size,
|
|
36
18
|
orientation,
|
|
37
|
-
mounting = "display",
|
|
38
19
|
noslide,
|
|
39
20
|
round,
|
|
40
21
|
disabled,
|
|
@@ -46,24 +27,12 @@ const Tabs = ({
|
|
|
46
27
|
const controlled = value !== void 0;
|
|
47
28
|
const [internalValue, setInternalValue] = useState(defaultValue);
|
|
48
29
|
const currentValue = controlled ? value : internalValue;
|
|
49
|
-
const
|
|
50
|
-
() => new Set(currentValue != null ? [currentValue] : [])
|
|
51
|
-
);
|
|
52
|
-
if (currentValue != null && !mounted.has(currentValue)) {
|
|
53
|
-
setMounted((m) => m.has(currentValue) ? m : new Set(m).add(currentValue));
|
|
54
|
-
}
|
|
55
|
-
const baseId = useId();
|
|
56
|
-
const tabId = (v) => `${baseId}-tab-${v}`;
|
|
57
|
-
const panelId = (v) => `${baseId}-panel-${v}`;
|
|
58
|
-
const items = flattenChildren(children);
|
|
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
|
-
const panelValues = new Set(panels.map((pan) => pan.props.value));
|
|
30
|
+
const tabs = options ?? [];
|
|
62
31
|
const seen = /* @__PURE__ */ new Set();
|
|
63
32
|
for (const t of tabs) {
|
|
64
|
-
if (seen.has(t.
|
|
65
|
-
console.warn(`[anta] <Tabs> duplicate
|
|
66
|
-
seen.add(t.
|
|
33
|
+
if (seen.has(t.value))
|
|
34
|
+
console.warn(`[anta] <Tabs> duplicate option value=${JSON.stringify(t.value)} \u2014 values must be unique.`);
|
|
35
|
+
seen.add(t.value);
|
|
67
36
|
}
|
|
68
37
|
const onstatechange = (e) => {
|
|
69
38
|
const { event, detail } = nativeStateChange(e);
|
|
@@ -78,7 +47,6 @@ const Tabs = ({
|
|
|
78
47
|
onValueChange?.(e, { value: e.currentTarget?.value ?? null });
|
|
79
48
|
} : void 0;
|
|
80
49
|
const vertical = orientation === "vertical";
|
|
81
|
-
const needsContainer = panels.length > 0 || vertical;
|
|
82
50
|
const strip = /* @__PURE__ */ jsx(
|
|
83
51
|
"a-tabs",
|
|
84
52
|
{
|
|
@@ -99,24 +67,20 @@ const Tabs = ({
|
|
|
99
67
|
onchange,
|
|
100
68
|
onfocusin: onFocus,
|
|
101
69
|
onfocusout: onBlur,
|
|
102
|
-
class:
|
|
103
|
-
id
|
|
70
|
+
class: className,
|
|
71
|
+
id,
|
|
104
72
|
style: roundStyle(round, "--tabs-round", toneStyle(tone, "--tabs-tone-source", style)),
|
|
105
|
-
...
|
|
106
|
-
children: tabs.map((
|
|
107
|
-
const p = t.props;
|
|
73
|
+
...rest,
|
|
74
|
+
children: tabs.map((p) => {
|
|
108
75
|
const tabDisabled = disabled || p.disabled;
|
|
109
76
|
const isSelected = p.value === currentValue;
|
|
110
|
-
const hasPanel = panelValues.has(p.value);
|
|
111
77
|
return /* @__PURE__ */ jsxs(
|
|
112
78
|
"a-tab",
|
|
113
79
|
{
|
|
114
80
|
role: "tab",
|
|
115
81
|
value: p.value,
|
|
116
|
-
id: tabId(p.value),
|
|
117
82
|
tone: p.tone && p.tone !== "neutral" ? p.tone : void 0,
|
|
118
83
|
style: toneStyle(p.tone, "--tabs-tone-source", void 0),
|
|
119
|
-
"aria-controls": hasPanel ? panelId(p.value) : void 0,
|
|
120
84
|
"aria-disabled": tabDisabled ? "true" : void 0,
|
|
121
85
|
tabIndex: tabDisabled && !isSelected ? -1 : 0,
|
|
122
86
|
disabled: tabDisabled ? "" : void 0,
|
|
@@ -132,44 +96,10 @@ const Tabs = ({
|
|
|
132
96
|
})
|
|
133
97
|
}
|
|
134
98
|
);
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
className: className ? `${styles.container} ${className}` : styles.container,
|
|
140
|
-
"data-orientation": vertical ? "vertical" : void 0,
|
|
141
|
-
id,
|
|
142
|
-
...rest,
|
|
143
|
-
children: [
|
|
144
|
-
strip,
|
|
145
|
-
panels.map((pan) => {
|
|
146
|
-
const p = pan.props;
|
|
147
|
-
const active = p.value === currentValue;
|
|
148
|
-
const mode = p.mounting ?? mounting;
|
|
149
|
-
if (mode === "active" && !active) return null;
|
|
150
|
-
if (mode === "lazy" && !active && !mounted.has(p.value)) return null;
|
|
151
|
-
const hidden = !active;
|
|
152
|
-
const hideByVisibility = hidden && mode === "visibility";
|
|
153
|
-
return /* @__PURE__ */ jsx(
|
|
154
|
-
"a-tabpanel",
|
|
155
|
-
{
|
|
156
|
-
role: "tabpanel",
|
|
157
|
-
id: panelId(p.value),
|
|
158
|
-
"aria-labelledby": tabId(p.value),
|
|
159
|
-
tabIndex: active ? 0 : void 0,
|
|
160
|
-
hidden: hidden && !hideByVisibility ? true : void 0,
|
|
161
|
-
"data-hide": hideByVisibility ? "visibility" : void 0,
|
|
162
|
-
inert: hidden ? true : void 0,
|
|
163
|
-
class: p.className,
|
|
164
|
-
style: p.style,
|
|
165
|
-
children: p.children
|
|
166
|
-
},
|
|
167
|
-
p.value
|
|
168
|
-
);
|
|
169
|
-
})
|
|
170
|
-
]
|
|
171
|
-
}
|
|
172
|
-
);
|
|
99
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
100
|
+
strip,
|
|
101
|
+
children
|
|
102
|
+
] });
|
|
173
103
|
};
|
|
174
104
|
export {
|
|
175
105
|
Tabs
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer anta{a-checkbox{--checkbox-gap: 8px;--checkbox-bg: var(--bg-1);--checkbox-fill: #635b65;--checkbox-fill-hover: #534c57;--checkbox-fill-active: #49424c;--checkbox-border-neutral: #d4ced4;--checkbox-border: var(--checkbox-border-neutral);--checkbox-border-hover: #c1b9c1;--checkbox-border-active: #9f99a1;--checkbox-icon: #ffffff;--checkbox-icon-disabled: #c1b9c1;--checkbox-bg-disabled: color-mix(in oklch, #44374b 10%, transparent);--checkbox-border-disabled: color-mix(in oklch, #44374b 15%, transparent);--checkbox-mask-size: 12px;--checkbox-mask-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");--checkbox-mask-indeterminate: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E");--checkbox-label-color: var(--text-2);--checkbox-label-color-disabled: var(--text-4);--checkbox-hint-color: var(--text-4);--checkbox-label-fs: 15px;--checkbox-label-lh: 20px;--checkbox-hint-fs: 13px;--checkbox-hint-lh: 16px;display:inline-grid;grid-template-columns:auto 1fr;align-items:center;column-gap:var(--checkbox-gap);vertical-align:middle;cursor:pointer;user-select:none;-webkit-user-drag:none;outline:none;color:var(--checkbox-label-color);font-family:var(--sans-serif);font-size:var(--checkbox-label-fs);line-height:var(--checkbox-label-lh);font-feature-settings:"ss02","ss05","tnum";&:before{content:"";grid-column:1;grid-row:1 / -1;align-self:center;box-sizing:border-box;inline-size:16px;block-size:16px;border-radius:4px;background:var(--checkbox-bg);border:1.5px solid var(--checkbox-border);transition:background-color .15s ease-out,border-color .15s ease-out}&[round]{--checkbox-round: attr(round type(<length>), 999px)}&[round]:before{border-radius:var(--checkbox-round, 999px)}&:after{content:"";grid-column:1;grid-row:1 / -1;align-self:center;inline-size:16px;block-size:16px;background-color:transparent;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;-webkit-mask-size:var(--checkbox-mask-size);mask-size:var(--checkbox-mask-size)}@media(hover:hover)and (pointer:fine){&:not(:disabled):hover:before{border-color:var(--checkbox-border-hover);transition:background-color 75ms ease-in,border-color 75ms ease-in}&:not(:disabled):hover:is(:state(checked),:state(indeterminate)):before{background:var(--checkbox-fill-hover);border-color:var(--checkbox-fill-hover)}}&:not(:disabled):active:before{border-color:var(--checkbox-border-active);transition:background-color 50ms linear,border-color 50ms linear}&:not(:disabled):active:is(:state(checked),:state(indeterminate)):before{background:var(--checkbox-fill-active);border-color:var(--checkbox-fill-active)}&:is(:state(checked),:state(indeterminate)){&:before{background:var(--checkbox-fill);border-color:var(--checkbox-fill)}&:after{background-color:var(--checkbox-icon)}}&:state(checked):after{-webkit-mask-image:var(--checkbox-mask-check);mask-image:var(--checkbox-mask-check)}&:state(indeterminate):after{-webkit-mask-image:var(--checkbox-mask-indeterminate);mask-image:var(--checkbox-mask-indeterminate)}&:focus-visible:before{outline:1px solid var(--focus-ring);outline-offset:1px}&:disabled{cursor:not-allowed;color:var(--checkbox-label-color-disabled);&:before{background:var(--checkbox-bg-disabled);border-color:var(--checkbox-border-disabled);transition:none}&:is(:state(checked),:state(indeterminate)):after{background-color:var(--checkbox-icon-disabled)}a-checkbox-hint{color:var(--checkbox-label-color-disabled)}}&[size=small]{--checkbox-gap: 6px;--checkbox-label-fs: 13px;--checkbox-label-lh: 16px;--checkbox-hint-fs: 12px;--checkbox-hint-lh: 14px;--checkbox-mask-size: 10px;&:before,&:after{inline-size:14px;block-size:14px}}&[size=large]{--checkbox-label-fs: 17px;--checkbox-label-lh: 24px;--checkbox-hint-fs: 15px;--checkbox-hint-lh: 19px;--checkbox-mask-size: 14px;&:before,&:after{inline-size:18px;block-size:18px}}}.dark a-checkbox{--checkbox-mask-size: 13px}.dark a-checkbox[size=small]{--checkbox-mask-size: 11px}.dark a-checkbox[size=large]{--checkbox-mask-size: 15px}a-checkbox-label,a-checkbox-hint{display:block;grid-column:2;min-width:0}a-checkbox-hint{color:var(--checkbox-hint-color);font-size:var(--checkbox-hint-fs);line-height:var(--checkbox-hint-lh);margin-block-start:2px}a-checkbox[tone=brand],a-checkbox[tone-selected=brand]{--checkbox-fill: #5f4bc3;--checkbox-fill-hover: #503cb4;--checkbox-fill-active: #483493}a-checkbox[tone=neutral],a-checkbox[tone-selected=neutral]{--checkbox-fill: #635b65;--checkbox-fill-hover: #534c57;--checkbox-fill-active: #49424c}a-checkbox[tone=info],a-checkbox[tone-selected=info]{--checkbox-fill: #1f6eb2;--checkbox-fill-hover: #1a5b93;--checkbox-fill-active: #175082}a-checkbox[tone=success],a-checkbox[tone-selected=success]{--checkbox-fill: #2a7e43;--checkbox-fill-hover: #226737;--checkbox-fill-active: #1f5c31}a-checkbox[tone=warning],a-checkbox[tone-selected=warning]{--checkbox-fill: #c37416;--checkbox-fill-hover: #ae6613;--checkbox-fill-active: #995200}a-checkbox[tone=critical],a-checkbox[tone-selected=critical]{--checkbox-fill: #c9302c;--checkbox-fill-hover: #b02120;--checkbox-fill-active: #a01c1c}a-checkbox[tone]:not([tone=""],[tone=neutral]){--_checkbox-border-base: color-mix(in oklch, var(--checkbox-fill) 70%, var(--checkbox-border-neutral));--checkbox-border: oklch(from var(--_checkbox-border-base) calc(l + .17) c h);--checkbox-border-hover: oklch(from var(--_checkbox-border-base) calc(l + .1) c h);--checkbox-border-active: var(--_checkbox-border-base);.dark &{--checkbox-border: var(--_checkbox-border-base);--checkbox-border-hover: oklch(from var(--_checkbox-border-base) calc(l + .1) c h);--checkbox-border-active: oklch(from var(--_checkbox-border-base) calc(l + .17) c h)}}a-checkbox[tone]:not([tone=""],[tone=brand],[tone=neutral],[tone=info],[tone=success],[tone=warning],[tone=critical]){--checkbox-tone-source: attr(tone type(<color>), transparent)}a-checkbox[tone-selected]:not([tone-selected=""],[tone-selected=brand],[tone-selected=neutral],[tone-selected=info],[tone-selected=success],[tone-selected=warning],[tone-selected=critical]){--checkbox-tone-source: attr(tone-selected type(<color>), transparent)}a-checkbox[tone]:not([tone=""],[tone=brand],[tone=neutral],[tone=info],[tone=success],[tone=warning],[tone=critical]),a-checkbox[tone-selected]:not([tone-selected=""],[tone-selected=brand],[tone-selected=neutral],[tone-selected=info],[tone-selected=success],[tone-selected=warning],[tone-selected=critical]){--_tone-l-rest: .5;--_tone-l-hover: .45;--_tone-l-active: .4;--checkbox-fill: oklch(from var(--checkbox-tone-source) var(--_tone-l-rest) c h);--checkbox-fill-hover: oklch(from var(--checkbox-tone-source) var(--_tone-l-hover) c h);--checkbox-fill-active: oklch(from var(--checkbox-tone-source) var(--_tone-l-active) c h);.dark &{--_tone-l-rest: .45;--_tone-l-hover: .5;--_tone-l-active: .57}}.dark a-checkbox{--checkbox-border-neutral: #49424c;--checkbox-border-hover: #635b65;--checkbox-border-active: #776e77;--checkbox-fill: #534c57;--checkbox-fill-hover: #635b65;--checkbox-fill-active: #938d96;--checkbox-icon-disabled: #635b65;--checkbox-bg-disabled: color-mix(in oklch, #e4d1ef 10%, transparent);--checkbox-border-disabled: color-mix(in oklch, #e4d1ef 15%, transparent)}.dark a-checkbox[tone=brand],.dark a-checkbox[tone-selected=brand]{--checkbox-fill: #503cb4;--checkbox-fill-hover: #5f4bc3;--checkbox-fill-active: #7460d7}.dark a-checkbox[tone=neutral],.dark a-checkbox[tone-selected=neutral]{--checkbox-fill: #534c57;--checkbox-fill-hover: #635b65;--checkbox-fill-active: #938d96}.dark a-checkbox[tone=info],.dark a-checkbox[tone-selected=info]{--checkbox-fill: #1a5b93;--checkbox-fill-hover: #1f6eb2;--checkbox-fill-active: #2686d9}.dark a-checkbox[tone=success],.dark a-checkbox[tone-selected=success]{--checkbox-fill: #226737;--checkbox-fill-hover: #2a7e43;--checkbox-fill-active: #329550}.dark a-checkbox[tone=warning],.dark a-checkbox[tone-selected=warning]{--checkbox-fill: #7f410b;--checkbox-fill-hover: #995200;--checkbox-fill-active: #ae6613}.dark a-checkbox[tone=critical],.dark a-checkbox[tone-selected=critical]{--checkbox-fill: #b02120;--checkbox-fill-hover: #c9302c;--checkbox-fill-active: #de4545}}
|
|
1
|
+
@layer anta{a-checkbox{--checkbox-gap: 8px;--checkbox-box-size: 16px;--checkbox-bg: var(--bg-1);--checkbox-fill: #878089;--checkbox-fill-hover: #776e77;--checkbox-fill-active: #635b65;--checkbox-border-neutral: #d4ced4;--checkbox-border: var(--checkbox-border-neutral);--checkbox-border-hover: #c1b9c1;--checkbox-border-active: #9f99a1;--checkbox-icon: #f1eff1;--checkbox-icon-disabled: #c1b9c1;--checkbox-bg-disabled: color-mix(in oklch, #44374b 10%, transparent);--checkbox-border-disabled: color-mix(in oklch, #44374b 10%, transparent);--checkbox-mask-size: 12px;--checkbox-mask-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");--checkbox-mask-indeterminate: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E");--checkbox-label-color: var(--text-2);--checkbox-label-color-disabled: var(--text-4);--checkbox-hint-color: var(--text-3);--checkbox-label-fs: 15px;--checkbox-label-lh: 20px;--checkbox-hint-fs: 13px;--checkbox-hint-lh: 16px;display:inline-grid;grid-template-columns:auto 1fr;align-items:start;column-gap:var(--checkbox-gap);vertical-align:middle;cursor:pointer;user-select:none;-webkit-user-drag:none;outline:none;color:var(--checkbox-label-color);font-family:var(--sans-serif);font-size:var(--checkbox-label-fs);line-height:var(--checkbox-label-lh);font-feature-settings:"ss02","ss05","tnum";&:before{content:"";grid-column:1;grid-row:1 / -1;align-self:start;margin-block-start:calc((var(--checkbox-label-lh) - var(--checkbox-box-size)) / 2);box-sizing:border-box;inline-size:16px;block-size:16px;border-radius:4px;background:var(--checkbox-bg);border:1.5px solid var(--checkbox-border);transition:background-color .15s ease-out,border-color .15s ease-out}&[round]{--checkbox-round: attr(round type(<length>), 999px)}&[round]:before{border-radius:var(--checkbox-round, 999px)}&:after{content:"";grid-column:1;grid-row:1 / -1;align-self:start;margin-block-start:calc((var(--checkbox-label-lh) - var(--checkbox-box-size)) / 2);inline-size:16px;block-size:16px;background-color:transparent;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;-webkit-mask-size:var(--checkbox-mask-size);mask-size:var(--checkbox-mask-size)}@media(hover:hover)and (pointer:fine){&:not(:disabled):hover:before{border-color:var(--checkbox-border-hover);transition:background-color 75ms ease-in,border-color 75ms ease-in}&:not(:disabled):hover:is(:state(checked),:state(indeterminate)):before{background:var(--checkbox-fill-hover);border-color:var(--checkbox-fill-hover)}}&:not(:disabled):active:before{border-color:var(--checkbox-border-active);transition:background-color 50ms linear,border-color 50ms linear}&:not(:disabled):active:is(:state(checked),:state(indeterminate)):before{background:var(--checkbox-fill-active);border-color:var(--checkbox-fill-active)}&:is(:state(checked),:state(indeterminate)){&:before{background:var(--checkbox-fill);border-color:var(--checkbox-fill)}&:after{background-color:var(--checkbox-icon)}}&:state(checked):after{-webkit-mask-image:var(--checkbox-mask-check);mask-image:var(--checkbox-mask-check)}&:state(indeterminate):after{-webkit-mask-image:var(--checkbox-mask-indeterminate);mask-image:var(--checkbox-mask-indeterminate)}&:focus-visible:before{outline:1px solid var(--focus-ring);outline-offset:1px}&:disabled{cursor:not-allowed;color:var(--checkbox-label-color-disabled);&:before{background:var(--checkbox-bg-disabled);border-color:var(--checkbox-border-disabled);transition:none}&:is(:state(checked),:state(indeterminate)):after{background-color:var(--checkbox-icon-disabled)}a-checkbox-hint{color:var(--checkbox-label-color-disabled)}}&[size=small]{--checkbox-gap: 6px;--checkbox-box-size: 14px;--checkbox-label-fs: 13px;--checkbox-label-lh: 16px;--checkbox-hint-fs: 12px;--checkbox-hint-lh: 14px;--checkbox-mask-size: 10px;&:before,&:after{inline-size:14px;block-size:14px}}&[size=large]{--checkbox-box-size: 18px;--checkbox-label-fs: 17px;--checkbox-label-lh: 22px;--checkbox-hint-fs: 15px;--checkbox-hint-lh: 19px;--checkbox-mask-size: 14px;&:before,&:after{inline-size:18px;block-size:18px}}}.dark a-checkbox{--checkbox-mask-size: 13px}.dark a-checkbox[size=small]{--checkbox-mask-size: 11px}.dark a-checkbox[size=large]{--checkbox-mask-size: 15px}a-checkbox-label,a-checkbox-hint{display:block;grid-column:2;min-width:0}a-checkbox-hint{color:var(--checkbox-hint-color);font-size:var(--checkbox-hint-fs);line-height:var(--checkbox-hint-lh);margin-block-start:2px}a-checkbox[tone=brand],a-checkbox[tone-selected=brand]{--checkbox-fill: #5f4bc3;--checkbox-fill-hover: #503cb4;--checkbox-fill-active: #483493}a-checkbox[tone=neutral],a-checkbox[tone-selected=neutral]{--checkbox-fill: #878089;--checkbox-fill-hover: #776e77;--checkbox-fill-active: #635b65}a-checkbox[tone=info],a-checkbox[tone-selected=info]{--checkbox-fill: #1f6eb2;--checkbox-fill-hover: #1a5b93;--checkbox-fill-active: #175082}a-checkbox[tone=success],a-checkbox[tone-selected=success]{--checkbox-fill: #2a7e43;--checkbox-fill-hover: #226737;--checkbox-fill-active: #1f5c31}a-checkbox[tone=warning],a-checkbox[tone-selected=warning]{--checkbox-fill: #c37416;--checkbox-fill-hover: #ae6613;--checkbox-fill-active: #995200}a-checkbox[tone=critical],a-checkbox[tone-selected=critical]{--checkbox-fill: #c9302c;--checkbox-fill-hover: #b02120;--checkbox-fill-active: #a01c1c}a-checkbox[tone=brand]{--checkbox-bg: #fcfcfe;--checkbox-border: #bcb1f1;--checkbox-border-hover: #9e8eeb;--checkbox-border-active: #9081df}a-checkbox[tone=info]{--checkbox-bg: #fbfcfe;--checkbox-border: #93c5ec;--checkbox-border-hover: #69ace5;--checkbox-border-active: #56a1e1}a-checkbox[tone=success]{--checkbox-bg: #f7fcf9;--checkbox-border: #88d7a0;--checkbox-border-hover: #5bc87b;--checkbox-border-active: #44c169}a-checkbox[tone=warning]{--checkbox-bg: #fefbf6;--checkbox-border: #edb25a;--checkbox-border-hover: #e09127;--checkbox-border-active: #d88118}a-checkbox[tone=critical]{--checkbox-bg: #fefbfb;--checkbox-border: #efa4a4;--checkbox-border-hover: #e87f7f;--checkbox-border-active: #e56c6c}a-checkbox[tone]:not([tone=""],[tone=neutral],[tone=brand],[tone=info],[tone=success],[tone=warning],[tone=critical]){--checkbox-bg: oklch(from var(--checkbox-tone-source) .99 calc(c*.03) h);--_checkbox-border-base: color-mix(in oklch, var(--checkbox-fill) 70%, var(--checkbox-border-neutral));--checkbox-border: oklch(from var(--_checkbox-border-base) calc(l + .17) c h);--checkbox-border-hover: oklch(from var(--_checkbox-border-base) calc(l + .1) c h);--checkbox-border-active: var(--_checkbox-border-base);.dark &{--checkbox-bg: oklch(from var(--checkbox-tone-source) .15 calc(c*.18) h);--checkbox-border: var(--_checkbox-border-base);--checkbox-border-hover: oklch(from var(--_checkbox-border-base) calc(l + .1) c h);--checkbox-border-active: oklch(from var(--_checkbox-border-base) calc(l + .17) c h)}}a-checkbox[tone]:not([tone=""],[tone=brand],[tone=neutral],[tone=info],[tone=success],[tone=warning],[tone=critical]){--checkbox-tone-source: attr(tone type(<color>), transparent)}a-checkbox[tone-selected]:not([tone-selected=""],[tone-selected=brand],[tone-selected=neutral],[tone-selected=info],[tone-selected=success],[tone-selected=warning],[tone-selected=critical]){--checkbox-tone-source: attr(tone-selected type(<color>), transparent)}a-checkbox[tone]:not([tone=""],[tone=brand],[tone=neutral],[tone=info],[tone=success],[tone=warning],[tone=critical]),a-checkbox[tone-selected]:not([tone-selected=""],[tone-selected=brand],[tone-selected=neutral],[tone-selected=info],[tone-selected=success],[tone-selected=warning],[tone-selected=critical]){--_tone-l-rest: .5;--_tone-l-hover: .45;--_tone-l-active: .4;--checkbox-fill: oklch(from var(--checkbox-tone-source) var(--_tone-l-rest) c h);--checkbox-fill-hover: oklch(from var(--checkbox-tone-source) var(--_tone-l-hover) c h);--checkbox-fill-active: oklch(from var(--checkbox-tone-source) var(--_tone-l-active) c h);.dark &{--_tone-l-rest: .45;--_tone-l-hover: .5;--_tone-l-active: .57}}.dark a-checkbox{--checkbox-border-neutral: #49424c;--checkbox-border-hover: #635b65;--checkbox-border-active: #776e77;--checkbox-fill: #49424c;--checkbox-fill-hover: #534c57;--checkbox-fill-active: #635b65;--checkbox-icon: #d4ced4;--checkbox-icon-disabled: #534c57;--checkbox-bg-disabled: color-mix(in oklch, #e4d1ef 10%, transparent);--checkbox-border-disabled: color-mix(in oklch, #e4d1ef 10%, transparent)}.dark a-checkbox[tone=brand],.dark a-checkbox[tone-selected=brand]{--checkbox-fill: #503cb4;--checkbox-fill-hover: #5f4bc3;--checkbox-fill-active: #7460d7}.dark a-checkbox[tone=neutral],.dark a-checkbox[tone-selected=neutral]{--checkbox-fill: #49424c;--checkbox-fill-hover: #534c57;--checkbox-fill-active: #635b65}.dark a-checkbox[tone=info],.dark a-checkbox[tone-selected=info]{--checkbox-fill: #1a5b93;--checkbox-fill-hover: #1f6eb2;--checkbox-fill-active: #2686d9}.dark a-checkbox[tone=success],.dark a-checkbox[tone-selected=success]{--checkbox-fill: #226737;--checkbox-fill-hover: #2a7e43;--checkbox-fill-active: #329550}.dark a-checkbox[tone=warning],.dark a-checkbox[tone-selected=warning]{--checkbox-fill: #7f410b;--checkbox-fill-hover: #995200;--checkbox-fill-active: #ae6613}.dark a-checkbox[tone=critical],.dark a-checkbox[tone-selected=critical]{--checkbox-fill: #b02120;--checkbox-fill-hover: #c9302c;--checkbox-fill-active: #de4545}.dark a-checkbox[tone=brand]{--checkbox-bg: #0b0916;--checkbox-border: #483493;--checkbox-border-hover: #5f4bc3;--checkbox-border-active: #7460d7}.dark a-checkbox[tone=info]{--checkbox-bg: #040d18;--checkbox-border: #175082;--checkbox-border-hover: #1f6eb2;--checkbox-border-active: #2686d9}.dark a-checkbox[tone=success]{--checkbox-bg: #041008;--checkbox-border: #1f5c31;--checkbox-border-hover: #2a7e43;--checkbox-border-active: #329550}.dark a-checkbox[tone=warning]{--checkbox-bg: #120a03;--checkbox-border: #6a3b0c;--checkbox-border-hover: #995200;--checkbox-border-active: #ae6613}.dark a-checkbox[tone=critical]{--checkbox-bg: #190405;--checkbox-border: #a01c1c;--checkbox-border-hover: #c9302c;--checkbox-border-active: #de4545}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer anta{a-input:not(:defined){display:grid;grid-template-columns:minmax(0,1fr);row-gap:4px}a-input:not(:defined):after{content:
|
|
1
|
+
@layer anta{a-input:not(:defined){display:grid;grid-template-columns:minmax(0,1fr);row-gap:4px}a-input:not(:defined)>[slot=leading],a-input:not(:defined)>[slot=trailing],a-input:not(:defined)>[slot=clear],a-input:not(:defined)>[slot=hint]{display:none!important}a-input:not(:defined)>[slot=label]{display:block;color:var(--input-label);font-family:var(--sans-serif);font-size:15px;line-height:20px;font-weight:500}a-input[size=small]:not(:defined)>[slot=label]{font-size:13px;line-height:16px}a-input[size=large]:not(:defined)>[slot=label]{font-size:17px;line-height:22px}a-input:not(:defined):after{content:attr(placeholder);display:block;min-height:28px;line-height:28px;padding-inline:7px;border-radius:4px;box-shadow:inset 0 0 0 .5px var(--input-border);color:var(--input-placeholder);font-family:var(--sans-serif);font-size:15px;font-weight:400;font-feature-settings:"ss02","ss05","tnum";font-variation-settings:"wdth" 100,"slnt" 0,"ital" 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}a-input[value]:not([value=""]):not([type=password]):not(:defined):after{content:attr(value);color:var(--input-text)}a-input[size=small]:not(:defined):after{min-height:24px;line-height:24px;font-size:13px}a-input[size=large]:not(:defined):after{min-height:32px;line-height:32px;font-size:17px}a-input[round]:not(:defined):after{border-radius:var(--input-round, 999px)}a-input{transition:opacity .28s ease-out 40ms}a-input:not(:defined){opacity:.5}@media(prefers-reduced-motion:reduce){a-input{transition:none}}a-input{--input-bg: var(--bg-1);--input-border: var(--border-2);--input-border-hover: var(--border-1);--input-text: var(--text-1);--input-label: var(--text-3);--input-placeholder: var(--text-4);--input-adornment: var(--text-4);--input-hint: var(--text-3);width:100%}a-input[round]{--input-round: attr(round type(<length>), 999px)}a-input[tone]:not([tone=""]){--input-tone-source: attr(tone type(<color>), var(--border-2));--input-border: oklch(from var(--input-tone-source) .7 calc(c*.8) h);--input-border-hover: oklch(from var(--input-tone-source) .6 c h);.dark &{--input-border: oklch(from var(--input-tone-source) .5 calc(c*.8) h);--input-border-hover: oklch(from var(--input-tone-source) .6 c h)}}a-input[status=critical]{--input-bg: #fefbfb;--input-border: #de4545;--input-border-hover: #de4545;--input-hint: #c9302c}a-input[status=warning]{--input-bg: #fefbf6;--input-border: #ae6613;--input-border-hover: #ae6613;--input-hint: #995200}a-input[status=success]{--input-bg: #f7fcf9;--input-border: #329550;--input-border-hover: #329550;--input-hint: #2a7e43}a-input[status=info]{--input-bg: #fbfcfe;--input-border: #2686d9;--input-border-hover: #2686d9;--input-hint: #175082}a-input[status=brand]{--input-bg: #fcfcfe;--input-border: #7460d7;--input-border-hover: #7460d7;--input-hint: #5f4bc3}.dark a-input[status=critical]{--input-bg: #1f0506;--input-border: #c9302c;--input-border-hover: #c9302c;--input-hint: #e25858}.dark a-input[status=warning]{--input-bg: #120a03;--input-border: #995200;--input-border-hover: #995200;--input-hint: #c37416}.dark a-input[status=success]{--input-bg: #041008;--input-border: #2a7e43;--input-border-hover: #2a7e43;--input-hint: #3aab5c}.dark a-input[status=info]{--input-bg: #040d18;--input-border: #1f6eb2;--input-border-hover: #1f6eb2;--input-hint: #3e93dd}.dark a-input[status=brand]{--input-bg: #0b0916;--input-border: #5f4bc3;--input-border-hover: #5f4bc3;--input-hint: #8270db}a-input:disabled{--input-bg: #44374b12;--input-border: #44374b26;--input-border-hover: #44374b26;--input-text: var(--text-4);--input-label: var(--text-4);--input-hint: var(--text-5);cursor:not-allowed}a-input[status]:disabled{--input-bg: #44374b12;--input-border: #44374b26;--input-border-hover: #44374b26;--input-hint: var(--text-5)}.dark a-input:disabled{--input-bg: #e4d1ef0d;--input-border: #e4d1ef1f;--input-border-hover: #e4d1ef1f}.dark a-input[status]:disabled{--input-bg: #e4d1ef0d;--input-border: #e4d1ef1f;--input-border-hover: #e4d1ef1f;--input-hint: var(--text-5)}a-input[size=small] a-icon{--icon-size: 14px}a-input[size=large] a-icon{--icon-size: 18px}a-input [slot=hint]>a-icon{margin-block-start:1px}a-input[size=small] [slot=hint]>a-icon{margin-block-start:.5px}a-input[size=large] [slot=hint]>a-icon{margin-block-start:1.5px}.dark a-input:not([status]){--input-border: #49424c;--input-border-hover: #635b65}.dark a-input[status=success]{--input-border: var(--border-1-success);--input-border-hover: var(--border-1-success)}}
|
package/dist/elements/a-input.js
CHANGED
|
@@ -92,6 +92,7 @@ const SHADOW_STYLE = `
|
|
|
92
92
|
color: var(--input-text);
|
|
93
93
|
font-family: var(--sans-serif);
|
|
94
94
|
font-feature-settings: 'ss02', 'ss05', 'tnum';
|
|
95
|
+
font-variation-settings: 'wdth' 100, 'slnt' 0, 'ital' 0;
|
|
95
96
|
font-size: var(--_fs);
|
|
96
97
|
line-height: var(--_lh);
|
|
97
98
|
font-weight: 400;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer anta{a-menu-item:not(:defined){display:none}a-menu-item{--menu-item-color: var(--text-2);--menu-item-icon-color: var(--text-3);--menu-item-hint-color: var(--text-3);--menu-item-hover: 5%;--menu-item-active: 8%;--menu-item-selected: 8%;--menu-item-timing-in: 60ms ease-in-out;--menu-item-timing-out: .28s ease-out;--menu-item-padding-x: 8px;--menu-item-padding-y: 6px;display:flex;flex-shrink:0;align-items:center;gap:.6ch;box-sizing:border-box;width:100%;min-height:28px;padding-block:var(--menu-item-padding-y);padding-inline:var(--menu-item-padding-x);border-radius:var(--radius-sm, 4px);color:var(--menu-item-color);background:transparent;transition:background-color var(--menu-item-timing-out);font:inherit;font-size:14px;line-height:16px;text-align:left;white-space:nowrap;cursor:pointer;user-select:none;outline:none}a-menu[round] a-menu-item{border-radius:999px}a-menu-item:hover,a-menu-item:focus-visible,a-menu-item:state(active){background:color-mix(in oklch,currentColor var(--menu-item-hover),transparent);transition:background-color var(--menu-item-timing-in)}a-menu-item:active{background:color-mix(in oklch,currentColor var(--menu-item-active),transparent);transition:none}a-menu-item[selected]{background:color-mix(in oklch,currentColor var(--menu-item-selected),transparent)}a-menu-item:focus-visible{outline:1px solid var(--focus-ring);outline-offset:1px}a-menu-item>a-menu-item-label,a-menu-item>a-menu-item-text{flex:1 1 auto;min-width:0}a-menu-item>a-menu-item-text{display:flex;flex-direction:column}a-menu-item:has(>a-menu-item-text){align-items:flex-start}a-menu-item-label{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis}a-menu-item-hint{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;margin-block-start:1px;color:var(--menu-item-hint-color);font-size:12px;line-height:15px}a-menu-item>a-icon{flex:none;--icon-size: 16px;color:var(--menu-item-icon-color)}a-menu-item>a-checkbox,a-menu-item>a-radio{flex:none;--checkbox-gap: 0;--radio-gap: 0;pointer-events:none}a-menu-item:has(>:is(a-icon,a-checkbox,a-radio,[data-indicator]):first-child:not(:only-child)){padding-inline-start:var(--menu-item-padding-y)}a-menu-item:not([submenu]):has(>a-icon:last-child:not(:only-child)){padding-inline-end:max(0px,var(--menu-item-padding-x) - 2px)}a-menu-item>kbd{flex:none;margin-left:auto;padding-left:12px;color:var(--text-5);font:inherit;font-size:1em;letter-spacing:.1ch;white-space:nowrap}a-menu-item[submenu]>a-icon:last-of-type{margin-left:auto}a-menu-item[submenu]>a-icon:last-of-type,a-menu-item>a-icon:last-child:not(:only-child){position:relative;inset-inline-end:-2px}a-menu-item[tone=brand],a-menu-item[tone=info],a-menu-item[tone=success],a-menu-item[tone=warning],a-menu-item[tone=critical]{--menu-item-icon-color: var(--menu-item-color)}a-menu-item[tone=brand]{--menu-item-color: var(--text-2-brand);--menu-item-hint-color: var(--text-3-brand)}a-menu-item[tone=info]{--menu-item-color: var(--text-2-info);--menu-item-hint-color: var(--text-3-info)}a-menu-item[tone=success]{--menu-item-color: var(--text-2-success);--menu-item-hint-color: var(--text-3-success)}a-menu-item[tone=warning]{--menu-item-color: var(--text-2-warning);--menu-item-hint-color: var(--text-3-warning)}a-menu-item[tone=critical]{--menu-item-color: var(--text-2-critical);--menu-item-hint-color: var(--text-3-critical)}a-menu-item[tone]:not([tone=""],[tone=brand],[tone=neutral],[tone=info],[tone=success],[tone=warning],[tone=critical]){--menu-item-tone-source: attr(tone type(<color>), var(--text-2));--menu-item-color: oklch(from var(--menu-item-tone-source) .45 c h);--menu-item-icon-color: var(--menu-item-color);--menu-item-hint-color: oklch(from var(--menu-item-tone-source) .55 calc(c*.85) h);.dark &{--menu-item-color: oklch(from var(--menu-item-tone-source) .78 c h);--menu-item-hint-color: oklch(from var(--menu-item-tone-source) .68 calc(c*.85) h)}}a-menu-item[disabled]{--menu-item-color: var(--text-5);--menu-item-icon-color: var(--text-5);--menu-item-hint-color: var(--text-5);cursor:default;pointer-events:none}.dark a-menu-item{--menu-item-hover: 10%;--menu-item-active: 14%;--menu-item-selected: 14%}}
|
|
1
|
+
@layer anta{a-menu-item:not(:defined){display:none}a-menu-item{--menu-item-color: var(--text-2);--menu-item-icon-color: var(--text-3);--menu-item-hint-color: var(--text-3);--menu-item-hover: 5%;--menu-item-active: 8%;--menu-item-selected: 8%;--menu-item-timing-in: 60ms ease-in-out;--menu-item-timing-out: .28s ease-out;--menu-item-padding-x: 8px;--menu-item-padding-y: 6px;display:flex;flex-shrink:0;align-items:center;gap:.6ch;box-sizing:border-box;width:100%;min-height:28px;padding-block:var(--menu-item-padding-y);padding-inline:var(--menu-item-padding-x);border-radius:var(--radius-sm, 4px);color:var(--menu-item-color);background:transparent;transition:background-color var(--menu-item-timing-out);font:inherit;font-size:14px;line-height:16px;text-align:left;white-space:nowrap;cursor:pointer;user-select:none;outline:none}a-menu[round] a-menu-item{border-radius:999px}a-menu-item:hover,a-menu-item:focus-visible,a-menu-item:has(>a-menu:state(open)),a-menu-item:state(active){background:color-mix(in oklch,currentColor var(--menu-item-hover),transparent);transition:background-color var(--menu-item-timing-in)}a-menu-item:active{background:color-mix(in oklch,currentColor var(--menu-item-active),transparent);transition:none}a-menu-item[selected]{background:color-mix(in oklch,currentColor var(--menu-item-selected),transparent)}a-menu-item:focus-visible{outline:1px solid var(--focus-ring);outline-offset:1px}a-menu-item>a-menu-item-label,a-menu-item>a-menu-item-text{flex:1 1 auto;min-width:0}a-menu-item>a-menu-item-text{display:flex;flex-direction:column}a-menu-item:has(>a-menu-item-text){align-items:flex-start}a-menu-item-label{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis}a-menu-item-hint{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;margin-block-start:1px;color:var(--menu-item-hint-color);font-size:12px;line-height:15px}a-menu-item>a-icon{flex:none;--icon-size: 16px;color:var(--menu-item-icon-color)}a-menu-item>a-checkbox,a-menu-item>a-radio{flex:none;--checkbox-gap: 0;--radio-gap: 0;pointer-events:none}a-menu-item:has(>:is(a-icon,a-checkbox,a-radio,[data-indicator]):first-child:not(:only-child)){padding-inline-start:var(--menu-item-padding-y)}a-menu-item:not([submenu]):has(>a-icon:last-child:not(:only-child)){padding-inline-end:max(0px,var(--menu-item-padding-x) - 2px)}a-menu-item>kbd{flex:none;margin-left:auto;padding-left:12px;color:var(--text-5);font:inherit;font-size:1em;letter-spacing:.1ch;white-space:nowrap}a-menu-item[submenu]>a-icon:last-of-type{margin-left:auto}a-menu-item[submenu]>a-icon:last-of-type,a-menu-item>a-icon:last-child:not(:only-child){position:relative;inset-inline-end:-2px}a-menu-item[tone=brand],a-menu-item[tone=info],a-menu-item[tone=success],a-menu-item[tone=warning],a-menu-item[tone=critical]{--menu-item-icon-color: var(--menu-item-color)}a-menu-item[tone=brand]{--menu-item-color: var(--text-2-brand);--menu-item-hint-color: var(--text-3-brand)}a-menu-item[tone=info]{--menu-item-color: var(--text-2-info);--menu-item-hint-color: var(--text-3-info)}a-menu-item[tone=success]{--menu-item-color: var(--text-2-success);--menu-item-hint-color: var(--text-3-success)}a-menu-item[tone=warning]{--menu-item-color: var(--text-2-warning);--menu-item-hint-color: var(--text-3-warning)}a-menu-item[tone=critical]{--menu-item-color: var(--text-2-critical);--menu-item-hint-color: var(--text-3-critical)}a-menu-item[tone]:not([tone=""],[tone=brand],[tone=neutral],[tone=info],[tone=success],[tone=warning],[tone=critical]){--menu-item-tone-source: attr(tone type(<color>), var(--text-2));--menu-item-color: oklch(from var(--menu-item-tone-source) .45 c h);--menu-item-icon-color: var(--menu-item-color);--menu-item-hint-color: oklch(from var(--menu-item-tone-source) .55 calc(c*.85) h);.dark &{--menu-item-color: oklch(from var(--menu-item-tone-source) .78 c h);--menu-item-hint-color: oklch(from var(--menu-item-tone-source) .68 calc(c*.85) h)}}a-menu-item[disabled]{--menu-item-color: var(--text-5);--menu-item-icon-color: var(--text-5);--menu-item-hint-color: var(--text-5);cursor:default;pointer-events:none}.dark a-menu-item{--menu-item-hover: 10%;--menu-item-active: 14%;--menu-item-selected: 14%}}
|
|
@@ -16,12 +16,14 @@ declare global {
|
|
|
16
16
|
* Enter / Space on a focused item synthesizes a click (the single
|
|
17
17
|
* activation path that flows through the menu's click delegation).
|
|
18
18
|
*
|
|
19
|
-
*
|
|
20
|
-
* `
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* `
|
|
19
|
+
* ARIA (`role="menuitem"`, `tabindex`, `aria-haspopup` on submenu parents) is
|
|
20
|
+
* added by the `MenuItem` JSX wrapper, never here — the element must stay
|
|
21
|
+
* re-renderable from any reactive engine, and a web component must not mutate
|
|
22
|
+
* light DOM (it would desync the worker-thread reactive model that owns the
|
|
23
|
+
* light tree). So submenu open state is NOT written to the parent's attributes
|
|
24
|
+
* (no `aria-expanded`): the nested `a-menu` carries its own off-DOM
|
|
25
|
+
* `:state(open)`, and the parent styles its open branch purely in CSS
|
|
26
|
+
* (`a-menu-item:has(> a-menu:state(open))`, see `reflectOpen` there).
|
|
25
27
|
*
|
|
26
28
|
* Styling notes (`a-menu-item.css` ships comment-free):
|
|
27
29
|
* - `a-menu-item:not(:defined)` is hidden against the pre-upgrade flash
|
|
@@ -35,6 +35,7 @@ export declare class AMenuElement extends HTMLElementBase {
|
|
|
35
35
|
* but stays visible until the consumer flips `state`. The flag lets the
|
|
36
36
|
* `closeAll` backstop skip a duplicate emit. Cleared on every show. */
|
|
37
37
|
_dismissNotified: boolean;
|
|
38
|
+
private internals?;
|
|
38
39
|
private openTimer?;
|
|
39
40
|
private closeTimer?;
|
|
40
41
|
private typeBuffer;
|
|
@@ -98,9 +99,9 @@ export declare class AMenuElement extends HTMLElementBase {
|
|
|
98
99
|
* Shadow-internal only. */
|
|
99
100
|
private updateScrollFade;
|
|
100
101
|
/** Move the combobox cursor. Sets the item's `active` **property** (off-DOM
|
|
101
|
-
* `:state(active)`, no attribute churn) and
|
|
102
|
-
*
|
|
103
|
-
* `aria-
|
|
102
|
+
* `:state(active)`, no attribute churn) for the highlight, and REPORTS the
|
|
103
|
+
* active id via the `activedescendant` event so the reactive layer can set
|
|
104
|
+
* `aria-activedescendant` on the light-DOM field. `null` clears the cursor. */
|
|
104
105
|
private setActive;
|
|
105
106
|
/** Re-seat the cursor on the first option — but only once the filter has input.
|
|
106
107
|
* An empty filter (e.g. right after opening) shows NO active row, so the first
|
|
@@ -175,18 +176,15 @@ export declare class AMenuElement extends HTMLElementBase {
|
|
|
175
176
|
private hideAnchorTooltip;
|
|
176
177
|
/** Shadow-only hide. */
|
|
177
178
|
_doHide(): void;
|
|
178
|
-
/**
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
|
|
187
|
-
* still announced and Esc-dismissable; consumers add `aria-haspopup="menu"`
|
|
188
|
-
* to their trigger themselves. (`context` menus aren't triggers either.) */
|
|
189
|
-
private reflectExpanded;
|
|
179
|
+
/** Expose the menu's OWN open state as an off-DOM custom state (`:state(open)`),
|
|
180
|
+
* never a light-DOM attribute. A web component must not mutate light DOM — it
|
|
181
|
+
* desyncs the worker-thread reactive model, which owns the light tree. A
|
|
182
|
+
* submenu parent lights its open branch purely in CSS via
|
|
183
|
+
* `a-menu-item:has(> a-menu:state(open))`; the state is element-owned (like
|
|
184
|
+
* `a-menu-item`'s `:state(active)`) and, being off-DOM, survives a reactive
|
|
185
|
+
* re-render without the element ever writing an attribute. Set on every menu
|
|
186
|
+
* (harmless on roots — no `a-menu-item` parent matches the selector). */
|
|
187
|
+
private reflectOpen;
|
|
190
188
|
private position;
|
|
191
189
|
/**
|
|
192
190
|
* Fully declarative close contract — decided synchronously from the DOM, so
|