@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,143 @@
1
+ import { r as registerInstance, c as createEvent, a as getElement, h, H as Host } from './index-CIV5Gg1o.js';
2
+
3
+ const chTableCss = () => `: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)}`;
4
+
5
+ let tableIds = 0;
6
+ const ChTable = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ this.chSort = createEvent(this, "chSort");
10
+ }
11
+ captionId = `ch-table-${++tableIds}-caption`;
12
+ emptyId = `${this.captionId}-empty`;
13
+ get host() { return getElement(this); }
14
+ /** Columns, in display order. Rendered as the header row. */
15
+ columns = [];
16
+ /** Whether the header offers sorting. Individual columns can opt out. */
17
+ sortable = false;
18
+ /** Key of the column currently used for sorting. Controlled by the consumer. */
19
+ sortKey;
20
+ /** Direction of the current sort. Defaults to `ascending`. */
21
+ sortDirection = 'ascending';
22
+ /**
23
+ * Accessible name for the table. Always rendered as a caption, visually
24
+ * hidden, because a data table without a name is announced as a bare grid.
25
+ */
26
+ label;
27
+ /**
28
+ * Shown in place of the rows when the body is empty. `filtered` distinguishes
29
+ * "nothing matched your filters" from "there is nothing yet", which are
30
+ * different messages and different next actions.
31
+ */
32
+ empty = 'unmeasured';
33
+ /**
34
+ * Marks the body as empty *because of filtering* rather than because there is
35
+ * no data at all. Both look like zero rows, and they need different messages
36
+ * and different next actions.
37
+ */
38
+ filtered = false;
39
+ /** Emitted when a sortable header is activated. The consumer applies the sort. */
40
+ chSort;
41
+ onFiltered() {
42
+ this.measure();
43
+ }
44
+ rerenderHeaders() {
45
+ // Header attributes are derived from controlled props, so a prop change
46
+ // has to repaint them; `columns` and the slot repaint on their own.
47
+ this.rerender = !this.rerender;
48
+ }
49
+ rerender = false;
50
+ observer;
51
+ componentDidLoad() {
52
+ this.measure();
53
+ // `slotchange` does not fire for native `<tr>` children, and it only fires
54
+ // at all once the element is upgraded, so a row added later would leave the
55
+ // table stuck on its first measurement. Observing the host covers both
56
+ // orders plus a consumer that swaps rows on refresh. `MutationObserver` is
57
+ // absent in the mock-doc test environment, where the slot behaviour is
58
+ // exercised through an explicit `slotchange` instead.
59
+ if (typeof MutationObserver === 'function') {
60
+ this.observer = new MutationObserver(this.measure);
61
+ this.observer.observe(this.host, { childList: true });
62
+ }
63
+ }
64
+ disconnectedCallback() {
65
+ this.observer?.disconnect();
66
+ this.observer = undefined;
67
+ }
68
+ measure = () => {
69
+ const rows = Array.from(this.host.children).filter(child => child.tagName === 'TR');
70
+ this.empty = rows.length === 0 ? 'true' : 'none';
71
+ };
72
+ /**
73
+ * A filtered-empty body and a truly empty one both have zero rows; only the
74
+ * consumer knows which, since `filtered` is a prop it controls.
75
+ */
76
+ get emptyState() {
77
+ if (this.filtered) {
78
+ return 'filtered';
79
+ }
80
+ return this.empty;
81
+ }
82
+ /** Direction glyph. Not colour: the arrow is the cue in greyscale. */
83
+ sortCue(active) {
84
+ if (!active) {
85
+ return '⇅';
86
+ }
87
+ return this.sortDirection === 'ascending' ? '▲' : '▼';
88
+ }
89
+ emptyMessage(state) {
90
+ return state === 'filtered' ? 'No results for these filters.' : 'Nothing here yet.';
91
+ }
92
+ nextDirection(key) {
93
+ if (this.sortKey !== key) {
94
+ return 'ascending';
95
+ }
96
+ return this.sortDirection === 'ascending' ? 'descending' : 'ascending';
97
+ }
98
+ handleSort = (key) => {
99
+ this.chSort.emit({ key, direction: this.nextDirection(key) });
100
+ };
101
+ handleHeaderKeydown = (ev, key) => {
102
+ if (ev.key !== 'Enter' && ev.key !== ' ') {
103
+ return;
104
+ }
105
+ ev.preventDefault();
106
+ this.handleSort(key);
107
+ };
108
+ renderHeaderCell(column) {
109
+ const sortable = this.sortable && column.sortable !== false;
110
+ if (!sortable) {
111
+ return (h("th", { scope: "col", class: "cell cell--header" }, column.label));
112
+ }
113
+ const active = this.sortKey === column.key;
114
+ const direction = active ? this.sortDirection : 'none';
115
+ return (h("th", { scope: "col", class: "cell cell--header", "aria-sort": direction }, h("button", { type: "button", class: "sort", onClick: () => this.handleSort(column.key), onKeyDown: ev => this.handleHeaderKeydown(ev, column.key) }, h("span", null, column.label), h("span", { class: "sort__cue", "aria-hidden": "true" }, this.sortCue(active)))));
116
+ }
117
+ render() {
118
+ const empty = this.emptyState;
119
+ // Before the first measurement the table is rendered as non-empty, so a
120
+ // consumer never sees the empty message flash over real rows.
121
+ return (h(Host, { key: 'f4511d753b9140b08eee0e50041ba4e7408930ec', class: { 'table': true, 'table--empty': empty === 'true' || empty === 'filtered' } }, h("div", { key: '8cc987803f5d000d7efbbc6b605561d2c6ca1c46', class: "table__scroll", tabIndex: 0, role: "group", "aria-labelledby": this.captionId }, h("table", { key: '9eff6abfe0fecfd3559bfe397db3957fa60e288a' }, h("caption", { key: '35d88e56267aff1ae9753326ffc807cf6e04bfba', id: this.captionId, class: "caption" }, this.label), h("thead", { key: '0b01e865f3c0f40e9e86634f701b77886713e2e3' }, h("tr", { key: '92ded28a12867b8a2a372a9b04e8fd251870a5c7' }, this.columns.map(column => this.renderHeaderCell(column)))), h("tbody", { key: '68d7a49aa51cf1e958f1af7ebc36cdb5f6acfdd0' }, h("slot", { key: '79e296699379971e93b8a91b7823987be835ce8e' })))), (empty === 'true' || empty === 'filtered') && (h("div", { key: 'b7b2734f3d83ced393377fbe6f2911d2466ce714', class: "table__empty", id: this.emptyId }, h("slot", { key: '926191c01eef1f1898ad7fc800824021a697da35', name: "empty" }, h("p", { key: '6302a52795029b3d31200ae3c1c4ff53af3ab81c', class: "table__empty-message" }, this.emptyMessage(empty)))))));
122
+ }
123
+ static get watchers() { return {
124
+ "filtered": [{
125
+ "onFiltered": 0
126
+ }],
127
+ "sortKey": [{
128
+ "rerenderHeaders": 0
129
+ }],
130
+ "sortDirection": [{
131
+ "rerenderHeaders": 0
132
+ }],
133
+ "sortable": [{
134
+ "rerenderHeaders": 0
135
+ }]
136
+ }; }
137
+ };
138
+ ChTable.style = chTableCss();
139
+
140
+ export { ChTable as ch_table };
141
+ //# sourceMappingURL=ch-table.entry.js.map
142
+
143
+ //# sourceMappingURL=ch-table.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ch-table.entry.js","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"],"names":[],"mappings":";;AAAA,MAAM,UAAU,GAAG,MAAM,CAAC,s5CAA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,iBAAA,EAAkB,IAAI,CAAC,SAAS,EAAA,EAClF,CAAA,CAAA,OAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EACE,CAAA,CAAA,SAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAS,EAAE,EAAE,IAAI,CAAC,SAAS,EAAE,KAAK,EAAC,SAAS,EAAA,EACzC,IAAI,CAAC,KAAK,CACH,EACV,CAAA,CAAA,OAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EACE,CAAA,CAAA,IAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EAAK,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,IAAI,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAM,CAC9D,EACR,CAAA,CAAA,OAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EACE,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAa,CACP,CACF,CACJ,EACL,CAAC,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,UAAU,MACxC,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,cAAc,EAAC,EAAE,EAAE,IAAI,CAAC,OAAO,EAAA,EACxC,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,OAAO,EAAA,EAChB,CAAA,CAAA,GAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAG,KAAK,EAAC,sBAAsB,EAAA,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAK,CACzD,CACH,CACP,CACI;;;;;;;;;;;;;;;;;;;;;"}
@@ -84,7 +84,7 @@ const ChTabs = class {
84
84
  }
