@devschile/chucao 1.3.0 → 1.4.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 (106) hide show
  1. package/dist/chucao/chucao.esm.js +1 -1
  2. package/dist/chucao/p-1f47dd08.entry.js +2 -0
  3. package/dist/chucao/p-1f47dd08.entry.js.map +1 -0
  4. package/dist/chucao/p-438e1401.entry.js +2 -0
  5. package/dist/chucao/p-438e1401.entry.js.map +1 -0
  6. package/dist/chucao/p-7413b8c3.entry.js +2 -0
  7. package/dist/chucao/p-7413b8c3.entry.js.map +1 -0
  8. package/dist/chucao/p-90db80a2.entry.js +2 -0
  9. package/dist/chucao/p-90db80a2.entry.js.map +1 -0
  10. package/dist/chucao/p-Bk9pvIKL.js +3 -0
  11. package/dist/chucao/p-Bk9pvIKL.js.map +1 -0
  12. package/dist/chucao/p-faa21ce0.entry.js +2 -0
  13. package/dist/chucao/p-faa21ce0.entry.js.map +1 -0
  14. package/dist/cjs/ch-badge_5.cjs.entry.js +54 -6
  15. package/dist/cjs/ch-badge_5.cjs.entry.js.map +1 -1
  16. package/dist/cjs/ch-checkbox.cjs.entry.js +80 -0
  17. package/dist/cjs/ch-checkbox.cjs.entry.js.map +1 -0
  18. package/dist/cjs/ch-radio.cjs.entry.js +83 -0
  19. package/dist/cjs/ch-radio.cjs.entry.js.map +1 -0
  20. package/dist/cjs/ch-switch.cjs.entry.js +80 -0
  21. package/dist/cjs/ch-switch.cjs.entry.js.map +1 -0
  22. package/dist/cjs/ch-textarea.cjs.entry.js +94 -0
  23. package/dist/cjs/ch-textarea.cjs.entry.js.map +1 -0
  24. package/dist/cjs/chucao.cjs.js +2 -2
  25. package/dist/cjs/{index-yB1Ik3Sa.js → index-DX3RZKi8.js} +5 -2
  26. package/dist/cjs/index-DX3RZKi8.js.map +1 -0
  27. package/dist/cjs/loader.cjs.js +2 -2
  28. package/dist/collection/collection-manifest.json +5 -1
  29. package/dist/collection/components/ch-card/ch-card.js +1 -1
  30. package/dist/collection/components/ch-checkbox/ch-checkbox.css +79 -0
  31. package/dist/collection/components/ch-checkbox/ch-checkbox.js +276 -0
  32. package/dist/collection/components/ch-checkbox/ch-checkbox.js.map +1 -0
  33. package/dist/collection/components/ch-input/ch-input.css +20 -0
  34. package/dist/collection/components/ch-input/ch-input.js +83 -1
  35. package/dist/collection/components/ch-input/ch-input.js.map +1 -1
  36. package/dist/collection/components/ch-radio/ch-radio.css +89 -0
  37. package/dist/collection/components/ch-radio/ch-radio.js +282 -0
  38. package/dist/collection/components/ch-radio/ch-radio.js.map +1 -0
  39. package/dist/collection/components/ch-select/ch-select.css +20 -0
  40. package/dist/collection/components/ch-select/ch-select.js +83 -1
  41. package/dist/collection/components/ch-select/ch-select.js.map +1 -1
  42. package/dist/collection/components/ch-switch/ch-switch.css +92 -0
  43. package/dist/collection/components/ch-switch/ch-switch.js +276 -0
  44. package/dist/collection/components/ch-switch/ch-switch.js.map +1 -0
  45. package/dist/collection/components/ch-textarea/ch-textarea.css +66 -0
  46. package/dist/collection/components/ch-textarea/ch-textarea.js +323 -0
  47. package/dist/collection/components/ch-textarea/ch-textarea.js.map +1 -0
  48. package/dist/components/ch-badge.js +1 -1
  49. package/dist/components/ch-button.js +1 -1
  50. package/dist/components/ch-card.js +1 -1
  51. package/dist/components/ch-card.js.map +1 -1
  52. package/dist/components/ch-checkbox.d.ts +11 -0
  53. package/dist/components/ch-checkbox.js +2 -0
  54. package/dist/components/ch-checkbox.js.map +1 -0
  55. package/dist/components/ch-input.js +1 -1
  56. package/dist/components/ch-input.js.map +1 -1
  57. package/dist/components/ch-radio.d.ts +11 -0
  58. package/dist/components/ch-radio.js +2 -0
  59. package/dist/components/ch-radio.js.map +1 -0
  60. package/dist/components/ch-select.js +1 -1
  61. package/dist/components/ch-select.js.map +1 -1
  62. package/dist/components/ch-switch.d.ts +11 -0
  63. package/dist/components/ch-switch.js +2 -0
  64. package/dist/components/ch-switch.js.map +1 -0
  65. package/dist/components/ch-textarea.d.ts +11 -0
  66. package/dist/components/ch-textarea.js +2 -0
  67. package/dist/components/ch-textarea.js.map +1 -0
  68. package/dist/components/index.js +1 -1
  69. package/dist/components/p-CcEsJ4Ml.js +2 -0
  70. package/dist/components/p-CcEsJ4Ml.js.map +1 -0
  71. package/dist/esm/ch-badge_5.entry.js +54 -6
  72. package/dist/esm/ch-badge_5.entry.js.map +1 -1
  73. package/dist/esm/ch-checkbox.entry.js +78 -0
  74. package/dist/esm/ch-checkbox.entry.js.map +1 -0
  75. package/dist/esm/ch-radio.entry.js +81 -0
  76. package/dist/esm/ch-radio.entry.js.map +1 -0
  77. package/dist/esm/ch-switch.entry.js +78 -0
  78. package/dist/esm/ch-switch.entry.js.map +1 -0
  79. package/dist/esm/ch-textarea.entry.js +92 -0
  80. package/dist/esm/ch-textarea.entry.js.map +1 -0
  81. package/dist/esm/chucao.js +3 -3
  82. package/dist/esm/{index-COo5t8-6.js → index-Bk9pvIKL.js} +5 -2
  83. package/dist/esm/index-Bk9pvIKL.js.map +1 -0
  84. package/dist/esm/loader.js +3 -3
  85. package/dist/types/components/ch-checkbox/ch-checkbox.d.ts +51 -0
  86. package/dist/types/components/ch-input/ch-input.d.ts +16 -0
  87. package/dist/types/components/ch-radio/ch-radio.d.ts +58 -0
  88. package/dist/types/components/ch-select/ch-select.d.ts +16 -0
  89. package/dist/types/components/ch-switch/ch-switch.d.ts +51 -0
  90. package/dist/types/components/ch-textarea/ch-textarea.d.ts +60 -0
  91. package/dist/types/components.d.ts +571 -0
  92. package/dist-react/components.d.ts +22 -1
  93. package/dist-react/components.js +39 -0
  94. package/dist-react/components.ts +55 -1
  95. package/dist-vue/index.d.ts +4 -0
  96. package/dist-vue/index.js +69 -0
  97. package/dist-vue/index.ts +77 -0
  98. package/package.json +1 -1
  99. package/dist/chucao/p-94a2b1be.entry.js +0 -2
  100. package/dist/chucao/p-94a2b1be.entry.js.map +0 -1
  101. package/dist/chucao/p-COo5t8-6.js +0 -3
  102. package/dist/chucao/p-COo5t8-6.js.map +0 -1
  103. package/dist/cjs/index-yB1Ik3Sa.js.map +0 -1
  104. package/dist/components/p-DCKzDjxR.js +0 -2
  105. package/dist/components/p-DCKzDjxR.js.map +0 -1
  106. package/dist/esm/index-COo5t8-6.js.map +0 -1
