@antadesign/anta 0.3.18 → 0.3.20
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/README.md +38 -242
- package/dist/anta_helpers.d.ts +2 -2
- package/dist/components/Banner.d.ts +3 -3
- package/dist/components/Button.d.ts +1 -1
- package/dist/components/Calendar.d.ts +11 -12
- package/dist/components/Card.d.ts +1 -1
- package/dist/components/Card.js +1 -1
- package/dist/components/Checkbox.d.ts +8 -9
- package/dist/components/Dialog.d.ts +1 -1
- package/dist/components/Expander.d.ts +5 -6
- package/dist/components/Input.d.ts +6 -3
- package/dist/components/Input.js +3 -1
- package/dist/components/InputAutocomplete.d.ts +8 -8
- package/dist/components/InputDate.css +1 -0
- package/dist/components/InputDate.d.ts +1 -0
- package/dist/components/InputDate.js +5 -5
- package/dist/components/InputTime.d.ts +3 -3
- package/dist/components/InputTime.js +1 -1
- package/dist/components/Menu.d.ts +7 -3
- package/dist/components/Menu.js +3 -2
- package/dist/components/MenuItem.d.ts +1 -1
- package/dist/components/MenuItem.js +1 -1
- package/dist/components/Progress.d.ts +1 -1
- package/dist/components/RadioGroup.d.ts +12 -13
- package/dist/components/Select.d.ts +32 -38
- package/dist/components/Select.js +9 -13
- package/dist/components/SelectFaceted.d.ts +28 -33
- package/dist/components/SelectFaceted.js +29 -23
- package/dist/components/Slider.d.ts +5 -5
- package/dist/components/Switch.d.ts +4 -4
- package/dist/components/Tabs.d.ts +7 -7
- package/dist/components/Title.d.ts +1 -1
- package/dist/components/Toaster.d.ts +1 -1
- package/dist/components/Tooltip.d.ts +1 -1
- package/dist/components/select-parts.css +1 -0
- package/dist/elements/a-card.css +1 -1
- package/dist/elements/a-dialog.css +1 -1
- package/dist/elements/a-expander.css +1 -1
- package/dist/elements/a-expander.d.ts +1 -0
- package/dist/elements/a-expander.js +12 -2
- package/dist/elements/a-input.css +1 -1
- package/dist/elements/a-menu.js +12 -0
- package/dist/elements/a-progress.css +1 -1
- package/dist/elements/a-slider.css +1 -1
- package/dist/elements/a-tabs.css +1 -1
- package/dist/elements/a-tabs.d.ts +3 -0
- package/dist/elements/a-tabs.js +40 -1
- package/dist/elements/a-tooltip.css +1 -1
- package/dist/elements/a-tooltip.d.ts +1 -1
- package/dist/elements/a-tooltip.js +1 -1
- package/dist/elements/index.d.ts +1 -1
- package/dist/general_types.d.ts +24 -22
- package/dist/index.d.ts +3 -3
- package/dist/jsx-runtime.d.ts +9 -0
- package/docs/accessibility.md +34 -0
- package/docs/changelog.md +561 -0
- package/docs/colors.md +42 -0
- package/docs/comparison.md +28 -0
- package/docs/components/banner.md +267 -0
- package/docs/components/button.md +603 -0
- package/docs/components/card.md +321 -0
- package/docs/components/checkbox.md +296 -0
- package/docs/components/dialog.md +314 -0
- package/docs/components/expander.md +526 -0
- package/docs/components/icon.md +155 -0
- package/docs/components/input-autocomplete.md +100 -0
- package/docs/components/input-date.md +401 -0
- package/docs/components/input-time.md +174 -0
- package/docs/components/input.md +610 -0
- package/docs/components/loader.md +139 -0
- package/docs/components/menu.md +511 -0
- package/docs/components/progress.md +182 -0
- package/docs/components/radio.md +368 -0
- package/docs/components/select-faceted.md +451 -0
- package/docs/components/select.md +926 -0
- package/docs/components/slider.md +147 -0
- package/docs/components/switch.md +198 -0
- package/docs/components/tabs.md +471 -0
- package/docs/components/tag.md +185 -0
- package/docs/components/text.md +148 -0
- package/docs/components/title.md +146 -0
- package/docs/components/toaster.md +313 -0
- package/docs/components/tooltip.md +177 -0
- package/docs/credits.md +18 -0
- package/docs/index.md +52 -0
- package/docs/install-config.md +240 -0
- package/docs/normalization.md +102 -0
- package/docs/overview.md +10 -0
- package/docs/packages/stickers.md +187 -0
- package/docs/packages/table.md +153 -0
- package/docs/theming.md +13 -0
- package/package.json +10 -6
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-height: 28px;--tab-radius: 4px;--tabs-gap: 3px;--tab-timing: .15s ease-out;--tabs-tone-source: var(--anta-seed-neutral);--tab-fg-rest: var(--text-3);--tab-selected-text: var(--text-1);--tab-text-2: var(--text-2);--_track-l: .55;--_track-c: .008;--_track-a: .06;--_sec-a: .03;--tabs-track-bg: oklch(from var(--tabs-tone-source) var(--_track-l) var(--_track-c) h / var(--_track-a));--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: oklch(from var(--tabs-tone-source) var(--_track-l) var(--_track-c) h / var(--_sec-a));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: var(--anta-seed-brand);--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: var(--anta-seed-info);--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: var(--anta-seed-success);--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: var(--anta-seed-warning);--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: var(--anta-seed-critical);--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]){--_track-c: .14}a-tabs:has(>a-tab[tone=brand]:state(selected)){--tabs-tone-source: var(--anta-seed-brand);--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: var(--anta-seed-info);--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: var(--anta-seed-success);--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: var(--anta-seed-warning);--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: var(--anta-seed-critical);--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])){--_track-c: .14}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 / .8);--tabs-track-border: oklch(from var(--tabs-tone-source) .9 .045 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{--_track-l: .8;--_track-a: .07;--_sec-a: .08}.dark a-tabs[tone]:not([tone=""],[tone=neutral]),.dark a-tab[tone]:not([tone=""],[tone=neutral]){--_track-c: .12}.dark a-tabs:has(>a-tab[tone]:state(selected):not([tone=""],[tone=neutral])){--_track-c: .12}.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 / .8);--tabs-track-border: oklch(from var(--tabs-tone-source) .26 .055 h);--tab-selected-border: oklch(from var(--tabs-tone-source) .4 .11 h)}@media(forced-colors:active){a-tabs:not([priority=secondary],[priority=tertiary]){background-color:Canvas;border:1px solid CanvasText;box-shadow:none}a-tabs[priority=tertiary] a-tab{--tab-underline-size: 0px;--tab-underline-color: transparent}a-tabs[priority=tertiary] a-tab:state(selected){--tab-underline-size: 2px;--tab-underline-color: CanvasText}a-tabs:not([priority=secondary],[priority=tertiary]) a-tab:state(selected){--anta-forced-foreground: ButtonFace;forced-color-adjust:none;color:ButtonFace;background-color:ButtonText;border:1px solid ButtonText;box-shadow:none}a-tabs[priority=secondary] a-tab:state(selected){background-color:Canvas;border:1px solid CanvasText;box-shadow:none}@supports (anchor-scope: all){a-tabs:not([noslide],[priority=tertiary]) a-tab:state(selected){background-color:transparent;border:0}a-tabs:not([noslide])[priority=tertiary] a-tab:state(selected){--tab-underline-size: 0px;--tab-underline-color: transparent}a-tabs:not([noslide],[priority=secondary],[priority=tertiary]):before{forced-color-adjust:none;background-color:ButtonText;border:1px solid ButtonText;box-shadow:none}a-tabs:not([noslide])[priority=secondary]:before{forced-color-adjust:none;background-color:Canvas;border:1px solid CanvasText;box-shadow:none}a-tabs:not([noslide])[priority=tertiary]:before{forced-color-adjust:none;border-bottom-width:2px;border-bottom-color:CanvasText}a-tabs[orientation=vertical]:not([noslide])[priority=tertiary]:before{border-inline-end-width:2px;border-inline-end-color:CanvasText}}}}
|
|
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: var(--anta-seed-neutral);--tab-fg-rest: var(--text-3);--tab-selected-text: var(--text-1);--tab-text-2: var(--text-2);--_track-l: .55;--_track-c: .008;--_track-a: .06;--_sec-a: .03;--tabs-track-bg: oklch(from var(--tabs-tone-source) var(--_track-l) var(--_track-c) h / var(--_track-a));--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: oklch(from var(--tabs-tone-source) var(--_track-l) var(--_track-c) h / var(--_sec-a));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: var(--anta-seed-brand);--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: var(--anta-seed-info);--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: var(--anta-seed-success);--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: var(--anta-seed-warning);--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: var(--anta-seed-critical);--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]){--_track-c: .14}a-tabs:has(>a-tab[tone=brand]:state(selected)){--tabs-tone-source: var(--anta-seed-brand);--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: var(--anta-seed-info);--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: var(--anta-seed-success);--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: var(--anta-seed-warning);--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: var(--anta-seed-critical);--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])){--_track-c: .14}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 / .8);--tabs-track-border: oklch(from var(--tabs-tone-source) .9 .045 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:state(resizing):not([noslide]):before{transition:none}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{--_track-l: .8;--_track-a: .07;--_sec-a: .08}.dark a-tabs[tone]:not([tone=""],[tone=neutral]),.dark a-tab[tone]:not([tone=""],[tone=neutral]){--_track-c: .12}.dark a-tabs:has(>a-tab[tone]:state(selected):not([tone=""],[tone=neutral])){--_track-c: .12}.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 / .8);--tabs-track-border: oklch(from var(--tabs-tone-source) .26 .055 h);--tab-selected-border: oklch(from var(--tabs-tone-source) .4 .11 h)}@media(forced-colors:active){a-tabs:not([priority=secondary],[priority=tertiary]){background-color:Canvas;border:1px solid CanvasText;box-shadow:none}a-tabs[priority=tertiary] a-tab{--tab-underline-size: 0px;--tab-underline-color: transparent}a-tabs[priority=tertiary] a-tab:state(selected){--tab-underline-size: 2px;--tab-underline-color: CanvasText}a-tabs:not([priority=secondary],[priority=tertiary]) a-tab:state(selected){--anta-forced-foreground: ButtonFace;forced-color-adjust:none;color:ButtonFace;background-color:ButtonText;border:1px solid ButtonText;box-shadow:none}a-tabs[priority=secondary] a-tab:state(selected){background-color:Canvas;border:1px solid CanvasText;box-shadow:none}@supports (anchor-scope: all){a-tabs:not([noslide],[priority=tertiary]) a-tab:state(selected){background-color:transparent;border:0}a-tabs:not([noslide])[priority=tertiary] a-tab:state(selected){--tab-underline-size: 0px;--tab-underline-color: transparent}a-tabs:not([noslide],[priority=secondary],[priority=tertiary]):before{forced-color-adjust:none;background-color:ButtonText;border:1px solid ButtonText;box-shadow:none}a-tabs:not([noslide])[priority=secondary]:before{forced-color-adjust:none;background-color:Canvas;border:1px solid CanvasText;box-shadow:none}a-tabs:not([noslide])[priority=tertiary]:before{forced-color-adjust:none;border-bottom-width:2px;border-bottom-color:CanvasText}a-tabs[orientation=vertical]:not([noslide])[priority=tertiary]:before{border-inline-end-width:2px;border-inline-end-color:CanvasText}}}}
|
|
@@ -7,6 +7,9 @@ export declare class ATabsElement extends HTMLElementBase {
|
|
|
7
7
|
private uncontrolledValue;
|
|
8
8
|
private seeded;
|
|
9
9
|
private observer?;
|
|
10
|
+
private resizeObserver?;
|
|
11
|
+
private resizeTimer?;
|
|
12
|
+
private resizeFrame?;
|
|
10
13
|
private lastSelected;
|
|
11
14
|
private alive;
|
|
12
15
|
private childrenReady;
|
package/dist/elements/a-tabs.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { HTMLElementBase } from "../anta_helpers";
|
|
2
2
|
import "./a-tabs.css";
|
|
3
3
|
class ATabsElement extends HTMLElementBase {
|
|
4
|
-
static observedAttributes = ["state", "disabled", "orientation"];
|
|
4
|
+
static observedAttributes = ["state", "disabled", "orientation", "noslide"];
|
|
5
5
|
internals;
|
|
6
6
|
uncontrolledValue = null;
|
|
7
7
|
seeded = false;
|
|
8
8
|
observer;
|
|
9
|
+
resizeObserver;
|
|
10
|
+
resizeTimer;
|
|
11
|
+
resizeFrame;
|
|
9
12
|
// The tab last scrolled into view — so scroll-into-view fires only when the SELECTION
|
|
10
13
|
// changes, not on every sync() (orientation / disabled changes call sync() too).
|
|
11
14
|
lastSelected = null;
|
|
@@ -42,6 +45,7 @@ class ATabsElement extends HTMLElementBase {
|
|
|
42
45
|
if (touchedTabs) this.sync();
|
|
43
46
|
});
|
|
44
47
|
this.observer.observe(this, { childList: true, subtree: true });
|
|
48
|
+
this.#syncResizeObserver();
|
|
45
49
|
queueMicrotask(() => {
|
|
46
50
|
if (!this.isConnected) return;
|
|
47
51
|
this.childrenReady = true;
|
|
@@ -51,8 +55,11 @@ class ATabsElement extends HTMLElementBase {
|
|
|
51
55
|
}
|
|
52
56
|
disconnectedCallback() {
|
|
53
57
|
this.observer?.disconnect();
|
|
58
|
+
this.resizeObserver?.disconnect();
|
|
59
|
+
this.#clearResizeTransitionPause();
|
|
54
60
|
}
|
|
55
61
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
62
|
+
if (name === "noslide" && this.isConnected) this.#syncResizeObserver();
|
|
56
63
|
this.sync();
|
|
57
64
|
if (name === "state" && this.alive && newValue !== oldValue) this.emitChange();
|
|
58
65
|
}
|
|
@@ -74,6 +81,38 @@ class ATabsElement extends HTMLElementBase {
|
|
|
74
81
|
get #tabs() {
|
|
75
82
|
return Array.from(this.querySelectorAll("a-tab"));
|
|
76
83
|
}
|
|
84
|
+
#syncResizeObserver() {
|
|
85
|
+
const canSlide = !this.hasAttribute("noslide") && typeof this.view.ResizeObserver === "function" && this.view.CSS.supports("anchor-scope: all");
|
|
86
|
+
if (!canSlide) {
|
|
87
|
+
this.resizeObserver?.disconnect();
|
|
88
|
+
this.#clearResizeTransitionPause();
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
this.resizeObserver ??= new this.view.ResizeObserver(this.#pauseIndicatorTransition);
|
|
92
|
+
this.resizeObserver.observe(this);
|
|
93
|
+
}
|
|
94
|
+
// The anchored indicator's far edge changes when its strip resizes. Pause its
|
|
95
|
+
// edge transition through a resize burst so it cannot stretch between layouts.
|
|
96
|
+
#pauseIndicatorTransition = () => {
|
|
97
|
+
this.internals?.states.add("resizing");
|
|
98
|
+
if (this.resizeTimer != null) this.view.clearTimeout(this.resizeTimer);
|
|
99
|
+
if (this.resizeFrame != null) this.view.cancelAnimationFrame(this.resizeFrame);
|
|
100
|
+
this.resizeFrame = void 0;
|
|
101
|
+
this.resizeTimer = this.view.setTimeout(() => {
|
|
102
|
+
this.resizeTimer = void 0;
|
|
103
|
+
this.resizeFrame = this.view.requestAnimationFrame(() => {
|
|
104
|
+
this.resizeFrame = void 0;
|
|
105
|
+
this.internals?.states.delete("resizing");
|
|
106
|
+
});
|
|
107
|
+
}, 120);
|
|
108
|
+
};
|
|
109
|
+
#clearResizeTransitionPause() {
|
|
110
|
+
if (this.resizeTimer != null) this.view.clearTimeout(this.resizeTimer);
|
|
111
|
+
if (this.resizeFrame != null) this.view.cancelAnimationFrame(this.resizeFrame);
|
|
112
|
+
this.resizeTimer = void 0;
|
|
113
|
+
this.resizeFrame = void 0;
|
|
114
|
+
this.internals?.states.delete("resizing");
|
|
115
|
+
}
|
|
77
116
|
sync = () => {
|
|
78
117
|
if (!this.childrenReady) return;
|
|
79
118
|
const value = this.#currentValue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer anta{a-tooltip:not(:defined){display:none}@media(hover:none)and (pointer:coarse){:where(:has(>a-tooltip)){-webkit-touch-callout:none;user-select:none}}a-tooltip{--tooltip-bg: color-mix(in oklch, var(--bg-1) 80%, transparent);--tooltip-shadow: 0 1px 8px color-mix(in oklch, var(--text-1) 15%, transparent), 0 0 1px color-mix(in oklch, var(--text-1) 50%, transparent);--tooltip-radius: 3px;--tooltip-max-width: min( calc(100vw - 20px) , 80ch);--tooltip-border: none;--tooltip-backdrop-filter: blur(8px)}a-tooltip[round]{--tooltip-radius: attr(round type(<length>), 20px)}.dark a-tooltip{--tooltip-bg: color-mix(in oklch, var(--bg-1) 70%, transparent);--tooltip-shadow: 0 2px 16px color-mix(in oklch, black 70%, transparent), inset 0 0 0 1px color-mix(in oklch, white 15%, transparent)}@media(forced-colors:active){a-tooltip{--tooltip-border: 1px dotted CanvasText}}}
|
|
1
|
+
@layer anta{a-tooltip:not(:defined){display:none}@media(hover:none)and (pointer:coarse){:where(:has(>a-tooltip)){-webkit-touch-callout:none;user-select:none}}a-tooltip{--tooltip-bg: color-mix(in oklch, var(--bg-1) 80%, transparent);--tooltip-shadow: 0 1px 8px color-mix(in oklch, var(--text-1) 15%, transparent), 0 0 1px color-mix(in oklch, var(--text-1) 50%, transparent);--tooltip-radius: 3px;--tooltip-max-width: min( calc(100vw - 20px) , 80ch);--tooltip-border: none;--tooltip-backdrop-filter: blur(8px)}a-tooltip[round]{--tooltip-radius: attr(round type(<length>), 20px)}.dark a-tooltip{--tooltip-bg: color-mix(in oklch, var(--bg-1) 70%, transparent);--tooltip-shadow: 0 2px 16px color-mix(in oklch, black 70%, transparent), inset 0 0 0 1px color-mix(in oklch, white 15%, transparent)}@media(forced-colors:active){a-tooltip{--tooltip-border: 1px dotted CanvasText}}}a-tooltip>p:last-child,a-tooltip>:not([slot])>p:last-child{margin-block-end:0}
|
|
@@ -109,7 +109,7 @@ export declare class ATooltipElement extends HTMLElementBase {
|
|
|
109
109
|
private position;
|
|
110
110
|
/** Opacity for the inner bubble from the cursor's distance to the anchor rect
|
|
111
111
|
* (0 inside the rect): 1 within PROX_NEAR, a linear ramp to 0 at PROX_FAR.
|
|
112
|
-
* Cursor-follow only — drives the "fade as you move away"
|
|
112
|
+
* Cursor-follow only — drives the "fade as you move away" behavior. */
|
|
113
113
|
private proximityOpacity;
|
|
114
114
|
show: (e?: MouseEvent) => void;
|
|
115
115
|
hide: () => void;
|
|
@@ -341,7 +341,7 @@ class ATooltipElement extends HTMLElementBase {
|
|
|
341
341
|
}
|
|
342
342
|
/** Opacity for the inner bubble from the cursor's distance to the anchor rect
|
|
343
343
|
* (0 inside the rect): 1 within PROX_NEAR, a linear ramp to 0 at PROX_FAR.
|
|
344
|
-
* Cursor-follow only — drives the "fade as you move away"
|
|
344
|
+
* Cursor-follow only — drives the "fade as you move away" behavior. */
|
|
345
345
|
proximityOpacity(e) {
|
|
346
346
|
if (!this.anchor) return 1;
|
|
347
347
|
const r = anchorRect(this.anchor);
|
package/dist/elements/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* set + injects every element's CSS. Importing this barrel for side effects —
|
|
7
7
|
* `import '@antadesign/anta/elements'` — gives you everything.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
9
|
+
* To reduce bundle size, import only the element(s) you use:
|
|
10
10
|
* import '@antadesign/anta/elements/a-tooltip' // registers a-tooltip + its CSS, nothing else
|
|
11
11
|
* That granular path pulls in only that element's code and CSS, nothing else.
|
|
12
12
|
*
|
package/dist/general_types.d.ts
CHANGED
|
@@ -151,7 +151,7 @@ export interface AProgressAttributes extends BaseAttributes {
|
|
|
151
151
|
value?: number | string | false;
|
|
152
152
|
/** Maximum value. Defaults to 100. */
|
|
153
153
|
max?: number | string;
|
|
154
|
-
/**
|
|
154
|
+
/** Color variant, or any literal CSS color for a custom tone (derived in
|
|
155
155
|
* oklch). Named tones track light/dark automatically. */
|
|
156
156
|
tone?: 'neutral' | 'brand' | 'info' | 'success' | 'warning' | 'critical' | (string & {});
|
|
157
157
|
/** Size variant. `medium` is the default. */
|
|
@@ -435,12 +435,12 @@ export interface ATooltipAttributes extends BaseAttributes {
|
|
|
435
435
|
* `@antadesign/anta`.
|
|
436
436
|
*/
|
|
437
437
|
export interface ACheckboxAttributes extends BaseAttributes {
|
|
438
|
-
/** Mark
|
|
438
|
+
/** Mark color in every state — checked fill *and* unselected box border — or any
|
|
439
439
|
* literal CSS color for a one-off custom tone. Named tones track light/dark mode
|
|
440
440
|
* automatically. `'neutral'` is the default (same as omitting it). The label + hint
|
|
441
|
-
* stay neutral —
|
|
441
|
+
* stay neutral — recolor them in plain CSS via the `--text-N-{tone}` tokens. */
|
|
442
442
|
tone?: 'brand' | 'neutral' | 'info' | 'success' | 'warning' | 'critical' | (string & {});
|
|
443
|
-
/** Like `tone`, but
|
|
443
|
+
/** Like `tone`, but colored onto the checked mark only — the empty box stays
|
|
444
444
|
* neutral grey. Same value set as `tone`; if both are set, `tone` governs the
|
|
445
445
|
* off-state border and `tone-selected` the checked fill. */
|
|
446
446
|
'tone-selected'?: 'brand' | 'neutral' | 'info' | 'success' | 'warning' | 'critical' | (string & {});
|
|
@@ -489,9 +489,9 @@ export interface ACheckboxAttributes extends BaseAttributes {
|
|
|
489
489
|
* wrapper supplies both.
|
|
490
490
|
*/
|
|
491
491
|
export interface ASwitchAttributes extends BaseAttributes {
|
|
492
|
-
/** Track and thumb
|
|
492
|
+
/** Track and thumb color. A tinted tone also colors the unchecked chrome. */
|
|
493
493
|
tone?: 'brand' | 'neutral' | 'info' | 'success' | 'warning' | 'critical' | (string & {});
|
|
494
|
-
/** Checked-track-only
|
|
494
|
+
/** Checked-track-only color. The unchecked track and thumb stay neutral. */
|
|
495
495
|
'tone-selected'?: 'brand' | 'neutral' | 'info' | 'success' | 'warning' | 'critical' | (string & {});
|
|
496
496
|
/** Size variant. `small` = 26×16px, `medium` (default) = 30×18px, `large` = 34×20px. */
|
|
497
497
|
size?: 'small' | 'medium' | 'large';
|
|
@@ -547,7 +547,7 @@ export interface AInputAttributes extends BaseAttributes {
|
|
|
547
547
|
* wrapper) the glyph. Only `critical` carries validity weight (`aria-invalid`
|
|
548
548
|
* + `:state(invalid)`); the others are advisory. Omit for the neutral field. */
|
|
549
549
|
status?: 'neutral' | 'brand' | 'info' | 'success' | 'warning' | 'critical';
|
|
550
|
-
/** Custom accent
|
|
550
|
+
/** Custom accent color (any literal CSS color) — tints the resting + hover
|
|
551
551
|
* border via an oklch derivation. `status` overrides it for validation. */
|
|
552
552
|
tone?: string;
|
|
553
553
|
/** Disabled state. Presence-based. */
|
|
@@ -571,6 +571,8 @@ export interface AInputAttributes extends BaseAttributes {
|
|
|
571
571
|
name?: string;
|
|
572
572
|
/** Placeholder shown when empty. */
|
|
573
573
|
placeholder?: string;
|
|
574
|
+
/** Ellipsize an overflowing single-line value. Presence-based. */
|
|
575
|
+
truncate?: boolean | '';
|
|
574
576
|
autocomplete?: string;
|
|
575
577
|
inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';
|
|
576
578
|
maxlength?: number | string;
|
|
@@ -612,9 +614,9 @@ export interface ASliderAttributes extends BaseAttributes {
|
|
|
612
614
|
name?: string;
|
|
613
615
|
/** Disables pointer and keyboard interaction. Presence-based. */
|
|
614
616
|
disabled?: boolean | '';
|
|
615
|
-
/**
|
|
617
|
+
/** Color of the filled rail. Named tones or a literal CSS color. */
|
|
616
618
|
tone?: 'neutral' | 'brand' | 'info' | 'success' | 'warning' | 'critical' | (string & {});
|
|
617
|
-
/**
|
|
619
|
+
/** Color of the thumb stroke. Named tones or a literal CSS color. */
|
|
618
620
|
'thumb-tone'?: 'neutral' | 'brand' | 'info' | 'success' | 'warning' | 'critical' | (string & {});
|
|
619
621
|
/** Size variant. small=24px, medium=28px, large=32px tall. */
|
|
620
622
|
size?: 'small' | 'medium' | 'large';
|
|
@@ -622,7 +624,7 @@ export interface ASliderAttributes extends BaseAttributes {
|
|
|
622
624
|
'track-size'?: string;
|
|
623
625
|
/** Diameter of the thumb as a CSS length, such as `'20px'`. */
|
|
624
626
|
'thumb-size'?: string;
|
|
625
|
-
/** Fill the thumb with its resolved border
|
|
627
|
+
/** Fill the thumb with its resolved border color. Presence-based. */
|
|
626
628
|
'thumb-fill'?: boolean | '';
|
|
627
629
|
/** Fully round the rail and thumb, or set both to a custom radius. */
|
|
628
630
|
round?: boolean | number | string;
|
|
@@ -666,7 +668,7 @@ export interface AInputTimeAttributes extends BaseAttributes {
|
|
|
666
668
|
max?: string;
|
|
667
669
|
/** Validation/feedback tone. Only `critical` carries validity weight. */
|
|
668
670
|
status?: 'neutral' | 'brand' | 'info' | 'success' | 'warning' | 'critical';
|
|
669
|
-
/** Custom accent
|
|
671
|
+
/** Custom accent color (any literal CSS color) — tints the resting + hover
|
|
670
672
|
* border via an oklch derivation; `status` overrides for validation. */
|
|
671
673
|
tone?: string;
|
|
672
674
|
/** Disabled state. Presence-based. */
|
|
@@ -938,12 +940,12 @@ export interface ACopyAttributes extends BaseAttributes {
|
|
|
938
940
|
export interface ARadioAttributes extends BaseAttributes {
|
|
939
941
|
/** This option's identity / submitted value. */
|
|
940
942
|
value?: string;
|
|
941
|
-
/** Mark
|
|
943
|
+
/** Mark color in every state — selected ring fill + dot *and* unselected ring
|
|
942
944
|
* border — or any literal CSS color for a one-off custom tone. Named tones track
|
|
943
945
|
* light/dark mode. `'neutral'` is the default. The label + hint stay neutral —
|
|
944
|
-
*
|
|
946
|
+
* recolor them in plain CSS via the `--text-N-{tone}` tokens. */
|
|
945
947
|
tone?: 'brand' | 'neutral' | 'info' | 'success' | 'warning' | 'critical' | (string & {});
|
|
946
|
-
/** Like `tone`, but
|
|
948
|
+
/** Like `tone`, but colored onto the selected mark only — an unselected ring stays
|
|
947
949
|
* neutral grey. Same value set as `tone`; if both are set, `tone` governs the
|
|
948
950
|
* off-state border and `tone-selected` the selected fill. */
|
|
949
951
|
'tone-selected'?: 'brand' | 'neutral' | 'info' | 'success' | 'warning' | 'critical' | (string & {});
|
|
@@ -989,17 +991,17 @@ export interface ARadioGroupAttributes extends BaseAttributes {
|
|
|
989
991
|
/** Form field name — the group submits `name=value`. */
|
|
990
992
|
name?: string;
|
|
991
993
|
/** Mark tone cascaded to children that don't set their own, or any literal CSS
|
|
992
|
-
* color for a one-off custom tone.
|
|
993
|
-
* unselected border. The option text stays neutral —
|
|
994
|
+
* color for a one-off custom tone. Colors every child's ring fill + dot *and*
|
|
995
|
+
* unselected border. The option text stays neutral — recolor it in plain CSS via
|
|
994
996
|
* the `--text-N-{tone}` tokens. */
|
|
995
997
|
tone?: 'brand' | 'neutral' | 'info' | 'success' | 'warning' | 'critical' | (string & {});
|
|
996
|
-
/** Like `tone`, but
|
|
998
|
+
/** Like `tone`, but colored onto the selected option only — every unselected ring
|
|
997
999
|
* stays neutral grey. Cascaded to children that don't set their own. */
|
|
998
1000
|
'tone-selected'?: 'brand' | 'neutral' | 'info' | 'success' | 'warning' | 'critical' | (string & {});
|
|
999
1001
|
/** Size cascaded to children that don't set their own. */
|
|
1000
1002
|
size?: 'small' | 'medium' | 'large';
|
|
1001
1003
|
/** Validation/feedback tone for the group hint — same set as `<a-input>`'s
|
|
1002
|
-
* `status`.
|
|
1004
|
+
* `status`. Recolors `<a-radio-group-hint>`; omit for the neutral default. */
|
|
1003
1005
|
status?: 'neutral' | 'brand' | 'info' | 'success' | 'warning' | 'critical';
|
|
1004
1006
|
/** Disable the whole group. Presence-based. */
|
|
1005
1007
|
disabled?: boolean | '';
|
|
@@ -1044,9 +1046,9 @@ export interface ARadioGroupAttributes extends BaseAttributes {
|
|
|
1044
1046
|
export interface ATabAttributes extends BaseAttributes {
|
|
1045
1047
|
/** This tab's identity / the value reported when it's selected. */
|
|
1046
1048
|
value?: string;
|
|
1047
|
-
/** Per-tab tone override (same vocabulary as `<a-tabs tone>`):
|
|
1049
|
+
/** Per-tab tone override (same vocabulary as `<a-tabs tone>`): colors this tab's
|
|
1048
1050
|
* label + icons and, when selected, its indicator. Named tones tone the sliding
|
|
1049
|
-
* indicator too; a custom literal
|
|
1051
|
+
* indicator too; a custom literal color tones the indicator only in `noslide`.
|
|
1050
1052
|
* Custom tones also set `--tabs-tone-source` on the tab (via the wrapper's style). */
|
|
1051
1053
|
tone?: 'neutral' | 'brand' | 'info' | 'success' | 'warning' | 'critical' | (string & {});
|
|
1052
1054
|
/** Selected state — connect-time seed for the standalone render path (no tablist).
|
|
@@ -1176,7 +1178,7 @@ export interface ACardAttributes extends BaseAttributes {
|
|
|
1176
1178
|
size?: 'small' | 'medium' | 'large';
|
|
1177
1179
|
/** Which edge the full-bleed `media` slot sits on. `top` is the default. */
|
|
1178
1180
|
'media-position'?: 'top' | 'bottom' | 'left' | 'right';
|
|
1179
|
-
/** Selected / chosen state — an inset ring in the tone
|
|
1181
|
+
/** Selected / chosen state — an inset ring in the tone color. Presence-based
|
|
1180
1182
|
* (`''` on, omit off). */
|
|
1181
1183
|
selected?: boolean | '';
|
|
1182
1184
|
/** Loading state — skeleton pulse, `aria-busy`, and (in link mode) navigation is
|
|
@@ -1220,7 +1222,7 @@ export interface ABannerAttributes extends BaseAttributes {
|
|
|
1220
1222
|
* `'closed'` starts it dismissed. */
|
|
1221
1223
|
'default-state'?: 'open' | 'closed';
|
|
1222
1224
|
/** Semantic tone, or any literal CSS color for a one-off custom tone. Named tones
|
|
1223
|
-
* re-point the surface + text + border
|
|
1225
|
+
* re-point the surface + text + border color (used if you opt into a border); a
|
|
1224
1226
|
* custom color keeps its hue with lightness/chroma pinned. `'neutral'` is the
|
|
1225
1227
|
* default (same as omitting it). */
|
|
1226
1228
|
tone?: 'neutral' | 'brand' | 'info' | 'success' | 'warning' | 'critical' | (string & {});
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @antadesign/anta —
|
|
2
|
+
* @antadesign/anta — Anta design system
|
|
3
3
|
*
|
|
4
4
|
* Portable UI components with web component internals and JSX wrappers.
|
|
5
5
|
* Works with React, Preact (via compat or `configure()`), or any custom JSX runtime.
|
|
@@ -43,7 +43,7 @@ export type { SwitchProps, SwitchChangeAttrs } from './components/Switch';
|
|
|
43
43
|
export { Menu } from './components/Menu';
|
|
44
44
|
export type { MenuProps } from './components/Menu';
|
|
45
45
|
export { MenuItem } from './components/MenuItem';
|
|
46
|
-
export type { MenuItemProps } from './components/MenuItem';
|
|
46
|
+
export type { MenuItemProps, MenuItemCommonProps, MenuItemLinkMode, MenuItemActionMode, } from './components/MenuItem';
|
|
47
47
|
export { MenuItemCopy } from './components/MenuItemCopy';
|
|
48
48
|
export type { MenuItemCopyProps } from './components/MenuItemCopy';
|
|
49
49
|
export { MenuSeparator } from './components/MenuSeparator';
|
|
@@ -71,7 +71,7 @@ export type { RadioGroupProps, RadioOption } from './components/RadioGroup';
|
|
|
71
71
|
export { Select, optionsWithSelection } from './components/Select';
|
|
72
72
|
export type { SelectProps, SelectCommonProps, OptionValue, SelectOption, SelectGroup, SelectSubmenu, SelectItem, SelectChangeAttrs, OptionState, TriggerState, EmptyState, SelectionState, SelectedOption, SelectedGroup, SelectedSubmenu, SelectedItem, } from './components/Select';
|
|
73
73
|
export { SelectFaceted } from './components/SelectFaceted';
|
|
74
|
-
export type { SelectFacetedProps, SelectFacet, SelectFacetSingle, SelectFacetMultiple, SelectFacetText, SelectFacetCustom, SelectFacetCustomContext, SelectFacetedValue, SelectFacetedChangeAttrs, SelectFacetedTriggerState, } from './components/SelectFaceted';
|
|
74
|
+
export type { SelectFacetedProps, SelectFacet, SelectFacetSingle, SelectFacetMultiple, SelectFacetText, SelectFacetCustom, SelectFacetCustomContext, FacetFilter, SelectFacetedValue, SelectFacetedChangeAttrs, SelectFacetedTriggerState, } from './components/SelectFaceted';
|
|
75
75
|
export { Tabs } from './components/Tabs';
|
|
76
76
|
export type { TabsProps, TabOption, TabsChangeAttrs } from './components/Tabs';
|
|
77
77
|
export { TabPanel } from './components/TabPanel';
|
package/dist/jsx-runtime.d.ts
CHANGED
|
@@ -94,6 +94,14 @@ export interface AntaIntrinsicElements {
|
|
|
94
94
|
'a-menu-item-hint': BaseAttributes;
|
|
95
95
|
'a-menu-item-text': BaseAttributes;
|
|
96
96
|
'a-menu-separator': BaseAttributes;
|
|
97
|
+
'a-menu-header': BaseAttributes;
|
|
98
|
+
'a-menu-footer': BaseAttributes;
|
|
99
|
+
'a-select-header': BaseAttributes;
|
|
100
|
+
'a-select-footer': BaseAttributes;
|
|
101
|
+
'a-select-chevron': BaseAttributes & {
|
|
102
|
+
open?: boolean | '';
|
|
103
|
+
};
|
|
104
|
+
'a-select-faceted-summary': BaseAttributes;
|
|
97
105
|
'a-menu-group': AMenuGroupAttributes;
|
|
98
106
|
'a-menu-group-label': BaseAttributes;
|
|
99
107
|
'a-tabs': ATabsAttributes;
|
|
@@ -103,6 +111,7 @@ export interface AntaIntrinsicElements {
|
|
|
103
111
|
'a-dialog': ADialogAttributes;
|
|
104
112
|
'a-card': ACardAttributes;
|
|
105
113
|
'a-card-icon-chip': BaseAttributes;
|
|
114
|
+
'a-input-date-time-container': BaseAttributes;
|
|
106
115
|
'a-banner': ABannerAttributes;
|
|
107
116
|
'a-banner-message': BaseAttributes;
|
|
108
117
|
'a-toaster': AToasterAttributes;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Accessibility
|
|
2
|
+
|
|
3
|
+
A few guidelines for designers and engineers using Anta.
|
|
4
|
+
|
|
5
|
+
## Colors
|
|
6
|
+
|
|
7
|
+
The matrix renders every text level on every background for the selected tone and theme. Each cell shows the WCAG 2 contrast ratio, AA or AAA result for the selected size and weight, and APCA Lc value. The controls change rendering and pass thresholds, not the color-pair ratios. Vision tabs apply SVG-filter and CSS-mask simulations; the numbers use normal-vision math.
|
|
8
|
+
|
|
9
|
+
This table uses the browser's system colors directly. It changes with the active
|
|
10
|
+
forced-colors palette, so it shows the values a component can use in that mode.
|
|
11
|
+
|
|
12
|
+
## Color is not a unique communication channel
|
|
13
|
+
|
|
14
|
+
A color-only message fails when a reader cannot distinguish its color. This includes color blindness, low contrast, low brightness, monochrome printing, glare, and theme changes.
|
|
15
|
+
|
|
16
|
+
`tone` on `Progress`, `Text`, backgrounds, and borders is a secondary signal. Pair it with text and, where useful, a distinct icon shape such as a checkmark or cross.
|
|
17
|
+
|
|
18
|
+
The simulator above makes it easy to check a candidate combination across the most common color-vision deficiencies and a handful of other vision conditions.
|
|
19
|
+
|
|
20
|
+
## Low-priority text and contrast
|
|
21
|
+
|
|
22
|
+
The `Text`/`Title` `quaternary` priority (`text-4`) and the `text-5` step (the faintest — used for disabled and hint text across components) sit at intentionally muted contrast, designed for non-essential metadata: timestamps, captions, helper hints, secondary counters. At small sizes (13–15 px) they may not pass WCAG AA against some background levels and tones. Use the matrix above to verify combinations before relying on them for content that has to be readable.
|
|
23
|
+
|
|
24
|
+
`text-1` and `text-2` are the primary-content priorities; reach for them whenever the content matters.
|
|
25
|
+
|
|
26
|
+
## Truncated text and screen readers
|
|
27
|
+
|
|
28
|
+
When `Text` is `truncated` *without* `expandable`, the hidden portion is also hidden from the accessibility tree — the visible ellipsis is what AT reads, exactly like sighted users see. This is intentional: the content the user *can* see is what gets read. If the truncated content matters, set `expandable` too — the chevron is keyboard-discoverable, focus-visible, and Enter/click reveals the rest.
|
|
29
|
+
|
|
30
|
+
## ARIA lives in JSX wrappers, not in web components
|
|
31
|
+
|
|
32
|
+
Anta's web components (`<a-progress>`, `<a-text>`, `<a-icon>`, …) are **pure declarative DOM**. They never set ARIA attributes from JS — no `setAttribute` from constructors or `attributeChangedCallback`. ARIA wiring (`role`, `aria-label`, `aria-valuenow`, etc.) is layered on by the JSX wrappers (`Progress`, `Icon`, `Text`) as ordinary attribute pass-through. If you write the elements by hand instead of via the wrappers, you're responsible for the ARIA bits — the elements stay DOM-clean either way.
|
|
33
|
+
|
|
34
|
+
This means consumers in other reactive engines (Worker-driven UIs, plain HTML, hand-rolled JSX) get web components that don't fight their state model, while React/Preact users get accessible defaults out of the box from the wrappers.
|