@devschile/chucao 2.1.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/dist/chucao/chucao.esm.js +1 -1
  2. package/dist/chucao/p-37e7f9cc.entry.js +2 -0
  3. package/dist/chucao/p-37e7f9cc.entry.js.map +1 -0
  4. package/dist/chucao/p-3db38c49.entry.js +2 -0
  5. package/dist/chucao/p-3db38c49.entry.js.map +1 -0
  6. package/dist/chucao/p-60c2fd71.entry.js +2 -0
  7. package/dist/chucao/p-60c2fd71.entry.js.map +1 -0
  8. package/dist/chucao/{p-121fbfc8.entry.js → p-6a4bc80c.entry.js} +2 -2
  9. package/dist/chucao/p-6c617158.entry.js +2 -0
  10. package/dist/chucao/p-6c617158.entry.js.map +1 -0
  11. package/dist/chucao/{p-4bc8e098.entry.js → p-aeea9cbe.entry.js} +2 -2
  12. package/dist/chucao/p-bb2445d1.entry.js +2 -0
  13. package/dist/chucao/{p-5fe8bfff.entry.js → p-c4806e96.entry.js} +2 -2
  14. package/dist/chucao/{p-9bb81a65.entry.js → p-c986036f.entry.js} +2 -2
  15. package/dist/chucao/p-d8DfpzMR.js +2 -0
  16. package/dist/chucao/p-d8DfpzMR.js.map +1 -0
  17. package/dist/chucao/{p-1b1e56cd.entry.js → p-e3265e38.entry.js} +2 -2
  18. package/dist/chucao/{p-d5a9e340.entry.js → p-f78f0163.entry.js} +2 -2
  19. package/dist/cjs/ch-alert_8.cjs.entry.js +54 -11
  20. package/dist/cjs/ch-alert_8.cjs.entry.js.map +1 -1
  21. package/dist/cjs/ch-checkbox.cjs.entry.js +1 -1
  22. package/dist/cjs/ch-divider.cjs.entry.js +1 -1
  23. package/dist/cjs/ch-drawer.cjs.entry.js +153 -0
  24. package/dist/cjs/ch-drawer.cjs.entry.js.map +1 -0
  25. package/dist/cjs/ch-emoji.cjs.entry.js +1 -1
  26. package/dist/cjs/ch-modal.cjs.entry.js +12 -24
  27. package/dist/cjs/ch-modal.cjs.entry.js.map +1 -1
  28. package/dist/cjs/ch-radio.cjs.entry.js +1 -1
  29. package/dist/cjs/ch-segmented-control.cjs.entry.js +112 -0
  30. package/dist/cjs/ch-segmented-control.cjs.entry.js.map +1 -0
  31. package/dist/cjs/ch-tabs.cjs.entry.js +1 -1
  32. package/dist/cjs/ch-textarea.cjs.entry.js +1 -1
  33. package/dist/cjs/ch-tooltip.cjs.entry.js +1 -1
  34. package/dist/cjs/chucao.cjs.js +1 -1
  35. package/dist/cjs/loader.cjs.js +1 -1
  36. package/dist/cjs/scroll-lock-DIRqLP4K.js +49 -0
  37. package/dist/cjs/scroll-lock-DIRqLP4K.js.map +1 -0
  38. package/dist/collection/collection-manifest.json +3 -1
  39. package/dist/collection/components/ch-button/ch-button.css +56 -18
  40. package/dist/collection/components/ch-button/ch-button.js +135 -8
  41. package/dist/collection/components/ch-button/ch-button.js.map +1 -1
  42. package/dist/collection/components/ch-card/ch-card.js +1 -1
  43. package/dist/collection/components/ch-checkbox/ch-checkbox.js +1 -1
  44. package/dist/collection/components/ch-divider/ch-divider.js +1 -1
  45. package/dist/collection/components/ch-drawer/ch-drawer.css +152 -0
  46. package/dist/collection/components/ch-drawer/ch-drawer.js +285 -0
  47. package/dist/collection/components/ch-drawer/ch-drawer.js.map +1 -0
  48. package/dist/collection/components/ch-emoji/ch-emoji.js +1 -1
  49. package/dist/collection/components/ch-input/ch-input.js +1 -1
  50. package/dist/collection/components/ch-modal/ch-modal.css +12 -1
  51. package/dist/collection/components/ch-modal/ch-modal.js +37 -23
  52. package/dist/collection/components/ch-modal/ch-modal.js.map +1 -1
  53. package/dist/collection/components/ch-radio/ch-radio.js +1 -1
  54. package/dist/collection/components/ch-segmented-control/ch-segmented-control.css +88 -0
  55. package/dist/collection/components/ch-segmented-control/ch-segmented-control.js +295 -0
  56. package/dist/collection/components/ch-segmented-control/ch-segmented-control.js.map +1 -0
  57. package/dist/collection/components/ch-select/ch-select.js +1 -1
  58. package/dist/collection/components/ch-spinner/ch-spinner.js +1 -1
  59. package/dist/collection/components/ch-switch/ch-switch.js +1 -1
  60. package/dist/collection/components/ch-tabs/ch-tabs.js +1 -1
  61. package/dist/collection/components/ch-textarea/ch-textarea.js +1 -1
  62. package/dist/collection/components/ch-tooltip/ch-tooltip.js +1 -1
  63. package/dist/collection/utils/scroll-lock.js +42 -0
  64. package/dist/collection/utils/scroll-lock.js.map +1 -0
  65. package/dist/components/ch-button.js +1 -1
  66. package/dist/components/ch-button.js.map +1 -1
  67. package/dist/components/ch-card.js +1 -1
  68. package/dist/components/ch-card.js.map +1 -1
  69. package/dist/components/ch-checkbox.js +1 -1
  70. package/dist/components/ch-divider.js +1 -1
  71. package/dist/components/ch-drawer.d.ts +11 -0
  72. package/dist/components/ch-drawer.js +2 -0
  73. package/dist/components/ch-drawer.js.map +1 -0
  74. package/dist/components/ch-emoji.js +1 -1
  75. package/dist/components/ch-input.js +1 -1
  76. package/dist/components/ch-modal.js +1 -1
  77. package/dist/components/ch-modal.js.map +1 -1
  78. package/dist/components/ch-radio.js +1 -1
  79. package/dist/components/ch-segmented-control.d.ts +11 -0
  80. package/dist/components/ch-segmented-control.js +2 -0
  81. package/dist/components/ch-segmented-control.js.map +1 -0
  82. package/dist/components/ch-select.js +1 -1
  83. package/dist/components/ch-spinner.js +1 -1
  84. package/dist/components/ch-spinner.js.map +1 -1
  85. package/dist/components/ch-switch.js +1 -1
  86. package/dist/components/ch-tabs.js +1 -1
  87. package/dist/components/ch-textarea.js +1 -1
  88. package/dist/components/ch-tooltip.js +1 -1
  89. package/dist/components/p-C1995t1C.js +2 -0
  90. package/dist/components/p-C1995t1C.js.map +1 -0
  91. package/dist/components/p-d8DfpzMR.js +2 -0
  92. package/dist/components/p-d8DfpzMR.js.map +1 -0
  93. package/dist/esm/ch-alert_8.entry.js +54 -11
  94. package/dist/esm/ch-alert_8.entry.js.map +1 -1
  95. package/dist/esm/ch-checkbox.entry.js +1 -1
  96. package/dist/esm/ch-divider.entry.js +1 -1
  97. package/dist/esm/ch-drawer.entry.js +151 -0
  98. package/dist/esm/ch-drawer.entry.js.map +1 -0
  99. package/dist/esm/ch-emoji.entry.js +1 -1
  100. package/dist/esm/ch-modal.entry.js +12 -24
  101. package/dist/esm/ch-modal.entry.js.map +1 -1
  102. package/dist/esm/ch-radio.entry.js +1 -1
  103. package/dist/esm/ch-segmented-control.entry.js +110 -0
  104. package/dist/esm/ch-segmented-control.entry.js.map +1 -0
  105. package/dist/esm/ch-tabs.entry.js +1 -1
  106. package/dist/esm/ch-textarea.entry.js +1 -1
  107. package/dist/esm/ch-tooltip.entry.js +1 -1
  108. package/dist/esm/chucao.js +1 -1
  109. package/dist/esm/loader.js +1 -1
  110. package/dist/esm/scroll-lock-d8DfpzMR.js +46 -0
  111. package/dist/esm/scroll-lock-d8DfpzMR.js.map +1 -0
  112. package/dist/types/components/ch-button/ch-button.d.ts +29 -5
  113. package/dist/types/components/ch-drawer/ch-drawer.d.ts +68 -0
  114. package/dist/types/components/ch-modal/ch-modal.d.ts +8 -0
  115. package/dist/types/components/ch-segmented-control/ch-segmented-control.d.ts +72 -0
  116. package/dist/types/components.d.ts +346 -6
  117. package/dist/types/utils/scroll-lock.d.ts +17 -0
  118. package/dist-react/components.d.ts +12 -1
  119. package/dist-react/components.js +21 -0
  120. package/dist-react/components.ts +31 -1
  121. package/dist-vue/index.d.ts +2 -0
  122. package/dist-vue/index.js +30 -0
  123. package/dist-vue/index.ts +34 -0
  124. package/hydrate/index.js +428 -43
  125. package/hydrate/index.mjs +428 -43
  126. package/package.json +4 -3
  127. package/dist/chucao/p-11083711.entry.js +0 -2
  128. package/dist/chucao/p-11083711.entry.js.map +0 -1
  129. package/dist/chucao/p-2ab4a6a8.entry.js +0 -2
  130. package/dist/chucao/p-a955eebf.entry.js +0 -2
  131. package/dist/chucao/p-a955eebf.entry.js.map +0 -1
  132. /package/dist/chucao/{p-121fbfc8.entry.js.map → p-6a4bc80c.entry.js.map} +0 -0
  133. /package/dist/chucao/{p-4bc8e098.entry.js.map → p-aeea9cbe.entry.js.map} +0 -0
  134. /package/dist/chucao/{p-2ab4a6a8.entry.js.map → p-bb2445d1.entry.js.map} +0 -0
  135. /package/dist/chucao/{p-5fe8bfff.entry.js.map → p-c4806e96.entry.js.map} +0 -0
  136. /package/dist/chucao/{p-9bb81a65.entry.js.map → p-c986036f.entry.js.map} +0 -0
  137. /package/dist/chucao/{p-1b1e56cd.entry.js.map → p-e3265e38.entry.js.map} +0 -0
  138. /package/dist/chucao/{p-d5a9e340.entry.js.map → p-f78f0163.entry.js.map} +0 -0
