@antadesign/anta 0.3.34 → 0.3.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +14 -1
- package/README.md +9 -0
- package/dist/anta_helpers.d.ts +46 -30
- package/dist/anta_helpers.js +66 -25
- package/dist/bundle.css +1 -1
- package/dist/bundle.js +2 -1333
- package/dist/components/Banner.d.ts +25 -40
- package/dist/components/Banner.js +15 -17
- package/dist/components/Button.js +1 -0
- package/dist/components/ButtonCopy.js +3 -2
- package/dist/components/Calendar.js +13 -13
- package/dist/components/Card.d.ts +9 -17
- package/dist/components/Card.js +50 -46
- package/dist/components/Dialog.d.ts +1 -0
- package/dist/components/Dialog.js +16 -10
- package/dist/components/Expander.d.ts +6 -21
- package/dist/components/Expander.js +24 -23
- package/dist/components/Icon.d.ts +8 -14
- package/dist/components/Input.d.ts +77 -96
- package/dist/components/Input.js +23 -27
- package/dist/components/InputAutocomplete.d.ts +29 -10
- package/dist/components/InputAutocomplete.js +25 -8
- package/dist/components/InputDate.js +2 -2
- package/dist/components/InputTime.d.ts +10 -4
- package/dist/components/InputTime.js +20 -16
- package/dist/components/Loader.d.ts +2 -2
- package/dist/components/Menu.d.ts +5 -4
- package/dist/components/Menu.js +13 -8
- package/dist/components/MenuItem.js +1 -14
- package/dist/components/MenuItemCopy.js +2 -2
- package/dist/components/Panel.d.ts +3 -1
- package/dist/components/Panel.js +17 -11
- package/dist/components/Progress.d.ts +21 -23
- package/dist/components/Progress.js +13 -9
- package/dist/components/RadioGroup.js +6 -8
- package/dist/components/{select-parts.css → Select.css} +1 -1
- package/dist/components/Select.d.ts +53 -35
- package/dist/components/Select.js +53 -97
- package/dist/components/SelectFaceted.d.ts +7 -3
- package/dist/components/SelectFaceted.js +21 -9
- package/dist/components/Slider.d.ts +28 -11
- package/dist/components/Slider.js +20 -20
- package/dist/components/Steps.css +1 -1
- package/dist/components/Steps.js +1 -11
- package/dist/components/Tabs.d.ts +17 -20
- package/dist/components/Tabs.js +5 -8
- package/dist/components/Text.d.ts +55 -36
- package/dist/components/Text.js +35 -22
- package/dist/components/Title.d.ts +16 -26
- package/dist/components/Title.js +2 -1
- package/dist/components/Toaster.js +9 -2
- package/dist/components/Tooltip.d.ts +10 -15
- package/dist/components/copy-props.d.ts +14 -3
- package/dist/components/copy-props.js +14 -3
- package/dist/components/select-tree.d.ts +24 -0
- package/dist/components/select-tree.js +35 -0
- package/dist/element-base.d.ts +10 -0
- package/dist/element-base.js +15 -0
- package/dist/elements/a-banner.css +1 -1
- package/dist/elements/a-banner.d.ts +4 -1
- package/dist/elements/a-banner.js +22 -112
- package/dist/elements/a-button.d.ts +2 -1
- package/dist/elements/a-button.js +18 -1
- package/dist/elements/a-calendar.d.ts +14 -13
- package/dist/elements/a-calendar.js +29 -24
- package/dist/elements/a-card.css +1 -1
- package/dist/elements/a-card.d.ts +0 -9
- package/dist/elements/a-card.js +0 -184
- package/dist/elements/a-checkbox.css +1 -1
- package/dist/elements/a-copy.css +1 -1
- package/dist/elements/a-copy.d.ts +1 -5
- package/dist/elements/a-copy.js +129 -108
- package/dist/elements/a-dialog.css +1 -1
- package/dist/elements/a-dialog.d.ts +1 -1
- package/dist/elements/a-dialog.js +66 -194
- package/dist/elements/a-expander.css +1 -1
- package/dist/elements/a-expander.d.ts +4 -30
- package/dist/elements/a-expander.js +85 -344
- package/dist/elements/a-icon.d.ts +5 -23
- package/dist/elements/a-icon.js +1 -2
- package/dist/elements/a-input-time.css +1 -1
- package/dist/elements/a-input-time.d.ts +2 -1
- package/dist/elements/a-input-time.js +101 -168
- package/dist/elements/a-input.css +1 -1
- package/dist/elements/a-input.d.ts +10 -8
- package/dist/elements/a-input.js +155 -230
- package/dist/elements/a-loader.d.ts +5 -8
- package/dist/elements/a-loader.js +1 -2
- package/dist/elements/a-menu-item.css +1 -1
- package/dist/elements/a-menu-item.d.ts +5 -3
- package/dist/elements/a-menu-item.js +5 -1
- package/dist/elements/a-menu.css +1 -1
- package/dist/elements/a-menu.d.ts +5 -7
- package/dist/elements/a-menu.js +383 -299
- package/dist/elements/a-panel.css +1 -1
- package/dist/elements/a-panel.js +19 -37
- package/dist/elements/a-progress.css +1 -1
- package/dist/elements/a-progress.d.ts +0 -22
- package/dist/elements/a-progress.js +0 -100
- package/dist/elements/a-radio-group.d.ts +1 -1
- package/dist/elements/a-radio-group.js +6 -4
- package/dist/elements/a-select-faceted.d.ts +1 -1
- package/dist/elements/a-select-faceted.js +1 -1
- package/dist/elements/a-select.d.ts +1 -1
- package/dist/elements/a-select.js +1 -1
- package/dist/elements/a-slider.css +1 -1
- package/dist/elements/a-slider.d.ts +11 -3
- package/dist/elements/a-slider.js +244 -242
- package/dist/elements/a-switch.css +1 -1
- package/dist/elements/a-tab.css +1 -1
- package/dist/elements/a-tabs.css +1 -1
- package/dist/elements/a-tabs.d.ts +1 -1
- package/dist/elements/a-tabs.js +6 -4
- package/dist/elements/a-tag.css +1 -1
- package/dist/elements/a-text.css +1 -1
- package/dist/elements/a-text.d.ts +6 -43
- package/dist/elements/a-text.js +110 -193
- package/dist/elements/a-title.css +1 -1
- package/dist/elements/a-toast.css +1 -1
- package/dist/elements/a-toast.d.ts +10 -45
- package/dist/elements/a-toast.js +80 -66
- package/dist/elements/a-toaster.css +1 -1
- package/dist/elements/a-toaster.js +9 -44
- package/dist/elements/a-tooltip.css +1 -1
- package/dist/elements/a-tooltip.d.ts +1 -1
- package/dist/elements/a-tooltip.js +142 -136
- package/dist/elements/copy-behavior.d.ts +1 -1
- package/dist/elements/copy-behavior.js +21 -21
- package/dist/elements/index.d.ts +3 -3
- package/dist/elements/index.js +3 -7
- package/dist/elements/input-focus-modality.d.ts +15 -0
- package/dist/elements/input-focus-modality.js +44 -0
- package/dist/elements/input-trailing-actions.d.ts +5 -0
- package/dist/elements/input-trailing-actions.js +38 -0
- package/dist/elements/shadow-aria.d.ts +2 -0
- package/dist/elements/shadow-aria.js +2 -1
- package/dist/elements/value-input.d.ts +3 -0
- package/dist/elements/value-input.js +12 -0
- package/dist/general_types.d.ts +103 -96
- package/dist/index.d.ts +1 -1
- package/dist/input-events.d.ts +4 -0
- package/dist/input-events.js +15 -0
- package/dist/jsx-runtime.d.ts +70 -23
- package/dist/jsx-runtime.js +26 -19
- package/dist/native-event-props.d.ts +2 -0
- package/dist/native-event-props.js +10 -0
- package/dist/reset.css +1 -1
- package/dist/theme-antithesis.css +10 -1
- package/dist/theme-antune.css +1 -1
- package/docs/accessibility.md +17 -3
- package/docs/changelog.md +348 -2
- package/docs/comparison.md +2 -2
- package/docs/components/avatar.md +5 -0
- package/docs/components/banner.md +117 -187
- package/docs/components/button.md +22 -0
- package/docs/components/card.md +74 -28
- package/docs/components/checkbox.md +9 -10
- package/docs/components/dialog.md +83 -32
- package/docs/components/expander.md +198 -435
- package/docs/components/icon.md +11 -17
- package/docs/components/input-autocomplete.md +152 -52
- package/docs/components/input-date.md +175 -148
- package/docs/components/input-time.md +81 -38
- package/docs/components/input.md +343 -349
- package/docs/components/loader.md +2 -1
- package/docs/components/menu.md +35 -6
- package/docs/components/panel.md +18 -0
- package/docs/components/progress.md +83 -49
- package/docs/components/radio.md +39 -43
- package/docs/components/select-faceted.md +54 -7
- package/docs/components/select.md +390 -386
- package/docs/components/slider.md +136 -19
- package/docs/components/steps.md +2 -1
- package/docs/components/switch.md +8 -9
- package/docs/components/tabs.md +110 -104
- package/docs/components/text.md +110 -86
- package/docs/components/title.md +47 -33
- package/docs/components/toaster.md +242 -84
- package/docs/components/tooltip.md +204 -113
- package/docs/install-config.md +183 -26
- package/docs/packages/plot.md +170 -148
- package/docs/theming.md +7 -0
- package/package.json +41 -3
- package/theme-antithesis-license.md +66 -0
|
@@ -1,382 +1,123 @@
|
|
|
1
1
|
import { HTMLElementBase, parseOpenState } from "../anta_helpers";
|
|
2
2
|
import "./a-expander.css";
|
|
3
|
-
const ANIM_MS = 200;
|
|
4
3
|
const INTERACTIVE_SELECTOR = 'a-button,a-checkbox,a-radio,a-radio-group,a-input,a-input-time,a-calendar,a-menu-item,a-tab,[data-anta][role="button"],button,a[href],input,select,textarea,label,[contenteditable=""],[contenteditable="true"]';
|
|
5
4
|
const DISABLED_SELECTOR = ':disabled,[disabled],[aria-disabled="true"]';
|
|
6
|
-
function ignoresToggle(
|
|
7
|
-
|
|
8
|
-
return el.matches(INTERACTIVE_SELECTOR) && !el.matches(DISABLED_SELECTOR);
|
|
5
|
+
function ignoresToggle(element) {
|
|
6
|
+
return element.hasAttribute("data-expander-ignore") || element.matches(INTERACTIVE_SELECTOR) && !element.matches(DISABLED_SELECTOR);
|
|
9
7
|
}
|
|
10
|
-
const SHADOW_STYLE = `
|
|
11
|
-
:host { display: block; }
|
|
12
|
-
|
|
13
|
-
.header {
|
|
14
|
-
display: flex;
|
|
15
|
-
/* Stretch so the trigger button (and the actions row) fill the full host
|
|
16
|
-
height \u2014 the title's hit area is the whole header, not just the text. */
|
|
17
|
-
align-items: stretch;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
:host([indicator-placement="end"]) .header {
|
|
21
|
-
display: grid;
|
|
22
|
-
grid-template-columns: minmax(0, 1fr) auto var(--_expander-indicator-track);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
slot[name="actions"] { display: none; }
|
|
26
|
-
.header.has-actions slot[name="actions"] {
|
|
27
|
-
display: flex;
|
|
28
|
-
align-items: center;
|
|
29
|
-
gap: var(--_expander-actions-gap);
|
|
30
|
-
flex-shrink: 0;
|
|
31
|
-
margin-inline-start: var(--_expander-actions-start);
|
|
32
|
-
/* Inset from the right edge (the host has no padding of its own). */
|
|
33
|
-
margin-inline-end: var(--_expander-actions-end);
|
|
34
|
-
}
|
|
35
|
-
:host([indicator-placement="end"]) .header.has-actions slot[name="actions"] {
|
|
36
|
-
grid-column: 2;
|
|
37
|
-
grid-row: 1;
|
|
38
|
-
z-index: 1;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
button {
|
|
42
|
-
appearance: none;
|
|
43
|
-
-webkit-appearance: none;
|
|
44
|
-
background: none;
|
|
45
|
-
border: none;
|
|
46
|
-
margin: 0;
|
|
47
|
-
/* The default button fills the header beside its actions. The title and
|
|
48
|
-
body share --expander-gutter, and the indicator hangs inside that gutter.
|
|
49
|
-
End placement switches to the header's subgrid. */
|
|
50
|
-
position: relative;
|
|
51
|
-
padding: var(--_expander-header-padding-block) var(--_expander-header-padding-end) var(--_expander-header-padding-block) var(--expander-gutter);
|
|
52
|
-
flex: 1;
|
|
53
|
-
min-width: 0;
|
|
54
|
-
font: inherit;
|
|
55
|
-
font-variation-settings: inherit;
|
|
56
|
-
color: inherit;
|
|
57
|
-
text-align: left;
|
|
58
|
-
|
|
59
|
-
display: flex;
|
|
60
|
-
align-items: center;
|
|
61
|
-
gap: 0;
|
|
62
|
-
cursor: pointer;
|
|
63
|
-
user-select: text;
|
|
64
|
-
border-radius: 2px;
|
|
65
|
-
outline: none;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
:host([indicator-placement="end"]) button {
|
|
69
|
-
grid-column: 1 / -1;
|
|
70
|
-
grid-row: 1;
|
|
71
|
-
display: grid;
|
|
72
|
-
grid-template-columns: subgrid;
|
|
73
|
-
padding: var(--_expander-header-padding-block) 0;
|
|
74
|
-
}
|
|
75
|
-
:host([indicator-placement="end"]) slot[name="title"] {
|
|
76
|
-
grid-column: 1;
|
|
77
|
-
display: block;
|
|
78
|
-
min-width: 0;
|
|
79
|
-
margin-inline-start: var(--expander-gutter);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
button:focus-visible {
|
|
83
|
-
outline: 1px solid var(--focus-ring);
|
|
84
|
-
outline-offset: 0px;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.indicator {
|
|
88
|
-
position: absolute;
|
|
89
|
-
inset-inline-start: var(--_expander-indicator-start);
|
|
90
|
-
top: 50%;
|
|
91
|
-
width: var(--_expander-indicator-size);
|
|
92
|
-
height: var(--_expander-indicator-size);
|
|
93
|
-
pointer-events: none;
|
|
94
|
-
opacity: 0.6;
|
|
95
|
-
transform: translateY(-50%);
|
|
96
|
-
transition: transform 150ms ease, opacity 150ms ease;
|
|
97
|
-
}
|
|
98
|
-
.indicator slot { display: grid; place-items: center; width: 100%; height: 100%; }
|
|
99
|
-
.indicator slot::slotted(*) { pointer-events: none; }
|
|
100
|
-
.indicator .glyph {
|
|
101
|
-
display: block;
|
|
102
|
-
width: var(--_expander-indicator-size);
|
|
103
|
-
height: var(--_expander-indicator-size);
|
|
104
|
-
background-color: currentColor;
|
|
105
|
-
-webkit-mask-image: var(--_expander-indicator-mask);
|
|
106
|
-
mask-image: var(--_expander-indicator-mask);
|
|
107
|
-
-webkit-mask-size: contain;
|
|
108
|
-
mask-size: contain;
|
|
109
|
-
-webkit-mask-repeat: no-repeat;
|
|
110
|
-
mask-repeat: no-repeat;
|
|
111
|
-
-webkit-mask-position: center;
|
|
112
|
-
mask-position: center;
|
|
113
|
-
}
|
|
114
|
-
:host([indicator="plus"]) .indicator .glyph { position: relative; background: none; mask: none; -webkit-mask: none; }
|
|
115
|
-
:host([indicator="plus"]) .indicator .glyph::before,
|
|
116
|
-
:host([indicator="plus"]) .indicator .glyph::after {
|
|
117
|
-
content: '';
|
|
118
|
-
position: absolute;
|
|
119
|
-
background: currentColor;
|
|
120
|
-
border-radius: calc(var(--_expander-indicator-stroke) / 2);
|
|
121
|
-
}
|
|
122
|
-
:host([indicator="plus"]) .indicator .glyph::before {
|
|
123
|
-
width: calc(var(--_expander-indicator-size) - 2 * var(--_expander-indicator-stroke));
|
|
124
|
-
height: var(--_expander-indicator-stroke);
|
|
125
|
-
left: var(--_expander-indicator-stroke);
|
|
126
|
-
top: calc((var(--_expander-indicator-size) - var(--_expander-indicator-stroke)) / 2);
|
|
127
|
-
}
|
|
128
|
-
:host([indicator="plus"]) .indicator .glyph::after {
|
|
129
|
-
width: var(--_expander-indicator-stroke);
|
|
130
|
-
height: calc(var(--_expander-indicator-size) - 2 * var(--_expander-indicator-stroke));
|
|
131
|
-
left: calc((var(--_expander-indicator-size) - var(--_expander-indicator-stroke)) / 2);
|
|
132
|
-
top: var(--_expander-indicator-stroke);
|
|
133
|
-
transition: transform 150ms ease;
|
|
134
|
-
}
|
|
135
|
-
button:enabled:hover .indicator { opacity: 1; }
|
|
136
|
-
button[aria-expanded="true"] .indicator { transform: translateY(-50%) rotate(90deg); opacity: 1; }
|
|
137
|
-
:host([indicator="plus"]) button[aria-expanded="true"] .indicator,
|
|
138
|
-
button[aria-expanded="true"] .indicator.has-pair { transform: translateY(-50%); }
|
|
139
|
-
:host([indicator="plus"]) button[aria-expanded="true"] .glyph::after { transform: scaleY(0); }
|
|
140
|
-
button[aria-expanded="false"] slot[name="indicator"]::slotted([data-when="open"]),
|
|
141
|
-
button[aria-expanded="true"] slot[name="indicator"]::slotted([data-when="closed"]) { display: none; }
|
|
142
|
-
|
|
143
|
-
:host([indicator-placement="end"]) .indicator {
|
|
144
|
-
position: static;
|
|
145
|
-
grid-column: 3;
|
|
146
|
-
grid-row: 1;
|
|
147
|
-
justify-self: end;
|
|
148
|
-
align-self: center;
|
|
149
|
-
margin-inline-end: var(--_expander-indicator-edge);
|
|
150
|
-
transform: rotate(90deg);
|
|
151
|
-
}
|
|
152
|
-
:host([indicator-placement="end"]) button[aria-expanded="true"] .indicator { transform: rotate(270deg); }
|
|
153
|
-
:host([indicator-placement="end"]) .indicator.has-custom,
|
|
154
|
-
:host([indicator-placement="end"]) .indicator.has-pair { transform: none; }
|
|
155
|
-
:host([indicator-placement="end"][indicator="plus"]) .indicator { transform: none; }
|
|
156
|
-
:host([indicator-placement="end"]) button[aria-expanded="true"] .indicator.has-custom { transform: rotate(180deg); }
|
|
157
|
-
:host([indicator-placement="end"]) button[aria-expanded="true"] .indicator.has-pair,
|
|
158
|
-
:host([indicator-placement="end"][indicator="plus"]) button[aria-expanded="true"] .indicator { transform: none; }
|
|
159
|
-
|
|
160
|
-
button:enabled:hover { color: var(--expander-text-hover); }
|
|
161
|
-
:host([priority="tertiary"]) button:enabled:hover { --_summary-underline: underline; }
|
|
162
|
-
button:enabled:active { color: var(--expander-text); }
|
|
163
|
-
button:disabled { cursor: default; }
|
|
164
|
-
button:enabled:not([aria-expanded="true"]):active .indicator {
|
|
165
|
-
opacity: 0.6;
|
|
166
|
-
}
|
|
167
|
-
@media (prefers-reduced-motion: reduce) {
|
|
168
|
-
.indicator, :host([indicator="plus"]) .indicator .glyph::after { transition: none; }
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
.region {
|
|
172
|
-
display: grid;
|
|
173
|
-
grid-template-rows: 0fr;
|
|
174
|
-
grid-template-columns: minmax(0, 1fr);
|
|
175
|
-
}
|
|
176
|
-
.header:has(button[aria-expanded="true"]) + .region { grid-template-rows: 1fr; }
|
|
177
|
-
|
|
178
|
-
/* The transparent tertiary border still insets the content by 1px. Pull the
|
|
179
|
-
header and region back so outdent lands flush with surrounding content. */
|
|
180
|
-
:host([priority="tertiary"][outdent]) .header,
|
|
181
|
-
:host([priority="tertiary"][outdent]) .region {
|
|
182
|
-
margin-inline-start: -1px;
|
|
183
|
-
}
|
|
184
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
185
|
-
.region { transition: grid-template-rows ${ANIM_MS}ms ease; }
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
[part="content"] { display: block; min-height: 0; overflow: clip; }
|
|
189
|
-
.header:has(button[aria-expanded="true"]) + .region [part="content"] {
|
|
190
|
-
overflow: visible;
|
|
191
|
-
transition: overflow 0s ${ANIM_MS}ms;
|
|
192
|
-
transition-behavior: allow-discrete;
|
|
193
|
-
}
|
|
194
|
-
`;
|
|
195
|
-
const parseState = parseOpenState;
|
|
196
8
|
class AExpanderElement extends HTMLElementBase {
|
|
197
|
-
static observedAttributes = ["state", "disabled"
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
// Observes the header (folded) box so the `round` radius tracks its height —
|
|
208
|
-
// including custom header content. Guarded for engines without ResizeObserver.
|
|
209
|
-
roundObserver;
|
|
210
|
-
// ElementInternals exposes the open/closed state as a custom state
|
|
211
|
-
// (`:state(open)`) for consumer styling, including the indicator. It's NOT a host
|
|
212
|
-
// attribute (declarative-DOM safe: no host mutation, no reconciliation
|
|
213
|
-
// churn), just element-internal state the browser exposes for CSS matching.
|
|
214
|
-
// Guarded for engines without attachInternals / CustomStateSet (no-op there).
|
|
215
|
-
internals;
|
|
9
|
+
static observedAttributes = ["state", "disabled"];
|
|
10
|
+
#internals;
|
|
11
|
+
#summary;
|
|
12
|
+
#title;
|
|
13
|
+
#actions;
|
|
14
|
+
#indicator;
|
|
15
|
+
#content;
|
|
16
|
+
#region;
|
|
17
|
+
#observer;
|
|
18
|
+
#seeded = false;
|
|
216
19
|
constructor() {
|
|
217
20
|
super();
|
|
218
|
-
this
|
|
219
|
-
const shadow = this.attachShadow({ mode: "open" });
|
|
220
|
-
const
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
this
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
this
|
|
229
|
-
const indicator =
|
|
230
|
-
indicator.className = "indicator";
|
|
231
|
-
indicator.setAttribute("part", "indicator");
|
|
21
|
+
this.#internals = this.attachInternals();
|
|
22
|
+
const shadow = this.attachShadow({ mode: "open", slotAssignment: "manual" });
|
|
23
|
+
const node = (tag, part) => {
|
|
24
|
+
const element = this.ownerDocument.createElement(tag);
|
|
25
|
+
element.setAttribute("part", part);
|
|
26
|
+
return element;
|
|
27
|
+
};
|
|
28
|
+
this.#summary = node("button", "summary");
|
|
29
|
+
this.#summary.type = "button";
|
|
30
|
+
this.#summary.setAttribute("aria-expanded", "false");
|
|
31
|
+
this.#title = node("slot", "title");
|
|
32
|
+
const indicator = node("span", "indicator");
|
|
232
33
|
indicator.setAttribute("aria-hidden", "true");
|
|
233
34
|
indicator.inert = true;
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
this.summary.append(titleSlot, indicator);
|
|
247
|
-
this.summary.addEventListener("click", this.onSummaryClick);
|
|
248
|
-
const header = document.createElement("div");
|
|
249
|
-
header.className = "header";
|
|
250
|
-
this.header = header;
|
|
251
|
-
const actionsSlot = document.createElement("slot");
|
|
252
|
-
actionsSlot.name = "actions";
|
|
253
|
-
actionsSlot.setAttribute("part", "actions");
|
|
254
|
-
actionsSlot.addEventListener("slotchange", () => {
|
|
255
|
-
header.classList.toggle("has-actions", actionsSlot.assignedElements().length > 0);
|
|
256
|
-
});
|
|
257
|
-
header.append(this.summary, actionsSlot);
|
|
258
|
-
this.region = document.createElement("div");
|
|
259
|
-
this.region.className = "region";
|
|
260
|
-
const content = document.createElement("slot");
|
|
261
|
-
content.setAttribute("part", "content");
|
|
262
|
-
this.region.append(content);
|
|
263
|
-
this.roundStyle = document.createElement("style");
|
|
264
|
-
if (typeof ResizeObserver !== "undefined") {
|
|
265
|
-
this.roundObserver = new ResizeObserver(() => this.measureRoundRadius());
|
|
266
|
-
}
|
|
267
|
-
shadow.append(style, this.roundStyle, header, this.region);
|
|
35
|
+
this.#indicator = node("slot", "indicator-content");
|
|
36
|
+
indicator.append(this.#indicator);
|
|
37
|
+
this.#summary.append(this.#title, indicator);
|
|
38
|
+
this.#summary.addEventListener("click", this.#onSummaryClick);
|
|
39
|
+
const header = node("div", "header");
|
|
40
|
+
this.#actions = node("slot", "actions");
|
|
41
|
+
header.append(this.#summary, this.#actions);
|
|
42
|
+
this.#region = node("div", "region");
|
|
43
|
+
this.#region.inert = true;
|
|
44
|
+
this.#content = node("slot", "content");
|
|
45
|
+
this.#region.append(this.#content);
|
|
46
|
+
shadow.append(header, this.#region);
|
|
268
47
|
}
|
|
269
|
-
/** Publish HALF the folded (header + host borders) height as
|
|
270
|
-
* `--_expander-round-radius` on `:host`, for `a-expander[round]` to consume.
|
|
271
|
-
* Reads layout only; writes only the shadow sheet — no host mutation. */
|
|
272
|
-
/** A `round` attribute carrying a length (`round="12px"`) is a fixed radius —
|
|
273
|
-
* the CSS uses it directly and the measured pill is unused, so skip measuring.
|
|
274
|
-
* (The wrapper's `round={12}` path sets an inline var + a bare `round=""`, so
|
|
275
|
-
* it isn't caught here; the measurement runs but its var is simply overridden.) */
|
|
276
|
-
hasFixedRound() {
|
|
277
|
-
const v = this.getAttribute("round");
|
|
278
|
-
return v != null && v.trim() !== "";
|
|
279
|
-
}
|
|
280
|
-
measureRoundRadius() {
|
|
281
|
-
if (!this.hasAttribute("round") || this.hasFixedRound()) return;
|
|
282
|
-
const h = this.header.getBoundingClientRect().height;
|
|
283
|
-
if (h <= 0) return;
|
|
284
|
-
const cs = getComputedStyle(this);
|
|
285
|
-
const borders = (parseFloat(cs.borderTopWidth) || 0) + (parseFloat(cs.borderBottomWidth) || 0);
|
|
286
|
-
const radius = (h + borders) / 2;
|
|
287
|
-
this.roundStyle.textContent = `:host{--_expander-round-radius:${radius}px}`;
|
|
288
|
-
}
|
|
289
|
-
startRoundObserver() {
|
|
290
|
-
if (!this.roundObserver || this.hasFixedRound()) return;
|
|
291
|
-
this.roundObserver.observe(this.header);
|
|
292
|
-
this.measureRoundRadius();
|
|
293
|
-
}
|
|
294
|
-
stopRoundObserver() {
|
|
295
|
-
this.roundObserver?.disconnect();
|
|
296
|
-
this.roundStyle.textContent = "";
|
|
297
|
-
}
|
|
298
|
-
/** Controlled mode: the `state` attribute is present and owns the state. */
|
|
299
48
|
get #controlled() {
|
|
300
49
|
return this.hasAttribute("state");
|
|
301
50
|
}
|
|
302
|
-
/** The currently *applied* state (read from the shadow, the source of truth
|
|
303
|
-
* for what's painted). */
|
|
304
51
|
get #current() {
|
|
305
|
-
return this
|
|
52
|
+
return this.#summary.getAttribute("aria-expanded") === "true" ? "open" : "closed";
|
|
306
53
|
}
|
|
307
54
|
connectedCallback() {
|
|
308
|
-
this.
|
|
309
|
-
this
|
|
310
|
-
if (this.
|
|
55
|
+
this.#summary.disabled = this.hasAttribute("disabled");
|
|
56
|
+
if (this.#controlled) this.#applyState(parseOpenState(this.getAttribute("state")));
|
|
57
|
+
else if (!this.#seeded) this.#applyState(parseOpenState(this.getAttribute("default-state")));
|
|
58
|
+
this.#seeded = true;
|
|
59
|
+
this.#observer ??= new MutationObserver(() => this.#project());
|
|
60
|
+
this.#observer.observe(this, { childList: true });
|
|
61
|
+
this.#project();
|
|
311
62
|
}
|
|
312
63
|
disconnectedCallback() {
|
|
313
|
-
this
|
|
64
|
+
this.#observer?.disconnect();
|
|
314
65
|
}
|
|
315
|
-
attributeChangedCallback(name) {
|
|
316
|
-
if (
|
|
317
|
-
|
|
318
|
-
else if (name === "
|
|
319
|
-
if (this.hasAttribute("round")) this.startRoundObserver();
|
|
320
|
-
else this.stopRoundObserver();
|
|
321
|
-
}
|
|
66
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
67
|
+
if (oldValue === newValue) return;
|
|
68
|
+
if (name === "disabled") this.#summary.disabled = this.hasAttribute("disabled");
|
|
69
|
+
else if (name === "state" && this.#controlled) this.#applyState(parseOpenState(newValue));
|
|
322
70
|
}
|
|
323
|
-
|
|
324
|
-
|
|
71
|
+
#project() {
|
|
72
|
+
const children = [...this.children];
|
|
73
|
+
this.#title.assign(...children.filter((node) => node.localName === "a-expander-summary" || node.localName === "a-expander-title"));
|
|
74
|
+
this.#actions.assign(...children.filter((node) => node.localName === "a-expander-actions"));
|
|
75
|
+
this.#indicator.assign(...children.filter((node) => node.localName === "a-expander-indicator"));
|
|
76
|
+
this.#content.assign(...children.filter((node) => node.localName === "a-expander-details"));
|
|
325
77
|
}
|
|
326
|
-
|
|
327
|
-
* only the shadow). `aria-expanded` is both the a11y signal and the CSS
|
|
328
|
-
* state hook; `inert` keeps collapsed content out of the tab order and the
|
|
329
|
-
* accessibility tree. */
|
|
330
|
-
applyState(state) {
|
|
78
|
+
#applyState(state) {
|
|
331
79
|
const open = state === "open";
|
|
332
|
-
this
|
|
333
|
-
this
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
80
|
+
this.#summary.setAttribute("aria-expanded", String(open));
|
|
81
|
+
this.#region.inert = !open;
|
|
82
|
+
this.#internals.states.delete(open ? "closed" : "open");
|
|
83
|
+
this.#internals.states.add(state);
|
|
84
|
+
}
|
|
85
|
+
#clickIgnoresToggle(event) {
|
|
86
|
+
const path = event.composedPath();
|
|
87
|
+
const nearest = path.find((node) => node.nodeType === 1 && node.localName === "a-expander");
|
|
88
|
+
if (nearest && nearest !== this) return true;
|
|
89
|
+
return path.slice(0, path.indexOf(this.#summary)).some((node) => node.nodeType === 1 && ignoresToggle(node));
|
|
90
|
+
}
|
|
91
|
+
#titleControlHasFocus() {
|
|
92
|
+
let active = this.ownerDocument.activeElement;
|
|
93
|
+
const titles = this.#title.assignedElements();
|
|
94
|
+
while (active && active !== this) {
|
|
95
|
+
if (titles.some((title) => title.contains(active)) && ignoresToggle(active)) return true;
|
|
96
|
+
active = active.parentElement;
|
|
338
97
|
}
|
|
98
|
+
return false;
|
|
339
99
|
}
|
|
340
|
-
/** Refuse to toggle when the click landed on a control inside the projected
|
|
341
|
-
* title — walk the composed path up to (not including) the summary button and
|
|
342
|
-
* test each element with `ignoresToggle` (enabled interactive control or the
|
|
343
|
-
* opt-out marker). Synchronous and read here in the element, so it stands in
|
|
344
|
-
* off-UI-thread runtimes. Suppressing before the dispatch also keeps a
|
|
345
|
-
* *controlled* consumer from toggling (no `statechange` fires). */
|
|
346
|
-
#clickIgnoresToggle(e) {
|
|
347
|
-
const path = e.composedPath();
|
|
348
|
-
const end = path.indexOf(this.summary);
|
|
349
|
-
const scope = end === -1 ? path : path.slice(0, end);
|
|
350
|
-
return scope.some((n) => n instanceof Element && ignoresToggle(n));
|
|
351
|
-
}
|
|
352
|
-
/** A selection that reaches projected title content came from a drag. Keep it
|
|
353
|
-
* selected instead of treating its release as an activation. */
|
|
354
100
|
#titleHasSelection() {
|
|
355
101
|
const selection = this.ownerDocument.getSelection();
|
|
356
|
-
if (!selection || selection.isCollapsed || selection.rangeCount
|
|
102
|
+
if (!selection || selection.isCollapsed || !selection.rangeCount) return false;
|
|
357
103
|
const range = selection.getRangeAt(0);
|
|
358
|
-
return this.
|
|
104
|
+
return this.#title.assignedNodes().some((node) => range.intersectsNode(node));
|
|
359
105
|
}
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
* attribute. See STATEFUL-COMPONENTS.md. */
|
|
364
|
-
onSummaryClick = (e) => {
|
|
365
|
-
if (this.#clickIgnoresToggle(e) || e.detail !== 0 && this.#titleHasSelection()) return;
|
|
106
|
+
#onSummaryClick = (event) => {
|
|
107
|
+
if (this.hasAttribute("disabled") || this.#clickIgnoresToggle(event) || event.isTrusted && event.detail === 0 && this.#titleControlHasFocus() || event.detail !== 0 && this.#titleHasSelection()) return;
|
|
108
|
+
const controlled = this.#controlled;
|
|
366
109
|
const prev = this.#current;
|
|
367
110
|
const next = prev === "open" ? "closed" : "open";
|
|
368
|
-
const
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
if (
|
|
111
|
+
const accepted = this.dispatchEvent(new this.view.CustomEvent("statechange", {
|
|
112
|
+
cancelable: true,
|
|
113
|
+
detail: { next, prev }
|
|
114
|
+
}));
|
|
115
|
+
if (!controlled && !this.#controlled && accepted) this.#applyState(next);
|
|
373
116
|
};
|
|
374
117
|
}
|
|
375
118
|
function register_a_expander() {
|
|
376
119
|
if (typeof customElements === "undefined") return;
|
|
377
|
-
if (!customElements.get("a-expander"))
|
|
378
|
-
customElements.define("a-expander", AExpanderElement);
|
|
379
|
-
}
|
|
120
|
+
if (!customElements.get("a-expander")) customElements.define("a-expander", AExpanderElement);
|
|
380
121
|
}
|
|
381
122
|
register_a_expander();
|
|
382
123
|
export {
|
|
@@ -1,29 +1,11 @@
|
|
|
1
|
-
import { HTMLElementBase } from '../
|
|
1
|
+
import { HTMLElementBase } from '../element-base';
|
|
2
2
|
import './a-icon.css';
|
|
3
3
|
import './a-icon.shapes.css';
|
|
4
4
|
import './a-loader.css';
|
|
5
|
-
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* No shadow DOM and no JS state. Styling is driven entirely by external
|
|
9
|
-
* CSS: the base rule (`a-icon.css`) sets up the mask compositing, and
|
|
10
|
-
* the per-shape rules (`a-icon.shapes.css`, generated) supply the
|
|
11
|
-
* `--icon` URL. Color follows `currentColor`.
|
|
12
|
-
*
|
|
13
|
-
* Sizing notes (`a-icon.css` ships comment-free):
|
|
14
|
-
* - The 16px default lives in a plain `--icon-size: 16px` declaration,
|
|
15
|
-
* never inside `attr()` — Safari has no typed `attr()` for `<length>`,
|
|
16
|
-
* so a default on the attr() path can't resolve there and the
|
|
17
|
-
* var-substituted `width` would collapse to 0 on an empty inline-block.
|
|
18
|
-
* - `<a-icon size="N">` maps to `--icon-size` via CSS Values 5 typed
|
|
19
|
-
* `attr()` (Chrome 133+ / Safari 18.2+) behind an `@supports` guard.
|
|
20
|
-
* Custom properties parse permissively, so without the guard the invalid
|
|
21
|
-
* `attr()` would only fail later, at `width: var(--icon-size)`
|
|
22
|
-
* substitution — collapsing the icon to 0×0 on unsupported engines
|
|
23
|
-
* instead of falling back to the 16px base. The `<Icon size={N}>` JSX
|
|
24
|
-
* wrapper sets `--icon-size` inline as a plain length and is the
|
|
25
|
-
* cross-browser path.
|
|
26
|
-
*/
|
|
5
|
+
/** Compatibility class for applications that explicitly register `<a-icon>`.
|
|
6
|
+
* Icon renders through CSS and does not require registration. */
|
|
27
7
|
export declare class AIconElement extends HTMLElementBase {
|
|
28
8
|
}
|
|
9
|
+
/** Register the compatibility class when an integration requires a defined tag.
|
|
10
|
+
* Ordinary Icon usage needs only its stylesheet. */
|
|
29
11
|
export declare function register_a_icon(): void;
|
package/dist/elements/a-icon.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HTMLElementBase } from "../
|
|
1
|
+
import { HTMLElementBase } from "../element-base";
|
|
2
2
|
import "./a-icon.css";
|
|
3
3
|
import "./a-icon.shapes.css";
|
|
4
4
|
import "./a-loader.css";
|
|
@@ -10,7 +10,6 @@ function register_a_icon() {
|
|
|
10
10
|
customElements.define("a-icon", AIconElement);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
register_a_icon();
|
|
14
13
|
export {
|
|
15
14
|
AIconElement,
|
|
16
15
|
register_a_icon
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer base,anta,components,utilities;@layer anta.reset,anta.components,anta.theme;@layer anta.components{a-input-time:not(:defined){display:grid;grid-template-columns:minmax(0,1fr);row-gap:4px}a-input-time:not(:defined)>[slot=leading],a-input-time:not(:defined)>[slot=trailing],a-input-time:not(:defined)>[slot=clear],a-input-time:not(:defined)>[slot=hint]{display:none!important}a-input-time:not(:defined)>[slot=label]{display:block;color:var(--input-time-label);font-family:var(--sans-serif);font-size:var(--input-time-font-size);line-height:var(--input-time-line-height);font-weight:500}a-input-time:not(:defined):after{content:"\2013\2013:\2013\2013";display:block;min-height:var(--input-time-field-height);line-height:var(--input-time-field-height);padding-inline:8px;border-radius:var(--input-time-field-radius);box-shadow:inset 0 0 0 .5px var(--input-time-border);color:var(--input-time-placeholder);font-family:var(--sans-serif);font-size:var(--input-time-font-size);font-weight:400;font-stretch:normal;font-style:normal;font-variant-numeric:tabular-nums;white-space:nowrap}@media(forced-colors:active){a-input-time:not(:defined):after{border:1px solid ButtonBorder}}a-input-time{transition:opacity .28s ease-out 40ms}a-input-time:not(:defined){opacity:.5}@media(prefers-reduced-motion:reduce){a-input-time{transition:none}}a-input-time{--input-time-bg: var(--bg-1);--input-time-border: var(--border-2);--input-time-border-hover: var(--border-1);--input-time-text: var(--text-1);--input-time-label: var(--text-3);--input-time-placeholder: var(--text-3);--input-time-adornment: var(--text-3);--input-time-hint: var(--text-3);--input-time-period-color: var(--text-3);--input-time-font-size: 15px;--input-time-line-height: 20px;--input-time-field-height: 28px;--input-time-field-radius: 4px;width:fit-content;max-width:100%}a-input-time:has(>[slot=label])::part(label){display:block}a-input-time:has(>[slot=leading])::part(leading){display:flex;align-items:center;flex-shrink:0
|
|
1
|
+
@layer base,anta,components,utilities;@layer anta.reset,anta.components,anta.theme;@layer anta.components{a-input-time{display:grid;grid-template-columns:minmax(0,1fr);row-gap:4px;outline:none}a-input-time::part(label){display:none;color:var(--input-time-label);font-family:var(--sans-serif);font-size:var(--input-time-font-size);line-height:var(--input-time-line-height);font-weight:500}a-input-time::part(field){--_bc: var(--input-time-border);--_bw: .5px;display:flex;align-items:center;box-sizing:border-box;min-height:var(--input-time-field-height);background:var(--input-time-bg);border-radius:var(--input-time-field-radius);box-shadow:inset 0 0 0 var(--_bw) var(--_bc);transition:box-shadow .12s ease}a-input-time[status]:not([status=neutral])::part(field){--_bw: 1px}@media(hover:hover)and (pointer:fine){a-input-time:not(:disabled)::part(field):hover{--_bc: var(--input-time-border-hover);--_bw: 1px}}a-input-time:not(:disabled):not([readonly]):focus::part(field),a-input-time:not(:disabled)[readonly]:focus:state(kb-focus)::part(field){--_bc: var(--input-time-border-hover);--_bw: 1px;outline:1px solid var(--focus-ring);outline-offset:1px}@media(forced-colors:active){a-input-time::part(field){border:1px solid ButtonBorder}}a-input-time::part(leading){display:none;color:var(--input-time-adornment);font-size:var(--input-time-font-size);line-height:var(--input-time-line-height)}a-input-time:disabled::part(leading),a-input-time:disabled::part(trailing){opacity:.5;pointer-events:none}a-input-time::part(segments){display:flex;align-items:center;flex:1 1 auto;min-width:0;padding-inline:7px;color:var(--input-time-text);font-family:var(--sans-serif);font-stretch:normal;font-style:normal;font-size:var(--input-time-font-size);line-height:var(--input-time-line-height);font-weight:400}a-input-time::part(segment){appearance:none;display:inline-block;box-sizing:border-box;min-width:0;padding-inline:1px;border:0;border-radius:2px;background:transparent;color:inherit;font:inherit;font-variation-settings:inherit;font-stretch:inherit;font-style:inherit;line-height:inherit;text-align:center;white-space:nowrap;outline:none;cursor:text;font-variant-numeric:tabular-nums}a-input-time::part(period){color:var(--input-time-period-color)}a-input-time::part(segment)::placeholder{color:var(--input-time-placeholder);opacity:1}a-input-time::part(literal){margin-inline:-1px;white-space:pre;color:var(--input-time-text)}a-input-time:disabled::part(segments){cursor:not-allowed}a-input-time:disabled::part(segment){cursor:not-allowed}a-input-time::part(trailing){display:none;color:var(--input-time-adornment);font-size:var(--input-time-font-size);line-height:var(--input-time-line-height)}a-input-time::part(clear){display:flex;align-items:center;flex-shrink:0;visibility:hidden;box-sizing:border-box}a-input-time:state(filled):not(:disabled):not([readonly])::part(clear){visibility:visible}a-input-time::part(hint){display:none;gap:4px;align-items:flex-start;padding-inline-start:1px;color:var(--input-time-hint);font-family:var(--sans-serif);font-size:calc(var(--input-time-font-size) - 1px);line-height:calc(var(--input-time-line-height) - 2px)}a-input-time:not(:defined){display:grid;grid-template-columns:minmax(0,1fr);row-gap:4px}a-input-time:not(:defined)>[slot=leading],a-input-time:not(:defined)>[slot=trailing],a-input-time:not(:defined)>[slot=clear],a-input-time:not(:defined)>[slot=hint]{display:none!important}a-input-time:not(:defined)>[slot=label]{display:block;color:var(--input-time-label);font-family:var(--sans-serif);font-size:var(--input-time-font-size);line-height:var(--input-time-line-height);font-weight:500}a-input-time:not(:defined):after{content:"\2013\2013:\2013\2013";display:block;min-height:var(--input-time-field-height);line-height:var(--input-time-field-height);padding-inline:8px;border-radius:var(--input-time-field-radius);box-shadow:inset 0 0 0 .5px var(--input-time-border);color:var(--input-time-placeholder);font-family:var(--sans-serif);font-size:var(--input-time-font-size);font-weight:400;font-stretch:normal;font-style:normal;font-variant-numeric:tabular-nums;white-space:nowrap}@media(forced-colors:active){a-input-time:not(:defined):after{border:1px solid ButtonBorder}}a-input-time{transition:opacity .28s ease-out 40ms}a-input-time:not(:defined){opacity:.5}@media(prefers-reduced-motion:reduce){a-input-time{transition:none}}a-input-time{--_input-time-action-size: 24px;--input-time-bg: var(--bg-1);--input-time-border: var(--border-2);--input-time-border-hover: var(--border-1);--input-time-text: var(--text-1);--input-time-label: var(--text-3);--input-time-placeholder: var(--text-3);--input-time-adornment: var(--text-3);--input-time-hint: var(--text-3);--input-time-period-color: var(--text-3);--input-time-font-size: 15px;--input-time-line-height: 20px;--input-time-field-height: 28px;--input-time-field-radius: 4px;width:fit-content;max-width:100%}a-input-time:defined>:is(a-input-time-label,a-input-time-leading,a-input-time-clear,a-input-time-trailing,a-input-time-hint){display:contents}a-input-time:has(>[slot=label])::part(label){display:block}a-input-time:has(>[slot=leading])::part(leading),a-input-time:has(>[slot=trailing])::part(trailing){display:flex;align-items:center;flex-shrink:0}a-input-time:has(>[slot=leading])::part(leading){margin-inline-start:7px}a-input-time:has(>[slot=trailing])::part(trailing){gap:2px;margin-inline-end:var(--input-time-trailing-inset, 7px)}a-input-time:has(>[slot=leading])::part(segments){padding-inline-start:4px}a-input-time:has(>[slot=hint])::part(hint){display:flex}a-input-time>:is([slot=clear],[slot=trailing]) :is(a-button,button[data-anta],a[role=button][data-anta]),a-input-time>:is(a-button,button[data-anta],a[role=button][data-anta]):is([slot=clear],[slot=trailing]){--_fs: var(--input-time-font-size);--_lh: var(--input-time-line-height);--_pb: 0px;box-sizing:border-box;width:auto;min-width:var(--_input-time-action-size);height:var(--_input-time-action-size);min-height:0;justify-content:center;&[data-anta-icon-only]{width:var(--_input-time-action-size)}}a-input-time:state(trailing-actions)::part(trailing){margin-inline-end:0;padding-inline-end:var(--input-time-trailing-inset, 2px)}a-input-time[size=small]{--input-time-font-size: 13px;--input-time-line-height: 16px;--input-time-field-height: 24px;--_input-time-action-size: 20px}a-input-time[size=large]{--input-time-font-size: 17px;--input-time-line-height: 22px;--input-time-field-height: 32px;--_input-time-action-size: 28px}a-input-time[round]{--input-time-round: 999px;--input-time-field-radius: var(--input-time-round, 999px);@supports (border-radius: attr(probe type(<length>),1px)){--input-time-round: attr(round type(<length>), 999px)}}a-input-time[size=small] a-icon{--icon-size: 14px}a-input-time[size=large] a-icon{--icon-size: 18px}a-input-time[tone]:not([tone=""]):not([status]:not([status=neutral])){--input-time-tone-source: var(--border-2);--input-time-border: light-dark( oklch(from var(--input-time-tone-source) .7 calc(c*.8) h), oklch(from var(--input-time-tone-source) .5 calc(c*.8) h) );--input-time-border-hover: oklch(from var(--input-time-tone-source) .6 c h);@supports (color: attr(probe type(<color>),red)){--input-time-tone-source: attr(tone type(<color>), var(--border-2))}}a-input-time[status=critical]{--input-time-status-source: var(--anta-seed-critical);--input-time-bg: var(--bg-2-critical);--input-time-hint: var(--text-2-critical)}a-input-time[status=warning]{--input-time-status-source: var(--anta-seed-warning);--input-time-bg: var(--bg-2-warning);--input-time-hint: var(--text-2-warning)}a-input-time[status=success]{--input-time-status-source: var(--anta-seed-success);--input-time-bg: var(--bg-2-success);--input-time-hint: var(--text-2-success)}a-input-time[status=info]{--input-time-status-source: var(--anta-seed-info);--input-time-bg: var(--bg-2-info);--input-time-hint: var(--text-2-info)}a-input-time[status=brand]{--input-time-status-source: var(--anta-seed-brand);--input-time-bg: var(--bg-2-brand);--input-time-hint: var(--text-2-brand)}a-input-time[status]:not([status=neutral]){--input-time-border: light-dark( oklch(from var(--input-time-status-source) .58 c h), oklch(from var(--input-time-status-source) .52 c h) );--input-time-border-hover: var(--input-time-border)}a-input-time:disabled{--input-time-bg: light-dark(#44374b12, #e4d1ef0d);--input-time-border: light-dark(#44374b26, #e4d1ef1f);--input-time-border-hover: var(--input-time-border);--input-time-text: var(--text-4);--input-time-label: var(--text-4);--input-time-hint: var(--text-5);cursor:not-allowed}}@layer anta.components{a-input-time[dim-actions]::part(leading),a-input-time[dim-actions]::part(trailing),a-input-time[dim-actions]::part(clear){opacity:var(--_input-time-actions-opacity, .6);transition:opacity .12s ease}a-input-time[dim-actions]:not(:disabled)::part(field):hover,a-input-time[dim-actions]:not(:disabled)::part(field):focus-within{--_input-time-actions-opacity: 1}a-input-time:has(>[slot=clear])::part(clear){padding:2px}a-input-time[dim-actions]:disabled::part(leading),a-input-time[dim-actions]:disabled::part(trailing){opacity:.5}@media(prefers-reduced-motion:reduce){a-input-time::part(field),a-input-time[dim-actions]::part(leading),a-input-time[dim-actions]::part(trailing),a-input-time[dim-actions]::part(clear){transition:none}}}
|
|
@@ -10,6 +10,7 @@ export declare class AInputTimeElement extends HTMLElementBase {
|
|
|
10
10
|
constructor();
|
|
11
11
|
getAnchorRect(): DOMRect;
|
|
12
12
|
connectedCallback(): void;
|
|
13
|
+
disconnectedCallback(): void;
|
|
13
14
|
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
|
14
15
|
removeAttribute(name: string): void;
|
|
15
16
|
toggleAttribute(name: string, force?: boolean): boolean;
|
|
@@ -23,7 +24,7 @@ export declare class AInputTimeElement extends HTMLElementBase {
|
|
|
23
24
|
/** Focus the first editable segment. */
|
|
24
25
|
focus(options?: FocusOptions): void;
|
|
25
26
|
get name(): string;
|
|
26
|
-
set name(v: string);
|
|
27
|
+
set name(v: string | null | undefined);
|
|
27
28
|
get validity(): ValidityState | undefined;
|
|
28
29
|
get validationMessage(): string;
|
|
29
30
|
get willValidate(): boolean;
|