@@ -1,10 +1,10 @@
1
- import { g as globalScripts, b as bootstrapLazy } from './index-COo5t8-6.js';
2
- export { s as setNonce } from './index-COo5t8-6.js';
1
+ import { g as globalScripts, b as bootstrapLazy } from './index-Bk9pvIKL.js';
2
+ export { s as setNonce } from './index-Bk9pvIKL.js';
3
3
 
4
4
  const defineCustomElements = async (win, options) => {
5
5
  if (typeof window === 'undefined') return undefined;
6
6
  await globalScripts();
7
- return bootstrapLazy([["ch-badge_5",[[769,"ch-badge",{"variant":[1]}],[769,"ch-button",{"variant":[1],"disabled":[4],"label":[1]}],[257,"ch-card"],[513,"ch-input",{"label":[1],"type":[1],"value":[1025],"placeholder":[1],"name":[1],"disabled":[4],"required":[4]}],[513,"ch-select",{"label":[1],"options":[16],"value":[1025],"placeholder":[1],"name":[1],"disabled":[4],"required":[4]}]]]], options);
7
+ return bootstrapLazy([["ch-badge_5",[[769,"ch-badge",{"variant":[1]}],[769,"ch-button",{"variant":[1],"disabled":[4],"label":[1]}],[257,"ch-card"],[513,"ch-input",{"label":[1],"type":[1],"value":[1025],"placeholder":[1],"name":[1],"disabled":[4],"required":[4],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4]}],[513,"ch-select",{"label":[1],"options":[16],"value":[1025],"placeholder":[1],"name":[1],"disabled":[4],"required":[4],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4]}]]],["ch-checkbox",[[513,"ch-checkbox",{"label":[1],"name":[1],"value":[1],"checked":[1028],"disabled":[4],"required":[4],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4]}]]],["ch-radio",[[513,"ch-radio",{"label":[1],"options":[16],"value":[1025],"name":[1],"disabled":[4],"required":[4],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4]}]]],["ch-switch",[[513,"ch-switch",{"label":[1],"name":[1],"value":[1],"checked":[1028],"disabled":[4],"required":[4],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4]}]]],["ch-textarea",[[513,"ch-textarea",{"label":[1],"value":[1025],"placeholder":[1],"rows":[2],"name":[1],"disabled":[4],"required":[4],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4]}]]]], options);
8
8
  };
