@editora/ui-core 0.2.0 → 0.2.2
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 +8 -0
- package/dist/accordion.cjs.js +1 -1
- package/dist/accordion.esm.js +1 -1
- package/dist/alert-dialog.cjs.js +32 -24
- package/dist/alert-dialog.esm.js +48 -40
- package/dist/alert.cjs.js +2 -2
- package/dist/alert.esm.js +2 -2
- package/dist/animated-text.cjs.js +5 -5
- package/dist/animated-text.esm.js +5 -5
- package/dist/app-header.cjs.js +12 -7
- package/dist/app-header.esm.js +12 -7
- package/dist/avatar.cjs.js +3 -3
- package/dist/avatar.esm.js +3 -3
- package/dist/{calendar-o273O28D.js → calendar-CzpWDxLc.js} +5 -4
- package/dist/{calendar-DmxiZrR7.mjs → calendar-DkSDFg33.mjs} +1 -0
- package/dist/calendar.cjs.js +1 -1
- package/dist/calendar.esm.js +1 -1
- package/dist/chart.cjs.js +13 -7
- package/dist/chart.esm.js +13 -7
- package/dist/collapsible.cjs.js +2 -2
- package/dist/collapsible.esm.js +2 -2
- package/dist/color-picker.cjs.js +3 -3
- package/dist/color-picker.esm.js +3 -3
- package/dist/combobox.cjs.js +3 -3
- package/dist/combobox.esm.js +36 -36
- package/dist/components/ui-alert-dialog.d.ts.map +1 -1
- package/dist/components/ui-app-header.d.ts.map +1 -1
- package/dist/components/ui-calendar.d.ts.map +1 -1
- package/dist/components/ui-chart.d.ts.map +1 -1
- package/dist/components/ui-gantt.d.ts.map +1 -1
- package/dist/components/ui-hover-card.d.ts.map +1 -1
- package/dist/components/ui-inline-edit.d.ts.map +1 -1
- package/dist/components/ui-multi-select.d.ts.map +1 -1
- package/dist/components/ui-sidebar.d.ts.map +1 -1
- package/dist/components/ui-tabs.d.ts.map +1 -1
- package/dist/components/ui-wizard.d.ts.map +1 -1
- package/dist/context-menu.cjs.js +1 -1
- package/dist/context-menu.esm.js +1 -1
- package/dist/data-table.cjs.js +3 -3
- package/dist/data-table.esm.js +3 -3
- package/dist/date-field.cjs.js +2 -2
- package/dist/date-field.esm.js +14 -14
- package/dist/date-picker.cjs.js +3 -3
- package/dist/date-picker.esm.js +4 -4
- package/dist/date-range-picker.cjs.js +3 -3
- package/dist/date-range-picker.esm.js +59 -59
- package/dist/date-range-time-picker.cjs.js +2 -2
- package/dist/date-range-time-picker.esm.js +3 -3
- package/dist/date-time-picker.cjs.js +2 -2
- package/dist/date-time-picker.esm.js +3 -3
- package/dist/{date-time-utils-DdigV4hs.js → date-time-utils-C-4eHTyy.js} +1 -1
- package/dist/{date-time-utils-B4hAkt36.mjs → date-time-utils-zAx4ghvC.mjs} +1 -1
- package/dist/description.cjs.js +4 -4
- package/dist/description.esm.js +4 -4
- package/dist/dialog.cjs.js +2 -2
- package/dist/dialog.esm.js +2 -2
- package/dist/direction-provider.cjs.js +1 -1
- package/dist/direction-provider.esm.js +1 -1
- package/dist/dock.cjs.js +1 -1
- package/dist/dock.esm.js +1 -1
- package/dist/dropdown.cjs.js +1 -1
- package/dist/dropdown.esm.js +1 -1
- package/dist/field-error.cjs.js +1 -1
- package/dist/field-error.esm.js +7 -7
- package/dist/field.cjs.js +1 -1
- package/dist/field.esm.js +29 -29
- package/dist/fieldset.cjs.js +4 -4
- package/dist/fieldset.esm.js +3 -3
- package/dist/file-upload.cjs.js +2 -2
- package/dist/file-upload.esm.js +2 -2
- package/dist/flex.cjs.js +2 -2
- package/dist/flex.esm.js +8 -8
- package/dist/form.cjs.js +4 -4
- package/dist/form.esm.js +4 -4
- package/dist/gantt.cjs.js +7 -5
- package/dist/gantt.esm.js +7 -5
- package/dist/grid.cjs.js +1 -1
- package/dist/grid.esm.js +1 -1
- package/dist/hover-card.cjs.js +1 -1
- package/dist/hover-card.esm.js +11 -8
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/inline-edit.cjs.js +6 -6
- package/dist/inline-edit.esm.js +15 -15
- package/dist/input.cjs.js +1 -1
- package/dist/input.esm.js +1 -1
- package/dist/label.cjs.js +6 -6
- package/dist/label.esm.js +6 -6
- package/dist/masonry-grid.cjs.js +2 -2
- package/dist/masonry-grid.esm.js +11 -11
- package/dist/{menu-item-styles-IGSFLAHu.mjs → menu-item-styles-CdqxPUuw.mjs} +15 -15
- package/dist/{menu-item-styles-B4onAr4C.js → menu-item-styles-DUdyjQ7i.js} +10 -10
- package/dist/menu.cjs.js +1 -1
- package/dist/menu.esm.js +1 -1
- package/dist/menubar.cjs.js +1 -1
- package/dist/menubar.esm.js +1 -1
- package/dist/multi-select.cjs.js +7 -7
- package/dist/multi-select.esm.js +26 -26
- package/dist/number-field.cjs.js +1 -1
- package/dist/number-field.esm.js +1 -1
- package/dist/number-ticker.cjs.js +4 -4
- package/dist/number-ticker.esm.js +10 -10
- package/dist/odometer.cjs.js +7 -7
- package/dist/odometer.esm.js +14 -14
- package/dist/password-field.cjs.js +1 -1
- package/dist/password-field.esm.js +1 -1
- package/dist/pin-input.cjs.js +1 -1
- package/dist/pin-input.esm.js +1 -1
- package/dist/placement-grid.cjs.js +1 -1
- package/dist/placement-grid.esm.js +1 -1
- package/dist/portal.cjs.js +1 -1
- package/dist/portal.esm.js +1 -1
- package/dist/presence.cjs.js +1 -1
- package/dist/presence.esm.js +1 -1
- package/dist/quick-actions.cjs.js +1 -1
- package/dist/quick-actions.esm.js +1 -1
- package/dist/radio.cjs.js +1 -1
- package/dist/radio.esm.js +1 -1
- package/dist/{runtime-CQM6wZOc.mjs → runtime-CJzoaC8Z.mjs} +385 -329
- package/dist/runtime-DYSIU3sR.js +5 -0
- package/dist/runtime.cjs.js +1 -1
- package/dist/runtime.esm.js +1 -1
- package/dist/select.cjs.js +2 -2
- package/dist/select.esm.js +2 -2
- package/dist/separator.cjs.js +6 -6
- package/dist/separator.esm.js +7 -7
- package/dist/sidebar.cjs.js +7 -6
- package/dist/sidebar.esm.js +7 -6
- package/dist/slot.cjs.js +1 -1
- package/dist/slot.esm.js +1 -1
- package/dist/sortable.cjs.js +6 -6
- package/dist/sortable.esm.js +6 -6
- package/dist/split-button.cjs.js +2 -2
- package/dist/split-button.esm.js +2 -2
- package/dist/tabs.cjs.js +11 -6
- package/dist/tabs.esm.js +28 -23
- package/dist/tags-input.cjs.js +2 -2
- package/dist/tags-input.esm.js +2 -2
- package/dist/textarea.cjs.js +2 -2
- package/dist/textarea.esm.js +16 -16
- package/dist/theme.d.ts.map +1 -1
- package/dist/time-field.cjs.js +2 -2
- package/dist/time-field.esm.js +24 -24
- package/dist/time-picker.cjs.js +2 -2
- package/dist/time-picker.esm.js +3 -3
- package/dist/toast.cjs.js +2 -2
- package/dist/toast.esm.js +2 -2
- package/dist/transfer-list.cjs.js +9 -9
- package/dist/transfer-list.esm.js +4 -4
- package/dist/wizard.cjs.js +16 -7
- package/dist/wizard.esm.js +16 -7
- package/package.json +1 -1
- package/dist/runtime-DxCl0A5q.js +0 -5
package/README.md
CHANGED
|
@@ -541,6 +541,12 @@ argument:
|
|
|
541
541
|
Apply the theme early, before the first render. To theme one part of the page, call
|
|
542
542
|
`applyTheme(tokens, element)`.
|
|
543
543
|
|
|
544
|
+
Theme a part of the page with `applyTheme(tokens, element)` (or `ThemeProvider` in `@editora/ui-react`), not by
|
|
545
|
+
setting a few `--ui-color-*` variables yourself. The fills, lines and soft accent colours that components read
|
|
546
|
+
(`--ui-color-fill`, `--ui-color-line`, `--ui-color-accent-fill` and the like) are derived from the whole theme, so
|
|
547
|
+
overriding only `--ui-color-text` and `--ui-color-surface` on an element leaves them at the page theme. If you need
|
|
548
|
+
plain CSS, spread `themeToVariables(tokens)` (below) onto the element instead.
|
|
549
|
+
|
|
544
550
|
### Follow the system light/dark setting
|
|
545
551
|
|
|
546
552
|
```js
|
|
@@ -573,6 +579,8 @@ stay on theme.
|
|
|
573
579
|
| `--ui-color-surface-elevated`, `--ui-color-info` | raised surface (menus, popovers) and the informational colour |
|
|
574
580
|
| `--ui-color-placeholder` | placeholder text (62% of the text colour, 4.5:1 or better on the field) |
|
|
575
581
|
| `--ui-color-foreground-on-warning` | text on a solid warning fill: dark when the warning colour is light (amber) |
|
|
582
|
+
| `--ui-color-danger-text`, `-success-text`, `-warning-text`, `-info-text`, `-accent-text` | the status and accent hues as text: pulled toward the text colour until they read at 4.5:1 or better on the surface and on their own tint. The plain `--ui-color-danger` and the like are fill and icon colours (about 3-4:1 as text on white) |
|
|
583
|
+
| `--ui-color-danger-solid`, `-success-solid`, `--ui-color-foreground-on-danger`, `-on-success` | a solid fill that white text reads on, and that text colour |
|
|
576
584
|
| `--ui-ring-color`, `--ui-ring-width`, `--ui-ring-offset` | the focus ring |
|
|
577
585
|
| `--ui-control-height-{1..4}`, `--ui-control-font-size-{1..4}`, `--ui-control-padding-inline-{1..4}`, `--ui-control-radius-{1..4}` | the control scale: 24, 32, 40 and 48px (see below) |
|
|
578
586
|
| `--ui-motion-enter-easing`, `--ui-motion-exit-easing` | easing for things that appear and disappear |
|
package/dist/accordion.cjs.js
CHANGED
|
@@ -240,7 +240,7 @@
|
|
|
240
240
|
text-transform: uppercase;
|
|
241
241
|
line-height: 1.2;
|
|
242
242
|
background: color-mix(in srgb, var(--ui-accordion-accent) 14%, transparent);
|
|
243
|
-
color: color-mix(in srgb, var(--ui-accordion-accent)
|
|
243
|
+
color: color-mix(in srgb, var(--ui-accordion-accent) 32%, var(--ui-color-text-strong, var(--ui-accordion-text)));
|
|
244
244
|
}
|
|
245
245
|
|
|
246
246
|
ui-accordion[data-ui-accordion-root="true"] [data-ui-accordion-chevron] {
|
package/dist/accordion.esm.js
CHANGED
|
@@ -241,7 +241,7 @@ const p = `
|
|
|
241
241
|
text-transform: uppercase;
|
|
242
242
|
line-height: 1.2;
|
|
243
243
|
background: color-mix(in srgb, var(--ui-accordion-accent) 14%, transparent);
|
|
244
|
-
color: color-mix(in srgb, var(--ui-accordion-accent)
|
|
244
|
+
color: color-mix(in srgb, var(--ui-accordion-accent) 32%, var(--ui-color-text-strong, var(--ui-accordion-text)));
|
|
245
245
|
}
|
|
246
246
|
|
|
247
247
|
ui-accordion[data-ui-accordion-root="true"] [data-ui-accordion-chevron] {
|
package/dist/alert-dialog.cjs.js
CHANGED
|
@@ -18,7 +18,10 @@
|
|
|
18
18
|
--ui-alert-z: 1301;
|
|
19
19
|
--ui-alert-backdrop-z: 1300;
|
|
20
20
|
--ui-alert-focus: var(--ui-color-focus-ring, var(--ui-focus-ring, #2563eb));
|
|
21
|
-
--ui-alert-danger: var(--ui-color-danger, #dc2626);
|
|
21
|
+
--ui-alert-danger: var(--ui-color-danger-text, var(--ui-color-danger, #dc2626));
|
|
22
|
+
/* A solid dialog: the fill, and the text colour that reads on it. */
|
|
23
|
+
--ui-alert-solid-bg: var(--ui-alert-accent);
|
|
24
|
+
--ui-alert-on-accent: var(--ui-color-foreground-on-primary, #ffffff);
|
|
22
25
|
--ui-alert-backdrop: var(--base-alert-dialog-backdrop, var(--color-overlay, rgba(2, 6, 23, 0.52)));
|
|
23
26
|
--ui-alert-btn-bg: color-mix(in srgb, var(--ui-alert-bg-base) 90%, var(--ui-color-background, #ffffff) 10%);
|
|
24
27
|
--ui-alert-btn-border: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 72%, transparent);
|
|
@@ -46,18 +49,23 @@
|
|
|
46
49
|
|
|
47
50
|
:host([tone='success']) {
|
|
48
51
|
--ui-alert-accent: var(--ui-color-success, #15803d);
|
|
52
|
+
--ui-alert-solid-bg: var(--ui-color-success-solid, var(--ui-alert-accent));
|
|
53
|
+
--ui-alert-on-accent: var(--ui-color-foreground-on-success, #ffffff);
|
|
49
54
|
--ui-alert-confirm-bg: color-mix(in srgb, var(--ui-alert-accent) 76%, #000000);
|
|
50
55
|
--ui-alert-confirm-color: #ffffff;
|
|
51
56
|
}
|
|
52
57
|
|
|
53
58
|
:host([tone='warning']) {
|
|
54
59
|
--ui-alert-accent: var(--ui-color-warning, #b45309);
|
|
60
|
+
--ui-alert-on-accent: var(--ui-color-foreground-on-warning, #ffffff);
|
|
55
61
|
--ui-alert-confirm-bg: var(--ui-alert-accent);
|
|
56
62
|
--ui-alert-confirm-color: var(--ui-color-foreground-on-warning, #ffffff);
|
|
57
63
|
}
|
|
58
64
|
|
|
59
65
|
:host([tone='danger']) {
|
|
60
66
|
--ui-alert-accent: var(--ui-color-danger, #dc2626);
|
|
67
|
+
--ui-alert-solid-bg: var(--ui-color-danger-solid, var(--ui-alert-accent));
|
|
68
|
+
--ui-alert-on-accent: var(--ui-color-foreground-on-danger, #ffffff);
|
|
61
69
|
--ui-alert-confirm-bg: color-mix(in srgb, var(--ui-alert-accent) 80%, #000000);
|
|
62
70
|
--ui-alert-confirm-color: #ffffff;
|
|
63
71
|
}
|
|
@@ -108,17 +116,17 @@
|
|
|
108
116
|
}
|
|
109
117
|
|
|
110
118
|
:host([variant='solid']) {
|
|
111
|
-
--ui-alert-bg: var(--ui-alert-
|
|
119
|
+
--ui-alert-bg: var(--ui-alert-solid-bg);
|
|
112
120
|
--ui-alert-border: 1px solid color-mix(in srgb, #000000 16%, transparent);
|
|
113
|
-
--ui-alert-text:
|
|
114
|
-
--ui-alert-muted: color-mix(in srgb,
|
|
121
|
+
--ui-alert-text: var(--ui-alert-on-accent);
|
|
122
|
+
--ui-alert-muted: color-mix(in srgb, var(--ui-alert-on-accent) 98%, transparent);
|
|
115
123
|
--ui-alert-btn-bg: color-mix(in srgb, #000000 14%, transparent);
|
|
116
|
-
--ui-alert-btn-border: color-mix(in srgb,
|
|
124
|
+
--ui-alert-btn-border: color-mix(in srgb, var(--ui-alert-on-accent) 30%, transparent);
|
|
117
125
|
--ui-alert-btn-hover: color-mix(in srgb, #000000 22%, transparent);
|
|
118
126
|
--ui-alert-confirm-bg: color-mix(in srgb, #000000 30%, transparent);
|
|
119
|
-
--ui-alert-confirm-color:
|
|
120
|
-
--ui-alert-icon-bg: color-mix(in srgb,
|
|
121
|
-
--ui-alert-icon-color:
|
|
127
|
+
--ui-alert-confirm-color: var(--ui-alert-on-accent);
|
|
128
|
+
--ui-alert-icon-bg: color-mix(in srgb, var(--ui-alert-on-accent) 18%, transparent);
|
|
129
|
+
--ui-alert-icon-color: var(--ui-alert-on-accent);
|
|
122
130
|
}
|
|
123
131
|
|
|
124
132
|
:host([elevation='none']) {
|
|
@@ -528,17 +536,17 @@
|
|
|
528
536
|
border: 1px solid CanvasText;
|
|
529
537
|
}
|
|
530
538
|
}
|
|
531
|
-
`,J='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function b(i,t){if(i==null)return t;const e=i.trim().toLowerCase();return e!=="false"&&e!=="0"&&e!=="off"}function o(i){return String(i).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Q(i){return i==="info"||i==="success"||i==="warning"||i==="danger"?i:"neutral"}function X(i){return i==="sm"||i==="1"?"sm":i==="lg"||i==="3"?"lg":"md"}function tt(i){return i==="soft"||i==="outline"||i==="solid"?i:"surface"}function et(i){return i==="none"||i==="high"?i:"low"}function it(i){return i==="none"?"none":"line"}function rt(i,t="var(--base-alert-dialog-radius, var(--ui-radius, 6px))"){if(i==null)return t;const e=i.trim().toLowerCase();return e?e==="full"||e==="pill"?"999px":/^-?\d+(\.\d+)?$/.test(e)?`${e}px`:i:t}const st=new Set(["tone","size","variant","elevation","indicator","radius"]);function ot(i){return i==="success"?'<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M5 10.2 8.3 13.4 15 6.8"></path></svg>':i==="warning"?'<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M10 3.6 17 16.4H3L10 3.6Z"></path><path d="M10 8v3.4"></path><circle cx="10" cy="14.1" r="0.9" fill="currentColor" stroke="none"></circle></svg>':i==="danger"?'<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><circle cx="10" cy="10" r="7.1"></circle><path d="m7.5 7.5 5 5M12.5 7.5l-5 5"></path></svg>':i==="info"?'<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><circle cx="10" cy="10" r="7.1"></circle><path d="M10 13v-3.8"></path><circle cx="10" cy="6.5" r="0.9" fill="currentColor" stroke="none"></circle></svg>':'<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M6 10h8"></path><circle cx="10" cy="10" r="7.1"></circle></svg>'}function u(){return typeof window<"u"&&typeof document<"u"}function T(){if(!u())return null;const i=document.activeElement;return i instanceof HTMLElement?i:null}function w(i){return typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>i()):window.setTimeout(i,16)}function p(i){if(i){if(typeof cancelAnimationFrame=="function"){cancelAnimationFrame(i);return}window.clearTimeout(i)}}const c="data-ui-auto-name",l=class l extends Z.ElementBase{constructor(){super(),this._lastActive=null,this._active=!1,this._terminalEmitted=!1,this._closeMeta=null,this._uid=Math.random().toString(36).slice(2,10),this._dialogId="",this._config={},this._inputValue="",this._checked=!1,this._runtimeError="",this._activeHeadless=!1,this._focusInitialFrame=0,this._restoreFocusFrame=0,this._presented=!1,this._finishClose=null,this._onClick=this._onClick.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onFocusIn=this._onFocusIn.bind(this),this._onInput=this._onInput.bind(this),this._dialogId=this._uid}static get observedAttributes(){return["open","headless","dismissible","close-on-esc","close-on-backdrop","lock-while-loading","role","tone","size","variant","elevation","indicator","radius","state","aria-label","aria-labelledby","aria-describedby","initial-focus","title","description","confirm-text","cancel-text","loading-text","error-message"]}connectedCallback(){super.connectedCallback(),this.root.addEventListener("click",this._onClick),this.root.addEventListener("keydown",this._onKeyDown),this.root.addEventListener("input",this._onInput),this._syncFromAttributes(),this._syncVisualTokens(),this._syncOpenState()}disconnectedCallback(){this.root.removeEventListener("click",this._onClick),this.root.removeEventListener("keydown",this._onKeyDown),this.root.removeEventListener("input",this._onInput),this._focusInitialFrame&&(p(this._focusInitialFrame),this._focusInitialFrame=0),this._restoreFocusFrame&&(p(this._restoreFocusFrame),this._restoreFocusFrame=0),this._active&&!this._terminalEmitted&&this.close("dismiss","unmount"),this._deactivate(),super.disconnectedCallback()}attributeChangedCallback(t,e,r){if(e!==r){if(st.has(t)){this._syncVisualTokens();return}if(t==="headless"){this._syncActiveEnvironment(),this.requestRender();return}if(t==="open"){this._syncOpenState();return}t==="state"&&r!=="error"&&(this._runtimeError=""),this._syncFromAttributes(),this.isConnected&&this.requestRender()}}get open(){return this.hasAttribute("open")}set open(t){t?this.setAttribute("open",""):this.close("dismiss","programmatic")}get headless(){return this.hasAttribute("headless")}set headless(t){t?this.setAttribute("headless",""):this.removeAttribute("headless")}get dismissible(){return b(this.getAttribute("dismissible"),!0)}set dismissible(t){this.setAttribute("dismissible",String(t))}get closeOnEsc(){return b(this.getAttribute("close-on-esc"),this.dismissible)}set closeOnEsc(t){this.setAttribute("close-on-esc",String(t))}get closeOnBackdrop(){return b(this.getAttribute("close-on-backdrop"),this.dismissible)}set closeOnBackdrop(t){this.setAttribute("close-on-backdrop",String(t))}get lockWhileLoading(){return b(this.getAttribute("lock-while-loading"),!0)}set lockWhileLoading(t){this.setAttribute("lock-while-loading",String(t))}get roleType(){return this.getAttribute("role")==="dialog"?"dialog":"alertdialog"}set roleType(t){this.setAttribute("role",t)}get tone(){return Q(this.getAttribute("tone"))}set tone(t){if(t==="neutral"){this.removeAttribute("tone");return}this.setAttribute("tone",t)}get size(){return X(this.getAttribute("size"))}set size(t){if(t==="md"){this.removeAttribute("size");return}this.setAttribute("size",t)}get variant(){return tt(this.getAttribute("variant"))}set variant(t){if(t==="surface"){this.removeAttribute("variant");return}this.setAttribute("variant",t)}get elevation(){return et(this.getAttribute("elevation"))}set elevation(t){if(t==="low"){this.removeAttribute("elevation");return}this.setAttribute("elevation",t)}get indicator(){return it(this.getAttribute("indicator"))}set indicator(t){if(t==="line"){this.removeAttribute("indicator");return}this.setAttribute("indicator",t)}get radius(){return this.getAttribute("radius")||""}set radius(t){if(!t){this.removeAttribute("radius");return}this.setAttribute("radius",t)}get state(){const t=this.getAttribute("state");return t==="loading"||t==="error"?t:"idle"}set state(t){if(t==="idle"){this.removeAttribute("state");return}this.setAttribute("state",t)}get initialFocus(){return this.getAttribute("initial-focus")||this._config.initialFocus||""}set initialFocus(t){if(!t){this.removeAttribute("initial-focus");return}this.setAttribute("initial-focus",t)}get dialogId(){return this._dialogId}set dialogId(t){this._dialogId=t||this._uid,this.requestRender()}get config(){return this._config}set config(t){this._config=t||{},this._config.id&&(this._dialogId=this._config.id),this._config.dismissible!=null&&(this.dismissible=!!this._config.dismissible),this._config.closeOnEsc!=null&&(this.closeOnEsc=!!this._config.closeOnEsc),this._config.closeOnBackdrop!=null&&(this.closeOnBackdrop=!!this._config.closeOnBackdrop),this._config.lockWhileLoading!=null&&(this.lockWhileLoading=!!this._config.lockWhileLoading),this._config.role&&(this.roleType=this._config.role),this._config.tone&&(this.tone=this._config.tone),this._config.size&&(this.size=this._config.size),this._config.variant&&(this.variant=this._config.variant),this._config.elevation&&(this.elevation=this._config.elevation),this._config.indicator&&(this.indicator=this._config.indicator),this._config.radius!=null&&(this.radius=String(this._config.radius)),this._config.ariaLabel&&this.setAttribute("aria-label",this._config.ariaLabel),this._config.ariaLabelledby&&this.setAttribute("aria-labelledby",this._config.ariaLabelledby),this._config.ariaDescribedby&&this.setAttribute("aria-describedby",this._config.ariaDescribedby),this._config.initialFocus&&(this.initialFocus=this._config.initialFocus),this._config.headless!=null&&(this.headless=!!this._config.headless),this._inputValue=this._config.input?.value??this._inputValue,this._checked=this._config.checkbox?.checked??this._checked,this._runtimeError=this._config.errorMessage||"",this._syncVisualTokens(),this.requestRender()}getInputValue(){return this.root.querySelector(".input")?.value??this._inputValue}setInputValue(t){this._inputValue=t;const e=this.root.querySelector(".input");e&&(e.value=t)}getChecked(){return this.root.querySelector(".checkbox-input")?.checked??this._checked}setChecked(t){this._checked=t;const e=this.root.querySelector(".checkbox-input");e&&(e.checked=t)}setError(t){this._runtimeError=t,this.state=t?"error":"idle",this.requestRender()}clearError(){this._runtimeError="",this.state==="error"&&(this.state="idle"),this.requestRender()}close(t="dismiss",e,r){this._terminalEmitted||(this._closeMeta={action:t,source:e,reason:r},this.hasAttribute("open")&&this.removeAttribute("open"),this._syncOpenState())}_syncFromAttributes(){this.hasAttribute("role")||this.setAttribute("role","alertdialog")}_syncVisualTokens(){this.style.setProperty("--ui-alert-radius",rt(this.getAttribute("radius")))}_syncOpenState(){const t=this.hasAttribute("open");if(t&&!this._active){this._activate();return}!t&&this._active&&this._deactivate()}_activate(){this._active=!0,this._activeHeadless=this.headless,this._terminalEmitted=!1,this._closeMeta=null,l._openStack.includes(this)||l._openStack.push(this),this._lastActive=this.headless?null:T(),this.headless||f.acquireBodyScrollLock(),u()&&!this.headless&&document.addEventListener("focusin",this._onFocusIn,!0);const t=this.dialogId||this._uid;this._dispatchWithLegacy("ui-open","open",{id:t}),this.headless||(this._focusInitialFrame&&p(this._focusInitialFrame),this._focusInitialFrame=w(()=>{this._focusInitialFrame=0,this._focusInitial()})),this.requestRender()}_deactivate(){if(!this._active)return;this._active=!1;const t=l._openStack.lastIndexOf(this);if(t>=0&&l._openStack.splice(t,1),u()&&!this._activeHeadless&&document.removeEventListener("focusin",this._onFocusIn,!0),this._activeHeadless||f.releaseBodyScrollLock(),!this._terminalEmitted){const r=this._closeMeta||{action:"dismiss",source:"abort"},s=this.dialogId||this._uid;r.action==="cancel"?this._dispatchWithLegacy("ui-cancel","cancel",{id:s}):r.action==="dismiss"&&this._dispatchWithLegacy("ui-dismiss","dismiss",{id:s,source:r.source||"abort",reason:r.reason}),this._dispatchWithLegacy("ui-close","close",{id:s,action:r.action,source:r.source,reason:r.reason}),this._terminalEmitted=!0,this._closeMeta=null}const e=this._lastActive;this._lastActive=null,e&&!this._activeHeadless&&(this._restoreFocusFrame&&p(this._restoreFocusFrame),this._restoreFocusFrame=w(()=>{this._restoreFocusFrame=0;try{e.focus()}catch{}})),this._activeHeadless=!1,this.requestRender()}_syncActiveEnvironment(){if(this._active&&this.headless!==this._activeHeadless){if(this.headless){u()&&document.removeEventListener("focusin",this._onFocusIn,!0),f.releaseBodyScrollLock(),this._lastActive=null,this._activeHeadless=!0;return}this._lastActive=T(),f.acquireBodyScrollLock(),u()&&document.addEventListener("focusin",this._onFocusIn,!0),this._activeHeadless=!1,this._focusInitialFrame&&p(this._focusInitialFrame),this._focusInitialFrame=w(()=>{this._focusInitialFrame=0,this._focusInitial()})}}_dispatchWithLegacy(t,e,r,s=!1){const a=new CustomEvent(t,{detail:r,bubbles:!0,composed:!0,cancelable:s});this.dispatchEvent(a);const n=new CustomEvent(e,{detail:r,bubbles:!0,composed:!0,cancelable:s});return this.dispatchEvent(n),a}_isTopMost(){if(!this._active)return!1;const t=l._openStack;return t.length>0&&t[t.length-1]===this}_queryPanel(){return this.root.querySelector(".dialog")}_collectFocusable(t){return Array.from(t.querySelectorAll(J)).filter(e=>{if(e.disabled||e.getAttribute("aria-hidden")==="true")return!1;const s=u()?window.getComputedStyle(e):null;return!(s&&(s.display==="none"||s.visibility==="hidden"))})}_focusInitial(){if(!this.open)return;const t=this._queryPanel();if(!t)return;const e=this.initialFocus;if(e){const n=t.querySelector(e);if(n&&typeof n.focus=="function"){n.focus();return}}const r=this._collectFocusable(t),a=r.find(n=>n.hasAttribute("autofocus"))||r[0]||t;!a.hasAttribute("tabindex")&&a===t&&a.setAttribute("tabindex","-1");try{a.focus()}catch{}}_handleTab(t){if(t.key!=="Tab")return;const e=this._queryPanel();if(!e)return;const r=this._collectFocusable(e);if(!r.length){t.preventDefault(),e.focus();return}const s=this.root.activeElement||document.activeElement,a=r[0],n=r[r.length-1];if(t.shiftKey){(s===a||!s||!e.contains(s))&&(t.preventDefault(),n.focus());return}s===n&&(t.preventDefault(),a.focus())}_onFocusIn(t){if(!this.open||!this._isTopMost())return;const e=this._queryPanel();if(!e)return;const r=t.target;(typeof t.composedPath=="function"?t.composedPath():[]).includes(e)||r&&e.contains(r)||this._focusInitial()}_onInput(t){const e=t.target;e&&(e.classList.contains("input")&&(this._inputValue=e.value),e.classList.contains("checkbox-input")&&(this._checked=e.checked),this._dispatchWithLegacy("ui-change","change",{id:this.dialogId||this._uid,inputValue:this._inputValue,checked:this._checked}))}_isInteractionLocked(){return this.state==="loading"&&this.lockWhileLoading}_requestDismiss(t,e){this._isInteractionLocked()||this.close("dismiss",t,e)}_handleConfirm(){const t={id:this.dialogId||this._uid,inputValue:this.getInputValue(),checked:this.getChecked()};this._dispatchWithLegacy("ui-confirm","confirm",t,!0).defaultPrevented||this.close("confirm")}_handleCancel(){this._isInteractionLocked()||this.close("cancel")}_onClick(t){if(!this.open||!this._isTopMost())return;const e=t.target;if(e){if(e.classList.contains("backdrop")&&this.closeOnBackdrop){this._requestDismiss("backdrop");return}if(e.closest(".close")){this._requestDismiss("close-icon");return}if(e.closest(".btn-confirm")){this._handleConfirm();return}e.closest(".btn-cancel")&&this._handleCancel()}}_onKeyDown(t){if(!(!this.open||!this._isTopMost())){if(t.key==="Escape"){if(!this.closeOnEsc)return;t.preventDefault(),t.stopPropagation(),this._requestDismiss("esc");return}this._handleTab(t)}}_syncHostSemantics(t,e="",r=!1){if(!t){this.getAttribute("aria-hidden")!=="true"&&this.setAttribute("aria-hidden","true"),this.hasAttribute(c)&&(this.removeAttribute("aria-label"),this.removeAttribute(c));return}if(this.hasAttribute("aria-hidden")&&this.removeAttribute("aria-hidden"),r){this.hasAttribute(c)&&this.removeAttribute(c);return}this.getAttribute("aria-label")!==e&&this.setAttribute("aria-label",e),this.hasAttribute(c)||this.setAttribute(c,"")}render(){if(!this.open){this._syncHostSemantics(!1);const y=this.root.querySelector(".backdrop");if(this._presented&&y){this._presented=!1,y.removeAttribute("data-instant"),this._finishClose=L.closeOverlay(y,()=>{this._finishClose=null,this.setContent("")});return}if(this._finishClose)return;this.setContent("");return}this._finishClose?.(),this._finishClose=null;const t=this._config.title??this.getAttribute("title")??"",e=this._config.description??this.getAttribute("description")??"",r=this._config.confirmText??this.getAttribute("confirm-text")??"Confirm",s=this._config.cancelText??this.getAttribute("cancel-text")??"Cancel",a=this._config.loadingText??this.getAttribute("loading-text")??"Working...",n=!!this._config.input?.enabled,B=this._config.input?.label||"Value",$=this._config.input?.placeholder||"",q=!!this._config.input?.required,M=!!this._config.checkbox?.enabled,O=this._config.checkbox?.label||"Remember this choice",D=this.state,m=this._runtimeError||this._config.errorMessage||this.getAttribute("error-message")||"",A=`ui-alert-title-${this._uid}`,z=`ui-alert-description-${this._uid}`,F=`ui-alert-error-${this._uid}`,H=!!this.querySelector('[slot="title"]'),V=!!this.querySelector('[slot="description"]'),R=!!this.querySelector('[slot="icon"]'),W=!!this.querySelector('[slot="footer"]'),P=!!this.querySelector('[slot="content"]'),v=H||!!t,x=V||!!e,j=R||v||x,K=this._config.showCancel??this.dismissible,Y=this._config.showClose??this.dismissible,N=this.tone,_=this.hasAttribute(c)?"":this.getAttribute("aria-label")||"",C=this.getAttribute("aria-labelledby")||"",E=this.getAttribute("aria-describedby")||"",k=C||(v?A:""),S=_||(k?"":t||e||"Dialog"),U=(this.querySelector('[slot="title"]')?.textContent||"").replace(/\s+/g," ").trim();this._syncHostSemantics(!0,_||U||t||e||"Dialog",!!_||!!C);const d=[];E?d.push(E):(x&&d.push(z),m&&d.push(F));const h=D==="loading";this.setContent(`
|
|
539
|
+
`,J='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function b(i,t){if(i==null)return t;const e=i.trim().toLowerCase();return e!=="false"&&e!=="0"&&e!=="off"}function s(i){return String(i).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Q(i){return i==="info"||i==="success"||i==="warning"||i==="danger"?i:"neutral"}function X(i){return i==="sm"||i==="1"?"sm":i==="lg"||i==="3"?"lg":"md"}function tt(i){return i==="soft"||i==="outline"||i==="solid"?i:"surface"}function et(i){return i==="none"||i==="high"?i:"low"}function it(i){return i==="none"?"none":"line"}function rt(i,t="var(--base-alert-dialog-radius, var(--ui-radius, 6px))"){if(i==null)return t;const e=i.trim().toLowerCase();return e?e==="full"||e==="pill"?"999px":/^-?\d+(\.\d+)?$/.test(e)?`${e}px`:i:t}const at=new Set(["tone","size","variant","elevation","indicator","radius"]);function st(i){return i==="success"?'<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M5 10.2 8.3 13.4 15 6.8"></path></svg>':i==="warning"?'<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M10 3.6 17 16.4H3L10 3.6Z"></path><path d="M10 8v3.4"></path><circle cx="10" cy="14.1" r="0.9" fill="currentColor" stroke="none"></circle></svg>':i==="danger"?'<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><circle cx="10" cy="10" r="7.1"></circle><path d="m7.5 7.5 5 5M12.5 7.5l-5 5"></path></svg>':i==="info"?'<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><circle cx="10" cy="10" r="7.1"></circle><path d="M10 13v-3.8"></path><circle cx="10" cy="6.5" r="0.9" fill="currentColor" stroke="none"></circle></svg>':'<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M6 10h8"></path><circle cx="10" cy="10" r="7.1"></circle></svg>'}function u(){return typeof window<"u"&&typeof document<"u"}function T(){if(!u())return null;const i=document.activeElement;return i instanceof HTMLElement?i:null}function w(i){return typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>i()):window.setTimeout(i,16)}function p(i){if(i){if(typeof cancelAnimationFrame=="function"){cancelAnimationFrame(i);return}window.clearTimeout(i)}}const c="data-ui-auto-name",l=class l extends Z.ElementBase{constructor(){super(),this._lastActive=null,this._active=!1,this._terminalEmitted=!1,this._closeMeta=null,this._uid=Math.random().toString(36).slice(2,10),this._dialogId="",this._config={},this._inputValue="",this._checked=!1,this._runtimeError="",this._activeHeadless=!1,this._focusInitialFrame=0,this._restoreFocusFrame=0,this._presented=!1,this._finishClose=null,this._onClick=this._onClick.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onFocusIn=this._onFocusIn.bind(this),this._onInput=this._onInput.bind(this),this._dialogId=this._uid}static get observedAttributes(){return["open","headless","dismissible","close-on-esc","close-on-backdrop","lock-while-loading","role","tone","size","variant","elevation","indicator","radius","state","aria-label","aria-labelledby","aria-describedby","initial-focus","title","description","confirm-text","cancel-text","loading-text","error-message"]}connectedCallback(){super.connectedCallback(),this.root.addEventListener("click",this._onClick),this.root.addEventListener("keydown",this._onKeyDown),this.root.addEventListener("input",this._onInput),this._syncFromAttributes(),this._syncVisualTokens(),this._syncOpenState()}disconnectedCallback(){this.root.removeEventListener("click",this._onClick),this.root.removeEventListener("keydown",this._onKeyDown),this.root.removeEventListener("input",this._onInput),this._focusInitialFrame&&(p(this._focusInitialFrame),this._focusInitialFrame=0),this._restoreFocusFrame&&(p(this._restoreFocusFrame),this._restoreFocusFrame=0),this._active&&!this._terminalEmitted&&this.close("dismiss","unmount"),this._deactivate(),super.disconnectedCallback()}attributeChangedCallback(t,e,r){if(e!==r){if(at.has(t)){this._syncVisualTokens();return}if(t==="headless"){this._syncActiveEnvironment(),this.requestRender();return}if(t==="open"){this._syncOpenState();return}t==="state"&&r!=="error"&&(this._runtimeError=""),this._syncFromAttributes(),this.isConnected&&this.requestRender()}}get open(){return this.hasAttribute("open")}set open(t){t?this.setAttribute("open",""):this.close("dismiss","programmatic")}get headless(){return this.hasAttribute("headless")}set headless(t){t?this.setAttribute("headless",""):this.removeAttribute("headless")}get dismissible(){return b(this.getAttribute("dismissible"),!0)}set dismissible(t){this.setAttribute("dismissible",String(t))}get closeOnEsc(){return b(this.getAttribute("close-on-esc"),this.dismissible)}set closeOnEsc(t){this.setAttribute("close-on-esc",String(t))}get closeOnBackdrop(){return b(this.getAttribute("close-on-backdrop"),this.dismissible)}set closeOnBackdrop(t){this.setAttribute("close-on-backdrop",String(t))}get lockWhileLoading(){return b(this.getAttribute("lock-while-loading"),!0)}set lockWhileLoading(t){this.setAttribute("lock-while-loading",String(t))}get roleType(){return this.getAttribute("role")==="dialog"?"dialog":"alertdialog"}set roleType(t){this.setAttribute("role",t)}get tone(){return Q(this.getAttribute("tone"))}set tone(t){if(t==="neutral"){this.removeAttribute("tone");return}this.setAttribute("tone",t)}get size(){return X(this.getAttribute("size"))}set size(t){if(t==="md"){this.removeAttribute("size");return}this.setAttribute("size",t)}get variant(){return tt(this.getAttribute("variant"))}set variant(t){if(t==="surface"){this.removeAttribute("variant");return}this.setAttribute("variant",t)}get elevation(){return et(this.getAttribute("elevation"))}set elevation(t){if(t==="low"){this.removeAttribute("elevation");return}this.setAttribute("elevation",t)}get indicator(){return it(this.getAttribute("indicator"))}set indicator(t){if(t==="line"){this.removeAttribute("indicator");return}this.setAttribute("indicator",t)}get radius(){return this.getAttribute("radius")||""}set radius(t){if(!t){this.removeAttribute("radius");return}this.setAttribute("radius",t)}get state(){const t=this.getAttribute("state");return t==="loading"||t==="error"?t:"idle"}set state(t){if(t==="idle"){this.removeAttribute("state");return}this.setAttribute("state",t)}get initialFocus(){return this.getAttribute("initial-focus")||this._config.initialFocus||""}set initialFocus(t){if(!t){this.removeAttribute("initial-focus");return}this.setAttribute("initial-focus",t)}get dialogId(){return this._dialogId}set dialogId(t){this._dialogId=t||this._uid,this.requestRender()}get config(){return this._config}set config(t){this._config=t||{},this._config.id&&(this._dialogId=this._config.id),this._config.dismissible!=null&&(this.dismissible=!!this._config.dismissible),this._config.closeOnEsc!=null&&(this.closeOnEsc=!!this._config.closeOnEsc),this._config.closeOnBackdrop!=null&&(this.closeOnBackdrop=!!this._config.closeOnBackdrop),this._config.lockWhileLoading!=null&&(this.lockWhileLoading=!!this._config.lockWhileLoading),this._config.role&&(this.roleType=this._config.role),this._config.tone&&(this.tone=this._config.tone),this._config.size&&(this.size=this._config.size),this._config.variant&&(this.variant=this._config.variant),this._config.elevation&&(this.elevation=this._config.elevation),this._config.indicator&&(this.indicator=this._config.indicator),this._config.radius!=null&&(this.radius=String(this._config.radius)),this._config.ariaLabel&&this.setAttribute("aria-label",this._config.ariaLabel),this._config.ariaLabelledby&&this.setAttribute("aria-labelledby",this._config.ariaLabelledby),this._config.ariaDescribedby&&this.setAttribute("aria-describedby",this._config.ariaDescribedby),this._config.initialFocus&&(this.initialFocus=this._config.initialFocus),this._config.headless!=null&&(this.headless=!!this._config.headless),this._inputValue=this._config.input?.value??this._inputValue,this._checked=this._config.checkbox?.checked??this._checked,this._runtimeError=this._config.errorMessage||"",this._syncVisualTokens(),this.requestRender()}getInputValue(){return this.root.querySelector(".input")?.value??this._inputValue}setInputValue(t){this._inputValue=t;const e=this.root.querySelector(".input");e&&(e.value=t)}getChecked(){return this.root.querySelector(".checkbox-input")?.checked??this._checked}setChecked(t){this._checked=t;const e=this.root.querySelector(".checkbox-input");e&&(e.checked=t)}setError(t){this._runtimeError=t,this.state=t?"error":"idle",this.requestRender()}clearError(){this._runtimeError="",this.state==="error"&&(this.state="idle"),this.requestRender()}close(t="dismiss",e,r){this._terminalEmitted||(this._closeMeta={action:t,source:e,reason:r},this.hasAttribute("open")&&this.removeAttribute("open"),this._syncOpenState())}_syncFromAttributes(){this.hasAttribute("role")||this.setAttribute("role","alertdialog")}_syncVisualTokens(){this.style.setProperty("--ui-alert-radius",rt(this.getAttribute("radius")))}_syncOpenState(){const t=this.hasAttribute("open");if(t&&!this._active){this._activate();return}!t&&this._active&&this._deactivate()}_activate(){this._active=!0,this._activeHeadless=this.headless,this._terminalEmitted=!1,this._closeMeta=null,l._openStack.includes(this)||l._openStack.push(this),this._lastActive=this.headless?null:T(),this.headless||f.acquireBodyScrollLock(),u()&&!this.headless&&document.addEventListener("focusin",this._onFocusIn,!0);const t=this.dialogId||this._uid;this._dispatchWithLegacy("ui-open","open",{id:t}),this.headless||(this._focusInitialFrame&&p(this._focusInitialFrame),this._focusInitialFrame=w(()=>{this._focusInitialFrame=0,this._focusInitial()})),this.requestRender()}_deactivate(){if(!this._active)return;this._active=!1;const t=l._openStack.lastIndexOf(this);if(t>=0&&l._openStack.splice(t,1),u()&&!this._activeHeadless&&document.removeEventListener("focusin",this._onFocusIn,!0),this._activeHeadless||f.releaseBodyScrollLock(),!this._terminalEmitted){const r=this._closeMeta||{action:"dismiss",source:"abort"},a=this.dialogId||this._uid;r.action==="cancel"?this._dispatchWithLegacy("ui-cancel","cancel",{id:a}):r.action==="dismiss"&&this._dispatchWithLegacy("ui-dismiss","dismiss",{id:a,source:r.source||"abort",reason:r.reason}),this._dispatchWithLegacy("ui-close","close",{id:a,action:r.action,source:r.source,reason:r.reason}),this._terminalEmitted=!0,this._closeMeta=null}const e=this._lastActive;this._lastActive=null,e&&!this._activeHeadless&&(this._restoreFocusFrame&&p(this._restoreFocusFrame),this._restoreFocusFrame=w(()=>{this._restoreFocusFrame=0;try{e.focus()}catch{}})),this._activeHeadless=!1,this.requestRender()}_syncActiveEnvironment(){if(this._active&&this.headless!==this._activeHeadless){if(this.headless){u()&&document.removeEventListener("focusin",this._onFocusIn,!0),f.releaseBodyScrollLock(),this._lastActive=null,this._activeHeadless=!0;return}this._lastActive=T(),f.acquireBodyScrollLock(),u()&&document.addEventListener("focusin",this._onFocusIn,!0),this._activeHeadless=!1,this._focusInitialFrame&&p(this._focusInitialFrame),this._focusInitialFrame=w(()=>{this._focusInitialFrame=0,this._focusInitial()})}}_dispatchWithLegacy(t,e,r,a=!1){const o=new CustomEvent(t,{detail:r,bubbles:!0,composed:!0,cancelable:a});this.dispatchEvent(o);const n=new CustomEvent(e,{detail:r,bubbles:!0,composed:!0,cancelable:a});return this.dispatchEvent(n),o}_isTopMost(){if(!this._active)return!1;const t=l._openStack;return t.length>0&&t[t.length-1]===this}_queryPanel(){return this.root.querySelector(".dialog")}_collectFocusable(t){return Array.from(t.querySelectorAll(J)).filter(e=>{if(e.disabled||e.getAttribute("aria-hidden")==="true")return!1;const a=u()?window.getComputedStyle(e):null;return!(a&&(a.display==="none"||a.visibility==="hidden"))})}_focusInitial(){if(!this.open)return;const t=this._queryPanel();if(!t)return;const e=this.initialFocus;if(e){const n=t.querySelector(e);if(n&&typeof n.focus=="function"){n.focus();return}}const r=this._collectFocusable(t),o=r.find(n=>n.hasAttribute("autofocus"))||r[0]||t;!o.hasAttribute("tabindex")&&o===t&&o.setAttribute("tabindex","-1");try{o.focus()}catch{}}_handleTab(t){if(t.key!=="Tab")return;const e=this._queryPanel();if(!e)return;const r=this._collectFocusable(e);if(!r.length){t.preventDefault(),e.focus();return}const a=this.root.activeElement||document.activeElement,o=r[0],n=r[r.length-1];if(t.shiftKey){(a===o||!a||!e.contains(a))&&(t.preventDefault(),n.focus());return}a===n&&(t.preventDefault(),o.focus())}_onFocusIn(t){if(!this.open||!this._isTopMost())return;const e=this._queryPanel();if(!e)return;const r=t.target;(typeof t.composedPath=="function"?t.composedPath():[]).includes(e)||r&&e.contains(r)||this._focusInitial()}_onInput(t){const e=t.target;e&&(e.classList.contains("input")&&(this._inputValue=e.value),e.classList.contains("checkbox-input")&&(this._checked=e.checked),this._dispatchWithLegacy("ui-change","change",{id:this.dialogId||this._uid,inputValue:this._inputValue,checked:this._checked}))}_isInteractionLocked(){return this.state==="loading"&&this.lockWhileLoading}_requestDismiss(t,e){this._isInteractionLocked()||this.close("dismiss",t,e)}_handleConfirm(){const t={id:this.dialogId||this._uid,inputValue:this.getInputValue(),checked:this.getChecked()};this._dispatchWithLegacy("ui-confirm","confirm",t,!0).defaultPrevented||this.close("confirm")}_handleCancel(){this._isInteractionLocked()||this.close("cancel")}_onClick(t){if(!this.open||!this._isTopMost())return;const e=t.target;if(e){if(e.classList.contains("backdrop")&&this.closeOnBackdrop){this._requestDismiss("backdrop");return}if(e.closest(".close")){this._requestDismiss("close-icon");return}if(e.closest(".btn-confirm")){this._handleConfirm();return}e.closest(".btn-cancel")&&this._handleCancel()}}_onKeyDown(t){if(!(!this.open||!this._isTopMost())){if(t.key==="Escape"){if(!this.closeOnEsc)return;t.preventDefault(),t.stopPropagation(),this._requestDismiss("esc");return}this._handleTab(t)}}_syncHostSemantics(t,e="",r=!1){if(!t){this.getAttribute("aria-hidden")!=="true"&&this.setAttribute("aria-hidden","true"),this.hasAttribute(c)&&(this.removeAttribute("aria-label"),this.removeAttribute(c));return}if(this.hasAttribute("aria-hidden")&&this.removeAttribute("aria-hidden"),r){this.hasAttribute(c)&&this.removeAttribute(c);return}this.getAttribute("aria-label")!==e&&this.setAttribute("aria-label",e),this.hasAttribute(c)||this.setAttribute(c,"")}render(){if(!this.open){this._syncHostSemantics(!1);const y=this.root.querySelector(".backdrop");if(this._presented&&y){this._presented=!1,y.removeAttribute("data-instant"),this._finishClose=L.closeOverlay(y,()=>{this._finishClose=null,this.setContent("")});return}if(this._finishClose)return;this.setContent("");return}this._finishClose?.(),this._finishClose=null;const t=this._config.title??this.getAttribute("title")??"",e=this._config.description??this.getAttribute("description")??"",r=this._config.confirmText??this.getAttribute("confirm-text")??"Confirm",a=this._config.cancelText??this.getAttribute("cancel-text")??"Cancel",o=this._config.loadingText??this.getAttribute("loading-text")??"Working...",n=!!this._config.input?.enabled,B=this._config.input?.label||"Value",$=this._config.input?.placeholder||"",q=!!this._config.input?.required,M=!!this._config.checkbox?.enabled,O=this._config.checkbox?.label||"Remember this choice",D=this.state,m=this._runtimeError||this._config.errorMessage||this.getAttribute("error-message")||"",A=`ui-alert-title-${this._uid}`,z=`ui-alert-description-${this._uid}`,F=`ui-alert-error-${this._uid}`,H=!!this.querySelector('[slot="title"]'),V=!!this.querySelector('[slot="description"]'),R=!!this.querySelector('[slot="icon"]'),W=!!this.querySelector('[slot="footer"]'),P=!!this.querySelector('[slot="content"]'),v=H||!!t,x=V||!!e,j=R||v||x,K=this._config.showCancel??this.dismissible,Y=this._config.showClose??this.dismissible,N=this.tone,_=this.hasAttribute(c)?"":this.getAttribute("aria-label")||"",C=this.getAttribute("aria-labelledby")||"",E=this.getAttribute("aria-describedby")||"",k=C||(v?A:""),S=_||(k?"":t||e||"Dialog"),U=(this.querySelector('[slot="title"]')?.textContent||"").replace(/\s+/g," ").trim();this._syncHostSemantics(!0,_||U||t||e||"Dialog",!!_||!!C);const d=[];E?d.push(E):(x&&d.push(z),m&&d.push(F));const h=D==="loading";this.setContent(`
|
|
532
540
|
<style>${G}</style>
|
|
533
541
|
<div class="backdrop" part="backdrop" role="presentation" data-open="${String(this.open)}" data-state="open" ${this._presented?"data-instant":""}>
|
|
534
542
|
<section
|
|
535
543
|
class="dialog"
|
|
536
544
|
part="dialog"
|
|
537
|
-
role="${
|
|
545
|
+
role="${s(this.roleType)}"
|
|
538
546
|
aria-modal="true"
|
|
539
|
-
${S?`aria-label="${
|
|
540
|
-
${k?`aria-labelledby="${
|
|
541
|
-
${d.length?`aria-describedby="${
|
|
547
|
+
${S?`aria-label="${s(S)}"`:""}
|
|
548
|
+
${k?`aria-labelledby="${s(k)}"`:""}
|
|
549
|
+
${d.length?`aria-describedby="${s(d.join(" "))}"`:""}
|
|
542
550
|
tabindex="-1"
|
|
543
551
|
>
|
|
544
552
|
${Y?`<button class="close" part="close" aria-label="Close dialog">
|
|
@@ -551,12 +559,12 @@
|
|
|
551
559
|
<div class="header-main">
|
|
552
560
|
<span class="icon-wrap" part="icon-wrap" aria-hidden="true">
|
|
553
561
|
<span class="icon" part="icon">
|
|
554
|
-
<slot name="icon">${
|
|
562
|
+
<slot name="icon">${st(N)}</slot>
|
|
555
563
|
</span>
|
|
556
564
|
</span>
|
|
557
565
|
<div class="heading">
|
|
558
|
-
${v?`<h2 id="${A}" class="title" part="title"><slot name="title">${
|
|
559
|
-
${x?`<p id="${z}" class="description" part="description"><slot name="description">${
|
|
566
|
+
${v?`<h2 id="${A}" class="title" part="title"><slot name="title">${s(t)}</slot></h2>`:""}
|
|
567
|
+
${x?`<p id="${z}" class="description" part="description"><slot name="description">${s(e)}</slot></p>`:""}
|
|
560
568
|
</div>
|
|
561
569
|
</div>
|
|
562
570
|
</header>`:""}
|
|
@@ -565,13 +573,13 @@
|
|
|
565
573
|
${P?'<slot name="content"></slot>':"<slot></slot>"}
|
|
566
574
|
|
|
567
575
|
${n?`<label class="input-wrap">
|
|
568
|
-
<span class="label">${
|
|
576
|
+
<span class="label">${s(B)}</span>
|
|
569
577
|
<input
|
|
570
578
|
class="input"
|
|
571
579
|
part="input"
|
|
572
580
|
type="text"
|
|
573
|
-
value="${
|
|
574
|
-
placeholder="${
|
|
581
|
+
value="${s(this.getInputValue())}"
|
|
582
|
+
placeholder="${s($)}"
|
|
575
583
|
${q?"required":""}
|
|
576
584
|
${h?"disabled":""}
|
|
577
585
|
/>
|
|
@@ -580,18 +588,18 @@
|
|
|
580
588
|
${M?`<label class="checkbox" part="checkbox">
|
|
581
589
|
<span class="checkbox-line">
|
|
582
590
|
<input class="checkbox-input" type="checkbox" ${this.getChecked()?"checked":""} ${h?"disabled":""} />
|
|
583
|
-
<span>${
|
|
591
|
+
<span>${s(O)}</span>
|
|
584
592
|
</span>
|
|
585
593
|
</label>`:""}
|
|
586
594
|
</div>
|
|
587
595
|
|
|
588
|
-
<div class="error" id="${F}" part="error" aria-live="polite" data-empty="${String(!m)}">${
|
|
596
|
+
<div class="error" id="${F}" part="error" aria-live="polite" data-empty="${String(!m)}">${s(m)}</div>
|
|
589
597
|
|
|
590
598
|
<footer class="footer" part="footer">
|
|
591
|
-
${h?`<span class="loading"><span class="spinner" aria-hidden="true"></span><span>${o
|
|
599
|
+
${h?`<span class="loading"><span class="spinner" aria-hidden="true"></span><span>${s(o)}</span></span>`:'<span aria-hidden="true"></span>'}
|
|
592
600
|
|
|
593
|
-
${W?'<slot name="footer"></slot>':`${K?`<button class="btn btn-cancel" part="cancel" type="button" ${h?"disabled":""}>${
|
|
594
|
-
<button class="btn btn-confirm" part="confirm" type="button" ${h?"disabled":""}>${
|
|
601
|
+
${W?'<slot name="footer"></slot>':`${K?`<button class="btn btn-cancel" part="cancel" type="button" ${h?"disabled":""}>${s(a)}</button>`:""}
|
|
602
|
+
<button class="btn btn-confirm" part="confirm" type="button" ${h?"disabled":""}>${s(r)}</button>`}
|
|
595
603
|
</footer>
|
|
596
604
|
</section>
|
|
597
605
|
</div>
|
package/dist/alert-dialog.esm.js
CHANGED
|
@@ -21,7 +21,10 @@ const Q = `
|
|
|
21
21
|
--ui-alert-z: 1301;
|
|
22
22
|
--ui-alert-backdrop-z: 1300;
|
|
23
23
|
--ui-alert-focus: var(--ui-color-focus-ring, var(--ui-focus-ring, #2563eb));
|
|
24
|
-
--ui-alert-danger: var(--ui-color-danger, #dc2626);
|
|
24
|
+
--ui-alert-danger: var(--ui-color-danger-text, var(--ui-color-danger, #dc2626));
|
|
25
|
+
/* A solid dialog: the fill, and the text colour that reads on it. */
|
|
26
|
+
--ui-alert-solid-bg: var(--ui-alert-accent);
|
|
27
|
+
--ui-alert-on-accent: var(--ui-color-foreground-on-primary, #ffffff);
|
|
25
28
|
--ui-alert-backdrop: var(--base-alert-dialog-backdrop, var(--color-overlay, rgba(2, 6, 23, 0.52)));
|
|
26
29
|
--ui-alert-btn-bg: color-mix(in srgb, var(--ui-alert-bg-base) 90%, var(--ui-color-background, #ffffff) 10%);
|
|
27
30
|
--ui-alert-btn-border: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 72%, transparent);
|
|
@@ -49,18 +52,23 @@ const Q = `
|
|
|
49
52
|
|
|
50
53
|
:host([tone='success']) {
|
|
51
54
|
--ui-alert-accent: var(--ui-color-success, #15803d);
|
|
55
|
+
--ui-alert-solid-bg: var(--ui-color-success-solid, var(--ui-alert-accent));
|
|
56
|
+
--ui-alert-on-accent: var(--ui-color-foreground-on-success, #ffffff);
|
|
52
57
|
--ui-alert-confirm-bg: color-mix(in srgb, var(--ui-alert-accent) 76%, #000000);
|
|
53
58
|
--ui-alert-confirm-color: #ffffff;
|
|
54
59
|
}
|
|
55
60
|
|
|
56
61
|
:host([tone='warning']) {
|
|
57
62
|
--ui-alert-accent: var(--ui-color-warning, #b45309);
|
|
63
|
+
--ui-alert-on-accent: var(--ui-color-foreground-on-warning, #ffffff);
|
|
58
64
|
--ui-alert-confirm-bg: var(--ui-alert-accent);
|
|
59
65
|
--ui-alert-confirm-color: var(--ui-color-foreground-on-warning, #ffffff);
|
|
60
66
|
}
|
|
61
67
|
|
|
62
68
|
:host([tone='danger']) {
|
|
63
69
|
--ui-alert-accent: var(--ui-color-danger, #dc2626);
|
|
70
|
+
--ui-alert-solid-bg: var(--ui-color-danger-solid, var(--ui-alert-accent));
|
|
71
|
+
--ui-alert-on-accent: var(--ui-color-foreground-on-danger, #ffffff);
|
|
64
72
|
--ui-alert-confirm-bg: color-mix(in srgb, var(--ui-alert-accent) 80%, #000000);
|
|
65
73
|
--ui-alert-confirm-color: #ffffff;
|
|
66
74
|
}
|
|
@@ -111,17 +119,17 @@ const Q = `
|
|
|
111
119
|
}
|
|
112
120
|
|
|
113
121
|
:host([variant='solid']) {
|
|
114
|
-
--ui-alert-bg: var(--ui-alert-
|
|
122
|
+
--ui-alert-bg: var(--ui-alert-solid-bg);
|
|
115
123
|
--ui-alert-border: 1px solid color-mix(in srgb, #000000 16%, transparent);
|
|
116
|
-
--ui-alert-text:
|
|
117
|
-
--ui-alert-muted: color-mix(in srgb,
|
|
124
|
+
--ui-alert-text: var(--ui-alert-on-accent);
|
|
125
|
+
--ui-alert-muted: color-mix(in srgb, var(--ui-alert-on-accent) 98%, transparent);
|
|
118
126
|
--ui-alert-btn-bg: color-mix(in srgb, #000000 14%, transparent);
|
|
119
|
-
--ui-alert-btn-border: color-mix(in srgb,
|
|
127
|
+
--ui-alert-btn-border: color-mix(in srgb, var(--ui-alert-on-accent) 30%, transparent);
|
|
120
128
|
--ui-alert-btn-hover: color-mix(in srgb, #000000 22%, transparent);
|
|
121
129
|
--ui-alert-confirm-bg: color-mix(in srgb, #000000 30%, transparent);
|
|
122
|
-
--ui-alert-confirm-color:
|
|
123
|
-
--ui-alert-icon-bg: color-mix(in srgb,
|
|
124
|
-
--ui-alert-icon-color:
|
|
130
|
+
--ui-alert-confirm-color: var(--ui-alert-on-accent);
|
|
131
|
+
--ui-alert-icon-bg: color-mix(in srgb, var(--ui-alert-on-accent) 18%, transparent);
|
|
132
|
+
--ui-alert-icon-color: var(--ui-alert-on-accent);
|
|
125
133
|
}
|
|
126
134
|
|
|
127
135
|
:host([elevation='none']) {
|
|
@@ -537,7 +545,7 @@ function f(i, t) {
|
|
|
537
545
|
const e = i.trim().toLowerCase();
|
|
538
546
|
return e !== "false" && e !== "0" && e !== "off";
|
|
539
547
|
}
|
|
540
|
-
function
|
|
548
|
+
function s(i) {
|
|
541
549
|
return String(i).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
542
550
|
}
|
|
543
551
|
function tt(i) {
|
|
@@ -552,10 +560,10 @@ function it(i) {
|
|
|
552
560
|
function rt(i) {
|
|
553
561
|
return i === "none" || i === "high" ? i : "low";
|
|
554
562
|
}
|
|
555
|
-
function
|
|
563
|
+
function at(i) {
|
|
556
564
|
return i === "none" ? "none" : "line";
|
|
557
565
|
}
|
|
558
|
-
function
|
|
566
|
+
function st(i, t = "var(--base-alert-dialog-radius, var(--ui-radius, 6px))") {
|
|
559
567
|
if (i == null) return t;
|
|
560
568
|
const e = i.trim().toLowerCase();
|
|
561
569
|
return e ? e === "full" || e === "pill" ? "999px" : /^-?\d+(\.\d+)?$/.test(e) ? `${e}px` : i : t;
|
|
@@ -722,7 +730,7 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
722
730
|
this.setAttribute("elevation", t);
|
|
723
731
|
}
|
|
724
732
|
get indicator() {
|
|
725
|
-
return
|
|
733
|
+
return at(this.getAttribute("indicator"));
|
|
726
734
|
}
|
|
727
735
|
set indicator(t) {
|
|
728
736
|
if (t === "line") {
|
|
@@ -803,7 +811,7 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
803
811
|
this.hasAttribute("role") || this.setAttribute("role", "alertdialog");
|
|
804
812
|
}
|
|
805
813
|
_syncVisualTokens() {
|
|
806
|
-
this.style.setProperty("--ui-alert-radius",
|
|
814
|
+
this.style.setProperty("--ui-alert-radius", st(this.getAttribute("radius")));
|
|
807
815
|
}
|
|
808
816
|
_syncOpenState() {
|
|
809
817
|
const t = this.hasAttribute("open");
|
|
@@ -825,13 +833,13 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
825
833
|
this._active = !1;
|
|
826
834
|
const t = l._openStack.lastIndexOf(this);
|
|
827
835
|
if (t >= 0 && l._openStack.splice(t, 1), u() && !this._activeHeadless && document.removeEventListener("focusin", this._onFocusIn, !0), this._activeHeadless || L(), !this._terminalEmitted) {
|
|
828
|
-
const r = this._closeMeta || { action: "dismiss", source: "abort" },
|
|
829
|
-
r.action === "cancel" ? this._dispatchWithLegacy("ui-cancel", "cancel", { id:
|
|
830
|
-
id:
|
|
836
|
+
const r = this._closeMeta || { action: "dismiss", source: "abort" }, a = this.dialogId || this._uid;
|
|
837
|
+
r.action === "cancel" ? this._dispatchWithLegacy("ui-cancel", "cancel", { id: a }) : r.action === "dismiss" && this._dispatchWithLegacy("ui-dismiss", "dismiss", {
|
|
838
|
+
id: a,
|
|
831
839
|
source: r.source || "abort",
|
|
832
840
|
reason: r.reason
|
|
833
841
|
}), this._dispatchWithLegacy("ui-close", "close", {
|
|
834
|
-
id:
|
|
842
|
+
id: a,
|
|
835
843
|
action: r.action,
|
|
836
844
|
source: r.source,
|
|
837
845
|
reason: r.reason
|
|
@@ -857,19 +865,19 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
857
865
|
});
|
|
858
866
|
}
|
|
859
867
|
}
|
|
860
|
-
_dispatchWithLegacy(t, e, r,
|
|
868
|
+
_dispatchWithLegacy(t, e, r, a = !1) {
|
|
861
869
|
const o = new CustomEvent(t, {
|
|
862
870
|
detail: r,
|
|
863
871
|
bubbles: !0,
|
|
864
872
|
composed: !0,
|
|
865
|
-
cancelable:
|
|
873
|
+
cancelable: a
|
|
866
874
|
});
|
|
867
875
|
this.dispatchEvent(o);
|
|
868
876
|
const n = new CustomEvent(e, {
|
|
869
877
|
detail: r,
|
|
870
878
|
bubbles: !0,
|
|
871
879
|
composed: !0,
|
|
872
|
-
cancelable:
|
|
880
|
+
cancelable: a
|
|
873
881
|
});
|
|
874
882
|
return this.dispatchEvent(n), o;
|
|
875
883
|
}
|
|
@@ -884,8 +892,8 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
884
892
|
_collectFocusable(t) {
|
|
885
893
|
return Array.from(t.querySelectorAll(X)).filter((e) => {
|
|
886
894
|
if (e.disabled || e.getAttribute("aria-hidden") === "true") return !1;
|
|
887
|
-
const
|
|
888
|
-
return !(
|
|
895
|
+
const a = u() ? window.getComputedStyle(e) : null;
|
|
896
|
+
return !(a && (a.display === "none" || a.visibility === "hidden"));
|
|
889
897
|
});
|
|
890
898
|
}
|
|
891
899
|
_focusInitial() {
|
|
@@ -916,12 +924,12 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
916
924
|
t.preventDefault(), e.focus();
|
|
917
925
|
return;
|
|
918
926
|
}
|
|
919
|
-
const
|
|
927
|
+
const a = this.root.activeElement || document.activeElement, o = r[0], n = r[r.length - 1];
|
|
920
928
|
if (t.shiftKey) {
|
|
921
|
-
(
|
|
929
|
+
(a === o || !a || !e.contains(a)) && (t.preventDefault(), n.focus());
|
|
922
930
|
return;
|
|
923
931
|
}
|
|
924
|
-
|
|
932
|
+
a === n && (t.preventDefault(), o.focus());
|
|
925
933
|
}
|
|
926
934
|
_onFocusIn(t) {
|
|
927
935
|
if (!this.open || !this._isTopMost()) return;
|
|
@@ -1013,7 +1021,7 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
1013
1021
|
return;
|
|
1014
1022
|
}
|
|
1015
1023
|
this._finishClose?.(), this._finishClose = null;
|
|
1016
|
-
const t = this._config.title ?? this.getAttribute("title") ?? "", e = this._config.description ?? this.getAttribute("description") ?? "", r = this._config.confirmText ?? this.getAttribute("confirm-text") ?? "Confirm",
|
|
1024
|
+
const t = this._config.title ?? this.getAttribute("title") ?? "", e = this._config.description ?? this.getAttribute("description") ?? "", r = this._config.confirmText ?? this.getAttribute("confirm-text") ?? "Confirm", a = this._config.cancelText ?? this.getAttribute("cancel-text") ?? "Cancel", o = this._config.loadingText ?? this.getAttribute("loading-text") ?? "Working...", n = !!this._config.input?.enabled, $ = this._config.input?.label || "Value", B = this._config.input?.placeholder || "", q = !!this._config.input?.required, O = !!this._config.checkbox?.enabled, D = this._config.checkbox?.label || "Remember this choice", M = this.state, b = this._runtimeError || this._config.errorMessage || this.getAttribute("error-message") || "", w = `ui-alert-title-${this._uid}`, A = `ui-alert-description-${this._uid}`, z = `ui-alert-error-${this._uid}`, H = !!this.querySelector('[slot="title"]'), V = !!this.querySelector('[slot="description"]'), R = !!this.querySelector('[slot="icon"]'), W = !!this.querySelector('[slot="footer"]'), P = !!this.querySelector('[slot="content"]'), g = H || !!t, m = V || !!e, j = R || g || m, K = this._config.showCancel ?? this.dismissible, Y = this._config.showClose ?? this.dismissible, N = this.tone, v = this.hasAttribute(c) ? "" : this.getAttribute("aria-label") || "", F = this.getAttribute("aria-labelledby") || "", C = this.getAttribute("aria-describedby") || "", x = F || (g ? w : ""), E = v || (x ? "" : t || e || "Dialog"), U = (this.querySelector('[slot="title"]')?.textContent || "").replace(/\s+/g, " ").trim();
|
|
1017
1025
|
this._syncHostSemantics(
|
|
1018
1026
|
!0,
|
|
1019
1027
|
v || U || t || e || "Dialog",
|
|
@@ -1028,11 +1036,11 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
1028
1036
|
<section
|
|
1029
1037
|
class="dialog"
|
|
1030
1038
|
part="dialog"
|
|
1031
|
-
role="${
|
|
1039
|
+
role="${s(this.roleType)}"
|
|
1032
1040
|
aria-modal="true"
|
|
1033
|
-
${E ? `aria-label="${
|
|
1034
|
-
${x ? `aria-labelledby="${
|
|
1035
|
-
${d.length ? `aria-describedby="${
|
|
1041
|
+
${E ? `aria-label="${s(E)}"` : ""}
|
|
1042
|
+
${x ? `aria-labelledby="${s(x)}"` : ""}
|
|
1043
|
+
${d.length ? `aria-describedby="${s(d.join(" "))}"` : ""}
|
|
1036
1044
|
tabindex="-1"
|
|
1037
1045
|
>
|
|
1038
1046
|
${Y ? `<button class="close" part="close" aria-label="Close dialog">
|
|
@@ -1049,8 +1057,8 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
1049
1057
|
</span>
|
|
1050
1058
|
</span>
|
|
1051
1059
|
<div class="heading">
|
|
1052
|
-
${g ? `<h2 id="${w}" class="title" part="title"><slot name="title">${
|
|
1053
|
-
${m ? `<p id="${A}" class="description" part="description"><slot name="description">${
|
|
1060
|
+
${g ? `<h2 id="${w}" class="title" part="title"><slot name="title">${s(t)}</slot></h2>` : ""}
|
|
1061
|
+
${m ? `<p id="${A}" class="description" part="description"><slot name="description">${s(e)}</slot></p>` : ""}
|
|
1054
1062
|
</div>
|
|
1055
1063
|
</div>
|
|
1056
1064
|
</header>` : ""}
|
|
@@ -1059,13 +1067,13 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
1059
1067
|
${P ? '<slot name="content"></slot>' : "<slot></slot>"}
|
|
1060
1068
|
|
|
1061
1069
|
${n ? `<label class="input-wrap">
|
|
1062
|
-
<span class="label">${
|
|
1070
|
+
<span class="label">${s($)}</span>
|
|
1063
1071
|
<input
|
|
1064
1072
|
class="input"
|
|
1065
1073
|
part="input"
|
|
1066
1074
|
type="text"
|
|
1067
|
-
value="${
|
|
1068
|
-
placeholder="${
|
|
1075
|
+
value="${s(this.getInputValue())}"
|
|
1076
|
+
placeholder="${s(B)}"
|
|
1069
1077
|
${q ? "required" : ""}
|
|
1070
1078
|
${h ? "disabled" : ""}
|
|
1071
1079
|
/>
|
|
@@ -1074,18 +1082,18 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
1074
1082
|
${O ? `<label class="checkbox" part="checkbox">
|
|
1075
1083
|
<span class="checkbox-line">
|
|
1076
1084
|
<input class="checkbox-input" type="checkbox" ${this.getChecked() ? "checked" : ""} ${h ? "disabled" : ""} />
|
|
1077
|
-
<span>${
|
|
1085
|
+
<span>${s(D)}</span>
|
|
1078
1086
|
</span>
|
|
1079
1087
|
</label>` : ""}
|
|
1080
1088
|
</div>
|
|
1081
1089
|
|
|
1082
|
-
<div class="error" id="${z}" part="error" aria-live="polite" data-empty="${String(!b)}">${
|
|
1090
|
+
<div class="error" id="${z}" part="error" aria-live="polite" data-empty="${String(!b)}">${s(b)}</div>
|
|
1083
1091
|
|
|
1084
1092
|
<footer class="footer" part="footer">
|
|
1085
|
-
${h ? `<span class="loading"><span class="spinner" aria-hidden="true"></span><span>${
|
|
1093
|
+
${h ? `<span class="loading"><span class="spinner" aria-hidden="true"></span><span>${s(o)}</span></span>` : '<span aria-hidden="true"></span>'}
|
|
1086
1094
|
|
|
1087
|
-
${W ? '<slot name="footer"></slot>' : `${K ? `<button class="btn btn-cancel" part="cancel" type="button" ${h ? "disabled" : ""}>${a
|
|
1088
|
-
<button class="btn btn-confirm" part="confirm" type="button" ${h ? "disabled" : ""}>${
|
|
1095
|
+
${W ? '<slot name="footer"></slot>' : `${K ? `<button class="btn btn-cancel" part="cancel" type="button" ${h ? "disabled" : ""}>${s(a)}</button>` : ""}
|
|
1096
|
+
<button class="btn btn-confirm" part="confirm" type="button" ${h ? "disabled" : ""}>${s(r)}</button>`}
|
|
1089
1097
|
</footer>
|
|
1090
1098
|
</section>
|
|
1091
1099
|
</div>
|
package/dist/alert.cjs.js
CHANGED
|
@@ -209,7 +209,7 @@
|
|
|
209
209
|
:host([variant="solid"]) .alert {
|
|
210
210
|
--ui-alert-bg: var(--ui-alert-accent);
|
|
211
211
|
--ui-alert-color: #ffffff;
|
|
212
|
-
--ui-alert-muted: color-mix(in srgb, #ffffff
|
|
212
|
+
--ui-alert-muted: color-mix(in srgb, #ffffff 92%, transparent);
|
|
213
213
|
--ui-alert-border: 1px solid color-mix(in srgb, #000000 18%, transparent);
|
|
214
214
|
--ui-alert-icon-bg: color-mix(in srgb, #ffffff 20%, transparent);
|
|
215
215
|
--ui-alert-icon-color: #ffffff;
|
|
@@ -258,7 +258,7 @@
|
|
|
258
258
|
|
|
259
259
|
/* The tone rules above set a tinted fill; a solid alert must win over them, so these come last. */
|
|
260
260
|
:host([variant="solid"]) .alert {
|
|
261
|
-
--ui-alert-bg: color-mix(in srgb, var(--ui-alert-accent)
|
|
261
|
+
--ui-alert-bg: color-mix(in srgb, var(--ui-alert-accent) 78%, #000000);
|
|
262
262
|
--ui-alert-border: 1px solid color-mix(in srgb, #000000 18%, transparent);
|
|
263
263
|
}
|
|
264
264
|
|
package/dist/alert.esm.js
CHANGED
|
@@ -210,7 +210,7 @@ const y = `
|
|
|
210
210
|
:host([variant="solid"]) .alert {
|
|
211
211
|
--ui-alert-bg: var(--ui-alert-accent);
|
|
212
212
|
--ui-alert-color: #ffffff;
|
|
213
|
-
--ui-alert-muted: color-mix(in srgb, #ffffff
|
|
213
|
+
--ui-alert-muted: color-mix(in srgb, #ffffff 92%, transparent);
|
|
214
214
|
--ui-alert-border: 1px solid color-mix(in srgb, #000000 18%, transparent);
|
|
215
215
|
--ui-alert-icon-bg: color-mix(in srgb, #ffffff 20%, transparent);
|
|
216
216
|
--ui-alert-icon-color: #ffffff;
|
|
@@ -259,7 +259,7 @@ const y = `
|
|
|
259
259
|
|
|
260
260
|
/* The tone rules above set a tinted fill; a solid alert must win over them, so these come last. */
|
|
261
261
|
:host([variant="solid"]) .alert {
|
|
262
|
-
--ui-alert-bg: color-mix(in srgb, var(--ui-alert-accent)
|
|
262
|
+
--ui-alert-bg: color-mix(in srgb, var(--ui-alert-accent) 78%, #000000);
|
|
263
263
|
--ui-alert-border: 1px solid color-mix(in srgb, #000000 18%, transparent);
|
|
264
264
|
}
|
|
265
265
|
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
|
|
97
97
|
:host([variant="soft"]) {
|
|
98
98
|
--ui-animated-text-color:
|
|
99
|
-
color-mix(in srgb, var(--ui-animated-text-accent)
|
|
99
|
+
color-mix(in srgb, var(--ui-animated-text-accent) 62%, var(--ui-color-text, var(--ui-text, #0f172a)));
|
|
100
100
|
--ui-animated-text-bg:
|
|
101
101
|
color-mix(in srgb, var(--ui-animated-text-accent) 8%, var(--ui-color-surface, #ffffff));
|
|
102
102
|
--ui-animated-text-border:
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
:host([variant="solid"]) {
|
|
109
|
-
--ui-animated-text-color: color-mix(in srgb, var(--ui-animated-text-accent)
|
|
109
|
+
--ui-animated-text-color: color-mix(in srgb, var(--ui-animated-text-accent) 45%, var(--ui-color-text-strong, #0f172a));
|
|
110
110
|
--ui-animated-text-bg:
|
|
111
111
|
linear-gradient(
|
|
112
112
|
180deg,
|
|
@@ -149,7 +149,7 @@
|
|
|
149
149
|
|
|
150
150
|
:host([variant="minimal"]) {
|
|
151
151
|
--ui-animated-text-color:
|
|
152
|
-
color-mix(in srgb, var(--ui-animated-text-accent)
|
|
152
|
+
color-mix(in srgb, var(--ui-animated-text-accent) 45%, var(--ui-color-text-strong, var(--ui-color-text, var(--ui-text, #0f172a))));
|
|
153
153
|
--ui-animated-text-bg: transparent;
|
|
154
154
|
--ui-animated-text-border: none;
|
|
155
155
|
--ui-animated-text-shadow: none;
|
|
@@ -396,8 +396,8 @@
|
|
|
396
396
|
background:
|
|
397
397
|
linear-gradient(
|
|
398
398
|
135deg,
|
|
399
|
-
color-mix(in srgb, var(--ui-animated-text-accent)
|
|
400
|
-
color-mix(in srgb, var(--ui-animated-text-accent)
|
|
399
|
+
color-mix(in srgb, var(--ui-animated-text-accent) 62%, var(--ui-color-text-strong, #0f172a)),
|
|
400
|
+
color-mix(in srgb, var(--ui-animated-text-accent) 40%, var(--ui-color-text-strong, #0f172a))
|
|
401
401
|
);
|
|
402
402
|
-webkit-background-clip: text;
|
|
403
403
|
background-clip: text;
|