@antadesign/anta 0.3.32 → 0.3.34
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/avatar-core.d.ts +7 -2
- package/dist/bundle.css +1 -1
- package/dist/bundle.js +48 -58
- package/dist/components/Breadcrumbs.d.ts +0 -1
- package/dist/components/Breadcrumbs.js +0 -1
- package/dist/components/Button.d.ts +2 -3
- package/dist/components/Input.d.ts +9 -3
- package/dist/components/Input.js +2 -0
- package/dist/components/InputDate.d.ts +0 -1
- package/dist/components/InputDate.js +0 -1
- package/dist/components/Select.d.ts +0 -1
- package/dist/components/Select.js +0 -1
- package/dist/components/SelectFaceted.d.ts +0 -1
- package/dist/components/SelectFaceted.js +0 -1
- package/dist/components/Slider.d.ts +22 -10
- package/dist/components/Slider.js +9 -5
- package/dist/components/Steps.d.ts +0 -1
- package/dist/components/Steps.js +0 -1
- package/dist/components/Tabs.js +2 -1
- package/dist/components/Title.d.ts +3 -1
- package/dist/elements/a-avatar.css +1 -1
- package/dist/elements/a-avatar.js +2 -28
- package/dist/elements/a-breadcrumbs.d.ts +1 -0
- package/dist/elements/a-breadcrumbs.js +1 -0
- package/dist/elements/a-button.css +1 -1
- package/dist/elements/a-button.d.ts +8 -6
- package/dist/elements/a-button.js +2 -4
- package/dist/elements/a-dialog.js +3 -1
- package/dist/elements/a-input-date.d.ts +1 -0
- package/dist/elements/a-input-date.js +1 -0
- package/dist/elements/a-input-time.js +1 -2
- package/dist/elements/a-input.css +1 -1
- package/dist/elements/a-input.js +13 -10
- package/dist/elements/a-menu.d.ts +1 -1
- package/dist/elements/a-menu.js +17 -4
- package/dist/elements/a-select-faceted.d.ts +1 -0
- package/dist/elements/a-select-faceted.js +1 -0
- package/dist/elements/a-select.d.ts +1 -0
- package/dist/elements/a-select.js +1 -0
- package/dist/elements/a-slider.d.ts +7 -5
- package/dist/elements/a-slider.js +256 -59
- package/dist/elements/a-steps.d.ts +1 -0
- package/dist/elements/a-steps.js +1 -0
- package/dist/elements/a-tabpanel.d.ts +2 -2
- package/dist/elements/a-tabpanel.js +13 -3
- package/dist/elements/a-tag.d.ts +1 -0
- package/dist/elements/a-tag.js +1 -0
- package/dist/elements/a-title.d.ts +1 -0
- package/dist/elements/a-title.js +1 -0
- package/dist/elements/index.d.ts +7 -1
- package/dist/elements/index.js +4 -0
- package/dist/general_types.d.ts +9 -4
- package/dist/index.d.ts +1 -1
- package/dist/theme-antithesis.css +1 -1
- package/dist/theme-antune.css +1 -1
- package/docs/changelog.md +61 -0
- package/docs/components/breadcrumbs.md +9 -6
- package/docs/components/button.md +9 -6
- package/docs/components/input.md +29 -9
- package/docs/components/panel.md +3 -2
- package/docs/components/select-faceted.md +19 -19
- package/docs/components/slider.md +139 -4
- package/docs/components/steps.md +4 -2
- package/docs/install-config.md +295 -87
- package/docs/packages/plot.md +222 -20
- package/docs/theming.md +22 -13
- package/package.json +7 -4
package/dist/elements/a-input.js
CHANGED
|
@@ -60,8 +60,8 @@ const SHADOW_STYLE = `
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
.field {
|
|
63
|
-
--_bc: var(--input-border);
|
|
64
|
-
--_bw:
|
|
63
|
+
--_bc: var(--input-rest-border);
|
|
64
|
+
--_bw: var(--input-border-width);
|
|
65
65
|
--_pad-block: 4px;
|
|
66
66
|
|
|
67
67
|
display: flex;
|
|
@@ -74,7 +74,6 @@ const SHADOW_STYLE = `
|
|
|
74
74
|
transition: box-shadow 120ms ease;
|
|
75
75
|
}
|
|
76
76
|
:host([multiline]) .field { align-items: stretch; }
|
|
77
|
-
:host([status]:not([status="neutral"])) .field { --_bw: 1px; }
|
|
78
77
|
:host([size="small"]) { --_fs: 13px; --_lh: 16px; }
|
|
79
78
|
:host([size="large"]) { --_fs: 17px; --_lh: 22px; }
|
|
80
79
|
:host([size="small"]) .field { min-height: 24px; }
|
|
@@ -82,13 +81,14 @@ const SHADOW_STYLE = `
|
|
|
82
81
|
:host([round]) .field { border-radius: var(--input-round, 999px); }
|
|
83
82
|
|
|
84
83
|
@media (hover: hover) and (pointer: fine) {
|
|
85
|
-
:host(:not(:disabled)) .field:hover { --_bw: 1px; }
|
|
84
|
+
:host(:not(:disabled)) .field:hover { --_bw: 1px; --_bc: var(--input-border); }
|
|
86
85
|
}
|
|
87
86
|
:host(:not([readonly])) .field:has(input:focus, textarea:focus, button:focus-visible),
|
|
88
87
|
:host([readonly]:state(kb-focus)) .field {
|
|
89
88
|
--_bw: 1px;
|
|
90
|
-
|
|
91
|
-
outline
|
|
89
|
+
--_bc: var(--input-border);
|
|
90
|
+
outline: var(--_input-focus-width, 1px) solid var(--focus-ring);
|
|
91
|
+
outline-offset: var(--_input-focus-offset, 1px);
|
|
92
92
|
}
|
|
93
93
|
@media (forced-colors: active) { .field { border: 1px solid ButtonBorder; } }
|
|
94
94
|
|
|
@@ -163,10 +163,13 @@ const SHADOW_STYLE = `
|
|
|
163
163
|
:host(:disabled) slot[name="leading"],
|
|
164
164
|
:host(:disabled) slot[name="trailing"] { opacity: 0.5; pointer-events: none; }
|
|
165
165
|
|
|
166
|
-
slot[name="clear"] {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
166
|
+
slot[name="clear"] {
|
|
167
|
+
display: flex;
|
|
168
|
+
align-items: center;
|
|
169
|
+
flex-shrink: 0;
|
|
170
|
+
visibility: hidden;
|
|
171
|
+
}
|
|
172
|
+
:host(:state(filled):not(:disabled):not([readonly])) slot[name="clear"] { visibility: visible; }
|
|
170
173
|
|
|
171
174
|
:host([multiline]:state(filled)) slot[name="clear"] {
|
|
172
175
|
align-self: flex-start;
|
|
@@ -206,7 +206,7 @@ export declare class AMenuElement extends HTMLElementBase {
|
|
|
206
206
|
* - nothing → keep open (plain custom content doesn't dismiss).
|
|
207
207
|
*/
|
|
208
208
|
private onSurfaceClick;
|
|
209
|
-
/** Close
|
|
209
|
+
/** Close this popup inside persistent content, or the menu system otherwise. */
|
|
210
210
|
private closeSystem;
|
|
211
211
|
/** Called by the coordinator on the topmost open menu. Handles navigation;
|
|
212
212
|
* roving Enter / Space activation is `<a-menu-item>`'s own delegated keyup
|
package/dist/elements/a-menu.js
CHANGED
|
@@ -783,7 +783,11 @@ class AMenuElement extends HTMLElementBase {
|
|
|
783
783
|
if (parent) {
|
|
784
784
|
const pidx = openStack.indexOf(parent);
|
|
785
785
|
if (pidx !== -1) {
|
|
786
|
-
for (let i = openStack.length - 1; i > pidx; i--)
|
|
786
|
+
for (let i = openStack.length - 1; i > pidx; i--) {
|
|
787
|
+
const menu = openStack[i];
|
|
788
|
+
if (menu !== this && menu.isOpen && !menu._dismissNotified) menu.emitChange("closed");
|
|
789
|
+
menu._doHide();
|
|
790
|
+
}
|
|
787
791
|
openStack.length = pidx + 1;
|
|
788
792
|
}
|
|
789
793
|
}
|
|
@@ -1091,6 +1095,10 @@ class AMenuElement extends HTMLElementBase {
|
|
|
1091
1095
|
* - nothing → keep open (plain custom content doesn't dismiss).
|
|
1092
1096
|
*/
|
|
1093
1097
|
onSurfaceClick = (e) => {
|
|
1098
|
+
for (const node of e.composedPath()) {
|
|
1099
|
+
if (node === this.surface) break;
|
|
1100
|
+
if (node instanceof AMenuElement && node !== this) return;
|
|
1101
|
+
}
|
|
1094
1102
|
let contain = false;
|
|
1095
1103
|
let exemptTrigger = false;
|
|
1096
1104
|
for (const node of e.composedPath()) {
|
|
@@ -1130,11 +1138,15 @@ class AMenuElement extends HTMLElementBase {
|
|
|
1130
1138
|
return this.closeSystem(e);
|
|
1131
1139
|
}
|
|
1132
1140
|
if (node.matches("a[data-anta-menu-item]")) return this.closeSystem(e);
|
|
1133
|
-
if (node.hasAttribute("data-menu-close")) return this.closeSystem(e);
|
|
1141
|
+
if (node.hasAttribute("data-menu-close")) return this.closeSystem(e, true);
|
|
1134
1142
|
}
|
|
1135
1143
|
};
|
|
1136
|
-
/** Close
|
|
1137
|
-
closeSystem(e) {
|
|
1144
|
+
/** Close this popup inside persistent content, or the menu system otherwise. */
|
|
1145
|
+
closeSystem(e, explicit = false) {
|
|
1146
|
+
if (!explicit && this.closest("[data-menu-open]")) {
|
|
1147
|
+
this.requestClose(e);
|
|
1148
|
+
return;
|
|
1149
|
+
}
|
|
1138
1150
|
const root = openStack[0] ?? this;
|
|
1139
1151
|
root.requestClose(e);
|
|
1140
1152
|
}
|
|
@@ -1309,6 +1321,7 @@ class AMenuElement extends HTMLElementBase {
|
|
|
1309
1321
|
return;
|
|
1310
1322
|
} else {
|
|
1311
1323
|
const onClick = (e) => {
|
|
1324
|
+
if (anchor.matches("a-input") && e.composedPath().some((node) => node instanceof Element && node.getAttribute("slot") === "clear")) return;
|
|
1312
1325
|
const viaKeyboard = e.detail === 0;
|
|
1313
1326
|
const coord = this.#isCoord ? viaKeyboard ? this.#anchorCoord(anchor) : [e.clientX, e.clientY] : void 0;
|
|
1314
1327
|
if (this._shown) this.requestClose(e);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '../components/select-parts.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../components/select-parts.css";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '../components/select-parts.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../components/select-parts.css";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { HTMLElementBase } from '../anta_helpers';
|
|
2
2
|
import './a-slider.css';
|
|
3
|
+
type SliderValue = number | [number, number];
|
|
3
4
|
/**
|
|
4
|
-
* `<a-slider>` is a form-associated single-value slider. Its rail uses relative
|
|
5
|
+
* `<a-slider>` is a form-associated single-value or range slider. Its rail uses relative
|
|
5
6
|
* dragging by default: pressing any point captures the pointer, while only the
|
|
6
7
|
* subsequent horizontal movement changes the value. Set `track-click="jump"`
|
|
7
8
|
* for the conventional position-based track click.
|
|
@@ -11,10 +12,10 @@ export declare class ASliderElement extends HTMLElementBase {
|
|
|
11
12
|
static formAssociated: boolean;
|
|
12
13
|
static observedAttributes: string[];
|
|
13
14
|
private internals?;
|
|
14
|
-
get value():
|
|
15
|
-
set value(value:
|
|
16
|
-
get defaultValue():
|
|
17
|
-
set defaultValue(value:
|
|
15
|
+
get value(): SliderValue;
|
|
16
|
+
set value(value: SliderValue | string);
|
|
17
|
+
get defaultValue(): SliderValue;
|
|
18
|
+
set defaultValue(value: SliderValue | string);
|
|
18
19
|
constructor();
|
|
19
20
|
connectedCallback(): void;
|
|
20
21
|
attributeChangedCallback(name: string): void;
|
|
@@ -23,3 +24,4 @@ export declare class ASliderElement extends HTMLElementBase {
|
|
|
23
24
|
formDisabledCallback(): void;
|
|
24
25
|
}
|
|
25
26
|
export declare function register_a_slider(): void;
|
|
27
|
+
export {};
|