@devschile/chucao 2.6.0 → 2.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. package/dist/chucao/chucao.esm.js +1 -1
  2. package/dist/chucao/{p-ffaf1a31.entry.js → p-01b6c7bf.entry.js} +2 -2
  3. package/dist/chucao/{p-2c1bc8bd.entry.js → p-0c7f6f8d.entry.js} +2 -2
  4. package/dist/chucao/p-10f6801e.entry.js +2 -0
  5. package/dist/chucao/p-10f6801e.entry.js.map +1 -0
  6. package/dist/chucao/{p-0409c063.entry.js → p-15d27bb7.entry.js} +2 -2
  7. package/dist/chucao/{p-e6f959f4.entry.js → p-1b70e3f1.entry.js} +2 -2
  8. package/dist/chucao/{p-66ae9e2c.entry.js → p-1e4cd3aa.entry.js} +2 -2
  9. package/dist/chucao/{p-c1b35f1b.entry.js → p-2e37c61b.entry.js} +2 -2
  10. package/dist/chucao/{p-f7305552.entry.js → p-42028c97.entry.js} +2 -2
  11. package/dist/chucao/{p-090d26f1.entry.js → p-472ec451.entry.js} +2 -2
  12. package/dist/chucao/{p-81b6622f.entry.js → p-5240f5ac.entry.js} +2 -2
  13. package/dist/chucao/p-60e1c1df.entry.js +2 -0
  14. package/dist/chucao/{p-b56f4a29.entry.js.map → p-60e1c1df.entry.js.map} +1 -1
  15. package/dist/chucao/{p-b9b47942.entry.js → p-7cdc71cc.entry.js} +2 -2
  16. package/dist/chucao/{p-50cbea7f.entry.js → p-8ae680a4.entry.js} +2 -2
  17. package/dist/chucao/{p-20ea1b18.entry.js → p-90284ebe.entry.js} +2 -2
  18. package/dist/chucao/p-9db118d9.entry.js +2 -0
  19. package/dist/chucao/p-9ebcc7be.entry.js +2 -0
  20. package/dist/chucao/p-9ebcc7be.entry.js.map +1 -0
  21. package/dist/chucao/{p-207648f9.entry.js → p-a7c674b7.entry.js} +2 -2
  22. package/dist/chucao/{p-79f20bfd.entry.js → p-c4b2bd1f.entry.js} +2 -2
  23. package/dist/chucao/{p-7d4336bd.entry.js → p-c90da3c0.entry.js} +2 -2
  24. package/dist/chucao/p-d8b71751.entry.js +2 -0
  25. package/dist/chucao/p-d8b71751.entry.js.map +1 -0
  26. package/dist/chucao/{p-925af6b8.entry.js → p-deb2571b.entry.js} +2 -2
  27. package/dist/chucao/{p-9794a3fa.entry.js → p-e77d35c3.entry.js} +2 -2
  28. package/dist/chucao/{p-21ca2235.entry.js → p-f6ab0a11.entry.js} +2 -2
  29. package/dist/chucao/p-f917d34f.entry.js +2 -0
  30. package/dist/chucao/{p-e2f725bd.entry.js.map → p-f917d34f.entry.js.map} +1 -1
  31. package/dist/chucao/{p-f0aea6ed.entry.js → p-ffecdf25.entry.js} +2 -2
  32. package/dist/cjs/ch-accordion.cjs.entry.js +1 -1
  33. package/dist/cjs/ch-alert_8.cjs.entry.js +7 -7
  34. package/dist/cjs/ch-checkbox.cjs.entry.js +1 -1
  35. package/dist/cjs/ch-cluster.cjs.entry.js +2 -2
  36. package/dist/cjs/ch-description-list.cjs.entry.js +1 -1
  37. package/dist/cjs/ch-divider.cjs.entry.js +1 -1
  38. package/dist/cjs/ch-drawer.cjs.entry.js +1 -1
  39. package/dist/cjs/ch-emoji.cjs.entry.js +1 -1
  40. package/dist/cjs/ch-empty-state.cjs.entry.js +1 -1
  41. package/dist/cjs/ch-grid.cjs.entry.js +1 -1
  42. package/dist/cjs/ch-icon-button.cjs.entry.js +1 -1
  43. package/dist/cjs/ch-icon.cjs.entry.js +1 -1
  44. package/dist/cjs/ch-modal.cjs.entry.js +1 -1
  45. package/dist/cjs/ch-number-input.cjs.entry.js +237 -0
  46. package/dist/cjs/ch-number-input.cjs.entry.js.map +1 -0
  47. package/dist/cjs/ch-page-header.cjs.entry.js +1 -1
  48. package/dist/cjs/ch-radio.cjs.entry.js +1 -1
  49. package/dist/cjs/ch-segmented-control.cjs.entry.js +1 -1
  50. package/dist/cjs/ch-skeleton.cjs.entry.js +1 -1
  51. package/dist/cjs/ch-stack.cjs.entry.js +1 -1
  52. package/dist/cjs/ch-stat.cjs.entry.js +2 -2
  53. package/dist/cjs/ch-table.cjs.entry.js +145 -0
  54. package/dist/cjs/ch-table.cjs.entry.js.map +1 -0
  55. package/dist/cjs/ch-tabs.cjs.entry.js +1 -1
  56. package/dist/cjs/ch-textarea.cjs.entry.js +1 -1
  57. package/dist/cjs/ch-timeline.cjs.entry.js +1 -1
  58. package/dist/cjs/ch-tooltip.cjs.entry.js +24 -7
  59. package/dist/cjs/ch-tooltip.cjs.entry.js.map +1 -1
  60. package/dist/cjs/chucao.cjs.js +1 -1
  61. package/dist/cjs/loader.cjs.js +1 -1
  62. package/dist/collection/collection-manifest.json +2 -0
  63. package/dist/collection/components/ch-accordion/ch-accordion.js +1 -1
  64. package/dist/collection/components/ch-alert/ch-alert.js +1 -1
  65. package/dist/collection/components/ch-badge/ch-badge.js +1 -1
  66. package/dist/collection/components/ch-card/ch-card.js +1 -1
  67. package/dist/collection/components/ch-checkbox/ch-checkbox.js +1 -1
  68. package/dist/collection/components/ch-cluster/ch-cluster.js +2 -2
  69. package/dist/collection/components/ch-description-list/ch-description-list.js +1 -1
  70. package/dist/collection/components/ch-divider/ch-divider.js +1 -1
  71. package/dist/collection/components/ch-drawer/ch-drawer.js +1 -1
  72. package/dist/collection/components/ch-emoji/ch-emoji.js +1 -1
  73. package/dist/collection/components/ch-empty-state/ch-empty-state.js +1 -1
  74. package/dist/collection/components/ch-grid/ch-grid.js +1 -1
  75. package/dist/collection/components/ch-icon/ch-icon.js +1 -1
  76. package/dist/collection/components/ch-icon-button/ch-icon-button.js +1 -1
  77. package/dist/collection/components/ch-input/ch-input.js +1 -1
  78. package/dist/collection/components/ch-modal/ch-modal.js +1 -1
  79. package/dist/collection/components/ch-number-input/ch-number-input.css +74 -0
  80. package/dist/collection/components/ch-number-input/ch-number-input.js +555 -0
  81. package/dist/collection/components/ch-number-input/ch-number-input.js.map +1 -0
  82. package/dist/collection/components/ch-page-header/ch-page-header.js +1 -1
  83. package/dist/collection/components/ch-radio/ch-radio.js +1 -1
  84. package/dist/collection/components/ch-segmented-control/ch-segmented-control.js +1 -1
  85. package/dist/collection/components/ch-select/ch-select.js +1 -1
  86. package/dist/collection/components/ch-skeleton/ch-skeleton.js +1 -1
  87. package/dist/collection/components/ch-spinner/ch-spinner.js +1 -1
  88. package/dist/collection/components/ch-stack/ch-stack.js +1 -1
  89. package/dist/collection/components/ch-stat/ch-stat.js +2 -2
  90. package/dist/collection/components/ch-switch/ch-switch.js +1 -1
  91. package/dist/collection/components/ch-table/ch-table.css +107 -0
  92. package/dist/collection/components/ch-table/ch-table.js +347 -0
  93. package/dist/collection/components/ch-table/ch-table.js.map +1 -0
  94. package/dist/collection/components/ch-tabs/ch-tabs.js +1 -1
  95. package/dist/collection/components/ch-textarea/ch-textarea.js +1 -1
  96. package/dist/collection/components/ch-timeline/ch-timeline.js +1 -1
  97. package/dist/collection/components/ch-tooltip/ch-tooltip.css +11 -0
  98. package/dist/collection/components/ch-tooltip/ch-tooltip.js +23 -6
  99. package/dist/collection/components/ch-tooltip/ch-tooltip.js.map +1 -1
  100. package/dist/collection/utils/overlay.js.map +1 -1
  101. package/dist/components/ch-accordion.js +1 -1
  102. package/dist/components/ch-alert.js +1 -1
  103. package/dist/components/ch-badge.js +1 -1
  104. package/dist/components/ch-button.js +1 -1
  105. package/dist/components/ch-card.js +1 -1
  106. package/dist/components/ch-card.js.map +1 -1
  107. package/dist/components/ch-checkbox.js +1 -1
  108. package/dist/components/ch-cluster.js +1 -1
  109. package/dist/components/ch-description-list.js +1 -1
  110. package/dist/components/ch-divider.js +1 -1
  111. package/dist/components/ch-drawer.js +1 -1
  112. package/dist/components/ch-emoji.js +1 -1
  113. package/dist/components/ch-empty-state.js +1 -1
  114. package/dist/components/ch-grid.js +1 -1
  115. package/dist/components/ch-icon-button.js +1 -1
  116. package/dist/components/ch-icon.js +1 -1
  117. package/dist/components/ch-input.js +1 -1
  118. package/dist/components/ch-modal.js +1 -1
  119. package/dist/components/ch-number-input.d.ts +11 -0
  120. package/dist/components/ch-number-input.js +2 -0
  121. package/dist/components/ch-number-input.js.map +1 -0
  122. package/dist/components/ch-page-header.js +1 -1
  123. package/dist/components/ch-radio.js +1 -1
  124. package/dist/components/ch-segmented-control.js +1 -1
  125. package/dist/components/ch-select.js +1 -1
  126. package/dist/components/ch-skeleton.js +1 -1
  127. package/dist/components/ch-spinner.js +1 -1
  128. package/dist/components/ch-stack.js +1 -1
  129. package/dist/components/ch-stat.js +1 -1
  130. package/dist/components/ch-switch.js +1 -1
  131. package/dist/components/ch-table.d.ts +11 -0
  132. package/dist/components/ch-table.js +2 -0
  133. package/dist/components/ch-table.js.map +1 -0
  134. package/dist/components/ch-tabs.js +1 -1
  135. package/dist/components/ch-textarea.js +1 -1
  136. package/dist/components/ch-timeline.js +1 -1
  137. package/dist/components/ch-tooltip.js +1 -1
  138. package/dist/components/ch-tooltip.js.map +1 -1
  139. package/dist/components/{p-Cw0b4OGc.js → p-DiUN1WGc.js} +2 -2
  140. package/dist/esm/ch-accordion.entry.js +1 -1
  141. package/dist/esm/ch-alert_8.entry.js +7 -7
  142. package/dist/esm/ch-checkbox.entry.js +1 -1
  143. package/dist/esm/ch-cluster.entry.js +2 -2
  144. package/dist/esm/ch-description-list.entry.js +1 -1
  145. package/dist/esm/ch-divider.entry.js +1 -1
  146. package/dist/esm/ch-drawer.entry.js +1 -1
  147. package/dist/esm/ch-emoji.entry.js +1 -1
  148. package/dist/esm/ch-empty-state.entry.js +1 -1
  149. package/dist/esm/ch-grid.entry.js +1 -1
  150. package/dist/esm/ch-icon-button.entry.js +1 -1
  151. package/dist/esm/ch-icon.entry.js +1 -1
  152. package/dist/esm/ch-modal.entry.js +1 -1
  153. package/dist/esm/ch-number-input.entry.js +235 -0
  154. package/dist/esm/ch-number-input.entry.js.map +1 -0
  155. package/dist/esm/ch-page-header.entry.js +1 -1
  156. package/dist/esm/ch-radio.entry.js +1 -1
  157. package/dist/esm/ch-segmented-control.entry.js +1 -1
  158. package/dist/esm/ch-skeleton.entry.js +1 -1
  159. package/dist/esm/ch-stack.entry.js +1 -1
  160. package/dist/esm/ch-stat.entry.js +2 -2
  161. package/dist/esm/ch-table.entry.js +143 -0
  162. package/dist/esm/ch-table.entry.js.map +1 -0
  163. package/dist/esm/ch-tabs.entry.js +1 -1
  164. package/dist/esm/ch-textarea.entry.js +1 -1
  165. package/dist/esm/ch-timeline.entry.js +1 -1
  166. package/dist/esm/ch-tooltip.entry.js +24 -7
  167. package/dist/esm/ch-tooltip.entry.js.map +1 -1
  168. package/dist/esm/chucao.js +1 -1
  169. package/dist/esm/loader.js +1 -1
  170. package/dist/types/components/ch-number-input/ch-number-input.d.ts +105 -0
  171. package/dist/types/components/ch-table/ch-table.d.ts +106 -0
  172. package/dist/types/components/ch-tooltip/ch-tooltip.d.ts +7 -0
  173. package/dist/types/components.d.ts +459 -0
  174. package/dist/types/utils/overlay.d.ts +1 -1
  175. package/dist-react/components.d.ts +15 -1
  176. package/dist-react/components.js +21 -0
  177. package/dist-react/components.ts +31 -1
  178. package/dist-vue/index.d.ts +2 -0
  179. package/dist-vue/index.js +33 -0
  180. package/dist-vue/index.ts +37 -0
  181. package/hydrate/index.js +519 -37
  182. package/hydrate/index.mjs +519 -37
  183. package/package.json +9 -1
  184. package/dist/chucao/p-370d9629.entry.js +0 -2
  185. package/dist/chucao/p-370d9629.entry.js.map +0 -1
  186. package/dist/chucao/p-95061461.entry.js +0 -2
  187. package/dist/chucao/p-b56f4a29.entry.js +0 -2
  188. package/dist/chucao/p-e2f725bd.entry.js +0 -2
  189. /package/dist/chucao/{p-ffaf1a31.entry.js.map → p-01b6c7bf.entry.js.map} +0 -0
  190. /package/dist/chucao/{p-2c1bc8bd.entry.js.map → p-0c7f6f8d.entry.js.map} +0 -0
  191. /package/dist/chucao/{p-0409c063.entry.js.map → p-15d27bb7.entry.js.map} +0 -0
  192. /package/dist/chucao/{p-e6f959f4.entry.js.map → p-1b70e3f1.entry.js.map} +0 -0
  193. /package/dist/chucao/{p-66ae9e2c.entry.js.map → p-1e4cd3aa.entry.js.map} +0 -0
  194. /package/dist/chucao/{p-c1b35f1b.entry.js.map → p-2e37c61b.entry.js.map} +0 -0
  195. /package/dist/chucao/{p-f7305552.entry.js.map → p-42028c97.entry.js.map} +0 -0
  196. /package/dist/chucao/{p-090d26f1.entry.js.map → p-472ec451.entry.js.map} +0 -0
  197. /package/dist/chucao/{p-81b6622f.entry.js.map → p-5240f5ac.entry.js.map} +0 -0
  198. /package/dist/chucao/{p-b9b47942.entry.js.map → p-7cdc71cc.entry.js.map} +0 -0
  199. /package/dist/chucao/{p-50cbea7f.entry.js.map → p-8ae680a4.entry.js.map} +0 -0
  200. /package/dist/chucao/{p-20ea1b18.entry.js.map → p-90284ebe.entry.js.map} +0 -0
  201. /package/dist/chucao/{p-95061461.entry.js.map → p-9db118d9.entry.js.map} +0 -0
  202. /package/dist/chucao/{p-207648f9.entry.js.map → p-a7c674b7.entry.js.map} +0 -0
  203. /package/dist/chucao/{p-79f20bfd.entry.js.map → p-c4b2bd1f.entry.js.map} +0 -0
  204. /package/dist/chucao/{p-7d4336bd.entry.js.map → p-c90da3c0.entry.js.map} +0 -0
  205. /package/dist/chucao/{p-925af6b8.entry.js.map → p-deb2571b.entry.js.map} +0 -0
  206. /package/dist/chucao/{p-9794a3fa.entry.js.map → p-e77d35c3.entry.js.map} +0 -0
  207. /package/dist/chucao/{p-21ca2235.entry.js.map → p-f6ab0a11.entry.js.map} +0 -0
  208. /package/dist/chucao/{p-f0aea6ed.entry.js.map → p-ffecdf25.entry.js.map} +0 -0
  209. /package/dist/components/{p-Cw0b4OGc.js.map → p-DiUN1WGc.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"names":["chNumberInputCss","numberInputIds","ChNumberInput","__stencil_proxyCustomElement","HTMLElement","inputId","hintId","this","errorId","initialValue","internals","formDisabled","label","value","format","placeholder","name","disabled","required","min","max","step","hint","errorMessage","invalid","chInput","chChange","draft","typing","componentWillLoad","formatDisplay","decimals","digits","replace","Number","toLocaleString","toCanonical","text","normalised","match","exec","isEmpty","test","canonical","numericValue","outOfRange","parsed","undefined","rangeError","isNaN","syncForm","setFormValue","base","resolveValidity","empty","rangeMessage","setValidity","flags","badInput","message","componentDidLoad","host","addEventListener","markTouched","setAttribute","formResetCallback","input","shadowRoot","querySelector","formDisabledCallback","isDisabled","commit","emit","handleInput","ev","target","handleChange","handleBlur","isInvalid","describedBy","render","showError","h","Host","key","class","htmlFor","id","type","inputMode","onInput","onChange","onBlur","role"],"sources":["src/components/ch-number-input/ch-number-input.css?tag=ch-number-input&encapsulation=shadow","src/components/ch-number-input/ch-number-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","import { AttachInternals, Component, Element, Event, type EventEmitter, Host, Prop, State, Watch, h } from '@stencil/core';\n\nimport { resolveValidity } from '../../utils/validation-message';\n\nexport type ChNumberInputFormat = 'plain' | 'clp';\n\nexport type ChNumberInputStep = number | 'any';\n\nlet numberInputIds = 0;\n\n/**\n * Numeric input that keeps what the user is typing separate from the value the\n * form submits.\n *\n * The display is formatted (`1.234.567` for CLP) while `value` and `FormData`\n * carry a canonical machine-readable string: digits only for CLP, the plain\n * decimal for `plain`. Parsing on every keystroke cannot represent the\n * intermediate states people actually type — `-`, `1.`, `0,` — so those stay as\n * text and are validated at the end.\n *\n * Empty is not zero. A cleared field submits `''` and reports `valueMissing`\n * when required; it never becomes `0`.\n *\n * There is no separate currency component: `format=\"clp\"` is the currency\n * boundary for Chilean pesos, the only case with a real consumer.\n */\n@Component({\n tag: 'ch-number-input',\n styleUrl: 'ch-number-input.css',\n shadow: true,\n formAssociated: true,\n})\nexport class ChNumberInput {\n private readonly inputId = `ch-number-input-${++numberInputIds}`;\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 /**\n * Canonical value: digits only for `clp`, a plain decimal string for `plain`.\n * Never formatted — formatting lives in the rendered text.\n */\n @Prop({ mutable: true }) value = '';\n\n /** How the number is displayed while typing. */\n @Prop() format: ChNumberInputFormat = 'plain';\n\n /** Placeholder shown when the field is 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 value is required; an empty field is then invalid. */\n @Prop({ reflect: true }) required = false;\n\n /** Minimum accepted value. */\n @Prop() min?: number;\n\n /** Maximum accepted value. */\n @Prop() max?: number;\n\n /** Stepping increment. `'any'` disables stepping validation. */\n @Prop() step: ChNumberInputStep = 'any';\n\n /** Helper text, replaced by `errorMessage` when invalid. */\n @Prop() hint?: string;\n\n /** Custom error message; wins over the built-in range messages. */\n @Prop() errorMessage?: string;\n\n /** Whether the field is marked invalid by the consumer. */\n @Prop() invalid = false;\n\n /** Emitted on every keystroke with the canonical value. */\n @Event() chInput: EventEmitter<string>;\n\n /** Emitted on commit (native `change`) with the canonical value. */\n @Event() chChange: EventEmitter<string>;\n\n /**\n * The text in the input, which may be a partial number like `-` or `1.`.\n * This is the only thing rendered, so it is also what a reset must restore.\n */\n @State() private draft = '';\n\n /**\n * Whether the user has typed since the last commit. While false the input\n * renders `value` directly, which is what makes `formResetCallback` and a\n * consumer assigning `.value` repaint without extra bookkeeping.\n */\n @State() private typing = false;\n\n componentWillLoad() {\n this.draft = this.formatDisplay(this.value);\n }\n\n private get decimals(): boolean {\n return this.format !== 'clp';\n }\n\n /** Formats a canonical value for display. */\n private formatDisplay(value: string): string {\n if (value === '') {\n return '';\n }\n if (this.format === 'clp') {\n const digits = value.replace(/\\D/gu, '');\n return digits === '' ? '' : Number(digits).toLocaleString('es-CL');\n }\n return value;\n }\n\n /**\n * Strips display formatting back to the canonical string: digits only for\n * CLP; a leading sign, digits and one decimal separator for `plain`.\n */\n private toCanonical(text: string): string {\n if (this.format === 'clp') {\n return text.replace(/\\D/gu, '');\n }\n const normalised = text.replace(/\\s/gu, '').replace(',', '.');\n const match = /^-?\\d*(?:\\.\\d*)?/u.exec(normalised);\n return match ? match[0] : '';\n }\n\n /**\n * Whether the field holds a real number. A draft that is only a sign or a\n * separator (`-`, `.`) is still being typed and submits as empty.\n */\n private get isEmpty(): boolean {\n return !/^-?\\d/u.test(this.toCanonical(this.draft));\n }\n\n /** What the form receives and `value` exposes. */\n private get canonical(): string {\n return this.isEmpty ? '' : this.toCanonical(this.draft);\n }\n\n private get numericValue(): number {\n return Number(this.canonical);\n }\n\n /** The message for a value outside `min`/`max`, if there is one. */\n private outOfRange(parsed: number): string | undefined {\n const { min, max } = this;\n if (min !== undefined && parsed < min) {\n return `Enter a value of at least ${min}.`;\n }\n if (max !== undefined && parsed > max) {\n return `Enter a value of at most ${max}.`;\n }\n return undefined;\n }\n\n private rangeError(): string | undefined {\n if (this.errorMessage || this.isEmpty || this.invalid) {\n return undefined;\n }\n const parsed = this.numericValue;\n return Number.isNaN(parsed) ? 'Enter a valid number.' : this.outOfRange(parsed);\n }\n\n @Watch('required')\n @Watch('invalid')\n @Watch('errorMessage')\n @Watch('min')\n @Watch('max')\n protected syncForm(): void {\n const { internals, required, invalid, errorMessage, canonical } = this;\n if (typeof internals?.setFormValue !== 'function') {\n return;\n }\n internals.setFormValue(canonical);\n\n const base = resolveValidity({ required, empty: canonical === '', invalid, errorMessage });\n const rangeMessage = this.rangeError();\n if (rangeMessage) {\n internals.setValidity({ ...base.flags, badInput: true }, rangeMessage);\n return;\n }\n internals.setValidity(base.flags, base.message);\n }\n\n componentDidLoad() {\n this.initialValue = this.value;\n this.syncForm();\n this.host.addEventListener('change', this.markTouched);\n this.host.addEventListener('focusout', this.markTouched);\n this.host.addEventListener('invalid', this.markTouched);\n }\n\n private markTouched = (): void => {\n this.host.setAttribute('data-touched', '');\n };\n\n formResetCallback(): void {\n this.value = this.initialValue;\n this.draft = this.formatDisplay(this.initialValue);\n this.typing = false;\n this.syncForm();\n // The vdom does not push a re-rendered `value` onto a live `<input>`: the\n // property is set by the browser's own typing and the diff sees no change.\n // A reset restores the text directly.\n const input = this.host.shadowRoot?.querySelector('input');\n if (input) {\n input.value = this.formatDisplay(this.initialValue);\n }\n }\n\n formDisabledCallback(isDisabled: boolean): void {\n this.formDisabled = isDisabled;\n }\n\n private commit(text: string): void {\n this.typing = true;\n this.draft = text;\n this.value = this.canonical;\n this.chInput.emit(this.value);\n this.syncForm();\n }\n\n private handleInput = (ev: InputEvent) => {\n this.commit((ev.target as HTMLInputElement).value);\n };\n\n private handleChange = (ev: Event) => {\n this.commit((ev.target as HTMLInputElement).value);\n this.chChange.emit(this.value);\n };\n\n /** Reformats grouped CLP digits once the field loses focus. */\n private handleBlur = () => {\n if (this.format === 'clp') {\n this.draft = this.formatDisplay(this.canonical);\n }\n };\n\n private get isInvalid(): boolean {\n return this.invalid || this.rangeError() !== 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 // `text` with `inputmode`, not `type=\"number\"`: a number input drops\n // partial values and cannot show grouped digits.\n type=\"text\"\n inputMode={this.decimals ? 'decimal' : 'numeric'}\n name={this.name}\n placeholder={this.placeholder}\n disabled={this.disabled || this.formDisabled}\n required={this.required}\n value={this.typing ? this.draft : this.formatDisplay(this.value)}\n aria-invalid={this.isInvalid ? 'true' : undefined}\n aria-describedby={this.describedBy}\n onInput={this.handleInput}\n onChange={this.handleChange}\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"],"mappings":"2GAAA,MAAMA,EAAmB,IAAM,s4CCQ/B,IAAIC,EAAiB,E,MAwBRC,EAAaC,EAAA,MAAAD,UAAAE,E,uLACPC,QAAU,qBAAqBJ,IAC/BK,OAAS,GAAGC,KAAKF,eACjBG,QAAU,GAAGD,KAAKF,gBAC3BI,aAAe,GAEJC,UACVC,aAAe,M,uBAIhBC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IhF,KAAKD,QACtBC,KAAKe,MAGT2D,GACCC,EAAA,KAAAE,IAAA,2CAAGC,MAAM,QAAQE,GAAIhF,KAAKC,QAASqF,KAAK,SACrCtF,KAAKgB,c","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{p as e,H as a,h as t,d as r,t as s}from"./p-qP_9qshx.js";const i=()=>`:host{display:block}.header{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:var(--spacing-2xl);padding-bottom:var(--spacing-2xl);border-bottom:var(--border-width) solid var(--border)}.header-text{display:flex;flex-direction:column;gap:var(--spacing-xs);flex:1 1 20rem;min-width:0}.header-eyebrow{margin:0;color:var(--text-secondary);font-family:var(--font-heading);font-size:var(--typography-size-xs);letter-spacing:var(--typography-tracking-badge);text-transform:uppercase}.header-title{margin:0;color:var(--text);font-family:var(--font-heading);font-size:var(--typography-size-xl);font-weight:var(--typography-weight-bold);line-height:1.2;overflow-wrap:anywhere}.header-description{margin:0;color:var(--text-secondary);font-size:var(--typography-size-sm);line-height:1.5;overflow-wrap:anywhere}.header-actions{display:flex;flex-wrap:wrap;align-items:center;gap:var(--spacing-md);max-width:100%}.header-actions:empty{display:none}.header--stacked .header-actions{flex-basis:100%}@media (max-width: 30rem){.header{flex-direction:column}.header-actions{width:100%}}@media (forced-colors: active){.header{border-bottom-color:CanvasText}}`;const c=e(class e extends a{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow()}title;headingLevel="h1";eyebrow;description;actionsStacked=false;render(){const e=this.headingLevel;return t(r,{key:"0e2bc8c10790e1f6f36a4c679579ac775f6ec3a4"},t("div",{key:"8ef9876c61f0ff325fedfb899d2e09c02b8e5e53",class:{header:true,"header--stacked":this.actionsStacked}},t("div",{key:"3bef4d66f8d69397c4117e9d4a0637e978abbe2e",class:"header-text"},this.eyebrow&&t("p",{key:"1ae504669807c48d95d12ce5b7d488f85e5dc864",class:"header-eyebrow"},this.eyebrow),t(e,{key:"9b6374d6b1d18124e49acf67af08443175f4bbaa",class:"header-title"},this.title),this.description&&t("p",{key:"9c3d2d58f1c2dde2c70fc5f86eb2d580a13f8594",class:"header-description"},this.description)),t("div",{key:"3b48c89c2a8c4c5d3e42f6b78db80b3e9c2e0c50",class:"header-actions"},t("slot",{key:"77b2010fec0113af7c8ee7c7bcd884dd11b05138",name:"actions"}))))}static get style(){return i()}},[769,"ch-page-header",{title:[1],headingLevel:[1,"heading-level"],eyebrow:[1],description:[1],actionsStacked:[4,"actions-stacked"]}]);function d(){if(typeof customElements==="undefined"){return}const e=["ch-page-header"];e.forEach((e=>{switch(e){case"ch-page-header":if(!customElements.get(s(e))){customElements.define(s(e),c)}break}}))}d();const o=c;const n=d;export{o as ChPageHeader,n as defineCustomElement};
1
+ import{p as e,H as a,h as t,d as r,t as s}from"./p-qP_9qshx.js";const d=()=>`:host{display:block}.header{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:var(--spacing-2xl);padding-bottom:var(--spacing-2xl);border-bottom:var(--border-width) solid var(--border)}.header-text{display:flex;flex-direction:column;gap:var(--spacing-xs);flex:1 1 20rem;min-width:0}.header-eyebrow{margin:0;color:var(--text-secondary);font-family:var(--font-heading);font-size:var(--typography-size-xs);letter-spacing:var(--typography-tracking-badge);text-transform:uppercase}.header-title{margin:0;color:var(--text);font-family:var(--font-heading);font-size:var(--typography-size-xl);font-weight:var(--typography-weight-bold);line-height:1.2;overflow-wrap:anywhere}.header-description{margin:0;color:var(--text-secondary);font-size:var(--typography-size-sm);line-height:1.5;overflow-wrap:anywhere}.header-actions{display:flex;flex-wrap:wrap;align-items:center;gap:var(--spacing-md);max-width:100%}.header-actions:empty{display:none}.header--stacked .header-actions{flex-basis:100%}@media (max-width: 30rem){.header{flex-direction:column}.header-actions{width:100%}}@media (forced-colors: active){.header{border-bottom-color:CanvasText}}`;const i=e(class e extends a{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow()}title;headingLevel="h1";eyebrow;description;actionsStacked=false;render(){const e=this.headingLevel;return t(r,{key:"3d8de76e3df7fba8be55d0708861c7d136b05722"},t("div",{key:"057d2b4359b9faff34b9fbf6886b04d5d89dc9ac",class:{header:true,"header--stacked":this.actionsStacked}},t("div",{key:"1ff40b1cd100d41a72d80ab35e619f93b4a43633",class:"header-text"},this.eyebrow&&t("p",{key:"6c2538bf1d450a6dca25fd2815968a9622f7fcbf",class:"header-eyebrow"},this.eyebrow),t(e,{key:"54cdf8e62468e11cf9fe084023e4fe624f958452",class:"header-title"},this.title),this.description&&t("p",{key:"fe9c6cc78354b38b8833871ddc53d412007abe29",class:"header-description"},this.description)),t("div",{key:"e91a66715e2c23478c375ce9ddcf29c04f85b3eb",class:"header-actions"},t("slot",{key:"06654c2a28d004791ed5b9c213cd66ef80bbcc85",name:"actions"}))))}static get style(){return d()}},[769,"ch-page-header",{title:[1],headingLevel:[1,"heading-level"],eyebrow:[1],description:[1],actionsStacked:[4,"actions-stacked"]}]);function c(){if(typeof customElements==="undefined"){return}const e=["ch-page-header"];e.forEach((e=>{switch(e){case"ch-page-header":if(!customElements.get(s(e))){customElements.define(s(e),i)}break}}))}c();const o=i;const n=c;export{o as ChPageHeader,n as defineCustomElement};
2
2
  //# sourceMappingURL=ch-page-header.js.map
