@haiilo/catalyst 3.0.2 → 4.1.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 (80) hide show
  1. package/dist/catalyst/catalyst.esm.js +1 -1
  2. package/dist/catalyst/catalyst.esm.js.map +1 -1
  3. package/dist/catalyst/p-8d6a31b9.entry.js +10 -0
  4. package/dist/catalyst/p-8d6a31b9.entry.js.map +1 -0
  5. package/dist/catalyst/p-919eea27.js +3 -0
  6. package/dist/catalyst/p-919eea27.js.map +1 -0
  7. package/dist/catalyst/p-ccfebe33.js.map +1 -1
  8. package/dist/cjs/cat-alert_24.cjs.entry.js +129 -28
  9. package/dist/cjs/cat-alert_24.cjs.entry.js.map +1 -1
  10. package/dist/cjs/cat-icon-registry-671af264.js.map +1 -1
  11. package/dist/cjs/catalyst.cjs.js +2 -2
  12. package/dist/cjs/{index-22e41d18.js → index-c4542095.js} +65 -4
  13. package/dist/cjs/index-c4542095.js.map +1 -0
  14. package/dist/cjs/loader.cjs.js +2 -2
  15. package/dist/collection/components/cat-button/cat-button.js +17 -2
  16. package/dist/collection/components/cat-button/cat-button.js.map +1 -1
  17. package/dist/collection/components/cat-checkbox/cat-checkbox.js +16 -1
  18. package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -1
  19. package/dist/collection/components/cat-form-hint/cat-form-hint-utils.js +13 -0
  20. package/dist/collection/components/cat-form-hint/cat-form-hint-utils.js.map +1 -0
  21. package/dist/collection/components/cat-form-hint/cat-form-hint.js +2 -1
  22. package/dist/collection/components/cat-form-hint/cat-form-hint.js.map +1 -1
  23. package/dist/collection/components/cat-i18n/cat-i18n-registry.js.map +1 -1
  24. package/dist/collection/components/cat-input/cat-input.css +244 -8
  25. package/dist/collection/components/cat-input/cat-input.js +101 -13
  26. package/dist/collection/components/cat-input/cat-input.js.map +1 -1
  27. package/dist/collection/components/cat-radio/cat-radio.js +16 -1
  28. package/dist/collection/components/cat-radio/cat-radio.js.map +1 -1
  29. package/dist/collection/components/cat-select/cat-select.css +252 -0
  30. package/dist/collection/components/cat-select/cat-select.js +95 -9
  31. package/dist/collection/components/cat-select/cat-select.js.map +1 -1
  32. package/dist/collection/components/cat-textarea/cat-textarea.css +261 -1
  33. package/dist/collection/components/cat-textarea/cat-textarea.js +102 -10
  34. package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
  35. package/dist/collection/components/cat-toggle/cat-toggle.js +16 -1
  36. package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -1
  37. package/dist/components/cat-button2.js +3 -2
  38. package/dist/components/cat-button2.js.map +1 -1
  39. package/dist/components/cat-checkbox2.js +2 -1
  40. package/dist/components/cat-checkbox2.js.map +1 -1
  41. package/dist/components/cat-form-hint-utils.js +17 -0
  42. package/dist/components/cat-form-hint-utils.js.map +1 -0
  43. package/dist/components/cat-form-hint.js +2 -1
  44. package/dist/components/cat-form-hint.js.map +1 -1
  45. package/dist/components/cat-i18n-registry.js.map +1 -1
  46. package/dist/components/cat-input.js +43 -9
  47. package/dist/components/cat-input.js.map +1 -1
  48. package/dist/components/cat-radio.js +2 -1
  49. package/dist/components/cat-radio.js.map +1 -1
  50. package/dist/components/cat-select2.js +40 -9
  51. package/dist/components/cat-select2.js.map +1 -1
  52. package/dist/components/cat-textarea.js +50 -7
  53. package/dist/components/cat-textarea.js.map +1 -1
  54. package/dist/components/cat-toggle.js +2 -1
  55. package/dist/components/cat-toggle.js.map +1 -1
  56. package/dist/esm/cat-alert_24.entry.js +129 -28
  57. package/dist/esm/cat-alert_24.entry.js.map +1 -1
  58. package/dist/esm/cat-icon-registry-d6b80490.js.map +1 -1
  59. package/dist/esm/catalyst.js +2 -2
  60. package/dist/esm/{index-7b85fb91.js → index-524906f7.js} +65 -4
  61. package/dist/esm/index-524906f7.js.map +1 -0
  62. package/dist/esm/loader.js +2 -2
  63. package/dist/types/components/cat-button/cat-button.d.ts +6 -0
  64. package/dist/types/components/cat-checkbox/cat-checkbox.d.ts +6 -0
  65. package/dist/types/components/cat-form-hint/cat-form-hint-utils.d.ts +4 -0
  66. package/dist/types/components/cat-form-hint/cat-form-hint.d.ts +1 -0
  67. package/dist/types/components/cat-i18n/cat-i18n-registry.d.ts +1 -1
  68. package/dist/types/components/cat-input/cat-input.d.ts +27 -1
  69. package/dist/types/components/cat-radio/cat-radio.d.ts +6 -0
  70. package/dist/types/components/cat-select/cat-select.d.ts +28 -2
  71. package/dist/types/components/cat-textarea/cat-textarea.d.ts +27 -1
  72. package/dist/types/components/cat-toggle/cat-toggle.d.ts +6 -0
  73. package/dist/types/components.d.ts +105 -0
  74. package/package.json +3 -2
  75. package/dist/catalyst/p-1c6eace6.js +0 -3
  76. package/dist/catalyst/p-1c6eace6.js.map +0 -1
  77. package/dist/catalyst/p-6865acc8.entry.js +0 -10
  78. package/dist/catalyst/p-6865acc8.entry.js.map +0 -1
  79. package/dist/cjs/index-22e41d18.js.map +0 -1
  80. package/dist/esm/index-7b85fb91.js.map +0 -1