9
9
 
10
10
  export { defineCustomElements };
@@ -0,0 +1,51 @@
1
+ import { type EventEmitter } from '../../stencil-public-runtime';
2
+ export declare class ChCheckbox {
3
+ private readonly checkboxId;
4
+ private readonly hintId;
5
+ private readonly errorId;
6
+ /**
7
+ * Visible label rendered next to the checkbox, associated with it via
8
+ * `for`/`id`, so assistive technology announces the checkbox's purpose.
9
+ */
10
+ label?: string;
11
+ /**
12
+ * The name of the checkbox, submitted with form data.
13
+ */
14
+ name?: string;
15
+ /**
16
+ * The value of the checkbox, submitted with form data.
17
+ */
18
+ value: string;
19
+ /**
20
+ * Whether the checkbox is checked.
21
+ */
22
+ checked: boolean;
23
+ /**
24
+ * Whether the checkbox is disabled.
25
+ */
26
+ disabled: boolean;
27
+ /**
28
+ * Whether the checkbox is required.
29
+ */
30
+ required: boolean;
31
+ /**
32
+ * Helper text rendered below the checkbox, associated via `aria-describedby`.
33
+ * Replaced by `errorMessage` when the checkbox is invalid.
34
+ */
35
+ hint?: string;
36
+ /**
37
+ * Error message rendered below the checkbox when it is invalid.
38
+ */
39
+ errorMessage?: string;
40
+ /**
41
+ * Whether the checkbox is in an invalid state; toggles `aria-invalid` and error styling.
42
+ */
43
+ invalid: boolean;
44
+ /**
45
+ * Emitted when the checked state changes, with the new checked value.
46
+ */
47
+ chChange: EventEmitter<boolean>;
48
+ private handleChange;
49
+ private get describedBy();
50
+ render(): any;
51
+ }
@@ -1,6 +1,8 @@
1
1
  import { type EventEmitter } from '../../stencil-public-runtime';