@@ -0,0 +1,72 @@
1
+ import { type EventEmitter } from '../../stencil-public-runtime';
2
+ export interface ChSegmentedControlOption {
3
+ label: string;
4
+ value: string;
5
+ disabled?: boolean;
6
+ }
7
+ export type ChSegmentedControlSize = 'sm' | 'md';
8
+ /**
9
+ * Compact control for switching between a few mutually exclusive options
10
+ * (all/in/out, movement type, and similar filters).
11
+ *
12
+ * Built on native radio inputs sharing a name inside a `role="radiogroup"`,
13
+ * so arrow-key navigation, a single tab stop, `:focus-visible` and native form
14
+ * participation come from the platform instead of hand-rolled key handling.
15
+ * It is form-associated like the other controls: inside a `<form>` the selected
16
+ * value is submitted under `name`, and `required` with an empty value is
17
+ * invalid.
18
+ *
19
+ * It differs from `ch-radio` in presentation only — segments in a joined track
20
+ * instead of a vertical list of radio marks — so it is meant for compact
21
+ * filters, not for long option lists.
22
+ */
23
+ export declare class ChSegmentedControl {
24
+ private readonly groupId;
25
+ private readonly labelId;
26
+ private initialValue;
27
+ internals: ElementInternals;
28
+ formDisabled: boolean;
29
+ private host;
30
+ /**
31
+ * Visible label describing the group, associated with it via
32
+ * `aria-labelledby`.
33
+ */
34
+ label?: string;
35
+ /**
36
+ * The list of options rendered as segments.
37
+ */
38
+ options: ChSegmentedControlOption[];
39
+ /**
40
+ * The value of the selected option.
41
+ */
42
+ value?: string;
43
+ /**
44
+ * The size of the segments. Either `sm` or `md`.
45
+ */
46
+ size: ChSegmentedControlSize;
47
+ /**
48
+ * The name shared by all radio inputs in the group, also used to submit the
49
+ * value. Defaults to an auto-generated group name so options are mutually
50
+ * exclusive out of the box.
51
+ */
52
+ name?: string;
53
+ /**
54
+ * Whether all segments are disabled.
55
+ */
56
+ disabled: boolean;
57
+ /**
58
+ * Whether a value is required.
59
+ */
60
+ required: boolean;
61
+ /**
62
+ * Emitted when a new option is selected, with the selected value.
63
+ */
64
+ chChange: EventEmitter<string>;
65
+ private handleChange;
66
+ protected syncForm(): void;
67
+ componentDidLoad(): void;
68
+ private markTouched;
69
+ formResetCallback(): void;
70
+ formDisabledCallback(isDisabled: boolean): void;
71
+ render(): any;
72
+ }
@@ -8,11 +8,14 @@ import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
8
  import { ChAccordionItem } from "./components/ch-accordion/ch-accordion";
