@devschile/chucao 1.6.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -12
- package/dist/chucao/chucao.css +1 -1
- package/dist/chucao/chucao.esm.js +1 -1
- package/dist/chucao/chucao.esm.js.map +1 -1
- package/dist/chucao/index.esm.js +1 -1
- package/dist/chucao/index.esm.js.map +1 -1
- package/dist/chucao/{p-175aee94.entry.js → p-13ab5f9a.entry.js} +2 -2
- package/dist/chucao/{p-dde82d7d.entry.js → p-1cc7042e.entry.js} +2 -2
- package/dist/chucao/p-23c5220b.entry.js +2 -0
- package/dist/chucao/p-23c5220b.entry.js.map +1 -0
- package/dist/chucao/p-2d7e81b2.entry.js +2 -0
- package/dist/chucao/p-2d7e81b2.entry.js.map +1 -0
- package/dist/chucao/{p-af2c57b5.entry.js → p-421cda05.entry.js} +2 -2
- package/dist/chucao/p-Bvah_WQV.js +3 -0
- package/dist/chucao/p-Bvah_WQV.js.map +1 -0
- package/dist/chucao/{p-d75eeeea.entry.js → p-c16b18b7.entry.js} +2 -2
- package/dist/chucao/p-cbb2b478.entry.js +2 -0
- package/dist/chucao/p-cbb2b478.entry.js.map +1 -0
- package/dist/chucao/{p-fcc70c8d.entry.js → p-cfb6db53.entry.js} +2 -2
- package/dist/chucao/p-df73f786.entry.js +2 -0
- package/dist/chucao/{p-85a49fd7.entry.js → p-e8fe65bb.entry.js} +2 -2
- package/dist/cjs/ch-accordion.cjs.entry.js +1 -1
- package/dist/cjs/{ch-badge_6.cjs.entry.js → ch-alert_8.cjs.entry.js} +73 -9
- package/dist/cjs/ch-alert_8.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/ch-divider.cjs.entry.js +2 -2
- package/dist/cjs/ch-link.cjs.entry.js +1 -1
- package/dist/cjs/ch-modal.cjs.entry.js +167 -0
- package/dist/cjs/ch-modal.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-radio.cjs.entry.js +2 -2
- package/dist/cjs/ch-tabs.cjs.entry.js +2 -2
- package/dist/cjs/ch-textarea.cjs.entry.js +2 -2
- package/dist/cjs/ch-tooltip.cjs.entry.js +82 -0
- package/dist/cjs/ch-tooltip.cjs.entry.js.map +1 -0
- package/dist/cjs/chucao.cjs.js +3 -3
- package/dist/cjs/chucao.cjs.js.map +1 -1
- package/dist/cjs/{index-CiYvuUBV.js → index-DMeDkSQU.js} +183 -11
- package/dist/cjs/index-DMeDkSQU.js.map +1 -0
- package/dist/cjs/index.cjs.js +12 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +5 -1
- package/dist/collection/components/ch-alert/ch-alert.css +77 -0
- package/dist/collection/components/ch-alert/ch-alert.js +118 -0
- package/dist/collection/components/ch-alert/ch-alert.js.map +1 -0
- package/dist/collection/components/ch-badge/ch-badge.js +1 -1
- package/dist/collection/components/ch-button/ch-button.js +1 -1
- package/dist/collection/components/ch-button/ch-button.js.map +1 -1
- package/dist/collection/components/ch-card/ch-card.js +1 -1
- package/dist/collection/components/ch-checkbox/ch-checkbox.js +1 -1
- package/dist/collection/components/ch-divider/ch-divider.js +1 -1
- package/dist/collection/components/ch-input/ch-input.js +1 -1
- package/dist/collection/components/ch-modal/ch-modal.css +69 -0
- package/dist/collection/components/ch-modal/ch-modal.js +278 -0
- package/dist/collection/components/ch-modal/ch-modal.js.map +1 -0
- package/dist/collection/components/ch-radio/ch-radio.js +1 -1
- package/dist/collection/components/ch-select/ch-select.js +1 -1
- package/dist/collection/components/ch-spinner/ch-spinner.css +39 -0
- package/dist/collection/components/ch-spinner/ch-spinner.js +90 -0
- package/dist/collection/components/ch-spinner/ch-spinner.js.map +1 -0
- package/dist/collection/components/ch-switch/ch-switch.js +1 -1
- package/dist/collection/components/ch-tabs/ch-tabs.js +1 -1
- package/dist/collection/components/ch-textarea/ch-textarea.js +1 -1
- package/dist/collection/components/ch-tooltip/ch-tooltip.css +100 -0
- package/dist/collection/components/ch-tooltip/ch-tooltip.js +168 -0
- package/dist/collection/components/ch-tooltip/ch-tooltip.js.map +1 -0
- package/dist/collection/tokens/tokens.js +9 -1
- package/dist/collection/tokens/tokens.js.map +1 -1
- package/dist/collection/tokens/types.js.map +1 -1
- package/dist/components/ch-accordion.js +1 -1
- package/dist/components/ch-alert.d.ts +11 -0
- package/dist/components/ch-alert.js +2 -0
- package/dist/components/ch-alert.js.map +1 -0
- package/dist/components/ch-badge.js +1 -1
- package/dist/components/ch-button.js +1 -1
- package/dist/components/ch-button.js.map +1 -1
- package/dist/components/ch-card.js +1 -1
- package/dist/components/ch-card.js.map +1 -1
- package/dist/components/ch-checkbox.js +1 -1
- package/dist/components/ch-divider.js +1 -1
- package/dist/components/ch-input.js +1 -1
- package/dist/components/ch-link.js +1 -1
- package/dist/components/ch-modal.d.ts +11 -0
- package/dist/components/ch-modal.js +2 -0
- package/dist/components/ch-modal.js.map +1 -0
- package/dist/components/ch-radio.js +1 -1
- package/dist/components/ch-select.js +1 -1
- package/dist/components/ch-spinner.d.ts +11 -0
- package/dist/components/ch-spinner.js +2 -0
- package/dist/components/ch-spinner.js.map +1 -0
- package/dist/components/ch-switch.js +1 -1
- package/dist/components/ch-tabs.js +1 -1
- package/dist/components/ch-textarea.js +1 -1
- package/dist/components/ch-tooltip.d.ts +11 -0
- package/dist/components/ch-tooltip.js +2 -0
- package/dist/components/ch-tooltip.js.map +1 -0
- package/dist/components/index.js +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/p-hyy-cLgi.js +2 -0
- package/dist/components/p-hyy-cLgi.js.map +1 -0
- package/dist/esm/ch-accordion.entry.js +1 -1
- package/dist/esm/{ch-badge_6.entry.js → ch-alert_8.entry.js} +72 -10
- package/dist/esm/ch-alert_8.entry.js.map +1 -0
- package/dist/esm/ch-checkbox.entry.js +2 -2
- package/dist/esm/ch-divider.entry.js +2 -2
- package/dist/esm/ch-link.entry.js +1 -1
- package/dist/esm/ch-modal.entry.js +165 -0
- package/dist/esm/ch-modal.entry.js.map +1 -0
- package/dist/esm/ch-radio.entry.js +2 -2
- package/dist/esm/ch-tabs.entry.js +2 -2
- package/dist/esm/ch-textarea.entry.js +2 -2
- package/dist/esm/ch-tooltip.entry.js +80 -0
- package/dist/esm/ch-tooltip.entry.js.map +1 -0
- package/dist/esm/chucao.js +4 -4
- package/dist/esm/chucao.js.map +1 -1
- package/dist/esm/{index-ImsAHlk9.js → index-Bvah_WQV.js} +183 -12
- package/dist/esm/index-Bvah_WQV.js.map +1 -0
- package/dist/esm/index.js +10 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/ch-alert/ch-alert.d.ts +34 -0
- package/dist/types/components/ch-modal/ch-modal.d.ts +67 -0
- package/dist/types/components/ch-spinner/ch-spinner.d.ts +25 -0
- package/dist/types/components/ch-tooltip/ch-tooltip.d.ts +47 -0
- package/dist/types/components.d.ts +369 -0
- package/dist/types/stencil-public-runtime.d.ts +11 -0
- package/dist/types/tokens/tokens.d.ts +8 -0
- package/dist/types/tokens/types.d.ts +3 -3
- package/dist-react/components.d.ts +18 -1
- package/dist-react/components.js +39 -0
- package/dist-react/components.ts +55 -1
- package/dist-vue/index.d.ts +4 -0
- package/dist-vue/index.js +28 -0
- package/dist-vue/index.ts +36 -0
- package/hydrate/index.js +542 -19
- package/hydrate/index.mjs +542 -19
- package/package.json +6 -2
- package/dist/chucao/p-ImsAHlk9.js +0 -3
- package/dist/chucao/p-ImsAHlk9.js.map +0 -1
- package/dist/chucao/p-b4520f1c.entry.js +0 -2
- package/dist/chucao/p-b4520f1c.entry.js.map +0 -1
- package/dist/chucao/p-fe0c9320.entry.js +0 -2
- package/dist/cjs/ch-badge_6.cjs.entry.js.map +0 -1
- package/dist/cjs/index-CiYvuUBV.js.map +0 -1
- package/dist/components/p-x4aZoujY.js +0 -2
- package/dist/components/p-x4aZoujY.js.map +0 -1
- package/dist/esm/ch-badge_6.entry.js.map +0 -1
- package/dist/esm/index-ImsAHlk9.js.map +0 -1
- /package/dist/chucao/{p-175aee94.entry.js.map → p-13ab5f9a.entry.js.map} +0 -0
- /package/dist/chucao/{p-dde82d7d.entry.js.map → p-1cc7042e.entry.js.map} +0 -0
- /package/dist/chucao/{p-af2c57b5.entry.js.map → p-421cda05.entry.js.map} +0 -0
- /package/dist/chucao/{p-d75eeeea.entry.js.map → p-c16b18b7.entry.js.map} +0 -0
- /package/dist/chucao/{p-fcc70c8d.entry.js.map → p-cfb6db53.entry.js.map} +0 -0
- /package/dist/chucao/{p-fe0c9320.entry.js.map → p-df73f786.entry.js.map} +0 -0
- /package/dist/chucao/{p-85a49fd7.entry.js.map → p-e8fe65bb.entry.js.map} +0 -0
|
@@ -6,21 +6,27 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
8
|
import { ChAccordionItem } from "./components/ch-accordion/ch-accordion";
|
|
9
|
+
import { ChAlertVariant } from "./components/ch-alert/ch-alert";
|
|
9
10
|
import { ChBadgeVariant } from "./components/ch-badge/ch-badge";
|
|
10
11
|
import { ChButtonVariant } from "./components/ch-button/ch-button";
|
|
11
12
|
import { ChDividerOrientation } from "./components/ch-divider/ch-divider";
|
|
12
13
|
import { ChLinkVariant } from "./components/ch-link/ch-link";
|
|
13
14
|
import { ChRadioOption } from "./components/ch-radio/ch-radio";
|
|
14
15
|
import { ChSelectOption } from "./components/ch-select/ch-select";
|
|
16
|
+
import { ChSpinnerSize } from "./components/ch-spinner/ch-spinner";
|
|
15
17
|
import { ChTab } from "./components/ch-tabs/ch-tabs";
|
|
18
|
+
import { ChTooltipPlacement } from "./components/ch-tooltip/ch-tooltip";
|
|
16
19
|
export { ChAccordionItem } from "./components/ch-accordion/ch-accordion";
|
|
20
|
+
export { ChAlertVariant } from "./components/ch-alert/ch-alert";
|
|
17
21
|
export { ChBadgeVariant } from "./components/ch-badge/ch-badge";
|
|
18
22
|
export { ChButtonVariant } from "./components/ch-button/ch-button";
|
|
19
23
|
export { ChDividerOrientation } from "./components/ch-divider/ch-divider";
|
|
20
24
|
export { ChLinkVariant } from "./components/ch-link/ch-link";
|
|
21
25
|
export { ChRadioOption } from "./components/ch-radio/ch-radio";
|
|
22
26
|
export { ChSelectOption } from "./components/ch-select/ch-select";
|
|
27
|
+
export { ChSpinnerSize } from "./components/ch-spinner/ch-spinner";
|
|
23
28
|
export { ChTab } from "./components/ch-tabs/ch-tabs";
|
|
29
|
+
export { ChTooltipPlacement } from "./components/ch-tooltip/ch-tooltip";
|
|
24
30
|
export namespace Components {
|
|
25
31
|
interface ChAccordion {
|
|
26
32
|
/**
|
|
@@ -33,6 +39,25 @@ export namespace Components {
|
|
|
33
39
|
*/
|
|
34
40
|
"value"?: string;
|
|
35
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Block-level status message.
|
|
44
|
+
* `warning` carries `role="alert"` and is announced assertively; `default` and
|
|
45
|
+
* `positive` use `role="status"`, since a confirmation is not urgent enough to
|
|
46
|
+
* interrupt. Both announce reliably when the alert is added to the page in
|
|
47
|
+
* response to something — an alert already present at load may not be read out,
|
|
48
|
+
* which is how live regions work rather than something this component controls.
|
|
49
|
+
*/
|
|
50
|
+
interface ChAlert {
|
|
51
|
+
/**
|
|
52
|
+
* Accessible label for the dismiss button, set as `aria-label`. Setting it is what adds the button: the button's only content is a decorative glyph, so without a label it would have no accessible name at all.
|
|
53
|
+
*/
|
|
54
|
+
"dismissLabel"?: string;
|
|
55
|
+
/**
|
|
56
|
+
* The kind of message. `default` is neutral, `positive` confirms, and `warning` covers both warnings and errors — the token scale has a single status colour for the two of them.
|
|
57
|
+
* @default 'default'
|
|
58
|
+
*/
|
|
59
|
+
"variant": ChAlertVariant;
|
|
60
|
+
}
|
|
36
61
|
interface ChBadge {
|
|
37
62
|
/**
|
|
38
63
|
* The visual style of the badge. Either `default`, `positive`, or `warning`.
|
|
@@ -175,6 +200,37 @@ export namespace Components {
|
|
|
175
200
|
*/
|
|
176
201
|
"variant": ChLinkVariant;
|
|
177
202
|
}
|
|
203
|
+
/**
|
|
204
|
+
* Modal dialog, built on the native `<dialog>` element and opened with
|
|
205
|
+
* `showModal()`.
|
|
206
|
+
* The browser therefore supplies the parts that are easy to get wrong: moving
|
|
207
|
+
* focus into the dialog and returning it afterwards, marking the rest of the
|
|
208
|
+
* document inert, `Escape` to close, the top layer, `::backdrop`, and the
|
|
209
|
+
* implicit `dialog` role with `aria-modal="true"`. Notably it does not trap
|
|
210
|
+
* focus, which is deliberate — the W3C APA group concluded a modal should let
|
|
211
|
+
* keyboard users reach browser UI, so a hand-rolled trap would be less
|
|
212
|
+
* correct, not more.
|
|
213
|
+
* What the platform does not cover, and this component adds: locking the page
|
|
214
|
+
* behind the dialog so it cannot scroll, and closing when the backdrop is
|
|
215
|
+
* clicked. The latter is `closedby="any"` in the platform, which Safari does
|
|
216
|
+
* not support yet, so it is implemented here for every browser alike rather
|
|
217
|
+
* than only for some.
|
|
218
|
+
*/
|
|
219
|
+
interface ChModal {
|
|
220
|
+
/**
|
|
221
|
+
* 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.
|
|
222
|
+
*/
|
|
223
|
+
"closeLabel"?: string;
|
|
224
|
+
/**
|
|
225
|
+
* Accessible name for the dialog, 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.
|
|
226
|
+
*/
|
|
227
|
+
"label"?: string;
|
|
228
|
+
/**
|
|
229
|
+
* Whether the dialog is open. Kept in sync when the user closes it with `Escape`, the close button or a click outside.
|
|
230
|
+
* @default false
|
|
231
|
+
*/
|
|
232
|
+
"open": boolean;
|
|
233
|
+
}
|
|
178
234
|
interface ChRadio {
|
|
179
235
|
/**
|
|
180
236
|
* Whether all radios in the group are disabled.
|
|
@@ -263,6 +319,24 @@ export namespace Components {
|
|
|
263
319
|
*/
|
|
264
320
|
"value"?: string;
|
|
265
321
|
}
|
|
322
|
+
/**
|
|
323
|
+
* Loading indicator.
|
|
324
|
+
* The spinner is drawn in `currentColor`, so it takes the surrounding text
|
|
325
|
+
* colour and stays legible on any surface — inside a primary `ch-button` it
|
|
326
|
+
* picks up the button's own text colour instead of the accent, which would be
|
|
327
|
+
* invisible there. Set `color` on or above the element to change it.
|
|
328
|
+
*/
|
|
329
|
+
interface ChSpinner {
|
|
330
|
+
/**
|
|
331
|
+
* Accessible label announced while the spinner is visible, e.g. `Cargando resultados`. When omitted the spinner is treated as decorative and hidden from assistive technology — the right behaviour next to visible loading text, which would otherwise be announced twice.
|
|
332
|
+
*/
|
|
333
|
+
"label"?: string;
|
|
334
|
+
/**
|
|
335
|
+
* The size of the spinner. Either `sm`, `md`, or `lg`. Each size sets a font-size and the spinner is drawn in `em`, so it also scales with an inherited font-size.
|
|
336
|
+
* @default 'md'
|
|
337
|
+
*/
|
|
338
|
+
"size": ChSpinnerSize;
|
|
339
|
+
}
|
|
266
340
|
interface ChSwitch {
|
|
267
341
|
/**
|
|
268
342
|
* Whether the switch is on.
|
|
@@ -368,11 +442,36 @@ export namespace Components {
|
|
|
368
442
|
*/
|
|
369
443
|
"value": string;
|
|
370
444
|
}
|
|
445
|
+
/**
|
|
446
|
+
* Short help text shown on hover and on focus.
|
|
447
|
+
* Both the trigger and the text come from the consumer's light DOM through
|
|
448
|
+
* named slots. That is what makes the accessible association work: an
|
|
449
|
+
* `aria-describedby` IDREF only resolves within a single tree, and slotted
|
|
450
|
+
* nodes stay in the document tree even though they render inside the shadow
|
|
451
|
+
* root. Keeping the text in the shadow root instead would need a reference
|
|
452
|
+
* pointing into a shadow tree, which the platform does not allow — element
|
|
453
|
+
* reflection only points outwards, and `referenceTarget` is not available yet.
|
|
454
|
+
* The trigger has to be a natively focusable element (`<button>`, `<a>`,
|
|
455
|
+
* `<input>`). A chucao component such as `ch-button` will not be described,
|
|
456
|
+
* because `aria-*` set on a custom element host does not reach the native
|
|
457
|
+
* element inside it — see the discussion in issue #47.
|
|
458
|
+
*/
|
|
459
|
+
interface ChTooltip {
|
|
460
|
+
/**
|
|
461
|
+
* Which side of the trigger the bubble is placed on.
|
|
462
|
+
* @default 'top'
|
|
463
|
+
*/
|
|
464
|
+
"placement": ChTooltipPlacement;
|
|
465
|
+
}
|
|
371
466
|
}
|
|
372
467
|
export interface ChAccordionCustomEvent<T> extends CustomEvent<T> {
|
|
373
468
|
detail: T;
|
|
374
469
|
target: HTMLChAccordionElement;
|
|
375
470
|
}
|
|
471
|
+
export interface ChAlertCustomEvent<T> extends CustomEvent<T> {
|
|
472
|
+
detail: T;
|
|
473
|
+
target: HTMLChAlertElement;
|
|
474
|
+
}
|
|
376
475
|
export interface ChButtonCustomEvent<T> extends CustomEvent<T> {
|
|
377
476
|
detail: T;
|
|
378
477
|
target: HTMLChButtonElement;
|
|
@@ -389,6 +488,10 @@ export interface ChLinkCustomEvent<T> extends CustomEvent<T> {
|
|
|
389
488
|
detail: T;
|
|
390
489
|
target: HTMLChLinkElement;
|
|
391
490
|
}
|
|
491
|
+
export interface ChModalCustomEvent<T> extends CustomEvent<T> {
|
|
492
|
+
detail: T;
|
|
493
|
+
target: HTMLChModalElement;
|
|
494
|
+
}
|
|
392
495
|
export interface ChRadioCustomEvent<T> extends CustomEvent<T> {
|
|
393
496
|
detail: T;
|
|
394
497
|
target: HTMLChRadioElement;
|
|
@@ -427,6 +530,31 @@ declare global {
|
|
|
427
530
|
prototype: HTMLChAccordionElement;
|
|
428
531
|
new (): HTMLChAccordionElement;
|
|
429
532
|
};
|
|
533
|
+
interface HTMLChAlertElementEventMap {
|
|
534
|
+
"chDismiss": void;
|
|
535
|
+
}
|
|
536
|
+
/**
|
|
537
|
+
* Block-level status message.
|
|
538
|
+
* `warning` carries `role="alert"` and is announced assertively; `default` and
|
|
539
|
+
* `positive` use `role="status"`, since a confirmation is not urgent enough to
|
|
540
|
+
* interrupt. Both announce reliably when the alert is added to the page in
|
|
541
|
+
* response to something — an alert already present at load may not be read out,
|
|
542
|
+
* which is how live regions work rather than something this component controls.
|
|
543
|
+
*/
|
|
544
|
+
interface HTMLChAlertElement extends Components.ChAlert, HTMLStencilElement {
|
|
545
|
+
addEventListener<K extends keyof HTMLChAlertElementEventMap>(type: K, listener: (this: HTMLChAlertElement, ev: ChAlertCustomEvent<HTMLChAlertElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
546
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
547
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
548
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
549
|
+
removeEventListener<K extends keyof HTMLChAlertElementEventMap>(type: K, listener: (this: HTMLChAlertElement, ev: ChAlertCustomEvent<HTMLChAlertElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
550
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
551
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
552
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
553
|
+
}
|
|
554
|
+
var HTMLChAlertElement: {
|
|
555
|
+
prototype: HTMLChAlertElement;
|
|
556
|
+
new (): HTMLChAlertElement;
|
|
557
|
+
};
|
|
430
558
|
interface HTMLChBadgeElement extends Components.ChBadge, HTMLStencilElement {
|
|
431
559
|
}
|
|
432
560
|
var HTMLChBadgeElement: {
|
|
@@ -514,6 +642,40 @@ declare global {
|
|
|
514
642
|
prototype: HTMLChLinkElement;
|
|
515
643
|
new (): HTMLChLinkElement;
|
|
516
644
|
};
|
|
645
|
+
interface HTMLChModalElementEventMap {
|
|
646
|
+
"chOpen": void;
|
|
647
|
+
"chClose": void;
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
650
|
+
* Modal dialog, built on the native `<dialog>` element and opened with
|
|
651
|
+
* `showModal()`.
|
|
652
|
+
* The browser therefore supplies the parts that are easy to get wrong: moving
|
|
653
|
+
* focus into the dialog and returning it afterwards, marking the rest of the
|
|
654
|
+
* document inert, `Escape` to close, the top layer, `::backdrop`, and the
|
|
655
|
+
* implicit `dialog` role with `aria-modal="true"`. Notably it does not trap
|
|
656
|
+
* focus, which is deliberate — the W3C APA group concluded a modal should let
|
|
657
|
+
* keyboard users reach browser UI, so a hand-rolled trap would be less
|
|
658
|
+
* correct, not more.
|
|
659
|
+
* What the platform does not cover, and this component adds: locking the page
|
|
660
|
+
* behind the dialog so it cannot scroll, and closing when the backdrop is
|
|
661
|
+
* clicked. The latter is `closedby="any"` in the platform, which Safari does
|
|
662
|
+
* not support yet, so it is implemented here for every browser alike rather
|
|
663
|
+
* than only for some.
|
|
664
|
+
*/
|
|
665
|
+
interface HTMLChModalElement extends Components.ChModal, HTMLStencilElement {
|
|
666
|
+
addEventListener<K extends keyof HTMLChModalElementEventMap>(type: K, listener: (this: HTMLChModalElement, ev: ChModalCustomEvent<HTMLChModalElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
667
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
668
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
669
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
670
|
+
removeEventListener<K extends keyof HTMLChModalElementEventMap>(type: K, listener: (this: HTMLChModalElement, ev: ChModalCustomEvent<HTMLChModalElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
671
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
672
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
673
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
674
|
+
}
|
|
675
|
+
var HTMLChModalElement: {
|
|
676
|
+
prototype: HTMLChModalElement;
|
|
677
|
+
new (): HTMLChModalElement;
|
|
678
|
+
};
|
|
517
679
|
interface HTMLChRadioElementEventMap {
|
|
518
680
|
"chChange": string;
|
|
519
681
|
}
|
|
@@ -548,6 +710,19 @@ declare global {
|
|
|
548
710
|
prototype: HTMLChSelectElement;
|
|
549
711
|
new (): HTMLChSelectElement;
|
|
550
712
|
};
|
|
713
|
+
/**
|
|
714
|
+
* Loading indicator.
|
|
715
|
+
* The spinner is drawn in `currentColor`, so it takes the surrounding text
|
|
716
|
+
* colour and stays legible on any surface — inside a primary `ch-button` it
|
|
717
|
+
* picks up the button's own text colour instead of the accent, which would be
|
|
718
|
+
* invisible there. Set `color` on or above the element to change it.
|
|
719
|
+
*/
|
|
720
|
+
interface HTMLChSpinnerElement extends Components.ChSpinner, HTMLStencilElement {
|
|
721
|
+
}
|
|
722
|
+
var HTMLChSpinnerElement: {
|
|
723
|
+
prototype: HTMLChSpinnerElement;
|
|
724
|
+
new (): HTMLChSpinnerElement;
|
|
725
|
+
};
|
|
551
726
|
interface HTMLChSwitchElementEventMap {
|
|
552
727
|
"chChange": boolean;
|
|
553
728
|
}
|
|
@@ -600,8 +775,29 @@ declare global {
|
|
|
600
775
|
prototype: HTMLChTextareaElement;
|
|
601
776
|
new (): HTMLChTextareaElement;
|
|
602
777
|
};
|
|
778
|
+
/**
|
|
779
|
+
* Short help text shown on hover and on focus.
|
|
780
|
+
* Both the trigger and the text come from the consumer's light DOM through
|
|
781
|
+
* named slots. That is what makes the accessible association work: an
|
|
782
|
+
* `aria-describedby` IDREF only resolves within a single tree, and slotted
|
|
783
|
+
* nodes stay in the document tree even though they render inside the shadow
|
|
784
|
+
* root. Keeping the text in the shadow root instead would need a reference
|
|
785
|
+
* pointing into a shadow tree, which the platform does not allow — element
|
|
786
|
+
* reflection only points outwards, and `referenceTarget` is not available yet.
|
|
787
|
+
* The trigger has to be a natively focusable element (`<button>`, `<a>`,
|
|
788
|
+
* `<input>`). A chucao component such as `ch-button` will not be described,
|
|
789
|
+
* because `aria-*` set on a custom element host does not reach the native
|
|
790
|
+
* element inside it — see the discussion in issue #47.
|
|
791
|
+
*/
|
|
792
|
+
interface HTMLChTooltipElement extends Components.ChTooltip, HTMLStencilElement {
|
|
793
|
+
}
|
|
794
|
+
var HTMLChTooltipElement: {
|
|
795
|
+
prototype: HTMLChTooltipElement;
|
|
796
|
+
new (): HTMLChTooltipElement;
|
|
797
|
+
};
|
|
603
798
|
interface HTMLElementTagNameMap {
|
|
604
799
|
"ch-accordion": HTMLChAccordionElement;
|
|
800
|
+
"ch-alert": HTMLChAlertElement;
|
|
605
801
|
"ch-badge": HTMLChBadgeElement;
|
|
606
802
|
"ch-button": HTMLChButtonElement;
|
|
607
803
|
"ch-card": HTMLChCardElement;
|
|
@@ -609,11 +805,14 @@ declare global {
|
|
|
609
805
|
"ch-divider": HTMLChDividerElement;
|
|
610
806
|
"ch-input": HTMLChInputElement;
|
|
611
807
|
"ch-link": HTMLChLinkElement;
|
|
808
|
+
"ch-modal": HTMLChModalElement;
|
|
612
809
|
"ch-radio": HTMLChRadioElement;
|
|
613
810
|
"ch-select": HTMLChSelectElement;
|
|
811
|
+
"ch-spinner": HTMLChSpinnerElement;
|
|
614
812
|
"ch-switch": HTMLChSwitchElement;
|
|
615
813
|
"ch-tabs": HTMLChTabsElement;
|
|
616
814
|
"ch-textarea": HTMLChTextareaElement;
|
|
815
|
+
"ch-tooltip": HTMLChTooltipElement;
|
|
617
816
|
}
|
|
618
817
|
}
|
|
619
818
|
declare namespace LocalJSX {
|
|
@@ -632,6 +831,29 @@ declare namespace LocalJSX {
|
|
|
632
831
|
*/
|
|
633
832
|
"value"?: string;
|
|
634
833
|
}
|
|
834
|
+
/**
|
|
835
|
+
* Block-level status message.
|
|
836
|
+
* `warning` carries `role="alert"` and is announced assertively; `default` and
|
|
837
|
+
* `positive` use `role="status"`, since a confirmation is not urgent enough to
|
|
838
|
+
* interrupt. Both announce reliably when the alert is added to the page in
|
|
839
|
+
* response to something — an alert already present at load may not be read out,
|
|
840
|
+
* which is how live regions work rather than something this component controls.
|
|
841
|
+
*/
|
|
842
|
+
interface ChAlert {
|
|
843
|
+
/**
|
|
844
|
+
* Accessible label for the dismiss button, set as `aria-label`. Setting it is what adds the button: the button's only content is a decorative glyph, so without a label it would have no accessible name at all.
|
|
845
|
+
*/
|
|
846
|
+
"dismissLabel"?: string;
|
|
847
|
+
/**
|
|
848
|
+
* Emitted when the dismiss button is clicked. The alert stays in the DOM — whether to remove it is the consumer's decision. If you do remove it, move focus somewhere sensible first: removing the focused button drops focus to `<body>`.
|
|
849
|
+
*/
|
|
850
|
+
"onChDismiss"?: (event: ChAlertCustomEvent<void>) => void;
|
|
851
|
+
/**
|
|
852
|
+
* The kind of message. `default` is neutral, `positive` confirms, and `warning` covers both warnings and errors — the token scale has a single status colour for the two of them.
|
|
853
|
+
* @default 'default'
|
|
854
|
+
*/
|
|
855
|
+
"variant"?: ChAlertVariant;
|
|
856
|
+
}
|
|
635
857
|
interface ChBadge {
|
|
636
858
|
/**
|
|
637
859
|
* The visual style of the badge. Either `default`, `positive`, or `warning`.
|
|
@@ -794,6 +1016,45 @@ declare namespace LocalJSX {
|
|
|
794
1016
|
*/
|
|
795
1017
|
"variant"?: ChLinkVariant;
|
|
796
1018
|
}
|
|
1019
|
+
/**
|
|
1020
|
+
* Modal dialog, built on the native `<dialog>` element and opened with
|
|
1021
|
+
* `showModal()`.
|
|
1022
|
+
* The browser therefore supplies the parts that are easy to get wrong: moving
|
|
1023
|
+
* focus into the dialog and returning it afterwards, marking the rest of the
|
|
1024
|
+
* document inert, `Escape` to close, the top layer, `::backdrop`, and the
|
|
1025
|
+
* implicit `dialog` role with `aria-modal="true"`. Notably it does not trap
|
|
1026
|
+
* focus, which is deliberate — the W3C APA group concluded a modal should let
|
|
1027
|
+
* keyboard users reach browser UI, so a hand-rolled trap would be less
|
|
1028
|
+
* correct, not more.
|
|
1029
|
+
* What the platform does not cover, and this component adds: locking the page
|
|
1030
|
+
* behind the dialog so it cannot scroll, and closing when the backdrop is
|
|
1031
|
+
* clicked. The latter is `closedby="any"` in the platform, which Safari does
|
|
1032
|
+
* not support yet, so it is implemented here for every browser alike rather
|
|
1033
|
+
* than only for some.
|
|
1034
|
+
*/
|
|
1035
|
+
interface ChModal {
|
|
1036
|
+
/**
|
|
1037
|
+
* 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.
|
|
1038
|
+
*/
|
|
1039
|
+
"closeLabel"?: string;
|
|
1040
|
+
/**
|
|
1041
|
+
* Accessible name for the dialog, 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.
|
|
1042
|
+
*/
|
|
1043
|
+
"label"?: string;
|
|
1044
|
+
/**
|
|
1045
|
+
* Emitted after the dialog closes, however it was closed.
|
|
1046
|
+
*/
|
|
1047
|
+
"onChClose"?: (event: ChModalCustomEvent<void>) => void;
|
|
1048
|
+
/**
|
|
1049
|
+
* Emitted after the dialog opens.
|
|
1050
|
+
*/
|
|
1051
|
+
"onChOpen"?: (event: ChModalCustomEvent<void>) => void;
|
|
1052
|
+
/**
|
|
1053
|
+
* Whether the dialog is open. Kept in sync when the user closes it with `Escape`, the close button or a click outside.
|
|
1054
|
+
* @default false
|
|
1055
|
+
*/
|
|
1056
|
+
"open"?: boolean;
|
|
1057
|
+
}
|
|
797
1058
|
interface ChRadio {
|
|
798
1059
|
/**
|
|
799
1060
|
* Whether all radios in the group are disabled.
|
|
@@ -890,6 +1151,24 @@ declare namespace LocalJSX {
|
|
|
890
1151
|
*/
|
|
891
1152
|
"value"?: string;
|
|
892
1153
|
}
|
|
1154
|
+
/**
|
|
1155
|
+
* Loading indicator.
|
|
1156
|
+
* The spinner is drawn in `currentColor`, so it takes the surrounding text
|
|
1157
|
+
* colour and stays legible on any surface — inside a primary `ch-button` it
|
|
1158
|
+
* picks up the button's own text colour instead of the accent, which would be
|
|
1159
|
+
* invisible there. Set `color` on or above the element to change it.
|
|
1160
|
+
*/
|
|
1161
|
+
interface ChSpinner {
|
|
1162
|
+
/**
|
|
1163
|
+
* Accessible label announced while the spinner is visible, e.g. `Cargando resultados`. When omitted the spinner is treated as decorative and hidden from assistive technology — the right behaviour next to visible loading text, which would otherwise be announced twice.
|
|
1164
|
+
*/
|
|
1165
|
+
"label"?: string;
|
|
1166
|
+
/**
|
|
1167
|
+
* The size of the spinner. Either `sm`, `md`, or `lg`. Each size sets a font-size and the spinner is drawn in `em`, so it also scales with an inherited font-size.
|
|
1168
|
+
* @default 'md'
|
|
1169
|
+
*/
|
|
1170
|
+
"size"?: ChSpinnerSize;
|
|
1171
|
+
}
|
|
893
1172
|
interface ChSwitch {
|
|
894
1173
|
/**
|
|
895
1174
|
* Whether the switch is on.
|
|
@@ -1011,10 +1290,35 @@ declare namespace LocalJSX {
|
|
|
1011
1290
|
*/
|
|
1012
1291
|
"value"?: string;
|
|
1013
1292
|
}
|
|
1293
|
+
/**
|
|
1294
|
+
* Short help text shown on hover and on focus.
|
|
1295
|
+
* Both the trigger and the text come from the consumer's light DOM through
|
|
1296
|
+
* named slots. That is what makes the accessible association work: an
|
|
1297
|
+
* `aria-describedby` IDREF only resolves within a single tree, and slotted
|
|
1298
|
+
* nodes stay in the document tree even though they render inside the shadow
|
|
1299
|
+
* root. Keeping the text in the shadow root instead would need a reference
|
|
1300
|
+
* pointing into a shadow tree, which the platform does not allow — element
|
|
1301
|
+
* reflection only points outwards, and `referenceTarget` is not available yet.
|
|
1302
|
+
* The trigger has to be a natively focusable element (`<button>`, `<a>`,
|
|
1303
|
+
* `<input>`). A chucao component such as `ch-button` will not be described,
|
|
1304
|
+
* because `aria-*` set on a custom element host does not reach the native
|
|
1305
|
+
* element inside it — see the discussion in issue #47.
|
|
1306
|
+
*/
|
|
1307
|
+
interface ChTooltip {
|
|
1308
|
+
/**
|
|
1309
|
+
* Which side of the trigger the bubble is placed on.
|
|
1310
|
+
* @default 'top'
|
|
1311
|
+
*/
|
|
1312
|
+
"placement"?: ChTooltipPlacement;
|
|
1313
|
+
}
|
|
1014
1314
|
|
|
1015
1315
|
interface ChAccordionAttributes {
|
|
1016
1316
|
"value": string;
|
|
1017
1317
|
}
|
|
1318
|
+
interface ChAlertAttributes {
|
|
1319
|
+
"variant": ChAlertVariant;
|
|
1320
|
+
"dismissLabel": string;
|
|
1321
|
+
}
|
|
1018
1322
|
interface ChBadgeAttributes {
|
|
1019
1323
|
"variant": ChBadgeVariant;
|
|
1020
1324
|
}
|
|
@@ -1055,6 +1359,11 @@ declare namespace LocalJSX {
|
|
|
1055
1359
|
"variant": ChLinkVariant;
|
|
1056
1360
|
"disabled": boolean;
|
|
1057
1361
|
}
|
|
1362
|
+
interface ChModalAttributes {
|
|
1363
|
+
"open": boolean;
|
|
1364
|
+
"label": string;
|
|
1365
|
+
"closeLabel": string;
|
|
1366
|
+
}
|
|
1058
1367
|
interface ChRadioAttributes {
|
|
1059
1368
|
"label": string;
|
|
1060
1369
|
"value": string;
|
|
@@ -1076,6 +1385,10 @@ declare namespace LocalJSX {
|
|
|
1076
1385
|
"errorMessage": string;
|
|
1077
1386
|
"invalid": boolean;
|
|
1078
1387
|
}
|
|
1388
|
+
interface ChSpinnerAttributes {
|
|
1389
|
+
"size": ChSpinnerSize;
|
|
1390
|
+
"label": string;
|
|
1391
|
+
}
|
|
1079
1392
|
interface ChSwitchAttributes {
|
|
1080
1393
|
"label": string;
|
|
1081
1394
|
"name": string;
|
|
@@ -1103,9 +1416,13 @@ declare namespace LocalJSX {
|
|
|
1103
1416
|
"errorMessage": string;
|
|
1104
1417
|
"invalid": boolean;
|
|
1105
1418
|
}
|
|
1419
|
+
interface ChTooltipAttributes {
|
|
1420
|
+
"placement": ChTooltipPlacement;
|
|
1421
|
+
}
|
|
1106
1422
|
|
|
1107
1423
|
interface IntrinsicElements {
|
|
1108
1424
|
"ch-accordion": Omit<ChAccordion, keyof ChAccordionAttributes> & { [K in keyof ChAccordion & keyof ChAccordionAttributes]?: ChAccordion[K] } & { [K in keyof ChAccordion & keyof ChAccordionAttributes as `attr:${K}`]?: ChAccordionAttributes[K] } & { [K in keyof ChAccordion & keyof ChAccordionAttributes as `prop:${K}`]?: ChAccordion[K] };
|
|
1425
|
+
"ch-alert": Omit<ChAlert, keyof ChAlertAttributes> & { [K in keyof ChAlert & keyof ChAlertAttributes]?: ChAlert[K] } & { [K in keyof ChAlert & keyof ChAlertAttributes as `attr:${K}`]?: ChAlertAttributes[K] } & { [K in keyof ChAlert & keyof ChAlertAttributes as `prop:${K}`]?: ChAlert[K] };
|
|
1109
1426
|
"ch-badge": Omit<ChBadge, keyof ChBadgeAttributes> & { [K in keyof ChBadge & keyof ChBadgeAttributes]?: ChBadge[K] } & { [K in keyof ChBadge & keyof ChBadgeAttributes as `attr:${K}`]?: ChBadgeAttributes[K] } & { [K in keyof ChBadge & keyof ChBadgeAttributes as `prop:${K}`]?: ChBadge[K] };
|
|
1110
1427
|
"ch-button": Omit<ChButton, keyof ChButtonAttributes> & { [K in keyof ChButton & keyof ChButtonAttributes]?: ChButton[K] } & { [K in keyof ChButton & keyof ChButtonAttributes as `attr:${K}`]?: ChButtonAttributes[K] } & { [K in keyof ChButton & keyof ChButtonAttributes as `prop:${K}`]?: ChButton[K] };
|
|
1111
1428
|
"ch-card": ChCard;
|
|
@@ -1113,11 +1430,14 @@ declare namespace LocalJSX {
|
|
|
1113
1430
|
"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] };
|
|
1114
1431
|
"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] };
|
|
1115
1432
|
"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] };
|
|
1433
|
+
"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] };
|
|
1116
1434
|
"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] };
|
|
1117
1435
|
"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] };
|
|
1436
|
+
"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] };
|
|
1118
1437
|
"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] };
|
|
1119
1438
|
"ch-tabs": Omit<ChTabs, keyof ChTabsAttributes> & { [K in keyof ChTabs & keyof ChTabsAttributes]?: ChTabs[K] } & { [K in keyof ChTabs & keyof ChTabsAttributes as `attr:${K}`]?: ChTabsAttributes[K] } & { [K in keyof ChTabs & keyof ChTabsAttributes as `prop:${K}`]?: ChTabs[K] };
|
|
1120
1439
|
"ch-textarea": Omit<ChTextarea, keyof ChTextareaAttributes> & { [K in keyof ChTextarea & keyof ChTextareaAttributes]?: ChTextarea[K] } & { [K in keyof ChTextarea & keyof ChTextareaAttributes as `attr:${K}`]?: ChTextareaAttributes[K] } & { [K in keyof ChTextarea & keyof ChTextareaAttributes as `prop:${K}`]?: ChTextarea[K] };
|
|
1440
|
+
"ch-tooltip": Omit<ChTooltip, keyof ChTooltipAttributes> & { [K in keyof ChTooltip & keyof ChTooltipAttributes]?: ChTooltip[K] } & { [K in keyof ChTooltip & keyof ChTooltipAttributes as `attr:${K}`]?: ChTooltipAttributes[K] } & { [K in keyof ChTooltip & keyof ChTooltipAttributes as `prop:${K}`]?: ChTooltip[K] };
|
|
1121
1441
|
}
|
|
1122
1442
|
}
|
|
1123
1443
|
export { LocalJSX as JSX };
|
|
@@ -1125,6 +1445,15 @@ declare module "@stencil/core" {
|
|
|
1125
1445
|
export namespace JSX {
|
|
1126
1446
|
interface IntrinsicElements {
|
|
1127
1447
|
"ch-accordion": LocalJSX.IntrinsicElements["ch-accordion"] & JSXBase.HTMLAttributes<HTMLChAccordionElement>;
|
|
1448
|
+
/**
|
|
1449
|
+
* Block-level status message.
|
|
1450
|
+
* `warning` carries `role="alert"` and is announced assertively; `default` and
|
|
1451
|
+
* `positive` use `role="status"`, since a confirmation is not urgent enough to
|
|
1452
|
+
* interrupt. Both announce reliably when the alert is added to the page in
|
|
1453
|
+
* response to something — an alert already present at load may not be read out,
|
|
1454
|
+
* which is how live regions work rather than something this component controls.
|
|
1455
|
+
*/
|
|
1456
|
+
"ch-alert": LocalJSX.IntrinsicElements["ch-alert"] & JSXBase.HTMLAttributes<HTMLChAlertElement>;
|
|
1128
1457
|
"ch-badge": LocalJSX.IntrinsicElements["ch-badge"] & JSXBase.HTMLAttributes<HTMLChBadgeElement>;
|
|
1129
1458
|
"ch-button": LocalJSX.IntrinsicElements["ch-button"] & JSXBase.HTMLAttributes<HTMLChButtonElement>;
|
|
1130
1459
|
"ch-card": LocalJSX.IntrinsicElements["ch-card"] & JSXBase.HTMLAttributes<HTMLChCardElement>;
|
|
@@ -1132,11 +1461,51 @@ declare module "@stencil/core" {
|
|
|
1132
1461
|
"ch-divider": LocalJSX.IntrinsicElements["ch-divider"] & JSXBase.HTMLAttributes<HTMLChDividerElement>;
|
|
1133
1462
|
"ch-input": LocalJSX.IntrinsicElements["ch-input"] & JSXBase.HTMLAttributes<HTMLChInputElement>;
|
|
1134
1463
|
"ch-link": LocalJSX.IntrinsicElements["ch-link"] & JSXBase.HTMLAttributes<HTMLChLinkElement>;
|
|
1464
|
+
/**
|
|
1465
|
+
* Modal dialog, built on the native `<dialog>` element and opened with
|
|
1466
|
+
* `showModal()`.
|
|
1467
|
+
* The browser therefore supplies the parts that are easy to get wrong: moving
|
|
1468
|
+
* focus into the dialog and returning it afterwards, marking the rest of the
|
|
1469
|
+
* document inert, `Escape` to close, the top layer, `::backdrop`, and the
|
|
1470
|
+
* implicit `dialog` role with `aria-modal="true"`. Notably it does not trap
|
|
1471
|
+
* focus, which is deliberate — the W3C APA group concluded a modal should let
|
|
1472
|
+
* keyboard users reach browser UI, so a hand-rolled trap would be less
|
|
1473
|
+
* correct, not more.
|
|
1474
|
+
* What the platform does not cover, and this component adds: locking the page
|
|
1475
|
+
* behind the dialog so it cannot scroll, and closing when the backdrop is
|
|
1476
|
+
* clicked. The latter is `closedby="any"` in the platform, which Safari does
|
|
1477
|
+
* not support yet, so it is implemented here for every browser alike rather
|
|
1478
|
+
* than only for some.
|
|
1479
|
+
*/
|
|
1480
|
+
"ch-modal": LocalJSX.IntrinsicElements["ch-modal"] & JSXBase.HTMLAttributes<HTMLChModalElement>;
|
|
1135
1481
|
"ch-radio": LocalJSX.IntrinsicElements["ch-radio"] & JSXBase.HTMLAttributes<HTMLChRadioElement>;
|
|
1136
1482
|
"ch-select": LocalJSX.IntrinsicElements["ch-select"] & JSXBase.HTMLAttributes<HTMLChSelectElement>;
|
|
1483
|
+
/**
|
|
1484
|
+
* Loading indicator.
|
|
1485
|
+
* The spinner is drawn in `currentColor`, so it takes the surrounding text
|
|
1486
|
+
* colour and stays legible on any surface — inside a primary `ch-button` it
|
|
1487
|
+
* picks up the button's own text colour instead of the accent, which would be
|
|
1488
|
+
* invisible there. Set `color` on or above the element to change it.
|
|
1489
|
+
*/
|
|
1490
|
+
"ch-spinner": LocalJSX.IntrinsicElements["ch-spinner"] & JSXBase.HTMLAttributes<HTMLChSpinnerElement>;
|
|
1137
1491
|
"ch-switch": LocalJSX.IntrinsicElements["ch-switch"] & JSXBase.HTMLAttributes<HTMLChSwitchElement>;
|
|
1138
1492
|
"ch-tabs": LocalJSX.IntrinsicElements["ch-tabs"] & JSXBase.HTMLAttributes<HTMLChTabsElement>;
|
|
1139
1493
|
"ch-textarea": LocalJSX.IntrinsicElements["ch-textarea"] & JSXBase.HTMLAttributes<HTMLChTextareaElement>;
|
|
1494
|
+
/**
|
|
1495
|
+
* Short help text shown on hover and on focus.
|
|
1496
|
+
* Both the trigger and the text come from the consumer's light DOM through
|
|
1497
|
+
* named slots. That is what makes the accessible association work: an
|
|
1498
|
+
* `aria-describedby` IDREF only resolves within a single tree, and slotted
|
|
1499
|
+
* nodes stay in the document tree even though they render inside the shadow
|
|
1500
|
+
* root. Keeping the text in the shadow root instead would need a reference
|
|
1501
|
+
* pointing into a shadow tree, which the platform does not allow — element
|
|
1502
|
+
* reflection only points outwards, and `referenceTarget` is not available yet.
|
|
1503
|
+
* The trigger has to be a natively focusable element (`<button>`, `<a>`,
|
|
1504
|
+
* `<input>`). A chucao component such as `ch-button` will not be described,
|
|
1505
|
+
* because `aria-*` set on a custom element host does not reach the native
|
|
1506
|
+
* element inside it — see the discussion in issue #47.
|
|
1507
|
+
*/
|
|
1508
|
+
"ch-tooltip": LocalJSX.IntrinsicElements["ch-tooltip"] & JSXBase.HTMLAttributes<HTMLChTooltipElement>;
|
|
1140
1509
|
}
|
|
1141
1510
|
}
|
|
1142
1511
|
}
|
|
@@ -1008,6 +1008,7 @@ export declare namespace JSXBase {
|
|
|
1008
1008
|
onClose?: (event: Event) => void;
|
|
1009
1009
|
open?: boolean;
|
|
1010
1010
|
returnValue?: string;
|
|
1011
|
+
closedby?: 'any' | 'closerequest' | 'none';
|
|
1011
1012
|
}
|
|
1012
1013
|
interface EmbedHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
1013
1014
|
height?: number | string;
|
|
@@ -1045,6 +1046,8 @@ export declare namespace JSXBase {
|
|
|
1045
1046
|
allowtransparency?: string | boolean;
|
|
1046
1047
|
frameBorder?: number | string;
|
|
1047
1048
|
frameborder?: number | string;
|
|
1049
|
+
fetchPriority?: 'high' | 'low' | 'auto';
|
|
1050
|
+
fetchpriority?: 'high' | 'low' | 'auto';
|
|
1048
1051
|
importance?: 'low' | 'auto' | 'high';
|
|
1049
1052
|
height?: number | string;
|
|
1050
1053
|
loading?: 'lazy' | 'auto' | 'eager';
|
|
@@ -1067,6 +1070,8 @@ export declare namespace JSXBase {
|
|
|
1067
1070
|
crossOrigin?: string;
|
|
1068
1071
|
crossorigin?: string;
|
|
1069
1072
|
decoding?: 'async' | 'auto' | 'sync';
|
|
1073
|
+
fetchPriority?: 'high' | 'low' | 'auto';
|
|
1074
|
+
fetchpriority?: 'high' | 'low' | 'auto';
|
|
1070
1075
|
importance?: 'low' | 'auto' | 'high';
|
|
1071
1076
|
height?: number | string;
|
|
1072
1077
|
loading?: 'lazy' | 'auto' | 'eager';
|
|
@@ -1166,6 +1171,8 @@ export declare namespace JSXBase {
|
|
|
1166
1171
|
}
|
|
1167
1172
|
interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
1168
1173
|
as?: string;
|
|
1174
|
+
fetchPriority?: 'high' | 'low' | 'auto';
|
|
1175
|
+
fetchpriority?: 'high' | 'low' | 'auto';
|
|
1169
1176
|
href?: string;
|
|
1170
1177
|
hrefLang?: string;
|
|
1171
1178
|
hreflang?: string;
|
|
@@ -1289,6 +1296,8 @@ export declare namespace JSXBase {
|
|
|
1289
1296
|
crossOrigin?: string;
|
|
1290
1297
|
crossorigin?: string;
|
|
1291
1298
|
defer?: boolean;
|
|
1299
|
+
fetchPriority?: 'high' | 'low' | 'auto';
|
|
1300
|
+
fetchpriority?: 'high' | 'low' | 'auto';
|
|
1292
1301
|
importance?: 'low' | 'auto' | 'high';
|
|
1293
1302
|
integrity?: string;
|
|
1294
1303
|
nonce?: string;
|
|
@@ -1404,7 +1413,9 @@ export declare namespace JSXBase {
|
|
|
1404
1413
|
tabIndex?: number;
|
|
1405
1414
|
tabindex?: number | string;
|
|
1406
1415
|
title?: string;
|
|
1416
|
+
translate?: 'yes' | 'no' | (string & {});
|
|
1407
1417
|
popover?: string | null;
|
|
1418
|
+
focusgroup?: string;
|
|
1408
1419
|
inputMode?: string;
|
|
1409
1420
|
inputmode?: string;
|
|
1410
1421
|
enterKeyHint?: string;
|
|
@@ -3,6 +3,7 @@ export declare const colorBackgroundTopGlow = "#201e40";
|
|
|
3
3
|
export declare const colorBackgroundBottomGlow = "#261226";
|
|
4
4
|
export declare const colorSurfaceDefault = "rgba(32, 30, 64, 0.6)";
|
|
5
5
|
export declare const colorSurfaceHover = "rgba(45, 212, 191, 0.08)";
|
|
6
|
+
export declare const colorScrimDefault = "rgba(0, 0, 0, 0.6)";
|
|
6
7
|
export declare const colorBorderDefault = "rgba(255, 255, 255, 0.08)";
|
|
7
8
|
export declare const colorBorderHover = "rgba(45, 212, 191, 0.3)";
|
|
8
9
|
export declare const colorAccentDefault = "#2dd4bf";
|
|
@@ -51,7 +52,9 @@ export declare const shadowCardHover = "0 4px 20px rgba(45, 212, 191, 0.06)";
|
|
|
51
52
|
export declare const effectBlur = "10px";
|
|
52
53
|
export declare const durationFast = "150ms";
|
|
53
54
|
export declare const durationNormal = "200ms";
|
|
55
|
+
export declare const durationSpin = "800ms";
|
|
54
56
|
export declare const easingDefault = "ease";
|
|
57
|
+
export declare const easingLinear = "linear";
|
|
55
58
|
export declare const focusOutlineWidth = "2px";
|
|
56
59
|
export declare const focusOutlineOffset = "2px";
|
|
57
60
|
export declare const opacityDisabled = 0.5;
|
|
@@ -70,6 +73,9 @@ export declare const tokens: {
|
|
|
70
73
|
readonly default: "rgba(32, 30, 64, 0.6)";
|
|
71
74
|
readonly hover: "rgba(45, 212, 191, 0.08)";
|
|
72
75
|
};
|
|
76
|
+
readonly scrim: {
|
|
77
|
+
readonly default: "rgba(0, 0, 0, 0.6)";
|
|
78
|
+
};
|
|
73
79
|
readonly border: {
|
|
74
80
|
readonly default: "rgba(255, 255, 255, 0.08)";
|
|
75
81
|
readonly hover: "rgba(45, 212, 191, 0.3)";
|
|
@@ -148,9 +154,11 @@ export declare const tokens: {
|
|
|
148
154
|
readonly duration: {
|
|
149
155
|
readonly fast: "150ms";
|
|
150
156
|
readonly normal: "200ms";
|
|
157
|
+
readonly spin: "800ms";
|
|
151
158
|
};
|
|
152
159
|
readonly easing: {
|
|
153
160
|
readonly default: "ease";
|
|
161
|
+
readonly linear: "linear";
|
|
154
162
|
};
|
|
155
163
|
readonly focus: {
|
|
156
164
|
readonly outlineWidth: "2px";
|