85
85
  render() {
86
86
  const active = this.activeValue;
87
- return (h(Host, { key: 'de167280c159345631f84f5eb7a3dc165396f361' }, h("div", { key: '62c008bcf9eafd1c5f5121540b2841e2a6ada541', class: "tablist", role: "tablist", "aria-label": this.label, onKeyDown: this.handleKeyDown, ref: el => (this.tablistEl = el) }, this.tabs.map(tab => {
87
+ return (h(Host, { key: '5fd5208bb1b9b75f13b9d3830d042f623aaca651' }, h("div", { key: '8d602a604a8315db01f3e4d28a39e866efabdb48', class: "tablist", role: "tablist", "aria-label": this.label, onKeyDown: this.handleKeyDown, ref: el => (this.tablistEl = el) }, this.tabs.map(tab => {
88
88
  const selected = tab.value === active;
89
89
  return (h("button", { key: tab.value, type: "button", class: { 'tab': true, 'tab--active': selected, 'tab--disabled': Boolean(tab.disabled) }, role: "tab", id: this.tabId(tab.value), "data-value": tab.value, "aria-selected": selected ? 'true' : 'false', "aria-controls": this.panelId(tab.value), tabIndex: selected ? FIRST_TAB_INDEX : LAST_TAB_INDEX, disabled: tab.disabled, onClick: () => this.select(tab.value) }, tab.label));
90
90
  })), this.tabs.map(tab => (h("div", { key: `${tab.value}-panel`, class: "tabpanel", id: this.panelId(tab.value), role: "tabpanel", "aria-labelledby": this.tabId(tab.value), tabIndex: FIRST_TAB_INDEX, hidden: tab.value !== active }, h("slot", { name: `panel-${tab.value}` }))))));
@@ -123,7 +123,7 @@ const ChTextarea = class {
123
123
  return undefined;
124
124
  }
125
125
  render() {
126
- return (h(Host, { key: 'c4334a23f6ad2394d410498726f3f422a654ffe3' }, this.label && (h("label", { key: 'd935613b40c6c52be41e258aad2a3c17a290a506', class: "label", htmlFor: this.textareaId }, this.label)), h("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) && (h("p", { key: 'eb488704ac6ff76534308aefd0938d848d14608f', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: '04c084b29d102f06bf15efc4c416b6ba0967ba8d', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
126
+ return (h(Host, { key: '0f2b76444b3bff5d37d069bf1fe307781c5e59d1' }, this.label && (h("label", { key: '08b83be70f33dc2c9b93a6d748564aad4eb63d76', class: "label", htmlFor: this.textareaId }, this.label)), h("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) && (h("p", { key: '36e41249852346df559bd278256cc89a79371a88', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: '90bda1f377da78e07eae82ee13069813c7ed1e8b', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
127
127
  }
128
128
  static get formAssociated() { return true; }
129
129
  static get watchers() { return {
@@ -7,7 +7,7 @@ const ChTimeline = class {
7
7
  registerInstance(this, hostRef);
8
8
  }
9
9
  render() {
10
- return (h(Host, { key: 'da3288af540acb92113ba83d08fc5e1693e83b3e', class: "timeline" }, h("ol", { key: '1aaee846703dd0a67d6df04945eb4a62e2bbf711', class: "list" }, h("slot", { key: '394cfd03640a2cf78bd620338de9ed9ef7b9d9f5' }))));
10
+ return (h(Host, { key: '50b3a225915e4223fa3eaf560cb1e15898026ec0', class: "timeline" }, h("ol", { key: '5b5e218a419f63990deca2d1a7e0f8f36f63cc09', class: "list" }, h("slot", { key: '69ff4592e898cdecb078437b6633e5e24c626e61' }))));
11
11
  }
12
12
  };
13
13
  ChTimeline.style = chTimelineCss();
@@ -101,7 +101,7 @@ function correction(before, after) {
101
101
  return 0;
102
102
  }
103
103
 
104
- const chTooltipCss = () => `: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}}`;
104
+ const chTooltipCss = () => `: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}}`;
105
105
 
106
106
  let tooltipIds = 0;
107
107
  /** Space between the trigger and the bubble, matching `--spacing-md`. */
@@ -113,6 +113,7 @@ const ChTooltip = class {
113
113
  get el() { return getElement(this); }
114
114
  fallbackId = `ch-tooltip-${++tooltipIds}`;
115
115
  bubbleEl;
116
+ probeEl;
116
117
  cleanup;
117
118
  /**
118
119
  * The side the bubble is placed on. It is a preference: when that side has no
@@ -204,30 +205,46 @@ const ChTooltip = class {
204
205
  * Measures the anchor and the bubble and stores the offset that keeps the
205
206
  * bubble inside the viewport. Nothing is measured before the bubble has a
206
207
  * box to measure, so the pre-paint render uses plain CSS.
208
+ *
209
+ * A fixed bubble is positioned against the nearest ancestor that establishes
210
+ * a containing block (a `transform`, `filter`, `backdrop-filter`, `contain`
211
+ * or `will-change`), not necessarily the viewport. The probe is fixed at the
212
+ * containing block's origin, so both the anchor and the viewport are
213
+ * converted into that same space before `placeOverlay` does its maths.
207
214
  */
208
215
  position() {
209
216
  if (typeof window === 'undefined') {
210
217
  return;
211
218
  }
212
219
  const bubble = this.bubbleEl ?? (this.bubbleEl = this.el.shadowRoot?.querySelector('.bubble') ?? undefined);
213
- if (!bubble || bubble.offsetWidth === 0) {
220
+ const probe = this.probeEl ?? (this.probeEl = this.el.shadowRoot?.querySelector('.probe') ?? undefined);
221
+ if (!bubble || !probe || bubble.offsetWidth === 0) {
214
222
  return;
215
223
  }
216
224
  const anchorRect = this.slotted('trigger')?.getBoundingClientRect?.();
217
225
  if (!anchorRect) {
218
226
  return;
219
227
  }
228
+ const probeRect = probe.getBoundingClientRect();
229
+ const scaleX = probeRect.width || 1;
230
+ const scaleY = probeRect.height || 1;
231
+ const inContainingBlock = (rect) => ({
232
+ top: (rect.top - probeRect.top) / scaleY,
233
+ left: (rect.left - probeRect.left) / scaleX,
234
+ width: rect.width / scaleX,
235
+ height: rect.height / scaleY,
236
+ });
220
237
  const surface = {
221
238
  width: bubble.offsetWidth + horizontalMargin(bubble),
222
239
  height: bubble.offsetHeight,
223
240
  };
224
241
  const viewport = window.visualViewport;
225
242
  const { placement, top, left } = placeOverlay({
226
- anchor: { top: anchorRect.top, left: anchorRect.left, width: anchorRect.width, height: anchorRect.height },
243
+ anchor: inContainingBlock(anchorRect),
227
244
  surface,
228
- viewport: viewport
245
+ viewport: inContainingBlock(viewport
229
246
  ? { top: viewport.offsetTop, left: viewport.offsetLeft, width: viewport.width, height: viewport.height }
230
- : { top: 0, left: 0, width: window.innerWidth, height: window.innerHeight },
247
+ : { top: 0, left: 0, width: window.innerWidth, height: window.innerHeight }),
231
248
  preferred: this.placement,
232
249
  gap: GAP,
233
250
  });
@@ -258,7 +275,7 @@ const ChTooltip = class {
258
275
  };
259
276
  render() {
260
277
  const { offset } = this;
261
- return (h(Host, { key: '676e431d0100ecc9ea688b7e37bc87e8295bb24d' }, h("span", { key: '20a388681252e9c4d52e662c014efd9a198efbd7', class: "anchor" }, h("slot", { key: 'a06cbe31dd04cba38ef09788359783d816fc1a5b', name: "trigger", onSlotchange: this.associate }), h("span", { key: '13cb5b782a7029fc82c10b9b6765de62b94b9afa', ref: el => (this.bubbleEl = el), style: {
278
+ return (h(Host, { key: 'c88fafd18dfa217051213dc510d7c3edd7e6fa45' }, h("span", { key: '97b027bccda9cfcfed684556ed11211317ca97b3', class: "anchor" }, h("span", { key: '30f76981b7d295b4459f3ca4045168e24ec1ee65', class: "probe", "aria-hidden": "true", ref: el => (this.probeEl = el) }), h("slot", { key: 'f99a7e5b4ca3775e7af26edf9a9e9d76e7c7a292', name: "trigger", onSlotchange: this.associate }), h("span", { key: '17b396847c0be20c03fc010b57dfe3c299dbf3c1', ref: el => (this.bubbleEl = el), style: {
262
279
  '--ch-tooltip-offset-top': offset ? `${offset.top}px` : null,
263
280
  '--ch-tooltip-offset-left': offset ? `${offset.left}px` : null,
264
281
  }, class: {
@@ -266,7 +283,7 @@ const ChTooltip = class {
266
283
  'bubble--positioned': Boolean(this.offset),
267
284
  [`bubble--${this.resolvedPlacement ?? this.placement}`]: true,
268
285
  'bubble--visible': this.visible,
269
- } }, h("slot", { key: '6610bbf299354bb3be07bb273fab3f8fd91fd254', name: "content", onSlotchange: this.associate })))));
286
+ } }, h("slot", { key: 'd11e591c095b29033db96242dbeafa4347ee4326', name: "content", onSlotchange: this.associate })))));
270
287
  }
271
288
  };
272
289
  function horizontalMargin(el) {
@@ -1 +1 @@
1
- {"version":3,"file":"ch-tooltip.entry.js","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"],"names":[],"mappings":";;AAwBA,MAAM,QAAQ,GAAmD;AAC/D,IAAA,GAAG,EAAE,QAAQ;AACb,IAAA,MAAM,EAAE,KAAK;AACb,IAAA,IAAI,EAAE,OAAO;AACb,IAAA,KAAK,EAAE,MAAM;CACd;AAED,MAAM,IAAI,GAA0D;AAClE,IAAA,GAAG,EAAE,UAAU;AACf,IAAA,MAAM,EAAE,UAAU;AAClB,IAAA,IAAI,EAAE,YAAY;AAClB,IAAA,KAAK,EAAE,YAAY;CACpB;AAED;;;AAGG;AACG,SAAU,UAAU,CAAC,OAAsB,EAAE,QAA2B,EAAA;IAC5E,OAAO;AACL,QAAA,GAAG,EAAE,QAAQ,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG;AAC/B,QAAA,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI;AAClC,QAAA,MAAM,EAAE,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,MAAM,IAAI,QAAQ,CAAC,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC;AACvE,QAAA,KAAK,EAAE,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,KAAK,IAAI,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC;KACvE;AACH;AAEA,SAAS,SAAS,CAAC,SAA6B,EAAE,MAAqB,EAAE,OA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CAAC,IAAI,CAAC,CAAC;AACnF;;;;;"}
1
+ {"version":3,"file":"ch-tooltip.entry.js","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"],"names":[],"mappings":";;AAwBA,MAAM,QAAQ,GAAmD;AAC/D,IAA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A,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,SAAS,EAAC,YAAY,EAAE,IAAI,CAAC,SAAS,EAAA,CAAS,CACrD,CACF,CACF;;;AAKb,SAAS,gBAAgB,CAAC,EAAe,EAAA;AACvC,IAAA,MAAM,KAAK,GAAG,gBAAgB,CAAC,EAAE,CAAC;IAClC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AACnF;;;;;"}
@@ -16,7 +16,7 @@ var patchBrowser = () => {
16
16
 
17
17
  patchBrowser().then(async (options) => {
18
18
  await globalScripts();
19
- return bootstrapLazy([["ch-accordion",[[769,"ch-accordion",{"items":[16],"value":[1025]}]]],["ch-checkbox",[[577,"ch-checkbox",{"label":[1],"name":[513],"value":[1],"checked":[1028],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-cluster",[[769,"ch-cluster",{"gap":[1],"align":[1],"justify":[1],"wrap":[4]}]]],["ch-description-list",[[769,"ch-description-list",{"columns":[1]}]]],["ch-divider",[[513,"ch-divider",{"orientation":[1]}]]],["ch-drawer",[[769,"ch-drawer",{"open":[1028],"side":[1],"label":[1],"closeLabel":[1,"close-label"]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-emoji",[[513,"ch-emoji",{"name":[1],"alt":[1],"size":[1],"extIndex":[32],"loaded":[32]},null,{"name":[{"handleNameChange":0}]}]]],["ch-empty-state",[[769,"ch-empty-state",{"title":[1],"description":[1],"size":[1]}]]],["ch-grid",[[769,"ch-grid",{"columns":[1],"gap":[1],"minItemWidth":[1,"min-item-width"]}]]],["ch-icon",[[513,"ch-icon",{"name":[1],"size":[1],"label":[1]}]]],["ch-icon-button",[[513,"ch-icon-button",{"name":[1],"label":[1],"size":[1],"type":[1],"disabled":[4],"loading":[4]}]]],["ch-link",[[769,"ch-link",{"href":[1],"target":[1],"variant":[1],"disabled":[4]}]]],["ch-modal",[[769,"ch-modal",{"open":[1028],"label":[1],"closeLabel":[1,"close-label"],"size":[1]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-page-header",[[769,"ch-page-header",{"title":[1],"headingLevel":[1,"heading-level"],"eyebrow":[1],"description":[1],"actionsStacked":[4,"actions-stacked"]}]]],["ch-radio",[[577,"ch-radio",{"label":[1],"options":[16],"value":[1025],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-segmented-control",[[577,"ch-segmented-control",{"label":[1],"options":[16],"value":[1025],"size":[1],"name":[513],"disabled":[516],"required":[516],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}]}]]],["ch-skeleton",[[513,"ch-skeleton",{"width":[1],"height":[1],"shape":[1],"count":[2],"animated":[4]}]]],["ch-stack",[[769,"ch-stack",{"gap":[1],"align":[1],"justify":[1]}]]],["ch-stat",[[769,"ch-stat",{"label":[1],"value":[1],"hint":[1],"tone":[1]}]]],["ch-tabs",[[769,"ch-tabs",{"tabs":[16],"value":[1025],"label":[1]}]]],["ch-textarea",[[577,"ch-textarea",{"label":[1],"value":[1025],"placeholder":[1],"rows":[2],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-timeline",[[257,"ch-timeline"]]],["ch-tooltip",[[769,"ch-tooltip",{"placement":[1],"hovered":[32],"focused":[32],"dismissed":[32],"resolvedPlacement":[32]},[[1,"mouseenter","handleMouseEnter"],[1,"mouseleave","handleMouseLeave"],[0,"focusin","handleFocusIn"],[0,"focusout","handleFocusOut"],[4,"keydown","handleKeyDown"],[11,"scroll","handleScroll"],[9,"resize","handleResize"]]]]],["ch-alert_8",[[769,"ch-button",{"variant":[1],"size":[1],"disabled":[4],"loading":[4],"href":[1],"target":[1],"label":[1]}],[769,"ch-alert",{"variant":[1],"dismissLabel":[1,"dismiss-label"],"statusCue":[4,"status-cue"]}],[769,"ch-badge",{"variant":[1],"statusCue":[4,"status-cue"]}],[257,"ch-card"],[577,"ch-input",{"label":[1],"type":[1],"value":[1025],"placeholder":[1],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[577,"ch-select",{"label":[1],"options":[16],"value":[1025],"placeholder":[1],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[577,"ch-switch",{"label":[1],"name":[513],"value":[1],"checked":[1028],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[513,"ch-spinner",{"size":[1],"label":[1]}]]]], options);
19
+ return bootstrapLazy([["ch-accordion",[[769,"ch-accordion",{"items":[16],"value":[1025]}]]],["ch-checkbox",[[577,"ch-checkbox",{"label":[1],"name":[513],"value":[1],"checked":[1028],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-cluster",[[769,"ch-cluster",{"gap":[1],"align":[1],"justify":[1],"wrap":[4]}]]],["ch-description-list",[[769,"ch-description-list",{"columns":[1]}]]],["ch-divider",[[513,"ch-divider",{"orientation":[1]}]]],["ch-drawer",[[769,"ch-drawer",{"open":[1028],"side":[1],"label":[1],"closeLabel":[1,"close-label"]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-emoji",[[513,"ch-emoji",{"name":[1],"alt":[1],"size":[1],"extIndex":[32],"loaded":[32]},null,{"name":[{"handleNameChange":0}]}]]],["ch-empty-state",[[769,"ch-empty-state",{"title":[1],"description":[1],"size":[1]}]]],["ch-grid",[[769,"ch-grid",{"columns":[1],"gap":[1],"minItemWidth":[1,"min-item-width"]}]]],["ch-icon",[[513,"ch-icon",{"name":[1],"size":[1],"label":[1]}]]],["ch-icon-button",[[513,"ch-icon-button",{"name":[1],"label":[1],"size":[1],"type":[1],"disabled":[4],"loading":[4]}]]],["ch-link",[[769,"ch-link",{"href":[1],"target":[1],"variant":[1],"disabled":[4]}]]],["ch-modal",[[769,"ch-modal",{"open":[1028],"label":[1],"closeLabel":[1,"close-label"],"size":[1]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-number-input",[[577,"ch-number-input",{"label":[1],"value":[1025],"format":[1],"placeholder":[1],"name":[513],"disabled":[516],"required":[516],"min":[2],"max":[2],"step":[8],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32],"draft":[32],"typing":[32]},null,{"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}],"min":[{"syncForm":0}],"max":[{"syncForm":0}]}]]],["ch-page-header",[[769,"ch-page-header",{"title":[1],"headingLevel":[1,"heading-level"],"eyebrow":[1],"description":[1],"actionsStacked":[4,"actions-stacked"]}]]],["ch-radio",[[577,"ch-radio",{"label":[1],"options":[16],"value":[1025],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-segmented-control",[[577,"ch-segmented-control",{"label":[1],"options":[16],"value":[1025],"size":[1],"name":[513],"disabled":[516],"required":[516],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}]}]]],["ch-skeleton",[[513,"ch-skeleton",{"width":[1],"height":[1],"shape":[1],"count":[2],"animated":[4]}]]],["ch-stack",[[769,"ch-stack",{"gap":[1],"align":[1],"justify":[1]}]]],["ch-stat",[[769,"ch-stat",{"label":[1],"value":[1],"hint":[1],"tone":[1]}]]],["ch-table",[[769,"ch-table",{"columns":[16],"sortable":[516],"sortKey":[1,"sort-key"],"sortDirection":[1,"sort-direction"],"label":[1],"filtered":[516],"empty":[32],"rerender":[32]},null,{"filtered":[{"onFiltered":0}],"sortKey":[{"rerenderHeaders":0}],"sortDirection":[{"rerenderHeaders":0}],"sortable":[{"rerenderHeaders":0}]}]]],["ch-tabs",[[769,"ch-tabs",{"tabs":[16],"value":[1025],"label":[1]}]]],["ch-textarea",[[577,"ch-textarea",{"label":[1],"value":[1025],"placeholder":[1],"rows":[2],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-timeline",[[257,"ch-timeline"]]],["ch-tooltip",[[769,"ch-tooltip",{"placement":[1],"hovered":[32],"focused":[32],"dismissed":[32],"resolvedPlacement":[32]},[[1,"mouseenter","handleMouseEnter"],[1,"mouseleave","handleMouseLeave"],[0,"focusin","handleFocusIn"],[0,"focusout","handleFocusOut"],[4,"keydown","handleKeyDown"],[11,"scroll","handleScroll"],[9,"resize","handleResize"]]]]],["ch-alert_8",[[769,"ch-button",{"variant":[1],"size":[1],"disabled":[4],"loading":[4],"href":[1],"target":[1],"label":[1]}],[769,"ch-alert",{"variant":[1],"dismissLabel":[1,"dismiss-label"],"statusCue":[4,"status-cue"]}],[769,"ch-badge",{"variant":[1],"statusCue":[4,"status-cue"]}],[257,"ch-card"],[577,"ch-input",{"label":[1],"type":[1],"value":[1025],"placeholder":[1],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[577,"ch-select",{"label":[1],"options":[16],"value":[1025],"placeholder":[1],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[577,"ch-switch",{"label":[1],"name":[513],"value":[1],"checked":[1028],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[513,"ch-spinner",{"size":[1],"label":[1]}]]]], options);
20
20
  });
21
21
  //# sourceMappingURL=chucao.js.map
22
22
 
@@ -4,7 +4,7 @@ export { s as setNonce } from './index-CIV5Gg1o.js';
4
4
  const defineCustomElements = async (win, options) => {
5
5
  if (typeof window === 'undefined') return undefined;
6
6
  await globalScripts();
7
- return bootstrapLazy([["ch-accordion",[[769,"ch-accordion",{"items":[16],"value":[1025]}]]],["ch-checkbox",[[577,"ch-checkbox",{"label":[1],"name":[513],"value":[1],"checked":[1028],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-cluster",[[769,"ch-cluster",{"gap":[1],"align":[1],"justify":[1],"wrap":[4]}]]],["ch-description-list",[[769,"ch-description-list",{"columns":[1]}]]],["ch-divider",[[513,"ch-divider",{"orientation":[1]}]]],["ch-drawer",[[769,"ch-drawer",{"open":[1028],"side":[1],"label":[1],"closeLabel":[1,"close-label"]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-emoji",[[513,"ch-emoji",{"name":[1],"alt":[1],"size":[1],"extIndex":[32],"loaded":[32]},null,{"name":[{"handleNameChange":0}]}]]],["ch-empty-state",[[769,"ch-empty-state",{"title":[1],"description":[1],"size":[1]}]]],["ch-grid",[[769,"ch-grid",{"columns":[1],"gap":[1],"minItemWidth":[1,"min-item-width"]}]]],["ch-icon",[[513,"ch-icon",{"name":[1],"size":[1],"label":[1]}]]],["ch-icon-button",[[513,"ch-icon-button",{"name":[1],"label":[1],"size":[1],"type":[1],"disabled":[4],"loading":[4]}]]],["ch-link",[[769,"ch-link",{"href":[1],"target":[1],"variant":[1],"disabled":[4]}]]],["ch-modal",[[769,"ch-modal",{"open":[1028],"label":[1],"closeLabel":[1,"close-label"],"size":[1]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-page-header",[[769,"ch-page-header",{"title":[1],"headingLevel":[1,"heading-level"],"eyebrow":[1],"description":[1],"actionsStacked":[4,"actions-stacked"]}]]],["ch-radio",[[577,"ch-radio",{"label":[1],"options":[16],"value":[1025],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-segmented-control",[[577,"ch-segmented-control",{"label":[1],"options":[16],"value":[1025],"size":[1],"name":[513],"disabled":[516],"required":[516],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}]}]]],["ch-skeleton",[[513,"ch-skeleton",{"width":[1],"height":[1],"shape":[1],"count":[2],"animated":[4]}]]],["ch-stack",[[769,"ch-stack",{"gap":[1],"align":[1],"justify":[1]}]]],["ch-stat",[[769,"ch-stat",{"label":[1],"value":[1],"hint":[1],"tone":[1]}]]],["ch-tabs",[[769,"ch-tabs",{"tabs":[16],"value":[1025],"label":[1]}]]],["ch-textarea",[[577,"ch-textarea",{"label":[1],"value":[1025],"placeholder":[1],"rows":[2],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-timeline",[[257,"ch-timeline"]]],["ch-tooltip",[[769,"ch-tooltip",{"placement":[1],"hovered":[32],"focused":[32],"dismissed":[32],"resolvedPlacement":[32]},[[1,"mouseenter","handleMouseEnter"],[1,"mouseleave","handleMouseLeave"],[0,"focusin","handleFocusIn"],[0,"focusout","handleFocusOut"],[4,"keydown","handleKeyDown"],[11,"scroll","handleScroll"],[9,"resize","handleResize"]]]]],["ch-alert_8",[[769,"ch-button",{"variant":[1],"size":[1],"disabled":[4],"loading":[4],"href":[1],"target":[1],"label":[1]}],[769,"ch-alert",{"variant":[1],"dismissLabel":[1,"dismiss-label"],"statusCue":[4,"status-cue"]}],[769,"ch-badge",{"variant":[1],"statusCue":[4,"status-cue"]}],[257,"ch-card"],[577,"ch-input",{"label":[1],"type":[1],"value":[1025],"placeholder":[1],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[577,"ch-select",{"label":[1],"options":[16],"value":[1025],"placeholder":[1],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[577,"ch-switch",{"label":[1],"name":[513],"value":[1],"checked":[1028],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[513,"ch-spinner",{"size":[1],"label":[1]}]]]], options);
7
+ return bootstrapLazy([["ch-accordion",[[769,"ch-accordion",{"items":[16],"value":[1025]}]]],["ch-checkbox",[[577,"ch-checkbox",{"label":[1],"name":[513],"value":[1],"checked":[1028],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-cluster",[[769,"ch-cluster",{"gap":[1],"align":[1],"justify":[1],"wrap":[4]}]]],["ch-description-list",[[769,"ch-description-list",{"columns":[1]}]]],["ch-divider",[[513,"ch-divider",{"orientation":[1]}]]],["ch-drawer",[[769,"ch-drawer",{"open":[1028],"side":[1],"label":[1],"closeLabel":[1,"close-label"]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-emoji",[[513,"ch-emoji",{"name":[1],"alt":[1],"size":[1],"extIndex":[32],"loaded":[32]},null,{"name":[{"handleNameChange":0}]}]]],["ch-empty-state",[[769,"ch-empty-state",{"title":[1],"description":[1],"size":[1]}]]],["ch-grid",[[769,"ch-grid",{"columns":[1],"gap":[1],"minItemWidth":[1,"min-item-width"]}]]],["ch-icon",[[513,"ch-icon",{"name":[1],"size":[1],"label":[1]}]]],["ch-icon-button",[[513,"ch-icon-button",{"name":[1],"label":[1],"size":[1],"type":[1],"disabled":[4],"loading":[4]}]]],["ch-link",[[769,"ch-link",{"href":[1],"target":[1],"variant":[1],"disabled":[4]}]]],["ch-modal",[[769,"ch-modal",{"open":[1028],"label":[1],"closeLabel":[1,"close-label"],"size":[1]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-number-input",[[577,"ch-number-input",{"label":[1],"value":[1025],"format":[1],"placeholder":[1],"name":[513],"disabled":[516],"required":[516],"min":[2],"max":[2],"step":[8],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32],"draft":[32],"typing":[32]},null,{"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}],"min":[{"syncForm":0}],"max":[{"syncForm":0}]}]]],["ch-page-header",[[769,"ch-page-header",{"title":[1],"headingLevel":[1,"heading-level"],"eyebrow":[1],"description":[1],"actionsStacked":[4,"actions-stacked"]}]]],["ch-radio",[[577,"ch-radio",{"label":[1],"options":[16],"value":[1025],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-segmented-control",[[577,"ch-segmented-control",{"label":[1],"options":[16],"value":[1025],"size":[1],"name":[513],"disabled":[516],"required":[516],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}]}]]],["ch-skeleton",[[513,"ch-skeleton",{"width":[1],"height":[1],"shape":[1],"count":[2],"animated":[4]}]]],["ch-stack",[[769,"ch-stack",{"gap":[1],"align":[1],"justify":[1]}]]],["ch-stat",[[769,"ch-stat",{"label":[1],"value":[1],"hint":[1],"tone":[1]}]]],["ch-table",[[769,"ch-table",{"columns":[16],"sortable":[516],"sortKey":[1,"sort-key"],"sortDirection":[1,"sort-direction"],"label":[1],"filtered":[516],"empty":[32],"rerender":[32]},null,{"filtered":[{"onFiltered":0}],"sortKey":[{"rerenderHeaders":0}],"sortDirection":[{"rerenderHeaders":0}],"sortable":[{"rerenderHeaders":0}]}]]],["ch-tabs",[[769,"ch-tabs",{"tabs":[16],"value":[1025],"label":[1]}]]],["ch-textarea",[[577,"ch-textarea",{"label":[1],"value":[1025],"placeholder":[1],"rows":[2],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-timeline",[[257,"ch-timeline"]]],["ch-tooltip",[[769,"ch-tooltip",{"placement":[1],"hovered":[32],"focused":[32],"dismissed":[32],"resolvedPlacement":[32]},[[1,"mouseenter","handleMouseEnter"],[1,"mouseleave","handleMouseLeave"],[0,"focusin","handleFocusIn"],[0,"focusout","handleFocusOut"],[4,"keydown","handleKeyDown"],[11,"scroll","handleScroll"],[9,"resize","handleResize"]]]]],["ch-alert_8",[[769,"ch-button",{"variant":[1],"size":[1],"disabled":[4],"loading":[4],"href":[1],"target":[1],"label":[1]}],[769,"ch-alert",{"variant":[1],"dismissLabel":[1,"dismiss-label"],"statusCue":[4,"status-cue"]}],[769,"ch-badge",{"variant":[1],"statusCue":[4,"status-cue"]}],[257,"ch-card"],[577,"ch-input",{"label":[1],"type":[1],"value":[1025],"placeholder":[1],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[577,"ch-select",{"label":[1],"options":[16],"value":[1025],"placeholder":[1],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[577,"ch-switch",{"label":[1],"name":[513],"value":[1],"checked":[1028],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[513,"ch-spinner",{"size":[1],"label":[1]}]]]], options);
8
8
  };
9
9
 
10
10
  export { defineCustomElements };