9
9
  import { ChAlertVariant } from "./components/ch-alert/ch-alert";
10
10
  import { ChBadgeVariant } from "./components/ch-badge/ch-badge";
11
- import { ChButtonVariant } from "./components/ch-button/ch-button";
11
+ import { ChButtonSize, ChButtonVariant } from "./components/ch-button/ch-button";
12
12
  import { ChDividerOrientation } from "./components/ch-divider/ch-divider";
13
+ import { ChDrawerSide } from "./components/ch-drawer/ch-drawer";
13
14
  import { ChEmojiSize } from "./components/ch-emoji/ch-emoji";
14
15
  import { ChLinkVariant } from "./components/ch-link/ch-link";
16
+ import { ChModalSize } from "./components/ch-modal/ch-modal";
15
17
  import { ChRadioOption } from "./components/ch-radio/ch-radio";
18
+ import { ChSegmentedControlOption, ChSegmentedControlSize } from "./components/ch-segmented-control/ch-segmented-control";
16
19
  import { ChSelectOption } from "./components/ch-select/ch-select";
17
20
  import { ChSpinnerSize } from "./components/ch-spinner/ch-spinner";
18
21
  import { ChTab } from "./components/ch-tabs/ch-tabs";
@@ -20,11 +23,14 @@ import { ChTooltipPlacement } from "./components/ch-tooltip/ch-tooltip";
20
23
  export { ChAccordionItem } from "./components/ch-accordion/ch-accordion";
21
24
  export { ChAlertVariant } from "./components/ch-alert/ch-alert";
22
25
  export { ChBadgeVariant } from "./components/ch-badge/ch-badge";
23
- export { ChButtonVariant } from "./components/ch-button/ch-button";
26
+ export { ChButtonSize, ChButtonVariant } from "./components/ch-button/ch-button";
24
27
  export { ChDividerOrientation } from "./components/ch-divider/ch-divider";
28
+ export { ChDrawerSide } from "./components/ch-drawer/ch-drawer";
25
29
  export { ChEmojiSize } from "./components/ch-emoji/ch-emoji";
26
30
  export { ChLinkVariant } from "./components/ch-link/ch-link";
31
+ export { ChModalSize } from "./components/ch-modal/ch-modal";
27
32
  export { ChRadioOption } from "./components/ch-radio/ch-radio";
33
+ export { ChSegmentedControlOption, ChSegmentedControlSize } from "./components/ch-segmented-control/ch-segmented-control";
28
34
  export { ChSelectOption } from "./components/ch-select/ch-select";
29
35
  export { ChSpinnerSize } from "./components/ch-spinner/ch-spinner";
30
36
  export { ChTab } from "./components/ch-tabs/ch-tabs";