@@ -1,4 +1,5 @@
1
1
  import { EventEmitter } from '../../stencil-public-runtime';
2
+ import { ErrorMap } from '../cat-form-hint/cat-form-hint-utils';
2
3
  import { InputType } from './input-type';
3
4
  /**
4
5
  * Inputs are used to allow users to provide text input when the expected input
@@ -15,8 +16,10 @@ export declare class CatInput {
15
16
  private readonly _id;
16
17
  private get id();
17
18
  private input;
19
+ private errorMapSrc?;
18
20
  hostElement: HTMLElement;
19
21
  hasSlottedLabel: boolean;
22
+ errorMap?: ErrorMap;
20
23
  /**
21
24
  * Whether the label need a marker to shown if the input is required or optional.
22
25
  */
@@ -109,6 +112,27 @@ export declare class CatInput {
109
112
  * The value of the control.
110
113
  */
111
114
  value?: string | number;
115
+ /**
116
+ * The validation errors for this input. Will render a hint under the input
117
+ * with the translated error message(s) `error.${key}`. If an object is
118
+ * passed, the keys will be used as error keys and the values translation
119
+ * parameters.
120
+ * If the value is `true`, the input will be marked as invalid without any
121
+ * hints under the input.
122
+ */
123
+ errors?: boolean | string[] | ErrorMap;
124
+ /**
125
+ * Fine-grained control over when the errors are shown. Can be `false` to
126
+ * never show errors, `true` to show errors on blur, or a number to show
127
+ * errors on change with the given delay in milliseconds.
128
+ */
129
+ errorUpdate: boolean | number;
130
+ /**
131
+ * Attributes that will be added to the native HTML input element.
132
+ */
133
+ nativeAttributes?: {
134
+ [key: string]: string;
135
+ };
112
136
  /**
113
137
  * Emitted when the value is changed.
114
138
  */
@@ -143,8 +167,10 @@ export declare class CatInput {
143
167
  * Clear the input.
144
168
  */
145
169
  clear(): Promise<void>;
170
+ watchErrorsHandler(value?: boolean | string[] | ErrorMap): void;
146
171
  render(): any;
147
- private get hintSection();
172
+ private get invalid();
173
+ private errorUpdateTimeoutId?;
148
174
  private onInput;
149
175
  private onFocus;
150
176
  private onBlur;
@@ -53,6 +53,12 @@ export declare class CatRadio {
53
53
  * Whether the label should appear to the left of the radio component.
54
54
  */
55
55
  labelLeft: boolean;
56
+ /**
57
+ * Attributes that will be added to the native HTML input element.
58
+ */
59
+ nativeAttributes?: {
60
+ [key: string]: string;
61
+ };
56
62
  /**
57
63
  * Emitted when the radio is changed.
58
64
  */
@@ -1,6 +1,7 @@
1
1
  import { Placement } from '@floating-ui/dom';
2
2
  import { EventEmitter } from '../../stencil-public-runtime';
3
3
  import { Observable } from 'rxjs';
4
+ import { ErrorMap } from '../cat-form-hint/cat-form-hint-utils';
4
5
  export interface Item {
5
6
  id: string;
6
7
  }
@@ -19,7 +20,7 @@ export interface RenderInfo {
19
20
  };
20
21
  }
21
22
  /**
22
- * @property customId - Change the id of item for the given one.
23
+ * @property customId - Change the ID of item for the given one.
23
24
  * @property resolve - Resolves the value of the select.
24
25
  * @property retrieve - Retrieves the options of the select.
25
26
  * @property render - Renders the items of the select.
@@ -72,6 +73,7 @@ export declare class CatSelect {
72
73
  private dropdown?;
73
74
  private trigger?;
74
75
  private input?;
76
+ private errorMapSrc?;
75
77
  private subscription?;
76
78
  private term$;
77
79
  private more$;
@@ -80,6 +82,7 @@ export declare class CatSelect {
80
82
  connector?: CatSelectConnector;
81
83
  state: CatSelectState;
82
84
  hasSlottedLabel: boolean;
85
+ errorMap?: ErrorMap;
83
86
  /**
84
87
  * Whether the label need a marker to shown if the select is required or optional.
85
88
  */
@@ -154,8 +157,31 @@ export declare class CatSelect {
154
157
  * The text to display in the dropdown if no results are found.
155
158
  */
156
159
  noItems?: string;
160
+ /**
161
+ * The validation errors for this input. Will render a hint under the input
162
+ * with the translated error message(s) `error.${key}`. If an object is
163
+ * passed, the keys will be used as error keys and the values translation
164
+ * parameters.
165
+ * If the value is `true`, the input will be marked as invalid without any
166
+ * hints under the input.
167
+ */
168
+ errors?: boolean | string[] | ErrorMap;
169
+ /**
170
+ * Fine-grained control over when the errors are shown. Can be `false` to
171
+ * never show errors, `true` to show errors on blur, or a number to show
172
+ * errors on change with the given delay in milliseconds.
173
+ */
174
+ errorUpdate: boolean | number;
175
+ /**
176
+ * Attributes that will be added to the native HTML input element.
177
+ */
178
+ nativeAttributes?: {
179
+ [key: string]: string;
180
+ };
157
181
  onConnectorChange(connector: CatSelectConnector): void;
158
182
  onValueChange(): void;
183
+ watchErrorsHandler(value?: boolean | string[] | ErrorMap): void;
184
+ private errorUpdateTimeoutId?;
159
185
  onStateChange(newState: CatSelectState, oldState: CatSelectState): void;
160
186
  /**
161
187
  * Emitted when the select dropdown is opened.
@@ -185,8 +211,8 @@ export declare class CatSelect {
185
211
  */
186
212
  connect(connector: CatSelectConnector): Promise<void>;
187
213
  render(): any;
214
+ private get invalid();
188
215
  private get optionsList();
189
- private get hintSection();
190
216
  private get connectorSafe();
191
217
  private resolve;
192
218
  private toSelectItems;
@@ -1,4 +1,5 @@
1
1
  import { EventEmitter } from '../../stencil-public-runtime';
2
+ import { ErrorMap } from '../cat-form-hint/cat-form-hint-utils';
2
3
  /**
3
4
  * Textarea specifies a control that allows user to write text over multiple
4
5
  * rows. Used when the expected user input is long. For shorter input, use the
@@ -12,8 +13,10 @@ export declare class CatTextarea {
12
13
  private readonly _id;
13
14
  private get id();
14
15
  private textarea;
16
+ private errorMapSrc?;
15
17
  hostElement: HTMLElement;
16
18
  hasSlottedLabel: boolean;
19
+ errorMap?: ErrorMap;
17
20
  /**
18
21
  * Whether the label need a marker to shown if the textarea is required or optional.
19
22
  */
@@ -70,6 +73,27 @@ export declare class CatTextarea {
70
73
  * The initial value of the control.
71
74
  */
72
75
  value?: string | number;
76
+ /**
77
+ * The validation errors for this input. Will render a hint under the input
78
+ * with the translated error message(s) `error.${key}`. If an object is
79
+ * passed, the keys will be used as error keys and the values translation
80
+ * parameters.
81
+ * If the value is `true`, the input will be marked as invalid without any
82
+ * hints under the input.
83
+ */
84
+ errors?: boolean | string[] | ErrorMap;
85
+ /**
86
+ * Fine-grained control over when the errors are shown. Can be `false` to
87
+ * never show errors, `true` to show errors on blur, or a number to show
88
+ * errors on change with the given delay in milliseconds.
89
+ */
90
+ errorUpdate: boolean | number;
91
+ /**
92
+ * Attributes that will be added to the native HTML textarea element.
93
+ */
94
+ nativeAttributes?: {
95
+ [key: string]: string;
96
+ };
73
97
  /**
74
98
  * Emitted when the value is changed.
75
99
  */
@@ -101,8 +125,10 @@ export declare class CatTextarea {
101
125
  * Programmatically simulate a click on the textarea.
102
126
  */
103
127
  doClick(): Promise<void>;
128
+ watchErrorsHandler(value?: boolean | string[] | ErrorMap): void;
104
129
  render(): any;
105
- private get hintSection();
130
+ private get invalid();
131
+ private errorUpdateTimeoutId?;
106
132
  private onInput;
107
133
  private onFocus;
108
134
  private onBlur;
@@ -54,6 +54,12 @@ export declare class CatToggle {
54
54
  * Whether the label should appear to the left of the toggle.
55
55
  */
56
56
  labelLeft: boolean;
57
+ /**
58
+ * Attributes that will be added to the native HTML input element.
59
+ */
60
+ nativeAttributes?: {
61
+ [key: string]: string;
62
+ };
57
63
  /**
58
64
  * Emitted when the checked status of the toggle is changed.
59
65
  */
@@ -8,6 +8,7 @@ import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
8
  import { Breakpoint } from "./utils/breakpoints";
9
9
  import { Placement } from "@floating-ui/dom";
10
10
  import { InputType } from "./components/cat-input/input-type";
11
+ import { ErrorMap } from "./components/cat-form-hint/cat-form-hint-utils";
11
12
  import { CatSelectConnector, CatSelectMultipleTaggingValue, CatSelectTaggingValue, Item } from "./components/cat-select/cat-select";
12
13
  import { Observable } from "rxjs";
13
14
  export namespace Components {
@@ -143,6 +144,10 @@ export namespace Components {
143
144
  * The name of the button, which gets paired with the button's value when submitted as part of a form. Corresponds with the native HTML name attribute.
144
145
  */
145
146
  "name"?: string;
147
+ /**
148
+ * Attributes that will be added to the native HTML button element
149
+ */
150
+ "nativeAttributes"?: { [key: string]: string };
146
151
  /**
147
152
  * Disables ellipse overflowing button content.
148
153
  */
@@ -228,6 +233,10 @@ export namespace Components {
228
233
  * The name of the input
229
234
  */
230
235
  "name"?: string;
236
+ /**
237
+ * Attributes that will be added to the native HTML input element.
238
+ */
239
+ "nativeAttributes"?: { [key: string]: string };
231
240
  /**
232
241
  * Required state of the checkbox
233
242
  */
@@ -309,6 +318,14 @@ export namespace Components {
309
318
  * @param options An optional object providing options to control aspects of the focusing process.
310
319
  */
311
320
  "doFocus": (options?: FocusOptions | undefined) => Promise<void>;
321
+ /**
322
+ * Fine-grained control over when the errors are shown. Can be `false` to never show errors, `true` to show errors on blur, or a number to show errors on change with the given delay in milliseconds.
323
+ */
324
+ "errorUpdate": boolean | number;
325
+ /**
326
+ * The validation errors for this input. Will render a hint under the input with the translated error message(s) `error.${key}`. If an object is passed, the keys will be used as error keys and the values translation parameters. If the value is `true`, the input will be marked as invalid without any hints under the input.
327
+ */
328
+ "errors"?: boolean | string[] | ErrorMap;
312
329
  /**
313
330
  * Optional hint text(s) to be displayed with the input.
314
331
  */
@@ -353,6 +370,10 @@ export namespace Components {
353
370
  * The name of the form control. Submitted with the form as part of a name/value pair.
354
371
  */
355
372
  "name"?: string;
373
+ /**
374
+ * Attributes that will be added to the native HTML input element.
375
+ */
376
+ "nativeAttributes"?: { [key: string]: string };
356
377
  /**
357
378
  * The placeholder text to display within the input.
358
379
  */
@@ -492,6 +513,10 @@ export namespace Components {
492
513
  * The name of the radio component.
493
514
  */
494
515
  "name"?: string;
516
+ /**
517
+ * Attributes that will be added to the native HTML input element.
518
+ */
519
+ "nativeAttributes"?: { [key: string]: string };
495
520
  /**
496
521
  * Whether the radio is required.
497
522
  */
@@ -571,6 +596,14 @@ export namespace Components {
571
596
  * Whether the select is disabled.
572
597
  */
573
598
  "disabled": boolean;
599
+ /**
600
+ * Fine-grained control over when the errors are shown. Can be `false` to never show errors, `true` to show errors on blur, or a number to show errors on change with the given delay in milliseconds.
601
+ */
602
+ "errorUpdate": boolean | number;
603
+ /**
604
+ * The validation errors for this input. Will render a hint under the input with the translated error message(s) `error.${key}`. If an object is passed, the keys will be used as error keys and the values translation parameters. If the value is `true`, the input will be marked as invalid without any hints under the input.
605
+ */
606
+ "errors"?: boolean | string[] | ErrorMap;
574
607
  /**
575
608
  * Optional hint text(s) to be displayed with the select.
576
609
  */
@@ -595,6 +628,10 @@ export namespace Components {
595
628
  * The name of the form control. Submitted with the form as part of a name/value pair.
596
629
  */
597
630
  "name"?: string;
631
+ /**
632
+ * Attributes that will be added to the native HTML input element.
633
+ */
634
+ "nativeAttributes"?: { [key: string]: string };
598
635
  /**
599
636
  * The text to display in the dropdown if no results are found.
600
637
  */
@@ -716,6 +753,14 @@ export namespace Components {
716
753
  * @param options An optional object providing options to control aspects of the focusing process.
717
754
  */
718
755
  "doFocus": (options?: FocusOptions | undefined) => Promise<void>;
756
+ /**
757
+ * Fine-grained control over when the errors are shown. Can be `false` to never show errors, `true` to show errors on blur, or a number to show errors on change with the given delay in milliseconds.
758
+ */
759
+ "errorUpdate": boolean | number;
760
+ /**
761
+ * The validation errors for this input. Will render a hint under the input with the translated error message(s) `error.${key}`. If an object is passed, the keys will be used as error keys and the values translation parameters. If the value is `true`, the input will be marked as invalid without any hints under the input.
762
+ */
763
+ "errors"?: boolean | string[] | ErrorMap;
719
764
  /**
720
765
  * Optional hint text(s) to be displayed with the textarea.
721
766
  */
@@ -744,6 +789,10 @@ export namespace Components {
744
789
  * The name of the form control. Submitted with the form as part of a name/value pair.
745
790
  */
746
791
  "name"?: string;
792
+ /**
793
+ * Attributes that will be added to the native HTML textarea element.
794
+ */
795
+ "nativeAttributes"?: { [key: string]: string };
747
796
  /**
748
797
  * The placeholder text to display within the input.
749
798
  */
@@ -815,6 +864,10 @@ export namespace Components {
815
864
  * The name of the input
816
865
  */
817
866
  "name"?: string;
867
+ /**
868
+ * Attributes that will be added to the native HTML input element.
869
+ */
870
+ "nativeAttributes"?: { [key: string]: string };
818
871
  /**
819
872
  * Required state of the toggle.
820
873
  */
@@ -1195,6 +1248,10 @@ declare namespace LocalJSX {
1195
1248
  * The name of the button, which gets paired with the button's value when submitted as part of a form. Corresponds with the native HTML name attribute.
1196
1249
  */
1197
1250
  "name"?: string;
1251
+ /**
1252
+ * Attributes that will be added to the native HTML button element
1253
+ */
1254
+ "nativeAttributes"?: { [key: string]: string };
1198
1255
  /**
1199
1256
  * Disables ellipse overflowing button content.
1200
1257
  */
@@ -1279,6 +1336,10 @@ declare namespace LocalJSX {
1279
1336
  * The name of the input
1280
1337
  */
1281
1338
  "name"?: string;
1339
+ /**
1340
+ * Attributes that will be added to the native HTML input element.
1341
+ */
1342
+ "nativeAttributes"?: { [key: string]: string };
1282
1343
  /**
1283
1344
  * Emitted when the checkbox loses focus.
1284
1345
  */
@@ -1359,6 +1420,14 @@ declare namespace LocalJSX {
1359
1420
  * Whether the input is disabled.
1360
1421
  */
1361
1422
  "disabled"?: boolean;
1423
+ /**
1424
+ * Fine-grained control over when the errors are shown. Can be `false` to never show errors, `true` to show errors on blur, or a number to show errors on change with the given delay in milliseconds.
1425
+ */
1426
+ "errorUpdate"?: boolean | number;
1427
+ /**
1428
+ * The validation errors for this input. Will render a hint under the input with the translated error message(s) `error.${key}`. If an object is passed, the keys will be used as error keys and the values translation parameters. If the value is `true`, the input will be marked as invalid without any hints under the input.
1429
+ */
1430
+ "errors"?: boolean | string[] | ErrorMap;
1362
1431
  /**
1363
1432
  * Optional hint text(s) to be displayed with the input.
1364
1433
  */
@@ -1403,6 +1472,10 @@ declare namespace LocalJSX {
1403
1472
  * The name of the form control. Submitted with the form as part of a name/value pair.
1404
1473
  */
1405
1474
  "name"?: string;
1475
+ /**
1476
+ * Attributes that will be added to the native HTML input element.
1477
+ */
1478
+ "nativeAttributes"?: { [key: string]: string };
1406
1479
  /**
1407
1480
  * Emitted when the input loses focus.
1408
1481
  */
@@ -1541,6 +1614,10 @@ declare namespace LocalJSX {
1541
1614
  * The name of the radio component.
1542
1615
  */
1543
1616
  "name"?: string;
1617
+ /**
1618
+ * Attributes that will be added to the native HTML input element.
1619
+ */
1620
+ "nativeAttributes"?: { [key: string]: string };
1544
1621
  /**
1545
1622
  * Emitted when the radio loses focus.
1546
1623
  */
@@ -1651,6 +1728,14 @@ declare namespace LocalJSX {
1651
1728
  * Whether the select is disabled.
1652
1729
  */
1653
1730
  "disabled"?: boolean;
1731
+ /**
1732
+ * Fine-grained control over when the errors are shown. Can be `false` to never show errors, `true` to show errors on blur, or a number to show errors on change with the given delay in milliseconds.
1733
+ */
1734
+ "errorUpdate"?: boolean | number;
1735
+ /**
1736
+ * The validation errors for this input. Will render a hint under the input with the translated error message(s) `error.${key}`. If an object is passed, the keys will be used as error keys and the values translation parameters. If the value is `true`, the input will be marked as invalid without any hints under the input.
1737
+ */
1738
+ "errors"?: boolean | string[] | ErrorMap;
1654
1739
  /**
1655
1740
  * Optional hint text(s) to be displayed with the select.
1656
1741
  */
@@ -1675,6 +1760,10 @@ declare namespace LocalJSX {
1675
1760
  * The name of the form control. Submitted with the form as part of a name/value pair.
1676
1761
  */
1677
1762
  "name"?: string;
1763
+ /**
1764
+ * Attributes that will be added to the native HTML input element.
1765
+ */
1766
+ "nativeAttributes"?: { [key: string]: string };
1678
1767
  /**
1679
1768
  * The text to display in the dropdown if no results are found.
1680
1769
  */
@@ -1803,6 +1892,14 @@ declare namespace LocalJSX {
1803
1892
  * Whether the textarea is disabled.
1804
1893
  */
1805
1894
  "disabled"?: boolean;
1895
+ /**
1896
+ * Fine-grained control over when the errors are shown. Can be `false` to never show errors, `true` to show errors on blur, or a number to show errors on change with the given delay in milliseconds.
1897
+ */
1898
+ "errorUpdate"?: boolean | number;
1899
+ /**
1900
+ * The validation errors for this input. Will render a hint under the input with the translated error message(s) `error.${key}`. If an object is passed, the keys will be used as error keys and the values translation parameters. If the value is `true`, the input will be marked as invalid without any hints under the input.
1901
+ */
1902
+ "errors"?: boolean | string[] | ErrorMap;
1806
1903
  /**
1807
1904
  * Optional hint text(s) to be displayed with the textarea.
1808
1905
  */
@@ -1831,6 +1928,10 @@ declare namespace LocalJSX {
1831
1928
  * The name of the form control. Submitted with the form as part of a name/value pair.
1832
1929
  */
1833
1930
  "name"?: string;
1931
+ /**
1932
+ * Attributes that will be added to the native HTML textarea element.
1933
+ */
1934
+ "nativeAttributes"?: { [key: string]: string };
1834
1935
  /**
1835
1936
  * Emitted when the textarea loses focus.
1836
1937
  */
@@ -1901,6 +2002,10 @@ declare namespace LocalJSX {
1901
2002
  * The name of the input
1902
2003
  */
1903
2004
  "name"?: string;
2005
+ /**
2006
+ * Attributes that will be added to the native HTML input element.
2007
+ */
2008
+ "nativeAttributes"?: { [key: string]: string };
1904
2009
  /**
1905
2010
  * Emitted when the toggle loses focus.
1906
2011
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haiilo/catalyst",
3
- "version": "3.0.2",
3
+ "version": "4.1.0",
4
4
  "description": "Catalyst Design System",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -25,6 +25,7 @@
25
25
  },
26
26
  "scripts": {
27
27
  "build": "stencil build --docs",
28
+ "build:watch": "stencil build --docs --watch",
28
29
  "build:ci": "stencil build --ci",
29
30
  "postbuild": "node replace",
30
31
  "postbuild:ci": "node replace",
@@ -45,7 +46,7 @@
45
46
  },
46
47
  "dependencies": {
47
48
  "@floating-ui/dom": "1.0.3",
48
- "@haiilo/catalyst-tokens": "3.0.2",
49
+ "@haiilo/catalyst-tokens": "4.1.0",
49
50
  "@stencil/core": "2.17.4",
50
51
  "autosize": "5.0.1",
51
52
  "autosize-input": "1.0.2",
@@ -1,3 +0,0 @@
1
- const t="catalyst";let e;let n;let s=false;let o=false;const c=typeof window!=="undefined"?window:{};const l=c.document||{head:{}};const i={t:0,o:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,s)=>t.addEventListener(e,n,s),rel:(t,e,n,s)=>t.removeEventListener(e,n,s),ce:(t,e)=>new CustomEvent(t,e)};const f=t=>Promise.resolve(t);const r=(()=>{try{new CSSStyleSheet;return typeof(new CSSStyleSheet).replaceSync==="function"}catch(t){}return false})();const u=(t,e,n,s)=>{if(n){n.map((([n,s,o])=>{const c=t;const l=a(e,o);const f=d(n);i.ael(c,s,l,f);(e.l=e.l||[]).push((()=>i.rel(c,s,l,f)))}))}};const a=(t,e)=>n=>{try{{if(t.t&256){t.i[e](n)}else{(t.u=t.u||[]).push([e,n])}}}catch(t){$t(t)}};const d=t=>(t&2)!==0;const h="{visibility:hidden}.hydrated{visibility:inherit}";const p=(t,e="")=>{{return()=>{}}};const y=(t,e)=>{{return()=>{}}};const m=new WeakMap;const b=(t,e,n)=>{let s=St.get(t);if(r&&n){s=s||new CSSStyleSheet;if(typeof s==="string"){s=e}else{s.replaceSync(e)}}else{s=e}St.set(t,s)};const $=(t,e,n,s)=>{let o=g(e);const c=St.get(o);t=t.nodeType===11?t:l;if(c){if(typeof c==="string"){t=t.head||t;let e=m.get(t);let n;if(!e){m.set(t,e=new Set)}if(!e.has(o)){{{n=l.createElement("style");n.innerHTML=c}t.insertBefore(n,t.querySelector("link"))}if(e){e.add(o)}}}else if(!t.adoptedStyleSheets.includes(c)){t.adoptedStyleSheets=[...t.adoptedStyleSheets,c]}}return o};const w=t=>{const e=t.h;const n=t.p;const s=e.t;const o=p("attachStyles",e.m);const c=$(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);if(s&10){n["s-sc"]=c;n.classList.add(c+"-h")}o()};const g=(t,e)=>"sc-"+t.m;const S={};const v="http://www.w3.org/2000/svg";const j="http://www.w3.org/1999/xhtml";const O=t=>t!=null;const k=t=>{t=typeof t;return t==="object"||t==="function"};const C=(t,e,...n)=>{let s=null;let o=false;let c=false;const l=[];const i=e=>{for(let n=0;n<e.length;n++){s=e[n];if(Array.isArray(s)){i(s)}else if(s!=null&&typeof s!=="boolean"){if(o=typeof t!=="function"&&!k(s)){s=String(s)}if(o&&c){l[l.length-1].$+=s}else{l.push(o?M(null,s):s)}c=o}}};i(n);if(e){{const t=e.className||e.class;if(t){e.class=typeof t!=="object"?t:Object.keys(t).filter((e=>t[e])).join(" ")}}}if(typeof t==="function"){return t(e===null?{}:e,l,E)}const f=M(t,null);f.g=e;if(l.length>0){f.S=l}return f};const M=(t,e)=>{const n={t:0,v:t,$:e,j:null,S:null};{n.g=null}return n};const x={};const P=t=>t&&t.v===x;const E={forEach:(t,e)=>t.map(L).forEach(e),map:(t,e)=>t.map(L).map(e).map(R)};const L=t=>({vattrs:t.g,vchildren:t.S,vkey:t.O,vname:t.k,vtag:t.v,vtext:t.$});const R=t=>{if(typeof t.vtag==="function"){const e=Object.assign({},t.vattrs);if(t.vkey){e.key=t.vkey}if(t.vname){e.name=t.vname}return C(t.vtag,e,...t.vchildren||[])}const e=M(t.vtag,t.vtext);e.g=t.vattrs;e.S=t.vchildren;e.O=t.vkey;e.k=t.vname;return e};const U=(t,e,n,s,o,l)=>{if(n!==s){let f=bt(t,e);let r=e.toLowerCase();if(e==="class"){const e=t.classList;const o=N(n);const c=N(s);e.remove(...o.filter((t=>t&&!c.includes(t))));e.add(...c.filter((t=>t&&!o.includes(t))))}else if(e==="style"){{for(const e in n){if(!s||s[e]==null){if(e.includes("-")){t.style.removeProperty(e)}else{t.style[e]=""}}}}for(const e in s){if(!n||s[e]!==n[e]){if(e.includes("-")){t.style.setProperty(e,s[e])}else{t.style[e]=s[e]}}}}else if(e==="ref"){if(s){s(t)}}else if(!f&&e[0]==="o"&&e[1]==="n"){if(e[2]==="-"){e=e.slice(3)}else if(bt(c,r)){e=r.slice(2)}else{e=r[2]+e.slice(3)}if(n){i.rel(t,e,n,false)}if(s){i.ael(t,e,s,false)}}else{const c=k(s);if((f||c&&s!==null)&&!o){try{if(!t.tagName.includes("-")){const o=s==null?"":s;if(e==="list"){f=false}else if(n==null||t[e]!=o){t[e]=o}}else{t[e]=s}}catch(t){}}if(s==null||s===false){if(s!==false||t.getAttribute(e)===""){{t.removeAttribute(e)}}}else if((!f||l&4||o)&&!c){s=s===true?"":s;{t.setAttribute(e,s)}}}}};const W=/\s/;const N=t=>!t?[]:t.split(W);const T=(t,e,n,s)=>{const o=e.j.nodeType===11&&e.j.host?e.j.host:e.j;const c=t&&t.g||S;const l=e.g||S;{for(s in c){if(!(s in l)){U(o,s,c[s],undefined,n,e.t)}}}for(s in l){U(o,s,c[s],l[s],n,e.t)}};const A=(t,n,o,c)=>{const i=n.S[o];let f=0;let r;let u;if(i.$!==null){r=i.j=l.createTextNode(i.$)}else{if(!s){s=i.v==="svg"}r=i.j=l.createElementNS(s?v:j,i.v);if(s&&i.v==="foreignObject"){s=false}{T(null,i,s)}if(O(e)&&r["s-si"]!==e){r.classList.add(r["s-si"]=e)}if(i.S){for(f=0;f<i.S.length;++f){u=A(t,i,f);if(u){r.appendChild(u)}}}{if(i.v==="svg"){s=false}else if(r.tagName==="foreignObject"){s=true}}}return r};const D=(t,e,s,o,c,l)=>{let i=t;let f;if(i.shadowRoot&&i.tagName===n){i=i.shadowRoot}for(;c<=l;++c){if(o[c]){f=A(null,s,c);if(f){o[c].j=f;i.insertBefore(f,e)}}}};const F=(t,e,n,s,o)=>{for(;e<=n;++e){if(s=t[e]){o=s.j;V(s);o.remove()}}};const H=(t,e,n,s)=>{let o=0;let c=0;let l=e.length-1;let i=e[0];let f=e[l];let r=s.length-1;let u=s[0];let a=s[r];let d;while(o<=l&&c<=r){if(i==null){i=e[++o]}else if(f==null){f=e[--l]}else if(u==null){u=s[++c]}else if(a==null){a=s[--r]}else if(q(i,u)){I(i,u);i=e[++o];u=s[++c]}else if(q(f,a)){I(f,a);f=e[--l];a=s[--r]}else if(q(i,a)){I(i,a);t.insertBefore(i.j,f.j.nextSibling);i=e[++o];a=s[--r]}else if(q(f,u)){I(f,u);t.insertBefore(f.j,i.j);f=e[--l];u=s[++c]}else{{d=A(e&&e[c],n,c);u=s[++c]}if(d){{i.j.parentNode.insertBefore(d,i.j)}}}}if(o>l){D(t,s[r+1]==null?null:s[r+1].j,n,s,c,r)}else if(c>r){F(e,o,l)}};const q=(t,e)=>{if(t.v===e.v){return true}return false};const I=(t,e)=>{const n=e.j=t.j;const o=t.S;const c=e.S;const l=e.v;const i=e.$;if(i===null){{s=l==="svg"?true:l==="foreignObject"?false:s}{if(l==="slot");else{T(t,e,s)}}if(o!==null&&c!==null){H(n,o,e,c)}else if(c!==null){if(t.$!==null){n.textContent=""}D(n,null,e,c,0,c.length-1)}else if(o!==null){F(o,0,o.length-1)}if(s&&l==="svg"){s=false}}else if(t.$!==i){n.data=i}};const V=t=>{{t.g&&t.g.ref&&t.g.ref(null);t.S&&t.S.map(V)}};const _=(t,s)=>{const o=t.p;const c=t.h;const l=t.C||M(null,null);const i=P(s)?s:C(null,null,s);n=o.tagName;if(c.M){i.g=i.g||{};c.M.map((([t,e])=>i.g[e]=o[t]))}i.v=null;i.t|=4;t.C=i;i.j=l.j=o.shadowRoot||o;{e=o["s-sc"]}I(l,i)};const z=t=>pt(t).p;const B=(t,e,n)=>{const s=z(t);return{emit:t=>G(s,e,{bubbles:!!(n&4),composed:!!(n&2),cancelable:!!(n&1),detail:t})}};const G=(t,e,n)=>{const s=i.ce(e,n);t.dispatchEvent(s);return s};const J=(t,e)=>{if(e&&!t.P&&e["s-p"]){e["s-p"].push(new Promise((e=>t.P=e)))}};const K=(t,e)=>{{t.t|=16}if(t.t&4){t.t|=512;return}J(t,t.L);const n=()=>Q(t,e);return xt(n)};const Q=(t,e)=>{const n=p("scheduleUpdate",t.h.m);const s=t.i;let o;if(e){{t.t|=256;if(t.u){t.u.map((([t,e])=>et(s,t,e)));t.u=null}}{o=et(s,"componentWillLoad")}}{o=nt(o,(()=>et(s,"componentWillRender")))}n();return nt(o,(()=>X(t,s,e)))};const X=async(t,e,n)=>{const s=t.p;const o=p("update",t.h.m);const c=s["s-rc"];if(n){w(t)}const l=p("render",t.h.m);{Y(t,e)}if(c){c.map((t=>t()));s["s-rc"]=undefined}l();o();{const e=s["s-p"];const n=()=>Z(t);if(e.length===0){n()}else{Promise.all(e).then(n);t.t|=4;e.length=0}}};const Y=(t,e,n)=>{try{e=e.render();{t.t&=~16}{t.t|=2}{{{_(t,e)}}}}catch(e){$t(e,t.p)}return null};const Z=t=>{const e=t.h.m;const n=t.p;const s=p("postUpdate",e);const o=t.i;const c=t.L;{et(o,"componentDidRender")}if(!(t.t&64)){t.t|=64;{st(n)}{et(o,"componentDidLoad")}s();{t.R(n);if(!c){tt()}}}else{s()}{t.U(n)}{if(t.P){t.P();t.P=undefined}if(t.t&512){Mt((()=>K(t,false)))}t.t&=~(4|512)}};const tt=e=>{{st(l.documentElement)}Mt((()=>G(c,"appload",{detail:{namespace:t}})))};const et=(t,e,n)=>{if(t&&t[e]){try{return t[e](n)}catch(t){$t(t)}}return undefined};const nt=(t,e)=>t&&t.then?t.then(e):e();const st=t=>t.classList.add("hydrated");const ot=(t,e)=>{if(t!=null&&!k(t)){if(e&4){return t==="false"?false:t===""||!!t}if(e&2){return parseFloat(t)}if(e&1){return String(t)}return t}return t};const ct=(t,e)=>pt(t).W.get(e);const lt=(t,e,n,s)=>{const o=pt(t);const c=o.p;const l=o.W.get(e);const i=o.t;const f=o.i;n=ot(n,s.N[e][0]);const r=Number.isNaN(l)&&Number.isNaN(n);const u=n!==l&&!r;if((!(i&8)||l===undefined)&&u){o.W.set(e,n);if(f){if(s.T&&i&128){const t=s.T[e];if(t){t.map((t=>{try{f[t](n,l,e)}catch(t){$t(t,c)}}))}}if((i&(2|16))===2){K(o,false)}}}};const it=(t,e,n)=>{if(e.N){if(t.watchers){e.T=t.watchers}const s=Object.entries(e.N);const o=t.prototype;s.map((([t,[s]])=>{if(s&31||n&2&&s&32){Object.defineProperty(o,t,{get(){return ct(this,t)},set(n){lt(this,t,n,e)},configurable:true,enumerable:true})}else if(n&1&&s&64){Object.defineProperty(o,t,{value(...e){const n=pt(this);return n.A.then((()=>n.i[t](...e)))}})}}));if(n&1){const n=new Map;o.attributeChangedCallback=function(t,e,s){i.jmp((()=>{const e=n.get(t);if(this.hasOwnProperty(e)){s=this[e];delete this[e]}else if(o.hasOwnProperty(e)&&typeof this[e]==="number"&&this[e]==s){return}this[e]=s===null&&typeof this[e]==="boolean"?false:s}))};t.observedAttributes=s.filter((([t,e])=>e[0]&15)).map((([t,s])=>{const o=s[1]||t;n.set(o,t);if(s[0]&512){e.M.push([t,o])}return o}))}}return t};const ft=async(t,e,n,s,o)=>{if((e.t&32)===0){{e.t|=32;o=gt(n);if(o.then){const t=y();o=await o;t()}if(!o.isProxied){{n.T=o.watchers}it(o,n,2);o.isProxied=true}const t=p("createInstance",n.m);{e.t|=8}try{new o(e)}catch(t){$t(t)}{e.t&=~8}{e.t|=128}t();rt(e.i)}if(o.style){let t=o.style;const e=g(n);if(!St.has(e)){const s=p("registerStyles",n.m);b(e,t,!!(n.t&1));s()}}}const c=e.L;const l=()=>K(e,true);if(c&&c["s-rc"]){c["s-rc"].push(l)}else{l()}};const rt=t=>{{et(t,"connectedCallback")}};const ut=t=>{if((i.t&1)===0){const e=pt(t);const n=e.h;const s=p("connectedCallback",n.m);if(!(e.t&1)){e.t|=1;{let n=t;while(n=n.parentNode||n.host){if(n["s-p"]){J(e,e.L=n);break}}}if(n.N){Object.entries(n.N).map((([e,[n]])=>{if(n&31&&t.hasOwnProperty(e)){const n=t[e];delete t[e];t[e]=n}}))}{ft(t,e,n)}}else{u(t,e,n.D);rt(e.i)}s()}};const at=t=>{if((i.t&1)===0){const e=pt(t);const n=e.i;{if(e.l){e.l.map((t=>t()));e.l=undefined}}{et(n,"disconnectedCallback")}}};const dt=(t,e={})=>{const n=p();const s=[];const o=e.exclude||[];const f=c.customElements;const r=l.head;const u=r.querySelector("meta[charset]");const a=l.createElement("style");const d=[];let y;let m=true;Object.assign(i,e);i.o=new URL(e.resourcesUrl||"./",l.baseURI).href;t.map((t=>{t[1].map((e=>{const n={t:e[0],m:e[1],N:e[2],D:e[3]};{n.N=e[2]}{n.D=e[3]}{n.M=[]}{n.T={}}const c=n.m;const l=class extends HTMLElement{constructor(t){super(t);t=this;mt(t,n);if(n.t&1){{{t.attachShadow({mode:"open"})}}}}connectedCallback(){if(y){clearTimeout(y);y=null}if(m){d.push(this)}else{i.jmp((()=>ut(this)))}}disconnectedCallback(){i.jmp((()=>at(this)))}componentOnReady(){return pt(this).F}};n.H=t[0];if(!o.includes(c)&&!f.get(c)){s.push(c);f.define(c,it(l,n,1))}}))}));{a.innerHTML=s+h;a.setAttribute("data-styles","");r.insertBefore(a,u?u.nextSibling:r.firstChild)}m=false;if(d.length){d.map((t=>t.connectedCallback()))}else{{i.jmp((()=>y=setTimeout(tt,30)))}}n()};const ht=new WeakMap;const pt=t=>ht.get(t);const yt=(t,e)=>ht.set(e.i=t,e);const mt=(t,e)=>{const n={t:0,p:t,h:e,W:new Map};{n.A=new Promise((t=>n.U=t))}{n.F=new Promise((t=>n.R=t));t["s-p"]=[];t["s-rc"]=[]}u(t,n,e.D);return ht.set(t,n)};const bt=(t,e)=>e in t;const $t=(t,e)=>(0,console.error)(t,e);const wt=new Map;const gt=(t,e,n)=>{const s=t.m.replace(/-/g,"_");const o=t.H;const c=wt.get(o);if(c){return c[s]}
2
- /*!__STENCIL_STATIC_IMPORT_SWITCH__*/return import(`./${o}.entry.js${""}`).then((t=>{{wt.set(o,t)}return t[s]}),$t)};const St=new Map;const vt=[];const jt=[];const Ot=(t,e)=>n=>{t.push(n);if(!o){o=true;if(e&&i.t&4){Mt(Ct)}else{i.raf(Ct)}}};const kt=t=>{for(let e=0;e<t.length;e++){try{t[e](performance.now())}catch(t){$t(t)}}t.length=0};const Ct=()=>{kt(vt);{kt(jt);if(o=vt.length>0){i.raf(Ct)}}};const Mt=t=>f().then(t);const xt=Ot(jt,true);export{x as H,dt as b,B as c,z as g,C as h,f as p,yt as r};
3
- //# sourceMappingURL=p-1c6eace6.js.map