@@ -1,2 +1,2 @@
1
- import{p as i,H as e,c as t,h as s,d as r,t as a}from"./p-qP_9qshx.js";import{r as o}from"./p-BXzZsX2r.js";const n=()=>`:host{display:inline-block}.group-label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.radio-group{display:flex;flex-direction:column;gap:var(--spacing-lg)}.control{display:inline-flex;align-items:center;gap:var(--spacing-lg);cursor:pointer}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{appearance:none;-webkit-appearance:none;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--spacing-4xl);height:var(--spacing-4xl);margin:0;flex-shrink:0;border:var(--border-width) solid var(--border);border-radius:50%;background:var(--surface);cursor:pointer;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.input:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.input:checked{border-color:var(--accent)}.input:checked::before{content:'';width:var(--spacing-md);height:var(--spacing-md);border-radius:50%;background:var(--accent)}.input--invalid{border-color:var(--color-status-warning)}.input--invalid:focus-visible{outline-color:var(--color-status-warning)}:host([data-touched]:invalid) .input,:host(:user-invalid) .input{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .input:focus-visible,:host(:user-invalid) .input:focus-visible{outline-color:var(--color-status-warning)}.label-text{color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;let l=0;const d=i(class i extends e{constructor(i){super();if(i!==false){this.__registerHost()}this.__attachShadow();this.chChange=t(this,"chChange");this.internals=this.attachInternals()}groupId=`ch-radio-${++l}`;labelId=`${this.groupId}-label`;hintId=`${this.groupId}-hint`;errorId=`${this.groupId}-error`;initialValue;internals;formDisabled=false;get host(){return this}label;options=[];value;name;disabled=false;required=false;hint;errorMessage;invalid=false;chChange;handleChange=i=>{this.value=i.target.value;this.chChange.emit(this.value)};syncForm(){const i=this.internals;if(typeof i?.setFormValue!=="function"){return}i.setFormValue(this.value??null);const{flags:e,message:t}=o({required:this.required,empty:!this.value,invalid:this.invalid,errorMessage:this.errorMessage});i.setValidity(e,t)}componentDidLoad(){this.initialValue=this.value;this.syncForm();this.host.addEventListener("change",this.markTouched);this.host.addEventListener("focusout",this.markTouched);this.host.addEventListener("invalid",this.markTouched)}markTouched=()=>{this.host.setAttribute("data-touched","")};formResetCallback(){this.value=this.initialValue}formDisabledCallback(i){this.formDisabled=i}get describedBy(){if(this.invalid&&this.errorMessage){return this.errorId}if(this.hint){return this.hintId}return undefined}render(){const i=this.name||`${this.groupId}-group`;return s(r,{key:"f55466f6bcbe3283d294161c02498419066ca958"},this.label&&s("span",{key:"789131e7d8812ee930db5e0a0c6dc7f7e353249f",class:"group-label",id:this.labelId},this.label),s("div",{key:"fc0a7adbde7feaaca99d156d45aacb6d18d5588e",class:"radio-group",role:"radiogroup","aria-labelledby":this.label?this.labelId:undefined},this.options.map((e=>s("label",{class:{control:true,"control--disabled":this.disabled||this.formDisabled||e.disabled}},s("input",{class:{input:true,"input--invalid":this.invalid},type:"radio",name:i,value:e.value,checked:e.value===this.value,disabled:this.disabled||this.formDisabled||e.disabled,"aria-invalid":this.invalid?"true":undefined,"aria-describedby":this.describedBy,onChange:this.handleChange}),s("span",{class:"mark"}),s("span",{class:"label-text"},e.label))))),this.hint&&!(this.invalid&&this.errorMessage)&&s("p",{key:"53f3e9d368cfefa9a4d85010b65f002a3b92e0f4",class:"hint",id:this.hintId},this.hint),this.invalid&&this.errorMessage&&s("p",{key:"517b7204ebf91042d293be294d7e936954eb80fb",class:"error",id:this.errorId,role:"alert"},this.errorMessage))}static get formAssociated(){return true}static get watchers(){return{value:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}}static get style(){return n()}},[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]},undefined,{value:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}]);function c(){if(typeof customElements==="undefined"){return}const i=["ch-radio"];i.forEach((i=>{switch(i){case"ch-radio":if(!customElements.get(a(i))){customElements.define(a(i),d)}break}}))}c();const h=d;const u=c;export{h as ChRadio,u as defineCustomElement};
1
+ import{p as i,H as e,c as t,h as s,d as r,t as a}from"./p-qP_9qshx.js";import{r as o}from"./p-BXzZsX2r.js";const n=()=>`:host{display:inline-block}.group-label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.radio-group{display:flex;flex-direction:column;gap:var(--spacing-lg)}.control{display:inline-flex;align-items:center;gap:var(--spacing-lg);cursor:pointer}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{appearance:none;-webkit-appearance:none;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--spacing-4xl);height:var(--spacing-4xl);margin:0;flex-shrink:0;border:var(--border-width) solid var(--border);border-radius:50%;background:var(--surface);cursor:pointer;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.input:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.input:checked{border-color:var(--accent)}.input:checked::before{content:'';width:var(--spacing-md);height:var(--spacing-md);border-radius:50%;background:var(--accent)}.input--invalid{border-color:var(--color-status-warning)}.input--invalid:focus-visible{outline-color:var(--color-status-warning)}:host([data-touched]:invalid) .input,:host(:user-invalid) .input{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .input:focus-visible,:host(:user-invalid) .input:focus-visible{outline-color:var(--color-status-warning)}.label-text{color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;let l=0;const c=i(class i extends e{constructor(i){super();if(i!==false){this.__registerHost()}this.__attachShadow();this.chChange=t(this,"chChange");this.internals=this.attachInternals()}groupId=`ch-radio-${++l}`;labelId=`${this.groupId}-label`;hintId=`${this.groupId}-hint`;errorId=`${this.groupId}-error`;initialValue;internals;formDisabled=false;get host(){return this}label;options=[];value;name;disabled=false;required=false;hint;errorMessage;invalid=false;chChange;handleChange=i=>{this.value=i.target.value;this.chChange.emit(this.value)};syncForm(){const i=this.internals;if(typeof i?.setFormValue!=="function"){return}i.setFormValue(this.value??null);const{flags:e,message:t}=o({required:this.required,empty:!this.value,invalid:this.invalid,errorMessage:this.errorMessage});i.setValidity(e,t)}componentDidLoad(){this.initialValue=this.value;this.syncForm();this.host.addEventListener("change",this.markTouched);this.host.addEventListener("focusout",this.markTouched);this.host.addEventListener("invalid",this.markTouched)}markTouched=()=>{this.host.setAttribute("data-touched","")};formResetCallback(){this.value=this.initialValue}formDisabledCallback(i){this.formDisabled=i}get describedBy(){if(this.invalid&&this.errorMessage){return this.errorId}if(this.hint){return this.hintId}return undefined}render(){const i=this.name||`${this.groupId}-group`;return s(r,{key:"a027da2d803a6e8a2a35afa1920dd3b0f8e06b01"},this.label&&s("span",{key:"28e11cd1148a89a4f3e85d331f00e39f1d7751ce",class:"group-label",id:this.labelId},this.label),s("div",{key:"43d8a53c9bec1dc129b6588c0118ebe2109b4b7e",class:"radio-group",role:"radiogroup","aria-labelledby":this.label?this.labelId:undefined},this.options.map((e=>s("label",{class:{control:true,"control--disabled":this.disabled||this.formDisabled||e.disabled}},s("input",{class:{input:true,"input--invalid":this.invalid},type:"radio",name:i,value:e.value,checked:e.value===this.value,disabled:this.disabled||this.formDisabled||e.disabled,"aria-invalid":this.invalid?"true":undefined,"aria-describedby":this.describedBy,onChange:this.handleChange}),s("span",{class:"mark"}),s("span",{class:"label-text"},e.label))))),this.hint&&!(this.invalid&&this.errorMessage)&&s("p",{key:"27335cc50f8b280f93857eea370aa37e2290b46b",class:"hint",id:this.hintId},this.hint),this.invalid&&this.errorMessage&&s("p",{key:"83f93bdc0739961136062acb784a3d6e666de349",class:"error",id:this.errorId,role:"alert"},this.errorMessage))}static get formAssociated(){return true}static get watchers(){return{value:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}}static get style(){return n()}},[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]},undefined,{value:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}]);function d(){if(typeof customElements==="undefined"){return}const i=["ch-radio"];i.forEach((i=>{switch(i){case"ch-radio":if(!customElements.get(a(i))){customElements.define(a(i),c)}break}}))}d();const h=c;const u=d;export{h as ChRadio,u as defineCustomElement};
2
2
  //# sourceMappingURL=ch-radio.js.map
@@ -1,2 +1,2 @@
1
- import{p as e,H as t,c as s,h as a,d as i,t as r}from"./p-qP_9qshx.js";import{r as o}from"./p-BXzZsX2r.js";const n=()=>`:host{display:inline-block;max-width:100%}.group-label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.segmented{display:inline-flex;align-items:stretch;max-width:100%;padding:var(--spacing-2xs);border:var(--border-width) solid var(--border);border-radius:var(--radius-pill);background:var(--surface)}.control{position:relative;display:inline-flex;align-items:center;justify-content:center;border-radius:var(--radius-pill);cursor:pointer;transition:background-color var(--duration-normal) var(--easing-default)}.control:hover:not(.control--disabled){background:var(--surface-hover)}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{position:absolute;inset:0;margin:0;opacity:0;cursor:inherit}.input:checked~.label-text{background:var(--accent);color:var(--color-accent-text);font-weight:var(--typography-weight-semibold)}.input:focus-visible~.label-text{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.label-text{display:block;padding:var(--spacing-2xs) var(--spacing-3xl);border-radius:inherit;font-size:var(--typography-size-sm);white-space:nowrap;transition:background-color var(--duration-normal) var(--easing-default), color var(--duration-normal) var(--easing-default)}.segmented--sm .label-text{padding:var(--spacing-2xs) var(--spacing-2xl);font-size:var(--typography-size-xs)}:host([data-touched]:invalid) .segmented,:host(:user-invalid) .segmented{border-color:var(--color-status-warning)}@media (prefers-reduced-motion: reduce){.control,.label-text{transition:none}}`;let l=0;const c=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.chChange=s(this,"chChange");this.internals=this.attachInternals()}groupId=`ch-segmented-${++l}`;labelId=`${this.groupId}-label`;initialValue;internals;formDisabled=false;get host(){return this}label;options=[];value;size="md";name;disabled=false;required=false;chChange;handleChange=e=>{this.value=e.target.value;this.chChange.emit(this.value)};syncForm(){const e=this.internals;if(typeof e?.setFormValue!=="function"){return}e.setFormValue(this.value??null);const{flags:t,message:s}=o({required:this.required,empty:!this.value});e.setValidity(t,s)}componentDidLoad(){this.initialValue=this.value;this.syncForm();this.host.addEventListener("change",this.markTouched);this.host.addEventListener("focusout",this.markTouched);this.host.addEventListener("invalid",this.markTouched)}markTouched=()=>{this.host.setAttribute("data-touched","")};formResetCallback(){this.value=this.initialValue}formDisabledCallback(e){this.formDisabled=e}render(){const e=this.name||`${this.groupId}-group`;return a(i,{key:"a8782886fd0c20fa96a5a54c9997fe9d91d3e670"},this.label&&a("span",{key:"99a2727035a62f71d01f07e0cf222becb118d3b2",class:"group-label",id:this.labelId},this.label),a("div",{key:"31b293c379a996e06650c1a6c9fe9c46c32097a2",class:{segmented:true,[`segmented--${this.size}`]:true},role:"radiogroup","aria-labelledby":this.label?this.labelId:undefined},this.options.map((t=>a("label",{class:{control:true,"control--disabled":this.disabled||this.formDisabled||t.disabled}},a("input",{class:"input",type:"radio",name:e,value:t.value,checked:t.value===this.value,disabled:this.disabled||this.formDisabled||t.disabled,onChange:this.handleChange}),a("span",{class:"label-text"},t.label))))))}static get formAssociated(){return true}static get watchers(){return{value:[{syncForm:0}],required:[{syncForm:0}]}}static get style(){return n()}},[577,"ch-segmented-control",{label:[1],options:[16],value:[1025],size:[1],name:[513],disabled:[516],required:[516],formDisabled:[32]},undefined,{value:[{syncForm:0}],required:[{syncForm:0}]}]);function d(){if(typeof customElements==="undefined"){return}const e=["ch-segmented-control"];e.forEach((e=>{switch(e){case"ch-segmented-control":if(!customElements.get(r(e))){customElements.define(r(e),c)}break}}))}d();const h=c;const u=d;export{h as ChSegmentedControl,u as defineCustomElement};
1
+ import{p as e,H as t,c as s,h as a,d as i,t as r}from"./p-qP_9qshx.js";import{r as o}from"./p-BXzZsX2r.js";const n=()=>`:host{display:inline-block;max-width:100%}.group-label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.segmented{display:inline-flex;align-items:stretch;max-width:100%;padding:var(--spacing-2xs);border:var(--border-width) solid var(--border);border-radius:var(--radius-pill);background:var(--surface)}.control{position:relative;display:inline-flex;align-items:center;justify-content:center;border-radius:var(--radius-pill);cursor:pointer;transition:background-color var(--duration-normal) var(--easing-default)}.control:hover:not(.control--disabled){background:var(--surface-hover)}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{position:absolute;inset:0;margin:0;opacity:0;cursor:inherit}.input:checked~.label-text{background:var(--accent);color:var(--color-accent-text);font-weight:var(--typography-weight-semibold)}.input:focus-visible~.label-text{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.label-text{display:block;padding:var(--spacing-2xs) var(--spacing-3xl);border-radius:inherit;font-size:var(--typography-size-sm);white-space:nowrap;transition:background-color var(--duration-normal) var(--easing-default), color var(--duration-normal) var(--easing-default)}.segmented--sm .label-text{padding:var(--spacing-2xs) var(--spacing-2xl);font-size:var(--typography-size-xs)}:host([data-touched]:invalid) .segmented,:host(:user-invalid) .segmented{border-color:var(--color-status-warning)}@media (prefers-reduced-motion: reduce){.control,.label-text{transition:none}}`;let l=0;const d=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.chChange=s(this,"chChange");this.internals=this.attachInternals()}groupId=`ch-segmented-${++l}`;labelId=`${this.groupId}-label`;initialValue;internals;formDisabled=false;get host(){return this}label;options=[];value;size="md";name;disabled=false;required=false;chChange;handleChange=e=>{this.value=e.target.value;this.chChange.emit(this.value)};syncForm(){const e=this.internals;if(typeof e?.setFormValue!=="function"){return}e.setFormValue(this.value??null);const{flags:t,message:s}=o({required:this.required,empty:!this.value});e.setValidity(t,s)}componentDidLoad(){this.initialValue=this.value;this.syncForm();this.host.addEventListener("change",this.markTouched);this.host.addEventListener("focusout",this.markTouched);this.host.addEventListener("invalid",this.markTouched)}markTouched=()=>{this.host.setAttribute("data-touched","")};formResetCallback(){this.value=this.initialValue}formDisabledCallback(e){this.formDisabled=e}render(){const e=this.name||`${this.groupId}-group`;return a(i,{key:"59e0782a5c120cd243bbd67eb727ba1a7755d45f"},this.label&&a("span",{key:"f1faf9b240224e4c2b10059ed7bf667e24e5997d",class:"group-label",id:this.labelId},this.label),a("div",{key:"b9e59c0fbd4af04ad4d079415497440ec0a60801",class:{segmented:true,[`segmented--${this.size}`]:true},role:"radiogroup","aria-labelledby":this.label?this.labelId:undefined},this.options.map((t=>a("label",{class:{control:true,"control--disabled":this.disabled||this.formDisabled||t.disabled}},a("input",{class:"input",type:"radio",name:e,value:t.value,checked:t.value===this.value,disabled:this.disabled||this.formDisabled||t.disabled,onChange:this.handleChange}),a("span",{class:"label-text"},t.label))))))}static get formAssociated(){return true}static get watchers(){return{value:[{syncForm:0}],required:[{syncForm:0}]}}static get style(){return n()}},[577,"ch-segmented-control",{label:[1],options:[16],value:[1025],size:[1],name:[513],disabled:[516],required:[516],formDisabled:[32]},undefined,{value:[{syncForm:0}],required:[{syncForm:0}]}]);function c(){if(typeof customElements==="undefined"){return}const e=["ch-segmented-control"];e.forEach((e=>{switch(e){case"ch-segmented-control":if(!customElements.get(r(e))){customElements.define(r(e),d)}break}}))}c();const h=d;const u=c;export{h as ChSegmentedControl,u as defineCustomElement};
2
2
  //# sourceMappingURL=ch-segmented-control.js.map