2
2
  export declare class ChInput {
3
3
  private readonly inputId;
4
+ private readonly hintId;
5
+ private readonly errorId;
4
6
  /**
5
7
  * Visible label rendered above the input and associated with it via
6
8
  * `for`/`id`, so assistive technology announces the input's purpose.
@@ -30,6 +32,19 @@ export declare class ChInput {
30
32
  * Whether the input is required.
31
33
  */
32
34
  required: boolean;
35
+ /**
36
+ * Helper text rendered below the input, associated via `aria-describedby`.
37
+ * Replaced by `errorMessage` when the input is invalid.
38
+ */
39
+ hint?: string;
40
+ /**
41
+ * Error message rendered below the input when it is invalid.
42
+ */
43
+ errorMessage?: string;
44
+ /**
45
+ * Whether the input is in an invalid state; toggles `aria-invalid` and error styling.
46
+ */
47
+ invalid: boolean;
33
48
  /**
34
49
  * Emitted on every keystroke, with the current input value.
35
50
  */
@@ -40,5 +55,6 @@ export declare class ChInput {
40
55
  chChange: EventEmitter<string>;
41
56
  private handleInput;
42
57
  private handleChange;
58
+ private get describedBy();
43
59
  render(): any;
44
60
  }
@@ -0,0 +1,58 @@
1
+ import { type EventEmitter } from '../../stencil-public-runtime';
2
+ export interface ChRadioOption {
3
+ label: string;
4
+ value: string;
5
+ disabled?: boolean;
6
+ }
7
+ export declare class ChRadio {
8
+ private readonly groupId;
9
+ private readonly labelId;
10
+ private readonly hintId;
11
+ private readonly errorId;
12
+ /**
13
+ * Visible label describing the radio group, associated with it via
14
+ * `aria-labelledby`.
15
+ */
16
+ label?: string;
17
+ /**
18
+ * The list of options rendered as radio inputs.
19
+ */
20
+ options: ChRadioOption[];
21
+ /**
22
+ * The value of the selected option.
23
+ */
24
+ value?: string;
25
+ /**
26
+ * The name shared by all radio inputs in the group. Defaults to an
27
+ * auto-generated group name so options are mutually exclusive out of the box.
28
+ */
29
+ name?: string;
30
+ /**
31
+ * Whether all radios in the group are disabled.
32
+ */
33
+ disabled: boolean;
34
+ /**
35
+ * Whether a value is required.
36
+ */
37
+ required: boolean;
38
+ /**
39
+ * Helper text rendered below the radio group, associated via `aria-describedby`.
40
+ * Replaced by `errorMessage` when the group is invalid.
41
+ */
42
+ hint?: string;
43
+ /**
44
+ * Error message rendered below the radio group when it is invalid.
45
+ */
46
+ errorMessage?: string;
47
+ /**
48
+ * Whether the radio group is in an invalid state; toggles `aria-invalid` and error styling.
49
+ */
50
+ invalid: boolean;
51
+ /**
52
+ * Emitted when a new option is selected, with the selected value.
53
+ */
54
+ chChange: EventEmitter<string>;
55
+ private handleChange;
56
+ private get describedBy();
57
+ render(): any;
58
+ }
@@ -6,6 +6,8 @@ export interface ChSelectOption {
6
6
  }
7
7
  export declare class ChSelect {
8
8
  private readonly selectId;
9
+ private readonly hintId;
10
+ private readonly errorId;
9
11
  /**
10
12
  * Visible label rendered above the select and associated with it via
11
13
  * `for`/`id`, so assistive technology announces the select's purpose.
@@ -35,10 +37,24 @@ export declare class ChSelect {
35
37
  * Whether a value is required.
36
38
  */
37
39
  required: boolean;
40
+ /**
41
+ * Helper text rendered below the select, associated via `aria-describedby`.
42
+ * Replaced by `errorMessage` when the select is invalid.
43
+ */
44
+ hint?: string;
45
+ /**
46
+ * Error message rendered below the select when it is invalid.
47
+ */
48
+ errorMessage?: string;
49
+ /**
50
+ * Whether the select is in an invalid state; toggles `aria-invalid` and error styling.
51
+ */
52
+ invalid: boolean;
38
53
  /**
39
54
  * Emitted when the selected option changes, with the new value.
40
55
  */
41
56
  chChange: EventEmitter<string>;
42
57
  private handleChange;
58
+ private get describedBy();
43
59
  render(): any;
44
60
  }
@@ -0,0 +1,51 @@
1
+ import { type EventEmitter } from '../../stencil-public-runtime';
2
+ export declare class ChSwitch {
3
+ private readonly switchId;
4
+ private readonly hintId;
5
+ private readonly errorId;
6
+ /**
7
+ * Visible label rendered next to the switch, associated with it via
8
+ * `for`/`id`, so assistive technology announces the switch's purpose.
9
+ */
10
+ label?: string;
11
+ /**
12
+ * The name of the switch, submitted with form data.
13
+ */
14
+ name?: string;
15
+ /**
16
+ * The value of the switch, submitted with form data.
17
+ */
18
+ value: string;
19
+ /**
20
+ * Whether the switch is on.
21
+ */
22
+ checked: boolean;
23
+ /**
24
+ * Whether the switch is disabled.
25
+ */
26
+ disabled: boolean;
27
+ /**
28
+ * Whether the switch is required.
29
+ */
30
+ required: boolean;
31
+ /**
32
+ * Helper text rendered below the switch, associated via `aria-describedby`.
33
+ * Replaced by `errorMessage` when the switch is invalid.
34
+ */
35
+ hint?: string;
36
+ /**
37
+ * Error message rendered below the switch when it is invalid.
38
+ */
39
+ errorMessage?: string;
40
+ /**
41
+ * Whether the switch is in an invalid state; toggles `aria-invalid` and error styling.
42
+ */
43
+ invalid: boolean;
44
+ /**
45
+ * Emitted when the switch is toggled, with the new on/off state.
46
+ */
47
+ chChange: EventEmitter<boolean>;
48
+ private handleChange;
49
+ private get describedBy();
50
+ render(): any;
51
+ }
@@ -0,0 +1,60 @@
1
+ import { type EventEmitter } from '../../stencil-public-runtime';
2
+ export declare class ChTextarea {
3
+ private readonly textareaId;
4
+ private readonly hintId;
5
+ private readonly errorId;
6
+ /**
7
+ * Visible label rendered above the textarea and associated with it via
8
+ * `for`/`id`, so assistive technology announces the textarea's purpose.
9
+ */
10
+ label?: string;
11
+ /**
12
+ * The value of the textarea.
13
+ */
14
+ value: string;
15
+ /**
16
+ * Placeholder text shown when the textarea is empty.
17
+ */
18
+ placeholder?: string;
19
+ /**
20
+ * The number of visible rows of the textarea.
21
+ */
22
+ rows: number;
23
+ /**
24
+ * The name of the textarea, submitted with form data.
25
+ */
26
+ name?: string;
27
+ /**
28
+ * Whether the textarea is disabled.
29
+ */
30
+ disabled: boolean;
31
+ /**
32
+ * Whether the textarea is required.
33
+ */
34
+ required: boolean;
35
+ /**
36
+ * Helper text rendered below the textarea, associated via `aria-describedby`.
37
+ * Replaced by `errorMessage` when the textarea is invalid.
38
+ */
39
+ hint?: string;
40
+ /**
41
+ * Error message rendered below the textarea when it is invalid.
42
+ */
43
+ errorMessage?: string;
44
+ /**
45
+ * Whether the textarea is in an invalid state; toggles `aria-invalid` and error styling.
46
+ */
47
+ invalid: boolean;
48
+ /**
49
+ * Emitted on every keystroke, with the current textarea value.
50
+ */
51
+ chInput: EventEmitter<string>;
52
+ /**
53
+ * Emitted when the textarea value is committed (on native `change`).
54
+ */
55
+ chChange: EventEmitter<string>;
56
+ private handleInput;
57
+ private handleChange;
58
+ private get describedBy();
59
+ render(): any;
60
+ }