@@ -74,11 +80,29 @@ export namespace Components {
74
80
  */
75
81
  "disabled": boolean;
76
82
  /**
77
- * Accessible label set as `aria-label` on the native `<button>`. Use it when the button's content doesn't convey its purpose on its own (e.g. an icon-only button).
83
+ * When set, the button renders as an `<a>` pointing to this URL while keeping the button styling.
84
+ */
85
+ "href"?: string;
86
+ /**
87
+ * Accessible label set as `aria-label` on the native element. Use it when the button's content doesn't convey its purpose on its own (e.g. an icon-only button).
78
88
  */
79
89
  "label"?: string;
80
90
  /**
81
- * The visual style of the button. Either `primary` or `secondary`.
91
+ * Whether the button is loading. Shows a spinner, disables interaction, and announces the busy state with `aria-busy`.
92
+ * @default false
93
+ */
94
+ "loading": boolean;
95
+ /**
96
+ * The size of the button. One of `sm`, `md`, or `lg`.
97
+ * @default 'md'
98
+ */
99
+ "size": ChButtonSize;
100
+ /**
101
+ * The browsing context the link opens in (e.g. `_blank`). Only used when `href` is set. For `_blank`, a `noopener noreferrer` `rel` is added automatically.
102
+ */
103
+ "target"?: string;
104
+ /**
105
+ * The visual style of the button. One of `primary`, `secondary`, `ghost`, or `danger`.
82
106
  * @default 'primary'
83
107
  */
84
108
  "variant": ChButtonVariant;
@@ -135,6 +159,37 @@ export namespace Components {
135
159
  */
136
160
  "orientation": ChDividerOrientation;
137
161
  }
162
+ /**
163
+ * Sliding side panel for navigation, editing forms and quick detail views.
164
+ * Built on the native `<dialog>` element and opened with `showModal()`, exactly
165
+ * like `ch-modal`, so the browser owns focus management, the inert background,
166
+ * `Escape`, the top layer, `::backdrop`, and the implicit `dialog` role with
167
+ * `aria-modal="true"`. The only differences are placement — anchored to one
168
+ * edge instead of centred — and the longer content it is meant for, which is
169
+ * why it exposes `header` and `footer` slots around a scrollable body.
170
+ * Scroll locking is shared with `ch-modal` through `utils/scroll-lock`, so a
171
+ * drawer and a modal opened together cannot unlock the page early.
172
+ */
173
+ interface ChDrawer {
174
+ /**
175
+ * Accessible label for the close button, set as `aria-label`. Setting it is what adds the button: its only content is a decorative glyph, so without a label it would have no accessible name.
176
+ */
177
+ "closeLabel"?: string;
178
+ /**
179
+ * Accessible name for the drawer, set as `aria-label`. A slotted heading cannot be referenced with `aria-labelledby` across the shadow boundary, so the name comes through this prop — and a modal dialog needs one, so pass the same text as the heading.
180
+ */
181
+ "label"?: string;
182
+ /**
183
+ * Whether the drawer is open. Kept in sync when the user closes it with `Escape`, the close button or a click outside.
184
+ * @default false
185
+ */
186
+ "open": boolean;
187
+ /**
188
+ * The edge the panel slides in from. `start`/`end` follow the writing direction, so `start` is the left edge in LTR and the right edge in RTL.
189
+ * @default 'end'
190
+ */
191
+ "side": ChDrawerSide;
192
+ }
138
193
  /**
139
194
  * Inline emoji from the devsChile CDN.
140
195
  * Given a name (or alias from the emoji map), the component resolves the
@@ -253,6 +308,11 @@ export namespace Components {
253
308
  * @default false
254
309
  */
255
310
  "open": boolean;
311
+ /**
312
+ * The maximum width of the dialog. One of `sm` (24rem), `md` (32rem), or `lg` (48rem). The `--ch-modal-width` custom property overrides it for a width none of the three cover. Either way the dialog never exceeds the viewport.
313
+ * @default 'md'
314
+ */
315
+ "size": ChModalSize;
256
316
  }
257
317
  interface ChRadio {
258
318
  /**
@@ -296,6 +356,53 @@ export namespace Components {
296
356
  */
297
357
  "value"?: string;
298
358
  }