@@ -1,2 +1,2 @@
1
- import{p as e,H as s,c as t,h as r,d as i,t as a}from"./p-qP_9qshx.js";import{r as o}from"./p-BXzZsX2r.js";const n=()=>`: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)}.select{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;cursor:pointer;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.select:focus{border-color:var(--accent);box-shadow:var(--shadow-focus-ring);outline:none}.select--invalid{border-color:var(--color-status-warning)}.select--invalid:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}:host([data-touched]:invalid) .select,:host(:user-invalid) .select{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .select:focus,:host(:user-invalid) .select:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}.select:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.select option{background:var(--bg);color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;let l=0;const d=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.chChange=t(this,"chChange");this.internals=this.attachInternals()}selectId=`ch-select-${++l}`;hintId=`${this.selectId}-hint`;errorId=`${this.selectId}-error`;initialValue;internals;formDisabled=false;get host(){return this}label;options=[];value;placeholder;name;disabled=false;required=false;hint;errorMessage;invalid=false;chChange;handleChange=e=>{this.value=e.target.value;this.chChange.emit(this.value)};syncForm(){const e=this.internals;if(typeof e?.setFormValue!=="function"){return}e.setFormValue(this.value??"");const{flags:s,message:t}=o({required:this.required,empty:!this.value,invalid:this.invalid,errorMessage:this.errorMessage});e.setValidity(s,t)}componentDidLoad(){this.initialValue=this.value;this.syncForm();this.host.addEventListener("change",this.markTouched);this.host.addEventListener("focusout",this.markTouched);this.host.addEventListener("invalid",this.markTouched)}markTouched=()=>{this.host.setAttribute("data-touched","")};formResetCallback(){this.value=this.initialValue}formDisabledCallback(e){this.formDisabled=e}get describedBy(){if(this.invalid&&this.errorMessage){return this.errorId}if(this.hint){return this.hintId}return undefined}render(){return r(i,{key:"aeba7eff5bf3bd7926922e65376c6508fc1c4dd3"},this.label&&r("label",{key:"943e5557014e2297368825505513f4ad8b093ee5",class:"label",htmlFor:this.selectId},this.label),r("select",{key:"ccec2dfef1b06b219e7aed536914ebf2b24e370f",id:this.label?this.selectId:undefined,class:{select:true,"select--invalid":this.invalid},name:this.name,disabled:this.disabled||this.formDisabled,required:this.required,"aria-invalid":this.invalid?"true":undefined,"aria-describedby":this.describedBy,onChange:this.handleChange},this.placeholder&&r("option",{key:"a0c41592c1a5a90f611917da984374edf5305b96",value:"",disabled:true,hidden:true,selected:!this.value},this.placeholder),this.options.map((e=>r("option",{value:e.value,disabled:e.disabled,selected:e.value===this.value},e.label)))),this.hint&&!(this.invalid&&this.errorMessage)&&r("p",{key:"28a35ede5d7bb1937d501719244b4b9f7a5d95f2",class:"hint",id:this.hintId},this.hint),this.invalid&&this.errorMessage&&r("p",{key:"b021c848f75367e2e3329aab423f787205ee0491",class:"error",id:this.errorId,role:"alert"},this.errorMessage))}static get formAssociated(){return true}static get watchers(){return{value:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}}static get style(){return n()}},[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]},undefined,{value:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}]);function c(){if(typeof customElements==="undefined"){return}const e=["ch-select"];e.forEach((e=>{switch(e){case"ch-select":if(!customElements.get(a(e))){customElements.define(a(e),d)}break}}))}c();const h=d;const u=c;export{h as ChSelect,u as defineCustomElement};
1
+ import{p as e,H as s,c as t,h as r,d as i,t as a}from"./p-qP_9qshx.js";import{r as o}from"./p-BXzZsX2r.js";const n=()=>`: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)}.select{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;cursor:pointer;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.select:focus{border-color:var(--accent);box-shadow:var(--shadow-focus-ring);outline:none}.select--invalid{border-color:var(--color-status-warning)}.select--invalid:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}:host([data-touched]:invalid) .select,:host(:user-invalid) .select{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .select:focus,:host(:user-invalid) .select:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}.select:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.select option{background:var(--bg);color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;let d=0;const c=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.chChange=t(this,"chChange");this.internals=this.attachInternals()}selectId=`ch-select-${++d}`;hintId=`${this.selectId}-hint`;errorId=`${this.selectId}-error`;initialValue;internals;formDisabled=false;get host(){return this}label;options=[];value;placeholder;name;disabled=false;required=false;hint;errorMessage;invalid=false;chChange;handleChange=e=>{this.value=e.target.value;this.chChange.emit(this.value)};syncForm(){const e=this.internals;if(typeof e?.setFormValue!=="function"){return}e.setFormValue(this.value??"");const{flags:s,message:t}=o({required:this.required,empty:!this.value,invalid:this.invalid,errorMessage:this.errorMessage});e.setValidity(s,t)}componentDidLoad(){this.initialValue=this.value;this.syncForm();this.host.addEventListener("change",this.markTouched);this.host.addEventListener("focusout",this.markTouched);this.host.addEventListener("invalid",this.markTouched)}markTouched=()=>{this.host.setAttribute("data-touched","")};formResetCallback(){this.value=this.initialValue}formDisabledCallback(e){this.formDisabled=e}get describedBy(){if(this.invalid&&this.errorMessage){return this.errorId}if(this.hint){return this.hintId}return undefined}render(){return r(i,{key:"f57fbcbfaaf64a9cbf1f201edd2f9f714db9afee"},this.label&&r("label",{key:"e7a4a802ff85cd597e5bdb9a54858e3cbbbcf73b",class:"label",htmlFor:this.selectId},this.label),r("select",{key:"5d70a598757d9440d90351e8639a876388b5f7a7",id:this.label?this.selectId:undefined,class:{select:true,"select--invalid":this.invalid},name:this.name,disabled:this.disabled||this.formDisabled,required:this.required,"aria-invalid":this.invalid?"true":undefined,"aria-describedby":this.describedBy,onChange:this.handleChange},this.placeholder&&r("option",{key:"9a002af8f52ab2bb2d2c762417cad071b7dd06c7",value:"",disabled:true,hidden:true,selected:!this.value},this.placeholder),this.options.map((e=>r("option",{value:e.value,disabled:e.disabled,selected:e.value===this.value},e.label)))),this.hint&&!(this.invalid&&this.errorMessage)&&r("p",{key:"0224ab6e0a54b925e0754c43bb15ceaab84c34a4",class:"hint",id:this.hintId},this.hint),this.invalid&&this.errorMessage&&r("p",{key:"1624ae9938d47971ee8195f986c45454dad7f846",class:"error",id:this.errorId,role:"alert"},this.errorMessage))}static get formAssociated(){return true}static get watchers(){return{value:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}}static get style(){return n()}},[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]},undefined,{value:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}]);function l(){if(typeof customElements==="undefined"){return}const e=["ch-select"];e.forEach((e=>{switch(e){case"ch-select":if(!customElements.get(a(e))){customElements.define(a(e),c)}break}}))}l();const h=c;const u=l;export{h as ChSelect,u as defineCustomElement};
2
2
  //# sourceMappingURL=ch-select.js.map
@@ -1,2 +1,2 @@
1
- import{p as e,H as t,h as s,d as i,t as n}from"./p-qP_9qshx.js";const r=()=>`:host{display:block;width:100%}:host([hidden]){display:none}:host(.skeleton--circle){width:auto;display:inline-flex}.skeleton__item{display:block;background:var(--color-surface-default);border-radius:var(--radius-sm)}.skeleton--circle .skeleton__item{border-radius:50%}.skeleton--rect .skeleton__item{border-radius:var(--radius-md)}.skeleton--animated .skeleton__item{background-image:linear-gradient(90deg, transparent 0%, var(--color-surface-hover) 50%, transparent 100%);background-size:200% 100%;background-repeat:no-repeat;animation:ch-skeleton-shimmer 1.4s ease-in-out infinite}@keyframes ch-skeleton-shimmer{from{background-position:100% 0}to{background-position:-100% 0}}@media (prefers-reduced-motion: reduce){.skeleton--animated .skeleton__item{animation:none;background-image:none}}`;const o=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow()}width="100%";height="1rem";shape="line";count=1;animated=true;get items(){const e=Number(this.count);return Number.isInteger(e)&&e>=1?e:1}get sizeStyle(){if(this.shape==="circle"){return{width:this.width,height:this.width}}if(this.shape==="line"){return{width:this.width,height:this.height}}return{width:this.width,height:this.height}}render(){return s(i,{key:"705e4cd6dac9c8c8578cb8133a700c3297d9fffe","aria-hidden":"true",class:{skeleton:true,[`skeleton--${this.shape}`]:true,"skeleton--animated":this.animated}},Array.from({length:this.items}).map(((e,t)=>s("span",{class:"skeleton__item",style:this.sizeStyle,key:t,"data-index":String(e)}))))}static get style(){return r()}},[513,"ch-skeleton",{width:[1],height:[1],shape:[1],count:[2],animated:[4]}]);function a(){if(typeof customElements==="undefined"){return}const e=["ch-skeleton"];e.forEach((e=>{switch(e){case"ch-skeleton":if(!customElements.get(n(e))){customElements.define(n(e),o)}break}}))}a();const c=o;const d=a;export{c as ChSkeleton,d as defineCustomElement};
1
+ import{p as e,H as t,h as s,d as i,t as n}from"./p-qP_9qshx.js";const r=()=>`:host{display:block;width:100%}:host([hidden]){display:none}:host(.skeleton--circle){width:auto;display:inline-flex}.skeleton__item{display:block;background:var(--color-surface-default);border-radius:var(--radius-sm)}.skeleton--circle .skeleton__item{border-radius:50%}.skeleton--rect .skeleton__item{border-radius:var(--radius-md)}.skeleton--animated .skeleton__item{background-image:linear-gradient(90deg, transparent 0%, var(--color-surface-hover) 50%, transparent 100%);background-size:200% 100%;background-repeat:no-repeat;animation:ch-skeleton-shimmer 1.4s ease-in-out infinite}@keyframes ch-skeleton-shimmer{from{background-position:100% 0}to{background-position:-100% 0}}@media (prefers-reduced-motion: reduce){.skeleton--animated .skeleton__item{animation:none;background-image:none}}`;const a=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow()}width="100%";height="1rem";shape="line";count=1;animated=true;get items(){const e=Number(this.count);return Number.isInteger(e)&&e>=1?e:1}get sizeStyle(){if(this.shape==="circle"){return{width:this.width,height:this.width}}if(this.shape==="line"){return{width:this.width,height:this.height}}return{width:this.width,height:this.height}}render(){return s(i,{key:"b28cd1be6da1721ff6b93ed1e4bab119ea066ad4","aria-hidden":"true",class:{skeleton:true,[`skeleton--${this.shape}`]:true,"skeleton--animated":this.animated}},Array.from({length:this.items}).map(((e,t)=>s("span",{class:"skeleton__item",style:this.sizeStyle,key:t,"data-index":String(e)}))))}static get style(){return r()}},[513,"ch-skeleton",{width:[1],height:[1],shape:[1],count:[2],animated:[4]}]);function o(){if(typeof customElements==="undefined"){return}const e=["ch-skeleton"];e.forEach((e=>{switch(e){case"ch-skeleton":if(!customElements.get(n(e))){customElements.define(n(e),a)}break}}))}o();const d=a;const h=o;export{d as ChSkeleton,h as defineCustomElement};
2
2
  //# sourceMappingURL=ch-skeleton.js.map
@@ -1,2 +1,2 @@
1
- import{C as o,d as s}from"./p-Cw0b4OGc.js";const t=o;const c=s;export{t as ChSpinner,c as defineCustomElement};
1
+ import{C as o,d as s}from"./p-DiUN1WGc.js";const t=o;const c=s;export{t as ChSpinner,c as defineCustomElement};
2
2
  //# sourceMappingURL=ch-spinner.js.map
@@ -1,2 +1,2 @@
1
- import{p as t,H as s,h as a,d as e,t as c}from"./p-qP_9qshx.js";const n=()=>`:host{display:flex;flex-direction:column;box-sizing:border-box}:host([hidden]){display:none}.stack--gap-none{gap:0}.stack--gap-2xs{gap:var(--spacing-2xs)}.stack--gap-xs{gap:var(--spacing-xs)}.stack--gap-sm{gap:var(--spacing-sm)}.stack--gap-md{gap:var(--spacing-md)}.stack--gap-lg{gap:var(--spacing-lg)}.stack--gap-xl{gap:var(--spacing-xl)}.stack--gap-2xl{gap:var(--spacing-2xl)}.stack--gap-3xl{gap:var(--spacing-3xl)}.stack--gap-4xl{gap:var(--spacing-4xl)}.stack--gap-5xl{gap:var(--spacing-5xl)}.stack--gap-6xl{gap:var(--spacing-6xl)}.stack--align-stretch{align-items:stretch}.stack--align-start{align-items:flex-start}.stack--align-center{align-items:center}.stack--align-end{align-items:flex-end}.stack--justify-start{justify-content:flex-start}.stack--justify-center{justify-content:center}.stack--justify-end{justify-content:flex-end}.stack--justify-between{justify-content:space-between}.stack--justify-around{justify-content:space-around}`;const i=new Set(["none","2xs","xs","sm","md","lg","xl","2xl","3xl","4xl","5xl","6xl"]);const g=t(class t extends s{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow()}gap="md";align="stretch";justify="start";get gapStep(){return i.has(this.gap)?this.gap:"md"}render(){return a(e,{key:"d4ee90331cd1ff0d65eb9c80aa684d3b2f5e2876",class:{stack:true,[`stack--gap-${this.gapStep}`]:true,[`stack--align-${this.align}`]:true,[`stack--justify-${this.justify}`]:true}},a("slot",{key:"bdfe358adc457ed6ba79ca80b9e96f17597fbcb5"}))}static get style(){return n()}},[769,"ch-stack",{gap:[1],align:[1],justify:[1]}]);function p(){if(typeof customElements==="undefined"){return}const t=["ch-stack"];t.forEach((t=>{switch(t){case"ch-stack":if(!customElements.get(c(t))){customElements.define(c(t),g)}break}}))}p();const l=g;const r=p;export{l as ChStack,r as defineCustomElement};
1
+ import{p as t,H as s,h as a,d as e,t as c}from"./p-qP_9qshx.js";const n=()=>`:host{display:flex;flex-direction:column;box-sizing:border-box}:host([hidden]){display:none}.stack--gap-none{gap:0}.stack--gap-2xs{gap:var(--spacing-2xs)}.stack--gap-xs{gap:var(--spacing-xs)}.stack--gap-sm{gap:var(--spacing-sm)}.stack--gap-md{gap:var(--spacing-md)}.stack--gap-lg{gap:var(--spacing-lg)}.stack--gap-xl{gap:var(--spacing-xl)}.stack--gap-2xl{gap:var(--spacing-2xl)}.stack--gap-3xl{gap:var(--spacing-3xl)}.stack--gap-4xl{gap:var(--spacing-4xl)}.stack--gap-5xl{gap:var(--spacing-5xl)}.stack--gap-6xl{gap:var(--spacing-6xl)}.stack--align-stretch{align-items:stretch}.stack--align-start{align-items:flex-start}.stack--align-center{align-items:center}.stack--align-end{align-items:flex-end}.stack--justify-start{justify-content:flex-start}.stack--justify-center{justify-content:center}.stack--justify-end{justify-content:flex-end}.stack--justify-between{justify-content:space-between}.stack--justify-around{justify-content:space-around}`;const i=new Set(["none","2xs","xs","sm","md","lg","xl","2xl","3xl","4xl","5xl","6xl"]);const g=t(class t extends s{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow()}gap="md";align="stretch";justify="start";get gapStep(){return i.has(this.gap)?this.gap:"md"}render(){return a(e,{key:"1c70344ce291ba78a533f99ac6c4c135296251e1",class:{stack:true,[`stack--gap-${this.gapStep}`]:true,[`stack--align-${this.align}`]:true,[`stack--justify-${this.justify}`]:true}},a("slot",{key:"f4167e47a2fdee42f97611fba5907d79f8d0448d"}))}static get style(){return n()}},[769,"ch-stack",{gap:[1],align:[1],justify:[1]}]);function p(){if(typeof customElements==="undefined"){return}const t=["ch-stack"];t.forEach((t=>{switch(t){case"ch-stack":if(!customElements.get(c(t))){customElements.define(c(t),g)}break}}))}p();const l=g;const r=p;export{l as ChStack,r as defineCustomElement};
2
2
  //# sourceMappingURL=ch-stack.js.map
