@antadesign/anta 0.3.4 → 0.3.6

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.
Files changed (55) hide show
  1. package/dist/anta_helpers.d.ts +10 -0
  2. package/dist/anta_helpers.js +8 -0
  3. package/dist/components/Calendar.d.ts +3 -2
  4. package/dist/components/Calendar.js +18 -7
  5. package/dist/components/Dialog.d.ts +92 -0
  6. package/dist/components/Dialog.js +71 -0
  7. package/dist/components/Input.d.ts +3 -0
  8. package/dist/components/InputAutocomplete.d.ts +69 -0
  9. package/dist/components/InputAutocomplete.js +95 -0
  10. package/dist/components/InputDate.d.ts +3 -2
  11. package/dist/components/InputDate.js +36 -91
  12. package/dist/components/InputDate.module.css +1 -1
  13. package/dist/components/InputTime.d.ts +105 -0
  14. package/dist/components/InputTime.js +110 -0
  15. package/dist/components/Menu.d.ts +9 -1
  16. package/dist/components/Menu.js +4 -1
  17. package/dist/components/MenuItem.d.ts +9 -1
  18. package/dist/components/MenuItem.js +2 -1
  19. package/dist/components/Select.d.ts +29 -8
  20. package/dist/components/Select.js +23 -30
  21. package/dist/components/Select.module.css +1 -1
  22. package/dist/components/SelectFaceted.d.ts +190 -0
  23. package/dist/components/SelectFaceted.js +332 -0
  24. package/dist/components/SelectFaceted.module.css +1 -0
  25. package/dist/components/Tabs.d.ts +6 -0
  26. package/dist/components/Tabs.js +3 -1
  27. package/dist/components/select-options.d.ts +14 -0
  28. package/dist/components/select-options.js +31 -0
  29. package/dist/elements/a-button.css +1 -1
  30. package/dist/elements/a-calendar.css +1 -1
  31. package/dist/elements/a-dialog.css +1 -0
  32. package/dist/elements/a-dialog.d.ts +26 -0
  33. package/dist/elements/a-dialog.js +386 -0
  34. package/dist/elements/a-expander.js +2 -2
  35. package/dist/elements/a-input-time.css +1 -0
  36. package/dist/elements/a-input-time.d.ts +27 -0
  37. package/dist/elements/a-input-time.js +857 -0
  38. package/dist/elements/a-input.css +1 -1
  39. package/dist/elements/a-input.js +7 -1
  40. package/dist/elements/a-menu-item.css +1 -1
  41. package/dist/elements/a-menu.d.ts +5 -2
  42. package/dist/elements/a-menu.js +42 -7
  43. package/dist/elements/a-tab.css +1 -1
  44. package/dist/elements/a-tabs.css +1 -1
  45. package/dist/elements/a-tooltip.d.ts +17 -0
  46. package/dist/elements/a-tooltip.js +29 -1
  47. package/dist/elements/index.d.ts +2 -0
  48. package/dist/elements/index.js +6 -0
  49. package/dist/general_types.d.ts +97 -0
  50. package/dist/index.d.ts +8 -0
  51. package/dist/index.js +8 -0
  52. package/dist/jsx-runtime.d.ts +3 -1
  53. package/dist/reset.css +1 -1
  54. package/dist/tokens.css +1 -1
  55. 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)>[slot=leading],a-input:not(:defined)>[slot=trailing],a-input:not(:defined)>[slot=clear],a-input:not(:defined)>[slot=hint]{display:none!important}a-input:not(:defined)>[slot=label]{display:block;color:var(--input-label);font-family:var(--sans-serif);font-size:15px;line-height:20px;font-weight:500}a-input[size=small]:not(:defined)>[slot=label]{font-size:13px;line-height:16px}a-input[size=large]:not(:defined)>[slot=label]{font-size:17px;line-height:22px}a-input:not(:defined):after{content:attr(placeholder);display:block;min-height:28px;line-height:28px;padding-inline:7px;border-radius:4px;box-shadow:inset 0 0 0 .5px var(--input-border);color:var(--input-placeholder);font-family:var(--sans-serif);font-size:15px;font-weight:400;font-feature-settings:"ss02","ss05","tnum";font-variation-settings:"wdth" 100,"slnt" 0,"ital" 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}a-input[value]:not([value=""]):not([type=password]):not(:defined):after{content:attr(value);color:var(--input-text)}a-input[size=small]:not(:defined):after{min-height:24px;line-height:24px;font-size:13px}a-input[size=large]:not(:defined):after{min-height:32px;line-height:32px;font-size:17px}a-input[round]:not(:defined):after{border-radius:var(--input-round, 999px)}a-input{transition:opacity .28s ease-out 40ms}a-input:not(:defined){opacity:.5}@media(prefers-reduced-motion:reduce){a-input{transition:none}}a-input{--input-bg: var(--bg-1);--input-border: var(--border-2);--input-border-hover: var(--border-1);--input-text: var(--text-1);--input-label: var(--text-3);--input-placeholder: var(--text-4);--input-adornment: var(--text-4);--input-hint: var(--text-3);width:100%}a-input[round]{--input-round: attr(round type(<length>), 999px)}a-input[tone]:not([tone=""]){--input-tone-source: attr(tone type(<color>), var(--border-2));--input-border: oklch(from var(--input-tone-source) .7 calc(c*.8) h);--input-border-hover: oklch(from var(--input-tone-source) .6 c h);.dark &{--input-border: oklch(from var(--input-tone-source) .5 calc(c*.8) h);--input-border-hover: oklch(from var(--input-tone-source) .6 c h)}}a-input[status=critical]{--input-bg: #fefbfb;--input-border: #de4545;--input-border-hover: #de4545;--input-hint: #c9302c}a-input[status=warning]{--input-bg: #fefbf6;--input-border: #ae6613;--input-border-hover: #ae6613;--input-hint: #995200}a-input[status=success]{--input-bg: #f7fcf9;--input-border: #329550;--input-border-hover: #329550;--input-hint: #2a7e43}a-input[status=info]{--input-bg: #fbfcfe;--input-border: #2686d9;--input-border-hover: #2686d9;--input-hint: #175082}a-input[status=brand]{--input-bg: #fcfcfe;--input-border: #7460d7;--input-border-hover: #7460d7;--input-hint: #5f4bc3}.dark a-input[status=critical]{--input-bg: #1f0506;--input-border: #c9302c;--input-border-hover: #c9302c;--input-hint: #e25858}.dark a-input[status=warning]{--input-bg: #120a03;--input-border: #995200;--input-border-hover: #995200;--input-hint: #c37416}.dark a-input[status=success]{--input-bg: #041008;--input-border: #2a7e43;--input-border-hover: #2a7e43;--input-hint: #3aab5c}.dark a-input[status=info]{--input-bg: #040d18;--input-border: #1f6eb2;--input-border-hover: #1f6eb2;--input-hint: #3e93dd}.dark a-input[status=brand]{--input-bg: #0b0916;--input-border: #5f4bc3;--input-border-hover: #5f4bc3;--input-hint: #8270db}a-input:disabled{--input-bg: #44374b12;--input-border: #44374b26;--input-border-hover: #44374b26;--input-text: var(--text-4);--input-label: var(--text-4);--input-hint: var(--text-5);cursor:not-allowed}a-input[status]:disabled{--input-bg: #44374b12;--input-border: #44374b26;--input-border-hover: #44374b26;--input-hint: var(--text-5)}.dark a-input:disabled{--input-bg: #e4d1ef0d;--input-border: #e4d1ef1f;--input-border-hover: #e4d1ef1f}.dark a-input[status]:disabled{--input-bg: #e4d1ef0d;--input-border: #e4d1ef1f;--input-border-hover: #e4d1ef1f;--input-hint: var(--text-5)}a-input[size=small] a-icon{--icon-size: 14px}a-input[size=large] a-icon{--icon-size: 18px}a-input [slot=hint]>a-icon{margin-block-start:1px}a-input[size=small] [slot=hint]>a-icon{margin-block-start:.5px}a-input[size=large] [slot=hint]>a-icon{margin-block-start:1.5px}.dark a-input:not([status]){--input-border: #49424c;--input-border-hover: #635b65}.dark a-input[status=success]{--input-border: var(--border-1-success);--input-border-hover: var(--border-1-success)}}
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)}}
@@ -121,7 +121,13 @@ const SHADOW_STYLE = `
121
121
  input::-webkit-outer-spin-button { -webkit-appearance: none; appearance: none; display: none; }
122
122
  input::-ms-clear, input::-ms-reveal { display: none; }
123
123
 
124
- slot[name="leading"], slot[name="trailing"] { display: none; color: var(--input-adornment); }
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
+ }
125
131
  .field.has-leading slot[name="leading"],
126
132
  .field.has-trailing slot[name="trailing"] {
127
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:has(>a-menu:state(open)),a-menu-item:state(active){background:color-mix(in oklch,currentColor var(--menu-item-hover),transparent);transition:background-color var(--menu-item-timing-in)}a-menu-item:active{background:color-mix(in oklch,currentColor var(--menu-item-active),transparent);transition:none}a-menu-item[selected]{background:color-mix(in oklch,currentColor var(--menu-item-selected),transparent)}a-menu-item:focus-visible{outline:1px solid var(--focus-ring);outline-offset:1px}a-menu-item>a-menu-item-label,a-menu-item>a-menu-item-text{flex:1 1 auto;min-width:0}a-menu-item>a-menu-item-text{display:flex;flex-direction:column}a-menu-item:has(>a-menu-item-text){align-items:flex-start}a-menu-item-label{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis}a-menu-item-hint{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;margin-block-start:1px;color:var(--menu-item-hint-color);font-size:12px;line-height:15px}a-menu-item>a-icon{flex:none;--icon-size: 16px;color:var(--menu-item-icon-color)}a-menu-item>a-checkbox,a-menu-item>a-radio{flex:none;--checkbox-gap: 0;--radio-gap: 0;pointer-events:none}a-menu-item:has(>:is(a-icon,a-checkbox,a-radio,[data-indicator]):first-child:not(:only-child)){padding-inline-start:var(--menu-item-padding-y)}a-menu-item:not([submenu]):has(>a-icon:last-child:not(:only-child)){padding-inline-end:max(0px,var(--menu-item-padding-x) - 2px)}a-menu-item>kbd{flex:none;margin-left:auto;padding-left:12px;color:var(--text-5);font:inherit;font-size:1em;letter-spacing:.1ch;white-space:nowrap}a-menu-item[submenu]>a-icon:last-of-type{margin-left:auto}a-menu-item[submenu]>a-icon:last-of-type,a-menu-item>a-icon:last-child:not(:only-child){position:relative;inset-inline-end:-2px}a-menu-item[tone=brand],a-menu-item[tone=info],a-menu-item[tone=success],a-menu-item[tone=warning],a-menu-item[tone=critical]{--menu-item-icon-color: var(--menu-item-color)}a-menu-item[tone=brand]{--menu-item-color: var(--text-2-brand);--menu-item-hint-color: var(--text-3-brand)}a-menu-item[tone=info]{--menu-item-color: var(--text-2-info);--menu-item-hint-color: var(--text-3-info)}a-menu-item[tone=success]{--menu-item-color: var(--text-2-success);--menu-item-hint-color: var(--text-3-success)}a-menu-item[tone=warning]{--menu-item-color: var(--text-2-warning);--menu-item-hint-color: var(--text-3-warning)}a-menu-item[tone=critical]{--menu-item-color: var(--text-2-critical);--menu-item-hint-color: var(--text-3-critical)}a-menu-item[tone]:not([tone=""],[tone=brand],[tone=neutral],[tone=info],[tone=success],[tone=warning],[tone=critical]){--menu-item-tone-source: attr(tone type(<color>), var(--text-2));--menu-item-color: oklch(from var(--menu-item-tone-source) .45 c h);--menu-item-icon-color: var(--menu-item-color);--menu-item-hint-color: oklch(from var(--menu-item-tone-source) .55 calc(c*.85) h);.dark &{--menu-item-color: oklch(from var(--menu-item-tone-source) .78 c h);--menu-item-hint-color: oklch(from var(--menu-item-tone-source) .68 calc(c*.85) h)}}a-menu-item[disabled]{--menu-item-color: var(--text-5);--menu-item-icon-color: var(--text-5);--menu-item-hint-color: var(--text-5);cursor:default;pointer-events:none}.dark a-menu-item{--menu-item-hover: 10%;--menu-item-active: 14%;--menu-item-selected: 14%}}
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%}}
@@ -110,8 +110,11 @@ export declare class AMenuElement extends HTMLElementBase {
110
110
  * the seat target — the cursor lands on the first real option — but they stay
111
111
  * arrow-reachable. */
112
112
  private resetActive;
113
- /** Combobox arrow / Home / End / Enter handling; returns true if it consumed the
114
- * key (so `handleKey` stops). Any other key falls through to the input (typing). */
113
+ /** Combobox arrow / PageUp / PageDown / Enter handling; returns true if it
114
+ * consumed the key (so `handleKey` stops). Home / End are deliberately NOT
115
+ * handled: focus is in a text field, so they must reach it for caret movement
116
+ * (line start/end); PageUp / PageDown jump the option list to first / last
117
+ * instead. Any other key falls through to the input (typing). */
115
118
  private handleComboKey;
116
119
  /** Public imperative API. Routes through the same intent path as the
117
120
  * triggers, so it emits `statechange` and respects controlled mode. */
@@ -451,11 +451,22 @@ class AMenuElement extends HTMLElementBase {
451
451
  el.style.setProperty("--fade-bottom", bottom ? "14px" : "0px");
452
452
  }
453
453
  /* ------------------------------ combobox mode ------------------------------ */
454
- /** The filter field slotted into THIS menu (never a submenu's), or null. Its
454
+ /** Combobox-anchor mode: the trigger anchor ITSELF is the filter field (it
455
+ * carries `[data-menu-search]`), as in `InputAutocomplete` where an editable
456
+ * `<a-input>` is the always-visible field the menu hangs under. null for the
457
+ * normal case — `Select`/`SelectFaceted` slot the field as a child, so their
458
+ * anchor never carries the marker and this stays inert for them. */
459
+ get #comboAnchor() {
460
+ const a = this.triggerAnchor;
461
+ return a?.matches("[data-menu-search]") ? a : null;
462
+ }
463
+ /** The filter field of THIS menu, or null. A slotted child (never a submenu's)
464
+ * wins; else the anchor when it's the field (combobox-anchor mode). Its
455
465
  * presence switches the menu to the combobox keyboard. */
456
466
  get #searchField() {
457
467
  const el = this.querySelector("[data-menu-search]");
458
- return el && el.closest("a-menu") === this ? el : null;
468
+ if (el && el.closest("a-menu") === this) return el;
469
+ return this.#comboAnchor;
459
470
  }
460
471
  /** Move the combobox cursor. Sets the item's `active` **property** (off-DOM
461
472
  * `:state(active)`, no attribute churn) for the highlight, and REPORTS the
@@ -481,11 +492,15 @@ class AMenuElement extends HTMLElementBase {
481
492
  resetActive() {
482
493
  const q = this.#searchField?.value;
483
494
  if (!q || !q.trim()) return this.setActive(null);
495
+ if (this.#comboAnchor) return this.setActive(null);
484
496
  const items = this.focusableItems();
485
497
  this.setActive(items.find((it) => !it.hasAttribute("data-menu-skip-active")) ?? items[0] ?? null);
486
498
  }
487
- /** Combobox arrow / Home / End / Enter handling; returns true if it consumed the
488
- * key (so `handleKey` stops). Any other key falls through to the input (typing). */
499
+ /** Combobox arrow / PageUp / PageDown / Enter handling; returns true if it
500
+ * consumed the key (so `handleKey` stops). Home / End are deliberately NOT
501
+ * handled: focus is in a text field, so they must reach it for caret movement
502
+ * (line start/end); PageUp / PageDown jump the option list to first / last
503
+ * instead. Any other key falls through to the input (typing). */
489
504
  handleComboKey(e) {
490
505
  const items = this.focusableItems();
491
506
  const idx = this.activeItem ? items.indexOf(this.activeItem) : -1;
@@ -498,11 +513,11 @@ class AMenuElement extends HTMLElementBase {
498
513
  e.preventDefault();
499
514
  this.setActive(items[idx <= 0 ? items.length - 1 : idx - 1] ?? null);
500
515
  return true;
501
- case "Home":
516
+ case "PageUp":
502
517
  e.preventDefault();
503
518
  this.setActive(items[0] ?? null);
504
519
  return true;
505
- case "End":
520
+ case "PageDown":
506
521
  e.preventDefault();
507
522
  this.setActive(items[items.length - 1] ?? null);
508
523
  return true;
@@ -561,6 +576,15 @@ class AMenuElement extends HTMLElementBase {
561
576
  * uncontrolled and not vetoed. */
562
577
  requestClose(originEvent) {
563
578
  if (!this._shown) return;
579
+ const idx = openStack.indexOf(this);
580
+ if (idx !== -1) {
581
+ for (let i = openStack.length - 1; i > idx; i--) {
582
+ const m = openStack[i];
583
+ if (m.isOpen && !m._dismissNotified) m.emitChange("closed");
584
+ m._doHide();
585
+ }
586
+ openStack.length = idx + 1;
587
+ }
564
588
  const ok = this.emitChange("closed", { originEvent });
565
589
  if (this.isControlled) {
566
590
  this._dismissNotified = true;
@@ -742,7 +766,8 @@ class AMenuElement extends HTMLElementBase {
742
766
  } else {
743
767
  const a = this.triggerAnchor ? anchorRect(this.triggerAnchor) : null;
744
768
  if (!a) return;
745
- surface.style.setProperty("--_anchor-width", `${Math.ceil(a.width)}px`);
769
+ if (this.hasAttribute("autowidth")) surface.style.removeProperty("--_anchor-width");
770
+ else surface.style.setProperty("--_anchor-width", `${Math.ceil(a.width)}px`);
746
771
  const p = this.#placement;
747
772
  const spaceBelow = vh - a.bottom - 2 * MARGIN;
748
773
  const spaceAbove = a.top - 2 * MARGIN;
@@ -838,6 +863,10 @@ class AMenuElement extends HTMLElementBase {
838
863
  return;
839
864
  }
840
865
  if (e.key === "Tab") {
866
+ if (this.#comboAnchor) {
867
+ this.requestClose(e);
868
+ return;
869
+ }
841
870
  const f = this.focusables();
842
871
  if (!f.length) return;
843
872
  e.preventDefault();
@@ -959,6 +988,12 @@ class AMenuElement extends HTMLElementBase {
959
988
  anchor.removeEventListener("contextmenu", onContext);
960
989
  this.listening = false;
961
990
  };
991
+ } else if (this.#comboAnchor) {
992
+ this.teardown = () => {
993
+ this.listening = false;
994
+ };
995
+ this.listening = true;
996
+ return;
962
997
  } else {
963
998
  const onClick = (e) => {
964
999
  const viaKeyboard = e.detail === 0;
@@ -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;padding-block:var(--tab-padding-y);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
+ @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-tabs{--_fs: 15px;--_lh: 20px;--_pb: 1px;--tab-padding-x: 9px;--tab-padding-y: calc((10px - var(--_pb)) / 2);--tab-radius: 4px;--tabs-gap: 3px;--tab-timing: .15s ease-out;--tabs-tone-source: #635b65;--tab-fg-rest: var(--text-3);--tab-fg-hover: var(--text-1);--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);--tab-pill-bg: var(--bg-1);--tab-pill-shadow: 0 0 3px 0 var(--border-3);--tab-secondary-bg: color-mix(in oklch, #44374b 3%, transparent);--tab-secondary-border: var(--border-3);--tab-secondary-shadow: 0 0 0px 1px var(--tab-secondary-border);display:flex;flex-direction:row;align-items:stretch;gap:var(--tabs-gap);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}a-tabs[size=large]{--_fs: 17px;--_lh: 24px;--_pb: 1.5px;--tab-padding-x: 13px}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-secondary-border: var(--border-3-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-secondary-border: var(--border-3-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-secondary-border: var(--border-3-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-secondary-border: var(--border-3-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-secondary-border: var(--border-3-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 / .08);--tab-secondary-bg: oklch(from var(--tabs-tone-source) .55 .14 h / .03);--tab-pill-shadow: 0 0 3px 0 oklch(from var(--tabs-tone-source) .62 .12 h / .5)}a-tabs:has(>a-tab[tone=brand]:state(selected)){--tabs-tone-source: #5f4bc3;--tab-selected-text: var(--text-1-brand);--tab-secondary-border: var(--border-3-brand)}a-tabs:has(>a-tab[tone=info]:state(selected)){--tabs-tone-source: #1f6eb2;--tab-selected-text: var(--text-1-info);--tab-secondary-border: var(--border-3-info)}a-tabs:has(>a-tab[tone=success]:state(selected)){--tabs-tone-source: #2a7e43;--tab-selected-text: var(--text-1-success);--tab-secondary-border: var(--border-3-success)}a-tabs:has(>a-tab[tone=warning]:state(selected)){--tabs-tone-source: #c37416;--tab-selected-text: var(--text-1-warning);--tab-secondary-border: var(--border-3-warning)}a-tabs:has(>a-tab[tone=critical]:state(selected)){--tabs-tone-source: #c9302c;--tab-selected-text: var(--text-1-critical);--tab-secondary-border: var(--border-3-critical)}a-tabs:has(>a-tab[tone]:state(selected):not([tone=""],[tone=neutral])){--tab-pill-shadow: 0 0 3px 0 oklch(from var(--tabs-tone-source) .62 .12 h / .5);--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) .9 .047 h);--tab-secondary-border: oklch(from var(--tabs-tone-source) .87 .065 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-fg-hover)}}a-tabs:not([priority=secondary],[priority=tertiary]){background:var(--tabs-track-bg);border:.5px solid var(--tabs-track-border);border-radius:6px;padding:1.5px}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-pill-bg);box-shadow:var(--tab-pill-shadow)}a-tabs[tone]:not([tone=""],[tone=neutral]),a-tab[tone]:not([tone=""],[tone=neutral]){--tab-fg-rest: var(--tab-rest-tone);--tab-fg-hover: var(--tab-selected-text)}a-tabs[priority=secondary]{border:.5px solid transparent;padding:1.5px}@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-secondary-shadow)}a-tabs[priority=tertiary]{padding-inline:2px}a-tabs[priority=tertiary] a-tab{--tab-underline-size: 1px;--tab-underline-color: transparent;position:relative;border-radius:0}a-tabs[priority=tertiary]:not([orientation=vertical]) a-tab{padding-block:calc(var(--tab-padding-y) + 2px)}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-pill-bg);border-radius:var(--tab-radius);box-shadow:var(--tab-pill-shadow)}a-tabs:not([noslide])[priority=secondary]:before{background:var(--tab-secondary-bg);border-radius:var(--tab-radius);box-shadow:var(--tab-secondary-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 10%, transparent);--tab-secondary-bg: color-mix(in oklch, #e4d1ef 6%, 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 / .12);--tab-secondary-bg: oklch(from var(--tabs-tone-source) .8 .12 h / .06);--tab-pill-shadow: 0 0 3px 0 oklch(from var(--tabs-tone-source) .8 .1 h / .45)}.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 / .06);--tab-pill-shadow: 0 0 3px 0 oklch(from var(--tabs-tone-source) .8 .1 h / .45)}.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) .25 .057 h);--tab-secondary-border: oklch(from var(--tabs-tone-source) .33 .087 h)}}
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)}}
@@ -52,6 +52,9 @@ export declare class ATooltipElement extends HTMLElementBase {
52
52
  private fading;
53
53
  private fadeTimer?;
54
54
  private docMoveBound;
55
+ /** Active only while shown: re-runs the empty gate when the slotted content
56
+ * changes under a live bubble. See observeContent(). */
57
+ private contentObserver?;
55
58
  constructor();
56
59
  connectedCallback(): void;
57
60
  disconnectedCallback(): void;
@@ -76,6 +79,20 @@ export declare class ATooltipElement extends HTMLElementBase {
76
79
  * (so formatting whitespace / an empty conditional doesn't open a blank bubble).
77
80
  * Re-checked on every show(), so a tooltip populated later self-corrects. */
78
81
  private isEmpty;
82
+ /** While shown, watch the slotted content so a bubble whose content is
83
+ * cleared out from under it — a reactive re-render dropping the text /
84
+ * children under one persistent anchor — self-hides. The mirror of
85
+ * isEmpty()'s "populated later self-corrects": the show-time gate can't fire
86
+ * again on its own once open, so this drives the reverse.
87
+ *
88
+ * A MutationObserver, not `slotchange`, because reactive renderers update
89
+ * text in place — React sets an existing text node's nodeValue rather than
90
+ * replacing the node — which changes no assigned-node set and so fires no
91
+ * `slotchange`; childList + characterData + subtree catches both that and
92
+ * node removal. Observing our own light-DOM children is a READ (like the
93
+ * truncation measurements), so it stays within the no-host-mutation rule.
94
+ * Runs only while shown — attached here, disconnected by hide() / cleanup(). */
95
+ private observeContent;
79
96
  private positionFrame?;
80
97
  private pendingPosition?;
81
98
  private schedulePosition;
@@ -85,6 +85,9 @@ class ATooltipElement extends HTMLElementBase {
85
85
  fading = false;
86
86
  fadeTimer;
87
87
  docMoveBound = false;
88
+ /** Active only while shown: re-runs the empty gate when the slotted content
89
+ * changes under a live bubble. See observeContent(). */
90
+ contentObserver;
88
91
  constructor() {
89
92
  super();
90
93
  const shadow = this.attachShadow({ mode: "open" });
@@ -128,7 +131,7 @@ class ATooltipElement extends HTMLElementBase {
128
131
  overflow: clip;
129
132
  text-align: left;
130
133
  background: var(--tooltip-bg, Canvas);
131
- color: var(--text-3, CanvasText);
134
+ color: var(--text-2, CanvasText);
132
135
  box-shadow: var(--tooltip-shadow, 0 1px 8px rgba(0, 0, 0, 0.2));
133
136
  -webkit-backdrop-filter: var(--tooltip-backdrop-filter, blur(8px));
134
137
  backdrop-filter: var(--tooltip-backdrop-filter, blur(8px));
@@ -259,6 +262,28 @@ class ATooltipElement extends HTMLElementBase {
259
262
  isEmpty() {
260
263
  return this.children.length === 0 && (this.textContent ?? "").trim() === "";
261
264
  }
265
+ /** While shown, watch the slotted content so a bubble whose content is
266
+ * cleared out from under it — a reactive re-render dropping the text /
267
+ * children under one persistent anchor — self-hides. The mirror of
268
+ * isEmpty()'s "populated later self-corrects": the show-time gate can't fire
269
+ * again on its own once open, so this drives the reverse.
270
+ *
271
+ * A MutationObserver, not `slotchange`, because reactive renderers update
272
+ * text in place — React sets an existing text node's nodeValue rather than
273
+ * replacing the node — which changes no assigned-node set and so fires no
274
+ * `slotchange`; childList + characterData + subtree catches both that and
275
+ * node removal. Observing our own light-DOM children is a READ (like the
276
+ * truncation measurements), so it stays within the no-host-mutation rule.
277
+ * Runs only while shown — attached here, disconnected by hide() / cleanup(). */
278
+ observeContent() {
279
+ if (typeof MutationObserver === "undefined") return;
280
+ if (!this.contentObserver) {
281
+ this.contentObserver = new MutationObserver(() => {
282
+ if (this.shown && this.isEmpty()) this.hide();
283
+ });
284
+ }
285
+ this.contentObserver.observe(this, { childList: true, characterData: true, subtree: true });
286
+ }
262
287
  // --- positioning (sets only the shadow container's own transform) ---
263
288
  // Single pending position frame: a burst of mousemoves within one frame
264
289
  // coalesces to ONE layout read + transform write, using the LATEST geometry
@@ -353,6 +378,7 @@ class ATooltipElement extends HTMLElementBase {
353
378
  this.doc.addEventListener("mousemove", this.onDocMove);
354
379
  this.docMoveBound = true;
355
380
  }
381
+ this.observeContent();
356
382
  }
357
383
  this.position(e);
358
384
  };
@@ -361,6 +387,7 @@ class ATooltipElement extends HTMLElementBase {
361
387
  if (!this.shown) return;
362
388
  this.shown = false;
363
389
  this.touchOpen = false;
390
+ this.contentObserver?.disconnect();
364
391
  this.container.hidePopover();
365
392
  this.fading = true;
366
393
  if (this.fadeTimer !== void 0) clearTimeout(this.fadeTimer);
@@ -391,6 +418,7 @@ class ATooltipElement extends HTMLElementBase {
391
418
  * calls it. */
392
419
  cleanup() {
393
420
  this.cancelHide();
421
+ this.contentObserver?.disconnect();
394
422
  if (this.shown) {
395
423
  this.shown = false;
396
424
  this.touchOpen = false;
@@ -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';
@@ -31,5 +32,6 @@ 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';
33
34
  export { ATabPanelElement, register_a_tabpanel } from './a-tabpanel';
35
+ export { ADialogElement, register_a_dialog } from './a-dialog';
34
36
  import './a-title.css';
35
37
  import './a-tag.css';
@@ -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";
@@ -16,15 +17,18 @@ 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";
18
19
  import { ATabPanelElement, register_a_tabpanel } from "./a-tabpanel";
20
+ import { ADialogElement, register_a_dialog } from "./a-dialog";
19
21
  import "./a-title.css";
20
22
  import "./a-tag.css";
21
23
  export {
22
24
  AButtonElement,
23
25
  ACalendarElement,
24
26
  ACheckboxElement,
27
+ ADialogElement,
25
28
  AExpanderElement,
26
29
  AIconElement,
27
30
  AInputElement,
31
+ AInputTimeElement,
28
32
  AMenuElement,
29
33
  AMenuGroupElement,
30
34
  AMenuItemElement,
@@ -40,9 +44,11 @@ export {
40
44
  register_a_button,
41
45
  register_a_calendar,
42
46
  register_a_checkbox,
47
+ register_a_dialog,
43
48
  register_a_expander,
44
49
  register_a_icon,
45
50
  register_a_input,
51
+ register_a_input_time,
46
52
  register_a_menu,
47
53
  register_a_menu_group,
48
54
  register_a_menu_item,
@@ -291,6 +291,51 @@ export interface AExpanderAttributes extends BaseAttributes {
291
291
  prev: 'open' | 'closed';
292
292
  }>) => void;
293
293
  }
294
+ /**
295
+ * Attributes for the `<a-dialog>` custom element — a modal dialog / edge drawer
296
+ * built on a native `<dialog>` in shadow DOM (top layer, focus trap, backdrop,
297
+ * Esc from the platform). Slots (light-DOM children): `header`, `footer`,
298
+ * `close` (the close button), and the default slot for the body. The element
299
+ * exposes `::part(dialog | header | body | footer | close)`. Low-level
300
+ * attributes; for the typed JSX wrapper use `Dialog` from `@antadesign/anta`.
301
+ */
302
+ export interface ADialogAttributes extends BaseAttributes {
303
+ /** Controlled open state (`'open'` / `'closed'`). Present → controlled: the
304
+ * attribute is the source of truth, user dismiss only dispatches the
305
+ * cancelable `statechange` event, and the consumer answers by updating it.
306
+ * Absent → uncontrolled (use `default-state`). See STATEFUL-COMPONENTS.md. */
307
+ state?: 'open' | 'closed';
308
+ /** Initial open state for the uncontrolled mode (`'open'` / `'closed'`); read
309
+ * once when the element connects. */
310
+ 'default-state'?: 'open' | 'closed';
311
+ /** Placement. `center` (default, omit) is a centered modal; `left` / `right` /
312
+ * `top` / `bottom` turn it into an edge drawer; `fullscreen` fills the whole
313
+ * viewport (no edge gap, no radius). */
314
+ position?: 'center' | 'left' | 'right' | 'top' | 'bottom' | 'fullscreen';
315
+ /** Corner radius. A side keyword (`top` / `right` / `bottom` / `left`) rounds
316
+ * only that edge's two corners at `--dialog-radius`; a length (`round="20px"`)
317
+ * or full `border-radius` shorthand rounds all corners at that value; bare
318
+ * `round` rounds all corners at `--dialog-radius`. Omit for the position
319
+ * default (center rounded, drawers / fullscreen square). */
320
+ round?: boolean | number | 'top' | 'right' | 'bottom' | 'left' | (string & {});
321
+ /** Disable light dismiss — Esc + backdrop click no longer close the dialog (it
322
+ * closes only via the close button or programmatically). For alert / confirm
323
+ * dialogs. Presence-based (`''` on, omit off). */
324
+ persistent?: boolean | '';
325
+ /** Uncontrolled trigger name. Any element with `data-dialog-open="{name}"`
326
+ * opens this dialog and `data-dialog-close="{name}"` closes it, via a document
327
+ * click listener. Ignored in controlled mode. */
328
+ name?: string;
329
+ /** Fires before the open state changes — the element dispatches a `cancelable`
330
+ * `statechange` `CustomEvent` whose `detail` is `{ next, prev }` in the
331
+ * `'open'|'closed'` vocabulary. Uncontrolled, `preventDefault()` vetoes the
332
+ * transition. All-lowercase so both renderers bind it (React 19 keeps the case
333
+ * after `on`; Preact lowercases). */
334
+ onstatechange?: (e: CustomEvent<{
335
+ next: 'open' | 'closed';
336
+ prev: 'open' | 'closed';
337
+ }>) => void;
338
+ }
294
339
  /**
295
340
  * Attributes for the `<a-icon>` custom element. `shape` is typed as
296
341
  * `IconShape` (`keyof IconShapes`); the `IconShapes` interface is
@@ -478,6 +523,52 @@ export interface AInputAttributes extends BaseAttributes {
478
523
  'aria-invalid'?: 'true' | 'false' | boolean;
479
524
  'aria-label'?: string;
480
525
  }
526
+ /** Attributes for the `<a-input-time>` custom element — a segmented wall-clock
527
+ * time field (hour / minute / AM-PM spinbutton sections in one box). */
528
+ export interface AInputTimeAttributes extends BaseAttributes {
529
+ /** Controlled value — 24-hour `"HH:mm"`, `''` when incomplete. */
530
+ value?: string;
531
+ /** Initial value for the uncontrolled case (24-hour `"HH:mm"`). */
532
+ defaultvalue?: string;
533
+ /** BCP-47 locale driving the clock (12h vs 24h), segment order, separator, and
534
+ * the AM/PM text. Defaults to `navigator.language`. */
535
+ locale?: string;
536
+ /** Force the clock — `'true'` = 12-hour (AM/PM), `'false'` = 24-hour. Omit to
537
+ * follow the locale. Value-based (tri-state), not a presence boolean. */
538
+ hour12?: 'true' | 'false';
539
+ /** Earliest allowed time, 24-hour `"HH:mm"` — complete values below it clamp up
540
+ * and flag `rangeUnderflow`. */
541
+ min?: string;
542
+ /** Latest allowed time, 24-hour `"HH:mm"` — complete values above it clamp down
543
+ * and flag `rangeOverflow`. */
544
+ max?: string;
545
+ /** Validation/feedback tone. Only `critical` carries validity weight. */
546
+ status?: 'neutral' | 'brand' | 'info' | 'success' | 'warning' | 'critical';
547
+ /** Custom accent colour (any literal CSS colour) — tints the resting + hover
548
+ * border via an oklch derivation; `status` overrides for validation. */
549
+ tone?: string;
550
+ /** Disabled state. Presence-based. */
551
+ disabled?: boolean | '';
552
+ /** Required — drives native validity. Presence-based. */
553
+ required?: boolean | '';
554
+ /** Dim the trailing adornments at rest (0.6); brighten on hover / focus. */
555
+ 'dim-actions'?: boolean | '';
556
+ /** Fully-round field, or a custom radius via a length value. Presence-based
557
+ * for the boolean form. */
558
+ round?: boolean | number | string;
559
+ /** Size variant. small=24px, medium (default)=28px, large=32px. */
560
+ size?: 'small' | 'medium' | 'large';
561
+ /** Form field name — the 24-hour value submits via ElementInternals. */
562
+ name?: string;
563
+ /** Fires on every segment edit (`input` is composed — it reaches the host). */
564
+ oninput?: (e: any) => void;
565
+ /** Fires on commit (blur). */
566
+ onchange?: (e: any) => void;
567
+ /** Fires after the built-in clear button empties the field (`clearinput`). */
568
+ onclearinput?: (e: any) => void;
569
+ 'aria-invalid'?: 'true' | 'false' | boolean;
570
+ 'aria-label'?: string;
571
+ }
481
572
  /**
482
573
  * Attributes for the `<a-calendar>` custom element — a **light-DOM,
483
574
  * form-associated** month grid, and the **interaction authority** for it. The
@@ -558,6 +649,12 @@ export interface AMenuAttributes extends BaseAttributes {
558
649
  round?: boolean | number | string;
559
650
  /** Gap in pixels between the trigger and the menu. Defaults to 4. */
560
651
  offset?: number | string;
652
+ /** Size the menu to its content instead of flooring its width to the trigger.
653
+ * By default a root menu is never narrower than its trigger; `autowidth` drops
654
+ * that floor (min-width falls back to `--menu-min-width`) for a content menu
655
+ * under a wide trigger, e.g. InputDate's calendar below a full-width field.
656
+ * Presence-based (`''` on, omit off). */
657
+ autowidth?: boolean | '';
561
658
  /** Controlled open state (`'open'` / `'closed'`). Omit for uncontrolled;
562
659
  * present → visibility follows this value, and the element never writes it
563
660
  * (the consumer owns it). Listen to `statechange` to keep it in sync. See
package/dist/index.d.ts CHANGED
@@ -49,16 +49,24 @@ export { Calendar } from './components/Calendar';
49
49
  export type { CalendarProps, CalendarChangeAttrs } from './components/Calendar';
50
50
  export { InputDate } from './components/InputDate';
51
51
  export type { InputDateProps, InputDateChangeAttrs } from './components/InputDate';
52
+ export { InputTime } from './components/InputTime';
53
+ export type { InputTimeProps, InputTimeChangeAttrs } from './components/InputTime';
54
+ export { InputAutocomplete } from './components/InputAutocomplete';
55
+ export type { InputAutocompleteProps } from './components/InputAutocomplete';
52
56
  export { buildMonth, getWeekdays, firstDayOfWeek, clampDate, isOutOfRange, parseISODate, parseDateInput, formatDateInput, dateFormatPattern, parseTimeInput, parseDateTimeInput, formatDateTimeInput, dateTimeFormatPattern, usesHour12, } from './calendar-core';
53
57
  export type { CalendarDay, CalendarWeekday, CalendarMonth, BuildMonthOptions, ParseDateOptions, } from './calendar-core';
54
58
  export { RadioGroup } from './components/RadioGroup';
55
59
  export type { RadioGroupProps, RadioOption } from './components/RadioGroup';
56
60
  export { Select, optionsWithSelection } from './components/Select';
57
61
  export type { SelectProps, SelectCommonProps, SelectOption, SelectGroup, SelectSubmenu, SelectItem, SelectChangeAttrs, OptionState, TriggerState, EmptyState, SelectionState, SelectedOption, SelectedGroup, SelectedSubmenu, SelectedItem, } from './components/Select';
62
+ export { SelectFaceted } from './components/SelectFaceted';
63
+ export type { SelectFacetedProps, SelectFacet, SelectFacetSingle, SelectFacetMultiple, SelectFacetText, SelectFacetCustom, SelectFacetCustomContext, SelectFacetedValue, SelectFacetedChangeAttrs, SelectFacetedTriggerState, } from './components/SelectFaceted';
58
64
  export { Tabs } from './components/Tabs';
59
65
  export type { TabsProps, TabOption, TabsChangeAttrs } from './components/Tabs';
60
66
  export { TabPanel } from './components/TabPanel';
61
67
  export type { TabPanelProps } from './components/TabPanel';
68
+ export { Dialog } from './components/Dialog';
69
+ export type { DialogProps } from './components/Dialog';
62
70
  export type { BaseProps, BaseAttributes } from './general_types';
63
71
  export { configure } from './jsx-runtime';
64
72
  export type { AntaIntrinsicElements } from './jsx-runtime';
package/dist/index.js CHANGED
@@ -15,6 +15,8 @@ import { Expander } from "./components/Expander";
15
15
  import { Input } from "./components/Input";
16
16
  import { Calendar } from "./components/Calendar";
17
17
  import { InputDate } from "./components/InputDate";
18
+ import { InputTime } from "./components/InputTime";
19
+ import { InputAutocomplete } from "./components/InputAutocomplete";
18
20
  import {
19
21
  buildMonth,
20
22
  getWeekdays,
@@ -33,19 +35,24 @@ import {
33
35
  } from "./calendar-core";
34
36
  import { RadioGroup } from "./components/RadioGroup";
35
37
  import { Select, optionsWithSelection } from "./components/Select";
38
+ import { SelectFaceted } from "./components/SelectFaceted";
36
39
  import { Tabs } from "./components/Tabs";
37
40
  import { TabPanel } from "./components/TabPanel";
41
+ import { Dialog } from "./components/Dialog";
38
42
  import { configure } from "./jsx-runtime";
39
43
  export {
40
44
  Button,
41
45
  Calendar,
42
46
  Checkbox,
47
+ Dialog,
43
48
  Expander,
44
49
  ICON_SHAPES,
45
50
  ICON_SYNONYMS,
46
51
  Icon,
47
52
  Input,
53
+ InputAutocomplete,
48
54
  InputDate,
55
+ InputTime,
49
56
  Menu,
50
57
  MenuGroup,
51
58
  MenuItem,
@@ -53,6 +60,7 @@ export {
53
60
  Progress,
54
61
  RadioGroup,
55
62
  Select,
63
+ SelectFaceted,
56
64
  TabPanel,
57
65
  Tabs,
58
66
  Tag,
@@ -41,7 +41,7 @@ export declare function useMemo<T>(factory: () => T, deps: unknown[]): T;
41
41
  export declare function jsx(type: ComponentType, props: Record<string, unknown> | null, key?: string | number): unknown;
42
42
  export declare function jsxs(type: ComponentType, props: Record<string, unknown> | null, key?: string | number): unknown;
43
43
  export { _Fragment as Fragment };
44
- import type { AProgressAttributes, ATextAttributes, ATitleAttributes, ATagAttributes, AExpanderAttributes, AIconAttributes, AButtonAttributes, ACheckboxAttributes, ATooltipAttributes, AInputAttributes, ACalendarAttributes, ARadioAttributes, ARadioGroupAttributes, AMenuAttributes, AMenuItemAttributes, AMenuGroupAttributes, ATabsAttributes, ATabAttributes, ATabpanelAttributes, BaseAttributes } from './general_types';
44
+ import type { AProgressAttributes, ATextAttributes, ATitleAttributes, ATagAttributes, AExpanderAttributes, AIconAttributes, AButtonAttributes, ACheckboxAttributes, ATooltipAttributes, AInputAttributes, AInputTimeAttributes, ACalendarAttributes, ARadioAttributes, ARadioGroupAttributes, AMenuAttributes, AMenuItemAttributes, AMenuGroupAttributes, ATabsAttributes, ATabAttributes, ATabpanelAttributes, ADialogAttributes, BaseAttributes } from './general_types';
45
45
  export declare namespace JSX {
46
46
  interface IntrinsicElements extends React.JSX.IntrinsicElements, AntaIntrinsicElements {
47
47
  }
@@ -70,6 +70,7 @@ export interface AntaIntrinsicElements {
70
70
  'a-checkbox-hint': BaseAttributes;
71
71
  'a-tooltip': ATooltipAttributes;
72
72
  'a-input': AInputAttributes;
73
+ 'a-input-time': AInputTimeAttributes;
73
74
  'a-calendar': ACalendarAttributes;
74
75
  'a-radio': ARadioAttributes;
75
76
  'a-radio-group': ARadioGroupAttributes;
@@ -90,4 +91,5 @@ export interface AntaIntrinsicElements {
90
91
  'a-tab': ATabAttributes;
91
92
  'a-tab-label': BaseAttributes;
92
93
  'a-tabpanel': ATabpanelAttributes;
94
+ 'a-dialog': ADialogAttributes;
93
95
  }
package/dist/reset.css CHANGED
@@ -1 +1 @@
1
- @layer anta{*,*:before,*:after{box-sizing:border-box}*{margin:0}img,picture,video,canvas,svg{display:block;max-width:100%}input,button,textarea,select{font:inherit}p,h1,h2,h3,h4,h5,h6{overflow-wrap:break-word}p{text-wrap:pretty}h1,h2,h3,h4,h5,h6{text-wrap:balance}h1,h2,h3,h4,h5,h6{color:var(--text-1);font-weight:584.62;letter-spacing:0}h1{font-size:28px;line-height:32px;margin-block:0 16px}h2{font-size:24px;line-height:28px;margin-block:32px 12px}h3{font-size:20px;line-height:24px;margin-block:24px 12px}h4{font-size:17px;line-height:20px;margin-block:20px 8px}h5{font-size:15px;line-height:20px;margin-block:16px 8px}h6{font-size:13px;line-height:16px;margin-block:16px 4px}strong{font-weight:600}code{line-height:1em}code,kbd,samp,pre{letter-spacing:0}ul,ol{padding-left:3ch}:is(ul,ol)>li{margin-bottom:.5em}:is(ul,ol)>li::marker{color:var(--text-5)}menu{list-style:none;padding:0;margin:0}menu>li{margin:0}a:not(:where([role=button])),a:not(:where([role=button])):link,a:not(:where([role=button])):visited{color:var(--link-color);text-decoration:underline;text-decoration-style:solid;text-decoration-color:color-mix(in srgb,currentColor 75%,transparent);text-decoration-thickness:.5px;text-underline-offset:3px}@media(hover:hover)and (pointer:fine){a:not(:where([role=button])):hover{color:var(--link-color-hover);text-decoration-thickness:1px}}a:not(:where([role=button])):active{text-decoration-color:color-mix(in srgb,currentColor 75%,transparent)}::selection{background:color-mix(in srgb,var(--text-1-brand),transparent 85%)}table{border-collapse:collapse;font-variant-numeric:lining-nums tabular-nums}caption{text-align:left;color:var(--text-3);padding-left:10px;margin-bottom:.25em}th,td{padding:5px 10px;text-align:left;vertical-align:top;border-bottom:1px solid var(--border-4)}thead th{font-weight:600}tfoot tr:last-child>:is(th,td),table:not(:has(tfoot)) tbody tr:last-child>:is(th,td){border-bottom:none}table[data-bordered]{border-collapse:separate;border-spacing:0;border:1px solid var(--border-4);border-radius:3px}table[data-bordered] :is(th,td){border-right:1px solid var(--border-4)}table[data-bordered] tr>:is(th,td):last-child{border-right:0}}
1
+ @layer anta{*,*:before,*:after{box-sizing:border-box}*{margin:0}img,picture,video,canvas,svg{display:block;max-width:100%}input,button,textarea,select{font:inherit}p,h1,h2,h3,h4,h5,h6{overflow-wrap:break-word}p{text-wrap:pretty}h1,h2,h3,h4,h5,h6{text-wrap:balance}h1,h2,h3,h4,h5,h6{color:var(--text-1);font-weight:584.62;letter-spacing:0}h1{font-size:28px;line-height:32px;margin-block:0 16px}h2{font-size:24px;line-height:28px;margin-block:32px 12px}h3{font-size:20px;line-height:24px;margin-block:24px 12px}h4{font-size:17px;line-height:20px;margin-block:20px 8px}h5{font-size:15px;line-height:20px;margin-block:16px 8px}h6{font-size:13px;line-height:16px;margin-block:16px 4px}strong{font-weight:600}code{line-height:1em}code,kbd,samp,pre{letter-spacing:0}ul,ol{padding-left:3ch}:is(ul,ol)>li{margin-bottom:.5em}:is(ul,ol)>li::marker{color:var(--text-5)}menu{list-style:none;padding:0;margin:0}menu>li{margin:0}a:not(:where([role=button])),a:not(:where([role=button])):link,a:not(:where([role=button])):visited{color:var(--link-color);text-decoration:underline;text-decoration-style:solid;text-decoration-color:color-mix(in srgb,currentColor 75%,transparent);text-decoration-thickness:.5px;text-underline-offset:3px}@media(hover:hover)and (pointer:fine){a:not(:where([role=button])):hover{color:var(--link-color-hover);text-decoration-thickness:1px}}a:not(:where([role=button])):active{text-decoration-color:color-mix(in srgb,currentColor 75%,transparent)}::selection{background:color-mix(in oklch,var(--focus-ring) 20%,transparent)}.dark ::selection{background:color-mix(in oklch,var(--focus-ring) 30%,transparent)}table{border-collapse:collapse;font-variant-numeric:lining-nums tabular-nums}caption{text-align:left;color:var(--text-3);padding-left:10px;margin-bottom:.25em}th,td{padding:5px 10px;text-align:left;vertical-align:top;border-bottom:1px solid var(--border-4)}thead th{font-weight:600}tfoot tr:last-child>:is(th,td),table:not(:has(tfoot)) tbody tr:last-child>:is(th,td){border-bottom:none}table[data-bordered]{border-collapse:separate;border-spacing:0;border:1px solid var(--border-4);border-radius:3px}table[data-bordered] :is(th,td){border-right:1px solid var(--border-4)}table[data-bordered] tr>:is(th,td):last-child{border-right:0}}