359
+ /**
360
+ * Compact control for switching between a few mutually exclusive options
361
+ * (all/in/out, movement type, and similar filters).
362
+ * Built on native radio inputs sharing a name inside a `role="radiogroup"`,
363
+ * so arrow-key navigation, a single tab stop, `:focus-visible` and native form
364
+ * participation come from the platform instead of hand-rolled key handling.
365
+ * It is form-associated like the other controls: inside a `<form>` the selected
366
+ * value is submitted under `name`, and `required` with an empty value is
367
+ * invalid.
368
+ * It differs from `ch-radio` in presentation only — segments in a joined track
369
+ * instead of a vertical list of radio marks — so it is meant for compact
370
+ * filters, not for long option lists.
371
+ */
372
+ interface ChSegmentedControl {
373
+ /**
374
+ * Whether all segments are disabled.
375
+ * @default false
376
+ */
377
+ "disabled": boolean;
378
+ /**
379
+ * Visible label describing the group, associated with it via `aria-labelledby`.
380
+ */
381
+ "label"?: string;
382
+ /**
383
+ * The name shared by all radio inputs in the group, also used to submit the value. Defaults to an auto-generated group name so options are mutually exclusive out of the box.
384
+ */
385
+ "name"?: string;
386
+ /**
387
+ * The list of options rendered as segments.
388
+ * @default []
389
+ */
390
+ "options": ChSegmentedControlOption[];
391
+ /**
392
+ * Whether a value is required.
393
+ * @default false
394
+ */
395
+ "required": boolean;
396
+ /**
397
+ * The size of the segments. Either `sm` or `md`.
398
+ * @default 'md'
399
+ */
400
+ "size": ChSegmentedControlSize;
401
+ /**
402
+ * The value of the selected option.
403
+ */
404
+ "value"?: string;
405
+ }
299
406
  interface ChSelect {
300
407
  /**
301
408
  * Whether the select is disabled.
@@ -503,6 +610,10 @@ export interface ChCheckboxCustomEvent<T> extends CustomEvent<T> {
503
610
  detail: T;
504
611
  target: HTMLChCheckboxElement;
505
612
  }
613
+ export interface ChDrawerCustomEvent<T> extends CustomEvent<T> {
614
+ detail: T;
615
+ target: HTMLChDrawerElement;
616
+ }
506
617
  export interface ChInputCustomEvent<T> extends CustomEvent<T> {
507
618
  detail: T;
508
619
  target: HTMLChInputElement;
@@ -519,6 +630,10 @@ export interface ChRadioCustomEvent<T> extends CustomEvent<T> {
519
630
  detail: T;
520
631
  target: HTMLChRadioElement;
521
632
  }
633
+ export interface ChSegmentedControlCustomEvent<T> extends CustomEvent<T> {
634
+ detail: T;
635
+ target: HTMLChSegmentedControlElement;
636
+ }
522
637
  export interface ChSelectCustomEvent<T> extends CustomEvent<T> {
523
638
  detail: T;
524
639
  target: HTMLChSelectElement;
@@ -630,6 +745,35 @@ declare global {
630
745
  prototype: HTMLChDividerElement;
631
746
  new (): HTMLChDividerElement;
632
747
  };
748
+ interface HTMLChDrawerElementEventMap {
749
+ "chOpen": void;
750
+ "chClose": void;
751
+ }
752
+ /**
753
+ * Sliding side panel for navigation, editing forms and quick detail views.
754
+ * Built on the native `<dialog>` element and opened with `showModal()`, exactly
755
+ * like `ch-modal`, so the browser owns focus management, the inert background,
756
+ * `Escape`, the top layer, `::backdrop`, and the implicit `dialog` role with
757
+ * `aria-modal="true"`. The only differences are placement — anchored to one
758
+ * edge instead of centred — and the longer content it is meant for, which is
759
+ * why it exposes `header` and `footer` slots around a scrollable body.
760
+ * Scroll locking is shared with `ch-modal` through `utils/scroll-lock`, so a
761
+ * drawer and a modal opened together cannot unlock the page early.
762
+ */
763
+ interface HTMLChDrawerElement extends Components.ChDrawer, HTMLStencilElement {
764
+ addEventListener<K extends keyof HTMLChDrawerElementEventMap>(type: K, listener: (this: HTMLChDrawerElement, ev: ChDrawerCustomEvent<HTMLChDrawerElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
765
+ addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
766
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
767
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
768
+ removeEventListener<K extends keyof HTMLChDrawerElementEventMap>(type: K, listener: (this: HTMLChDrawerElement, ev: ChDrawerCustomEvent<HTMLChDrawerElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
769
+ removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
770
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
771
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
772
+ }
773
+ var HTMLChDrawerElement: {
774
+ prototype: HTMLChDrawerElement;
775
+ new (): HTMLChDrawerElement;
776
+ };
633
777
  /**
634
778
  * Inline emoji from the devsChile CDN.
635
779
  * Given a name (or alias from the emoji map), the component resolves the
@@ -728,6 +872,36 @@ declare global {
728
872
  prototype: HTMLChRadioElement;
729
873
  new (): HTMLChRadioElement;
730
874
  };
875
+ interface HTMLChSegmentedControlElementEventMap {
876
+ "chChange": string;
877
+ }
878
+ /**
879
+ * Compact control for switching between a few mutually exclusive options
880
+ * (all/in/out, movement type, and similar filters).
881
+ * Built on native radio inputs sharing a name inside a `role="radiogroup"`,
882
+ * so arrow-key navigation, a single tab stop, `:focus-visible` and native form
883
+ * participation come from the platform instead of hand-rolled key handling.
884
+ * It is form-associated like the other controls: inside a `<form>` the selected
885
+ * value is submitted under `name`, and `required` with an empty value is
886
+ * invalid.
887
+ * It differs from `ch-radio` in presentation only — segments in a joined track
888
+ * instead of a vertical list of radio marks — so it is meant for compact
889
+ * filters, not for long option lists.
890
+ */
891
+ interface HTMLChSegmentedControlElement extends Components.ChSegmentedControl, HTMLStencilElement {
892
+ addEventListener<K extends keyof HTMLChSegmentedControlElementEventMap>(type: K, listener: (this: HTMLChSegmentedControlElement, ev: ChSegmentedControlCustomEvent<HTMLChSegmentedControlElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
893
+ addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
894
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
895
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
896
+ removeEventListener<K extends keyof HTMLChSegmentedControlElementEventMap>(type: K, listener: (this: HTMLChSegmentedControlElement, ev: ChSegmentedControlCustomEvent<HTMLChSegmentedControlElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
897
+ removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
898
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
899
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
900
+ }
901
+ var HTMLChSegmentedControlElement: {
902
+ prototype: HTMLChSegmentedControlElement;
903
+ new (): HTMLChSegmentedControlElement;
904
+ };
731
905
  interface HTMLChSelectElementEventMap {
732
906
  "chChange": string;
733
907
  }
@@ -838,11 +1012,13 @@ declare global {
838
1012
  "ch-card": HTMLChCardElement;
839
1013
  "ch-checkbox": HTMLChCheckboxElement;
840
1014
  "ch-divider": HTMLChDividerElement;
1015
+ "ch-drawer": HTMLChDrawerElement;
841
1016
  "ch-emoji": HTMLChEmojiElement;
842
1017
  "ch-input": HTMLChInputElement;
843
1018
  "ch-link": HTMLChLinkElement;
844
1019
  "ch-modal": HTMLChModalElement;
845
1020
  "ch-radio": HTMLChRadioElement;
1021
+ "ch-segmented-control": HTMLChSegmentedControlElement;
846
1022
  "ch-select": HTMLChSelectElement;
847
1023
  "ch-spinner": HTMLChSpinnerElement;
848
1024
  "ch-switch": HTMLChSwitchElement;
@@ -906,15 +1082,33 @@ declare namespace LocalJSX {
906
1082
  */
907
1083
  "disabled"?: boolean;
908
1084
  /**
909
- * Accessible label set as `aria-label` on the native `<button>`. Use it when the button's content doesn't convey its purpose on its own (e.g. an icon-only button).
1085
+ * When set, the button renders as an `<a>` pointing to this URL while keeping the button styling.
1086
+ */
1087
+ "href"?: string;
1088
+ /**
1089
+ * Accessible label set as `aria-label` on the native element. Use it when the button's content doesn't convey its purpose on its own (e.g. an icon-only button).
910
1090
  */
911
1091
  "label"?: string;
1092
+ /**
1093
+ * Whether the button is loading. Shows a spinner, disables interaction, and announces the busy state with `aria-busy`.
1094
+ * @default false
1095
+ */
1096
+ "loading"?: boolean;
912
1097
  /**
913
1098
  * Emitted when the button is clicked.
914
1099
  */
915
1100
  "onChClick"?: (event: ChButtonCustomEvent<MouseEvent>) => void;
916
1101
  /**
917
- * The visual style of the button. Either `primary` or `secondary`.
1102
+ * The size of the button. One of `sm`, `md`, or `lg`.
1103
+ * @default 'md'
1104
+ */
1105
+ "size"?: ChButtonSize;
1106
+ /**
1107
+ * The browsing context the link opens in (e.g. `_blank`). Only used when `href` is set. For `_blank`, a `noopener noreferrer` `rel` is added automatically.
1108
+ */
1109
+ "target"?: string;
1110
+ /**
1111
+ * The visual style of the button. One of `primary`, `secondary`, `ghost`, or `danger`.
918
1112
  * @default 'primary'
919
1113
  */
920
1114
  "variant"?: ChButtonVariant;
@@ -979,6 +1173,45 @@ declare namespace LocalJSX {
979
1173
  */
980
1174
  "orientation"?: ChDividerOrientation;
981
1175
  }
1176
+ /**
1177
+ * Sliding side panel for navigation, editing forms and quick detail views.
1178
+ * Built on the native `<dialog>` element and opened with `showModal()`, exactly
1179
+ * like `ch-modal`, so the browser owns focus management, the inert background,
1180
+ * `Escape`, the top layer, `::backdrop`, and the implicit `dialog` role with
1181
+ * `aria-modal="true"`. The only differences are placement — anchored to one
1182
+ * edge instead of centred — and the longer content it is meant for, which is
1183
+ * why it exposes `header` and `footer` slots around a scrollable body.
1184
+ * Scroll locking is shared with `ch-modal` through `utils/scroll-lock`, so a
1185
+ * drawer and a modal opened together cannot unlock the page early.
1186
+ */
1187
+ interface ChDrawer {
1188
+ /**
1189
+ * Accessible label for the close button, set as `aria-label`. Setting it is what adds the button: its only content is a decorative glyph, so without a label it would have no accessible name.
1190
+ */
1191
+ "closeLabel"?: string;
1192
+ /**
1193
+ * Accessible name for the drawer, set as `aria-label`. A slotted heading cannot be referenced with `aria-labelledby` across the shadow boundary, so the name comes through this prop — and a modal dialog needs one, so pass the same text as the heading.
1194
+ */
1195
+ "label"?: string;
1196
+ /**
1197
+ * Emitted after the drawer closes, however it was closed.
1198
+ */
1199
+ "onChClose"?: (event: ChDrawerCustomEvent<void>) => void;
1200
+ /**
1201
+ * Emitted after the drawer opens.
1202
+ */
1203
+ "onChOpen"?: (event: ChDrawerCustomEvent<void>) => void;
1204
+ /**
1205
+ * Whether the drawer is open. Kept in sync when the user closes it with `Escape`, the close button or a click outside.
1206
+ * @default false
1207
+ */
1208
+ "open"?: boolean;
1209
+ /**
1210
+ * The edge the panel slides in from. `start`/`end` follow the writing direction, so `start` is the left edge in LTR and the right edge in RTL.
1211
+ * @default 'end'
1212
+ */
1213
+ "side"?: ChDrawerSide;
1214
+ }
982
1215
  /**
983
1216
  * Inline emoji from the devsChile CDN.
984
1217
  * Given a name (or alias from the emoji map), the component resolves the
@@ -1121,6 +1354,11 @@ declare namespace LocalJSX {
1121
1354
  * @default false
1122
1355
  */
1123
1356
  "open"?: boolean;
1357
+ /**
1358
+ * The maximum width of the dialog. One of `sm` (24rem), `md` (32rem), or `lg` (48rem). The `--ch-modal-width` custom property overrides it for a width none of the three cover. Either way the dialog never exceeds the viewport.
1359
+ * @default 'md'
1360
+ */
1361
+ "size"?: ChModalSize;
1124
1362
  }
1125
1363
  interface ChRadio {
1126
1364
  /**
@@ -1172,6 +1410,61 @@ declare namespace LocalJSX {
1172
1410
  */
1173
1411
  "value"?: string;
1174
1412
  }
1413
+ /**
1414
+ * Compact control for switching between a few mutually exclusive options
1415
+ * (all/in/out, movement type, and similar filters).
1416
+ * Built on native radio inputs sharing a name inside a `role="radiogroup"`,
1417
+ * so arrow-key navigation, a single tab stop, `:focus-visible` and native form
1418
+ * participation come from the platform instead of hand-rolled key handling.
1419
+ * It is form-associated like the other controls: inside a `<form>` the selected
1420
+ * value is submitted under `name`, and `required` with an empty value is
1421
+ * invalid.
1422
+ * It differs from `ch-radio` in presentation only — segments in a joined track
1423
+ * instead of a vertical list of radio marks — so it is meant for compact
1424
+ * filters, not for long option lists.
1425
+ */
1426
+ interface ChSegmentedControl {
1427
+ /**
1428
+ * Whether all segments are disabled.
1429
+ * @default false
1430
+ */
1431
+ "disabled"?: boolean;
1432
+ /**
1433
+ * The `id` of a `<form>` element to associate this element with.
1434
+ */
1435
+ "form"?: string;
1436
+ /**
1437
+ * Visible label describing the group, associated with it via `aria-labelledby`.
1438
+ */
1439
+ "label"?: string;
1440
+ /**
1441
+ * The name shared by all radio inputs in the group, also used to submit the value. Defaults to an auto-generated group name so options are mutually exclusive out of the box.
1442
+ */
1443
+ "name"?: string;
1444
+ /**
1445
+ * Emitted when a new option is selected, with the selected value.
1446
+ */
1447
+ "onChChange"?: (event: ChSegmentedControlCustomEvent<string>) => void;
1448
+ /**
1449
+ * The list of options rendered as segments.
1450
+ * @default []
1451
+ */
1452
+ "options"?: ChSegmentedControlOption[];
1453
+ /**
1454
+ * Whether a value is required.
1455
+ * @default false
1456
+ */
1457
+ "required"?: boolean;
1458
+ /**
1459
+ * The size of the segments. Either `sm` or `md`.
1460
+ * @default 'md'
1461
+ */
1462
+ "size"?: ChSegmentedControlSize;
1463
+ /**
1464
+ * The value of the selected option.
1465
+ */
1466
+ "value"?: string;
1467
+ }
1175
1468
  interface ChSelect {
1176
1469
  /**
1177
1470
  * Whether the select is disabled.
@@ -1407,7 +1700,11 @@ declare namespace LocalJSX {
1407
1700
  }
1408
1701
  interface ChButtonAttributes {
1409
1702
  "variant": ChButtonVariant;
1703
+ "size": ChButtonSize;
1410
1704
  "disabled": boolean;
1705
+ "loading": boolean;
1706
+ "href": string;
1707
+ "target": string;
1411
1708
  "label": string;
1412
1709
  }
1413
1710
  interface ChCheckboxAttributes {
@@ -1424,6 +1721,12 @@ declare namespace LocalJSX {
1424
1721
  interface ChDividerAttributes {
1425
1722
  "orientation": ChDividerOrientation;
1426
1723
  }
1724
+ interface ChDrawerAttributes {
1725
+ "open": boolean;
1726
+ "side": ChDrawerSide;
1727
+ "label": string;
1728
+ "closeLabel": string;
1729
+ }
1427
1730
  interface ChEmojiAttributes {
1428
1731
  "name": string;
1429
1732
  "alt": string;
@@ -1451,6 +1754,7 @@ declare namespace LocalJSX {
1451
1754
  "open": boolean;
1452
1755
  "label": string;
1453
1756
  "closeLabel": string;
1757
+ "size": ChModalSize;
1454
1758
  }
1455
1759
  interface ChRadioAttributes {
1456
1760
  "label": string;
@@ -1462,6 +1766,14 @@ declare namespace LocalJSX {
1462
1766
  "errorMessage": string;
1463
1767
  "invalid": boolean;
1464
1768
  }
1769
+ interface ChSegmentedControlAttributes {
1770
+ "label": string;
1771
+ "value": string;
1772
+ "size": ChSegmentedControlSize;
1773
+ "name": string;
1774
+ "disabled": boolean;
1775
+ "required": boolean;
1776
+ }
1465
1777
  interface ChSelectAttributes {
1466
1778
  "label": string;
1467
1779
  "value": string;
@@ -1516,11 +1828,13 @@ declare namespace LocalJSX {
1516
1828
  "ch-card": ChCard;
1517
1829
  "ch-checkbox": Omit<ChCheckbox, keyof ChCheckboxAttributes> & { [K in keyof ChCheckbox & keyof ChCheckboxAttributes]?: ChCheckbox[K] } & { [K in keyof ChCheckbox & keyof ChCheckboxAttributes as `attr:${K}`]?: ChCheckboxAttributes[K] } & { [K in keyof ChCheckbox & keyof ChCheckboxAttributes as `prop:${K}`]?: ChCheckbox[K] };
1518
1830
  "ch-divider": Omit<ChDivider, keyof ChDividerAttributes> & { [K in keyof ChDivider & keyof ChDividerAttributes]?: ChDivider[K] } & { [K in keyof ChDivider & keyof ChDividerAttributes as `attr:${K}`]?: ChDividerAttributes[K] } & { [K in keyof ChDivider & keyof ChDividerAttributes as `prop:${K}`]?: ChDivider[K] };
1831
+ "ch-drawer": Omit<ChDrawer, keyof ChDrawerAttributes> & { [K in keyof ChDrawer & keyof ChDrawerAttributes]?: ChDrawer[K] } & { [K in keyof ChDrawer & keyof ChDrawerAttributes as `attr:${K}`]?: ChDrawerAttributes[K] } & { [K in keyof ChDrawer & keyof ChDrawerAttributes as `prop:${K}`]?: ChDrawer[K] };
1519
1832
  "ch-emoji": Omit<ChEmoji, keyof ChEmojiAttributes> & { [K in keyof ChEmoji & keyof ChEmojiAttributes]?: ChEmoji[K] } & { [K in keyof ChEmoji & keyof ChEmojiAttributes as `attr:${K}`]?: ChEmojiAttributes[K] } & { [K in keyof ChEmoji & keyof ChEmojiAttributes as `prop:${K}`]?: ChEmoji[K] } & OneOf<"name", ChEmoji["name"], ChEmojiAttributes["name"]>;
1520
1833
  "ch-input": Omit<ChInput, keyof ChInputAttributes> & { [K in keyof ChInput & keyof ChInputAttributes]?: ChInput[K] } & { [K in keyof ChInput & keyof ChInputAttributes as `attr:${K}`]?: ChInputAttributes[K] } & { [K in keyof ChInput & keyof ChInputAttributes as `prop:${K}`]?: ChInput[K] };
1521
1834
  "ch-link": Omit<ChLink, keyof ChLinkAttributes> & { [K in keyof ChLink & keyof ChLinkAttributes]?: ChLink[K] } & { [K in keyof ChLink & keyof ChLinkAttributes as `attr:${K}`]?: ChLinkAttributes[K] } & { [K in keyof ChLink & keyof ChLinkAttributes as `prop:${K}`]?: ChLink[K] };
1522
1835
  "ch-modal": Omit<ChModal, keyof ChModalAttributes> & { [K in keyof ChModal & keyof ChModalAttributes]?: ChModal[K] } & { [K in keyof ChModal & keyof ChModalAttributes as `attr:${K}`]?: ChModalAttributes[K] } & { [K in keyof ChModal & keyof ChModalAttributes as `prop:${K}`]?: ChModal[K] };
1523
1836
  "ch-radio": Omit<ChRadio, keyof ChRadioAttributes> & { [K in keyof ChRadio & keyof ChRadioAttributes]?: ChRadio[K] } & { [K in keyof ChRadio & keyof ChRadioAttributes as `attr:${K}`]?: ChRadioAttributes[K] } & { [K in keyof ChRadio & keyof ChRadioAttributes as `prop:${K}`]?: ChRadio[K] };
1837
+ "ch-segmented-control": Omit<ChSegmentedControl, keyof ChSegmentedControlAttributes> & { [K in keyof ChSegmentedControl & keyof ChSegmentedControlAttributes]?: ChSegmentedControl[K] } & { [K in keyof ChSegmentedControl & keyof ChSegmentedControlAttributes as `attr:${K}`]?: ChSegmentedControlAttributes[K] } & { [K in keyof ChSegmentedControl & keyof ChSegmentedControlAttributes as `prop:${K}`]?: ChSegmentedControl[K] };
1524
1838
  "ch-select": Omit<ChSelect, keyof ChSelectAttributes> & { [K in keyof ChSelect & keyof ChSelectAttributes]?: ChSelect[K] } & { [K in keyof ChSelect & keyof ChSelectAttributes as `attr:${K}`]?: ChSelectAttributes[K] } & { [K in keyof ChSelect & keyof ChSelectAttributes as `prop:${K}`]?: ChSelect[K] };
1525
1839
  "ch-spinner": Omit<ChSpinner, keyof ChSpinnerAttributes> & { [K in keyof ChSpinner & keyof ChSpinnerAttributes]?: ChSpinner[K] } & { [K in keyof ChSpinner & keyof ChSpinnerAttributes as `attr:${K}`]?: ChSpinnerAttributes[K] } & { [K in keyof ChSpinner & keyof ChSpinnerAttributes as `prop:${K}`]?: ChSpinner[K] };
1526
1840
  "ch-switch": Omit<ChSwitch, keyof ChSwitchAttributes> & { [K in keyof ChSwitch & keyof ChSwitchAttributes]?: ChSwitch[K] } & { [K in keyof ChSwitch & keyof ChSwitchAttributes as `attr:${K}`]?: ChSwitchAttributes[K] } & { [K in keyof ChSwitch & keyof ChSwitchAttributes as `prop:${K}`]?: ChSwitch[K] };
@@ -1548,6 +1862,18 @@ declare module "@stencil/core" {
1548
1862
  "ch-card": LocalJSX.IntrinsicElements["ch-card"] & JSXBase.HTMLAttributes<HTMLChCardElement>;
1549
1863
  "ch-checkbox": LocalJSX.IntrinsicElements["ch-checkbox"] & JSXBase.HTMLAttributes<HTMLChCheckboxElement>;
1550
1864
  "ch-divider": LocalJSX.IntrinsicElements["ch-divider"] & JSXBase.HTMLAttributes<HTMLChDividerElement>;
1865
+ /**
1866
+ * Sliding side panel for navigation, editing forms and quick detail views.
1867
+ * Built on the native `<dialog>` element and opened with `showModal()`, exactly
1868
+ * like `ch-modal`, so the browser owns focus management, the inert background,
1869
+ * `Escape`, the top layer, `::backdrop`, and the implicit `dialog` role with
1870
+ * `aria-modal="true"`. The only differences are placement — anchored to one
1871
+ * edge instead of centred — and the longer content it is meant for, which is
1872
+ * why it exposes `header` and `footer` slots around a scrollable body.
1873
+ * Scroll locking is shared with `ch-modal` through `utils/scroll-lock`, so a
1874
+ * drawer and a modal opened together cannot unlock the page early.
1875
+ */
1876
+ "ch-drawer": LocalJSX.IntrinsicElements["ch-drawer"] & JSXBase.HTMLAttributes<HTMLChDrawerElement>;
1551
1877
  /**
1552
1878
  * Inline emoji from the devsChile CDN.
1553
1879
  * Given a name (or alias from the emoji map), the component resolves the
@@ -1575,6 +1901,20 @@ declare module "@stencil/core" {
1575
1901
  */
1576
1902
  "ch-modal": LocalJSX.IntrinsicElements["ch-modal"] & JSXBase.HTMLAttributes<HTMLChModalElement>;
1577
1903
  "ch-radio": LocalJSX.IntrinsicElements["ch-radio"] & JSXBase.HTMLAttributes<HTMLChRadioElement>;
1904
+ /**
1905
+ * Compact control for switching between a few mutually exclusive options
1906
+ * (all/in/out, movement type, and similar filters).
1907
+ * Built on native radio inputs sharing a name inside a `role="radiogroup"`,
1908
+ * so arrow-key navigation, a single tab stop, `:focus-visible` and native form
1909
+ * participation come from the platform instead of hand-rolled key handling.
1910
+ * It is form-associated like the other controls: inside a `<form>` the selected
1911
+ * value is submitted under `name`, and `required` with an empty value is
1912
+ * invalid.
1913
+ * It differs from `ch-radio` in presentation only — segments in a joined track
1914
+ * instead of a vertical list of radio marks — so it is meant for compact
1915
+ * filters, not for long option lists.
1916
+ */
1917
+ "ch-segmented-control": LocalJSX.IntrinsicElements["ch-segmented-control"] & JSXBase.HTMLAttributes<HTMLChSegmentedControlElement>;
1578
1918
  "ch-select": LocalJSX.IntrinsicElements["ch-select"] & JSXBase.HTMLAttributes<HTMLChSelectElement>;
1579
1919
  /**
1580
1920
  * Loading indicator.
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Prevents the page behind an overlay from scrolling, compensating for the
3
+ * scrollbar it removes so the layout does not shift.
4
+ *
5
+ * Reference-counted on a module-level counter, so concurrent overlays (a modal
6
+ * over a drawer, several stacked dialogs) cannot unlock the page early:
7
+ * whichever overlay closes first only decrements the count, and the last one
8
+ * restores the original styles.
9
+ *
10
+ * Callers must pair every `lockScroll()` with exactly one `unlockScroll()`.
11
+ */
12
+ export declare function lockScroll(): void;
13
+ /**
14
+ * Releases one scroll lock. Only the last lock restores the page; earlier calls
15
+ * are a no-op so the overlay still open keeps the page frozen.
16
+ */
17
+ export declare function unlockScroll(): void;