@@ -1,2 +1,2 @@
1
- import{p as t,H as a,h as e,d as s,t as o}from"./p-qP_9qshx.js";const r=()=>`:host{display:block;font-family:var(--typography-body);color:var(--color-text-primary)}:host([hidden]){display:none}.stat__inner{display:flex;flex-direction:column;gap:var(--spacing-2xs);padding:var(--spacing-md) var(--spacing-lg);border:var(--border-width) solid var(--color-border-default);border-radius:var(--radius-md);background:var(--color-surface-default)}.stat__label{font-size:var(--typography-size-xs);font-weight:var(--typography-weight-semibold);letter-spacing:0.06em;text-transform:uppercase;color:var(--color-text-secondary)}.stat__value{font-family:var(--typography-heading);font-size:var(--typography-size-xl);font-weight:var(--typography-weight-bold);font-variant-numeric:tabular-nums;display:flex;align-items:baseline;gap:var(--spacing-2xs)}.stat__cue{font-size:var(--typography-size-md)}.stat__value--positive{color:var(--color-status-positive)}.stat__value--negative{color:var(--color-status-negative)}.stat__value--unavailable{color:var(--color-text-tertiary);font-style:italic}.stat__hint{font-size:var(--typography-size-sm);color:var(--color-text-secondary)}.stat__footer:empty{display:none}.stat__footer{margin-top:var(--spacing-2xs)}`;const c=new Set(["default","positive","negative","unavailable"]);const i=t(class t extends a{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow()}label;value;hint;tone="default";get toneClass(){return c.has(this.tone)?this.tone:"default"}render(){const t=this.toneClass==="positive"?"+":this.toneClass==="negative"?"−":null;return e(s,{key:"5a43c713faab1513866d8f06899bb3fd3184cf09",class:"stat"},e("div",{key:"9c24e9774cfe0a70b8ba37c06ce7f264b34a9d8c",class:"stat__inner"},e("span",{key:"1a9330c2b31ec6de29f1b8c77761d7eb16160aae",class:"stat__label"},this.label),e("span",{key:"3f6c5e76f5c062effcb9793206a949942bcdfb9a",class:{stat__value:true,[`stat__value--${this.toneClass}`]:this.toneClass!=="default"}},t&&e("span",{key:"b5f79899ec52e7e2b3ec3c00295f755f770a8bca",class:"stat__cue","aria-hidden":"true"},t),e("slot",{key:"b64083aa5738b4088cf9029650286b2564649ec9",name:"value"},this.value)),this.hint&&e("span",{key:"9f560c1f1fd23f08ea63eccc9076066a7fd1a0f9",class:"stat__hint"},this.hint),e("div",{key:"77f3fe1f87e3abc2cce829e06b21f6b2c5f9aa15",class:"stat__footer"},e("slot",{key:"d75204702eab0ab1f55df92e9c13c899235f6840",name:"footer"}))))}static get style(){return r()}},[769,"ch-stat",{label:[1],value:[1],hint:[1],tone:[1]}]);function l(){if(typeof customElements==="undefined"){return}const t=["ch-stat"];t.forEach((t=>{switch(t){case"ch-stat":if(!customElements.get(o(t))){customElements.define(o(t),i)}break}}))}l();const n=i;const f=l;export{n as ChStat,f as defineCustomElement};
1
+ import{p as t,H as a,h as e,d as s,t as o}from"./p-qP_9qshx.js";const r=()=>`:host{display:block;font-family:var(--typography-body);color:var(--color-text-primary)}:host([hidden]){display:none}.stat__inner{display:flex;flex-direction:column;gap:var(--spacing-2xs);padding:var(--spacing-md) var(--spacing-lg);border:var(--border-width) solid var(--color-border-default);border-radius:var(--radius-md);background:var(--color-surface-default)}.stat__label{font-size:var(--typography-size-xs);font-weight:var(--typography-weight-semibold);letter-spacing:0.06em;text-transform:uppercase;color:var(--color-text-secondary)}.stat__value{font-family:var(--typography-heading);font-size:var(--typography-size-xl);font-weight:var(--typography-weight-bold);font-variant-numeric:tabular-nums;display:flex;align-items:baseline;gap:var(--spacing-2xs)}.stat__cue{font-size:var(--typography-size-md)}.stat__value--positive{color:var(--color-status-positive)}.stat__value--negative{color:var(--color-status-negative)}.stat__value--unavailable{color:var(--color-text-tertiary);font-style:italic}.stat__hint{font-size:var(--typography-size-sm);color:var(--color-text-secondary)}.stat__footer:empty{display:none}.stat__footer{margin-top:var(--spacing-2xs)}`;const i=new Set(["default","positive","negative","unavailable"]);const l=t(class t extends a{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow()}label;value;hint;tone="default";get toneClass(){return i.has(this.tone)?this.tone:"default"}render(){const t=this.toneClass==="positive"?"+":this.toneClass==="negative"?"−":null;return e(s,{key:"76d71c964efeb4e5a07aabff0b895f1ded21b345",class:"stat"},e("div",{key:"103db766f21c91c8406e8d3368049f4e4a018007",class:"stat__inner"},e("span",{key:"74e45654072a92ba4f894aee5366852561f8f352",class:"stat__label"},this.label),e("span",{key:"deb8d0d20c70d7fbab392641fd9d0e617ab8daf5",class:{stat__value:true,[`stat__value--${this.toneClass}`]:this.toneClass!=="default"}},t&&e("span",{key:"82b83cb7182f10ceca5172fc790aad01882645cc",class:"stat__cue","aria-hidden":"true"},t),e("slot",{key:"e9c3095eca4ed3907fc0e95395f3cc62bfd4158a",name:"value"},this.value)),this.hint&&e("span",{key:"4b892b35299def40a62c386e6af7c5f19aebe44b",class:"stat__hint"},this.hint),e("div",{key:"0535d9fb62ddf5ed1ee2b5993689cb080f753ff9",class:"stat__footer"},e("slot",{key:"1d8e09fa8db2d4a6e188f8deaa93631df9cc2a36",name:"footer"}))))}static get style(){return r()}},[769,"ch-stat",{label:[1],value:[1],hint:[1],tone:[1]}]);function n(){if(typeof customElements==="undefined"){return}const t=["ch-stat"];t.forEach((t=>{switch(t){case"ch-stat":if(!customElements.get(o(t))){customElements.define(o(t),l)}break}}))}n();const c=l;const d=n;export{c as ChStat,d as defineCustomElement};
2
2
  //# sourceMappingURL=ch-stat.js.map
@@ -1,2 +1,2 @@
1
- import{p as t,H as e,c as i,h as r,d as s,t as a}from"./p-qP_9qshx.js";import{r as o}from"./p-BXzZsX2r.js";const c=()=>`:host{display:inline-block}.control{position:relative;display:inline-flex;align-items:center;gap:var(--spacing-lg);cursor:pointer}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}.input:focus-visible~.track{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.track{position:relative;box-sizing:border-box;width:var(--spacing-6xl);height:var(--spacing-5xl);flex-shrink:0;border:var(--border-width) solid var(--border);border-radius:var(--radius-pill);background:var(--surface);transition:border-color var(--duration-normal) var(--easing-default), background-color var(--duration-normal) var(--easing-default)}.thumb{position:absolute;top:50%;left:var(--spacing-2xs);width:var(--spacing-2xl);height:var(--spacing-2xl);border-radius:50%;background:var(--text-muted);transform:translateY(-50%);transition:left var(--duration-normal) var(--easing-default), background-color var(--duration-normal) var(--easing-default)}.input:checked~.track{border-color:var(--accent);background:var(--accent)}.input:checked~.track .thumb{left:calc(100% - var(--spacing-2xl) - var(--spacing-2xs));background:var(--color-accent-text)}.input--invalid~.track{border-color:var(--color-status-warning)}.input--invalid:focus-visible~.track{outline-color:var(--color-status-warning)}:host([data-touched]:invalid) .track,:host(:user-invalid) .track{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .input:focus-visible~.track,:host(:user-invalid) .input:focus-visible~.track{outline-color:var(--color-status-warning)}.label-text{color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;let n=0;const l=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow();this.chChange=i(this,"chChange");this.internals=this.attachInternals()}switchId=`ch-switch-${++n}`;hintId=`${this.switchId}-hint`;errorId=`${this.switchId}-error`;initialChecked=false;internals;formDisabled=false;get host(){return this}label;name;value="on";checked=false;disabled=false;required=false;hint;errorMessage;invalid=false;chChange;handleChange=t=>{this.checked=t.target.checked;this.chChange.emit(this.checked)};syncForm(){const t=this.internals;if(typeof t?.setFormValue!=="function"){return}t.setFormValue(this.checked?this.value:null);const{flags:e,message:i}=o({required:this.required,empty:!this.checked,invalid:this.invalid,errorMessage:this.errorMessage});t.setValidity(e,i)}componentDidLoad(){this.initialChecked=this.checked;this.syncForm();this.host.addEventListener("change",this.markTouched);this.host.addEventListener("focusout",this.markTouched);this.host.addEventListener("invalid",this.markTouched)}markTouched=()=>{this.host.setAttribute("data-touched","")};formResetCallback(){this.checked=this.initialChecked}formDisabledCallback(t){this.formDisabled=t}get describedBy(){if(this.invalid&&this.errorMessage){return this.errorId}if(this.hint){return this.hintId}return undefined}render(){return r(s,{key:"e1493afa72058b44b5051cdc641604d02952b6be"},r("label",{key:"80f2ca9bdb7fab02556f427f4a1fce56744eaf50",class:{control:true,"control--disabled":this.disabled||this.formDisabled},htmlFor:this.switchId},r("input",{key:"22a873c43b7f9c94455373d80ab5b3c28153ff70",id:this.switchId,class:{input:true,"input--invalid":this.invalid},type:"checkbox",role:"switch",name:this.name,value:this.value,checked:this.checked,disabled:this.disabled||this.formDisabled,required:this.required,"aria-checked":this.checked?"true":"false","aria-invalid":this.invalid?"true":undefined,"aria-describedby":this.describedBy,onChange:this.handleChange}),r("span",{key:"d995c061f60ad3040048966da17ad8cb2ebdb622",class:"track"},r("span",{key:"ba09dcb23640b2925d0c82f5ab46213acc7e8a86",class:"thumb"})),this.label&&r("span",{key:"9849238fd3486bc1d869c6df373e30209e46d264",class:"label-text"},this.label)),this.hint&&!(this.invalid&&this.errorMessage)&&r("p",{key:"76a5cb6da88dbd7088cf2c0d9c2b5a781a632a7f",class:"hint",id:this.hintId},this.hint),this.invalid&&this.errorMessage&&r("p",{key:"5ebd8ab9b2390fea801bf75eeb4967e95983e041",class:"error",id:this.errorId,role:"alert"},this.errorMessage))}static get formAssociated(){return true}static get watchers(){return{checked:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}}static get style(){return c()}},[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]},undefined,{checked:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}]);function d(){if(typeof customElements==="undefined"){return}const t=["ch-switch"];t.forEach((t=>{switch(t){case"ch-switch":if(!customElements.get(a(t))){customElements.define(a(t),l)}break}}))}d();const h=l;const u=d;export{h as ChSwitch,u as defineCustomElement};
1
+ import{p as t,H as e,c as i,h as r,d as s,t as a}from"./p-qP_9qshx.js";import{r as o}from"./p-BXzZsX2r.js";const c=()=>`:host{display:inline-block}.control{position:relative;display:inline-flex;align-items:center;gap:var(--spacing-lg);cursor:pointer}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}.input:focus-visible~.track{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.track{position:relative;box-sizing:border-box;width:var(--spacing-6xl);height:var(--spacing-5xl);flex-shrink:0;border:var(--border-width) solid var(--border);border-radius:var(--radius-pill);background:var(--surface);transition:border-color var(--duration-normal) var(--easing-default), background-color var(--duration-normal) var(--easing-default)}.thumb{position:absolute;top:50%;left:var(--spacing-2xs);width:var(--spacing-2xl);height:var(--spacing-2xl);border-radius:50%;background:var(--text-muted);transform:translateY(-50%);transition:left var(--duration-normal) var(--easing-default), background-color var(--duration-normal) var(--easing-default)}.input:checked~.track{border-color:var(--accent);background:var(--accent)}.input:checked~.track .thumb{left:calc(100% - var(--spacing-2xl) - var(--spacing-2xs));background:var(--color-accent-text)}.input--invalid~.track{border-color:var(--color-status-warning)}.input--invalid:focus-visible~.track{outline-color:var(--color-status-warning)}:host([data-touched]:invalid) .track,:host(:user-invalid) .track{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .input:focus-visible~.track,:host(:user-invalid) .input:focus-visible~.track{outline-color:var(--color-status-warning)}.label-text{color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;let n=0;const l=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow();this.chChange=i(this,"chChange");this.internals=this.attachInternals()}switchId=`ch-switch-${++n}`;hintId=`${this.switchId}-hint`;errorId=`${this.switchId}-error`;initialChecked=false;internals;formDisabled=false;get host(){return this}label;name;value="on";checked=false;disabled=false;required=false;hint;errorMessage;invalid=false;chChange;handleChange=t=>{this.checked=t.target.checked;this.chChange.emit(this.checked)};syncForm(){const t=this.internals;if(typeof t?.setFormValue!=="function"){return}t.setFormValue(this.checked?this.value:null);const{flags:e,message:i}=o({required:this.required,empty:!this.checked,invalid:this.invalid,errorMessage:this.errorMessage});t.setValidity(e,i)}componentDidLoad(){this.initialChecked=this.checked;this.syncForm();this.host.addEventListener("change",this.markTouched);this.host.addEventListener("focusout",this.markTouched);this.host.addEventListener("invalid",this.markTouched)}markTouched=()=>{this.host.setAttribute("data-touched","")};formResetCallback(){this.checked=this.initialChecked}formDisabledCallback(t){this.formDisabled=t}get describedBy(){if(this.invalid&&this.errorMessage){return this.errorId}if(this.hint){return this.hintId}return undefined}render(){return r(s,{key:"8bafcbe9b03858f278f0884d43b9ce579a98c84e"},r("label",{key:"8783c0e8ce0bb9c03a3772a08afb383e338b5be4",class:{control:true,"control--disabled":this.disabled||this.formDisabled},htmlFor:this.switchId},r("input",{key:"4093d398ed167ede08749050b6a9c9d5b25f2470",id:this.switchId,class:{input:true,"input--invalid":this.invalid},type:"checkbox",role:"switch",name:this.name,value:this.value,checked:this.checked,disabled:this.disabled||this.formDisabled,required:this.required,"aria-checked":this.checked?"true":"false","aria-invalid":this.invalid?"true":undefined,"aria-describedby":this.describedBy,onChange:this.handleChange}),r("span",{key:"eea728ebbf6c6fefd761415bf8cb00765e5c2e76",class:"track"},r("span",{key:"4d18d8c9ed871bbf6e537b93bcce14c0f00f00e9",class:"thumb"})),this.label&&r("span",{key:"048657735d8fdf9a03a89b83cf3f3d65a466d886",class:"label-text"},this.label)),this.hint&&!(this.invalid&&this.errorMessage)&&r("p",{key:"869a40f9ce8bd2f93d918426f119c637039ac5e9",class:"hint",id:this.hintId},this.hint),this.invalid&&this.errorMessage&&r("p",{key:"08d947e2909706290b7efbb3e8af6999ad249dea",class:"error",id:this.errorId,role:"alert"},this.errorMessage))}static get formAssociated(){return true}static get watchers(){return{checked:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}}static get style(){return c()}},[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]},undefined,{checked:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}]);function d(){if(typeof customElements==="undefined"){return}const t=["ch-switch"];t.forEach((t=>{switch(t){case"ch-switch":if(!customElements.get(a(t))){customElements.define(a(t),l)}break}}))}d();const h=l;const u=d;export{h as ChSwitch,u as defineCustomElement};
2
2
  //# sourceMappingURL=ch-switch.js.map
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface ChTable extends Components.ChTable, HTMLElement {}
4
+ export const ChTable: {
5
+ prototype: ChTable;
6
+ new (): ChTable;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,2 @@
1
+ import{p as e,H as t,c as r,h as s,d as a,t as o}from"./p-qP_9qshx.js";const i=()=>`:host{display:block;font-family:var(--typography-body);color:var(--color-text-primary)}:host([hidden]){display:none}.table__scroll{overflow-x:auto;min-width:0;border:var(--border-width) solid var(--color-border-default);border-radius:var(--radius-md);background:var(--color-surface-default)}.table__scroll:focus-visible{outline:2px solid var(--color-accent-default);outline-offset:2px}.table{width:100%;border-collapse:collapse;font-size:var(--typography-size-sm)}.cell{min-width:8rem}.caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.cell{padding:var(--spacing-md) var(--spacing-lg);text-align:left;vertical-align:top;border-bottom:var(--border-width) solid var(--color-border-default)}.cell--header{font-weight:var(--typography-weight-semibold);color:var(--color-text-secondary);white-space:nowrap;background:var(--color-surface-hover)}tbody tr:last-child td{border-bottom:0}.sort{all:unset;display:inline-flex;align-items:center;gap:var(--spacing-xs);cursor:pointer;border-radius:var(--radius-sm)}.sort:focus-visible{outline:2px solid var(--color-accent-default);outline-offset:2px}.sort__cue{font-size:var(--typography-size-xs);color:var(--color-text-secondary)}.table__empty{padding:var(--spacing-2xl) var(--spacing-lg);text-align:center}.table__empty-message{margin:0;font-size:var(--typography-size-sm);color:var(--color-text-secondary)}`;let n=0;const l=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.chSort=r(this,"chSort")}captionId=`ch-table-${++n}-caption`;emptyId=`${this.captionId}-empty`;get host(){return this}columns=[];sortable=false;sortKey;sortDirection="ascending";label;empty="unmeasured";filtered=false;chSort;onFiltered(){this.measure()}rerenderHeaders(){this.rerender=!this.rerender}rerender=false;observer;componentDidLoad(){this.measure();if(typeof MutationObserver==="function"){this.observer=new MutationObserver(this.measure);this.observer.observe(this.host,{childList:true})}}disconnectedCallback(){this.observer?.disconnect();this.observer=undefined}measure=()=>{const e=Array.from(this.host.children).filter((e=>e.tagName==="TR"));this.empty=e.length===0?"true":"none"};get emptyState(){if(this.filtered){return"filtered"}return this.empty}sortCue(e){if(!e){return"⇅"}return this.sortDirection==="ascending"?"▲":"▼"}emptyMessage(e){return e==="filtered"?"No results for these filters.":"Nothing here yet."}nextDirection(e){if(this.sortKey!==e){return"ascending"}return this.sortDirection==="ascending"?"descending":"ascending"}handleSort=e=>{this.chSort.emit({key:e,direction:this.nextDirection(e)})};handleHeaderKeydown=(e,t)=>{if(e.key!=="Enter"&&e.key!==" "){return}e.preventDefault();this.handleSort(t)};renderHeaderCell(e){const t=this.sortable&&e.sortable!==false;if(!t){return s("th",{scope:"col",class:"cell cell--header"},e.label)}const r=this.sortKey===e.key;const a=r?this.sortDirection:"none";return s("th",{scope:"col",class:"cell cell--header","aria-sort":a},s("button",{type:"button",class:"sort",onClick:()=>this.handleSort(e.key),onKeyDown:t=>this.handleHeaderKeydown(t,e.key)},s("span",null,e.label),s("span",{class:"sort__cue","aria-hidden":"true"},this.sortCue(r))))}render(){const e=this.emptyState;return s(a,{key:"f4511d753b9140b08eee0e50041ba4e7408930ec",class:{table:true,"table--empty":e==="true"||e==="filtered"}},s("div",{key:"8cc987803f5d000d7efbbc6b605561d2c6ca1c46",class:"table__scroll",tabIndex:0,role:"group","aria-labelledby":this.captionId},s("table",{key:"9eff6abfe0fecfd3559bfe397db3957fa60e288a"},s("caption",{key:"35d88e56267aff1ae9753326ffc807cf6e04bfba",id:this.captionId,class:"caption"},this.label),s("thead",{key:"0b01e865f3c0f40e9e86634f701b77886713e2e3"},s("tr",{key:"92ded28a12867b8a2a372a9b04e8fd251870a5c7"},this.columns.map((e=>this.renderHeaderCell(e))))),s("tbody",{key:"68d7a49aa51cf1e958f1af7ebc36cdb5f6acfdd0"},s("slot",{key:"79e296699379971e93b8a91b7823987be835ce8e"})))),(e==="true"||e==="filtered")&&s("div",{key:"b7b2734f3d83ced393377fbe6f2911d2466ce714",class:"table__empty",id:this.emptyId},s("slot",{key:"926191c01eef1f1898ad7fc800824021a697da35",name:"empty"},s("p",{key:"6302a52795029b3d31200ae3c1c4ff53af3ab81c",class:"table__empty-message"},this.emptyMessage(e)))))}static get watchers(){return{filtered:[{onFiltered:0}],sortKey:[{rerenderHeaders:0}],sortDirection:[{rerenderHeaders:0}],sortable:[{rerenderHeaders:0}]}}static get style(){return i()}},[769,"ch-table",{columns:[16],sortable:[516],sortKey:[1,"sort-key"],sortDirection:[1,"sort-direction"],label:[1],filtered:[516],empty:[32],rerender:[32]},undefined,{filtered:[{onFiltered:0}],sortKey:[{rerenderHeaders:0}],sortDirection:[{rerenderHeaders:0}],sortable:[{rerenderHeaders:0}]}]);function c(){if(typeof customElements==="undefined"){return}const e=["ch-table"];e.forEach((e=>{switch(e){case"ch-table":if(!customElements.get(o(e))){customElements.define(o(e),l)}break}}))}c();const d=l;const f=c;export{d as ChTable,f as defineCustomElement};
2
+ //# sourceMappingURL=ch-table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["chTableCss","tableIds","ChTable","__stencil_proxyCustomElement","HTMLElement","captionId","emptyId","this","columns","sortable","sortKey","sortDirection","label","empty","filtered","chSort","onFiltered","measure","rerenderHeaders","rerender","observer","componentDidLoad","MutationObserver","observe","host","childList","disconnectedCallback","disconnect","undefined","rows","Array","from","children","filter","child","tagName","length","emptyState","sortCue","active","emptyMessage","state","nextDirection","key","handleSort","emit","direction","handleHeaderKeydown","ev","preventDefault","renderHeaderCell","column","h","scope","class","type","onClick","onKeyDown","render","Host","table","tabIndex","role","id","map","name"],"sources":["src/components/ch-table/ch-table.css?tag=ch-table&encapsulation=shadow","src/components/ch-table/ch-table.tsx"],"sourcesContent":[":host {\n display: block;\n font-family: var(--typography-body);\n color: var(--color-text-primary);\n}\n\n:host([hidden]) {\n display: none;\n}\n\n/*\n * The scroll box owns the horizontal overflow so a wide table never widens the\n * page. It is focusable so a keyboard user can scroll it without a mouse.\n */\n.table__scroll {\n overflow-x: auto;\n /* Without this the table shrinks to the box and never overflows. */\n min-width: 0;\n border: var(--border-width) solid var(--color-border-default);\n border-radius: var(--radius-md);\n background: var(--color-surface-default);\n}\n\n.table__scroll:focus-visible {\n outline: 2px solid var(--color-accent-default);\n outline-offset: 2px;\n}\n\n.table {\n /*\n * `width: max-content` with a `min-width: 100%` floor: on a wide viewport the\n * table fills the box, on a narrow one it keeps the width its cells need and\n * the scroll box absorbs the overflow. `width: 100%` would instead squeeze the\n * columns until the text wrapped, which is not scrolling.\n */\n width: 100%;\n border-collapse: collapse;\n font-size: var(--typography-size-sm);\n}\n\n/* A cell never collapses below a readable width, which is what makes the table\n * wider than a narrow scroll box and produces the horizontal scroll. */\n.cell {\n min-width: 8rem;\n}\n\n.caption {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n}\n\n.cell {\n padding: var(--spacing-md) var(--spacing-lg);\n text-align: left;\n vertical-align: top;\n border-bottom: var(--border-width) solid var(--color-border-default);\n}\n\n.cell--header {\n font-weight: var(--typography-weight-semibold);\n color: var(--color-text-secondary);\n white-space: nowrap;\n background: var(--color-surface-hover);\n}\n\n/* The last body row loses its rule; the scroll box border closes the table. */\ntbody tr:last-child td {\n border-bottom: 0;\n}\n\n.sort {\n all: unset;\n display: inline-flex;\n align-items: center;\n gap: var(--spacing-xs);\n cursor: pointer;\n border-radius: var(--radius-sm);\n}\n\n.sort:focus-visible {\n outline: 2px solid var(--color-accent-default);\n outline-offset: 2px;\n}\n\n/* Direction is carried by the glyph, not by colour alone. */\n.sort__cue {\n font-size: var(--typography-size-xs);\n color: var(--color-text-secondary);\n}\n\n.table__empty {\n padding: var(--spacing-2xl) var(--spacing-lg);\n text-align: center;\n}\n\n.table__empty-message {\n margin: 0;\n font-size: var(--typography-size-sm);\n color: var(--color-text-secondary);\n}\n","import { Component, Element, Event, type EventEmitter, Host, Prop, State, Watch, h } from '@stencil/core';\n\nexport type ChTableSortDirection = 'ascending' | 'descending';\n\n/** A column the table can sort by, in display order. */\nexport interface ChTableSortColumn {\n /** Identifies the column in `chSort` events. */\n key: string;\n /** Visible header text. */\n label: string;\n /** Whether the header offers sorting. Defaults to `true` when the table is sortable. */\n sortable?: boolean;\n}\n\nlet tableIds = 0;\n\n/**\n * Presentation-only data grid over a native `<table>`.\n *\n * The component renders the table skeleton and the header row; the consumer\n * slots the body as **native** `<tr>` elements. It does not hold the rows, sort\n * them, paginate them or fetch anything — it reports intent and the consumer\n * decides. Sorting is controlled: the table reflects the `sortKey` and\n * `sortDirection` it is given, so a consumer that ignores `chSort` leaves the\n * `aria-sort` that matches its own data.\n *\n * ```html\n * <ch-table sortable sort-key=\"name\" sort-direction=\"ascending\">\n * <tr><td>Aurora SpA</td><td>En despacho</td></tr>\n * <tr><td>Bosque Ltda</td><td>Pendiente</td></tr>\n * </ch-table>\n * ```\n *\n * ```js\n * table.columns = [\n * { key: 'name', label: 'Cliente' },\n * { key: 'status', label: 'Estado' },\n * ];\n * ```\n *\n * Columns come from the `columns` prop, like `ch-select`'s `options` — there is\n * no `ch-table-column` element, and an unknown element inside a component is\n * never rendered.\n *\n * Rows must be real `<tr>` elements created as DOM nodes, not written as\n * HTML inside the tag: the parser rejects a `<tr>` outside a `<table>`, so\n * `<ch-table><tr>…</tr></ch-table>` in an HTML string parses to a text node\n * and the table correctly reports itself empty. Framework templates and\n * `createElement` are unaffected.\n *\n * The shape is the one approved on #77: `table`/`thead`/`tbody` live in the\n * shadow DOM and the consumer slots native rows. Custom row and cell elements\n * are not possible — the HTML parser foster-parents them out of a native\n * table, which the spike in `tests/browser/semantic-shapes.browser.spec.ts`\n * measured in real Chromium.\n */\n@Component({\n tag: 'ch-table',\n styleUrl: 'ch-table.css',\n shadow: true,\n})\nexport class ChTable {\n private readonly captionId = `ch-table-${++tableIds}-caption`;\n private readonly emptyId = `${this.captionId}-empty`;\n\n @Element() private host!: HTMLElement;\n\n /** Columns, in display order. Rendered as the header row. */\n @Prop() columns: ChTableSortColumn[] = [];\n\n /** Whether the header offers sorting. Individual columns can opt out. */\n @Prop({ reflect: true }) sortable = false;\n\n /** Key of the column currently used for sorting. Controlled by the consumer. */\n @Prop() sortKey?: string;\n\n /** Direction of the current sort. Defaults to `ascending`. */\n @Prop() sortDirection: ChTableSortDirection = 'ascending';\n\n /**\n * Accessible name for the table. Always rendered as a caption, visually\n * hidden, because a data table without a name is announced as a bare grid.\n */\n @Prop() label!: string;\n\n /**\n * Shown in place of the rows when the body is empty. `filtered` distinguishes\n * \"nothing matched your filters\" from \"there is nothing yet\", which are\n * different messages and different next actions.\n */\n @State() empty: 'unmeasured' | 'none' | 'true' = 'unmeasured';\n\n /**\n * Marks the body as empty *because of filtering* rather than because there is\n * no data at all. Both look like zero rows, and they need different messages\n * and different next actions.\n */\n @Prop({ reflect: true }) filtered = false;\n\n /** Emitted when a sortable header is activated. The consumer applies the sort. */\n @Event() chSort: EventEmitter<{ key: string; direction: ChTableSortDirection }>;\n\n @Watch('filtered')\n protected onFiltered(): void {\n this.measure();\n }\n\n @Watch('sortKey')\n @Watch('sortDirection')\n @Watch('sortable')\n protected rerenderHeaders(): void {\n // Header attributes are derived from controlled props, so a prop change\n // has to repaint them; `columns` and the slot repaint on their own.\n this.rerender = !this.rerender;\n }\n\n @State() private rerender = false;\n\n private observer?: MutationObserver;\n\n componentDidLoad() {\n this.measure();\n // `slotchange` does not fire for native `<tr>` children, and it only fires\n // at all once the element is upgraded, so a row added later would leave the\n // table stuck on its first measurement. Observing the host covers both\n // orders plus a consumer that swaps rows on refresh. `MutationObserver` is\n // absent in the mock-doc test environment, where the slot behaviour is\n // exercised through an explicit `slotchange` instead.\n if (typeof MutationObserver === 'function') {\n this.observer = new MutationObserver(this.measure);\n this.observer.observe(this.host, { childList: true });\n }\n }\n\n disconnectedCallback() {\n this.observer?.disconnect();\n this.observer = undefined;\n }\n\n private measure = (): void => {\n const rows = Array.from(this.host.children).filter(child => child.tagName === 'TR');\n this.empty = rows.length === 0 ? 'true' : 'none';\n };\n\n /**\n * A filtered-empty body and a truly empty one both have zero rows; only the\n * consumer knows which, since `filtered` is a prop it controls.\n */\n private get emptyState(): 'none' | 'true' | 'filtered' | 'unmeasured' {\n if (this.filtered) {\n return 'filtered';\n }\n return this.empty;\n }\n\n /** Direction glyph. Not colour: the arrow is the cue in greyscale. */\n private sortCue(active: boolean): string {\n if (!active) {\n return '⇅';\n }\n return this.sortDirection === 'ascending' ? '▲' : '▼';\n }\n\n private emptyMessage(state: 'none' | 'true' | 'filtered' | 'unmeasured'): string {\n return state === 'filtered' ? 'No results for these filters.' : 'Nothing here yet.';\n }\n\n private nextDirection(key: string): ChTableSortDirection {\n if (this.sortKey !== key) {\n return 'ascending';\n }\n return this.sortDirection === 'ascending' ? 'descending' : 'ascending';\n }\n\n private handleSort = (key: string) => {\n this.chSort.emit({ key, direction: this.nextDirection(key) });\n };\n\n private handleHeaderKeydown = (ev: KeyboardEvent, key: string) => {\n if (ev.key !== 'Enter' && ev.key !== ' ') {\n return;\n }\n ev.preventDefault();\n this.handleSort(key);\n };\n\n private renderHeaderCell(column: ChTableSortColumn) {\n const sortable = this.sortable && column.sortable !== false;\n if (!sortable) {\n return (\n <th scope=\"col\" class=\"cell cell--header\">\n {column.label}\n </th>\n );\n }\n\n const active = this.sortKey === column.key;\n const direction = active ? this.sortDirection : 'none';\n return (\n <th scope=\"col\" class=\"cell cell--header\" aria-sort={direction}>\n <button type=\"button\" class=\"sort\" onClick={() => this.handleSort(column.key)} onKeyDown={ev => this.handleHeaderKeydown(ev, column.key)}>\n <span>{column.label}</span>\n <span class=\"sort__cue\" aria-hidden=\"true\">\n {this.sortCue(active)}\n </span>\n </button>\n </th>\n );\n }\n\n render() {\n const empty = this.emptyState;\n // Before the first measurement the table is rendered as non-empty, so a\n // consumer never sees the empty message flash over real rows.\n return (\n <Host class={{ 'table': true, 'table--empty': empty === 'true' || empty === 'filtered' }}>\n <div class=\"table__scroll\" tabIndex={0} role=\"group\" aria-labelledby={this.captionId}>\n <table>\n <caption id={this.captionId} class=\"caption\">\n {this.label}\n </caption>\n <thead>\n <tr>{this.columns.map(column => this.renderHeaderCell(column))}</tr>\n </thead>\n <tbody>\n <slot></slot>\n </tbody>\n </table>\n </div>\n {(empty === 'true' || empty === 'filtered') && (\n <div class=\"table__empty\" id={this.emptyId}>\n <slot name=\"empty\">\n <p class=\"table__empty-message\">{this.emptyMessage(empty)}</p>\n </slot>\n </div>\n )}\n </Host>\n );\n }\n}\n"],"mappings":"uEAAA,MAAMA,EAAa,IAAM,y5CCczB,IAAIC,EAAW,E,MA+CFC,EAAOC,EAAA,MAAAD,UAAAE,E,8GACDC,UAAY,cAAcJ,YAC1BK,QAAU,GAAGC,KAAKF,kB,uBAK3BG,QAA+B,GAGdC,SAAW,MAG5BC,QAGAC,cAAsC,YAMtCC,MAOCC,MAAwC,aAOxBC,SAAW,MAG3BC,OAGC,UAAAC,GACRT,KAAKU,S,CAMG,eAAAC,GAGRX,KAAKY,UAAYZ,KAAKY,Q,CAGPA,SAAW,MAEpBC,SAER,gBAAAC,GACEd,KAAKU,UAOL,UAAWK,mBAAqB,WAAY,CAC1Cf,KAAKa,SAAW,IAAIE,iBAAiBf,KAAKU,SAC1CV,KAAKa,SAASG,QAAQhB,KAAKiB,KAAM,CAAEC,UAAW,M,EAIlD,oBAAAC,GACEnB,KAAKa,UAAUO,aACfpB,KAAKa,SAAWQ,S,CAGVX,QAAU,KAChB,MAAMY,EAAOC,MAAMC,KAAKxB,KAAKiB,KAAKQ,UAAUC,QAAOC,GAASA,EAAMC,UAAY,OAC9E5B,KAAKM,MAAQgB,EAA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CAACW,MAAO,CAAEM,MAAS,KAAM,eAAgB/C,IAAU,QAAUA,IAAU,aAC1EuC,EAAA,OAAAT,IAAA,2CAAKW,MAAM,gBAAgBO,SAAU,EAAGC,KAAK,QAAO,kBAAkBvD,KAAKF,WACzE+C,EAAA,SAAAT,IAAA,4CACES,EAAA,WAAAT,IAAA,2CAASoB,GAAIxD,KAAKF,UAAWiD,MAAM,WAChC/C,KAAKK,OAERwC,EAAA,SAAAT,IAAA,4CACES,EAAA,MAAAT,IAAA,4CAAKpC,KAAKC,QAAQwD,KAAIb,GAAU5C,KAAK2C,iBAAiBC,OAExDC,EAAA,SAAAT,IAAA,4CACES,EAAA,QAAAT,IAAA,iDAIJ9B,IAAU,QAAUA,IAAU,aAC9BuC,EAAA,OAAAT,IAAA,2CAAKW,MAAM,eAAeS,GAAIxD,KAAKD,SACjC8C,EAAA,QAAAT,IAAA,2CAAMsB,KAAK,SACTb,EAAA,KAAAT,IAAA,2CAAGW,MAAM,wBAAwB/C,KAAKiC,aAAa3B,M","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{p as t,H as a,c as e,h as r,d as i,t as s}from"./p-qP_9qshx.js";const o=()=>`:host{display:block}.tablist{display:flex;gap:var(--spacing-2xl);border-bottom:var(--border-width) solid var(--border)}.tab{appearance:none;position:relative;background:transparent;border:none;padding:var(--spacing-md) 0 var(--spacing-xl);margin-bottom:calc(-1 * var(--border-width));color:var(--text-muted);font-family:inherit;font-size:inherit;font-weight:var(--typography-weight-semibold);cursor:pointer;transition:color var(--duration-normal) var(--easing-default), border-color var(--duration-normal) var(--easing-default)}.tab::after{content:'';position:absolute;left:0;right:0;bottom:0;height:var(--border-accent-bar);background:var(--accent);opacity:0;transition:opacity var(--duration-normal) var(--easing-default)}.tab:hover{color:var(--text)}.tab:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.tab--active{color:var(--text)}.tab--active::after{opacity:1}.tab--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.tabpanel{padding-top:var(--spacing-2xl);color:var(--text)}.tabpanel[hidden]{display:none}`;const n=0;const l=-1;const c=1;const d=-1;let b=0;const h=t(class t extends a{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow();this.chChange=e(this,"chChange")}baseId=`ch-tabs-${++b}`;tablistEl;tabs=[];value;label;chChange;tabId(t){return`${this.baseId}-${t}`}panelId(t){return`${this.baseId}-${t}-panel`}get activeValue(){if(this.value&&this.tabs.some((t=>!t.disabled&&t.value===this.value))){return this.value}return this.tabs.find((t=>!t.disabled))?.value}select=t=>{this.value=t;this.chChange.emit(this.value)};focusTab(t){this.tablistEl?.querySelectorAll('[role="tab"]').forEach((a=>{if(a.dataset.value===t){a.focus()}}))}handleKeyDown=t=>{const a=this.tabs.filter((t=>!t.disabled));if(!a.length){return}const e=this.targetFor(t.key,a);if(!e){return}t.preventDefault();this.select(e);this.focusTab(e)};targetFor(t,a){const e=a.findIndex((t=>t.value===this.activeValue));if(t==="ArrowRight"){return a[(e+c)%a.length]?.value}if(t==="ArrowLeft"){return a[(e+d+a.length)%a.length]?.value}if(t==="Home"){return a[n]?.value}if(t==="End"){return a[a.length+l]?.value}return undefined}render(){const t=this.activeValue;return r(i,{key:"de167280c159345631f84f5eb7a3dc165396f361"},r("div",{key:"62c008bcf9eafd1c5f5121540b2841e2a6ada541",class:"tablist",role:"tablist","aria-label":this.label,onKeyDown:this.handleKeyDown,ref:t=>this.tablistEl=t},this.tabs.map((a=>{const e=a.value===t;return r("button",{key:a.value,type:"button",class:{tab:true,"tab--active":e,"tab--disabled":Boolean(a.disabled)},role:"tab",id:this.tabId(a.value),"data-value":a.value,"aria-selected":e?"true":"false","aria-controls":this.panelId(a.value),tabIndex:e?n:l,disabled:a.disabled,onClick:()=>this.select(a.value)},a.label)}))),this.tabs.map((a=>r("div",{key:`${a.value}-panel`,class:"tabpanel",id:this.panelId(a.value),role:"tabpanel","aria-labelledby":this.tabId(a.value),tabIndex:n,hidden:a.value!==t},r("slot",{name:`panel-${a.value}`})))))}static get style(){return o()}},[769,"ch-tabs",{tabs:[16],value:[1025],label:[1]}]);function u(){if(typeof customElements==="undefined"){return}const t=["ch-tabs"];t.forEach((t=>{switch(t){case"ch-tabs":if(!customElements.get(s(t))){customElements.define(s(t),h)}break}}))}u();const f=h;const p=u;export{f as ChTabs,p as defineCustomElement};
1
+ import{p as t,H as a,c as e,h as r,d as i,t as s}from"./p-qP_9qshx.js";const o=()=>`:host{display:block}.tablist{display:flex;gap:var(--spacing-2xl);border-bottom:var(--border-width) solid var(--border)}.tab{appearance:none;position:relative;background:transparent;border:none;padding:var(--spacing-md) 0 var(--spacing-xl);margin-bottom:calc(-1 * var(--border-width));color:var(--text-muted);font-family:inherit;font-size:inherit;font-weight:var(--typography-weight-semibold);cursor:pointer;transition:color var(--duration-normal) var(--easing-default), border-color var(--duration-normal) var(--easing-default)}.tab::after{content:'';position:absolute;left:0;right:0;bottom:0;height:var(--border-accent-bar);background:var(--accent);opacity:0;transition:opacity var(--duration-normal) var(--easing-default)}.tab:hover{color:var(--text)}.tab:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.tab--active{color:var(--text)}.tab--active::after{opacity:1}.tab--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.tabpanel{padding-top:var(--spacing-2xl);color:var(--text)}.tabpanel[hidden]{display:none}`;const n=0;const l=-1;const c=1;const d=-1;let b=0;const h=t(class t extends a{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow();this.chChange=e(this,"chChange")}baseId=`ch-tabs-${++b}`;tablistEl;tabs=[];value;label;chChange;tabId(t){return`${this.baseId}-${t}`}panelId(t){return`${this.baseId}-${t}-panel`}get activeValue(){if(this.value&&this.tabs.some((t=>!t.disabled&&t.value===this.value))){return this.value}return this.tabs.find((t=>!t.disabled))?.value}select=t=>{this.value=t;this.chChange.emit(this.value)};focusTab(t){this.tablistEl?.querySelectorAll('[role="tab"]').forEach((a=>{if(a.dataset.value===t){a.focus()}}))}handleKeyDown=t=>{const a=this.tabs.filter((t=>!t.disabled));if(!a.length){return}const e=this.targetFor(t.key,a);if(!e){return}t.preventDefault();this.select(e);this.focusTab(e)};targetFor(t,a){const e=a.findIndex((t=>t.value===this.activeValue));if(t==="ArrowRight"){return a[(e+c)%a.length]?.value}if(t==="ArrowLeft"){return a[(e+d+a.length)%a.length]?.value}if(t==="Home"){return a[n]?.value}if(t==="End"){return a[a.length+l]?.value}return undefined}render(){const t=this.activeValue;return r(i,{key:"5fd5208bb1b9b75f13b9d3830d042f623aaca651"},r("div",{key:"8d602a604a8315db01f3e4d28a39e866efabdb48",class:"tablist",role:"tablist","aria-label":this.label,onKeyDown:this.handleKeyDown,ref:t=>this.tablistEl=t},this.tabs.map((a=>{const e=a.value===t;return r("button",{key:a.value,type:"button",class:{tab:true,"tab--active":e,"tab--disabled":Boolean(a.disabled)},role:"tab",id:this.tabId(a.value),"data-value":a.value,"aria-selected":e?"true":"false","aria-controls":this.panelId(a.value),tabIndex:e?n:l,disabled:a.disabled,onClick:()=>this.select(a.value)},a.label)}))),this.tabs.map((a=>r("div",{key:`${a.value}-panel`,class:"tabpanel",id:this.panelId(a.value),role:"tabpanel","aria-labelledby":this.tabId(a.value),tabIndex:n,hidden:a.value!==t},r("slot",{name:`panel-${a.value}`})))))}static get style(){return o()}},[769,"ch-tabs",{tabs:[16],value:[1025],label:[1]}]);function u(){if(typeof customElements==="undefined"){return}const t=["ch-tabs"];t.forEach((t=>{switch(t){case"ch-tabs":if(!customElements.get(s(t))){customElements.define(s(t),h)}break}}))}u();const f=h;const p=u;export{f as ChTabs,p as defineCustomElement};
2
2
  //# sourceMappingURL=ch-tabs.js.map
