@devschile/chucao 2.3.0 → 2.5.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/README.md +17 -16
- package/dist/chucao/chucao.css +1 -1
- package/dist/chucao/chucao.esm.js +1 -1
- package/dist/chucao/chucao.esm.js.map +1 -1
- package/dist/chucao/index.esm.js +1 -1
- package/dist/chucao/index.esm.js.map +1 -1
- package/dist/chucao/p-0bc141a2.entry.js +2 -0
- package/dist/chucao/p-0bc141a2.entry.js.map +1 -0
- package/dist/chucao/p-0e044eff.entry.js +2 -0
- package/dist/chucao/p-0e044eff.entry.js.map +1 -0
- package/dist/chucao/{p-ff5f5c1f.entry.js → p-1108062e.entry.js} +2 -2
- package/dist/chucao/p-26e144ff.entry.js +2 -0
- package/dist/chucao/p-26e144ff.entry.js.map +1 -0
- package/dist/chucao/p-2c681cc0.entry.js +2 -0
- package/dist/chucao/p-2c681cc0.entry.js.map +1 -0
- package/dist/chucao/p-2e785177.entry.js +2 -0
- package/dist/chucao/p-2e785177.entry.js.map +1 -0
- package/dist/chucao/{p-04dbcfa0.entry.js → p-337d7f68.entry.js} +2 -2
- package/dist/chucao/p-350f974d.entry.js +2 -0
- package/dist/chucao/p-350f974d.entry.js.map +1 -0
- package/dist/chucao/p-4846cac4.entry.js +2 -0
- package/dist/chucao/p-6345c9e1.entry.js +2 -0
- package/dist/chucao/p-6345c9e1.entry.js.map +1 -0
- package/dist/chucao/p-957acf39.entry.js +2 -0
- package/dist/chucao/p-957acf39.entry.js.map +1 -0
- package/dist/chucao/p-97655c41.entry.js +2 -0
- package/dist/chucao/p-97655c41.entry.js.map +1 -0
- package/dist/chucao/{p-6a4bc80c.entry.js → p-9f73855e.entry.js} +2 -2
- package/dist/chucao/p-BXzZsX2r.js +2 -0
- package/dist/chucao/p-BXzZsX2r.js.map +1 -0
- package/dist/chucao/p-CIV5Gg1o.js +3 -0
- package/dist/chucao/p-CIV5Gg1o.js.map +1 -0
- package/dist/chucao/p-CnivhwvG.js +2 -0
- package/dist/chucao/p-CnivhwvG.js.map +1 -0
- package/dist/chucao/p-b53d954e.entry.js +2 -0
- package/dist/chucao/p-b53d954e.entry.js.map +1 -0
- package/dist/chucao/{p-c986036f.entry.js → p-b6cc08f0.entry.js} +2 -2
- package/dist/chucao/p-be7b5c21.entry.js +2 -0
- package/dist/chucao/p-be7b5c21.entry.js.map +1 -0
- package/dist/chucao/p-c165f839.entry.js +2 -0
- package/dist/chucao/p-c165f839.entry.js.map +1 -0
- package/dist/chucao/p-c251b0d1.entry.js +2 -0
- package/dist/chucao/p-c251b0d1.entry.js.map +1 -0
- package/dist/chucao/p-f5b74bca.entry.js +2 -0
- package/dist/chucao/p-f5b74bca.entry.js.map +1 -0
- package/dist/chucao/p-f9fe752c.entry.js +2 -0
- package/dist/chucao/p-f9fe752c.entry.js.map +1 -0
- package/dist/chucao/p-fdf065e6.entry.js +2 -0
- package/dist/chucao/p-fdf065e6.entry.js.map +1 -0
- package/dist/cjs/ch-accordion.cjs.entry.js +1 -1
- package/dist/cjs/ch-alert_8.cjs.entry.js +69 -38
- package/dist/cjs/ch-alert_8.cjs.entry.js.map +1 -1
- package/dist/cjs/ch-checkbox.cjs.entry.js +9 -11
- package/dist/cjs/ch-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/ch-cluster.cjs.entry.js +47 -0
- package/dist/cjs/ch-cluster.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-divider.cjs.entry.js +2 -2
- package/dist/cjs/ch-drawer.cjs.entry.js +4 -3
- package/dist/cjs/ch-drawer.cjs.entry.js.map +1 -1
- package/dist/cjs/ch-emoji.cjs.entry.js +2 -2
- package/dist/cjs/ch-empty-state.cjs.entry.js +34 -0
- package/dist/cjs/ch-empty-state.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-grid.cjs.entry.js +59 -0
- package/dist/cjs/ch-grid.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-icon-button.cjs.entry.js +51 -0
- package/dist/cjs/ch-icon-button.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-icon.cjs.entry.js +38 -0
- package/dist/cjs/ch-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-link.cjs.entry.js +1 -1
- package/dist/cjs/ch-modal.cjs.entry.js +4 -3
- package/dist/cjs/ch-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/ch-page-header.cjs.entry.js +45 -0
- package/dist/cjs/ch-page-header.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-radio.cjs.entry.js +9 -11
- package/dist/cjs/ch-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/ch-segmented-control.cjs.entry.js +8 -7
- package/dist/cjs/ch-segmented-control.cjs.entry.js.map +1 -1
- package/dist/cjs/ch-skeleton.cjs.entry.js +58 -0
- package/dist/cjs/ch-skeleton.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-stack.cjs.entry.js +37 -0
- package/dist/cjs/ch-stack.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-tabs.cjs.entry.js +2 -2
- package/dist/cjs/ch-textarea.cjs.entry.js +9 -11
- package/dist/cjs/ch-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/ch-tooltip.cjs.entry.js +204 -5
- package/dist/cjs/ch-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/chucao.cjs.js +3 -3
- package/dist/cjs/chucao.cjs.js.map +1 -1
- package/dist/cjs/icons-CNyDgV-q.js +88 -0
- package/dist/cjs/icons-CNyDgV-q.js.map +1 -0
- package/dist/cjs/{index-C9cpLteP.js → index-ByZY6aTj.js} +119 -16
- package/dist/cjs/index-ByZY6aTj.js.map +1 -0
- package/dist/cjs/index.cjs.js +16 -0
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/validation-message-bbtJ2sa_.js +26 -0
- package/dist/cjs/validation-message-bbtJ2sa_.js.map +1 -0
- package/dist/collection/collection-manifest.json +9 -1
- package/dist/collection/components/ch-alert/ch-alert.css +13 -0
- package/dist/collection/components/ch-alert/ch-alert.js +44 -1
- package/dist/collection/components/ch-alert/ch-alert.js.map +1 -1
- package/dist/collection/components/ch-badge/ch-badge.css +30 -1
- package/dist/collection/components/ch-badge/ch-badge.js +35 -1
- package/dist/collection/components/ch-badge/ch-badge.js.map +1 -1
- package/dist/collection/components/ch-button/ch-button.js +9 -2
- package/dist/collection/components/ch-button/ch-button.js.map +1 -1
- package/dist/collection/components/ch-card/ch-card.js +1 -1
- package/dist/collection/components/ch-checkbox/ch-checkbox.js +8 -10
- package/dist/collection/components/ch-checkbox/ch-checkbox.js.map +1 -1
- package/dist/collection/components/ch-cluster/ch-cluster.css +93 -0
- package/dist/collection/components/ch-cluster/ch-cluster.js +152 -0
- package/dist/collection/components/ch-cluster/ch-cluster.js.map +1 -0
- package/dist/collection/components/ch-divider/ch-divider.js +1 -1
- package/dist/collection/components/ch-drawer/ch-drawer.js +9 -3
- package/dist/collection/components/ch-drawer/ch-drawer.js.map +1 -1
- package/dist/collection/components/ch-emoji/ch-emoji.js +1 -1
- package/dist/collection/components/ch-empty-state/ch-empty-state.css +67 -0
- package/dist/collection/components/ch-empty-state/ch-empty-state.js +108 -0
- package/dist/collection/components/ch-empty-state/ch-empty-state.js.map +1 -0
- package/dist/collection/components/ch-grid/ch-grid.css +47 -0
- package/dist/collection/components/ch-grid/ch-grid.js +137 -0
- package/dist/collection/components/ch-grid/ch-grid.js.map +1 -0
- package/dist/collection/components/ch-icon/ch-icon.css +25 -0
- package/dist/collection/components/ch-icon/ch-icon.js +121 -0
- package/dist/collection/components/ch-icon/ch-icon.js.map +1 -0
- package/dist/collection/components/ch-icon-button/ch-icon-button.css +99 -0
- package/dist/collection/components/ch-icon-button/ch-icon-button.js +216 -0
- package/dist/collection/components/ch-icon-button/ch-icon-button.js.map +1 -0
- package/dist/collection/components/ch-input/ch-input.js +8 -10
- package/dist/collection/components/ch-input/ch-input.js.map +1 -1
- package/dist/collection/components/ch-modal/ch-modal.js +9 -3
- package/dist/collection/components/ch-modal/ch-modal.js.map +1 -1
- package/dist/collection/components/ch-page-header/ch-page-header.css +84 -0
- package/dist/collection/components/ch-page-header/ch-page-header.js +162 -0
- package/dist/collection/components/ch-page-header/ch-page-header.js.map +1 -0
- package/dist/collection/components/ch-radio/ch-radio.js +8 -10
- package/dist/collection/components/ch-radio/ch-radio.js.map +1 -1
- package/dist/collection/components/ch-segmented-control/ch-segmented-control.js +7 -6
- package/dist/collection/components/ch-segmented-control/ch-segmented-control.js.map +1 -1
- package/dist/collection/components/ch-select/ch-select.js +8 -10
- package/dist/collection/components/ch-select/ch-select.js.map +1 -1
- package/dist/collection/components/ch-skeleton/ch-skeleton.css +50 -0
- package/dist/collection/components/ch-skeleton/ch-skeleton.js +175 -0
- package/dist/collection/components/ch-skeleton/ch-skeleton.js.map +1 -0
- package/dist/collection/components/ch-spinner/ch-spinner.js +1 -1
- package/dist/collection/components/ch-stack/ch-stack.css +83 -0
- package/dist/collection/components/ch-stack/ch-stack.js +124 -0
- package/dist/collection/components/ch-stack/ch-stack.js.map +1 -0
- package/dist/collection/components/ch-switch/ch-switch.js +8 -10
- package/dist/collection/components/ch-switch/ch-switch.js.map +1 -1
- package/dist/collection/components/ch-tabs/ch-tabs.js +1 -1
- package/dist/collection/components/ch-textarea/ch-textarea.js +8 -10
- package/dist/collection/components/ch-textarea/ch-textarea.js.map +1 -1
- package/dist/collection/components/ch-tooltip/ch-tooltip.css +29 -1
- package/dist/collection/components/ch-tooltip/ch-tooltip.js +125 -6
- package/dist/collection/components/ch-tooltip/ch-tooltip.js.map +1 -1
- package/dist/collection/tokens/tokens.js +12 -0
- package/dist/collection/tokens/tokens.js.map +1 -1
- package/dist/collection/tokens/types.js.map +1 -1
- package/dist/collection/utils/accessibility.js +24 -0
- package/dist/collection/utils/accessibility.js.map +1 -0
- package/dist/collection/utils/icons.js +82 -0
- package/dist/collection/utils/icons.js.map +1 -0
- package/dist/collection/utils/overlay.js +101 -0
- package/dist/collection/utils/overlay.js.map +1 -0
- package/dist/collection/utils/validation-message.js +20 -0
- package/dist/collection/utils/validation-message.js.map +1 -0
- package/dist/components/ch-accordion.js +1 -1
- package/dist/components/ch-alert.js +1 -1
- package/dist/components/ch-alert.js.map +1 -1
- package/dist/components/ch-badge.js +1 -1
- package/dist/components/ch-badge.js.map +1 -1
- package/dist/components/ch-button.js +1 -1
- package/dist/components/ch-button.js.map +1 -1
- package/dist/components/ch-card.js +1 -1
- package/dist/components/ch-checkbox.js +1 -1
- package/dist/components/ch-checkbox.js.map +1 -1
- package/dist/components/ch-cluster.d.ts +11 -0
- package/dist/components/ch-cluster.js +2 -0
- package/dist/components/ch-cluster.js.map +1 -0
- package/dist/components/ch-divider.js +1 -1
- package/dist/components/ch-drawer.js +1 -1
- package/dist/components/ch-drawer.js.map +1 -1
- package/dist/components/ch-emoji.js +1 -1
- package/dist/components/ch-empty-state.d.ts +11 -0
- package/dist/components/ch-empty-state.js +2 -0
- package/dist/components/ch-empty-state.js.map +1 -0
- package/dist/components/ch-grid.d.ts +11 -0
- package/dist/components/ch-grid.js +2 -0
- package/dist/components/ch-grid.js.map +1 -0
- package/dist/components/ch-icon-button.d.ts +11 -0
- package/dist/components/ch-icon-button.js +2 -0
- package/dist/components/ch-icon-button.js.map +1 -0
- package/dist/components/ch-icon.d.ts +11 -0
- package/dist/components/ch-icon.js +2 -0
- package/dist/components/ch-icon.js.map +1 -0
- package/dist/components/ch-input.js +1 -1
- package/dist/components/ch-input.js.map +1 -1
- package/dist/components/ch-link.js +1 -1
- package/dist/components/ch-modal.js +1 -1
- package/dist/components/ch-modal.js.map +1 -1
- package/dist/components/ch-page-header.d.ts +11 -0
- package/dist/components/ch-page-header.js +2 -0
- package/dist/components/ch-page-header.js.map +1 -0
- package/dist/components/ch-radio.js +1 -1
- package/dist/components/ch-radio.js.map +1 -1
- package/dist/components/ch-segmented-control.js +1 -1
- package/dist/components/ch-segmented-control.js.map +1 -1
- package/dist/components/ch-select.js +1 -1
- package/dist/components/ch-select.js.map +1 -1
- package/dist/components/ch-skeleton.d.ts +11 -0
- package/dist/components/ch-skeleton.js +2 -0
- package/dist/components/ch-skeleton.js.map +1 -0
- package/dist/components/ch-spinner.js +1 -1
- package/dist/components/ch-stack.d.ts +11 -0
- package/dist/components/ch-stack.js +2 -0
- package/dist/components/ch-stack.js.map +1 -0
- package/dist/components/ch-switch.js +1 -1
- package/dist/components/ch-switch.js.map +1 -1
- package/dist/components/ch-tabs.js +1 -1
- package/dist/components/ch-textarea.js +1 -1
- package/dist/components/ch-textarea.js.map +1 -1
- package/dist/components/ch-tooltip.js +1 -1
- package/dist/components/ch-tooltip.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/p-BXzZsX2r.js +2 -0
- package/dist/components/p-BXzZsX2r.js.map +1 -0
- package/dist/components/{p-C1995t1C.js → p-CV0rD-fF.js} +2 -2
- package/dist/components/p-CnivhwvG.js +2 -0
- package/dist/components/p-CnivhwvG.js.map +1 -0
- package/dist/components/p-qP_9qshx.js +2 -0
- package/dist/components/p-qP_9qshx.js.map +1 -0
- package/dist/esm/ch-accordion.entry.js +1 -1
- package/dist/esm/ch-alert_8.entry.js +69 -38
- package/dist/esm/ch-alert_8.entry.js.map +1 -1
- package/dist/esm/ch-checkbox.entry.js +9 -11
- package/dist/esm/ch-checkbox.entry.js.map +1 -1
- package/dist/esm/ch-cluster.entry.js +45 -0
- package/dist/esm/ch-cluster.entry.js.map +1 -0
- package/dist/esm/ch-divider.entry.js +2 -2
- package/dist/esm/ch-drawer.entry.js +4 -3
- package/dist/esm/ch-drawer.entry.js.map +1 -1
- package/dist/esm/ch-emoji.entry.js +2 -2
- package/dist/esm/ch-empty-state.entry.js +32 -0
- package/dist/esm/ch-empty-state.entry.js.map +1 -0
- package/dist/esm/ch-grid.entry.js +57 -0
- package/dist/esm/ch-grid.entry.js.map +1 -0
- package/dist/esm/ch-icon-button.entry.js +49 -0
- package/dist/esm/ch-icon-button.entry.js.map +1 -0
- package/dist/esm/ch-icon.entry.js +36 -0
- package/dist/esm/ch-icon.entry.js.map +1 -0
- package/dist/esm/ch-link.entry.js +1 -1
- package/dist/esm/ch-modal.entry.js +4 -3
- package/dist/esm/ch-modal.entry.js.map +1 -1
- package/dist/esm/ch-page-header.entry.js +43 -0
- package/dist/esm/ch-page-header.entry.js.map +1 -0
- package/dist/esm/ch-radio.entry.js +9 -11
- package/dist/esm/ch-radio.entry.js.map +1 -1
- package/dist/esm/ch-segmented-control.entry.js +8 -7
- package/dist/esm/ch-segmented-control.entry.js.map +1 -1
- package/dist/esm/ch-skeleton.entry.js +56 -0
- package/dist/esm/ch-skeleton.entry.js.map +1 -0
- package/dist/esm/ch-stack.entry.js +35 -0
- package/dist/esm/ch-stack.entry.js.map +1 -0
- package/dist/esm/ch-tabs.entry.js +2 -2
- package/dist/esm/ch-textarea.entry.js +9 -11
- package/dist/esm/ch-textarea.entry.js.map +1 -1
- package/dist/esm/ch-tooltip.entry.js +204 -5
- package/dist/esm/ch-tooltip.entry.js.map +1 -1
- package/dist/esm/chucao.js +4 -4
- package/dist/esm/chucao.js.map +1 -1
- package/dist/esm/icons-CnivhwvG.js +86 -0
- package/dist/esm/icons-CnivhwvG.js.map +1 -0
- package/dist/esm/{index-DWC12BJ-.js → index-CIV5Gg1o.js} +119 -17
- package/dist/esm/index-CIV5Gg1o.js.map +1 -0
- package/dist/esm/index.js +13 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/validation-message-BXzZsX2r.js +24 -0
- package/dist/esm/validation-message-BXzZsX2r.js.map +1 -0
- package/dist/types/components/ch-alert/ch-alert.d.ts +11 -0
- package/dist/types/components/ch-badge/ch-badge.d.ts +14 -0
- package/dist/types/components/ch-button/ch-button.d.ts +3 -1
- package/dist/types/components/ch-cluster/ch-cluster.d.ts +28 -0
- package/dist/types/components/ch-drawer/ch-drawer.d.ts +2 -1
- package/dist/types/components/ch-empty-state/ch-empty-state.d.ts +25 -0
- package/dist/types/components/ch-grid/ch-grid.d.ts +38 -0
- package/dist/types/components/ch-icon/ch-icon.d.ts +29 -0
- package/dist/types/components/ch-icon-button/ch-icon-button.d.ts +36 -0
- package/dist/types/components/ch-modal/ch-modal.d.ts +2 -1
- package/dist/types/components/ch-page-header/ch-page-header.d.ts +39 -0
- package/dist/types/components/ch-skeleton/ch-skeleton.d.ts +39 -0
- package/dist/types/components/ch-stack/ch-stack.d.ts +26 -0
- package/dist/types/components/ch-tooltip/ch-tooltip.d.ts +32 -2
- package/dist/types/components.d.ts +807 -8
- package/dist/types/stencil-public-runtime.d.ts +61 -55
- package/dist/types/tokens/tokens.d.ts +12 -0
- package/dist/types/tokens/types.d.ts +2 -1
- package/dist/types/utils/accessibility.d.ts +2 -0
- package/dist/types/utils/icons.d.ts +15 -0
- package/dist/types/utils/overlay.d.ts +49 -0
- package/dist/types/utils/validation-message.d.ts +20 -0
- package/dist-react/components.d.ts +27 -1
- package/dist-react/components.js +72 -0
- package/dist-react/components.ts +97 -1
- package/dist-vue/index.d.ts +8 -0
- package/dist-vue/index.js +62 -1
- package/dist-vue/index.ts +78 -1
- package/hydrate/index.js +1114 -132
- package/hydrate/index.mjs +1114 -132
- package/package.json +112 -5
- package/dist/chucao/p-37e7f9cc.entry.js +0 -2
- package/dist/chucao/p-37e7f9cc.entry.js.map +0 -1
- package/dist/chucao/p-3db38c49.entry.js +0 -2
- package/dist/chucao/p-3db38c49.entry.js.map +0 -1
- package/dist/chucao/p-60c2fd71.entry.js +0 -2
- package/dist/chucao/p-60c2fd71.entry.js.map +0 -1
- package/dist/chucao/p-6c617158.entry.js +0 -2
- package/dist/chucao/p-6c617158.entry.js.map +0 -1
- package/dist/chucao/p-DWC12BJ-.js +0 -3
- package/dist/chucao/p-DWC12BJ-.js.map +0 -1
- package/dist/chucao/p-aeea9cbe.entry.js +0 -2
- package/dist/chucao/p-aeea9cbe.entry.js.map +0 -1
- package/dist/chucao/p-bb2445d1.entry.js +0 -2
- package/dist/chucao/p-c4806e96.entry.js +0 -2
- package/dist/chucao/p-c4806e96.entry.js.map +0 -1
- package/dist/chucao/p-e3265e38.entry.js +0 -2
- package/dist/chucao/p-e3265e38.entry.js.map +0 -1
- package/dist/chucao/p-f78f0163.entry.js +0 -2
- package/dist/chucao/p-f78f0163.entry.js.map +0 -1
- package/dist/cjs/index-C9cpLteP.js.map +0 -1
- package/dist/components/p-BhAZrOxf.js +0 -2
- package/dist/components/p-BhAZrOxf.js.map +0 -1
- package/dist/esm/index-DWC12BJ-.js.map +0 -1
- /package/dist/chucao/{p-ff5f5c1f.entry.js.map → p-1108062e.entry.js.map} +0 -0
- /package/dist/chucao/{p-04dbcfa0.entry.js.map → p-337d7f68.entry.js.map} +0 -0
- /package/dist/chucao/{p-bb2445d1.entry.js.map → p-4846cac4.entry.js.map} +0 -0
- /package/dist/chucao/{p-6a4bc80c.entry.js.map → p-9f73855e.entry.js.map} +0 -0
- /package/dist/chucao/{p-c986036f.entry.js.map → p-b6cc08f0.entry.js.map} +0 -0
- /package/dist/components/{p-C1995t1C.js.map → p-CV0rD-fF.js.map} +0 -0
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -65,6 +65,10 @@ const zIndexBase = 0;
|
|
|
65
65
|
const zIndexDropdown = 100;
|
|
66
66
|
const zIndexModal = 1000;
|
|
67
67
|
const layoutMaxWidth = '68rem';
|
|
68
|
+
const iconSizeSm = '16px';
|
|
69
|
+
const iconSizeMd = '20px';
|
|
70
|
+
const iconSizeLg = '24px';
|
|
71
|
+
const iconStroke = '2px';
|
|
68
72
|
const tokens = {
|
|
69
73
|
'color': {
|
|
70
74
|
background: {
|
|
@@ -178,6 +182,14 @@ const tokens = {
|
|
|
178
182
|
'layout': {
|
|
179
183
|
maxWidth: '68rem',
|
|
180
184
|
},
|
|
185
|
+
'icon': {
|
|
186
|
+
size: {
|
|
187
|
+
sm: '16px',
|
|
188
|
+
md: '20px',
|
|
189
|
+
lg: '24px',
|
|
190
|
+
},
|
|
191
|
+
stroke: '2px',
|
|
192
|
+
},
|
|
181
193
|
};
|
|
182
194
|
|
|
183
195
|
exports.borderAccentBar = borderAccentBar;
|
|
@@ -210,6 +222,10 @@ exports.easingLinear = easingLinear;
|
|
|
210
222
|
exports.effectBlur = effectBlur;
|
|
211
223
|
exports.focusOutlineOffset = focusOutlineOffset;
|
|
212
224
|
exports.focusOutlineWidth = focusOutlineWidth;
|
|
225
|
+
exports.iconSizeLg = iconSizeLg;
|
|
226
|
+
exports.iconSizeMd = iconSizeMd;
|
|
227
|
+
exports.iconSizeSm = iconSizeSm;
|
|
228
|
+
exports.iconStroke = iconStroke;
|
|
213
229
|
exports.layoutMaxWidth = layoutMaxWidth;
|
|
214
230
|
exports.opacityDisabled = opacityDisabled;
|
|
215
231
|
exports.radiusMd = radiusMd;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["src/tokens/tokens.ts"],"sourcesContent":["/* Generated by toki v1.12.1 — do not edit */\n\nexport const colorBackgroundBase = '#100a1c';\nexport const colorBackgroundTopGlow = '#201e40';\nexport const colorBackgroundBottomGlow = '#261226';\nexport const colorSurfaceDefault = 'rgba(32, 30, 64, 0.6)';\nexport const colorSurfaceHover = 'rgba(45, 212, 191, 0.08)';\nexport const colorScrimDefault = 'rgba(0, 0, 0, 0.6)';\nexport const colorBorderDefault = 'rgba(255, 255, 255, 0.08)';\nexport const colorBorderHover = 'rgba(45, 212, 191, 0.3)';\nexport const colorAccentDefault = '#2dd4bf';\nexport const colorAccentHover = '#5ee8d4';\nexport const colorAccentText = '#06210f';\nexport const colorStatusPositive = '#4ade80';\nexport const colorStatusPositiveBackground = 'rgba(34, 197, 94, 0.18)';\nexport const colorStatusWarning = '#f87171';\nexport const colorStatusWarningBackground = 'rgba(248, 113, 113, 0.15)';\nexport const colorTextPrimary = '#ffffff';\nexport const colorTextSecondary = 'rgba(255, 255, 255, 0.55)';\nexport const colorBrandHuemulDark = '#85422b';\nexport const colorBrandHuemulLight = '#b45b38';\nexport const colorBrandStroke = '#1d1d1b';\nexport const typographyBody = 'Fira Sans, Droid Sans, Helvetica Neue, sans-serif';\nexport const typographyHeading = 'Inconsolata, monospace';\nexport const typographySizeXs = '0.68rem';\nexport const typographySizeSm = '0.85rem';\nexport const typographySizeMd = '1rem';\nexport const typographySizeLg = '1.25rem';\nexport const typographySizeXl = '1.5rem';\nexport const typographyWeightRegular = '400';\nexport const typographyWeightSemibold = '600';\nexport const typographyWeightBold = '700';\nexport const typographyTrackingBadge = '0.03em';\nexport const spacing2xs = '0.18rem';\nexport const spacingXs = '0.25rem';\nexport const spacingSm = '0.35rem';\nexport const spacingMd = '0.5rem';\nexport const spacingLg = '0.6rem';\nexport const spacingXl = '0.8rem';\nexport const spacing2xl = '1rem';\nexport const spacing3xl = '1.25rem';\nexport const spacing4xl = '1.35rem';\nexport const spacing5xl = '1.5rem';\nexport const spacing6xl = '2rem';\nexport const spacingShift = '2px';\nexport const spacingElevate = '1px';\nexport const radiusSm = '6px';\nexport const radiusMd = '8px';\nexport const radiusPill = '999px';\nexport const borderWidth = '1px';\nexport const borderAccentBar = '3px';\nexport const shadowFocusRing = '0 0 0 3px rgba(45, 212, 191, 0.12)';\nexport const shadowCardHover = '0 4px 20px rgba(45, 212, 191, 0.06)';\nexport const effectBlur = '10px';\nexport const durationFast = '150ms';\nexport const durationNormal = '200ms';\nexport const durationSpin = '800ms';\nexport const easingDefault = 'ease';\nexport const easingLinear = 'linear';\nexport const focusOutlineWidth = '2px';\nexport const focusOutlineOffset = '2px';\nexport const opacityDisabled = 0.5;\nexport const zIndexBase = 0;\nexport const zIndexDropdown = 100;\nexport const zIndexModal = 1000;\nexport const layoutMaxWidth = '68rem';\n\nexport const tokens = {\n 'color': {\n background: {\n base: '#100a1c',\n topGlow: '#201e40',\n bottomGlow: '#261226',\n },\n surface: {\n default: 'rgba(32, 30, 64, 0.6)',\n hover: 'rgba(45, 212, 191, 0.08)',\n },\n scrim: {\n default: 'rgba(0, 0, 0, 0.6)',\n },\n border: {\n default: 'rgba(255, 255, 255, 0.08)',\n hover: 'rgba(45, 212, 191, 0.3)',\n },\n accent: {\n default: '#2dd4bf',\n hover: '#5ee8d4',\n text: '#06210f',\n },\n status: {\n positive: '#4ade80',\n positiveBackground: 'rgba(34, 197, 94, 0.18)',\n warning: '#f87171',\n warningBackground: 'rgba(248, 113, 113, 0.15)',\n },\n text: {\n primary: '#ffffff',\n secondary: 'rgba(255, 255, 255, 0.55)',\n },\n brand: {\n huemulDark: '#85422b',\n huemulLight: '#b45b38',\n stroke: '#1d1d1b',\n },\n },\n 'typography': {\n body: 'Fira Sans, Droid Sans, Helvetica Neue, sans-serif',\n heading: 'Inconsolata, monospace',\n size: {\n xs: '0.68rem',\n sm: '0.85rem',\n md: '1rem',\n lg: '1.25rem',\n xl: '1.5rem',\n },\n weight: {\n regular: '400',\n semibold: '600',\n bold: '700',\n },\n tracking: {\n badge: '0.03em',\n },\n },\n 'spacing': {\n '2xs': '0.18rem',\n 'xs': '0.25rem',\n 'sm': '0.35rem',\n 'md': '0.5rem',\n 'lg': '0.6rem',\n 'xl': '0.8rem',\n '2xl': '1rem',\n '3xl': '1.25rem',\n '4xl': '1.35rem',\n '5xl': '1.5rem',\n '6xl': '2rem',\n 'shift': '2px',\n 'elevate': '1px',\n },\n 'radius': {\n sm: '6px',\n md: '8px',\n pill: '999px',\n },\n 'border': {\n width: '1px',\n accentBar: '3px',\n },\n 'shadow': {\n focusRing: '0 0 0 3px rgba(45, 212, 191, 0.12)',\n cardHover: '0 4px 20px rgba(45, 212, 191, 0.06)',\n },\n 'effect': {\n blur: '10px',\n },\n 'duration': {\n fast: '150ms',\n normal: '200ms',\n spin: '800ms',\n },\n 'easing': {\n default: 'ease',\n linear: 'linear',\n },\n 'focus': {\n outlineWidth: '2px',\n outlineOffset: '2px',\n },\n 'opacity': {\n disabled: 0.5,\n },\n 'z-index': {\n base: 0,\n dropdown: 100,\n modal: 1000,\n },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AG;AACvB,MAAM,QAAQ,GAAG;AACjB,MAAM,QAAQ,GAAG;AACjB,MAAM,UAAU,GAAG;AACnB,MAAM,WAAW,GAAG;AACpB,MAAM,eAAe,GAAG;AACxB,MAAM,eAAe,GAAG;AACxB,MAAM,eAAe,GAAG;AACxB,MAAM,UAAU,GAAG;AACnB,MAAM,YAAY,GAAG;AACrB,MAAM,cAAc,GAAG;AACvB,MAAM,YAAY,GAAG;AACrB,MAAM,aAAa,GAAG;AACtB,MAAM,YAAY,GAAG;AACrB,MAAM,iBAAiB,GAAG;AAC1B,MAAM,kBAAkB,GAAG;AAC3B,MAAM,eAAe,GAAG;AACxB,MAAM,UAAU,GAAG;AACnB,MAAM,cAAc,GAAG;AACvB,MAAM,WAAW,GAAG;AACpB,MAAM,cAAc,GAAG;
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["src/tokens/tokens.ts"],"sourcesContent":["/* Generated by toki v1.12.1 — do not edit */\n\nexport const colorBackgroundBase = '#100a1c';\nexport const colorBackgroundTopGlow = '#201e40';\nexport const colorBackgroundBottomGlow = '#261226';\nexport const colorSurfaceDefault = 'rgba(32, 30, 64, 0.6)';\nexport const colorSurfaceHover = 'rgba(45, 212, 191, 0.08)';\nexport const colorScrimDefault = 'rgba(0, 0, 0, 0.6)';\nexport const colorBorderDefault = 'rgba(255, 255, 255, 0.08)';\nexport const colorBorderHover = 'rgba(45, 212, 191, 0.3)';\nexport const colorAccentDefault = '#2dd4bf';\nexport const colorAccentHover = '#5ee8d4';\nexport const colorAccentText = '#06210f';\nexport const colorStatusPositive = '#4ade80';\nexport const colorStatusPositiveBackground = 'rgba(34, 197, 94, 0.18)';\nexport const colorStatusWarning = '#f87171';\nexport const colorStatusWarningBackground = 'rgba(248, 113, 113, 0.15)';\nexport const colorTextPrimary = '#ffffff';\nexport const colorTextSecondary = 'rgba(255, 255, 255, 0.55)';\nexport const colorBrandHuemulDark = '#85422b';\nexport const colorBrandHuemulLight = '#b45b38';\nexport const colorBrandStroke = '#1d1d1b';\nexport const typographyBody = 'Fira Sans, Droid Sans, Helvetica Neue, sans-serif';\nexport const typographyHeading = 'Inconsolata, monospace';\nexport const typographySizeXs = '0.68rem';\nexport const typographySizeSm = '0.85rem';\nexport const typographySizeMd = '1rem';\nexport const typographySizeLg = '1.25rem';\nexport const typographySizeXl = '1.5rem';\nexport const typographyWeightRegular = '400';\nexport const typographyWeightSemibold = '600';\nexport const typographyWeightBold = '700';\nexport const typographyTrackingBadge = '0.03em';\nexport const spacing2xs = '0.18rem';\nexport const spacingXs = '0.25rem';\nexport const spacingSm = '0.35rem';\nexport const spacingMd = '0.5rem';\nexport const spacingLg = '0.6rem';\nexport const spacingXl = '0.8rem';\nexport const spacing2xl = '1rem';\nexport const spacing3xl = '1.25rem';\nexport const spacing4xl = '1.35rem';\nexport const spacing5xl = '1.5rem';\nexport const spacing6xl = '2rem';\nexport const spacingShift = '2px';\nexport const spacingElevate = '1px';\nexport const radiusSm = '6px';\nexport const radiusMd = '8px';\nexport const radiusPill = '999px';\nexport const borderWidth = '1px';\nexport const borderAccentBar = '3px';\nexport const shadowFocusRing = '0 0 0 3px rgba(45, 212, 191, 0.12)';\nexport const shadowCardHover = '0 4px 20px rgba(45, 212, 191, 0.06)';\nexport const effectBlur = '10px';\nexport const durationFast = '150ms';\nexport const durationNormal = '200ms';\nexport const durationSpin = '800ms';\nexport const easingDefault = 'ease';\nexport const easingLinear = 'linear';\nexport const focusOutlineWidth = '2px';\nexport const focusOutlineOffset = '2px';\nexport const opacityDisabled = 0.5;\nexport const zIndexBase = 0;\nexport const zIndexDropdown = 100;\nexport const zIndexModal = 1000;\nexport const layoutMaxWidth = '68rem';\nexport const iconSizeSm = '16px';\nexport const iconSizeMd = '20px';\nexport const iconSizeLg = '24px';\nexport const iconStroke = '2px';\n\nexport const tokens = {\n 'color': {\n background: {\n base: '#100a1c',\n topGlow: '#201e40',\n bottomGlow: '#261226',\n },\n surface: {\n default: 'rgba(32, 30, 64, 0.6)',\n hover: 'rgba(45, 212, 191, 0.08)',\n },\n scrim: {\n default: 'rgba(0, 0, 0, 0.6)',\n },\n border: {\n default: 'rgba(255, 255, 255, 0.08)',\n hover: 'rgba(45, 212, 191, 0.3)',\n },\n accent: {\n default: '#2dd4bf',\n hover: '#5ee8d4',\n text: '#06210f',\n },\n status: {\n positive: '#4ade80',\n positiveBackground: 'rgba(34, 197, 94, 0.18)',\n warning: '#f87171',\n warningBackground: 'rgba(248, 113, 113, 0.15)',\n },\n text: {\n primary: '#ffffff',\n secondary: 'rgba(255, 255, 255, 0.55)',\n },\n brand: {\n huemulDark: '#85422b',\n huemulLight: '#b45b38',\n stroke: '#1d1d1b',\n },\n },\n 'typography': {\n body: 'Fira Sans, Droid Sans, Helvetica Neue, sans-serif',\n heading: 'Inconsolata, monospace',\n size: {\n xs: '0.68rem',\n sm: '0.85rem',\n md: '1rem',\n lg: '1.25rem',\n xl: '1.5rem',\n },\n weight: {\n regular: '400',\n semibold: '600',\n bold: '700',\n },\n tracking: {\n badge: '0.03em',\n },\n },\n 'spacing': {\n '2xs': '0.18rem',\n 'xs': '0.25rem',\n 'sm': '0.35rem',\n 'md': '0.5rem',\n 'lg': '0.6rem',\n 'xl': '0.8rem',\n '2xl': '1rem',\n '3xl': '1.25rem',\n '4xl': '1.35rem',\n '5xl': '1.5rem',\n '6xl': '2rem',\n 'shift': '2px',\n 'elevate': '1px',\n },\n 'radius': {\n sm: '6px',\n md: '8px',\n pill: '999px',\n },\n 'border': {\n width: '1px',\n accentBar: '3px',\n },\n 'shadow': {\n focusRing: '0 0 0 3px rgba(45, 212, 191, 0.12)',\n cardHover: '0 4px 20px rgba(45, 212, 191, 0.06)',\n },\n 'effect': {\n blur: '10px',\n },\n 'duration': {\n fast: '150ms',\n normal: '200ms',\n spin: '800ms',\n },\n 'easing': {\n default: 'ease',\n linear: 'linear',\n },\n 'focus': {\n outlineWidth: '2px',\n outlineOffset: '2px',\n },\n 'opacity': {\n disabled: 0.5,\n },\n 'z-index': {\n base: 0,\n dropdown: 100,\n modal: 1000,\n },\n 'layout': {\n maxWidth: '68rem',\n },\n 'icon': {\n size: {\n sm: '16px',\n md: '20px',\n lg: '24px',\n },\n stroke: '2px',\n },\n} as const;\n\nexport type TokenCategory = keyof typeof tokens;\n"],"names":[],"mappings":";;AAAA;AAEO,MAAM,mBAAmB,GAAG;AAC5B,MAAM,sBAAsB,GAAG;AAC/B,MAAM,yBAAyB,GAAG;AAClC,MAAM,mBAAmB,GAAG;AAC5B,MAAM,iBAAiB,GAAG;AAC1B,MAAM,iBAAiB,GAAG;AAC1B,MAAM,kBAAkB,GAAG;AAC3B,MAAM,gBAAgB,GAAG;AACzB,MAAM,kBAAkB,GAAG;AAC3B,MAAM,gBAAgB,GAAG;AACzB,MAAM,eAAe,GAAG;AACxB,MAAM,mBAAmB,GAAG;AAC5B,MAAM,6BAA6B,GAAG;AACtC,MAAM,kBAAkB,GAAG;AAC3B,MAAM,4BAA4B,GAAG;AACrC,MAAM,gBAAgB,GAAG;AACzB,MAAM,kBAAkB,GAAG;AAC3B,MAAM,oBAAoB,GAAG;AAC7B,MAAM,qBAAqB,GAAG;AAC9B,MAAM,gBAAgB,GAAG;AACzB,MAAM,cAAc,GAAG;AACvB,MAAM,iBAAiB,GAAG;AAC1B,MAAM,gBAAgB,GAAG;AACzB,MAAM,gBAAgB,GAAG;AACzB,MAAM,gBAAgB,GAAG;AACzB,MAAM,gBAAgB,GAAG;AACzB,MAAM,gBAAgB,GAAG;AACzB,MAAM,uBAAuB,GAAG;AAChC,MAAM,wBAAwB,GAAG;AACjC,MAAM,oBAAoB,GAAG;AAC7B,MAAM,uBAAuB,GAAG;AAChC,MAAM,UAAU,GAAG;AACnB,MAAM,SAAS,GAAG;AAClB,MAAM,SAAS,GAAG;AAClB,MAAM,SAAS,GAAG;AAClB,MAAM,SAAS,GAAG;AAClB,MAAM,SAAS,GAAG;AAClB,MAAM,UAAU,GAAG;AACnB,MAAM,UAAU,GAAG;AACnB,MAAM,UAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-ByZY6aTj.js');
|
|
4
4
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await index.globalScripts();
|
|
8
|
-
return index.bootstrapLazy([["ch-accordion.cjs",[[769,"ch-accordion",{"items":[16],"value":[1025]}]]],["ch-checkbox.cjs",[[577,"ch-checkbox",{"label":[1],"name":[513],"value":[1],"checked":[1028],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-divider.cjs",[[513,"ch-divider",{"orientation":[1]}]]],["ch-drawer.cjs",[[769,"ch-drawer",{"open":[1028],"side":[1],"label":[1],"closeLabel":[1,"close-label"]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-emoji.cjs",[[513,"ch-emoji",{"name":[1],"alt":[1],"size":[1],"extIndex":[32],"loaded":[32]},null,{"name":[{"handleNameChange":0}]}]]],["ch-link.cjs",[[769,"ch-link",{"href":[1],"target":[1],"variant":[1],"disabled":[4]}]]],["ch-modal.cjs",[[769,"ch-modal",{"open":[1028],"label":[1],"closeLabel":[1,"close-label"],"size":[1]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-radio.cjs",[[577,"ch-radio",{"label":[1],"options":[16],"value":[1025],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-segmented-control.cjs",[[577,"ch-segmented-control",{"label":[1],"options":[16],"value":[1025],"size":[1],"name":[513],"disabled":[516],"required":[516],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}]}]]],["ch-tabs.cjs",[[769,"ch-tabs",{"tabs":[16],"value":[1025],"label":[1]}]]],["ch-textarea.cjs",[[577,"ch-textarea",{"label":[1],"value":[1025],"placeholder":[1],"rows":[2],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-tooltip.cjs",[[769,"ch-tooltip",{"placement":[1],"hovered":[32],"focused":[32],"dismissed":[32]},[[1,"mouseenter","handleMouseEnter"],[1,"mouseleave","handleMouseLeave"],[0,"focusin","handleFocusIn"],[0,"focusout","handleFocusOut"],[4,"keydown","handleKeyDown"]]]]],["ch-alert_8.cjs",[[769,"ch-button",{"variant":[1],"size":[1],"disabled":[4],"loading":[4],"href":[1],"target":[1],"label":[1]}],[769,"ch-alert",{"variant":[1],"dismissLabel":[1,"dismiss-label"]}],[769,"ch-badge",{"variant":[1]}],[257,"ch-card"],[577,"ch-input",{"label":[1],"type":[1],"value":[1025],"placeholder":[1],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[577,"ch-select",{"label":[1],"options":[16],"value":[1025],"placeholder":[1],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[577,"ch-switch",{"label":[1],"name":[513],"value":[1],"checked":[1028],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[513,"ch-spinner",{"size":[1],"label":[1]}]]]], options);
|
|
8
|
+
return index.bootstrapLazy([["ch-accordion.cjs",[[769,"ch-accordion",{"items":[16],"value":[1025]}]]],["ch-checkbox.cjs",[[577,"ch-checkbox",{"label":[1],"name":[513],"value":[1],"checked":[1028],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-cluster.cjs",[[769,"ch-cluster",{"gap":[1],"align":[1],"justify":[1],"wrap":[4]}]]],["ch-divider.cjs",[[513,"ch-divider",{"orientation":[1]}]]],["ch-drawer.cjs",[[769,"ch-drawer",{"open":[1028],"side":[1],"label":[1],"closeLabel":[1,"close-label"]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-emoji.cjs",[[513,"ch-emoji",{"name":[1],"alt":[1],"size":[1],"extIndex":[32],"loaded":[32]},null,{"name":[{"handleNameChange":0}]}]]],["ch-empty-state.cjs",[[769,"ch-empty-state",{"title":[1],"description":[1],"size":[1]}]]],["ch-grid.cjs",[[769,"ch-grid",{"columns":[1],"gap":[1],"minItemWidth":[1,"min-item-width"]}]]],["ch-icon.cjs",[[513,"ch-icon",{"name":[1],"size":[1],"label":[1]}]]],["ch-icon-button.cjs",[[513,"ch-icon-button",{"name":[1],"label":[1],"size":[1],"type":[1],"disabled":[4],"loading":[4]}]]],["ch-link.cjs",[[769,"ch-link",{"href":[1],"target":[1],"variant":[1],"disabled":[4]}]]],["ch-modal.cjs",[[769,"ch-modal",{"open":[1028],"label":[1],"closeLabel":[1,"close-label"],"size":[1]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-page-header.cjs",[[769,"ch-page-header",{"title":[1],"headingLevel":[1,"heading-level"],"eyebrow":[1],"description":[1],"actionsStacked":[4,"actions-stacked"]}]]],["ch-radio.cjs",[[577,"ch-radio",{"label":[1],"options":[16],"value":[1025],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-segmented-control.cjs",[[577,"ch-segmented-control",{"label":[1],"options":[16],"value":[1025],"size":[1],"name":[513],"disabled":[516],"required":[516],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}]}]]],["ch-skeleton.cjs",[[513,"ch-skeleton",{"width":[1],"height":[1],"shape":[1],"count":[2],"animated":[4]}]]],["ch-stack.cjs",[[769,"ch-stack",{"gap":[1],"align":[1],"justify":[1]}]]],["ch-tabs.cjs",[[769,"ch-tabs",{"tabs":[16],"value":[1025],"label":[1]}]]],["ch-textarea.cjs",[[577,"ch-textarea",{"label":[1],"value":[1025],"placeholder":[1],"rows":[2],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-tooltip.cjs",[[769,"ch-tooltip",{"placement":[1],"hovered":[32],"focused":[32],"dismissed":[32],"resolvedPlacement":[32]},[[1,"mouseenter","handleMouseEnter"],[1,"mouseleave","handleMouseLeave"],[0,"focusin","handleFocusIn"],[0,"focusout","handleFocusOut"],[4,"keydown","handleKeyDown"],[11,"scroll","handleScroll"],[9,"resize","handleResize"]]]]],["ch-alert_8.cjs",[[769,"ch-button",{"variant":[1],"size":[1],"disabled":[4],"loading":[4],"href":[1],"target":[1],"label":[1]}],[769,"ch-alert",{"variant":[1],"dismissLabel":[1,"dismiss-label"],"statusCue":[4,"status-cue"]}],[769,"ch-badge",{"variant":[1],"statusCue":[4,"status-cue"]}],[257,"ch-card"],[577,"ch-input",{"label":[1],"type":[1],"value":[1025],"placeholder":[1],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[577,"ch-select",{"label":[1],"options":[16],"value":[1025],"placeholder":[1],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[577,"ch-switch",{"label":[1],"name":[513],"value":[1],"checked":[1028],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[513,"ch-spinner",{"size":[1],"label":[1]}]]]], options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
exports.setNonce = index.setNonce;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const VALUE_MISSING_MESSAGE = 'Please fill out this field.';
|
|
4
|
+
/**
|
|
5
|
+
* Turns a form control's state into the flags and message passed to
|
|
6
|
+
* `ElementInternals.setValidity()`, so the six controls that mirror their
|
|
7
|
+
* props into constraint validation cannot drift apart.
|
|
8
|
+
*
|
|
9
|
+
* A custom error wins over `valueMissing` for the message, matching the native
|
|
10
|
+
* rule order, while both flags are reported when both apply.
|
|
11
|
+
*/
|
|
12
|
+
function resolveValidity({ required, empty, invalid, errorMessage }) {
|
|
13
|
+
const flags = {};
|
|
14
|
+
if (required && empty) {
|
|
15
|
+
flags.valueMissing = true;
|
|
16
|
+
}
|
|
17
|
+
if (invalid && errorMessage) {
|
|
18
|
+
flags.customError = true;
|
|
19
|
+
}
|
|
20
|
+
return { flags, message: errorMessage || (flags.valueMissing ? VALUE_MISSING_MESSAGE : undefined) };
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
exports.resolveValidity = resolveValidity;
|
|
24
|
+
//# sourceMappingURL=validation-message-bbtJ2sa_.js.map
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=validation-message-bbtJ2sa_.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation-message-bbtJ2sa_.js","sources":["src/utils/validation-message.ts"],"sourcesContent":["const VALUE_MISSING_MESSAGE = 'Please fill out this field.';\n\ninterface ValidationState {\n required: boolean;\n empty: boolean;\n invalid?: boolean;\n errorMessage?: string;\n}\n\ninterface ValidationResult {\n flags: ValidityStateFlags;\n message?: string;\n}\n\n/**\n * Turns a form control's state into the flags and message passed to\n * `ElementInternals.setValidity()`, so the six controls that mirror their\n * props into constraint validation cannot drift apart.\n *\n * A custom error wins over `valueMissing` for the message, matching the native\n * rule order, while both flags are reported when both apply.\n */\nexport function resolveValidity({ required, empty, invalid, errorMessage }: ValidationState): ValidationResult {\n const flags: ValidityStateFlags = {};\n if (required && empty) {\n flags.valueMissing = true;\n }\n if (invalid && errorMessage) {\n flags.customError = true;\n }\n return { flags, message: errorMessage || (flags.valueMissing ? VALUE_MISSING_MESSAGE : undefined) };\n}\n"],"names":[],"mappings":";;AAAA,MAAM,qBAAqB,GAAG,6BAA6B;AAc3D;;;;;;;AAOG;AACG,SAAU,eAAe,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAmB,EAAA;IACzF,MAAM,KAAK,GAAuB,EAAE;AACpC,IAAA,IAAI,QAAQ,IAAI,KAAK,EAAE;AACrB,QAAA,KAAK,CAAC,YAAY,GAAG,IAAI;;AAE3B,IAAA,IAAI,OAAO,IAAI,YAAY,EAAE;AAC3B,QAAA,KAAK,CAAC,WAAW,GAAG,IAAI;;IAE1B,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,KAAK,KAAK,CAAC,YAAY,GAAG,qBAAqB,GAAG,SAAS,CAAC,EAAE;AACrG;;;;"}
|
|
@@ -4,15 +4,23 @@
|
|
|
4
4
|
"components/ch-alert/ch-alert.js",
|
|
5
5
|
"components/ch-badge/ch-badge.js",
|
|
6
6
|
"components/ch-button/ch-button.js",
|
|
7
|
+
"components/ch-cluster/ch-cluster.js",
|
|
7
8
|
"components/ch-divider/ch-divider.js",
|
|
8
9
|
"components/ch-drawer/ch-drawer.js",
|
|
9
10
|
"components/ch-emoji/ch-emoji.js",
|
|
11
|
+
"components/ch-empty-state/ch-empty-state.js",
|
|
12
|
+
"components/ch-grid/ch-grid.js",
|
|
13
|
+
"components/ch-icon/ch-icon.js",
|
|
14
|
+
"components/ch-icon-button/ch-icon-button.js",
|
|
10
15
|
"components/ch-link/ch-link.js",
|
|
11
16
|
"components/ch-modal/ch-modal.js",
|
|
17
|
+
"components/ch-page-header/ch-page-header.js",
|
|
12
18
|
"components/ch-radio/ch-radio.js",
|
|
13
19
|
"components/ch-segmented-control/ch-segmented-control.js",
|
|
14
20
|
"components/ch-select/ch-select.js",
|
|
21
|
+
"components/ch-skeleton/ch-skeleton.js",
|
|
15
22
|
"components/ch-spinner/ch-spinner.js",
|
|
23
|
+
"components/ch-stack/ch-stack.js",
|
|
16
24
|
"components/ch-tabs/ch-tabs.js",
|
|
17
25
|
"components/ch-tooltip/ch-tooltip.js",
|
|
18
26
|
"components/ch-card/ch-card.js",
|
|
@@ -24,7 +32,7 @@
|
|
|
24
32
|
"mixins": [],
|
|
25
33
|
"compiler": {
|
|
26
34
|
"name": "@stencil/core",
|
|
27
|
-
"version": "4.
|
|
35
|
+
"version": "4.45.1",
|
|
28
36
|
"typescriptVersion": "5.8.3"
|
|
29
37
|
},
|
|
30
38
|
"collections": [],
|
|
@@ -7,12 +7,22 @@
|
|
|
7
7
|
align-items: flex-start;
|
|
8
8
|
gap: var(--spacing-2xl);
|
|
9
9
|
padding: var(--spacing-2xl) var(--spacing-3xl);
|
|
10
|
+
/* The leading edge is thicker on every variant, so the block still reads as
|
|
11
|
+
a status message in grayscale or with colour-vision deficiency. */
|
|
10
12
|
border: var(--border-width) solid transparent;
|
|
13
|
+
border-left: var(--border-accent-bar) solid transparent;
|
|
11
14
|
border-radius: var(--radius);
|
|
12
15
|
font-size: var(--typography-size-sm);
|
|
13
16
|
line-height: 1.5;
|
|
14
17
|
}
|
|
15
18
|
|
|
19
|
+
.alert-icon {
|
|
20
|
+
width: var(--icon-size-md);
|
|
21
|
+
height: var(--icon-size-md);
|
|
22
|
+
flex: none;
|
|
23
|
+
margin-top: 1px;
|
|
24
|
+
}
|
|
25
|
+
|
|
16
26
|
.alert-content {
|
|
17
27
|
flex: 1;
|
|
18
28
|
min-width: 0;
|
|
@@ -23,18 +33,21 @@
|
|
|
23
33
|
color: var(--text);
|
|
24
34
|
background: var(--surface);
|
|
25
35
|
border-color: var(--border);
|
|
36
|
+
border-left-color: var(--color-text-secondary);
|
|
26
37
|
}
|
|
27
38
|
|
|
28
39
|
.alert--positive {
|
|
29
40
|
color: var(--color-status-positive);
|
|
30
41
|
background: var(--color-status-positive-background);
|
|
31
42
|
border-color: var(--color-status-positive);
|
|
43
|
+
border-left-color: var(--color-status-positive);
|
|
32
44
|
}
|
|
33
45
|
|
|
34
46
|
.alert--warning {
|
|
35
47
|
color: var(--color-status-warning);
|
|
36
48
|
background: var(--color-status-warning-background);
|
|
37
49
|
border-color: var(--color-status-warning);
|
|
50
|
+
border-left-color: var(--color-status-warning);
|
|
38
51
|
}
|
|
39
52
|
|
|
40
53
|
.alert-dismiss {
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { chIcons } from "../../utils/icons";
|
|
3
|
+
/**
|
|
4
|
+
* The glyph paired with each variant. It is what makes the variants
|
|
5
|
+
* distinguishable without colour: `default` is informational, `positive`
|
|
6
|
+
* confirms and `warning` warns, and each reads differently in grayscale.
|
|
7
|
+
*/
|
|
8
|
+
const VARIANT_ICON = {
|
|
9
|
+
default: 'info',
|
|
10
|
+
positive: 'success',
|
|
11
|
+
warning: 'alert',
|
|
12
|
+
};
|
|
2
13
|
/**
|
|
3
14
|
* Block-level status message.
|
|
4
15
|
*
|
|
@@ -7,6 +18,11 @@ import { Host, h } from "@stencil/core";
|
|
|
7
18
|
* interrupt. Both announce reliably when the alert is added to the page in
|
|
8
19
|
* response to something — an alert already present at load may not be read out,
|
|
9
20
|
* which is how live regions work rather than something this component controls.
|
|
21
|
+
*
|
|
22
|
+
* Every variant also carries an icon and a thicker leading edge, so the three
|
|
23
|
+
* states stay distinguishable without colour vision. The icon is decorative:
|
|
24
|
+
* the text next to it already says what happened, and announcing "check
|
|
25
|
+
* circle" before it would only add noise.
|
|
10
26
|
*/
|
|
11
27
|
export class ChAlert {
|
|
12
28
|
/**
|
|
@@ -21,6 +37,12 @@ export class ChAlert {
|
|
|
21
37
|
* so without a label it would have no accessible name at all.
|
|
22
38
|
*/
|
|
23
39
|
dismissLabel;
|
|
40
|
+
/**
|
|
41
|
+
* Whether to show the variant's icon. On by default so the status is not
|
|
42
|
+
* colour-only; turn it off when the surrounding copy already carries the cue
|
|
43
|
+
* and a second marker would be redundant.
|
|
44
|
+
*/
|
|
45
|
+
statusCue = true;
|
|
24
46
|
/**
|
|
25
47
|
* Emitted when the dismiss button is clicked. The alert stays in the DOM —
|
|
26
48
|
* whether to remove it is the consumer's decision. If you do remove it, move
|
|
@@ -33,7 +55,8 @@ export class ChAlert {
|
|
|
33
55
|
};
|
|
34
56
|
render() {
|
|
35
57
|
const role = this.variant === 'warning' ? 'alert' : 'status';
|
|
36
|
-
|
|
58
|
+
const shapes = this.statusCue ? chIcons[VARIANT_ICON[this.variant]] : undefined;
|
|
59
|
+
return (h(Host, { key: '5a14801af29be0634bd35cf8706446a3a5d33286' }, h("div", { key: role, class: { alert: true, [`alert--${this.variant}`]: true }, role: role }, shapes && (h("svg", { key: 'dbaf65b9d7dc08e2ba51b60b273a16ae42eacb02', class: "alert-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)))), h("div", { key: 'ad1c508dea9e3f9e718ec8104f8236065f3eb0e8', class: "alert-content" }, h("slot", { key: '6f906d355fa416b674994716a3ca896ae517f492' })), this.dismissLabel && (h("button", { key: '165af98fa093bda95c785e86c078b69aee2c0580', class: "alert-dismiss", type: "button", "aria-label": this.dismissLabel, onClick: this.handleDismiss }, h("span", { key: '0a05eff2d077559dc267bd72898299c5d42eaf8a', "aria-hidden": "true" }, "\u00D7"))))));
|
|
37
60
|
}
|
|
38
61
|
static get is() { return "ch-alert"; }
|
|
39
62
|
static get encapsulation() { return "shadow"; }
|
|
@@ -93,6 +116,26 @@ export class ChAlert {
|
|
|
93
116
|
"setter": false,
|
|
94
117
|
"reflect": false,
|
|
95
118
|
"attribute": "dismiss-label"
|
|
119
|
+
},
|
|
120
|
+
"statusCue": {
|
|
121
|
+
"type": "boolean",
|
|
122
|
+
"mutable": false,
|
|
123
|
+
"complexType": {
|
|
124
|
+
"original": "boolean",
|
|
125
|
+
"resolved": "boolean",
|
|
126
|
+
"references": {}
|
|
127
|
+
},
|
|
128
|
+
"required": false,
|
|
129
|
+
"optional": false,
|
|
130
|
+
"docs": {
|
|
131
|
+
"tags": [],
|
|
132
|
+
"text": "Whether to show the variant's icon. On by default so the status is not\ncolour-only; turn it off when the surrounding copy already carries the cue\nand a second marker would be redundant."
|
|
133
|
+
},
|
|
134
|
+
"getter": false,
|
|
135
|
+
"setter": false,
|
|
136
|
+
"reflect": false,
|
|
137
|
+
"attribute": "status-cue",
|
|
138
|
+
"defaultValue": "true"
|
|
96
139
|
}
|
|
97
140
|
};
|
|
98
141
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ch-alert.js","sourceRoot":"","sources":["../../../../src/components/ch-alert/ch-alert.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAqB,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"ch-alert.js","sourceRoot":"","sources":["../../../../src/components/ch-alert/ch-alert.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAqB,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAEnF,OAAO,EAAE,OAAO,EAAmB,MAAM,mBAAmB,CAAC;AAI7D;;;;GAIG;AACH,MAAM,YAAY,GAAuC;IACvD,OAAO,EAAE,MAAM;IACf,QAAQ,EAAE,SAAS;IACnB,OAAO,EAAE,OAAO;CACjB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AAMH,MAAM,OAAO,OAAO;IAClB;;;;OAIG;IACK,OAAO,GAAmB,SAAS,CAAC;IAE5C;;;;OAIG;IACK,YAAY,CAAU;IAE9B;;;;OAIG;IACK,SAAS,GAAG,IAAI,CAAC;IAEzB;;;;;OAKG;IACM,SAAS,CAAqB;IAE/B,aAAa,GAAG,GAAG,EAAE;QAC3B,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;IACxB,CAAC,CAAC;IAEF,MAAM;QACJ,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC;QAC7D,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAEhF,OAAO,CACL,EAAC,IAAI;YAIH,WAAK,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,UAAU,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI;gBACjF,MAAM,IAAI,CACT,4DACE,KAAK,EAAC,YAAY,EAClB,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,kBACR,GAAG,oBACD,OAAO,qBACN,OAAO,iBACX,MAAM,EAClB,SAAS,EAAC,OAAO,IAEhB,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAC3C,CACP;gBACD,4DAAK,KAAK,EAAC,eAAe;oBACxB,8DAAa,CACT;gBACL,IAAI,CAAC,YAAY,IAAI,CACpB,+DAAQ,KAAK,EAAC,eAAe,EAAC,IAAI,EAAC,QAAQ,gBAAa,IAAI,CAAC,YAAY,EAAE,OAAO,EAAE,IAAI,CAAC,aAAa;oBACpG,4EAAkB,MAAM,aAAS,CAC1B,CACV,CACG,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, type EventEmitter, Host, Prop, h } from '@stencil/core';\n\nimport { chIcons, type ChIconName } from '../../utils/icons';\n\nexport type ChAlertVariant = 'default' | 'positive' | 'warning';\n\n/**\n * The glyph paired with each variant. It is what makes the variants\n * distinguishable without colour: `default` is informational, `positive`\n * confirms and `warning` warns, and each reads differently in grayscale.\n */\nconst VARIANT_ICON: Record<ChAlertVariant, ChIconName> = {\n default: 'info',\n positive: 'success',\n warning: 'alert',\n};\n\n/**\n * Block-level status message.\n *\n * `warning` carries `role=\"alert\"` and is announced assertively; `default` and\n * `positive` use `role=\"status\"`, since a confirmation is not urgent enough to\n * interrupt. Both announce reliably when the alert is added to the page in\n * response to something — an alert already present at load may not be read out,\n * which is how live regions work rather than something this component controls.\n *\n * Every variant also carries an icon and a thicker leading edge, so the three\n * states stay distinguishable without colour vision. The icon is decorative:\n * the text next to it already says what happened, and announcing \"check\n * circle\" before it would only add noise.\n */\n@Component({\n tag: 'ch-alert',\n styleUrl: 'ch-alert.css',\n shadow: true,\n})\nexport class ChAlert {\n /**\n * The kind of message. `default` is neutral, `positive` confirms, and\n * `warning` covers both warnings and errors — the token scale has a single\n * status colour for the two of them.\n */\n @Prop() variant: ChAlertVariant = 'default';\n\n /**\n * Accessible label for the dismiss button, set as `aria-label`. Setting it\n * is what adds the button: the button's only content is a decorative glyph,\n * so without a label it would have no accessible name at all.\n */\n @Prop() dismissLabel?: string;\n\n /**\n * Whether to show the variant's icon. On by default so the status is not\n * colour-only; turn it off when the surrounding copy already carries the cue\n * and a second marker would be redundant.\n */\n @Prop() statusCue = true;\n\n /**\n * Emitted when the dismiss button is clicked. The alert stays in the DOM —\n * whether to remove it is the consumer's decision. If you do remove it, move\n * focus somewhere sensible first: removing the focused button drops focus to\n * `<body>`.\n */\n @Event() chDismiss: EventEmitter<void>;\n\n private handleDismiss = () => {\n this.chDismiss.emit();\n };\n\n render() {\n const role = this.variant === 'warning' ? 'alert' : 'status';\n const shapes = this.statusCue ? chIcons[VARIANT_ICON[this.variant]] : undefined;\n\n return (\n <Host>\n {/* Keyed on the role so a variant change replaces the node instead of\n mutating its role in place, which assistive technology does not\n reliably re-announce. */}\n <div key={role} class={{ alert: true, [`alert--${this.variant}`]: true }} role={role}>\n {shapes && (\n <svg\n class=\"alert-icon\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n {shapes.map(shape => h(shape.tag, shape.attrs))}\n </svg>\n )}\n <div class=\"alert-content\">\n <slot></slot>\n </div>\n {this.dismissLabel && (\n <button class=\"alert-dismiss\" type=\"button\" aria-label={this.dismissLabel} onClick={this.handleDismiss}>\n <span aria-hidden=\"true\">×</span>\n </button>\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -3,8 +3,11 @@
|
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.badge {
|
|
6
|
-
display: inline-
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
gap: var(--spacing-xs);
|
|
7
9
|
padding: var(--spacing-2xs) var(--spacing-lg);
|
|
10
|
+
border: var(--border-width) solid transparent;
|
|
8
11
|
border-radius: var(--radius-pill);
|
|
9
12
|
font-size: var(--typography-size-xs);
|
|
10
13
|
font-weight: var(--typography-weight-semibold);
|
|
@@ -12,16 +15,42 @@
|
|
|
12
15
|
letter-spacing: var(--typography-tracking-badge);
|
|
13
16
|
}
|
|
14
17
|
|
|
18
|
+
/* The cue is shape first: a badge must not depend on hue to say what state it
|
|
19
|
+
is in, and shape survives grayscale printing and every form of colour-vision
|
|
20
|
+
deficiency. Colour repeats the cue rather than carrying it alone. */
|
|
21
|
+
.badge-dot {
|
|
22
|
+
display: block;
|
|
23
|
+
flex: none;
|
|
24
|
+
width: 0.45em;
|
|
25
|
+
height: 0.45em;
|
|
26
|
+
background: currentColor;
|
|
27
|
+
border-radius: var(--radius-pill);
|
|
28
|
+
}
|
|
29
|
+
|
|
15
30
|
.badge--default {
|
|
16
31
|
background: var(--color-surface-hover);
|
|
17
32
|
color: var(--accent);
|
|
33
|
+
border-color: var(--accent);
|
|
18
34
|
}
|
|
19
35
|
|
|
20
36
|
.badge--positive {
|
|
21
37
|
background: var(--color-status-positive-background);
|
|
22
38
|
color: var(--color-status-positive);
|
|
39
|
+
border-color: var(--color-status-positive);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.badge--positive .badge-dot {
|
|
43
|
+
background: transparent;
|
|
44
|
+
border: var(--border-width) solid currentColor;
|
|
45
|
+
border-radius: var(--radius-pill);
|
|
23
46
|
}
|
|
47
|
+
|
|
24
48
|
.badge--warning {
|
|
25
49
|
background: var(--color-status-warning-background);
|
|
26
50
|
color: var(--color-status-warning);
|
|
51
|
+
border-color: var(--color-status-warning);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.badge--warning .badge-dot {
|
|
55
|
+
border-radius: 0;
|
|
27
56
|
}
|
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* Small status label.
|
|
4
|
+
*
|
|
5
|
+
* Variants are not colour-only: each one also changes the leading dot's shape
|
|
6
|
+
* and adds a matching border, so a badge still says which state it is in when
|
|
7
|
+
* printed in grayscale or seen with colour-vision deficiency. `default` uses a
|
|
8
|
+
* filled dot, `positive` a ring, and `warning` a filled square.
|
|
9
|
+
*/
|
|
2
10
|
export class ChBadge {
|
|
3
11
|
/**
|
|
4
12
|
* The visual style of the badge. Either `default`, `positive`, or `warning`.
|
|
5
13
|
*/
|
|
6
14
|
variant = 'default';
|
|
15
|
+
/**
|
|
16
|
+
* Whether to show the variant marker. On by default so the state does not
|
|
17
|
+
* depend on colour; turn it off for a badge that only repeats text already
|
|
18
|
+
* carrying the meaning.
|
|
19
|
+
*/
|
|
20
|
+
statusCue = true;
|
|
7
21
|
render() {
|
|
8
|
-
return (h(Host, { key: '
|
|
22
|
+
return (h(Host, { key: '4690e03d920f9fd89afc7a37cab1e2c57d26f1f2' }, h("span", { key: '73bac91869bb6e37d1434e7318fd716ffedc2120', class: { badge: true, [`badge--${this.variant}`]: true } }, this.statusCue && h("span", { key: '8272f087de323e6d729a1820d971da6c5dc7c5b5', class: "badge-dot", "aria-hidden": "true" }), h("slot", { key: 'bafc32e7a928fa7c458efb12a08fa0bbf18e83e6' }))));
|
|
9
23
|
}
|
|
10
24
|
static get is() { return "ch-badge"; }
|
|
11
25
|
static get encapsulation() { return "shadow"; }
|
|
@@ -46,6 +60,26 @@ export class ChBadge {
|
|
|
46
60
|
"reflect": false,
|
|
47
61
|
"attribute": "variant",
|
|
48
62
|
"defaultValue": "'default'"
|
|
63
|
+
},
|
|
64
|
+
"statusCue": {
|
|
65
|
+
"type": "boolean",
|
|
66
|
+
"mutable": false,
|
|
67
|
+
"complexType": {
|
|
68
|
+
"original": "boolean",
|
|
69
|
+
"resolved": "boolean",
|
|
70
|
+
"references": {}
|
|
71
|
+
},
|
|
72
|
+
"required": false,
|
|
73
|
+
"optional": false,
|
|
74
|
+
"docs": {
|
|
75
|
+
"tags": [],
|
|
76
|
+
"text": "Whether to show the variant marker. On by default so the state does not\ndepend on colour; turn it off for a badge that only repeats text already\ncarrying the meaning."
|
|
77
|
+
},
|
|
78
|
+
"getter": false,
|
|
79
|
+
"setter": false,
|
|
80
|
+
"reflect": false,
|
|
81
|
+
"attribute": "status-cue",
|
|
82
|
+
"defaultValue": "true"
|
|
49
83
|
}
|
|
50
84
|
};
|
|
51
85
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ch-badge.js","sourceRoot":"","sources":["../../../../src/components/ch-badge/ch-badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"ch-badge.js","sourceRoot":"","sources":["../../../../src/components/ch-badge/ch-badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAIzD;;;;;;;GAOG;AAMH,MAAM,OAAO,OAAO;IAClB;;OAEG;IACK,OAAO,GAAmB,SAAS,CAAC;IAE5C;;;;OAIG;IACK,SAAS,GAAG,IAAI,CAAC;IAEzB,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH,6DAAM,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,UAAU,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE;gBAC3D,IAAI,CAAC,SAAS,IAAI,6DAAM,KAAK,EAAC,WAAW,iBAAa,MAAM,GAAQ;gBACrE,8DAAa,CACR,CACF,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\n\nexport type ChBadgeVariant = 'default' | 'positive' | 'warning';\n\n/**\n * Small status label.\n *\n * Variants are not colour-only: each one also changes the leading dot's shape\n * and adds a matching border, so a badge still says which state it is in when\n * printed in grayscale or seen with colour-vision deficiency. `default` uses a\n * filled dot, `positive` a ring, and `warning` a filled square.\n */\n@Component({\n tag: 'ch-badge',\n styleUrl: 'ch-badge.css',\n shadow: true,\n})\nexport class ChBadge {\n /**\n * The visual style of the badge. Either `default`, `positive`, or `warning`.\n */\n @Prop() variant: ChBadgeVariant = 'default';\n\n /**\n * Whether to show the variant marker. On by default so the state does not\n * depend on colour; turn it off for a badge that only repeats text already\n * carrying the meaning.\n */\n @Prop() statusCue = true;\n\n render() {\n return (\n <Host>\n <span class={{ badge: true, [`badge--${this.variant}`]: true }}>\n {this.statusCue && <span class=\"badge-dot\" aria-hidden=\"true\"></span>}\n <slot></slot>\n </span>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { hasLightDomText, warnMissingName } from "../../utils/accessibility";
|
|
2
3
|
export class ChButton {
|
|
4
|
+
el;
|
|
3
5
|
/**
|
|
4
6
|
* The visual style of the button. One of `primary`, `secondary`, `ghost`,
|
|
5
7
|
* or `danger`.
|
|
@@ -32,7 +34,8 @@ export class ChButton {
|
|
|
32
34
|
/**
|
|
33
35
|
* Accessible label set as `aria-label` on the native element. Use it when
|
|
34
36
|
* the button's content doesn't convey its purpose on its own (e.g. an
|
|
35
|
-
* icon-only button).
|
|
37
|
+
* icon-only button). Omitting it on an icon-only button logs a warning in
|
|
38
|
+
* development builds.
|
|
36
39
|
*/
|
|
37
40
|
label;
|
|
38
41
|
/**
|
|
@@ -53,6 +56,9 @@ export class ChButton {
|
|
|
53
56
|
return [this.loading ? h("ch-spinner", { size: this.spinnerSize }) : h("slot", { name: "start" }), h("slot", null), h("slot", { name: "end" })];
|
|
54
57
|
}
|
|
55
58
|
render() {
|
|
59
|
+
if (!this.label && !hasLightDomText(this.el)) {
|
|
60
|
+
warnMissingName(this.el, 'ch-button', 'pass label for an icon-only button');
|
|
61
|
+
}
|
|
56
62
|
const classes = {
|
|
57
63
|
'btn': true,
|
|
58
64
|
[`btn--${this.variant}`]: true,
|
|
@@ -223,7 +229,7 @@ export class ChButton {
|
|
|
223
229
|
"optional": true,
|
|
224
230
|
"docs": {
|
|
225
231
|
"tags": [],
|
|
226
|
-
"text": "Accessible label set as `aria-label` on the native element. Use it when\nthe button's content doesn't convey its purpose on its own (e.g. an\nicon-only button)."
|
|
232
|
+
"text": "Accessible label set as `aria-label` on the native element. Use it when\nthe button's content doesn't convey its purpose on its own (e.g. an\nicon-only button). Omitting it on an icon-only button logs a warning in\ndevelopment builds."
|
|
227
233
|
},
|
|
228
234
|
"getter": false,
|
|
229
235
|
"setter": false,
|
|
@@ -255,5 +261,6 @@ export class ChButton {
|
|
|
255
261
|
}
|
|
256
262
|
}];
|
|
257
263
|
}
|
|
264
|
+
static get elementRef() { return "el"; }
|
|
258
265
|
}
|
|
259
266
|
//# sourceMappingURL=ch-button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ch-button.js","sourceRoot":"","sources":["../../../../src/components/ch-button/ch-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAqB,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"ch-button.js","sourceRoot":"","sources":["../../../../src/components/ch-button/ch-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AI,IAAI,CAAC,OAAO,gBAC3B,IAAI,CAAC,KAAK,eACX,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC5C,OAAO,EAAE,IAAI,CAAC,WAAW,IAExB,IAAI,CAAC,aAAa,EAAE,CACd,CACJ,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, type EventEmitter, Host, Prop, h } from '@stencil/core';\n\nimport { hasLightDomText, warnMissingName } from '../../utils/accessibility';\n\nexport type ChButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';\nexport type ChButtonSize = 'sm' | 'md' | 'lg';\n\n@Component({\n tag: 'ch-button',\n styleUrl: 'ch-button.css',\n shadow: true,\n})\nexport class ChButton {\n @Element() el: HTMLChButtonElement;\n\n /**\n * The visual style of the button. One of `primary`, `secondary`, `ghost`,\n * or `danger`.\n */\n @Prop() variant: ChButtonVariant = 'primary';\n\n /**\n * The size of the button. One of `sm`, `md`, or `lg`.\n */\n @Prop() size: ChButtonSize = 'md';\n\n /**\n * Whether the button is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Whether the button is loading. Shows a spinner, disables interaction, and\n * announces the busy state with `aria-busy`.\n */\n @Prop() loading = false;\n\n /**\n * When set, the button renders as an `<a>` pointing to this URL while\n * keeping the button styling.\n */\n @Prop() href?: string;\n\n /**\n * The browsing context the link opens in (e.g. `_blank`). Only used when\n * `href` is set. For `_blank`, a `noopener noreferrer` `rel` is added\n * automatically.\n */\n @Prop() target?: string;\n\n /**\n * Accessible label set as `aria-label` on the native element. Use it when\n * the button's content doesn't convey its purpose on its own (e.g. an\n * icon-only button). Omitting it on an icon-only button logs a warning in\n * development builds.\n */\n @Prop() label?: string;\n\n /**\n * Emitted when the button is clicked.\n */\n @Event() chClick: EventEmitter<MouseEvent>;\n\n private handleClick = (ev: MouseEvent) => {\n if (this.disabled || this.loading) {\n ev.preventDefault();\n return;\n }\n this.chClick.emit(ev);\n };\n\n private get spinnerSize() {\n return this.size === 'lg' ? 'md' : 'sm';\n }\n\n private renderContent() {\n return [this.loading ? <ch-spinner size={this.spinnerSize}></ch-spinner> : <slot name=\"start\"></slot>, <slot></slot>, <slot name=\"end\"></slot>];\n }\n\n render() {\n if (!this.label && !hasLightDomText(this.el)) {\n warnMissingName(this.el, 'ch-button', 'pass label for an icon-only button');\n }\n\n const classes = {\n 'btn': true,\n [`btn--${this.variant}`]: true,\n [`btn--${this.size}`]: true,\n 'btn--loading': this.loading,\n };\n\n if (this.href && !this.disabled && !this.loading) {\n return (\n <Host>\n <a\n class={classes}\n href={this.href}\n target={this.target}\n rel={this.target === '_blank' ? 'noopener noreferrer' : undefined}\n aria-label={this.label}\n onClick={this.handleClick}\n >\n {this.renderContent()}\n </a>\n </Host>\n );\n }\n\n if (this.href) {\n return (\n <Host>\n <span class={{ ...classes, 'btn--disabled': true }} aria-label={this.label} aria-disabled=\"true\" aria-busy={this.loading ? 'true' : undefined}>\n {this.renderContent()}\n </span>\n </Host>\n );\n }\n\n return (\n <Host>\n <button\n class={classes}\n type=\"button\"\n disabled={this.disabled || this.loading}\n aria-label={this.label}\n aria-busy={this.loading ? 'true' : undefined}\n onClick={this.handleClick}\n >\n {this.renderContent()}\n </button>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
export class ChCard {
|
|
3
3
|
render() {
|
|
4
|
-
return (h(Host, { key: '
|
|
4
|
+
return (h(Host, { key: 'b3952612583c8f61076164d3795b56d54b023a77' }, h("div", { key: 'd0f58a9f84006c942ef9b27926f8cfa3138ad7d2', class: "card" }, h("slot", { key: '9b1b54af6c5ff58417732764d4fcb8a8114348c4' }))));
|
|
5
5
|
}
|
|
6
6
|
static get is() { return "ch-card"; }
|
|
7
7
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { resolveValidity } from "../../utils/validation-message";
|
|
2
3
|
let checkboxIds = 0;
|
|
3
4
|
export class ChCheckbox {
|
|
4
5
|
checkboxId = `ch-checkbox-${++checkboxIds}`;
|
|
@@ -60,15 +61,12 @@ export class ChCheckbox {
|
|
|
60
61
|
return;
|
|
61
62
|
}
|
|
62
63
|
internals.setFormValue(this.checked ? this.value : null);
|
|
63
|
-
const flags = {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
flags.customError = true;
|
|
70
|
-
}
|
|
71
|
-
message = this.errorMessage ?? (flags.valueMissing ? 'Please fill out this field.' : undefined);
|
|
64
|
+
const { flags, message } = resolveValidity({
|
|
65
|
+
required: this.required,
|
|
66
|
+
empty: !this.checked,
|
|
67
|
+
invalid: this.invalid,
|
|
68
|
+
errorMessage: this.errorMessage,
|
|
69
|
+
});
|
|
72
70
|
internals.setValidity(flags, message);
|
|
73
71
|
}
|
|
74
72
|
componentDidLoad() {
|
|
@@ -97,7 +95,7 @@ export class ChCheckbox {
|
|
|
97
95
|
return undefined;
|
|
98
96
|
}
|
|
99
97
|
render() {
|
|
100
|
-
return (h(Host, { key: '
|
|
98
|
+
return (h(Host, { key: '5246c3e6798a4ad0407f3b817ca1b83ab786ca1e' }, h("label", { key: 'c3fda492b9c61c81fd3c7afe62e5c379f783ff28', class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled }, htmlFor: this.checkboxId }, h("input", { key: 'd77cdf632cbe58c74719567a52fbe224fcceca0b', id: this.checkboxId, class: { 'input': true, 'input--invalid': this.invalid }, type: "checkbox", name: this.name, value: this.value, checked: this.checked, disabled: this.disabled || this.formDisabled, required: this.required, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }), this.label && h("span", { key: 'b2707475cc9b3f1e70044566e16ce1b90facabc6', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (h("p", { key: 'f597fbea344370911f71f2360db4eb0e57d3999d', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: '75082edd8a5a477c7c95365e6e2da66f6b69d6cc', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
101
99
|
}
|
|
102
100
|
static get is() { return "ch-checkbox"; }
|
|
103
101
|
static get encapsulation() { return "shadow"; }
|