@devschile/chucao 2.7.1 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chucao/chucao.esm.js +1 -1
- package/dist/chucao/{p-01b6c7bf.entry.js → p-03acf096.entry.js} +2 -2
- package/dist/chucao/{p-10f6801e.entry.js → p-0ce2b15d.entry.js} +2 -2
- package/dist/chucao/p-10e37157.entry.js +2 -0
- package/dist/chucao/p-10e37157.entry.js.map +1 -0
- package/dist/chucao/{p-f917d34f.entry.js → p-12043dc1.entry.js} +2 -2
- package/dist/chucao/p-1dca55d6.entry.js +2 -0
- package/dist/chucao/{p-deb2571b.entry.js.map → p-1dca55d6.entry.js.map} +1 -1
- package/dist/chucao/{p-0c7f6f8d.entry.js → p-244d8e96.entry.js} +2 -2
- package/dist/chucao/{p-a7c674b7.entry.js → p-29841714.entry.js} +2 -2
- package/dist/chucao/{p-ffecdf25.entry.js → p-302ec527.entry.js} +2 -2
- package/dist/chucao/{p-337d7f68.entry.js → p-51f6327c.entry.js} +2 -2
- package/dist/chucao/{p-1b70e3f1.entry.js → p-5a62951e.entry.js} +2 -2
- package/dist/chucao/{p-472ec451.entry.js → p-5d0ac17a.entry.js} +2 -2
- package/dist/chucao/{p-d8b71751.entry.js → p-5e0e1012.entry.js} +2 -2
- package/dist/chucao/{p-15d27bb7.entry.js → p-61a94a4e.entry.js} +2 -2
- package/dist/chucao/p-649c2cef.entry.js +2 -0
- package/dist/chucao/p-649c2cef.entry.js.map +1 -0
- package/dist/chucao/p-674c0f61.entry.js +2 -0
- package/dist/chucao/p-674c0f61.entry.js.map +1 -0
- package/dist/chucao/{p-c4b2bd1f.entry.js → p-67f0fc77.entry.js} +2 -2
- package/dist/chucao/{p-5240f5ac.entry.js → p-68e4a129.entry.js} +2 -2
- package/dist/chucao/{p-2e37c61b.entry.js → p-6e345b3f.entry.js} +2 -2
- package/dist/chucao/{p-f6ab0a11.entry.js → p-72d4dacf.entry.js} +2 -2
- package/dist/chucao/{p-8ae680a4.entry.js → p-74d9b7e5.entry.js} +2 -2
- package/dist/chucao/p-791ce537.entry.js +2 -0
- package/dist/chucao/p-791ce537.entry.js.map +1 -0
- package/dist/chucao/{p-c90da3c0.entry.js → p-79e8c10b.entry.js} +2 -2
- package/dist/chucao/{p-90284ebe.entry.js → p-7e13f725.entry.js} +2 -2
- package/dist/chucao/{p-9ebcc7be.entry.js → p-8b23d072.entry.js} +2 -2
- package/dist/chucao/{p-CIV5Gg1o.js → p-8l_6qAY9.js} +3 -3
- package/dist/chucao/p-8l_6qAY9.js.map +1 -0
- package/dist/chucao/{p-1e4cd3aa.entry.js → p-a5430e95.entry.js} +2 -2
- package/dist/chucao/{p-e77d35c3.entry.js → p-a7c66879.entry.js} +2 -2
- package/dist/chucao/p-b452d6cb.entry.js +2 -0
- package/dist/chucao/p-b7332faf.entry.js +2 -0
- package/dist/chucao/{p-60e1c1df.entry.js.map → p-b7332faf.entry.js.map} +1 -1
- package/dist/chucao/{p-42028c97.entry.js → p-f3d03388.entry.js} +2 -2
- package/dist/chucao/{p-7cdc71cc.entry.js → p-f925d45c.entry.js} +2 -2
- package/dist/cjs/ch-accordion.cjs.entry.js +2 -2
- package/dist/cjs/ch-alert_8.cjs.entry.js +8 -8
- package/dist/cjs/ch-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/ch-cluster.cjs.entry.js +3 -3
- package/dist/cjs/ch-combobox.cjs.entry.js +304 -0
- package/dist/cjs/ch-combobox.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-confirm-dialog.cjs.entry.js +138 -0
- package/dist/cjs/ch-confirm-dialog.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-description-list.cjs.entry.js +2 -2
- package/dist/cjs/ch-divider.cjs.entry.js +2 -2
- package/dist/cjs/ch-drawer.cjs.entry.js +2 -2
- package/dist/cjs/ch-emoji.cjs.entry.js +2 -2
- package/dist/cjs/ch-empty-state.cjs.entry.js +2 -2
- package/dist/cjs/ch-grid.cjs.entry.js +2 -2
- package/dist/cjs/ch-icon-button.cjs.entry.js +2 -2
- package/dist/cjs/ch-icon.cjs.entry.js +2 -2
- package/dist/cjs/ch-link.cjs.entry.js +1 -1
- package/dist/cjs/ch-modal.cjs.entry.js +2 -2
- package/dist/cjs/ch-number-input.cjs.entry.js +3 -3
- package/dist/cjs/ch-otp-input.cjs.entry.js +196 -0
- package/dist/cjs/ch-otp-input.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-page-header.cjs.entry.js +2 -2
- package/dist/cjs/ch-pagination.cjs.entry.js +67 -0
- package/dist/cjs/ch-pagination.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-radio.cjs.entry.js +2 -2
- package/dist/cjs/ch-segmented-control.cjs.entry.js +2 -2
- package/dist/cjs/ch-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/ch-stack.cjs.entry.js +2 -2
- package/dist/cjs/ch-stat.cjs.entry.js +3 -3
- package/dist/cjs/ch-table.cjs.entry.js +2 -2
- package/dist/cjs/ch-tabs.cjs.entry.js +2 -2
- package/dist/cjs/ch-textarea.cjs.entry.js +2 -2
- package/dist/cjs/ch-timeline.cjs.entry.js +2 -2
- package/dist/cjs/ch-tooltip.cjs.entry.js +3 -3
- package/dist/cjs/chucao.cjs.js +2 -2
- package/dist/cjs/{index-ByZY6aTj.js → index-C6khqyw3.js} +19 -2
- package/dist/cjs/index-C6khqyw3.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +4 -0
- package/dist/collection/components/ch-accordion/ch-accordion.js +1 -1
- package/dist/collection/components/ch-alert/ch-alert.js +1 -1
- package/dist/collection/components/ch-badge/ch-badge.js +1 -1
- package/dist/collection/components/ch-card/ch-card.js +1 -1
- package/dist/collection/components/ch-checkbox/ch-checkbox.js +1 -1
- package/dist/collection/components/ch-cluster/ch-cluster.js +2 -2
- package/dist/collection/components/ch-combobox/ch-combobox.css +153 -0
- package/dist/collection/components/ch-combobox/ch-combobox.js +577 -0
- package/dist/collection/components/ch-combobox/ch-combobox.js.map +1 -0
- package/dist/collection/components/ch-confirm-dialog/ch-confirm-dialog.css +71 -0
- package/dist/collection/components/ch-confirm-dialog/ch-confirm-dialog.js +382 -0
- package/dist/collection/components/ch-confirm-dialog/ch-confirm-dialog.js.map +1 -0
- package/dist/collection/components/ch-description-list/ch-description-list.js +1 -1
- package/dist/collection/components/ch-divider/ch-divider.js +1 -1
- package/dist/collection/components/ch-drawer/ch-drawer.js +1 -1
- package/dist/collection/components/ch-emoji/ch-emoji.js +1 -1
- package/dist/collection/components/ch-empty-state/ch-empty-state.js +1 -1
- package/dist/collection/components/ch-grid/ch-grid.js +1 -1
- package/dist/collection/components/ch-icon/ch-icon.js +1 -1
- package/dist/collection/components/ch-icon-button/ch-icon-button.js +1 -1
- package/dist/collection/components/ch-input/ch-input.js +1 -1
- package/dist/collection/components/ch-modal/ch-modal.js +1 -1
- package/dist/collection/components/ch-number-input/ch-number-input.js +2 -2
- package/dist/collection/components/ch-otp-input/ch-otp-input.css +86 -0
- package/dist/collection/components/ch-otp-input/ch-otp-input.js +478 -0
- package/dist/collection/components/ch-otp-input/ch-otp-input.js.map +1 -0
- package/dist/collection/components/ch-page-header/ch-page-header.js +1 -1
- package/dist/collection/components/ch-pagination/ch-pagination.css +63 -0
- package/dist/collection/components/ch-pagination/ch-pagination.js +228 -0
- package/dist/collection/components/ch-pagination/ch-pagination.js.map +1 -0
- package/dist/collection/components/ch-radio/ch-radio.js +1 -1
- package/dist/collection/components/ch-segmented-control/ch-segmented-control.js +1 -1
- package/dist/collection/components/ch-select/ch-select.js +1 -1
- package/dist/collection/components/ch-skeleton/ch-skeleton.js +1 -1
- package/dist/collection/components/ch-spinner/ch-spinner.js +1 -1
- package/dist/collection/components/ch-stack/ch-stack.js +1 -1
- package/dist/collection/components/ch-stat/ch-stat.js +2 -2
- package/dist/collection/components/ch-switch/ch-switch.js +1 -1
- package/dist/collection/components/ch-table/ch-table.js +1 -1
- package/dist/collection/components/ch-tabs/ch-tabs.js +1 -1
- package/dist/collection/components/ch-textarea/ch-textarea.js +1 -1
- package/dist/collection/components/ch-timeline/ch-timeline.js +1 -1
- package/dist/collection/components/ch-tooltip/ch-tooltip.js +2 -2
- package/dist/components/ch-accordion.js +1 -1
- package/dist/components/ch-alert.js +1 -1
- package/dist/components/ch-badge.js +1 -1
- package/dist/components/ch-button.js +1 -1
- package/dist/components/ch-card.js +1 -1
- package/dist/components/ch-checkbox.js +1 -1
- package/dist/components/ch-cluster.js +1 -1
- package/dist/components/ch-combobox.d.ts +11 -0
- package/dist/components/ch-combobox.js +2 -0
- package/dist/components/ch-combobox.js.map +1 -0
- package/dist/components/ch-confirm-dialog.d.ts +11 -0
- package/dist/components/ch-confirm-dialog.js +2 -0
- package/dist/components/ch-confirm-dialog.js.map +1 -0
- package/dist/components/ch-description-list.js +1 -1
- package/dist/components/ch-divider.js +1 -1
- package/dist/components/ch-drawer.js +1 -1
- package/dist/components/ch-emoji.js +1 -1
- package/dist/components/ch-empty-state.js +1 -1
- package/dist/components/ch-grid.js +1 -1
- package/dist/components/ch-icon-button.js +1 -1
- package/dist/components/ch-icon.js +1 -1
- package/dist/components/ch-input.js +1 -1
- package/dist/components/ch-modal.js +1 -1
- package/dist/components/ch-modal.js.map +1 -1
- package/dist/components/ch-number-input.js +1 -1
- package/dist/components/ch-otp-input.d.ts +11 -0
- package/dist/components/ch-otp-input.js +2 -0
- package/dist/components/ch-otp-input.js.map +1 -0
- package/dist/components/ch-page-header.js +1 -1
- package/dist/components/ch-pagination.d.ts +11 -0
- package/dist/components/ch-pagination.js +2 -0
- package/dist/components/ch-pagination.js.map +1 -0
- package/dist/components/ch-radio.js +1 -1
- package/dist/components/ch-segmented-control.js +1 -1
- package/dist/components/ch-select.js +1 -1
- package/dist/components/ch-skeleton.js +1 -1
- package/dist/components/ch-spinner.js +1 -1
- package/dist/components/ch-stack.js +1 -1
- package/dist/components/ch-stat.js +1 -1
- package/dist/components/ch-switch.js +1 -1
- package/dist/components/ch-table.js +1 -1
- package/dist/components/ch-tabs.js +1 -1
- package/dist/components/ch-textarea.js +1 -1
- package/dist/components/ch-timeline.js +1 -1
- package/dist/components/ch-tooltip.js +1 -1
- package/dist/components/{p-DiUN1WGc.js → p-CuSstsTP.js} +2 -2
- package/dist/components/p-MBLhKofG.js +2 -0
- package/dist/components/p-MBLhKofG.js.map +1 -0
- package/dist/components/p-qP_9qshx.js.map +1 -1
- package/dist/esm/ch-accordion.entry.js +2 -2
- package/dist/esm/ch-alert_8.entry.js +8 -8
- package/dist/esm/ch-checkbox.entry.js +2 -2
- package/dist/esm/ch-cluster.entry.js +3 -3
- package/dist/esm/ch-combobox.entry.js +302 -0
- package/dist/esm/ch-combobox.entry.js.map +1 -0
- package/dist/esm/ch-confirm-dialog.entry.js +136 -0
- package/dist/esm/ch-confirm-dialog.entry.js.map +1 -0
- package/dist/esm/ch-description-list.entry.js +2 -2
- package/dist/esm/ch-divider.entry.js +2 -2
- package/dist/esm/ch-drawer.entry.js +2 -2
- package/dist/esm/ch-emoji.entry.js +2 -2
- package/dist/esm/ch-empty-state.entry.js +2 -2
- package/dist/esm/ch-grid.entry.js +2 -2
- package/dist/esm/ch-icon-button.entry.js +2 -2
- package/dist/esm/ch-icon.entry.js +2 -2
- package/dist/esm/ch-link.entry.js +1 -1
- package/dist/esm/ch-modal.entry.js +2 -2
- package/dist/esm/ch-number-input.entry.js +3 -3
- package/dist/esm/ch-otp-input.entry.js +194 -0
- package/dist/esm/ch-otp-input.entry.js.map +1 -0
- package/dist/esm/ch-page-header.entry.js +2 -2
- package/dist/esm/ch-pagination.entry.js +65 -0
- package/dist/esm/ch-pagination.entry.js.map +1 -0
- package/dist/esm/ch-radio.entry.js +2 -2
- package/dist/esm/ch-segmented-control.entry.js +2 -2
- package/dist/esm/ch-skeleton.entry.js +2 -2
- package/dist/esm/ch-stack.entry.js +2 -2
- package/dist/esm/ch-stat.entry.js +3 -3
- package/dist/esm/ch-table.entry.js +2 -2
- package/dist/esm/ch-tabs.entry.js +2 -2
- package/dist/esm/ch-textarea.entry.js +2 -2
- package/dist/esm/ch-timeline.entry.js +2 -2
- package/dist/esm/ch-tooltip.entry.js +3 -3
- package/dist/esm/chucao.js +3 -3
- package/dist/esm/{index-CIV5Gg1o.js → index-8l_6qAY9.js} +19 -2
- package/dist/esm/index-8l_6qAY9.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/ch-combobox/ch-combobox.d.ts +98 -0
- package/dist/types/components/ch-confirm-dialog/ch-confirm-dialog.d.ts +81 -0
- package/dist/types/components/ch-otp-input/ch-otp-input.d.ts +79 -0
- package/dist/types/components/ch-pagination/ch-pagination.d.ts +44 -0
- package/dist/types/components.d.ts +757 -0
- package/dist-react/components.d.ts +27 -1
- package/dist-react/components.js +45 -0
- package/dist-react/components.ts +67 -1
- package/dist-vue/index.d.ts +4 -0
- package/dist-vue/index.js +67 -0
- package/dist-vue/index.ts +75 -0
- package/hydrate/index.js +855 -35
- package/hydrate/index.mjs +855 -35
- package/package.json +17 -1
- package/dist/chucao/p-60e1c1df.entry.js +0 -2
- package/dist/chucao/p-9db118d9.entry.js +0 -2
- package/dist/chucao/p-CIV5Gg1o.js.map +0 -1
- package/dist/chucao/p-deb2571b.entry.js +0 -2
- package/dist/cjs/index-ByZY6aTj.js.map +0 -1
- package/dist/esm/index-CIV5Gg1o.js.map +0 -1
- /package/dist/chucao/{p-01b6c7bf.entry.js.map → p-03acf096.entry.js.map} +0 -0
- /package/dist/chucao/{p-10f6801e.entry.js.map → p-0ce2b15d.entry.js.map} +0 -0
- /package/dist/chucao/{p-f917d34f.entry.js.map → p-12043dc1.entry.js.map} +0 -0
- /package/dist/chucao/{p-0c7f6f8d.entry.js.map → p-244d8e96.entry.js.map} +0 -0
- /package/dist/chucao/{p-a7c674b7.entry.js.map → p-29841714.entry.js.map} +0 -0
- /package/dist/chucao/{p-ffecdf25.entry.js.map → p-302ec527.entry.js.map} +0 -0
- /package/dist/chucao/{p-337d7f68.entry.js.map → p-51f6327c.entry.js.map} +0 -0
- /package/dist/chucao/{p-1b70e3f1.entry.js.map → p-5a62951e.entry.js.map} +0 -0
- /package/dist/chucao/{p-472ec451.entry.js.map → p-5d0ac17a.entry.js.map} +0 -0
- /package/dist/chucao/{p-d8b71751.entry.js.map → p-5e0e1012.entry.js.map} +0 -0
- /package/dist/chucao/{p-15d27bb7.entry.js.map → p-61a94a4e.entry.js.map} +0 -0
- /package/dist/chucao/{p-c4b2bd1f.entry.js.map → p-67f0fc77.entry.js.map} +0 -0
- /package/dist/chucao/{p-5240f5ac.entry.js.map → p-68e4a129.entry.js.map} +0 -0
- /package/dist/chucao/{p-2e37c61b.entry.js.map → p-6e345b3f.entry.js.map} +0 -0
- /package/dist/chucao/{p-f6ab0a11.entry.js.map → p-72d4dacf.entry.js.map} +0 -0
- /package/dist/chucao/{p-8ae680a4.entry.js.map → p-74d9b7e5.entry.js.map} +0 -0
- /package/dist/chucao/{p-c90da3c0.entry.js.map → p-79e8c10b.entry.js.map} +0 -0
- /package/dist/chucao/{p-90284ebe.entry.js.map → p-7e13f725.entry.js.map} +0 -0
- /package/dist/chucao/{p-9ebcc7be.entry.js.map → p-8b23d072.entry.js.map} +0 -0
- /package/dist/chucao/{p-1e4cd3aa.entry.js.map → p-a5430e95.entry.js.map} +0 -0
- /package/dist/chucao/{p-e77d35c3.entry.js.map → p-a7c66879.entry.js.map} +0 -0
- /package/dist/chucao/{p-9db118d9.entry.js.map → p-b452d6cb.entry.js.map} +0 -0
- /package/dist/chucao/{p-42028c97.entry.js.map → p-f3d03388.entry.js.map} +0 -0
- /package/dist/chucao/{p-7cdc71cc.entry.js.map → p-f925d45c.entry.js.map} +0 -0
- /package/dist/components/{p-DiUN1WGc.js.map → p-CuSstsTP.js.map} +0 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, a as getElement, h, H as Host } from './index-8l_6qAY9.js';
|
|
2
|
+
|
|
3
|
+
const chConfirmDialogCss = () => `:host{display:contents;font-family:var(--typography-body)}.confirm__heading{margin:0;font-family:var(--typography-heading);font-size:var(--typography-size-lg);font-weight:var(--typography-weight-semibold);color:var(--color-text-primary)}.confirm__message{margin:0;font-size:var(--typography-size-sm);color:var(--color-text-secondary);overflow-wrap:break-word}.confirm__actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--spacing-md);margin-top:var(--spacing-2xl)}.confirm__button{display:inline-flex;align-items:center;justify-content:center;min-height:2.25rem;padding:0 var(--spacing-lg);border:var(--border-width) solid var(--color-border-default);border-radius:var(--radius-sm);background:var(--color-surface-default);color:var(--color-text-primary);font-family:var(--typography-body);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);cursor:pointer}.confirm__button:focus-visible{outline:2px solid var(--color-accent-default);outline-offset:2px}.confirm__button:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.confirm__button--confirm{border-color:var(--color-accent-default);background:var(--color-accent-default);color:var(--color-accent-text)}.confirm__button--danger{border-color:var(--color-status-warning);background:var(--color-status-warning);color:var(--color-text-primary)}.confirm__button--danger::before{content:'⚠';margin-right:var(--spacing-xs)}`;
|
|
4
|
+
|
|
5
|
+
const ChConfirmDialog = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.chConfirm = createEvent(this, "chConfirm");
|
|
9
|
+
this.chCancel = createEvent(this, "chCancel");
|
|
10
|
+
}
|
|
11
|
+
get el() { return getElement(this); }
|
|
12
|
+
/** Whether the dialog is open. Kept in sync when it is dismissed. */
|
|
13
|
+
open = false;
|
|
14
|
+
/**
|
|
15
|
+
* The question, set as the dialog's accessible name. Required: a dialog
|
|
16
|
+
* without a name is announced as an unlabelled group.
|
|
17
|
+
*/
|
|
18
|
+
heading;
|
|
19
|
+
/** Supporting text, rendered under the heading. */
|
|
20
|
+
message;
|
|
21
|
+
/** Label of the confirming action. */
|
|
22
|
+
confirmLabel = 'Confirm';
|
|
23
|
+
/** Label of the dismissing action. */
|
|
24
|
+
cancelLabel = 'Cancel';
|
|
25
|
+
/**
|
|
26
|
+
* `danger` styles the confirm action as destructive and moves the initial
|
|
27
|
+
* focus to Cancel, so the safe choice is the default one.
|
|
28
|
+
*/
|
|
29
|
+
tone = 'default';
|
|
30
|
+
/** Whether the confirm action is in flight; both buttons are then disabled. */
|
|
31
|
+
pending = false;
|
|
32
|
+
/**
|
|
33
|
+
* Whether Escape and the backdrop dismiss the dialog. When false, the only
|
|
34
|
+
* way out is one of the two buttons — use it only for a decision that must
|
|
35
|
+
* be answered rather than abandoned.
|
|
36
|
+
*/
|
|
37
|
+
dismissible = true;
|
|
38
|
+
/** Emitted once when the user confirms. */
|
|
39
|
+
chConfirm;
|
|
40
|
+
/** Emitted once when the dialog is dismissed without confirming. */
|
|
41
|
+
chCancel;
|
|
42
|
+
/** `true` once an outcome has been emitted for the current opening. */
|
|
43
|
+
settled = false;
|
|
44
|
+
cancelButton;
|
|
45
|
+
confirmButton;
|
|
46
|
+
componentDidLoad() {
|
|
47
|
+
if (this.open) {
|
|
48
|
+
this.onOpening();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
handleOpenChange(open) {
|
|
52
|
+
if (open) {
|
|
53
|
+
this.onOpening();
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
this.settled = false;
|
|
57
|
+
}
|
|
58
|
+
onOpening() {
|
|
59
|
+
this.settled = false;
|
|
60
|
+
// Focus is moved once the dialog is actually shown; the modal handles
|
|
61
|
+
// moving focus into itself, and this refines where it lands.
|
|
62
|
+
requestAnimationFrame(() => {
|
|
63
|
+
const target = this.tone === 'danger' ? this.cancelButton : this.confirmButton;
|
|
64
|
+
target?.focus();
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
settle(outcome) {
|
|
68
|
+
if (this.settled) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
this.settled = true;
|
|
72
|
+
if (outcome === 'confirm') {
|
|
73
|
+
this.chConfirm.emit();
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
this.chCancel.emit();
|
|
77
|
+
}
|
|
78
|
+
handleConfirm = () => {
|
|
79
|
+
if (this.pending) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
this.settle('confirm');
|
|
83
|
+
};
|
|
84
|
+
handleCancel = () => {
|
|
85
|
+
if (this.pending) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
this.open = false;
|
|
89
|
+
this.settle('cancel');
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* `ch-modal` reports every close that was not requested by the consumer —
|
|
93
|
+
* Escape and the backdrop. A close while `pending` is the consumer's own
|
|
94
|
+
* doing and is not a cancellation.
|
|
95
|
+
*/
|
|
96
|
+
handleModalClose = () => {
|
|
97
|
+
this.open = false;
|
|
98
|
+
if (this.pending) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
this.settle('cancel');
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Escape is a platform close request on the inner `<dialog>`, so a
|
|
105
|
+
* non-dismissible dialog cancels it before it takes effect. The backdrop is
|
|
106
|
+
* handled by `ch-modal` and is suppressed the same way.
|
|
107
|
+
*/
|
|
108
|
+
handleKeyDown = (event) => {
|
|
109
|
+
if (this.dismissible || event.key !== 'Escape') {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
event.preventDefault();
|
|
113
|
+
event.stopPropagation();
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Focus the safe action. Exposed so a consumer can return focus deliberately
|
|
117
|
+
* after a request settles.
|
|
118
|
+
*/
|
|
119
|
+
async focusCancel() {
|
|
120
|
+
this.cancelButton?.focus();
|
|
121
|
+
}
|
|
122
|
+
render() {
|
|
123
|
+
return (h(Host, { key: 'b51a806f4cca331fc3a95421d3342608c6e0df4c', onKeyDown: this.handleKeyDown }, h("ch-modal", { key: '453db02cd724bc9bf2ed7c4b61bcf04c77b8d449', open: this.open, label: this.heading, size: "sm", onChClose: this.handleModalClose, onChOpen: () => this.onOpening() }, h("h2", { key: '1dee8f11ee68679792c394506ab2e8a7f98b852b', slot: "heading", class: "confirm__heading" }, this.heading), this.message && h("p", { key: 'f2a8a473acfcdfee51600a0dc7bc47b85f4a0889', class: "confirm__message" }, this.message), h("div", { key: '7ecfa78e4df217e38519f115fdcb4761ed88937d', class: "confirm__actions" }, h("button", { key: '0c4a117caee9ef316932e2eea9c0aa3734f0bbee', class: { 'confirm__button': true, 'confirm__button--cancel': true }, type: "button", ref: el => (this.cancelButton = el), disabled: this.pending, onClick: this.handleCancel }, this.cancelLabel), h("button", { key: 'd33fd5f6f218bfcd39f179e29d757f7f9bdcae30', class: { 'confirm__button': true, 'confirm__button--confirm': true, 'confirm__button--danger': this.tone === 'danger' }, type: "button", ref: el => (this.confirmButton = el), disabled: this.pending, "aria-busy": this.pending ? 'true' : undefined, onClick: this.handleConfirm }, this.confirmLabel)))));
|
|
124
|
+
}
|
|
125
|
+
static get watchers() { return {
|
|
126
|
+
"open": [{
|
|
127
|
+
"handleOpenChange": 0
|
|
128
|
+
}]
|
|
129
|
+
}; }
|
|
130
|
+
};
|
|
131
|
+
ChConfirmDialog.style = chConfirmDialogCss();
|
|
132
|
+
|
|
133
|
+
export { ChConfirmDialog as ch_confirm_dialog };
|
|
134
|
+
//# sourceMappingURL=ch-confirm-dialog.entry.js.map
|
|
135
|
+
|
|
136
|
+
//# sourceMappingURL=ch-confirm-dialog.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ch-confirm-dialog.entry.js","sources":["src/components/ch-confirm-dialog/ch-confirm-dialog.css?tag=ch-confirm-dialog&encapsulation=shadow","src/components/ch-confirm-dialog/ch-confirm-dialog.tsx"],"sourcesContent":[":host {\n display: contents;\n font-family: var(--typography-body);\n}\n\n.confirm__heading {\n margin: 0;\n font-family: var(--typography-heading);\n font-size: var(--typography-size-lg);\n font-weight: var(--typography-weight-semibold);\n color: var(--color-text-primary);\n}\n\n.confirm__message {\n margin: 0;\n font-size: var(--typography-size-sm);\n color: var(--color-text-secondary);\n overflow-wrap: break-word;\n}\n\n.confirm__actions {\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-end;\n gap: var(--spacing-md);\n margin-top: var(--spacing-2xl);\n}\n\n.confirm__button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-height: 2.25rem;\n padding: 0 var(--spacing-lg);\n border: var(--border-width) solid var(--color-border-default);\n border-radius: var(--radius-sm);\n background: var(--color-surface-default);\n color: var(--color-text-primary);\n font-family: var(--typography-body);\n font-size: var(--typography-size-sm);\n font-weight: var(--typography-weight-semibold);\n cursor: pointer;\n}\n\n.confirm__button:focus-visible {\n outline: 2px solid var(--color-accent-default);\n outline-offset: 2px;\n}\n\n.confirm__button:disabled {\n opacity: var(--opacity-disabled);\n cursor: not-allowed;\n}\n\n.confirm__button--confirm {\n border-color: var(--color-accent-default);\n background: var(--color-accent-default);\n color: var(--color-accent-text);\n}\n\n/* Destructive intent is carried by weight and iconography as well as colour. */\n.confirm__button--danger {\n border-color: var(--color-status-warning);\n background: var(--color-status-warning);\n color: var(--color-text-primary);\n}\n\n.confirm__button--danger::before {\n content: '⚠';\n margin-right: var(--spacing-xs);\n}\n","import { Component, Element, Event, type EventEmitter, Host, Method, Prop, State, Watch, h } from '@stencil/core';\n\nexport type ChConfirmDialogTone = 'default' | 'danger';\n\n/**\n * A confirmation dialog over `ch-modal`.\n *\n * Declarative only: the consumer opens it with `open` and handles the outcome.\n * The imperative `confirm()` helper is a separate concern and a separate issue,\n * because a promise-returning helper has to own mounting, focus and unhandled\n * rejection, none of which a component should decide for its consumer.\n *\n * The guarantees this adds over a plain `ch-modal` are the ones that make a\n * confirmation safe:\n *\n * - exactly one outcome per interaction — a double click on Confirm emits once;\n * - every dismissal path (Cancel, Escape, backdrop, confirm) is reported, so a\n * consumer awaiting an answer cannot hang;\n * - focus lands on Cancel for a destructive action, so the absent-minded Enter\n * does not destroy anything;\n * - `pending` is not a cancellation: a slow request keeps the dialog open.\n */\n@Component({\n tag: 'ch-confirm-dialog',\n styleUrl: 'ch-confirm-dialog.css',\n shadow: true,\n})\nexport class ChConfirmDialog {\n @Element() el: HTMLElement;\n\n /** Whether the dialog is open. Kept in sync when it is dismissed. */\n @Prop({ mutable: true }) open = false;\n\n /**\n * The question, set as the dialog's accessible name. Required: a dialog\n * without a name is announced as an unlabelled group.\n */\n @Prop() heading!: string;\n\n /** Supporting text, rendered under the heading. */\n @Prop() message?: string;\n\n /** Label of the confirming action. */\n @Prop() confirmLabel = 'Confirm';\n\n /** Label of the dismissing action. */\n @Prop() cancelLabel = 'Cancel';\n\n /**\n * `danger` styles the confirm action as destructive and moves the initial\n * focus to Cancel, so the safe choice is the default one.\n */\n @Prop() tone: ChConfirmDialogTone = 'default';\n\n /** Whether the confirm action is in flight; both buttons are then disabled. */\n @Prop() pending = false;\n\n /**\n * Whether Escape and the backdrop dismiss the dialog. When false, the only\n * way out is one of the two buttons — use it only for a decision that must\n * be answered rather than abandoned.\n */\n @Prop() dismissible = true;\n\n /** Emitted once when the user confirms. */\n @Event() chConfirm: EventEmitter<void>;\n\n /** Emitted once when the dialog is dismissed without confirming. */\n @Event() chCancel: EventEmitter<void>;\n\n /** `true` once an outcome has been emitted for the current opening. */\n @State() private settled = false;\n\n private cancelButton?: HTMLButtonElement;\n private confirmButton?: HTMLButtonElement;\n\n componentDidLoad() {\n if (this.open) {\n this.onOpening();\n }\n }\n\n @Watch('open')\n handleOpenChange(open: boolean) {\n if (open) {\n this.onOpening();\n return;\n }\n this.settled = false;\n }\n\n private onOpening() {\n this.settled = false;\n // Focus is moved once the dialog is actually shown; the modal handles\n // moving focus into itself, and this refines where it lands.\n requestAnimationFrame(() => {\n const target = this.tone === 'danger' ? this.cancelButton : this.confirmButton;\n target?.focus();\n });\n }\n\n private settle(outcome: 'confirm' | 'cancel') {\n if (this.settled) {\n return;\n }\n this.settled = true;\n if (outcome === 'confirm') {\n this.chConfirm.emit();\n return;\n }\n this.chCancel.emit();\n }\n\n private handleConfirm = () => {\n if (this.pending) {\n return;\n }\n this.settle('confirm');\n };\n\n private handleCancel = () => {\n if (this.pending) {\n return;\n }\n this.open = false;\n this.settle('cancel');\n };\n\n /**\n * `ch-modal` reports every close that was not requested by the consumer —\n * Escape and the backdrop. A close while `pending` is the consumer's own\n * doing and is not a cancellation.\n */\n private handleModalClose = () => {\n this.open = false;\n if (this.pending) {\n return;\n }\n this.settle('cancel');\n };\n\n /**\n * Escape is a platform close request on the inner `<dialog>`, so a\n * non-dismissible dialog cancels it before it takes effect. The backdrop is\n * handled by `ch-modal` and is suppressed the same way.\n */\n private handleKeyDown = (event: KeyboardEvent) => {\n if (this.dismissible || event.key !== 'Escape') {\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n };\n\n /**\n * Focus the safe action. Exposed so a consumer can return focus deliberately\n * after a request settles.\n */\n @Method()\n async focusCancel(): Promise<void> {\n this.cancelButton?.focus();\n }\n\n render() {\n return (\n <Host onKeyDown={this.handleKeyDown}>\n <ch-modal open={this.open} label={this.heading} size=\"sm\" onChClose={this.handleModalClose} onChOpen={() => this.onOpening()}>\n <h2 slot=\"heading\" class=\"confirm__heading\">\n {this.heading}\n </h2>\n {this.message && <p class=\"confirm__message\">{this.message}</p>}\n <div class=\"confirm__actions\">\n <button\n class={{ 'confirm__button': true, 'confirm__button--cancel': true }}\n type=\"button\"\n ref={el => (this.cancelButton = el as HTMLButtonElement)}\n disabled={this.pending}\n onClick={this.handleCancel}\n >\n {this.cancelLabel}\n </button>\n <button\n class={{ 'confirm__button': true, 'confirm__button--confirm': true, 'confirm__button--danger': this.tone === 'danger' }}\n type=\"button\"\n ref={el => (this.confirmButton = el as HTMLButtonElement)}\n disabled={this.pending}\n aria-busy={this.pending ? 'true' : undefined}\n onClick={this.handleConfirm}\n >\n {this.confirmLabel}\n </button>\n </div>\n </ch-modal>\n </Host>\n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|
2
2
|
|
|
3
3
|
const chDescriptionListCss = () => `:host{display:block;font-family:var(--typography-body);color:var(--color-text-secondary)}:host([hidden]){display:none}.list{margin:0;display:grid;grid-template-columns:repeat(1, minmax(0, 1fr));gap:var(--spacing-sm) var(--spacing-2xl)}.list--columns-2,.list--columns-3{grid-template-columns:repeat(2, minmax(0, 1fr))}.list--columns-3{grid-template-columns:repeat(3, minmax(0, 1fr))}@media (max-width: 48rem){.list--columns-2,.list--columns-3{grid-template-columns:minmax(0, 1fr)}}::slotted(div){display:grid;grid-template-columns:fit-content(min(12rem, 40%)) minmax(0, 1fr);gap:var(--spacing-sm);align-items:baseline}::slotted(dt){font-family:var(--typography-heading);font-weight:var(--typography-weight-semibold);font-size:var(--typography-size-sm);color:var(--color-text-primary)}::slotted(dd){margin:0;font-size:var(--typography-size-sm);min-width:0;overflow-wrap:break-word}`;
|
|
4
4
|
|
|
@@ -16,7 +16,7 @@ const ChDescriptionList = class {
|
|
|
16
16
|
return COLUMNS.has(this.columns) ? this.columns : '1';
|
|
17
17
|
}
|
|
18
18
|
render() {
|
|
19
|
-
return (h(Host, { key: '
|
|
19
|
+
return (h(Host, { key: '1fd1228705a78196b618efc4b9665de038663ae5' }, h("dl", { key: '0b724aa3c5dec011106347d9d29d0420f723012f', class: `list list--columns-${this.columnCount}` }, h("slot", { key: '4da2c6965568cf7d2f93ee98e131a7bede26d5dc' }))));
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
ChDescriptionList.style = chDescriptionListCss();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './index-8l_6qAY9.js';
|
|
2
2
|
|
|
3
3
|
const chDividerCss = () => `:host{display:block}:host(.divider--vertical){display:inline-block;height:100%;align-self:stretch}.divider{margin:0;border:none;background:var(--border)}.divider--horizontal{width:100%;height:var(--border-width)}.divider--vertical{width:var(--border-width);height:100%}`;
|
|
4
4
|
|
|
@@ -11,7 +11,7 @@ const ChDivider = class {
|
|
|
11
11
|
*/
|
|
12
12
|
orientation = 'horizontal';
|
|
13
13
|
render() {
|
|
14
|
-
return (h(Host, { key: '
|
|
14
|
+
return (h(Host, { key: 'cc193b7e7229de8ff96eb056bd345cc8d666004b', class: { 'divider--vertical': this.orientation === 'vertical' } }, h("hr", { key: '659320c0372d208aab9b13d471427e479499a72c', class: { divider: true, [`divider--${this.orientation}`]: true }, "aria-orientation": this.orientation })));
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
17
|
ChDivider.style = chDividerCss();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, a as getElement, h, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, a as getElement, h, H as Host } from './index-8l_6qAY9.js';
|
|
2
2
|
import { l as lockScroll, u as unlockScroll } from './scroll-lock-d8DfpzMR.js';
|
|
3
3
|
|
|
4
4
|
const chDrawerCss = () => `.drawer{position:fixed;inset:0;margin:0;box-sizing:border-box;flex-direction:column;gap:var(--spacing-2xl);width:min(24rem, 100vw);height:100vh;height:100dvh;max-width:100vw;max-height:100dvh;padding:var(--spacing-5xl);border:var(--border-width) solid var(--border);border-radius:0;background:var(--color-background-base);color:var(--text);font-family:var(--font-body);font-size:var(--typography-size-md);overflow:hidden}.drawer[open]{display:flex}.drawer--start{inset:0 auto 0 0;border-inline-start:none;animation:drawer-in-start var(--duration-normal) var(--easing-default)}.drawer--end{inset:0 0 0 auto;border-inline-end:none;animation:drawer-in-end var(--duration-normal) var(--easing-default)}.drawer--top{inset:0 0 auto 0;width:100vw;height:auto;max-height:80dvh;border-block-start:none;animation:drawer-in-top var(--duration-normal) var(--easing-default)}.drawer--bottom{inset:auto 0 0 0;width:100vw;height:auto;max-height:80dvh;border-block-end:none;animation:drawer-in-bottom var(--duration-normal) var(--easing-default)}.drawer::backdrop{background:var(--color-scrim-default);backdrop-filter:blur(var(--effect-blur))}.drawer-head{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--spacing-2xl);flex:none}.drawer-body{flex:1;min-height:0;overflow-y:auto}::slotted([slot='footer']){display:flex;align-items:center;justify-content:flex-end;gap:var(--spacing-md);flex:none;padding-top:var(--spacing-2xl);border-top:var(--border-width) solid var(--border)}.drawer-close{display:inline-flex;align-items:center;justify-content:center;flex:none;padding:var(--spacing-2xs) var(--spacing-md);border:0;border-radius:var(--radius);background:none;color:var(--text-muted);cursor:pointer;font-family:var(--font-heading);font-size:var(--typography-size-lg);line-height:1;transition:background-color var(--duration-normal) var(--easing-default)}.drawer-close:hover{background:var(--surface-hover);color:var(--text)}.drawer-close:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}@keyframes drawer-in-start{from{transform:translateX(-100%)}}@keyframes drawer-in-end{from{transform:translateX(100%)}}@keyframes drawer-in-top{from{transform:translateY(-100%)}}@keyframes drawer-in-bottom{from{transform:translateY(100%)}}@media (pointer: coarse){.drawer-close{min-width:44px;min-height:44px}}@media (prefers-reduced-motion: reduce){.drawer{animation:none}.drawer-close{transition:none}}`;
|
|
@@ -136,7 +136,7 @@ const ChDrawer = class {
|
|
|
136
136
|
this.chClose.emit();
|
|
137
137
|
};
|
|
138
138
|
render() {
|
|
139
|
-
return (h(Host, { key: '
|
|
139
|
+
return (h(Host, { key: '1a51b3f19b956fe860fe4def9f2ac23eac7f86ac' }, h("dialog", { key: 'ad7366eb2e6274962faa2a1564a06ecc3268329c', class: { drawer: true, [`drawer--${this.side}`]: true }, "aria-label": this.label, ref: el => (this.dialog = el) }, h("div", { key: 'ce532be71c35234f1713051e5669f1cf9316031e', class: "drawer-head" }, h("slot", { key: 'b522a8f26dddefd2aaf146134ac24e026a5eb72a', name: "header" }), this.closeLabel && (h("button", { key: 'b51fb4e20797cd82661c72c9250b0875338180f0', class: "drawer-close", type: "button", "aria-label": this.closeLabel, onClick: this.handleCloseClick }, h("span", { key: 'dd21e30fcb74f08c80b1c2ba79696e1d54bf4c26', "aria-hidden": "true" }, "\u00D7")))), h("div", { key: 'eacafa24e5af7c107e09a7cbfdfc93ae6f373dc5', class: "drawer-body" }, h("slot", { key: 'ddf9370c27956bc2954a3af29064394d37ec5e67' })), h("slot", { key: '0065c8f5bafb14791e63d15bbec0ec2ba533c222', name: "footer" }))));
|
|
140
140
|
}
|
|
141
141
|
static get watchers() { return {
|
|
142
142
|
"open": [{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './index-8l_6qAY9.js';
|
|
2
2
|
|
|
3
3
|
const aaaa = "aaaa";
|
|
4
4
|
const ameno = "ameno";
|
|
@@ -82,7 +82,7 @@ const ChEmoji = class {
|
|
|
82
82
|
this.loaded = true;
|
|
83
83
|
};
|
|
84
84
|
render() {
|
|
85
|
-
return (h(Host, { key: '
|
|
85
|
+
return (h(Host, { key: 'd6e224a01b95fdebb4525b30b326585ee96e1050' }, h("img", { key: '6bc232d8f25e0099c9e2794f15b8e47f6c2dbb22', class: {
|
|
86
86
|
'emoji': true,
|
|
87
87
|
[`emoji--${this.size}`]: true,
|
|
88
88
|
'emoji--hidden': !this.loaded,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './index-8l_6qAY9.js';
|
|
2
2
|
|
|
3
3
|
const chEmptyStateCss = () => `:host{display:block;font-family:var(--typography-body);color:var(--color-text-secondary);text-align:center}:host([hidden]){display:none}.empty-state__inner{display:flex;flex-direction:column;align-items:center;gap:var(--spacing-sm);padding:var(--spacing-6xl) var(--spacing-2xl);border:var(--border-width) dashed var(--color-border-default);border-radius:var(--radius-md);background:var(--color-surface-default)}.empty-state--sm .empty-state__inner{padding:var(--spacing-3xl) var(--spacing-xl);gap:var(--spacing-xs)}.empty-state__icon{display:contents;font-size:var(--typography-size-xl);line-height:1}.empty-state__icon:empty{display:none}.empty-state__title{margin:0;font-family:var(--typography-heading);font-size:var(--typography-size-md);font-weight:var(--typography-weight-semibold);color:var(--color-text-primary)}.empty-state--md .empty-state__title{font-size:var(--typography-size-lg)}.empty-state__description{margin:0;max-width:36ch;font-size:var(--typography-size-sm);line-height:1.5}.empty-state__actions:empty{display:none}.empty-state__actions{display:flex;flex-wrap:wrap;gap:var(--spacing-sm);justify-content:center;margin-top:var(--spacing-xs)}`;
|
|
4
4
|
|
|
@@ -21,7 +21,7 @@ const ChEmptyState = class {
|
|
|
21
21
|
*/
|
|
22
22
|
size = 'md';
|
|
23
23
|
render() {
|
|
24
|
-
return (h(Host, { key: '
|
|
24
|
+
return (h(Host, { key: '15a171d5e6128b278078f3564fe27a75f2d3638f', class: { 'empty-state': true, [`empty-state--${this.size}`]: true } }, h("div", { key: '959baade697f5817d46fe2ef1e08b31d1f14168d', class: "empty-state__inner" }, h("div", { key: 'c97f9d6405da2d81e538701c48e12acbb6bbbd76', class: "empty-state__icon", "aria-hidden": "true" }, h("slot", { key: 'abb50aae0a68ff11b5042a51cdb8d7f69d965ae8', name: "icon" })), h("h3", { key: '2049c3cb4714b642670ba283f8c3c9e3e1ba6ae4', class: "empty-state__title" }, this.title), this.description && h("p", { key: 'b74601952c870aab10345c7bdc856dc779396645', class: "empty-state__description" }, this.description), h("div", { key: 'c72be9f5a4f40113d1c6df1d62c9b617e8dcb407', class: "empty-state__actions" }, h("slot", { key: 'c998904407c1cf174921873e3d547c2056f3d1b5' })))));
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
ChEmptyState.style = chEmptyStateCss();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, a as getElement, h, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, a as getElement, h, H as Host } from './index-8l_6qAY9.js';
|
|
2
2
|
|
|
3
3
|
const chGridCss = () => `:host{display:grid;grid-template-columns:var(--ch-grid-columns, repeat(auto-fit, minmax(min(16rem, 100%), 1fr)));box-sizing:border-box}:host([hidden]){display:none}.grid--gap-none{gap:0}.grid--gap-2xs{gap:var(--spacing-2xs)}.grid--gap-xs{gap:var(--spacing-xs)}.grid--gap-sm{gap:var(--spacing-sm)}.grid--gap-md{gap:var(--spacing-md)}.grid--gap-lg{gap:var(--spacing-lg)}.grid--gap-xl{gap:var(--spacing-xl)}.grid--gap-2xl{gap:var(--spacing-2xl)}.grid--gap-3xl{gap:var(--spacing-3xl)}.grid--gap-4xl{gap:var(--spacing-4xl)}.grid--gap-5xl{gap:var(--spacing-5xl)}.grid--gap-6xl{gap:var(--spacing-6xl)}`;
|
|
4
4
|
|
|
@@ -46,7 +46,7 @@ const ChGrid = class {
|
|
|
46
46
|
this.el.style.setProperty('--ch-grid-columns', template);
|
|
47
47
|
}
|
|
48
48
|
render() {
|
|
49
|
-
return (h(Host, { key: '
|
|
49
|
+
return (h(Host, { key: '4fbcd3b5e563ebf0f5b2878ef6af0cb2d1c0f427', class: { grid: true, [`grid--gap-${this.gapStep}`]: true } }, h("slot", { key: '4fe1548392ab44de9dd895129d77f20650a0d929' })));
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
52
|
ChGrid.style = chGridCss();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-8l_6qAY9.js';
|
|
2
2
|
import { c as chIcons } from './icons-CnivhwvG.js';
|
|
3
3
|
|
|
4
4
|
const chIconButtonCss = () => `:host{display:inline-block}.button{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;border:var(--border-width) solid var(--border);border-radius:var(--radius-pill);background:transparent;color:var(--text);cursor:pointer;transition:background-color var(--duration-normal) var(--easing-default), border-color var(--duration-normal) var(--easing-default), color var(--duration-normal) var(--easing-default)}.button--sm{width:calc(var(--icon-size-sm) + 2 * var(--spacing-md));height:calc(var(--icon-size-sm) + 2 * var(--spacing-md))}.button--md{width:calc(var(--icon-size-md) + 2 * var(--spacing-xl));height:calc(var(--icon-size-md) + 2 * var(--spacing-xl))}.button--lg{width:calc(var(--icon-size-lg) + 2 * var(--spacing-2xl));height:calc(var(--icon-size-lg) + 2 * var(--spacing-2xl))}.button--sm .icon{width:var(--icon-size-sm);height:var(--icon-size-sm)}.button--md .icon{width:var(--icon-size-md);height:var(--icon-size-md)}.button--lg .icon{width:var(--icon-size-lg);height:var(--icon-size-lg)}.button:hover:not([aria-disabled='true']){border-color:var(--border-hover);background:var(--surface-hover)}.button:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.button[aria-disabled='true']{opacity:var(--opacity-disabled);cursor:not-allowed}.button[aria-busy='true']{cursor:progress}.button[aria-busy='true'] .icon{animation:ch-icon-button-spin var(--duration-spin) linear infinite}@keyframes ch-icon-button-spin{to{transform:rotate(360deg)}}@media (pointer: coarse){.button--sm{min-width:44px;min-height:44px}}@media (prefers-reduced-motion: reduce){.button{transition:none}.button[aria-busy='true'] .icon{animation:none}}`;
|
|
@@ -38,7 +38,7 @@ const ChIconButton = class {
|
|
|
38
38
|
};
|
|
39
39
|
render() {
|
|
40
40
|
const shapes = this.name ? chIcons[this.name] : undefined;
|
|
41
|
-
return (h(Host, { key: '
|
|
41
|
+
return (h(Host, { key: '585bbba80a0811664fcc2fa8fd625cd8655e3395' }, h("button", { key: 'd817e9eda842b824a052be9b822c860b9417ddd4', class: `button button--${this.size}`, type: this.type, "aria-label": this.label, "aria-busy": this.loading ? 'true' : undefined, "aria-disabled": this.disabled ? 'true' : undefined, onClick: this.handleClick }, h("svg", { key: '2f0278d9f551da6b526c3fe5a6680cd38080502e', class: "icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", focusable: "false" }, (shapes ?? []).map(shape => h(shape.tag, shape.attrs))))));
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
ChIconButton.style = chIconButtonCss();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './index-8l_6qAY9.js';
|
|
2
2
|
import { c as chIcons } from './icons-CnivhwvG.js';
|
|
3
3
|
|
|
4
4
|
const chIconCss = () => `:host{display:inline-flex;line-height:0}.icon{display:block;flex:none;color:inherit}.icon--sm{width:var(--icon-size-sm);height:var(--icon-size-sm)}.icon--md{width:var(--icon-size-md);height:var(--icon-size-md)}.icon--lg{width:var(--icon-size-lg);height:var(--icon-size-lg)}`;
|
|
@@ -25,7 +25,7 @@ const ChIcon = class {
|
|
|
25
25
|
render() {
|
|
26
26
|
const shapes = this.name ? chIcons[this.name] : undefined;
|
|
27
27
|
const decorative = !this.label;
|
|
28
|
-
return (h(Host, { key: '
|
|
28
|
+
return (h(Host, { key: 'c55af60731d59ee48bfb2566f498c5675c36cb04' }, h("svg", { key: '65334ba063c059ef2a505c7ea34859d1d1971f01', class: `icon icon--${this.size}`, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", role: decorative ? undefined : 'img', "aria-label": this.label, "aria-hidden": decorative ? 'true' : undefined, focusable: "false" }, (shapes ?? []).map(shape => h(shape.tag, shape.attrs)))));
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
ChIcon.style = chIconCss();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-8l_6qAY9.js';
|
|
2
2
|
|
|
3
3
|
const chLinkCss = () => `:host{display:inline}.link{color:var(--accent);font-weight:var(--typography-weight-semibold);text-decoration:var(--ch-link-text-decoration, underline);text-decoration-thickness:var(--border-width);text-underline-offset:var(--spacing-shift);border-radius:var(--radius-sm);transition:color var(--duration-normal) var(--easing-default), opacity var(--duration-normal) var(--easing-default)}.link:hover{color:var(--accent-hover)}.link:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.link--muted{color:var(--text-muted);text-decoration:none}.link--muted:hover{color:var(--text)}.link--disabled{color:var(--text-muted);text-decoration:none;opacity:var(--opacity-disabled);cursor:not-allowed}`;
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, a as getElement, h, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, a as getElement, h, H as Host } from './index-8l_6qAY9.js';
|
|
2
2
|
import { l as lockScroll, u as unlockScroll } from './scroll-lock-d8DfpzMR.js';
|
|
3
3
|
|
|
4
4
|
const chModalCss = () => `.modal{box-sizing:border-box;max-height:calc(100vh - var(--spacing-6xl));padding:var(--spacing-5xl);border:var(--border-width) solid var(--border);border-radius:var(--radius);background:var(--color-background-base);color:var(--text);font-family:var(--font-body);font-size:var(--typography-size-md)}.modal--sm{max-width:min(var(--ch-modal-width, 24rem), calc(100vw - var(--spacing-6xl)))}.modal--md{max-width:min(var(--ch-modal-width, 32rem), calc(100vw - var(--spacing-6xl)))}.modal--lg{max-width:min(var(--ch-modal-width, 48rem), calc(100vw - var(--spacing-6xl)))}.modal::backdrop{background:var(--color-scrim-default);backdrop-filter:blur(var(--effect-blur))}.modal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--spacing-2xl);margin-bottom:var(--spacing-2xl)}.modal-body{overflow-y:auto}.modal-close{display:inline-flex;align-items:center;justify-content:center;flex:none;padding:var(--spacing-2xs) var(--spacing-md);border:0;border-radius:var(--radius);background:none;color:var(--text-muted);cursor:pointer;font-family:var(--font-heading);font-size:var(--typography-size-lg);line-height:1;transition:background-color var(--duration-normal) var(--easing-default)}.modal-close:hover{background:var(--surface-hover);color:var(--text)}.modal-close:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}@media (pointer: coarse){.modal-close{min-width:44px;min-height:44px}}@media (prefers-reduced-motion: reduce){.modal-close{transition:none}}`;
|
|
@@ -138,7 +138,7 @@ const ChModal = class {
|
|
|
138
138
|
this.chClose.emit();
|
|
139
139
|
};
|
|
140
140
|
render() {
|
|
141
|
-
return (h(Host, { key: '
|
|
141
|
+
return (h(Host, { key: '36395dc0b52676493b93d02c04d1c810d98c8028' }, h("dialog", { key: '99d446c5d0ecd9e16f8d36fc2903f1ab06c274f2', class: { modal: true, [`modal--${this.size}`]: true }, "aria-label": this.label, ref: el => (this.dialog = el) }, h("div", { key: '9dd7043302df7ffa89fdb44f54ed5c93a48fff7e', class: "modal-head" }, h("slot", { key: '473041c868d2234c66276936cde0d020b8ed74ce', name: "heading" }), this.closeLabel && (h("button", { key: 'e3f65a8c91283b8f3a27975afe44e47e65fbf03f', class: "modal-close", type: "button", "aria-label": this.closeLabel, onClick: this.handleCloseClick }, h("span", { key: 'dbacf11f6b06ed4183e6d277fc807d63867fdf1d', "aria-hidden": "true" }, "\u00D7")))), h("div", { key: '1d9e1567fe0046078f1d26f5dea25c3c06c7e6ed', class: "modal-body" }, h("slot", { key: 'cc0a63c64b512a6c40c59d8395ced225a961adfc' })))));
|
|
142
142
|
}
|
|
143
143
|
static get watchers() { return {
|
|
144
144
|
"open": [{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, a as getElement, h, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, a as getElement, h, H as Host } from './index-8l_6qAY9.js';
|
|
2
2
|
import { r as resolveValidity } from './validation-message-BXzZsX2r.js';
|
|
3
3
|
|
|
4
4
|
const chNumberInputCss = () => `:host{display:inline-block;width:100%}.label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.input{box-sizing:border-box;width:100%;padding:var(--spacing-xl) var(--spacing-3xl);border-radius:var(--radius);border:var(--border-width) solid var(--border);background:var(--surface);color:var(--text);backdrop-filter:blur(var(--effect-blur));font-family:inherit;font-size:inherit;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.input::placeholder{color:var(--text-muted)}.input:focus{border-color:var(--accent);box-shadow:var(--shadow-focus-ring);outline:none}.input--invalid{border-color:var(--color-status-warning)}.input--invalid:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}:host([data-touched]:invalid) .input,:host(:user-invalid) .input{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .input:focus,:host(:user-invalid) .input:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}.input:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;
|
|
@@ -203,10 +203,10 @@ const ChNumberInput = class {
|
|
|
203
203
|
}
|
|
204
204
|
render() {
|
|
205
205
|
const showError = this.isInvalid && this.errorMessage;
|
|
206
|
-
return (h(Host, { key: '
|
|
206
|
+
return (h(Host, { key: '0265106cccf730338541d292be247b7853ab00cf' }, this.label && (h("label", { key: '17293d5cc55a8d4de0cd544ea1f508d1ed820b12', class: "label", htmlFor: this.inputId }, this.label)), h("input", { key: 'ce17dc7c0f5c1064d8535aef942e486a46b72188', id: this.label ? this.inputId : undefined, class: { 'input': true, 'input--invalid': this.isInvalid },
|
|
207
207
|
// `text` with `inputmode`, not `type="number"`: a number input drops
|
|
208
208
|
// partial values and cannot show grouped digits.
|
|
209
|
-
type: "text", inputMode: this.decimals ? 'decimal' : 'numeric', name: this.name, placeholder: this.placeholder, disabled: this.disabled || this.formDisabled, required: this.required, value: this.typing ? this.draft : this.formatDisplay(this.value), "aria-invalid": this.isInvalid ? 'true' : undefined, "aria-describedby": this.describedBy, onInput: this.handleInput, onChange: this.handleChange, onBlur: this.handleBlur }), this.hint && !showError && (h("p", { key: '
|
|
209
|
+
type: "text", inputMode: this.decimals ? 'decimal' : 'numeric', name: this.name, placeholder: this.placeholder, disabled: this.disabled || this.formDisabled, required: this.required, value: this.typing ? this.draft : this.formatDisplay(this.value), "aria-invalid": this.isInvalid ? 'true' : undefined, "aria-describedby": this.describedBy, onInput: this.handleInput, onChange: this.handleChange, onBlur: this.handleBlur }), this.hint && !showError && (h("p", { key: '37611a7755f6885e6f87a600b1a27cc5edd5fefd', class: "hint", id: this.hintId }, this.hint)), showError && (h("p", { key: '68b8c5b964a2a98df493103b1fde088aeefda769', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
210
210
|
}
|
|
211
211
|
static get formAssociated() { return true; }
|
|
212
212
|
static get watchers() { return {
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, a as getElement, h, H as Host } from './index-8l_6qAY9.js';
|
|
2
|
+
import { r as resolveValidity } from './validation-message-BXzZsX2r.js';
|
|
3
|
+
|
|
4
|
+
const chOtpInputCss = () => `:host{display:inline-block;width:100%}.label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.input{box-sizing:border-box;width:100%;padding:var(--spacing-xl) var(--spacing-3xl);border-radius:var(--radius);border:var(--border-width) solid var(--border);background:var(--surface);color:var(--text);backdrop-filter:blur(var(--effect-blur));font-family:inherit;font-size:inherit;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.input::placeholder{color:var(--text-muted)}.input:focus{border-color:var(--accent);box-shadow:var(--shadow-focus-ring);outline:none}.input--invalid{border-color:var(--color-status-warning)}.input--invalid:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}:host([data-touched]:invalid) .input,:host(:user-invalid) .input{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .input:focus,:host(:user-invalid) .input:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}.input:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}.input{font-family:var(--typography-heading);font-size:var(--typography-size-lg);letter-spacing:0.4em;text-align:center;font-variant-numeric:tabular-nums}`;
|
|
5
|
+
|
|
6
|
+
let otpIds = 0;
|
|
7
|
+
const ChOtpInput = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
registerInstance(this, hostRef);
|
|
10
|
+
this.chInput = createEvent(this, "chInput");
|
|
11
|
+
this.chComplete = createEvent(this, "chComplete");
|
|
12
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
13
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
17
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
inputId = `ch-otp-input-${++otpIds}`;
|
|
21
|
+
hintId = `${this.inputId}-hint`;
|
|
22
|
+
errorId = `${this.inputId}-error`;
|
|
23
|
+
initialValue = '';
|
|
24
|
+
internals;
|
|
25
|
+
formDisabled = false;
|
|
26
|
+
get host() { return getElement(this); }
|
|
27
|
+
/** Visible label, associated with the input via `for`/`id`. */
|
|
28
|
+
label;
|
|
29
|
+
/** The code without separators. Filtered to alphanumerics on every change. */
|
|
30
|
+
value = '';
|
|
31
|
+
/** How many characters make a complete code. */
|
|
32
|
+
length = 6;
|
|
33
|
+
/**
|
|
34
|
+
* `numeric` restricts input to digits, which is the shape of nearly every
|
|
35
|
+
* one-time code and lets a phone open the number pad.
|
|
36
|
+
*/
|
|
37
|
+
inputMode = 'numeric';
|
|
38
|
+
/** Whether the codes are masked, as for a short-lived secret. */
|
|
39
|
+
secret = false;
|
|
40
|
+
/** Placeholder shown when empty. */
|
|
41
|
+
placeholder;
|
|
42
|
+
/** Name submitted with the form. */
|
|
43
|
+
name;
|
|
44
|
+
/** Whether the field is disabled. */
|
|
45
|
+
disabled = false;
|
|
46
|
+
/** Whether a complete code is required for the field to be valid. */
|
|
47
|
+
required = false;
|
|
48
|
+
/** Helper text, replaced by `errorMessage` when invalid. */
|
|
49
|
+
hint;
|
|
50
|
+
/** Custom error message; wins over the built-in incomplete-code message. */
|
|
51
|
+
errorMessage;
|
|
52
|
+
/** Whether the field is marked invalid by the consumer. */
|
|
53
|
+
invalid = false;
|
|
54
|
+
/** Emitted on every change with the current (possibly partial) code. */
|
|
55
|
+
chInput;
|
|
56
|
+
/**
|
|
57
|
+
* Emitted once, when the code becomes complete and valid after not being so.
|
|
58
|
+
* Never fires again while it stays complete, so holding a code cannot
|
|
59
|
+
* resubmit it.
|
|
60
|
+
*/
|
|
61
|
+
chComplete;
|
|
62
|
+
wasComplete = false;
|
|
63
|
+
componentDidLoad() {
|
|
64
|
+
this.initialValue = this.value;
|
|
65
|
+
this.wasComplete = this.isComplete;
|
|
66
|
+
this.syncForm();
|
|
67
|
+
this.host.addEventListener('focusout', this.markTouched);
|
|
68
|
+
this.host.addEventListener('invalid', this.markTouched);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Leaving the field is what turns an unfinished code into an error. The
|
|
72
|
+
* validity has to be recomputed here: `syncForm` reads the attribute, and
|
|
73
|
+
* setting it alone would not update `ElementInternals`.
|
|
74
|
+
*/
|
|
75
|
+
markTouched = () => {
|
|
76
|
+
this.host.setAttribute('data-touched', '');
|
|
77
|
+
this.syncForm();
|
|
78
|
+
};
|
|
79
|
+
/** Whether the value is a complete, correctly shaped code. */
|
|
80
|
+
get isComplete() {
|
|
81
|
+
if (this.value.length !== this.length) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
return this.inputMode === 'numeric' ? /^\d+$/u.test(this.value) : /^[a-z0-9]+$/iu.test(this.value);
|
|
85
|
+
}
|
|
86
|
+
/** The message for an incomplete code, which is what makes it invalid. */
|
|
87
|
+
get incompleteMessage() {
|
|
88
|
+
if (this.errorMessage || this.invalid || this.value === '') {
|
|
89
|
+
return undefined;
|
|
90
|
+
}
|
|
91
|
+
return this.isComplete ? undefined : `Enter the ${this.length}-character code.`;
|
|
92
|
+
}
|
|
93
|
+
syncForm() {
|
|
94
|
+
const internals = this.internals;
|
|
95
|
+
if (typeof internals?.setFormValue !== 'function') {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
internals.setFormValue(this.value);
|
|
99
|
+
const empty = this.value === '';
|
|
100
|
+
const base = resolveValidity({ required: this.required, empty, invalid: this.invalid, errorMessage: this.errorMessage });
|
|
101
|
+
// A partially typed code is what the user is doing, not an error, unless
|
|
102
|
+
// they have already left the field once.
|
|
103
|
+
const touched = this.host.hasAttribute('data-touched');
|
|
104
|
+
const incomplete = this.incompleteMessage;
|
|
105
|
+
if (incomplete && touched && !empty) {
|
|
106
|
+
internals.setValidity({ ...base.flags, customError: true }, incomplete);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
internals.setValidity(base.flags, base.message);
|
|
110
|
+
}
|
|
111
|
+
formResetCallback() {
|
|
112
|
+
this.value = this.initialValue;
|
|
113
|
+
this.wasComplete = this.isComplete;
|
|
114
|
+
this.syncForm();
|
|
115
|
+
const input = this.host.shadowRoot?.querySelector('input');
|
|
116
|
+
if (input) {
|
|
117
|
+
input.value = this.value;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
formDisabledCallback(isDisabled) {
|
|
121
|
+
this.formDisabled = isDisabled;
|
|
122
|
+
}
|
|
123
|
+
/** Strips everything the input mode does not allow, then caps the length. */
|
|
124
|
+
sanitize(raw) {
|
|
125
|
+
const allowed = this.inputMode === 'numeric' ? raw.replace(/\D/gu, '') : raw.replace(/[^a-z0-9]/giu, '');
|
|
126
|
+
return allowed.slice(0, Math.max(1, this.length));
|
|
127
|
+
}
|
|
128
|
+
handleInput = (ev) => {
|
|
129
|
+
const input = ev.target;
|
|
130
|
+
const clean = this.sanitize(input.value);
|
|
131
|
+
// The element holds the raw text, so a rejected character has to be
|
|
132
|
+
// written back or it stays visible while the value says otherwise.
|
|
133
|
+
if (input.value !== clean) {
|
|
134
|
+
input.value = clean;
|
|
135
|
+
}
|
|
136
|
+
this.value = clean;
|
|
137
|
+
this.chInput.emit(clean);
|
|
138
|
+
const complete = this.isComplete;
|
|
139
|
+
if (complete && !this.wasComplete) {
|
|
140
|
+
this.chComplete.emit(clean);
|
|
141
|
+
}
|
|
142
|
+
this.wasComplete = complete;
|
|
143
|
+
this.syncForm();
|
|
144
|
+
};
|
|
145
|
+
handleBlur = () => {
|
|
146
|
+
this.syncForm();
|
|
147
|
+
};
|
|
148
|
+
get isInvalid() {
|
|
149
|
+
return this.invalid || (this.host.hasAttribute('data-touched') && this.incompleteMessage !== undefined);
|
|
150
|
+
}
|
|
151
|
+
get describedBy() {
|
|
152
|
+
if (this.isInvalid && this.errorMessage) {
|
|
153
|
+
return this.errorId;
|
|
154
|
+
}
|
|
155
|
+
if (this.hint) {
|
|
156
|
+
return this.hintId;
|
|
157
|
+
}
|
|
158
|
+
return undefined;
|
|
159
|
+
}
|
|
160
|
+
render() {
|
|
161
|
+
const showError = this.isInvalid && this.errorMessage;
|
|
162
|
+
return (h(Host, { key: '1ce9d8e77463ecb270b870461ef96f8e84f418df' }, this.label && (h("label", { key: 'd19c88141314b68912c91af235d45eceaa12555b', class: "label", htmlFor: this.inputId }, this.label)), h("input", { key: 'e2e93f1672fa753b3b20bc032abc6e375591cf3f', id: this.label ? this.inputId : undefined, class: { 'input': true, 'input--invalid': this.isInvalid }, type: this.secret ? 'password' : 'text', inputMode: this.inputMode,
|
|
163
|
+
// The platform fills a single field carrying this attribute; per-digit
|
|
164
|
+
// inputs never receive the SMS code.
|
|
165
|
+
autocomplete: "one-time-code", autocapitalize: this.inputMode === 'text' ? 'characters' : 'off', spellcheck: false, name: this.name, placeholder: this.placeholder, maxLength: this.length, disabled: this.disabled || this.formDisabled, required: this.required, value: this.value, "aria-invalid": this.isInvalid ? 'true' : undefined, "aria-describedby": this.describedBy, onInput: this.handleInput, onBlur: this.handleBlur }), this.hint && !showError && (h("p", { key: 'f02aa008051c1c0d64bba7045fb72d8c89ebaddd', class: "hint", id: this.hintId }, this.hint)), showError && (h("p", { key: 'ff9dc44ff5de84fd100fe617677ad18ab898fe1e', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
166
|
+
}
|
|
167
|
+
static get formAssociated() { return true; }
|
|
168
|
+
static get watchers() { return {
|
|
169
|
+
"value": [{
|
|
170
|
+
"syncForm": 0
|
|
171
|
+
}],
|
|
172
|
+
"required": [{
|
|
173
|
+
"syncForm": 0
|
|
174
|
+
}],
|
|
175
|
+
"invalid": [{
|
|
176
|
+
"syncForm": 0
|
|
177
|
+
}],
|
|
178
|
+
"errorMessage": [{
|
|
179
|
+
"syncForm": 0
|
|
180
|
+
}],
|
|
181
|
+
"length": [{
|
|
182
|
+
"syncForm": 0
|
|
183
|
+
}],
|
|
184
|
+
"inputMode": [{
|
|
185
|
+
"syncForm": 0
|
|
186
|
+
}]
|
|
187
|
+
}; }
|
|
188
|
+
};
|
|
189
|
+
ChOtpInput.style = chOtpInputCss();
|
|
190
|
+
|
|
191
|
+
export { ChOtpInput as ch_otp_input };
|
|
192
|
+
//# sourceMappingURL=ch-otp-input.entry.js.map
|
|
193
|
+
|
|
194
|
+
//# sourceMappingURL=ch-otp-input.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ch-otp-input.entry.js","sources":["src/components/ch-otp-input/ch-otp-input.css?tag=ch-otp-input&encapsulation=shadow","src/components/ch-otp-input/ch-otp-input.tsx"],"sourcesContent":[":host {\n display: inline-block;\n width: 100%;\n}\n\n.label {\n display: block;\n margin-bottom: var(--spacing-sm);\n font-size: var(--typography-size-sm);\n font-weight: var(--typography-weight-semibold);\n color: var(--text);\n}\n\n.input {\n box-sizing: border-box;\n width: 100%;\n padding: var(--spacing-xl) var(--spacing-3xl);\n border-radius: var(--radius);\n border: var(--border-width) solid var(--border);\n background: var(--surface);\n color: var(--text);\n backdrop-filter: blur(var(--effect-blur));\n font-family: inherit;\n font-size: inherit;\n transition:\n border-color var(--duration-normal) var(--easing-default),\n box-shadow var(--duration-normal) var(--easing-default);\n}\n\n.input::placeholder {\n color: var(--text-muted);\n}\n\n.input:focus {\n border-color: var(--accent);\n box-shadow: var(--shadow-focus-ring);\n outline: none;\n}\n\n.input--invalid {\n border-color: var(--color-status-warning);\n}\n\n.input--invalid:focus {\n border-color: var(--color-status-warning);\n box-shadow: 0 0 0 3px var(--color-status-warning-background);\n}\n\n:host([data-touched]:invalid) .input,\n:host(:user-invalid) .input {\n border-color: var(--color-status-warning);\n}\n\n:host([data-touched]:invalid) .input:focus,\n:host(:user-invalid) .input:focus {\n border-color: var(--color-status-warning);\n box-shadow: 0 0 0 3px var(--color-status-warning-background);\n}\n\n.input:disabled {\n opacity: var(--opacity-disabled);\n cursor: not-allowed;\n}\n\n.hint,\n.error {\n margin: var(--spacing-sm) 0 0;\n font-size: var(--typography-size-sm);\n color: var(--text-muted);\n}\n\n.error {\n color: var(--color-status-warning);\n}\n\n/*\n * One field, segmented by letter-spacing rather than by separate boxes: the\n * value stays a single string the platform can autofill and people can paste.\n */\n.input {\n font-family: var(--typography-heading);\n font-size: var(--typography-size-lg);\n letter-spacing: 0.4em;\n text-align: center;\n font-variant-numeric: tabular-nums;\n}\n","import { AttachInternals, Component, Element, Event, type EventEmitter, Host, Prop, State, Watch, h } from '@stencil/core';\n\nimport { resolveValidity } from '../../utils/validation-message';\n\nlet otpIds = 0;\n\n/**\n * One-time-code input.\n *\n * One native `<input>` holds the whole code, not a box per digit. Per-digit\n * inputs break paste, break SMS autofill (the platform fills a single field\n * carrying `autocomplete=\"one-time-code\"`), and give a keyboard user several\n * tab stops for what is one value. The segmented look is drawn by the shadow\n * CSS over the single field.\n *\n * It never submits on completion: a code entered is not a decision to send it,\n * so the consumer listens to `chComplete` and submits when it decides to.\n */\n@Component({\n tag: 'ch-otp-input',\n styleUrl: 'ch-otp-input.css',\n shadow: true,\n formAssociated: true,\n})\nexport class ChOtpInput {\n private readonly inputId = `ch-otp-input-${++otpIds}`;\n private readonly hintId = `${this.inputId}-hint`;\n private readonly errorId = `${this.inputId}-error`;\n private initialValue = '';\n\n @AttachInternals() internals!: ElementInternals;\n @State() formDisabled = false;\n @Element() private host!: HTMLElement;\n\n /** Visible label, associated with the input via `for`/`id`. */\n @Prop() label?: string;\n\n /** The code without separators. Filtered to alphanumerics on every change. */\n @Prop({ mutable: true }) value = '';\n\n /** How many characters make a complete code. */\n @Prop() length = 6;\n\n /**\n * `numeric` restricts input to digits, which is the shape of nearly every\n * one-time code and lets a phone open the number pad.\n */\n @Prop() inputMode: 'numeric' | 'text' = 'numeric';\n\n /** Whether the codes are masked, as for a short-lived secret. */\n @Prop() secret = false;\n\n /** Placeholder shown when empty. */\n @Prop() placeholder?: string;\n\n /** Name submitted with the form. */\n @Prop({ reflect: true }) name?: string;\n\n /** Whether the field is disabled. */\n @Prop({ reflect: true }) disabled = false;\n\n /** Whether a complete code is required for the field to be valid. */\n @Prop({ reflect: true }) required = false;\n\n /** Helper text, replaced by `errorMessage` when invalid. */\n @Prop() hint?: string;\n\n /** Custom error message; wins over the built-in incomplete-code message. */\n @Prop() errorMessage?: string;\n\n /** Whether the field is marked invalid by the consumer. */\n @Prop() invalid = false;\n\n /** Emitted on every change with the current (possibly partial) code. */\n @Event() chInput: EventEmitter<string>;\n\n /**\n * Emitted once, when the code becomes complete and valid after not being so.\n * Never fires again while it stays complete, so holding a code cannot\n * resubmit it.\n */\n @Event() chComplete: EventEmitter<string>;\n\n private wasComplete = false;\n\n componentDidLoad() {\n this.initialValue = this.value;\n this.wasComplete = this.isComplete;\n this.syncForm();\n this.host.addEventListener('focusout', this.markTouched);\n this.host.addEventListener('invalid', this.markTouched);\n }\n\n /**\n * Leaving the field is what turns an unfinished code into an error. The\n * validity has to be recomputed here: `syncForm` reads the attribute, and\n * setting it alone would not update `ElementInternals`.\n */\n private markTouched = (): void => {\n this.host.setAttribute('data-touched', '');\n this.syncForm();\n };\n\n /** Whether the value is a complete, correctly shaped code. */\n private get isComplete(): boolean {\n if (this.value.length !== this.length) {\n return false;\n }\n return this.inputMode === 'numeric' ? /^\\d+$/u.test(this.value) : /^[a-z0-9]+$/iu.test(this.value);\n }\n\n /** The message for an incomplete code, which is what makes it invalid. */\n private get incompleteMessage(): string | undefined {\n if (this.errorMessage || this.invalid || this.value === '') {\n return undefined;\n }\n return this.isComplete ? undefined : `Enter the ${this.length}-character code.`;\n }\n\n @Watch('value')\n @Watch('required')\n @Watch('invalid')\n @Watch('errorMessage')\n @Watch('length')\n @Watch('inputMode')\n protected syncForm(): void {\n const internals = this.internals;\n if (typeof internals?.setFormValue !== 'function') {\n return;\n }\n internals.setFormValue(this.value);\n\n const empty = this.value === '';\n const base = resolveValidity({ required: this.required, empty, invalid: this.invalid, errorMessage: this.errorMessage });\n\n // A partially typed code is what the user is doing, not an error, unless\n // they have already left the field once.\n const touched = this.host.hasAttribute('data-touched');\n const incomplete = this.incompleteMessage;\n if (incomplete && touched && !empty) {\n internals.setValidity({ ...base.flags, customError: true }, incomplete);\n return;\n }\n internals.setValidity(base.flags, base.message);\n }\n\n formResetCallback(): void {\n this.value = this.initialValue;\n this.wasComplete = this.isComplete;\n this.syncForm();\n const input = this.host.shadowRoot?.querySelector('input');\n if (input) {\n input.value = this.value;\n }\n }\n\n formDisabledCallback(isDisabled: boolean): void {\n this.formDisabled = isDisabled;\n }\n\n /** Strips everything the input mode does not allow, then caps the length. */\n private sanitize(raw: string): string {\n const allowed = this.inputMode === 'numeric' ? raw.replace(/\\D/gu, '') : raw.replace(/[^a-z0-9]/giu, '');\n return allowed.slice(0, Math.max(1, this.length));\n }\n\n private handleInput = (ev: InputEvent) => {\n const input = ev.target as HTMLInputElement;\n const clean = this.sanitize(input.value);\n // The element holds the raw text, so a rejected character has to be\n // written back or it stays visible while the value says otherwise.\n if (input.value !== clean) {\n input.value = clean;\n }\n this.value = clean;\n this.chInput.emit(clean);\n\n const complete = this.isComplete;\n if (complete && !this.wasComplete) {\n this.chComplete.emit(clean);\n }\n this.wasComplete = complete;\n this.syncForm();\n };\n\n private handleBlur = () => {\n this.syncForm();\n };\n\n private get isInvalid(): boolean {\n return this.invalid || (this.host.hasAttribute('data-touched') && this.incompleteMessage !== undefined);\n }\n\n private get describedBy(): string | undefined {\n if (this.isInvalid && this.errorMessage) {\n return this.errorId;\n }\n if (this.hint) {\n return this.hintId;\n }\n return undefined;\n }\n\n render() {\n const showError = this.isInvalid && this.errorMessage;\n return (\n <Host>\n {this.label && (\n <label class=\"label\" htmlFor={this.inputId}>\n {this.label}\n </label>\n )}\n <input\n id={this.label ? this.inputId : undefined}\n class={{ 'input': true, 'input--invalid': this.isInvalid }}\n type={this.secret ? 'password' : 'text'}\n inputMode={this.inputMode}\n // The platform fills a single field carrying this attribute; per-digit\n // inputs never receive the SMS code.\n autocomplete=\"one-time-code\"\n autocapitalize={this.inputMode === 'text' ? 'characters' : 'off'}\n spellcheck={false}\n name={this.name}\n placeholder={this.placeholder}\n maxLength={this.length}\n disabled={this.disabled || this.formDisabled}\n required={this.required}\n value={this.value}\n aria-invalid={this.isInvalid ? 'true' : undefined}\n aria-describedby={this.describedBy}\n onInput={this.handleInput}\n onBlur={this.handleBlur}\n />\n {this.hint && !showError && (\n <p class=\"hint\" id={this.hintId}>\n {this.hint}\n </p>\n )}\n {showError && (\n <p class=\"error\" id={this.errorId} role=\"alert\">\n {this.errorMessage}\n </p>\n )}\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;;AAAA,MAAM,aAAa,GAAG,MAAM,CAAC,6hDAA6hD,CAAC;;ACI3jD,IAAI,MAAM,GAAG,CAAC;MAoBD,UAAU,GAAA,MAAA;;;;;;;;;;;;;AACJ,IAAA,OAAO,GAAG,CAAA,aAAA,EAAgB,EAAE,MAAM,EAAE;AACpC,IAAA,MAAM,GAAG,CAAA,EAAG,IAA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