@@ -1,2 +1,2 @@
1
- import{p as t,H as e,c as r,h as a,d as s,t as i}from"./p-qP_9qshx.js";import{r as o}from"./p-BXzZsX2r.js";const n=()=>`: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)}.textarea{box-sizing:border-box;width:100%;min-height:var(--spacing-6xl);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;line-height:var(--spacing-5xl);resize:vertical;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.textarea::placeholder{color:var(--text-muted)}.textarea:focus{border-color:var(--accent);box-shadow:var(--shadow-focus-ring);outline:none}.textarea--invalid{border-color:var(--color-status-warning)}.textarea--invalid:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}:host([data-touched]:invalid) .textarea,:host(:user-invalid) .textarea{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .textarea:focus,:host(:user-invalid) .textarea:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}.textarea: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)}`;let h=0;const d=4;const c=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow();this.chInput=r(this,"chInput");this.chChange=r(this,"chChange");this.internals=this.attachInternals()}textareaId=`ch-textarea-${++h}`;hintId=`${this.textareaId}-hint`;errorId=`${this.textareaId}-error`;initialValue="";internals;formDisabled=false;get host(){return this}label;value="";placeholder;rows=d;name;disabled=false;required=false;hint;errorMessage;invalid=false;chInput;chChange;handleInput=t=>{this.value=t.target.value;this.chInput.emit(this.value)};handleChange=t=>{this.value=t.target.value;this.chChange.emit(this.value)};syncForm(){const t=this.internals;if(typeof t?.setFormValue!=="function"){return}t.setFormValue(this.value);const{flags:e,message:r}=o({required:this.required,empty:this.value==="",invalid:this.invalid,errorMessage:this.errorMessage});t.setValidity(e,r)}componentDidLoad(){this.initialValue=this.value;this.syncForm();this.host.addEventListener("change",this.markTouched);this.host.addEventListener("focusout",this.markTouched);this.host.addEventListener("invalid",this.markTouched)}markTouched=()=>{this.host.setAttribute("data-touched","")};formResetCallback(){this.value=this.initialValue}formDisabledCallback(t){this.formDisabled=t}get describedBy(){if(this.invalid&&this.errorMessage){return this.errorId}if(this.hint){return this.hintId}return undefined}render(){return a(s,{key:"c4334a23f6ad2394d410498726f3f422a654ffe3"},this.label&&a("label",{key:"d935613b40c6c52be41e258aad2a3c17a290a506",class:"label",htmlFor:this.textareaId},this.label),a("textarea",{key:"ab27ae9a6be7d2bcc17638c209ef23eb3757c102",id:this.label?this.textareaId:undefined,class:{textarea:true,"textarea--invalid":this.invalid},rows:this.rows,name:this.name,placeholder:this.placeholder,disabled:this.disabled||this.formDisabled,required:this.required,value:this.value,"aria-invalid":this.invalid?"true":undefined,"aria-describedby":this.describedBy,onInput:this.handleInput,onChange:this.handleChange}),this.hint&&!(this.invalid&&this.errorMessage)&&a("p",{key:"eb488704ac6ff76534308aefd0938d848d14608f",class:"hint",id:this.hintId},this.hint),this.invalid&&this.errorMessage&&a("p",{key:"04c084b29d102f06bf15efc4c416b6ba0967ba8d",class:"error",id:this.errorId,role:"alert"},this.errorMessage))}static get formAssociated(){return true}static get watchers(){return{value:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}}static get style(){return n()}},[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]},undefined,{value:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}]);function l(){if(typeof customElements==="undefined"){return}const t=["ch-textarea"];t.forEach((t=>{switch(t){case"ch-textarea":if(!customElements.get(i(t))){customElements.define(i(t),c)}break}}))}l();const u=c;const f=l;export{u as ChTextarea,f as defineCustomElement};
1
+ import{p as e,H as t,c as r,h as a,d as s,t as i}from"./p-qP_9qshx.js";import{r as o}from"./p-BXzZsX2r.js";const n=()=>`: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)}.textarea{box-sizing:border-box;width:100%;min-height:var(--spacing-6xl);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;line-height:var(--spacing-5xl);resize:vertical;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.textarea::placeholder{color:var(--text-muted)}.textarea:focus{border-color:var(--accent);box-shadow:var(--shadow-focus-ring);outline:none}.textarea--invalid{border-color:var(--color-status-warning)}.textarea--invalid:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}:host([data-touched]:invalid) .textarea,:host(:user-invalid) .textarea{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .textarea:focus,:host(:user-invalid) .textarea:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}.textarea: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)}`;let d=0;const h=4;const l=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.chInput=r(this,"chInput");this.chChange=r(this,"chChange");this.internals=this.attachInternals()}textareaId=`ch-textarea-${++d}`;hintId=`${this.textareaId}-hint`;errorId=`${this.textareaId}-error`;initialValue="";internals;formDisabled=false;get host(){return this}label;value="";placeholder;rows=h;name;disabled=false;required=false;hint;errorMessage;invalid=false;chInput;chChange;handleInput=e=>{this.value=e.target.value;this.chInput.emit(this.value)};handleChange=e=>{this.value=e.target.value;this.chChange.emit(this.value)};syncForm(){const e=this.internals;if(typeof e?.setFormValue!=="function"){return}e.setFormValue(this.value);const{flags:t,message:r}=o({required:this.required,empty:this.value==="",invalid:this.invalid,errorMessage:this.errorMessage});e.setValidity(t,r)}componentDidLoad(){this.initialValue=this.value;this.syncForm();this.host.addEventListener("change",this.markTouched);this.host.addEventListener("focusout",this.markTouched);this.host.addEventListener("invalid",this.markTouched)}markTouched=()=>{this.host.setAttribute("data-touched","")};formResetCallback(){this.value=this.initialValue}formDisabledCallback(e){this.formDisabled=e}get describedBy(){if(this.invalid&&this.errorMessage){return this.errorId}if(this.hint){return this.hintId}return undefined}render(){return a(s,{key:"0f2b76444b3bff5d37d069bf1fe307781c5e59d1"},this.label&&a("label",{key:"08b83be70f33dc2c9b93a6d748564aad4eb63d76",class:"label",htmlFor:this.textareaId},this.label),a("textarea",{key:"749876530342e5ff9d70ab7039dded1a4f0faa5a",id:this.label?this.textareaId:undefined,class:{textarea:true,"textarea--invalid":this.invalid},rows:this.rows,name:this.name,placeholder:this.placeholder,disabled:this.disabled||this.formDisabled,required:this.required,value:this.value,"aria-invalid":this.invalid?"true":undefined,"aria-describedby":this.describedBy,onInput:this.handleInput,onChange:this.handleChange}),this.hint&&!(this.invalid&&this.errorMessage)&&a("p",{key:"36e41249852346df559bd278256cc89a79371a88",class:"hint",id:this.hintId},this.hint),this.invalid&&this.errorMessage&&a("p",{key:"90bda1f377da78e07eae82ee13069813c7ed1e8b",class:"error",id:this.errorId,role:"alert"},this.errorMessage))}static get formAssociated(){return true}static get watchers(){return{value:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}}static get style(){return n()}},[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]},undefined,{value:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}]);function c(){if(typeof customElements==="undefined"){return}const e=["ch-textarea"];e.forEach((e=>{switch(e){case"ch-textarea":if(!customElements.get(i(e))){customElements.define(i(e),l)}break}}))}c();const u=l;const b=c;export{u as ChTextarea,b as defineCustomElement};
2
2
  //# sourceMappingURL=ch-textarea.js.map
