@antadesign/anta 0.3.3 → 0.3.5
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 +9 -3
- package/dist/components/Calendar.js +24 -7
- package/dist/components/InputDate.d.ts +9 -6
- package/dist/components/InputDate.js +83 -143
- package/dist/components/InputDate.module.css +1 -1
- package/dist/components/InputTime.d.ts +105 -0
- package/dist/components/InputTime.js +110 -0
- package/dist/components/Menu.d.ts +15 -1
- package/dist/components/Menu.js +2 -0
- package/dist/components/MenuItem.js +1 -7
- package/dist/components/Select.d.ts +96 -14
- package/dist/components/Select.js +69 -8
- package/dist/components/Select.module.css +1 -1
- package/dist/components/SelectFaceted.d.ts +184 -0
- package/dist/components/SelectFaceted.js +331 -0
- package/dist/components/SelectFaceted.module.css +1 -0
- package/dist/components/TabPanel.d.ts +21 -13
- package/dist/components/TabPanel.js +13 -2
- package/dist/components/Tabs.d.ts +76 -52
- package/dist/components/Tabs.js +18 -86
- package/dist/elements/a-button.css +1 -1
- package/dist/elements/a-calendar.css +1 -1
- package/dist/elements/a-checkbox.css +1 -1
- package/dist/elements/a-input-time.css +1 -0
- package/dist/elements/a-input-time.d.ts +27 -0
- package/dist/elements/a-input-time.js +856 -0
- package/dist/elements/a-input.css +1 -1
- package/dist/elements/a-input.js +8 -1
- 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 +71 -25
- package/dist/elements/a-radio.css +1 -1
- package/dist/elements/a-tab.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/a-tabs.css +1 -1
- package/dist/elements/a-tooltip.js +1 -1
- package/dist/elements/index.d.ts +2 -1
- package/dist/elements/index.js +6 -1
- package/dist/general_types.d.ts +83 -11
- package/dist/index.d.ts +7 -5
- package/dist/index.js +6 -3
- package/dist/jsx-runtime.d.ts +2 -1
- package/dist/reset.css +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
|
@@ -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-3);--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;
|
|
@@ -120,7 +121,13 @@ const SHADOW_STYLE = `
|
|
|
120
121
|
input::-webkit-outer-spin-button { -webkit-appearance: none; appearance: none; display: none; }
|
|
121
122
|
input::-ms-clear, input::-ms-reveal { display: none; }
|
|
122
123
|
|
|
123
|
-
slot[name="leading"], slot[name="trailing"] {
|
|
124
|
+
slot[name="leading"], slot[name="trailing"] {
|
|
125
|
+
display: none;
|
|
126
|
+
color: var(--input-adornment);
|
|
127
|
+
font-size: var(--_fs);
|
|
128
|
+
line-height: var(--_lh);
|
|
129
|
+
font-variation-settings: "wdth" 88, "slnt" 0, "ital" 0;
|
|
130
|
+
}
|
|
124
131
|
.field.has-leading slot[name="leading"],
|
|
125
132
|
.field.has-trailing slot[name="trailing"] {
|
|
126
133
|
display: flex;
|
|
@@ -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>a-checkbox:before,a-menu-item>a-checkbox:after,a-menu-item>a-radio:before{margin-block-start:0}a-menu-item>a-radio:after{margin-block-start:calc((var(--radio-control-size) - (var(--radio-dot-size) - var(--_radio-dot-adjust))) / 2)}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
|
package/dist/elements/a-menu.js
CHANGED
|
@@ -134,6 +134,10 @@ class AMenuElement extends HTMLElementBase {
|
|
|
134
134
|
* but stays visible until the consumer flips `state`. The flag lets the
|
|
135
135
|
* `closeAll` backstop skip a duplicate emit. Cleared on every show. */
|
|
136
136
|
_dismissNotified = false;
|
|
137
|
+
// Custom-state carrier — exposes the menu's own open state as `:state(open)`
|
|
138
|
+
// (off-DOM, like `a-menu-item`'s `:state(active)`). Never used to mutate light
|
|
139
|
+
// DOM; see `reflectOpen`.
|
|
140
|
+
internals;
|
|
137
141
|
// Submenu hover-intent timers.
|
|
138
142
|
openTimer;
|
|
139
143
|
closeTimer;
|
|
@@ -142,7 +146,8 @@ class AMenuElement extends HTMLElementBase {
|
|
|
142
146
|
typeTimer;
|
|
143
147
|
// Combobox (filter) state — engaged when a `[data-menu-search]` field is slotted
|
|
144
148
|
// in (e.g. `Select` with `filter`). Focus stays in that field; ArrowUp/Down move
|
|
145
|
-
// `activeItem` (a cursor, not DOM focus) and
|
|
149
|
+
// `activeItem` (a cursor, not DOM focus) and REPORT it via the `activedescendant`
|
|
150
|
+
// event, which the reactive layer reflects onto the field's `aria-activedescendant`.
|
|
146
151
|
activeItem = null;
|
|
147
152
|
comboObserver;
|
|
148
153
|
// The vertical side chosen at open (true = flipped above the anchor). A re-anchor
|
|
@@ -151,6 +156,10 @@ class AMenuElement extends HTMLElementBase {
|
|
|
151
156
|
_flippedTop = null;
|
|
152
157
|
constructor() {
|
|
153
158
|
super();
|
|
159
|
+
try {
|
|
160
|
+
this.internals = this.attachInternals?.();
|
|
161
|
+
} catch {
|
|
162
|
+
}
|
|
154
163
|
const shadow = this.attachShadow({ mode: "open" });
|
|
155
164
|
const style = document.createElement("style");
|
|
156
165
|
style.textContent = `
|
|
@@ -449,9 +458,9 @@ class AMenuElement extends HTMLElementBase {
|
|
|
449
458
|
return el && el.closest("a-menu") === this ? el : null;
|
|
450
459
|
}
|
|
451
460
|
/** Move the combobox cursor. Sets the item's `active` **property** (off-DOM
|
|
452
|
-
* `:state(active)`, no attribute churn) and
|
|
453
|
-
*
|
|
454
|
-
* `aria-
|
|
461
|
+
* `:state(active)`, no attribute churn) for the highlight, and REPORTS the
|
|
462
|
+
* active id via the `activedescendant` event so the reactive layer can set
|
|
463
|
+
* `aria-activedescendant` on the light-DOM field. `null` clears the cursor. */
|
|
455
464
|
setActive(item) {
|
|
456
465
|
if (this.activeItem && this.activeItem !== item) this.activeItem.active = false;
|
|
457
466
|
this.activeItem = item;
|
|
@@ -459,10 +468,9 @@ class AMenuElement extends HTMLElementBase {
|
|
|
459
468
|
item.active = true;
|
|
460
469
|
item.scrollIntoView?.({ block: "nearest" });
|
|
461
470
|
}
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
else s.removeAttribute("aria-activedescendant");
|
|
471
|
+
this.dispatchEvent(
|
|
472
|
+
new CustomEvent("activedescendant", { detail: { id: item?.id ?? null } })
|
|
473
|
+
);
|
|
466
474
|
}
|
|
467
475
|
/** Re-seat the cursor on the first option — but only once the filter has input.
|
|
468
476
|
* An empty filter (e.g. right after opening) shows NO active row, so the first
|
|
@@ -553,6 +561,15 @@ class AMenuElement extends HTMLElementBase {
|
|
|
553
561
|
* uncontrolled and not vetoed. */
|
|
554
562
|
requestClose(originEvent) {
|
|
555
563
|
if (!this._shown) return;
|
|
564
|
+
const idx = openStack.indexOf(this);
|
|
565
|
+
if (idx !== -1) {
|
|
566
|
+
for (let i = openStack.length - 1; i > idx; i--) {
|
|
567
|
+
const m = openStack[i];
|
|
568
|
+
if (m.isOpen && !m._dismissNotified) m.emitChange("closed");
|
|
569
|
+
m._doHide();
|
|
570
|
+
}
|
|
571
|
+
openStack.length = idx + 1;
|
|
572
|
+
}
|
|
556
573
|
const ok = this.emitChange("closed", { originEvent });
|
|
557
574
|
if (this.isControlled) {
|
|
558
575
|
this._dismissNotified = true;
|
|
@@ -661,7 +678,7 @@ class AMenuElement extends HTMLElementBase {
|
|
|
661
678
|
if (this.surface.isConnected && !this._shown) this.surface.showPopover();
|
|
662
679
|
this._shown = true;
|
|
663
680
|
this._dismissNotified = false;
|
|
664
|
-
this.
|
|
681
|
+
this.reflectOpen(true);
|
|
665
682
|
this.hideAnchorTooltip();
|
|
666
683
|
this.position(coord, instant);
|
|
667
684
|
}
|
|
@@ -677,24 +694,24 @@ class AMenuElement extends HTMLElementBase {
|
|
|
677
694
|
_doHide() {
|
|
678
695
|
if (this.surface.isConnected && this._shown) this.surface.hidePopover();
|
|
679
696
|
this._shown = false;
|
|
680
|
-
this.
|
|
697
|
+
this.reflectOpen(false);
|
|
681
698
|
this.cancelOpenTimer();
|
|
682
699
|
this.cancelCloseTimer();
|
|
683
700
|
}
|
|
684
|
-
/**
|
|
685
|
-
*
|
|
686
|
-
*
|
|
687
|
-
*
|
|
688
|
-
*
|
|
689
|
-
*
|
|
690
|
-
*
|
|
691
|
-
*
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
701
|
+
/** Expose the menu's OWN open state as an off-DOM custom state (`:state(open)`),
|
|
702
|
+
* never a light-DOM attribute. A web component must not mutate light DOM — it
|
|
703
|
+
* desyncs the worker-thread reactive model, which owns the light tree. A
|
|
704
|
+
* submenu parent lights its open branch purely in CSS via
|
|
705
|
+
* `a-menu-item:has(> a-menu:state(open))`; the state is element-owned (like
|
|
706
|
+
* `a-menu-item`'s `:state(active)`) and, being off-DOM, survives a reactive
|
|
707
|
+
* re-render without the element ever writing an attribute. Set on every menu
|
|
708
|
+
* (harmless on roots — no `a-menu-item` parent matches the selector). */
|
|
709
|
+
reflectOpen(open) {
|
|
710
|
+
try {
|
|
711
|
+
if (open) this.internals?.states.add("open");
|
|
712
|
+
else this.internals?.states.delete("open");
|
|
713
|
+
} catch {
|
|
714
|
+
}
|
|
698
715
|
}
|
|
699
716
|
/* ============================ positioning ============================ */
|
|
700
717
|
position(coord, sync = false, reanchor = false) {
|
|
@@ -734,7 +751,8 @@ class AMenuElement extends HTMLElementBase {
|
|
|
734
751
|
} else {
|
|
735
752
|
const a = this.triggerAnchor ? anchorRect(this.triggerAnchor) : null;
|
|
736
753
|
if (!a) return;
|
|
737
|
-
surface.style.
|
|
754
|
+
if (this.hasAttribute("autowidth")) surface.style.removeProperty("--_anchor-width");
|
|
755
|
+
else surface.style.setProperty("--_anchor-width", `${Math.ceil(a.width)}px`);
|
|
738
756
|
const p = this.#placement;
|
|
739
757
|
const spaceBelow = vh - a.bottom - 2 * MARGIN;
|
|
740
758
|
const spaceAbove = a.top - 2 * MARGIN;
|
|
@@ -779,6 +797,23 @@ class AMenuElement extends HTMLElementBase {
|
|
|
779
797
|
* - nothing → keep open (plain custom content doesn't dismiss).
|
|
780
798
|
*/
|
|
781
799
|
onSurfaceClick = (e) => {
|
|
800
|
+
for (const node of e.composedPath()) {
|
|
801
|
+
if (node === this.surface) break;
|
|
802
|
+
if (node instanceof AMenuItemElement) {
|
|
803
|
+
if (!node.hasAttribute("disabled") && !node.querySelector("a-menu") && node.closest("a-menu") === this) {
|
|
804
|
+
node.dispatchEvent(
|
|
805
|
+
new MouseEvent("menuselect", {
|
|
806
|
+
bubbles: false,
|
|
807
|
+
altKey: e.altKey,
|
|
808
|
+
ctrlKey: e.ctrlKey,
|
|
809
|
+
metaKey: e.metaKey,
|
|
810
|
+
shiftKey: e.shiftKey
|
|
811
|
+
})
|
|
812
|
+
);
|
|
813
|
+
}
|
|
814
|
+
break;
|
|
815
|
+
}
|
|
816
|
+
}
|
|
782
817
|
for (const node of e.composedPath()) {
|
|
783
818
|
if (node === this.surface) break;
|
|
784
819
|
if (!(node instanceof Element)) continue;
|
|
@@ -974,12 +1009,23 @@ class AMenuElement extends HTMLElementBase {
|
|
|
974
1009
|
scheduleClose() {
|
|
975
1010
|
this.cancelOpenTimer();
|
|
976
1011
|
if (!this._shown) return;
|
|
1012
|
+
if (this.#hasKeyboardFocusInside) return;
|
|
977
1013
|
this.cancelCloseTimer();
|
|
978
1014
|
this.closeTimer = setTimeout(() => {
|
|
979
1015
|
this.closeTimer = void 0;
|
|
980
1016
|
this.requestClose();
|
|
981
1017
|
}, SUBMENU_CLOSE_DELAY);
|
|
982
1018
|
}
|
|
1019
|
+
/** True when the document's focused element is inside this menu AND is
|
|
1020
|
+
* keyboard-focused (`:focus-visible`). Distinguishes "arrowed into the flyout"
|
|
1021
|
+
* (keep it open on hover-out) from a mouse-click focus (close as usual).
|
|
1022
|
+
* `activeElement` retargets to the shadow host at the document level, so a
|
|
1023
|
+
* focused menu item (or its delegated inner control) reads as a light-DOM
|
|
1024
|
+
* descendant here. */
|
|
1025
|
+
get #hasKeyboardFocusInside() {
|
|
1026
|
+
const active = this.doc.activeElement;
|
|
1027
|
+
return !!active && this.contains(active) && active.matches(":focus-visible");
|
|
1028
|
+
}
|
|
983
1029
|
cancelOpenTimer() {
|
|
984
1030
|
if (this.openTimer !== void 0) {
|
|
985
1031
|
clearTimeout(this.openTimer);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer anta{a-radio{--radio-control-size: 16px;--radio-border-width: 1.5px;--radio-dot-size: 6px;--_radio-dot-adjust: 0px;--radio-gap: 8px;--radio-bg: var(--bg-1);--radio-fill: #635b65;--radio-fill-hover: #534c57;--radio-fill-active: #49424c;--radio-border-neutral: #d4ced4;--radio-border: var(--radio-border-neutral);--radio-border-hover: #c1b9c1;--radio-border-active: #9f99a1;--radio-dot: #ffffff;--radio-dot-disabled: #c1b9c1;--radio-bg-disabled: color-mix(in oklch, #44374b 10%, transparent);--radio-border-disabled: color-mix(in oklch, #44374b 15%, transparent);--radio-label-color: var(--text-2);--radio-label-color-disabled: var(--text-4);--radio-hint-color: var(--text-3);--radio-label-fs: 15px;--radio-label-lh: 20px;--radio-hint-fs: 14px;--radio-hint-lh: 17px;display:inline-grid;grid-template-columns:auto 1fr;align-items:center;column-gap:var(--radio-gap);cursor:pointer;user-select:none;-webkit-user-drag:none;vertical-align:middle;outline:none;color:var(--radio-label-color);font-family:var(--sans-serif);font-size:var(--radio-label-fs);line-height:var(--radio-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:var(--radio-control-size);block-size:var(--radio-control-size);border-radius:50%;background:var(--radio-bg);border:var(--radio-border-width) solid var(--radio-border);transition:background-color .15s ease-out,border-color .15s ease-out}&:after{content:"";grid-column:1;grid-row:1 / -1;align-self:center;justify-self:center;inline-size:calc(var(--radio-dot-size) - var(--_radio-dot-adjust));block-size:calc(var(--radio-dot-size) - var(--_radio-dot-adjust));border-radius:50%;background:var(--radio-dot);transform:scale(0);transition:transform .12s ease-out;pointer-events:none}@media(hover:hover)and (pointer:fine){&:not([disabled]):hover:before{border-color:var(--radio-border-hover);transition:background-color 75ms ease-in,border-color 75ms ease-in}&:not([disabled]):hover:state(selected):before{background:var(--radio-fill-hover);border-color:var(--radio-fill-hover)}}&:not([disabled]):active:before{border-color:var(--radio-border-active);transition:background-color 50ms linear,border-color 50ms linear}&:not([disabled]):active:state(selected):before{background:var(--radio-fill-active);border-color:var(--radio-fill-active)}&:state(selected){&:before{background:var(--radio-fill);border-color:var(--radio-fill)}&:after{transform:scale(1)}}&:focus-visible:before{outline:1px solid var(--focus-ring);outline-offset:1px}&[disabled]{cursor:not-allowed;color:var(--radio-label-color-disabled);&:before{background:var(--radio-bg-disabled);border-color:var(--radio-border-disabled);transition:none}&:state(selected):after{background:var(--radio-dot-disabled)}a-radio-hint{color:var(--radio-label-color-disabled)}}&[size=small]{--radio-control-size: 14px;--radio-dot-size: 5px;--radio-gap: 6px;--radio-label-fs: 13px;--radio-label-lh: 16px;--radio-hint-fs: 12px;--radio-hint-lh: 14px}&[size=large]{--radio-control-size: 18px;--radio-dot-size: 7px;--radio-label-fs: 17px;--radio-label-lh: 24px;--radio-hint-fs: 16px;--radio-hint-lh: 21px}}a-radio-label,a-radio-hint{display:block;grid-column:2;min-width:0}a-radio-hint{color:var(--radio-hint-color);font-size:var(--radio-hint-fs);line-height:var(--radio-hint-lh);margin-block-start:2px}a-radio-group:focus-visible a-radio:state(selected):before{outline:1px solid var(--focus-ring);outline-offset:1px}a-radio[tone=brand],a-radio[tone-selected=brand],a-radio-group[tone=brand] a-radio:not([tone]),a-radio-group[tone-selected=brand] a-radio:not([tone-selected]){--radio-fill: #5f4bc3;--radio-fill-hover: #503cb4;--radio-fill-active: #483493}a-radio[tone=neutral],a-radio[tone-selected=neutral],a-radio-group[tone=neutral] a-radio:not([tone]),a-radio-group[tone-selected=neutral] a-radio:not([tone-selected]){--radio-fill: #635b65;--radio-fill-hover: #534c57;--radio-fill-active: #49424c}a-radio[tone=info],a-radio[tone-selected=info],a-radio-group[tone=info] a-radio:not([tone]),a-radio-group[tone-selected=info] a-radio:not([tone-selected]){--radio-fill: #1f6eb2;--radio-fill-hover: #1a5b93;--radio-fill-active: #175082}a-radio[tone=success],a-radio[tone-selected=success],a-radio-group[tone=success] a-radio:not([tone]),a-radio-group[tone-selected=success] a-radio:not([tone-selected]){--radio-fill: #2a7e43;--radio-fill-hover: #226737;--radio-fill-active: #1f5c31}a-radio[tone=warning],a-radio[tone-selected=warning],a-radio-group[tone=warning] a-radio:not([tone]),a-radio-group[tone-selected=warning] a-radio:not([tone-selected]){--radio-fill: #c37416;--radio-fill-hover: #ae6613;--radio-fill-active: #995200}a-radio[tone=critical],a-radio[tone-selected=critical],a-radio-group[tone=critical] a-radio:not([tone]),a-radio-group[tone-selected=critical] a-radio:not([tone-selected]){--radio-fill: #c9302c;--radio-fill-hover: #b02120;--radio-fill-active: #a01c1c}a-radio[tone]:not([tone=""],[tone=neutral]),a-radio-group[tone]:not([tone=""],[tone=neutral]) a-radio:not([tone]){--_radio-border-base: color-mix(in oklch, var(--radio-fill) 70%, var(--radio-border-neutral));--radio-border: oklch(from var(--_radio-border-base) calc(l + .17) c h);--radio-border-hover: oklch(from var(--_radio-border-base) calc(l + .1) c h);--radio-border-active: var(--_radio-border-base);.dark &{--radio-border: var(--_radio-border-base);--radio-border-hover: oklch(from var(--_radio-border-base) calc(l + .1) c h);--radio-border-active: oklch(from var(--_radio-border-base) calc(l + .17) c h)}}a-radio[tone]:not([tone=""],[tone=brand],[tone=neutral],[tone=info],[tone=success],[tone=warning],[tone=critical]){--radio-tone-source: attr(tone type(<color>), transparent)}a-radio[tone-selected]:not([tone-selected=""],[tone-selected=brand],[tone-selected=neutral],[tone-selected=info],[tone-selected=success],[tone-selected=warning],[tone-selected=critical]){--radio-tone-source: attr(tone-selected type(<color>), transparent)}a-radio[tone]:not([tone=""],[tone=brand],[tone=neutral],[tone=info],[tone=success],[tone=warning],[tone=critical]),a-radio[tone-selected]:not([tone-selected=""],[tone-selected=brand],[tone-selected=neutral],[tone-selected=info],[tone-selected=success],[tone-selected=warning],[tone-selected=critical]),a-radio-group[tone]:not([tone=""],[tone=brand],[tone=neutral],[tone=info],[tone=success],[tone=warning],[tone=critical]) a-radio:not([tone]),a-radio-group[tone-selected]:not([tone-selected=""],[tone-selected=brand],[tone-selected=neutral],[tone-selected=info],[tone-selected=success],[tone-selected=warning],[tone-selected=critical]) a-radio:not([tone-selected]){--_tone-l-rest: .5;--_tone-l-hover: .45;--_tone-l-active: .4;--radio-fill: oklch(from var(--radio-tone-source) var(--_tone-l-rest) c h);--radio-fill-hover: oklch(from var(--radio-tone-source) var(--_tone-l-hover) c h);--radio-fill-active: oklch(from var(--radio-tone-source) var(--_tone-l-active) c h);.dark &{--_tone-l-rest: .45;--_tone-l-hover: .5;--_tone-l-active: .57}}.dark a-radio{--_radio-dot-adjust: 1px;&:after{box-shadow:0 0 1px 1px #000}--radio-border-neutral: #49424c;--radio-border-hover: #635b65;--radio-border-active: #776e77;--radio-fill: #534c57;--radio-fill-hover: #635b65;--radio-fill-active: #938d96;--radio-dot-disabled: #635b65;--radio-bg-disabled: color-mix(in oklch, #e4d1ef 10%, transparent);--radio-border-disabled: color-mix(in oklch, #e4d1ef 15%, transparent)}.dark a-radio[tone=brand],.dark a-radio[tone-selected=brand],.dark a-radio-group[tone=brand] a-radio:not([tone]),.dark a-radio-group[tone-selected=brand] a-radio:not([tone-selected]){--radio-fill: #503cb4;--radio-fill-hover: #5f4bc3;--radio-fill-active: #7460d7}.dark a-radio[tone=neutral],.dark a-radio[tone-selected=neutral],.dark a-radio-group[tone=neutral] a-radio:not([tone]),.dark a-radio-group[tone-selected=neutral] a-radio:not([tone-selected]){--radio-fill: #534c57;--radio-fill-hover: #635b65;--radio-fill-active: #938d96}.dark a-radio[tone=info],.dark a-radio[tone-selected=info],.dark a-radio-group[tone=info] a-radio:not([tone]),.dark a-radio-group[tone-selected=info] a-radio:not([tone-selected]){--radio-fill: #1a5b93;--radio-fill-hover: #1f6eb2;--radio-fill-active: #2686d9}.dark a-radio[tone=success],.dark a-radio[tone-selected=success],.dark a-radio-group[tone=success] a-radio:not([tone]),.dark a-radio-group[tone-selected=success] a-radio:not([tone-selected]){--radio-fill: #226737;--radio-fill-hover: #2a7e43;--radio-fill-active: #329550}.dark a-radio[tone=warning],.dark a-radio[tone-selected=warning],.dark a-radio-group[tone=warning] a-radio:not([tone]),.dark a-radio-group[tone-selected=warning] a-radio:not([tone-selected]){--radio-fill: #7f410b;--radio-fill-hover: #995200;--radio-fill-active: #ae6613}.dark a-radio[tone=critical],.dark a-radio[tone-selected=critical],.dark a-radio-group[tone=critical] a-radio:not([tone]),.dark a-radio-group[tone-selected=critical] a-radio:not([tone-selected]){--radio-fill: #b02120;--radio-fill-hover: #c9302c;--radio-fill-active: #de4545}}
|
|
1
|
+
@layer anta{a-radio{--radio-control-size: 16px;--radio-border-width: 1.5px;--radio-dot-size: 6px;--_radio-dot-adjust: 0px;--radio-gap: 8px;--radio-bg: var(--bg-1);--radio-fill: #878089;--radio-fill-hover: #776e77;--radio-fill-active: #635b65;--radio-border-neutral: #d4ced4;--radio-border: var(--radio-border-neutral);--radio-border-hover: #c1b9c1;--radio-border-active: #9f99a1;--radio-dot: #f1eff1;--radio-dot-disabled: #c1b9c1;--radio-bg-disabled: color-mix(in oklch, #44374b 10%, transparent);--radio-border-disabled: color-mix(in oklch, #44374b 10%, transparent);--radio-label-color: var(--text-2);--radio-label-color-disabled: var(--text-4);--radio-hint-color: var(--text-3);--radio-label-fs: 15px;--radio-label-lh: 20px;--radio-hint-fs: 14px;--radio-hint-lh: 17px;display:inline-grid;grid-template-columns:auto 1fr;align-items:start;column-gap:var(--radio-gap);cursor:pointer;user-select:none;-webkit-user-drag:none;vertical-align:middle;outline:none;color:var(--radio-label-color);font-family:var(--sans-serif);font-size:var(--radio-label-fs);line-height:var(--radio-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(--radio-label-lh) - var(--radio-control-size)) / 2);box-sizing:border-box;inline-size:var(--radio-control-size);block-size:var(--radio-control-size);border-radius:50%;background:var(--radio-bg);border:var(--radio-border-width) solid var(--radio-border);transition:background-color .15s ease-out,border-color .15s ease-out}&:after{content:"";grid-column:1;grid-row:1 / -1;align-self:start;justify-self:center;margin-block-start:calc((var(--radio-label-lh) - (var(--radio-dot-size) - var(--_radio-dot-adjust))) / 2);inline-size:calc(var(--radio-dot-size) - var(--_radio-dot-adjust));block-size:calc(var(--radio-dot-size) - var(--_radio-dot-adjust));border-radius:50%;background:var(--radio-dot);transform:scale(0);transition:transform .12s ease-out;pointer-events:none}@media(hover:hover)and (pointer:fine){&:not([disabled]):hover:before{border-color:var(--radio-border-hover);transition:background-color 75ms ease-in,border-color 75ms ease-in}&:not([disabled]):hover:state(selected):before{background:var(--radio-fill-hover);border-color:var(--radio-fill-hover)}}&:not([disabled]):active:before{border-color:var(--radio-border-active);transition:background-color 50ms linear,border-color 50ms linear}&:not([disabled]):active:state(selected):before{background:var(--radio-fill-active);border-color:var(--radio-fill-active)}&:state(selected){&:before{background:var(--radio-fill);border-color:var(--radio-fill)}&:after{transform:scale(1)}}&:focus-visible:before{outline:1px solid var(--focus-ring);outline-offset:1px}&[disabled]{cursor:not-allowed;color:var(--radio-label-color-disabled);&:before{background:var(--radio-bg-disabled);border-color:var(--radio-border-disabled);transition:none}&:state(selected):after{background:var(--radio-dot-disabled)}a-radio-hint{color:var(--radio-label-color-disabled)}}&[size=small]{--radio-control-size: 14px;--radio-dot-size: 5px;--radio-gap: 6px;--radio-label-fs: 13px;--radio-label-lh: 16px;--radio-hint-fs: 12px;--radio-hint-lh: 14px}&[size=large]{--radio-control-size: 18px;--radio-dot-size: 7px;--radio-label-fs: 17px;--radio-label-lh: 22px;--radio-hint-fs: 16px;--radio-hint-lh: 21px}}a-radio-label,a-radio-hint{display:block;grid-column:2;min-width:0}a-radio-hint{color:var(--radio-hint-color);font-size:var(--radio-hint-fs);line-height:var(--radio-hint-lh);margin-block-start:2px}a-radio-group:focus-visible a-radio:state(selected):before{outline:1px solid var(--focus-ring);outline-offset:1px}a-radio[tone=brand],a-radio[tone-selected=brand],a-radio-group[tone=brand] a-radio:not([tone]),a-radio-group[tone-selected=brand] a-radio:not([tone-selected]){--radio-fill: #5f4bc3;--radio-fill-hover: #503cb4;--radio-fill-active: #483493}a-radio[tone=neutral],a-radio[tone-selected=neutral],a-radio-group[tone=neutral] a-radio:not([tone]),a-radio-group[tone-selected=neutral] a-radio:not([tone-selected]){--radio-fill: #878089;--radio-fill-hover: #776e77;--radio-fill-active: #635b65}a-radio[tone=info],a-radio[tone-selected=info],a-radio-group[tone=info] a-radio:not([tone]),a-radio-group[tone-selected=info] a-radio:not([tone-selected]){--radio-fill: #1f6eb2;--radio-fill-hover: #1a5b93;--radio-fill-active: #175082}a-radio[tone=success],a-radio[tone-selected=success],a-radio-group[tone=success] a-radio:not([tone]),a-radio-group[tone-selected=success] a-radio:not([tone-selected]){--radio-fill: #2a7e43;--radio-fill-hover: #226737;--radio-fill-active: #1f5c31}a-radio[tone=warning],a-radio[tone-selected=warning],a-radio-group[tone=warning] a-radio:not([tone]),a-radio-group[tone-selected=warning] a-radio:not([tone-selected]){--radio-fill: #c37416;--radio-fill-hover: #ae6613;--radio-fill-active: #995200}a-radio[tone=critical],a-radio[tone-selected=critical],a-radio-group[tone=critical] a-radio:not([tone]),a-radio-group[tone-selected=critical] a-radio:not([tone-selected]){--radio-fill: #c9302c;--radio-fill-hover: #b02120;--radio-fill-active: #a01c1c}a-radio[tone=brand],a-radio-group[tone=brand] a-radio:not([tone]){--radio-bg: #fcfcfe;--radio-border: #bcb1f1;--radio-border-hover: #9e8eeb;--radio-border-active: #9081df}a-radio[tone=info],a-radio-group[tone=info] a-radio:not([tone]){--radio-bg: #fbfcfe;--radio-border: #93c5ec;--radio-border-hover: #69ace5;--radio-border-active: #56a1e1}a-radio[tone=success],a-radio-group[tone=success] a-radio:not([tone]){--radio-bg: #f7fcf9;--radio-border: #88d7a0;--radio-border-hover: #5bc87b;--radio-border-active: #44c169}a-radio[tone=warning],a-radio-group[tone=warning] a-radio:not([tone]){--radio-bg: #fefbf6;--radio-border: #edb25a;--radio-border-hover: #e09127;--radio-border-active: #d88118}a-radio[tone=critical],a-radio-group[tone=critical] a-radio:not([tone]){--radio-bg: #fefbfb;--radio-border: #efa4a4;--radio-border-hover: #e87f7f;--radio-border-active: #e56c6c}a-radio[tone]:not([tone=""],[tone=neutral],[tone=brand],[tone=info],[tone=success],[tone=warning],[tone=critical]),a-radio-group[tone]:not([tone=""],[tone=neutral],[tone=brand],[tone=info],[tone=success],[tone=warning],[tone=critical]) a-radio:not([tone]){--radio-bg: oklch(from var(--radio-tone-source) .99 calc(c*.03) h);--_radio-border-base: color-mix(in oklch, var(--radio-fill) 70%, var(--radio-border-neutral));--radio-border: oklch(from var(--_radio-border-base) calc(l + .17) c h);--radio-border-hover: oklch(from var(--_radio-border-base) calc(l + .1) c h);--radio-border-active: var(--_radio-border-base);.dark &{--radio-bg: oklch(from var(--radio-tone-source) .15 calc(c*.18) h);--radio-border: var(--_radio-border-base);--radio-border-hover: oklch(from var(--_radio-border-base) calc(l + .1) c h);--radio-border-active: oklch(from var(--_radio-border-base) calc(l + .17) c h)}}a-radio[tone]:not([tone=""],[tone=brand],[tone=neutral],[tone=info],[tone=success],[tone=warning],[tone=critical]){--radio-tone-source: attr(tone type(<color>), transparent)}a-radio[tone-selected]:not([tone-selected=""],[tone-selected=brand],[tone-selected=neutral],[tone-selected=info],[tone-selected=success],[tone-selected=warning],[tone-selected=critical]){--radio-tone-source: attr(tone-selected type(<color>), transparent)}a-radio[tone]:not([tone=""],[tone=brand],[tone=neutral],[tone=info],[tone=success],[tone=warning],[tone=critical]),a-radio[tone-selected]:not([tone-selected=""],[tone-selected=brand],[tone-selected=neutral],[tone-selected=info],[tone-selected=success],[tone-selected=warning],[tone-selected=critical]),a-radio-group[tone]:not([tone=""],[tone=brand],[tone=neutral],[tone=info],[tone=success],[tone=warning],[tone=critical]) a-radio:not([tone]),a-radio-group[tone-selected]:not([tone-selected=""],[tone-selected=brand],[tone-selected=neutral],[tone-selected=info],[tone-selected=success],[tone-selected=warning],[tone-selected=critical]) a-radio:not([tone-selected]){--_tone-l-rest: .5;--_tone-l-hover: .45;--_tone-l-active: .4;--radio-fill: oklch(from var(--radio-tone-source) var(--_tone-l-rest) c h);--radio-fill-hover: oklch(from var(--radio-tone-source) var(--_tone-l-hover) c h);--radio-fill-active: oklch(from var(--radio-tone-source) var(--_tone-l-active) c h);.dark &{--_tone-l-rest: .45;--_tone-l-hover: .5;--_tone-l-active: .57}}.dark a-radio{--_radio-dot-adjust: 1px;&:after{box-shadow:0 0 1px 1px color-mix(in oklch,black 40%,transparent)}--radio-border-neutral: #49424c;--radio-border-hover: #635b65;--radio-border-active: #776e77;--radio-fill: #49424c;--radio-fill-hover: #534c57;--radio-fill-active: #635b65;--radio-dot: #d4ced4;--radio-dot-disabled: #534c57;--radio-bg-disabled: color-mix(in oklch, #e4d1ef 10%, transparent);--radio-border-disabled: color-mix(in oklch, #e4d1ef 10%, transparent)}.dark a-radio[tone=brand],.dark a-radio[tone-selected=brand],.dark a-radio-group[tone=brand] a-radio:not([tone]),.dark a-radio-group[tone-selected=brand] a-radio:not([tone-selected]){--radio-fill: #503cb4;--radio-fill-hover: #5f4bc3;--radio-fill-active: #7460d7}.dark a-radio[tone=neutral],.dark a-radio[tone-selected=neutral],.dark a-radio-group[tone=neutral] a-radio:not([tone]),.dark a-radio-group[tone-selected=neutral] a-radio:not([tone-selected]){--radio-fill: #49424c;--radio-fill-hover: #534c57;--radio-fill-active: #635b65}.dark a-radio[tone=info],.dark a-radio[tone-selected=info],.dark a-radio-group[tone=info] a-radio:not([tone]),.dark a-radio-group[tone-selected=info] a-radio:not([tone-selected]){--radio-fill: #1a5b93;--radio-fill-hover: #1f6eb2;--radio-fill-active: #2686d9}.dark a-radio[tone=success],.dark a-radio[tone-selected=success],.dark a-radio-group[tone=success] a-radio:not([tone]),.dark a-radio-group[tone-selected=success] a-radio:not([tone-selected]){--radio-fill: #226737;--radio-fill-hover: #2a7e43;--radio-fill-active: #329550}.dark a-radio[tone=warning],.dark a-radio[tone-selected=warning],.dark a-radio-group[tone=warning] a-radio:not([tone]),.dark a-radio-group[tone-selected=warning] a-radio:not([tone-selected]){--radio-fill: #7f410b;--radio-fill-hover: #995200;--radio-fill-active: #ae6613}.dark a-radio[tone=critical],.dark a-radio[tone-selected=critical],.dark a-radio-group[tone=critical] a-radio:not([tone]),.dark a-radio-group[tone-selected=critical] a-radio:not([tone-selected]){--radio-fill: #b02120;--radio-fill-hover: #c9302c;--radio-fill-active: #de4545}.dark a-radio[tone=brand],.dark a-radio-group[tone=brand] a-radio:not([tone]){--radio-bg: #0b0916;--radio-border: #483493;--radio-border-hover: #5f4bc3;--radio-border-active: #7460d7}.dark a-radio[tone=info],.dark a-radio-group[tone=info] a-radio:not([tone]){--radio-bg: #040d18;--radio-border: #175082;--radio-border-hover: #1f6eb2;--radio-border-active: #2686d9}.dark a-radio[tone=success],.dark a-radio-group[tone=success] a-radio:not([tone]){--radio-bg: #041008;--radio-border: #1f5c31;--radio-border-hover: #2a7e43;--radio-border-active: #329550}.dark a-radio[tone=warning],.dark a-radio-group[tone=warning] a-radio:not([tone]){--radio-bg: #120a03;--radio-border: #6a3b0c;--radio-border-hover: #995200;--radio-border-active: #ae6613}.dark a-radio[tone=critical],.dark a-radio-group[tone=critical] a-radio:not([tone]){--radio-bg: #190405;--radio-border: #a01c1c;--radio-border-hover: #c9302c;--radio-border-active: #de4545}}
|
package/dist/elements/a-tab.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer anta{a-tab{user-select:none;display:inline-flex;align-items:center;justify-content:center;gap:.5ch;flex-shrink:1;min-width:0;cursor:pointer;color:var(--tab-fg, var(--text-3));background-color:var(--tab-bg, transparent);border:none;border-radius:var(--tab-radius);&[round]{--tab-radius: 999px}box-shadow:0 0 0 0 transparent;font-size:var(--_fs);font-family:var(--sans-serif);font-weight:450;font-variation-settings:"wdth" 88,"slnt" 0,"ital" 0;font-feature-settings:"ss02","ss05","tnum";line-height:var(--_lh);letter-spacing:.05ch;white-space:nowrap;text-wrap:nowrap;
|
|
1
|
+
@layer anta{a-tab{user-select:none;display:inline-flex;align-items:center;justify-content:center;gap:.5ch;flex-shrink:1;min-width:0;cursor:pointer;color:var(--tab-fg, var(--text-3));background-color:var(--tab-bg, transparent);border:none;border-radius:var(--tab-radius);&[round]{--tab-radius: 999px}box-shadow:inset 0 0 0 0 transparent;font-size:var(--_fs);font-family:var(--sans-serif);font-weight:450;font-variation-settings:"wdth" 88,"slnt" 0,"ital" 0;font-feature-settings:"ss02","ss05","tnum";line-height:var(--_lh);letter-spacing:.05ch;white-space:nowrap;text-wrap:nowrap;min-height:var(--tab-height);padding-block:calc((8px - var(--_pb)) / 2);padding-inline:var(--tab-padding-x);transition:background-color var(--tab-timing),box-shadow var(--tab-timing);>a-tab-label{display:inline-block;min-width:0;overflow:hidden;text-overflow:ellipsis;text-wrap:nowrap;white-space:nowrap;line-height:calc(var(--_lh) - 2px);padding-bottom:var(--_pb);&:has(>*){display:inline-flex;gap:.25ch}}>*{pointer-events:none}&:has(>a-icon:first-child):has(>a-tab-label){padding-inline-start:max(0px,var(--tab-padding-x) - 2px)}&:has(>a-icon:last-child):has(>a-tab-label){padding-inline-end:max(0px,var(--tab-padding-x) - 2px)}}a-tab:focus-visible{outline:1px solid var(--focus-ring);outline-offset:-1px}a-tab[disabled]{pointer-events:none;cursor:not-allowed;opacity:.45}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer anta{a-tabpanel{display:block}a-tabpanel[
|
|
1
|
+
@layer anta{a-tabpanel{display:block}a-tabpanel:not(:state(active)):not([hide-mode=visibility]){display:none}a-tabpanel[hide-mode=visibility]:not(:state(active)){visibility:hidden}}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HTMLElementBase } from "../anta_helpers";
|
|
2
|
+
import "./a-tabpanel.css";
|
|
3
|
+
export declare class ATabPanelElement extends HTMLElementBase {
|
|
4
|
+
static observedAttributes: string[];
|
|
5
|
+
private internals?;
|
|
6
|
+
private tabs;
|
|
7
|
+
private onTabsChange;
|
|
8
|
+
constructor();
|
|
9
|
+
connectedCallback(): void;
|
|
10
|
+
disconnectedCallback(): void;
|
|
11
|
+
attributeChangedCallback(): void;
|
|
12
|
+
/** Locate the sibling <a-tabs> (the strip and panels are flat siblings under one
|
|
13
|
+
* parent — `Tabs` renders no wrapper) and subscribe to its `change`. */
|
|
14
|
+
private bindTabs;
|
|
15
|
+
private sync;
|
|
16
|
+
}
|
|
17
|
+
export declare function register_a_tabpanel(): void;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { HTMLElementBase } from "../anta_helpers";
|
|
2
|
+
import "./a-tabpanel.css";
|
|
3
|
+
class ATabPanelElement extends HTMLElementBase {
|
|
4
|
+
static observedAttributes = ["value"];
|
|
5
|
+
internals;
|
|
6
|
+
// The tablist this panel belongs to (its flat sibling under the same parent).
|
|
7
|
+
tabs = null;
|
|
8
|
+
onTabsChange = () => this.sync();
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
try {
|
|
12
|
+
this.internals = this.attachInternals?.();
|
|
13
|
+
} catch {
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
connectedCallback() {
|
|
17
|
+
this.bindTabs();
|
|
18
|
+
this.sync();
|
|
19
|
+
requestAnimationFrame(() => {
|
|
20
|
+
if (!this.tabs) this.bindTabs();
|
|
21
|
+
this.sync();
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
disconnectedCallback() {
|
|
25
|
+
this.tabs?.removeEventListener("change", this.onTabsChange);
|
|
26
|
+
this.tabs = null;
|
|
27
|
+
}
|
|
28
|
+
attributeChangedCallback() {
|
|
29
|
+
this.sync();
|
|
30
|
+
}
|
|
31
|
+
/** Locate the sibling <a-tabs> (the strip and panels are flat siblings under one
|
|
32
|
+
* parent — `Tabs` renders no wrapper) and subscribe to its `change`. */
|
|
33
|
+
bindTabs() {
|
|
34
|
+
const tabs = this.parentElement?.querySelector(":scope > a-tabs") ?? null;
|
|
35
|
+
if (tabs === this.tabs) return;
|
|
36
|
+
this.tabs?.removeEventListener("change", this.onTabsChange);
|
|
37
|
+
this.tabs = tabs;
|
|
38
|
+
this.tabs?.addEventListener("change", this.onTabsChange);
|
|
39
|
+
}
|
|
40
|
+
sync() {
|
|
41
|
+
const value = this.getAttribute("value");
|
|
42
|
+
const active = !!this.tabs && value === (this.tabs.value ?? null);
|
|
43
|
+
try {
|
|
44
|
+
if (active) this.internals?.states.add("active");
|
|
45
|
+
else this.internals?.states.delete("active");
|
|
46
|
+
} catch {
|
|
47
|
+
}
|
|
48
|
+
if (this.internals && "ariaLabelledByElements" in this.internals) {
|
|
49
|
+
const tab = value != null ? this.tabs?.querySelector(`a-tab[value="${cssEscape(value)}"]`) : null;
|
|
50
|
+
this.internals.ariaLabelledByElements = tab ? [tab] : [];
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function cssEscape(v) {
|
|
55
|
+
return typeof CSS !== "undefined" && CSS.escape ? CSS.escape(v) : v;
|
|
56
|
+
}
|
|
57
|
+
function register_a_tabpanel() {
|
|
58
|
+
if (typeof customElements === "undefined") return;
|
|
59
|
+
if (!customElements.get("a-tabpanel"))
|
|
60
|
+
customElements.define("a-tabpanel", ATabPanelElement);
|
|
61
|
+
}
|
|
62
|
+
register_a_tabpanel();
|
|
63
|
+
export {
|
|
64
|
+
ATabPanelElement,
|
|
65
|
+
register_a_tabpanel
|
|
66
|
+
};
|
package/dist/elements/a-tabs.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer anta{a-tabs{--_fs: 15px;--_lh: 20px;--_pb: 1px;--tab-padding-x: 9px;--tab-
|
|
1
|
+
@layer anta{a-tabs{--_fs: 15px;--_lh: 20px;--_pb: 1px;--tab-padding-x: 9px;--tab-height: 28px;--tab-radius: 4px;--tabs-gap: 3px;--tab-timing: .15s ease-out;--tabs-tone-source: #635b65;--tab-fg-rest: var(--text-3);--tab-selected-text: var(--text-1);--tab-text-2: var(--text-2);--tabs-track-bg: color-mix(in oklch, #44374b 6%, transparent);--tabs-track-border: var(--border-4);--tabs-track-shadow: inset 0 0 0px .5px var(--tabs-track-border);--tab-selected-bg: var(--bg-1);--tab-selected-border: var(--border-2);--tab-selected-shadow: inset 0 0 0px .5px var(--tab-selected-border);--tab-secondary-bg: color-mix(in oklch, #44374b 3%, transparent);display:flex;flex-direction:row;align-items:stretch;gap:var(--tabs-gap);padding:0;width:fit-content;align-self:flex-start;min-width:0;max-width:100%;overflow:hidden;scroll-behavior:smooth}a-tabs[size=small]{--_fs: 13px;--_lh: 16px;--_pb: .5px;--tab-padding-x: 7px;--tab-height: 24px}a-tabs[size=large]{--_fs: 17px;--_lh: 24px;--_pb: 1.5px;--tab-padding-x: 13px;--tab-height: 32px}a-tabs a-tab a-icon{--icon-size: 16px}a-tabs[size=small] a-tab a-icon{--icon-size: 14px}a-tabs[size=large] a-tab a-icon{--icon-size: 18px}a-tabs[tone=brand],a-tab[tone=brand]{--tabs-tone-source: #5f4bc3;--tab-selected-text: var(--text-1-brand);--tab-text-2: var(--text-2-brand);--tab-rest-tone: var(--text-3-brand);--tabs-track-border: var(--border-4-brand);--tab-selected-border: var(--border-2-brand)}a-tabs[tone=info],a-tab[tone=info]{--tabs-tone-source: #1f6eb2;--tab-selected-text: var(--text-1-info);--tab-text-2: var(--text-2-info);--tab-rest-tone: var(--text-3-info);--tabs-track-border: var(--border-4-info);--tab-selected-border: var(--border-2-info)}a-tabs[tone=success],a-tab[tone=success]{--tabs-tone-source: #2a7e43;--tab-selected-text: var(--text-1-success);--tab-text-2: var(--text-2-success);--tab-rest-tone: var(--text-3-success);--tabs-track-border: var(--border-4-success);--tab-selected-border: var(--border-2-success)}a-tabs[tone=warning],a-tab[tone=warning]{--tabs-tone-source: #c37416;--tab-selected-text: var(--text-1-warning);--tab-text-2: var(--text-2-warning);--tab-rest-tone: var(--text-3-warning);--tabs-track-border: var(--border-4-warning);--tab-selected-border: var(--border-2-warning)}a-tabs[tone=critical],a-tab[tone=critical]{--tabs-tone-source: #c9302c;--tab-selected-text: var(--text-1-critical);--tab-text-2: var(--text-2-critical);--tab-rest-tone: var(--text-3-critical);--tabs-track-border: var(--border-4-critical);--tab-selected-border: var(--border-2-critical)}a-tabs[tone]:not([tone=""],[tone=neutral]),a-tab[tone]:not([tone=""],[tone=neutral]){--tabs-track-bg: oklch(from var(--tabs-tone-source) .55 .14 h / .06);--tab-secondary-bg: oklch(from var(--tabs-tone-source) .55 .14 h / .03)}a-tabs:has(>a-tab[tone=brand]:state(selected)){--tabs-tone-source: #5f4bc3;--tab-selected-text: var(--text-1-brand);--tab-selected-border: var(--border-2-brand)}a-tabs:has(>a-tab[tone=info]:state(selected)){--tabs-tone-source: #1f6eb2;--tab-selected-text: var(--text-1-info);--tab-selected-border: var(--border-2-info)}a-tabs:has(>a-tab[tone=success]:state(selected)){--tabs-tone-source: #2a7e43;--tab-selected-text: var(--text-1-success);--tab-selected-border: var(--border-2-success)}a-tabs:has(>a-tab[tone=warning]:state(selected)){--tabs-tone-source: #c37416;--tab-selected-text: var(--text-1-warning);--tab-selected-border: var(--border-2-warning)}a-tabs:has(>a-tab[tone=critical]:state(selected)){--tabs-tone-source: #c9302c;--tab-selected-text: var(--text-1-critical);--tab-selected-border: var(--border-2-critical)}a-tabs:has(>a-tab[tone]:state(selected):not([tone=""],[tone=neutral])){--tab-secondary-bg: oklch(from var(--tabs-tone-source) .55 .14 h / .03)}a-tabs[tone]:not([tone=""],[tone=neutral],[tone=brand],[tone=info],[tone=success],[tone=warning],[tone=critical]),a-tab[tone]:not([tone=""],[tone=neutral],[tone=brand],[tone=info],[tone=success],[tone=warning],[tone=critical]){--tabs-tone-source: attr(tone type(<color>), #635b65);--tab-selected-text: oklch(from var(--tabs-tone-source) .38 .13 h);--tab-text-2: oklch(from var(--tabs-tone-source) .45 .13 h);--tab-rest-tone: oklch(from var(--tabs-tone-source) .45 .13 h);--tabs-track-border: oklch(from var(--tabs-tone-source) .86 .06 h);--tab-selected-border: oklch(from var(--tabs-tone-source) .8 .09 h)}a-tabs a-tab{--tab-fg: var(--tab-fg-rest);--tab-bg: transparent}a-tabs:not([orientation=vertical]) a-tab{flex:1 1 0;max-width:max-content}@media(hover:hover)and (pointer:fine){a-tabs a-tab:hover{--tab-fg: var(--tab-selected-text)}}a-tabs:not([priority=secondary],[priority=tertiary]){background:var(--tabs-track-bg);box-shadow:var(--tabs-track-shadow);border-radius:4px}a-tabs[round]{--tab-radius: 999px;--tabs-round: attr(round type(<length>), 999px)}a-tabs[round]:not([priority=secondary],[priority=tertiary]){border-radius:var(--tabs-round, 999px)}a-tabs:not([priority=secondary],[priority=tertiary]) a-tab:state(selected){--tab-fg: var(--tab-selected-text);--tab-bg: var(--tab-selected-bg);box-shadow:var(--tab-selected-shadow)}a-tabs[tone]:not([tone=""],[tone=neutral]),a-tab[tone]:not([tone=""],[tone=neutral]){--tab-fg-rest: var(--tab-rest-tone)}@media(hover:hover)and (pointer:fine){a-tabs[priority=secondary] a-tab:hover{--tab-fg: var(--tab-selected-text)}}a-tabs[priority=secondary] a-tab:state(selected){--tab-fg: var(--tab-selected-text);--tab-bg: var(--tab-secondary-bg);box-shadow:var(--tab-selected-shadow)}a-tabs[priority=tertiary] a-tab{--tab-underline-size: 1px;--tab-underline-color: transparent;position:relative;border-radius:0}a-tabs[priority=tertiary] a-tab:after{content:"";position:absolute;inset:0;box-sizing:border-box;pointer-events:none;border-bottom:var(--tab-underline-size) solid var(--tab-underline-color);transition:border-width var(--tab-timing),border-color var(--tab-timing)}a-tabs[orientation=vertical][priority=tertiary] a-tab:after{border-bottom:0;border-inline-end:var(--tab-underline-size) solid var(--tab-underline-color)}@media(hover:hover)and (pointer:fine){a-tabs[priority=tertiary] a-tab:hover{--tab-fg: var(--tab-text-2)}}a-tabs[priority=tertiary] a-tab:state(selected){--tab-fg: var(--tab-selected-text);--tab-underline-size: 1px;--tab-underline-color: var(--tab-selected-text)}a-tabs[orientation=vertical]{flex-direction:column;align-items:stretch;max-width:none;overflow-x:hidden;overflow-y:auto;flex-shrink:0}a-tabs[orientation=vertical] a-tab{justify-content:flex-start;flex-shrink:0}@supports (anchor-scope: all){a-tabs:not([noslide]){position:relative;anchor-scope:all}a-tabs:not([noslide]) a-tab{position:relative;z-index:1}a-tabs:not([noslide]) a-tab:state(selected){anchor-name:--tabs-active}a-tabs:not([noslide]):before{content:"";position:absolute;z-index:0;box-sizing:border-box;position-anchor:--tabs-active;top:anchor(top);right:anchor(right);bottom:anchor(bottom);left:anchor(left);transition:top var(--tab-timing),right var(--tab-timing),bottom var(--tab-timing),left var(--tab-timing)}a-tabs:not([noslide]):not(:has(a-tab:state(selected))):before{display:none}@media(prefers-reduced-motion:reduce){a-tabs:not([noslide]):before{transition:none}}a-tabs:not([noslide]) a-tab:state(selected){--tab-bg: transparent;box-shadow:none}a-tabs:not([noslide],[priority=secondary],[priority=tertiary]):before{background:var(--tab-selected-bg);border-radius:var(--tab-radius);box-shadow:var(--tab-selected-shadow)}a-tabs:not([noslide])[priority=secondary]:before{background:var(--tab-secondary-bg);border-radius:var(--tab-radius);box-shadow:var(--tab-selected-shadow)}a-tabs:not([noslide])[priority=tertiary] a-tab:state(selected){--tab-underline-size: 1px;--tab-underline-color: transparent}a-tabs:not([noslide])[priority=tertiary]:before{z-index:2;border-bottom:1px solid var(--tab-selected-text)}a-tabs[orientation=vertical]:not([noslide])[priority=tertiary]:before{border-bottom:0;border-inline-end:1px solid var(--tab-selected-text)}}.dark a-tabs{--tabs-track-bg: color-mix(in oklch, #e4d1ef 7%, transparent);--tab-secondary-bg: color-mix(in oklch, #e4d1ef 8%, transparent)}.dark a-tabs[tone]:not([tone=""],[tone=neutral]),.dark a-tab[tone]:not([tone=""],[tone=neutral]){--tabs-track-bg: oklch(from var(--tabs-tone-source) .8 .12 h / .07);--tab-secondary-bg: oklch(from var(--tabs-tone-source) .8 .12 h / .08)}.dark a-tabs:has(>a-tab[tone]:state(selected):not([tone=""],[tone=neutral])){--tab-secondary-bg: oklch(from var(--tabs-tone-source) .8 .12 h / .08)}.dark a-tabs[tone]:not([tone=""],[tone=neutral],[tone=brand],[tone=info],[tone=success],[tone=warning],[tone=critical]),.dark a-tab[tone]:not([tone=""],[tone=neutral],[tone=brand],[tone=info],[tone=success],[tone=warning],[tone=critical]){--tab-selected-text: oklch(from var(--tabs-tone-source) .83 .1 h);--tab-text-2: oklch(from var(--tabs-tone-source) .76 .11 h);--tab-rest-tone: oklch(from var(--tabs-tone-source) .76 .11 h);--tabs-track-border: oklch(from var(--tabs-tone-source) .33 .08 h);--tab-selected-border: oklch(from var(--tabs-tone-source) .4 .11 h)}}
|
|
@@ -128,7 +128,7 @@ class ATooltipElement extends HTMLElementBase {
|
|
|
128
128
|
overflow: clip;
|
|
129
129
|
text-align: left;
|
|
130
130
|
background: var(--tooltip-bg, Canvas);
|
|
131
|
-
color: var(--text-
|
|
131
|
+
color: var(--text-2, CanvasText);
|
|
132
132
|
box-shadow: var(--tooltip-shadow, 0 1px 8px rgba(0, 0, 0, 0.2));
|
|
133
133
|
-webkit-backdrop-filter: var(--tooltip-backdrop-filter, blur(8px));
|
|
134
134
|
backdrop-filter: var(--tooltip-backdrop-filter, blur(8px));
|
package/dist/elements/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export { ACheckboxElement, register_a_checkbox } from './a-checkbox';
|
|
|
21
21
|
export { AExpanderElement, register_a_expander } from './a-expander';
|
|
22
22
|
export { ATooltipElement, register_a_tooltip } from './a-tooltip';
|
|
23
23
|
export { AInputElement, register_a_input } from './a-input';
|
|
24
|
+
export { AInputTimeElement, register_a_input_time } from './a-input-time';
|
|
24
25
|
export { ACalendarElement, register_a_calendar } from './a-calendar';
|
|
25
26
|
export { ARadioElement, register_a_radio } from './a-radio';
|
|
26
27
|
export { ARadioGroupElement, register_a_radio_group } from './a-radio-group';
|
|
@@ -30,6 +31,6 @@ export { AMenuSeparatorElement, register_a_menu_separator } from './a-menu-separ
|
|
|
30
31
|
export { AMenuGroupElement, register_a_menu_group } from './a-menu-group';
|
|
31
32
|
export { ATabElement, register_a_tab } from './a-tab';
|
|
32
33
|
export { ATabsElement, register_a_tabs } from './a-tabs';
|
|
34
|
+
export { ATabPanelElement, register_a_tabpanel } from './a-tabpanel';
|
|
33
35
|
import './a-title.css';
|
|
34
36
|
import './a-tag.css';
|
|
35
|
-
import './a-tabpanel.css';
|
package/dist/elements/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import { ACheckboxElement, register_a_checkbox } from "./a-checkbox";
|
|
|
6
6
|
import { AExpanderElement, register_a_expander } from "./a-expander";
|
|
7
7
|
import { ATooltipElement, register_a_tooltip } from "./a-tooltip";
|
|
8
8
|
import { AInputElement, register_a_input } from "./a-input";
|
|
9
|
+
import { AInputTimeElement, register_a_input_time } from "./a-input-time";
|
|
9
10
|
import { ACalendarElement, register_a_calendar } from "./a-calendar";
|
|
10
11
|
import { ARadioElement, register_a_radio } from "./a-radio";
|
|
11
12
|
import { ARadioGroupElement, register_a_radio_group } from "./a-radio-group";
|
|
@@ -15,9 +16,9 @@ import { AMenuSeparatorElement, register_a_menu_separator } from "./a-menu-separ
|
|
|
15
16
|
import { AMenuGroupElement, register_a_menu_group } from "./a-menu-group";
|
|
16
17
|
import { ATabElement, register_a_tab } from "./a-tab";
|
|
17
18
|
import { ATabsElement, register_a_tabs } from "./a-tabs";
|
|
19
|
+
import { ATabPanelElement, register_a_tabpanel } from "./a-tabpanel";
|
|
18
20
|
import "./a-title.css";
|
|
19
21
|
import "./a-tag.css";
|
|
20
|
-
import "./a-tabpanel.css";
|
|
21
22
|
export {
|
|
22
23
|
AButtonElement,
|
|
23
24
|
ACalendarElement,
|
|
@@ -25,6 +26,7 @@ export {
|
|
|
25
26
|
AExpanderElement,
|
|
26
27
|
AIconElement,
|
|
27
28
|
AInputElement,
|
|
29
|
+
AInputTimeElement,
|
|
28
30
|
AMenuElement,
|
|
29
31
|
AMenuGroupElement,
|
|
30
32
|
AMenuItemElement,
|
|
@@ -33,6 +35,7 @@ export {
|
|
|
33
35
|
ARadioElement,
|
|
34
36
|
ARadioGroupElement,
|
|
35
37
|
ATabElement,
|
|
38
|
+
ATabPanelElement,
|
|
36
39
|
ATabsElement,
|
|
37
40
|
ATextElement,
|
|
38
41
|
ATooltipElement,
|
|
@@ -42,6 +45,7 @@ export {
|
|
|
42
45
|
register_a_expander,
|
|
43
46
|
register_a_icon,
|
|
44
47
|
register_a_input,
|
|
48
|
+
register_a_input_time,
|
|
45
49
|
register_a_menu,
|
|
46
50
|
register_a_menu_group,
|
|
47
51
|
register_a_menu_item,
|
|
@@ -50,6 +54,7 @@ export {
|
|
|
50
54
|
register_a_radio,
|
|
51
55
|
register_a_radio_group,
|
|
52
56
|
register_a_tab,
|
|
57
|
+
register_a_tabpanel,
|
|
53
58
|
register_a_tabs,
|
|
54
59
|
register_a_text,
|
|
55
60
|
register_a_tooltip
|