@@ -1,2 +1,2 @@
1
- import{p as t,H as e,h as a,d as s,t as o}from"./p-qP_9qshx.js";const i=()=>`:host{display:block;font-family:var(--typography-body);color:var(--color-text-secondary)}:host([hidden]){display:none}.list{margin:0;padding:0;display:grid;gap:var(--spacing-md);list-style:none}::slotted(li){position:relative;padding-left:var(--spacing-2xl);min-width:0}::slotted(li)::before{content:'';position:absolute;left:0;top:0.35em;width:var(--spacing-sm);height:var(--spacing-sm);border-radius:50%;background:var(--color-border-default)}::slotted(li:not(:last-of-type))::after{content:'';position:absolute;left:calc(var(--spacing-sm) / 2 - var(--border-width));top:calc(0.35em + var(--spacing-sm));bottom:calc(0px - var(--spacing-md));width:var(--border-width);background:var(--color-border-default)}::slotted(time){font-variant-numeric:tabular-nums}`;const r=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow()}render(){return a(s,{key:"da3288af540acb92113ba83d08fc5e1693e83b3e",class:"timeline"},a("ol",{key:"1aaee846703dd0a67d6df04945eb4a62e2bbf711",class:"list"},a("slot",{key:"394cfd03640a2cf78bd620338de9ed9ef7b9d9f5"})))}static get style(){return i()}},[257,"ch-timeline"]);function n(){if(typeof customElements==="undefined"){return}const t=["ch-timeline"];t.forEach((t=>{switch(t){case"ch-timeline":if(!customElements.get(o(t))){customElements.define(o(t),r)}break}}))}n();const d=r;const c=n;export{d as ChTimeline,c as defineCustomElement};
1
+ import{p as t,H as e,h as s,d as a,t as o}from"./p-qP_9qshx.js";const i=()=>`:host{display:block;font-family:var(--typography-body);color:var(--color-text-secondary)}:host([hidden]){display:none}.list{margin:0;padding:0;display:grid;gap:var(--spacing-md);list-style:none}::slotted(li){position:relative;padding-left:var(--spacing-2xl);min-width:0}::slotted(li)::before{content:'';position:absolute;left:0;top:0.35em;width:var(--spacing-sm);height:var(--spacing-sm);border-radius:50%;background:var(--color-border-default)}::slotted(li:not(:last-of-type))::after{content:'';position:absolute;left:calc(var(--spacing-sm) / 2 - var(--border-width));top:calc(0.35em + var(--spacing-sm));bottom:calc(0px - var(--spacing-md));width:var(--border-width);background:var(--color-border-default)}::slotted(time){font-variant-numeric:tabular-nums}`;const r=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow()}render(){return s(a,{key:"50b3a225915e4223fa3eaf560cb1e15898026ec0",class:"timeline"},s("ol",{key:"5b5e218a419f63990deca2d1a7e0f8f36f63cc09",class:"list"},s("slot",{key:"69ff4592e898cdecb078437b6633e5e24c626e61"})))}static get style(){return i()}},[257,"ch-timeline"]);function n(){if(typeof customElements==="undefined"){return}const t=["ch-timeline"];t.forEach((t=>{switch(t){case"ch-timeline":if(!customElements.get(o(t))){customElements.define(o(t),r)}break}}))}n();const c=r;const l=n;export{c as ChTimeline,l as defineCustomElement};
2
2
  //# sourceMappingURL=ch-timeline.js.map
@@ -1,2 +1,2 @@
1
- import{p as t,H as e,f as o,h as i,d as s,t as n}from"./p-qP_9qshx.js";const r={top:"bottom",bottom:"top",left:"right",right:"left"};const l={top:"vertical",bottom:"vertical",left:"horizontal",right:"horizontal"};function a(t,e){return{top:e.top-t.top,left:e.left-t.left,bottom:t.top+t.height-(e.top+e.height),right:t.left+t.width-(e.left+e.width)}}function b(t,e,o,i){switch(t){case"top":return{top:e.top-o.height-i,left:e.left+(e.width-o.width)/2};case"bottom":return{top:e.top+e.height+i,left:e.left+(e.width-o.width)/2};case"left":return{top:e.top+(e.height-o.height)/2,left:e.left-o.width-i};case"right":return{top:e.top+(e.height-o.height)/2,left:e.left+e.width+i}}}function c({anchor:t,surface:e,viewport:o,preferred:i,gap:s}){const n=[i,r[i]];let c=i;let d=Number.POSITIVE_INFINITY;for(const i of n){const{top:n,left:r}=b(i,t,e,s);const h={top:n,left:r,width:e.width,height:e.height};const u=a(h,o);const p=l[i]==="vertical"?f(u.top)+f(u.bottom):f(u.left)+f(u.right);if(p<d){d=p;c=i}}const{top:u,left:p}=b(c,t,e,s);const m={top:u,left:p,width:e.width,height:e.height};const g=a(m,o);const v=l[c]==="vertical"?{top:u,left:p+h(g.left,g.right)}:{top:u+h(g.top,g.bottom),left:p};return{placement:c,top:v.top,left:v.left}}function f(t){return t>0?t:0}function h(t,e){if(t>0){return t}if(e>0){return-e}return 0}const d=()=>`:host{display:inline-block}.anchor{position:relative;display:inline-flex}.bubble{position:absolute;z-index:var(--z-index-dropdown);width:max-content;max-width:min(16rem, calc(100vw - 2 * var(--spacing-2xl)));padding:var(--spacing-md) var(--spacing-2xl);border:var(--border-width) solid var(--border);border-radius:var(--radius-sm);background:var(--color-background-base);color:var(--text);font-family:var(--font-body);font-size:var(--typography-size-sm);line-height:1.4;opacity:0;visibility:hidden;transition:opacity var(--duration-fast) var(--easing-default), visibility var(--duration-fast) var(--easing-default)}.bubble--visible{opacity:1;visibility:visible}.bubble::before{content:'';position:absolute}.bubble--positioned{position:fixed;top:var(--ch-tooltip-offset-top);left:var(--ch-tooltip-offset-left);transform:none;margin:0}.bubble--top{bottom:100%;left:50%;transform:translateX(-50%);margin-bottom:var(--spacing-md)}.bubble.bubble--positioned.bubble--top,.bubble.bubble--positioned.bubble--bottom,.bubble.bubble--positioned.bubble--left,.bubble.bubble--positioned.bubble--right{inset:auto;top:var(--ch-tooltip-offset-top);left:var(--ch-tooltip-offset-left);right:auto;bottom:auto;transform:none;margin:0}.bubble--top::before{top:100%;left:0;right:0;height:var(--spacing-md)}.bubble--bottom{top:100%;left:50%;transform:translateX(-50%);margin-top:var(--spacing-md)}.bubble--bottom::before{bottom:100%;left:0;right:0;height:var(--spacing-md)}.bubble--left{right:100%;top:50%;transform:translateY(-50%);margin-right:var(--spacing-md)}.bubble--left::before{left:100%;top:0;bottom:0;width:var(--spacing-md)}.bubble--right{left:100%;top:50%;transform:translateY(-50%);margin-left:var(--spacing-md)}.bubble--right::before{right:100%;top:0;bottom:0;width:var(--spacing-md)}@media (prefers-reduced-motion: reduce){.bubble{transition:none}}`;let u=0;const p=8;const m=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow()}get el(){return this}fallbackId=`ch-tooltip-${++u}`;bubbleEl;cleanup;placement="top";hovered=false;focused=false;dismissed=false;resolvedPlacement;offset;get visible(){return(this.hovered||this.focused)&&!this.dismissed}componentDidLoad(){this.associate()}connectedCallback(){this.watchViewport()}disconnectedCallback(){this.cleanup?.()}handleMouseEnter(){this.hovered=true;this.dismissed=false;this.position()}handleMouseLeave(){this.hovered=false}handleFocusIn(){this.focused=true;this.dismissed=false;this.position()}handleFocusOut(){this.focused=false}handleKeyDown(t){if(t.key==="Escape"&&this.visible&&!t.defaultPrevented){t.preventDefault();this.dismissed=true}}handleScroll(){if(this.visible&&this.offset){this.position()}}handleResize(){this.position()}watchViewport(){if(typeof window==="undefined"){return}const t=window.visualViewport;if(!t||this.cleanup){return}const e=()=>this.position();t.addEventListener("resize",e);t.addEventListener("scroll",e);this.cleanup=()=>{t.removeEventListener("resize",e);t.removeEventListener("scroll",e)}}slotted(t){return Array.from(this.el.children).find((e=>e.getAttribute("slot")===t))}position(){if(typeof window==="undefined"){return}const t=this.bubbleEl??(this.bubbleEl=this.el.shadowRoot?.querySelector(".bubble")??undefined);if(!t||t.offsetWidth===0){return}const e=this.slotted("trigger")?.getBoundingClientRect?.();if(!e){return}const i={width:t.offsetWidth+g(t),height:t.offsetHeight};const s=window.visualViewport;const{placement:n,top:r,left:l}=c({anchor:{top:e.top,left:e.left,width:e.width,height:e.height},surface:i,viewport:s?{top:s.offsetTop,left:s.offsetLeft,width:s.width,height:s.height}:{top:0,left:0,width:window.innerWidth,height:window.innerHeight},preferred:this.placement,gap:p});const a=this.offset;const b=a?.top===r&&a?.left===l&&this.resolvedPlacement===n;this.resolvedPlacement=n;this.offset={top:r,left:l};if(!b){o(this)}}associate=()=>{const t=this.slotted("trigger");const e=this.slotted("content");if(!t||!e){return}if(!e.id){e.id=this.fallbackId}e.setAttribute("role","tooltip");t.setAttribute("aria-describedby",e.id)};render(){const{offset:t}=this;return i(s,{key:"676e431d0100ecc9ea688b7e37bc87e8295bb24d"},i("span",{key:"20a388681252e9c4d52e662c014efd9a198efbd7",class:"anchor"},i("slot",{key:"a06cbe31dd04cba38ef09788359783d816fc1a5b",name:"trigger",onSlotchange:this.associate}),i("span",{key:"13cb5b782a7029fc82c10b9b6765de62b94b9afa",ref:t=>this.bubbleEl=t,style:{"--ch-tooltip-offset-top":t?`${t.top}px`:null,"--ch-tooltip-offset-left":t?`${t.left}px`:null},class:{bubble:true,"bubble--positioned":Boolean(this.offset),[`bubble--${this.resolvedPlacement??this.placement}`]:true,"bubble--visible":this.visible}},i("slot",{key:"6610bbf299354bb3be07bb273fab3f8fd91fd254",name:"content",onSlotchange:this.associate}))))}static get style(){return d()}},[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"]]]);function g(t){const e=getComputedStyle(t);return(parseFloat(e.marginLeft)||0)+(parseFloat(e.marginRight)||0)}function v(){if(typeof customElements==="undefined"){return}const t=["ch-tooltip"];t.forEach((t=>{switch(t){case"ch-tooltip":if(!customElements.get(n(t))){customElements.define(n(t),m)}break}}))}v();const w=m;const y=v;export{w as ChTooltip,y as defineCustomElement};
1
+ import{p as t,H as e,f as o,h as i,d as s,t as n}from"./p-qP_9qshx.js";const r={top:"bottom",bottom:"top",left:"right",right:"left"};const l={top:"vertical",bottom:"vertical",left:"horizontal",right:"horizontal"};function a(t,e){return{top:e.top-t.top,left:e.left-t.left,bottom:t.top+t.height-(e.top+e.height),right:t.left+t.width-(e.left+e.width)}}function c(t,e,o,i){switch(t){case"top":return{top:e.top-o.height-i,left:e.left+(e.width-o.width)/2};case"bottom":return{top:e.top+e.height+i,left:e.left+(e.width-o.width)/2};case"left":return{top:e.top+(e.height-o.height)/2,left:e.left-o.width-i};case"right":return{top:e.top+(e.height-o.height)/2,left:e.left+e.width+i}}}function b({anchor:t,surface:e,viewport:o,preferred:i,gap:s}){const n=[i,r[i]];let b=i;let d=Number.POSITIVE_INFINITY;for(const i of n){const{top:n,left:r}=c(i,t,e,s);const h={top:n,left:r,width:e.width,height:e.height};const p=a(h,o);const u=l[i]==="vertical"?f(p.top)+f(p.bottom):f(p.left)+f(p.right);if(u<d){d=u;b=i}}const{top:p,left:u}=c(b,t,e,s);const m={top:p,left:u,width:e.width,height:e.height};const g=a(m,o);const v=l[b]==="vertical"?{top:p,left:u+h(g.left,g.right)}:{top:p+h(g.top,g.bottom),left:u};return{placement:b,top:v.top,left:v.left}}function f(t){return t>0?t:0}function h(t,e){if(t>0){return t}if(e>0){return-e}return 0}const d=()=>`:host{display:inline-block}.anchor{position:relative;display:inline-flex}.probe{position:fixed;top:0;left:0;width:1px;height:1px;visibility:hidden;pointer-events:none}.bubble{position:absolute;z-index:var(--z-index-dropdown);width:max-content;max-width:min(16rem, calc(100vw - 2 * var(--spacing-2xl)));padding:var(--spacing-md) var(--spacing-2xl);border:var(--border-width) solid var(--border);border-radius:var(--radius-sm);background:var(--color-background-base);color:var(--text);font-family:var(--font-body);font-size:var(--typography-size-sm);line-height:1.4;opacity:0;visibility:hidden;transition:opacity var(--duration-fast) var(--easing-default), visibility var(--duration-fast) var(--easing-default)}.bubble--visible{opacity:1;visibility:visible}.bubble::before{content:'';position:absolute}.bubble--positioned{position:fixed;top:var(--ch-tooltip-offset-top);left:var(--ch-tooltip-offset-left);transform:none;margin:0}.bubble--top{bottom:100%;left:50%;transform:translateX(-50%);margin-bottom:var(--spacing-md)}.bubble.bubble--positioned.bubble--top,.bubble.bubble--positioned.bubble--bottom,.bubble.bubble--positioned.bubble--left,.bubble.bubble--positioned.bubble--right{inset:auto;top:var(--ch-tooltip-offset-top);left:var(--ch-tooltip-offset-left);right:auto;bottom:auto;transform:none;margin:0}.bubble--top::before{top:100%;left:0;right:0;height:var(--spacing-md)}.bubble--bottom{top:100%;left:50%;transform:translateX(-50%);margin-top:var(--spacing-md)}.bubble--bottom::before{bottom:100%;left:0;right:0;height:var(--spacing-md)}.bubble--left{right:100%;top:50%;transform:translateY(-50%);margin-right:var(--spacing-md)}.bubble--left::before{left:100%;top:0;bottom:0;width:var(--spacing-md)}.bubble--right{left:100%;top:50%;transform:translateY(-50%);margin-left:var(--spacing-md)}.bubble--right::before{right:100%;top:0;bottom:0;width:var(--spacing-md)}@media (prefers-reduced-motion: reduce){.bubble{transition:none}}`;let p=0;const u=8;const m=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow()}get el(){return this}fallbackId=`ch-tooltip-${++p}`;bubbleEl;probeEl;cleanup;placement="top";hovered=false;focused=false;dismissed=false;resolvedPlacement;offset;get visible(){return(this.hovered||this.focused)&&!this.dismissed}componentDidLoad(){this.associate()}connectedCallback(){this.watchViewport()}disconnectedCallback(){this.cleanup?.()}handleMouseEnter(){this.hovered=true;this.dismissed=false;this.position()}handleMouseLeave(){this.hovered=false}handleFocusIn(){this.focused=true;this.dismissed=false;this.position()}handleFocusOut(){this.focused=false}handleKeyDown(t){if(t.key==="Escape"&&this.visible&&!t.defaultPrevented){t.preventDefault();this.dismissed=true}}handleScroll(){if(this.visible&&this.offset){this.position()}}handleResize(){this.position()}watchViewport(){if(typeof window==="undefined"){return}const t=window.visualViewport;if(!t||this.cleanup){return}const e=()=>this.position();t.addEventListener("resize",e);t.addEventListener("scroll",e);this.cleanup=()=>{t.removeEventListener("resize",e);t.removeEventListener("scroll",e)}}slotted(t){return Array.from(this.el.children).find((e=>e.getAttribute("slot")===t))}position(){if(typeof window==="undefined"){return}const t=this.bubbleEl??(this.bubbleEl=this.el.shadowRoot?.querySelector(".bubble")??undefined);const e=this.probeEl??(this.probeEl=this.el.shadowRoot?.querySelector(".probe")??undefined);if(!t||!e||t.offsetWidth===0){return}const i=this.slotted("trigger")?.getBoundingClientRect?.();if(!i){return}const s=e.getBoundingClientRect();const n=s.width||1;const r=s.height||1;const l=t=>({top:(t.top-s.top)/r,left:(t.left-s.left)/n,width:t.width/n,height:t.height/r});const a={width:t.offsetWidth+g(t),height:t.offsetHeight};const c=window.visualViewport;const{placement:f,top:h,left:d}=b({anchor:l(i),surface:a,viewport:l(c?{top:c.offsetTop,left:c.offsetLeft,width:c.width,height:c.height}:{top:0,left:0,width:window.innerWidth,height:window.innerHeight}),preferred:this.placement,gap:u});const p=this.offset;const m=p?.top===h&&p?.left===d&&this.resolvedPlacement===f;this.resolvedPlacement=f;this.offset={top:h,left:d};if(!m){o(this)}}associate=()=>{const t=this.slotted("trigger");const e=this.slotted("content");if(!t||!e){return}if(!e.id){e.id=this.fallbackId}e.setAttribute("role","tooltip");t.setAttribute("aria-describedby",e.id)};render(){const{offset:t}=this;return i(s,{key:"c88fafd18dfa217051213dc510d7c3edd7e6fa45"},i("span",{key:"97b027bccda9cfcfed684556ed11211317ca97b3",class:"anchor"},i("span",{key:"30f76981b7d295b4459f3ca4045168e24ec1ee65",class:"probe","aria-hidden":"true",ref:t=>this.probeEl=t}),i("slot",{key:"f99a7e5b4ca3775e7af26edf9a9e9d76e7c7a292",name:"trigger",onSlotchange:this.associate}),i("span",{key:"17b396847c0be20c03fc010b57dfe3c299dbf3c1",ref:t=>this.bubbleEl=t,style:{"--ch-tooltip-offset-top":t?`${t.top}px`:null,"--ch-tooltip-offset-left":t?`${t.left}px`:null},class:{bubble:true,"bubble--positioned":Boolean(this.offset),[`bubble--${this.resolvedPlacement??this.placement}`]:true,"bubble--visible":this.visible}},i("slot",{key:"d11e591c095b29033db96242dbeafa4347ee4326",name:"content",onSlotchange:this.associate}))))}static get style(){return d()}},[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"]]]);function g(t){const e=getComputedStyle(t);return(parseFloat(e.marginLeft)||0)+(parseFloat(e.marginRight)||0)}function v(){if(typeof customElements==="undefined"){return}const t=["ch-tooltip"];t.forEach((t=>{switch(t){case"ch-tooltip":if(!customElements.get(n(t))){customElements.define(n(t),m)}break}}))}v();const w=m;const y=v;export{w as ChTooltip,y as defineCustomElement};
2
2
  //# sourceMappingURL=ch-tooltip.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["OPPOSITE","top","bottom","left","right","AXIS","overflowOf","surface","viewport","height","width","offsetFor","placement","anchor","gap","placeOverlay","preferred","candidates","best","Number","POSITIVE_INFINITY","candidate","rect","overflow","main","clamp","shifted","correction","before","after","chTooltipCss","tooltipIds","GAP","ChTooltip","__stencil_proxyCustomElement","HTMLElement","fallbackId","bubbleEl","cleanup","hovered","focused","dismissed","resolvedPlacement","offset","visible","this","componentDidLoad","associate","connectedCallback","watchViewport","disconnectedCallback","handleMouseEnter","position","handleMouseLeave","handleFocusIn","handleFocusOut","handleKeyDown","event","key","defaultPrevented","preventDefault","handleScroll","handleResize","window","visualViewport","update","addEventListener","removeEventListener","slotted","name","Array","from","el","children","find","child","getAttribute","bubble","shadowRoot","querySelector","undefined","offsetWidth","anchorRect","getBoundingClientRect","horizontalMargin","offsetHeight","offsetTop","offsetLeft","innerWidth","innerHeight","current","unchanged","forceUpdate","trigger","content","id","setAttribute","render","h","Host","class","onSlotchange","ref","style","Boolean","getComputedStyle","parseFloat","marginLeft","marginRight"],"sources":["src/utils/overlay.ts","src/components/ch-tooltip/ch-tooltip.css?tag=ch-tooltip&encapsulation=shadow","src/components/ch-tooltip/ch-tooltip.tsx"],"sourcesContent":["export type ChOverlayPlacement = 'top' | 'bottom' | 'left' | 'right';\n\nexport interface ChOverlayPosition {\n /** Placement after flipping when the preferred side does not fit. */\n placement: ChOverlayPlacement;\n /** Offset from the anchor's top-left corner, in pixels. */\n top: number;\n left: number;\n}\n\nexport interface ChOverlayRect {\n top: number;\n left: number;\n width: number;\n height: number;\n}\n\nexport interface ChOverlayViewport {\n top: number;\n left: number;\n width: number;\n height: number;\n}\n\nconst OPPOSITE: Record<ChOverlayPlacement, ChOverlayPlacement> = {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left',\n};\n\nconst AXIS: Record<ChOverlayPlacement, 'vertical' | 'horizontal'> = {\n top: 'vertical',\n bottom: 'vertical',\n left: 'horizontal',\n right: 'horizontal',\n};\n\n/**\n * How far a placed surface overflows each viewport edge. Positive values are\n * overflow. Used both to pick a placement and to shift the surface back in.\n */\nexport function overflowOf(surface: ChOverlayRect, viewport: ChOverlayViewport) {\n return {\n top: viewport.top - surface.top,\n left: viewport.left - surface.left,\n bottom: surface.top + surface.height - (viewport.top + viewport.height),\n right: surface.left + surface.width - (viewport.left + viewport.width),\n };\n}\n\nfunction offsetFor(placement: ChOverlayPlacement, anchor: ChOverlayRect, surface: { width: number; height: number }, gap: number) {\n switch (placement) {\n case 'top':\n return {\n top: anchor.top - surface.height - gap,\n left: anchor.left + (anchor.width - surface.width) / 2,\n };\n case 'bottom':\n return {\n top: anchor.top + anchor.height + gap,\n left: anchor.left + (anchor.width - surface.width) / 2,\n };\n case 'left':\n return {\n top: anchor.top + (anchor.height - surface.height) / 2,\n left: anchor.left - surface.width - gap,\n };\n case 'right':\n return {\n top: anchor.top + (anchor.height - surface.height) / 2,\n left: anchor.left + anchor.width + gap,\n };\n }\n}\n\n/**\n * Picks the placement that overflows least and then shifts the surface along\n * the cross axis so it stays inside the viewport.\n *\n * The main-axis overflow is not compensated with a translate: a tooltip pinned\n * to the top edge would cover its own trigger. Flipping to the other side is\n * what keeps it readable, and the caller decides whether to accept the\n * remaining overflow.\n */\nexport function placeOverlay({\n anchor,\n surface,\n viewport,\n preferred,\n gap,\n}: {\n anchor: ChOverlayRect;\n surface: { width: number; height: number };\n viewport: ChOverlayViewport;\n preferred: ChOverlayPlacement;\n gap: number;\n}): ChOverlayPosition {\n const candidates: ChOverlayPlacement[] = [preferred, OPPOSITE[preferred]];\n let placement = preferred;\n let best = Number.POSITIVE_INFINITY;\n\n for (const candidate of candidates) {\n const { top, left } = offsetFor(candidate, anchor, surface, gap);\n const rect = { top, left, width: surface.width, height: surface.height };\n const overflow = overflowOf(rect, viewport);\n const main = AXIS[candidate] === 'vertical' ? clamp(overflow.top) + clamp(overflow.bottom) : clamp(overflow.left) + clamp(overflow.right);\n\n if (main < best) {\n best = main;\n placement = candidate;\n }\n }\n\n const { top, left } = offsetFor(placement, anchor, surface, gap);\n const rect = { top, left, width: surface.width, height: surface.height };\n const overflow = overflowOf(rect, viewport);\n\n const shifted = AXIS[placement] === 'vertical' ? { top, left: left + correction(overflow.left, overflow.right) } : { top: top + correction(overflow.top, overflow.bottom), left };\n\n return { placement, top: shifted.top, left: shifted.left };\n}\n\n/** Only real overflow counts: the side that fits contributes nothing. */\nfunction clamp(overflow: number) {\n return overflow > 0 ? overflow : 0;\n}\n\n/**\n * Turns the two overflows on an axis into a shift. `before` is the overflow on\n * the leading edge (top or left), `after` the one on the trailing edge; both\n * are positive when the surface spills past that edge.\n *\n * Pushing away from the leading edge moves the surface inwards, so the shift is\n * `+before`. The trailing edge needs the opposite sign. When both overflow the\n * surface is larger than the viewport: pin it to the leading edge and let\n * `max-width` stop the spill.\n */\nfunction correction(before: number, after: number) {\n if (before > 0) {\n return before;\n }\n if (after > 0) {\n return -after;\n }\n return 0;\n}\n",":host {\n display: inline-block;\n}\n\n.anchor {\n position: relative;\n display: inline-flex;\n}\n\n.bubble {\n position: absolute;\n z-index: var(--z-index-dropdown);\n width: max-content;\n max-width: min(16rem, calc(100vw - 2 * var(--spacing-2xl)));\n padding: var(--spacing-md) var(--spacing-2xl);\n border: var(--border-width) solid var(--border);\n border-radius: var(--radius-sm);\n background: var(--color-background-base);\n color: var(--text);\n font-family: var(--font-body);\n font-size: var(--typography-size-sm);\n line-height: 1.4;\n opacity: 0;\n visibility: hidden;\n transition:\n opacity var(--duration-fast) var(--easing-default),\n visibility var(--duration-fast) var(--easing-default);\n}\n\n.bubble--visible {\n opacity: 1;\n visibility: visible;\n}\n\n.bubble::before {\n content: '';\n position: absolute;\n}\n\n/*\n * Once the component has measured the anchor, the bubble is placed with fixed\n * coordinates. Viewport coordinates do not depend on ancestors' transforms or\n * overflow, so a tooltip inside a scrolling drawer or modal stays anchored.\n */\n.bubble--positioned {\n position: fixed;\n top: var(--ch-tooltip-offset-top);\n left: var(--ch-tooltip-offset-left);\n transform: none;\n margin: 0;\n}\n\n.bubble--top {\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-bottom: var(--spacing-md);\n}\n\n/* Stencil scopes each rule by doubling its classes, so a three-class selector\n is what actually outranks the single-class placement rules above. */\n.bubble.bubble--positioned.bubble--top,\n.bubble.bubble--positioned.bubble--bottom,\n.bubble.bubble--positioned.bubble--left,\n.bubble.bubble--positioned.bubble--right {\n inset: auto;\n top: var(--ch-tooltip-offset-top);\n left: var(--ch-tooltip-offset-left);\n right: auto;\n bottom: auto;\n transform: none;\n margin: 0;\n}\n\n.bubble--top::before {\n top: 100%;\n left: 0;\n right: 0;\n height: var(--spacing-md);\n}\n\n.bubble--bottom {\n top: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-top: var(--spacing-md);\n}\n\n.bubble--bottom::before {\n bottom: 100%;\n left: 0;\n right: 0;\n height: var(--spacing-md);\n}\n\n.bubble--left {\n right: 100%;\n top: 50%;\n transform: translateY(-50%);\n margin-right: var(--spacing-md);\n}\n\n.bubble--left::before {\n left: 100%;\n top: 0;\n bottom: 0;\n width: var(--spacing-md);\n}\n\n.bubble--right {\n left: 100%;\n top: 50%;\n transform: translateY(-50%);\n margin-left: var(--spacing-md);\n}\n\n.bubble--right::before {\n right: 100%;\n top: 0;\n bottom: 0;\n width: var(--spacing-md);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .bubble {\n transition: none;\n }\n}\n","import { Component, Element, forceUpdate, Host, Listen, Prop, State, h } from '@stencil/core';\n\nimport { placeOverlay, type ChOverlayPlacement } from '../../utils/overlay';\n\nexport type ChTooltipPlacement = ChOverlayPlacement;\n\nlet tooltipIds = 0;\n\n/** Space between the trigger and the bubble, matching `--spacing-md`. */\nconst GAP = 8;\n\n/**\n * Short help text shown on hover and on focus.\n *\n * Both the trigger and the text come from the consumer's light DOM through\n * named slots. That is what makes the accessible association work: an\n * `aria-describedby` IDREF only resolves within a single tree, and slotted\n * nodes stay in the document tree even though they render inside the shadow\n * root. Keeping the text in the shadow root instead would need a reference\n * pointing into a shadow tree, which the platform does not allow — element\n * reflection only points outwards, and `referenceTarget` is not available yet.\n *\n * The trigger has to be a natively focusable element (`<button>`, `<a>`,\n * `<input>`). A chucao component such as `ch-button` will not be described,\n * because `aria-*` set on a custom element host does not reach the native\n * element inside it — see the discussion in issue #47.\n *\n * Positioning is measured, not purely CSS: `placement` is the preferred side,\n * and the bubble flips to the opposite side when the preferred one does not\n * fit, then shifts along the other axis to stay inside the viewport. It\n * re-measures on scroll, resize and visual-viewport changes, which is what\n * keeps it correct inside a scrolling modal or drawer and when a mobile\n * keyboard shrinks the visible area.\n */\n@Component({\n tag: 'ch-tooltip',\n styleUrl: 'ch-tooltip.css',\n shadow: true,\n})\nexport class ChTooltip {\n @Element() private el: HTMLElement;\n\n private readonly fallbackId = `ch-tooltip-${++tooltipIds}`;\n\n private bubbleEl?: HTMLElement;\n\n private cleanup?: () => void;\n\n /**\n * The side the bubble is placed on. It is a preference: when that side has no\n * room the bubble flips to the opposite one.\n */\n @Prop() placement: ChTooltipPlacement = 'top';\n\n // Hover and focus are tracked apart so that neither cancels the other: a\n // pointer passing over and away must not hide a tooltip whose trigger still\n // holds keyboard focus.\n @State() hovered = false;\n @State() focused = false;\n @State() dismissed = false;\n\n /** The placement actually used, which may differ from the prop after a flip. */\n @State() resolvedPlacement?: ChTooltipPlacement;\n\n /** Offset applied to the bubble once it has been measured. */\n private offset?: { top: number; left: number };\n\n private get visible() {\n return (this.hovered || this.focused) && !this.dismissed;\n }\n\n componentDidLoad() {\n this.associate();\n }\n\n connectedCallback() {\n this.watchViewport();\n }\n\n disconnectedCallback() {\n this.cleanup?.();\n }\n\n @Listen('mouseenter')\n handleMouseEnter() {\n this.hovered = true;\n this.dismissed = false;\n this.position();\n }\n\n @Listen('mouseleave')\n handleMouseLeave() {\n this.hovered = false;\n }\n\n @Listen('focusin')\n handleFocusIn() {\n this.focused = true;\n this.dismissed = false;\n this.position();\n }\n\n @Listen('focusout')\n handleFocusOut() {\n this.focused = false;\n }\n\n /**\n * Listens on the document because a tooltip opened by hovering leaves focus\n * wherever it was, so a host-scoped handler would never see the key.\n *\n * `preventDefault()` dismisses only the innermost surface: the platform's\n * close request for an open native `<dialog>` is the default action of this\n * same keydown, so cancelling it keeps an enclosing `ch-modal` open. Proven\n * against a real `ch-modal` in `tests/browser/ch-tooltip.browser.spec.ts`.\n */\n @Listen('keydown', { target: 'document' })\n handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Escape' && this.visible && !event.defaultPrevented) {\n event.preventDefault();\n this.dismissed = true;\n }\n }\n\n /** Cheap guard so scroll frames do not measure while nothing is shown. */\n @Listen('scroll', { target: 'window', capture: true, passive: true })\n handleScroll() {\n if (this.visible && this.offset) {\n this.position();\n }\n }\n\n @Listen('resize', { target: 'window', passive: true })\n handleResize() {\n this.position();\n }\n\n private watchViewport() {\n if (typeof window === 'undefined') {\n return;\n }\n const viewport = window.visualViewport;\n if (!viewport || this.cleanup) {\n return;\n }\n const update = () => this.position();\n viewport.addEventListener('resize', update);\n viewport.addEventListener('scroll', update);\n this.cleanup = () => {\n viewport.removeEventListener('resize', update);\n viewport.removeEventListener('scroll', update);\n };\n }\n\n private slotted(name: string) {\n return Array.from(this.el.children).find(child => child.getAttribute('slot') === name);\n }\n\n /**\n * Measures the anchor and the bubble and stores the offset that keeps the\n * bubble inside the viewport. Nothing is measured before the bubble has a\n * box to measure, so the pre-paint render uses plain CSS.\n */\n private position() {\n if (typeof window === 'undefined') {\n return;\n }\n const bubble = this.bubbleEl ?? (this.bubbleEl = this.el.shadowRoot?.querySelector<HTMLElement>('.bubble') ?? undefined);\n if (!bubble || bubble.offsetWidth === 0) {\n return;\n }\n\n const anchorRect = (this.slotted('trigger') as HTMLElement | undefined)?.getBoundingClientRect?.();\n if (!anchorRect) {\n return;\n }\n\n const surface = {\n width: bubble.offsetWidth + horizontalMargin(bubble),\n height: bubble.offsetHeight,\n };\n const viewport = window.visualViewport;\n\n const { placement, top, left } = placeOverlay({\n anchor: { top: anchorRect.top, left: anchorRect.left, width: anchorRect.width, height: anchorRect.height },\n surface,\n viewport: viewport\n ? { top: viewport.offsetTop, left: viewport.offsetLeft, width: viewport.width, height: viewport.height }\n : { top: 0, left: 0, width: window.innerWidth, height: window.innerHeight },\n preferred: this.placement,\n gap: GAP,\n });\n\n const current = this.offset;\n const unchanged = current?.top === top && current?.left === left && this.resolvedPlacement === placement;\n this.resolvedPlacement = placement;\n this.offset = { top, left };\n if (!unchanged) {\n forceUpdate(this);\n }\n }\n\n /**\n * Points the trigger at the text with `aria-describedby`. Re-run on\n * `slotchange` because a framework re-render can replace the slotted nodes\n * and take the attributes with them.\n */\n private associate = () => {\n const trigger = this.slotted('trigger');\n const content = this.slotted('content');\n if (!trigger || !content) {\n return;\n }\n if (!content.id) {\n content.id = this.fallbackId;\n }\n content.setAttribute('role', 'tooltip');\n trigger.setAttribute('aria-describedby', content.id);\n };\n\n render() {\n const { offset } = this;\n\n return (\n <Host>\n <span class=\"anchor\">\n {/* Pre-measure render uses the preferred side so the bubble never\n jumps from the wrong edge on its first frame. */}\n <slot name=\"trigger\" onSlotchange={this.associate}></slot>\n <span\n ref={el => (this.bubbleEl = el)}\n style={{\n '--ch-tooltip-offset-top': offset ? `${offset.top}px` : null,\n '--ch-tooltip-offset-left': offset ? `${offset.left}px` : null,\n }}\n class={{\n 'bubble': true,\n 'bubble--positioned': Boolean(this.offset),\n [`bubble--${this.resolvedPlacement ?? this.placement}`]: true,\n 'bubble--visible': this.visible,\n }}\n >\n <slot name=\"content\" onSlotchange={this.associate}></slot>\n </span>\n </span>\n </Host>\n );\n }\n}\n\nfunction horizontalMargin(el: HTMLElement) {\n const style = getComputedStyle(el);\n return (parseFloat(style.marginLeft) || 0) + (parseFloat(style.marginRight) || 0);\n}\n"],"mappings":"uEAwBA,MAAMA,EAA2D,CAC/DC,IAAK,SACLC,OAAQ,MACRC,KAAM,QACNC,MAAO,QAGT,MAAMC,EAA8D,CAClEJ,IAAK,WACLC,OAAQ,WACRC,KAAM,aACNC,MAAO,cAOH,SAAUE,EAAWC,EAAwBC,GACjD,MAAO,CACLP,IAAKO,EAASP,IAAMM,EAAQN,IAC5BE,KAAMK,EAASL,KAAOI,EAAQJ,KAC9BD,OAAQK,EAAQN,IAAMM,EAAQE,QAAUD,EAASP,IAAMO,EAASC,QAChEL,MAAOG,EAAQJ,KAAOI,EAAQG,OAASF,EAASL,KAAOK,EAASE,OAEpE,CAEA,SAASC,EAAUC,EAA+BC,EAAuBN,EAA4CO,GACnH,OAAQF,GACN,IAAK,MACH,MAAO,CACLX,IAAKY,EAAOZ,IAAMM,EAAQE,OAASK,EACnCX,KAAMU,EAAOV,MAAQU,EAAOH,MAAQH,EAAQG,OAAS,GAEzD,IAAK,SACH,MAAO,CACLT,IAAKY,EAAOZ,IAAMY,EAAOJ,OAASK,EAClCX,KAAMU,EAAOV,MAAQU,EAAOH,MAAQH,EAAQG,OAAS,GAEzD,IAAK,OACH,MAAO,CACLT,IAAKY,EAAOZ,KAAOY,EAAOJ,OAASF,EAAQE,QAAU,EACrDN,KAAMU,EAAOV,KAAOI,EAAQG,MAAQI,GAExC,IAAK,QACH,MAAO,CACLb,IAAKY,EAAOZ,KAAOY,EAAOJ,OAASF,EAAQE,QAAU,EACrDN,KAAMU,EAAOV,KAAOU,EA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,mBAAoBF,EAAQC,GAAG,EAGtD,MAAAE,GACE,MAAMtD,OAAEA,GAAWE,KAEnB,OACEqD,EAACC,EAAI,CAAAzC,IAAA,4CACHwC,EAAA,QAAAxC,IAAA,2CAAM0C,MAAM,UAGVF,EAAA,QAAAxC,IAAA,2CAAMW,KAAK,UAAUgC,aAAcxD,KAAKE,YACxCmD,EAAA,QAAAxC,IAAA,2CACE4C,IAAK9B,GAAO3B,KAAKR,SAAWmC,EAC5B+B,MAAO,CACL,0BAA2B5D,EAAS,GAAGA,EAAO1C,QAAU,KACxD,2BAA4B0C,EAAS,GAAGA,EAAOxC,SAAW,MAE5DiG,MAAO,CACLvB,OAAU,KACV,qBAAsB2B,QAAQ3D,KAAKF,QACnC,CAAC,WAAWE,KAAKH,mBAAqBG,KAAKjC,aAAc,KACzD,kBAAmBiC,KAAKD,UAG1BsD,EAAA,QAAAxC,IAAA,2CAAMW,KAAK,UAAUgC,aAAcxD,KAAKE,c,oWAQpD,SAASqC,EAAiBZ,GACxB,MAAM+B,EAAQE,iBAAiBjC,GAC/B,OAAQkC,WAAWH,EAAMI,aAAe,IAAMD,WAAWH,EAAMK,cAAgB,EACjF,C","ignoreList":[]}
1
+ {"version":3,"names":["OPPOSITE","top","bottom","left","right","AXIS","overflowOf","surface","viewport","height","width","offsetFor","placement","anchor","gap","placeOverlay","preferred","candidates","best","Number","POSITIVE_INFINITY","candidate","rect","overflow","main","clamp","shifted","correction","before","after","chTooltipCss","tooltipIds","GAP","ChTooltip","__stencil_proxyCustomElement","HTMLElement","fallbackId","bubbleEl","probeEl","cleanup","hovered","focused","dismissed","resolvedPlacement","offset","visible","this","componentDidLoad","associate","connectedCallback","watchViewport","disconnectedCallback","handleMouseEnter","position","handleMouseLeave","handleFocusIn","handleFocusOut","handleKeyDown","event","key","defaultPrevented","preventDefault","handleScroll","handleResize","window","visualViewport","update","addEventListener","removeEventListener","slotted","name","Array","from","el","children","find","child","getAttribute","bubble","shadowRoot","querySelector","undefined","probe","offsetWidth","anchorRect","getBoundingClientRect","probeRect","scaleX","scaleY","inContainingBlock","horizontalMargin","offsetHeight","offsetTop","offsetLeft","innerWidth","innerHeight","current","unchanged","forceUpdate","trigger","content","id","setAttribute","render","h","Host","class","ref","onSlotchange","style","Boolean","getComputedStyle","parseFloat","marginLeft","marginRight"],"sources":["src/utils/overlay.ts","src/components/ch-tooltip/ch-tooltip.css?tag=ch-tooltip&encapsulation=shadow","src/components/ch-tooltip/ch-tooltip.tsx"],"sourcesContent":["export type ChOverlayPlacement = 'top' | 'bottom' | 'left' | 'right';\n\nexport interface ChOverlayPosition {\n /** Placement after flipping when the preferred side does not fit. */\n placement: ChOverlayPlacement;\n /** Position in the same coordinate space as `anchor` and `viewport`, in pixels. */\n top: number;\n left: number;\n}\n\nexport interface ChOverlayRect {\n top: number;\n left: number;\n width: number;\n height: number;\n}\n\nexport interface ChOverlayViewport {\n top: number;\n left: number;\n width: number;\n height: number;\n}\n\nconst OPPOSITE: Record<ChOverlayPlacement, ChOverlayPlacement> = {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left',\n};\n\nconst AXIS: Record<ChOverlayPlacement, 'vertical' | 'horizontal'> = {\n top: 'vertical',\n bottom: 'vertical',\n left: 'horizontal',\n right: 'horizontal',\n};\n\n/**\n * How far a placed surface overflows each viewport edge. Positive values are\n * overflow. Used both to pick a placement and to shift the surface back in.\n */\nexport function overflowOf(surface: ChOverlayRect, viewport: ChOverlayViewport) {\n return {\n top: viewport.top - surface.top,\n left: viewport.left - surface.left,\n bottom: surface.top + surface.height - (viewport.top + viewport.height),\n right: surface.left + surface.width - (viewport.left + viewport.width),\n };\n}\n\nfunction offsetFor(placement: ChOverlayPlacement, anchor: ChOverlayRect, surface: { width: number; height: number }, gap: number) {\n switch (placement) {\n case 'top':\n return {\n top: anchor.top - surface.height - gap,\n left: anchor.left + (anchor.width - surface.width) / 2,\n };\n case 'bottom':\n return {\n top: anchor.top + anchor.height + gap,\n left: anchor.left + (anchor.width - surface.width) / 2,\n };\n case 'left':\n return {\n top: anchor.top + (anchor.height - surface.height) / 2,\n left: anchor.left - surface.width - gap,\n };\n case 'right':\n return {\n top: anchor.top + (anchor.height - surface.height) / 2,\n left: anchor.left + anchor.width + gap,\n };\n }\n}\n\n/**\n * Picks the placement that overflows least and then shifts the surface along\n * the cross axis so it stays inside the viewport.\n *\n * The main-axis overflow is not compensated with a translate: a tooltip pinned\n * to the top edge would cover its own trigger. Flipping to the other side is\n * what keeps it readable, and the caller decides whether to accept the\n * remaining overflow.\n */\nexport function placeOverlay({\n anchor,\n surface,\n viewport,\n preferred,\n gap,\n}: {\n anchor: ChOverlayRect;\n surface: { width: number; height: number };\n viewport: ChOverlayViewport;\n preferred: ChOverlayPlacement;\n gap: number;\n}): ChOverlayPosition {\n const candidates: ChOverlayPlacement[] = [preferred, OPPOSITE[preferred]];\n let placement = preferred;\n let best = Number.POSITIVE_INFINITY;\n\n for (const candidate of candidates) {\n const { top, left } = offsetFor(candidate, anchor, surface, gap);\n const rect = { top, left, width: surface.width, height: surface.height };\n const overflow = overflowOf(rect, viewport);\n const main = AXIS[candidate] === 'vertical' ? clamp(overflow.top) + clamp(overflow.bottom) : clamp(overflow.left) + clamp(overflow.right);\n\n if (main < best) {\n best = main;\n placement = candidate;\n }\n }\n\n const { top, left } = offsetFor(placement, anchor, surface, gap);\n const rect = { top, left, width: surface.width, height: surface.height };\n const overflow = overflowOf(rect, viewport);\n\n const shifted = AXIS[placement] === 'vertical' ? { top, left: left + correction(overflow.left, overflow.right) } : { top: top + correction(overflow.top, overflow.bottom), left };\n\n return { placement, top: shifted.top, left: shifted.left };\n}\n\n/** Only real overflow counts: the side that fits contributes nothing. */\nfunction clamp(overflow: number) {\n return overflow > 0 ? overflow : 0;\n}\n\n/**\n * Turns the two overflows on an axis into a shift. `before` is the overflow on\n * the leading edge (top or left), `after` the one on the trailing edge; both\n * are positive when the surface spills past that edge.\n *\n * Pushing away from the leading edge moves the surface inwards, so the shift is\n * `+before`. The trailing edge needs the opposite sign. When both overflow the\n * surface is larger than the viewport: pin it to the leading edge and let\n * `max-width` stop the spill.\n */\nfunction correction(before: number, after: number) {\n if (before > 0) {\n return before;\n }\n if (after > 0) {\n return -after;\n }\n return 0;\n}\n",":host {\n display: inline-block;\n}\n\n.anchor {\n position: relative;\n display: inline-flex;\n}\n\n/* Fixed at the origin of the same containing block the bubble uses. */\n.probe {\n position: fixed;\n top: 0;\n left: 0;\n width: 1px;\n height: 1px;\n visibility: hidden;\n pointer-events: none;\n}\n\n.bubble {\n position: absolute;\n z-index: var(--z-index-dropdown);\n width: max-content;\n max-width: min(16rem, calc(100vw - 2 * var(--spacing-2xl)));\n padding: var(--spacing-md) var(--spacing-2xl);\n border: var(--border-width) solid var(--border);\n border-radius: var(--radius-sm);\n background: var(--color-background-base);\n color: var(--text);\n font-family: var(--font-body);\n font-size: var(--typography-size-sm);\n line-height: 1.4;\n opacity: 0;\n visibility: hidden;\n transition:\n opacity var(--duration-fast) var(--easing-default),\n visibility var(--duration-fast) var(--easing-default);\n}\n\n.bubble--visible {\n opacity: 1;\n visibility: visible;\n}\n\n.bubble::before {\n content: '';\n position: absolute;\n}\n\n/*\n * Once the component has measured the anchor, the bubble is placed with fixed\n * coordinates. Viewport coordinates do not depend on ancestors' transforms or\n * overflow, so a tooltip inside a scrolling drawer or modal stays anchored.\n */\n.bubble--positioned {\n position: fixed;\n top: var(--ch-tooltip-offset-top);\n left: var(--ch-tooltip-offset-left);\n transform: none;\n margin: 0;\n}\n\n.bubble--top {\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-bottom: var(--spacing-md);\n}\n\n/* Stencil scopes each rule by doubling its classes, so a three-class selector\n is what actually outranks the single-class placement rules above. */\n.bubble.bubble--positioned.bubble--top,\n.bubble.bubble--positioned.bubble--bottom,\n.bubble.bubble--positioned.bubble--left,\n.bubble.bubble--positioned.bubble--right {\n inset: auto;\n top: var(--ch-tooltip-offset-top);\n left: var(--ch-tooltip-offset-left);\n right: auto;\n bottom: auto;\n transform: none;\n margin: 0;\n}\n\n.bubble--top::before {\n top: 100%;\n left: 0;\n right: 0;\n height: var(--spacing-md);\n}\n\n.bubble--bottom {\n top: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-top: var(--spacing-md);\n}\n\n.bubble--bottom::before {\n bottom: 100%;\n left: 0;\n right: 0;\n height: var(--spacing-md);\n}\n\n.bubble--left {\n right: 100%;\n top: 50%;\n transform: translateY(-50%);\n margin-right: var(--spacing-md);\n}\n\n.bubble--left::before {\n left: 100%;\n top: 0;\n bottom: 0;\n width: var(--spacing-md);\n}\n\n.bubble--right {\n left: 100%;\n top: 50%;\n transform: translateY(-50%);\n margin-left: var(--spacing-md);\n}\n\n.bubble--right::before {\n right: 100%;\n top: 0;\n bottom: 0;\n width: var(--spacing-md);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .bubble {\n transition: none;\n }\n}\n","import { Component, Element, forceUpdate, Host, Listen, Prop, State, h } from '@stencil/core';\n\nimport { placeOverlay, type ChOverlayPlacement } from '../../utils/overlay';\n\nexport type ChTooltipPlacement = ChOverlayPlacement;\n\nlet tooltipIds = 0;\n\n/** Space between the trigger and the bubble, matching `--spacing-md`. */\nconst GAP = 8;\n\n/**\n * Short help text shown on hover and on focus.\n *\n * Both the trigger and the text come from the consumer's light DOM through\n * named slots. That is what makes the accessible association work: an\n * `aria-describedby` IDREF only resolves within a single tree, and slotted\n * nodes stay in the document tree even though they render inside the shadow\n * root. Keeping the text in the shadow root instead would need a reference\n * pointing into a shadow tree, which the platform does not allow — element\n * reflection only points outwards, and `referenceTarget` is not available yet.\n *\n * The trigger has to be a natively focusable element (`<button>`, `<a>`,\n * `<input>`). A chucao component such as `ch-button` will not be described,\n * because `aria-*` set on a custom element host does not reach the native\n * element inside it — see the discussion in issue #47.\n *\n * Positioning is measured, not purely CSS: `placement` is the preferred side,\n * and the bubble flips to the opposite side when the preferred one does not\n * fit, then shifts along the other axis to stay inside the viewport. It\n * re-measures on scroll, resize and visual-viewport changes, which is what\n * keeps it correct inside a scrolling modal or drawer and when a mobile\n * keyboard shrinks the visible area.\n */\n@Component({\n tag: 'ch-tooltip',\n styleUrl: 'ch-tooltip.css',\n shadow: true,\n})\nexport class ChTooltip {\n @Element() private el: HTMLElement;\n\n private readonly fallbackId = `ch-tooltip-${++tooltipIds}`;\n\n private bubbleEl?: HTMLElement;\n\n private probeEl?: HTMLElement;\n\n private cleanup?: () => void;\n\n /**\n * The side the bubble is placed on. It is a preference: when that side has no\n * room the bubble flips to the opposite one.\n */\n @Prop() placement: ChTooltipPlacement = 'top';\n\n // Hover and focus are tracked apart so that neither cancels the other: a\n // pointer passing over and away must not hide a tooltip whose trigger still\n // holds keyboard focus.\n @State() hovered = false;\n @State() focused = false;\n @State() dismissed = false;\n\n /** The placement actually used, which may differ from the prop after a flip. */\n @State() resolvedPlacement?: ChTooltipPlacement;\n\n /** Offset applied to the bubble once it has been measured. */\n private offset?: { top: number; left: number };\n\n private get visible() {\n return (this.hovered || this.focused) && !this.dismissed;\n }\n\n componentDidLoad() {\n this.associate();\n }\n\n connectedCallback() {\n this.watchViewport();\n }\n\n disconnectedCallback() {\n this.cleanup?.();\n }\n\n @Listen('mouseenter')\n handleMouseEnter() {\n this.hovered = true;\n this.dismissed = false;\n this.position();\n }\n\n @Listen('mouseleave')\n handleMouseLeave() {\n this.hovered = false;\n }\n\n @Listen('focusin')\n handleFocusIn() {\n this.focused = true;\n this.dismissed = false;\n this.position();\n }\n\n @Listen('focusout')\n handleFocusOut() {\n this.focused = false;\n }\n\n /**\n * Listens on the document because a tooltip opened by hovering leaves focus\n * wherever it was, so a host-scoped handler would never see the key.\n *\n * `preventDefault()` dismisses only the innermost surface: the platform's\n * close request for an open native `<dialog>` is the default action of this\n * same keydown, so cancelling it keeps an enclosing `ch-modal` open. Proven\n * against a real `ch-modal` in `tests/browser/ch-tooltip.browser.spec.ts`.\n */\n @Listen('keydown', { target: 'document' })\n handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Escape' && this.visible && !event.defaultPrevented) {\n event.preventDefault();\n this.dismissed = true;\n }\n }\n\n /** Cheap guard so scroll frames do not measure while nothing is shown. */\n @Listen('scroll', { target: 'window', capture: true, passive: true })\n handleScroll() {\n if (this.visible && this.offset) {\n this.position();\n }\n }\n\n @Listen('resize', { target: 'window', passive: true })\n handleResize() {\n this.position();\n }\n\n private watchViewport() {\n if (typeof window === 'undefined') {\n return;\n }\n const viewport = window.visualViewport;\n if (!viewport || this.cleanup) {\n return;\n }\n const update = () => this.position();\n viewport.addEventListener('resize', update);\n viewport.addEventListener('scroll', update);\n this.cleanup = () => {\n viewport.removeEventListener('resize', update);\n viewport.removeEventListener('scroll', update);\n };\n }\n\n private slotted(name: string) {\n return Array.from(this.el.children).find(child => child.getAttribute('slot') === name);\n }\n\n /**\n * Measures the anchor and the bubble and stores the offset that keeps the\n * bubble inside the viewport. Nothing is measured before the bubble has a\n * box to measure, so the pre-paint render uses plain CSS.\n *\n * A fixed bubble is positioned against the nearest ancestor that establishes\n * a containing block (a `transform`, `filter`, `backdrop-filter`, `contain`\n * or `will-change`), not necessarily the viewport. The probe is fixed at the\n * containing block's origin, so both the anchor and the viewport are\n * converted into that same space before `placeOverlay` does its maths.\n */\n private position() {\n if (typeof window === 'undefined') {\n return;\n }\n const bubble = this.bubbleEl ?? (this.bubbleEl = this.el.shadowRoot?.querySelector<HTMLElement>('.bubble') ?? undefined);\n const probe = this.probeEl ?? (this.probeEl = this.el.shadowRoot?.querySelector<HTMLElement>('.probe') ?? undefined);\n if (!bubble || !probe || bubble.offsetWidth === 0) {\n return;\n }\n\n const anchorRect = (this.slotted('trigger') as HTMLElement | undefined)?.getBoundingClientRect?.();\n if (!anchorRect) {\n return;\n }\n\n const probeRect = probe.getBoundingClientRect();\n const scaleX = probeRect.width || 1;\n const scaleY = probeRect.height || 1;\n const inContainingBlock = (rect: { top: number; left: number; width: number; height: number }) => ({\n top: (rect.top - probeRect.top) / scaleY,\n left: (rect.left - probeRect.left) / scaleX,\n width: rect.width / scaleX,\n height: rect.height / scaleY,\n });\n\n const surface = {\n width: bubble.offsetWidth + horizontalMargin(bubble),\n height: bubble.offsetHeight,\n };\n const viewport = window.visualViewport;\n\n const { placement, top, left } = placeOverlay({\n anchor: inContainingBlock(anchorRect),\n surface,\n viewport: inContainingBlock(\n viewport\n ? { top: viewport.offsetTop, left: viewport.offsetLeft, width: viewport.width, height: viewport.height }\n : { top: 0, left: 0, width: window.innerWidth, height: window.innerHeight },\n ),\n preferred: this.placement,\n gap: GAP,\n });\n\n const current = this.offset;\n const unchanged = current?.top === top && current?.left === left && this.resolvedPlacement === placement;\n this.resolvedPlacement = placement;\n this.offset = { top, left };\n if (!unchanged) {\n forceUpdate(this);\n }\n }\n\n /**\n * Points the trigger at the text with `aria-describedby`. Re-run on\n * `slotchange` because a framework re-render can replace the slotted nodes\n * and take the attributes with them.\n */\n private associate = () => {\n const trigger = this.slotted('trigger');\n const content = this.slotted('content');\n if (!trigger || !content) {\n return;\n }\n if (!content.id) {\n content.id = this.fallbackId;\n }\n content.setAttribute('role', 'tooltip');\n trigger.setAttribute('aria-describedby', content.id);\n };\n\n render() {\n const { offset } = this;\n\n return (\n <Host>\n <span class=\"anchor\">\n <span class=\"probe\" aria-hidden=\"true\" ref={el => (this.probeEl = el)}></span>\n {/* Pre-measure render uses the preferred side so the bubble never\n jumps from the wrong edge on its first frame. */}\n <slot name=\"trigger\" onSlotchange={this.associate}></slot>\n <span\n ref={el => (this.bubbleEl = el)}\n style={{\n '--ch-tooltip-offset-top': offset ? `${offset.top}px` : null,\n '--ch-tooltip-offset-left': offset ? `${offset.left}px` : null,\n }}\n class={{\n 'bubble': true,\n 'bubble--positioned': Boolean(this.offset),\n [`bubble--${this.resolvedPlacement ?? this.placement}`]: true,\n 'bubble--visible': this.visible,\n }}\n >\n <slot name=\"content\" onSlotchange={this.associate}></slot>\n </span>\n </span>\n </Host>\n );\n }\n}\n\nfunction horizontalMargin(el: HTMLElement) {\n const style = getComputedStyle(el);\n return (parseFloat(style.marginLeft) || 0) + (parseFloat(style.marginRight) || 0);\n}\n"],"mappings":"uEAwBA,MAAMA,EAA2D,CAC/DC,IAAK,SACLC,OAAQ,MACRC,KAAM,QACNC,MAAO,QAGT,MAAMC,EAA8D,CAClEJ,IAAK,WACLC,OAAQ,WACRC,KAAM,aACNC,MAAO,cAOH,SAAUE,EAAWC,EAAwBC,GACjD,MAAO,CACLP,IAAKO,EAASP,IAAMM,EAAQN,IAC5BE,KAAMK,EAASL,KAAOI,EAAQJ,KAC9BD,OAAQK,EAAQN,IAAMM,EAAQE,QAAUD,EAASP,IAAMO,EAASC,QAChEL,MAAOG,EAAQJ,KAAOI,EAAQG,OAASF,EAASL,KAAOK,EAASE,OAEpE,CAEA,SAASC,EAAUC,EAA+BC,EAAuBN,EAA4CO,GACnH,OAAQF,GACN,IAAK,MACH,MAAO,CACLX,IAAKY,EAAOZ,IAAMM,EAAQE,OAASK,EACnCX,KAAMU,EAAOV,MAAQU,EAAOH,MAAQH,EAAQG,OAAS,GAEzD,IAAK,SACH,MAAO,CACLT,IAAKY,EAAOZ,IAAMY,EAAOJ,OAASK,EAClCX,KAAMU,EAAOV,MAAQU,EAAOH,MAAQH,EAAQG,OAAS,GAEzD,IAAK,OACH,MAAO,CACLT,IAAKY,EAAOZ,KAAOY,EAAOJ,OAASF,EAAQE,QAAU,EACrDN,KAAMU,EAAOV,KAAOI,EAAQG,MAAQI,GAExC,IAAK,QACH,MAAO,CACLb,IAAKY,EAAOZ,KAAOY,EAAOJ,OAASF,EAAQE,QAAU,EACrDN,KAAMU,EAAOV,KAAOU,EAAOH,MAAQI,GAG3C,CAWM,SAAUC,GAAaF,OAC3BA,EAAMN,QACNA,EAAOC,SACPA,EAAQQ,UACRA,EAASF,IACTA,IAQA,MAAMG,EAAmC,CAACD,EAAWhB,EAASgB,IAC9D,IAAIJ,EAAYI,EAChB,IAAIE,EAAOC,OAAOC,kBAElB,IAAK,MAAMC,KAAaJ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AAKA,EAAQC,GAAI,CACfD,EAAQC,GAAKvD,KAAKV,U,CAEpBgE,EAAQE,aAAa,OAAQ,WAC7BH,EAAQG,aAAa,mBAAoBF,EAAQC,GAAG,EAGtD,MAAAE,GACE,MAAM3D,OAAEA,GAAWE,KAEnB,OACE0D,EAACC,EAAI,CAAA9C,IAAA,4CACH6C,EAAA,QAAA7C,IAAA,2CAAM+C,MAAM,UACVF,EAAA,QAAA7C,IAAA,2CAAM+C,MAAM,QAAO,cAAa,OAAOC,IAAKlC,GAAO3B,KAAKR,QAAUmC,IAGlE+B,EAAA,QAAA7C,IAAA,2CAAMW,KAAK,UAAUsC,aAAc9D,KAAKE,YACxCwD,EAAA,QAAA7C,IAAA,2CACEgD,IAAKlC,GAAO3B,KAAKT,SAAWoC,EAC5BoC,MAAO,CACL,0BAA2BjE,EAAS,GAAGA,EAAO3C,QAAU,KACxD,2BAA4B2C,EAAS,GAAGA,EAAOzC,SAAW,MAE5DuG,MAAO,CACL5B,OAAU,KACV,qBAAsBgC,QAAQhE,KAAKF,QACnC,CAAC,WAAWE,KAAKH,mBAAqBG,KAAKlC,aAAc,KACzD,kBAAmBkC,KAAKD,UAG1B2D,EAAA,QAAA7C,IAAA,2CAAMW,KAAK,UAAUsC,aAAc9D,KAAKE,c,oWAQpD,SAAS0C,EAAiBjB,GACxB,MAAMoC,EAAQE,iBAAiBtC,GAC/B,OAAQuC,WAAWH,EAAMI,aAAe,IAAMD,WAAWH,EAAMK,cAAgB,EACjF,C","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{p as e,H as n,h as r,d as s,t as i}from"./p-qP_9qshx.js";const t=()=>`:host{display:inline-block;vertical-align:middle}.spinner{display:block;box-sizing:border-box;width:1em;height:1em;border:0.125em solid currentColor;border-top-color:transparent;border-radius:50%;animation:ch-spinner-rotate var(--duration-spin) var(--easing-linear) infinite}.spinner--sm{font-size:var(--typography-size-sm)}.spinner--md{font-size:var(--typography-size-lg)}.spinner--lg{font-size:var(--typography-size-xl)}@keyframes ch-spinner-rotate{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.spinner{animation-duration:calc(var(--duration-spin) * 4)}}`;const a=e(class e extends n{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow()}size="md";label;render(){const e=Boolean(this.label);return r(s,{key:"6d26b2ead7b674058b3d5c56caf9329cf9377ae6"},r("span",{key:"a3fa9b56474271154527b9e0f9def3136b158ea4",class:{spinner:true,[`spinner--${this.size}`]:true},role:e?"status":undefined,"aria-label":e?this.label:undefined,"aria-hidden":e?undefined:"true"}))}static get style(){return t()}},[513,"ch-spinner",{size:[1],label:[1]}]);function o(){if(typeof customElements==="undefined"){return}const e=["ch-spinner"];e.forEach((e=>{switch(e){case"ch-spinner":if(!customElements.get(i(e))){customElements.define(i(e),a)}break}}))}o();export{a as C,o as d};
2
- //# sourceMappingURL=p-Cw0b4OGc.js.map
1
+ import{p as e,H as n,h as r,d as s,t as i}from"./p-qP_9qshx.js";const t=()=>`:host{display:inline-block;vertical-align:middle}.spinner{display:block;box-sizing:border-box;width:1em;height:1em;border:0.125em solid currentColor;border-top-color:transparent;border-radius:50%;animation:ch-spinner-rotate var(--duration-spin) var(--easing-linear) infinite}.spinner--sm{font-size:var(--typography-size-sm)}.spinner--md{font-size:var(--typography-size-lg)}.spinner--lg{font-size:var(--typography-size-xl)}@keyframes ch-spinner-rotate{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.spinner{animation-duration:calc(var(--duration-spin) * 4)}}`;const a=e(class e extends n{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow()}size="md";label;render(){const e=Boolean(this.label);return r(s,{key:"1d8ef18f03d7a52d61854cc84fb39994ee8ce0a9"},r("span",{key:"28ec4657d1a0de9181f9d31742fc6bd26b284b14",class:{spinner:true,[`spinner--${this.size}`]:true},role:e?"status":undefined,"aria-label":e?this.label:undefined,"aria-hidden":e?undefined:"true"}))}static get style(){return t()}},[513,"ch-spinner",{size:[1],label:[1]}]);function o(){if(typeof customElements==="undefined"){return}const e=["ch-spinner"];e.forEach((e=>{switch(e){case"ch-spinner":if(!customElements.get(i(e))){customElements.define(i(e),a)}break}}))}o();export{a as C,o as d};
2
+ //# sourceMappingURL=p-DiUN1WGc.js.map
@@ -32,7 +32,7 @@ const ChAccordion = class {
32
32
  this.chChange.emit(this.value);
33
33
  };
34
34
  render() {
35
- return (h(Host, { key: '83cb1bb02baec54767edde0241c9f784b35cf336' }, this.items.map(item => {
35
+ return (h(Host, { key: 'f147314134464f7455ac179fad62c1b9318efc92' }, this.items.map(item => {
36
36
  const open = this.value === item.value;
37
37
  return (h("div", { key: item.value, class: { 'item': true, 'item--open': open } }, h("h3", { class: "item-head" }, h("button", { type: "button", class: "item-toggle", id: this.headerId(item.value), "data-value": item.value, "aria-expanded": open ? 'true' : 'false', "aria-controls": this.panelId(item.value), disabled: item.disabled, onClick: () => this.toggle(item.value) }, item.title)), h("div", { class: "item-panel", id: this.panelId(item.value), role: "region", "aria-labelledby": this.headerId(item.value), hidden: !open }, h("slot", { name: `panel-${item.value}` }))));
38
38
  })));