@abgov/ui-components-common 2.0.0-dev.2 → 2.0.0-dev.3

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 (2) hide show
  1. package/lib/common.d.ts +130 -1
  2. package/package.json +1 -1
package/lib/common.d.ts CHANGED
@@ -1,86 +1,173 @@
1
1
  export type GoabSpinnerType = "infinite" | "progress";
2
2
  export type GoabSpinnerSize = "small" | "medium" | "large" | "xlarge";
3
+ /**
4
+ * Provides details when a radio group's selected value changes.
5
+ */
3
6
  export type GoabRadioGroupOnChangeDetail = {
7
+ /** The radio group name. */
4
8
  name: string;
9
+ /** The selected value. */
5
10
  value: string;
11
+ /** The originating DOM event. */
6
12
  event: Event;
7
13
  };
14
+ /**
15
+ * Provides details when a checkbox list value changes.
16
+ */
8
17
  export type GoabCheckboxListOnChangeDetail = {
18
+ /** The checkbox list name. */
9
19
  name: string;
20
+ /** The selected values. */
10
21
  value: string[];
22
+ /** The originating DOM event. */
11
23
  event: Event;
12
24
  };
25
+ /**
26
+ * Provides details when an input value changes.
27
+ */
13
28
  export type GoabInputOnChangeDetail<T = string> = {
29
+ /** The input name. */
14
30
  name: string;
31
+ /** The updated value. */
15
32
  value: T;
33
+ /** The originating DOM event. */
16
34
  event: Event;
17
35
  };
18
36
  export type GoaInputOnBlurDetail = GoabInputOnBlurDetail;
37
+ /**
38
+ * Provides details when an input loses focus.
39
+ */
19
40
  export type GoabInputOnBlurDetail<T = string> = {
41
+ /** The input name. */
20
42
  name: string;
43
+ /** The input value at blur time. */
21
44
  value: T;
45
+ /** The originating DOM event. */
22
46
  event: Event;
23
47
  };
48
+ /**
49
+ * Provides details when an input receives focus.
50
+ */
24
51
  export type GoabInputOnFocusDetail<T = string> = GoabInputOnChangeDetail<T>;
52
+ /**
53
+ * Provides details when a menu button action is selected.
54
+ */
25
55
  export type GoabMenuButtonOnActionDetail = {
56
+ /** The selected action identifier. */
26
57
  action: string;
27
58
  };
28
59
  export type GoabInputAutoCapitalize = "on" | "off" | "none" | "sentences" | "words" | "characters";
60
+ /**
61
+ * Provides details when a key is pressed in an input.
62
+ */
29
63
  export type GoabInputOnKeyPressDetail<T = string> = {
64
+ /** The input name. */
30
65
  name: string;
66
+ /** The current input value. */
31
67
  value: T;
68
+ /** The pressed key. */
32
69
  key: T;
70
+ /** The originating DOM event. */
33
71
  event: Event;
34
72
  };
73
+ /**
74
+ * Provides details when the active step changes in a form stepper.
75
+ */
35
76
  export type GoabFormStepperOnChangeDetail = {
77
+ /** The 1-based step value. */
36
78
  step: number;
37
79
  };
80
+ /**
81
+ * Provides details when a file is selected in file upload input.
82
+ */
38
83
  export type GoabFileUploadInputOnSelectFileDetail = {
84
+ /** The selected file. */
39
85
  file: File;
86
+ /** The originating DOM event. */
40
87
  event: Event;
41
88
  };
89
+ /**
90
+ * Provides details when a file upload item is canceled.
91
+ */
42
92
  export type GoabFileUploadOnCancelDetail = {
93
+ /** The file name being canceled. */
43
94
  filename: string;
95
+ /** The originating DOM event. */
44
96
  event: Event;
45
97
  };
98
+ /**
99
+ * Provides details when a file upload item is deleted.
100
+ */
46
101
  export type GoabFileUploadOnDeleteDetail = {
102
+ /** The file name being deleted. */
47
103
  filename: string;
104
+ /** The originating DOM event. */
48
105
  event: Event;
49
106
  };
50
107
  export type GoabDropdownItemMountType = "append" | "prepend" | "reset";
108
+ /**
109
+ * Provides details when a dropdown selection changes.
110
+ */
51
111
  export type GoabDropdownOnChangeDetail = {
112
+ /** The dropdown name, when provided. */
52
113
  name?: string;
114
+ /** The selected value for single-select dropdowns. */
53
115
  value?: string;
116
+ /** The selected values for multi-select dropdowns. */
54
117
  values?: string[];
118
+ /** The originating DOM event. */
55
119
  event: Event;
56
120
  };
121
+ /**
122
+ * Provides details when a date picker value changes.
123
+ */
57
124
  export type GoabDatePickerOnChangeDetail = {
125
+ /** The date picker name, when provided. */
58
126
  name?: string;
127
+ /** The selected date as a string. */
59
128
  valueStr: string;
60
129
  /**
61
130
  * @deprecated Use `valueStr` instead
62
131
  */
63
132
  value: Date;
133
+ /** The originating DOM event. */
64
134
  event: Event;
65
135
  };
66
136
  export type GoabDatePickerInputType = "calendar" | "input";
67
137
  export type GoabChipVariant = "filter";
68
138
  export type GoabChipTheme = "outline" | "filled";
69
139
  export type GoabFilterChipTheme = "outline" | "filled";
140
+ /**
141
+ * Provides details when a checkbox value or checked state changes.
142
+ */
70
143
  export type GoabCheckboxOnChangeDetail = {
144
+ /** The checkbox name, when provided. */
71
145
  name?: string;
146
+ /** The checkbox value, when provided. */
72
147
  value?: string;
148
+ /** The updated checked state. */
73
149
  checked: boolean;
150
+ /** Indicates whether the change came from value or checked binding. */
74
151
  binding: "value" | "check";
152
+ /** The originating DOM event. */
75
153
  event: Event;
76
154
  };
155
+ /**
156
+ * Provides details when a calendar value changes.
157
+ */
77
158
  export type GoabCalendarOnChangeDetail = {
159
+ /** The calendar name, when provided. */
78
160
  name?: string;
161
+ /** The selected date value. */
79
162
  value: string;
80
163
  };
81
164
  export type GoabBadgeType = "information" | "success" | "important" | "emergency" | "archived" | "sky" | "prairie" | "lilac" | "pasture" | "sunset" | "dawn" | "default";
82
165
  export type GoabPaginationVariant = "all" | "links-only";
166
+ /**
167
+ * Provides details when pagination changes pages.
168
+ */
83
169
  export type GoabPaginationOnChangeDetail = {
170
+ /** The selected page number. */
84
171
  page: number;
85
172
  };
86
173
  export type GoabFormStepperType = "constrained" | "free";
@@ -106,20 +193,39 @@ export type GoabAccordionIconPosition = "left" | "right";
106
193
  export type GoabTooltipPosition = "top" | "bottom" | "left" | "right";
107
194
  export type GoabTooltipHorizontalAlignment = "left" | "right" | "center";
108
195
  export type GoabTextAreaCountBy = "character" | "word" | "";
196
+ /**
197
+ * Provides details when a textarea value changes.
198
+ */
109
199
  export type GoabTextAreaOnChangeDetail = {
200
+ /** The textarea name. */
110
201
  name: string;
202
+ /** The updated value. */
111
203
  value: string;
204
+ /** The originating DOM event. */
112
205
  event: Event;
113
206
  };
207
+ /**
208
+ * Provides details when a key is pressed in a textarea.
209
+ */
114
210
  export type GoabTextAreaOnKeyPressDetail = {
211
+ /** The textarea name. */
115
212
  name: string;
213
+ /** The current value. */
116
214
  value: string;
215
+ /** The pressed key. */
117
216
  key: string;
217
+ /** The originating DOM event. */
118
218
  event: Event;
119
219
  };
220
+ /**
221
+ * Provides details when a textarea loses focus.
222
+ */
120
223
  export type GoabTextAreaOnBlurDetail = {
224
+ /** The textarea name. */
121
225
  name: string;
226
+ /** The value at blur time. */
122
227
  value: string;
228
+ /** The originating DOM event. */
123
229
  event: Event;
124
230
  };
125
231
  export type GoabTabsVariant = "default" | "segmented";
@@ -130,7 +236,11 @@ export interface GoabTabsProps {
130
236
  variant?: GoabTabsVariant;
131
237
  orientation?: GoabTabsOrientation;
132
238
  }
239
+ /**
240
+ * Provides details when the active tab changes.
241
+ */
133
242
  export type GoabTabsOnChangeDetail = {
243
+ /** The selected tab index. */
134
244
  tab: number;
135
245
  };
136
246
  export type GoabTableVariant = "normal" | "relaxed";
@@ -147,11 +257,20 @@ export type GoabTableSortEntry = {
147
257
  column: string;
148
258
  direction: "asc" | "desc";
149
259
  };
260
+ /**
261
+ * Provides details when a single table sort changes.
262
+ */
150
263
  export type GoabTableOnSortDetail = {
264
+ /** The sorted column key. */
151
265
  sortBy: string;
266
+ /** The sort direction as a numeric value. */
152
267
  sortDir: number;
153
268
  };
269
+ /**
270
+ * Provides details when multi-sort values change.
271
+ */
154
272
  export type GoabTableOnMultiSortDetail = {
273
+ /** The collection of active sort entries. */
155
274
  sorts: GoabTableSortEntry[];
156
275
  };
157
276
  export type GoabSpacerHorizontalSpacing = Spacing | "fill";
@@ -288,7 +407,7 @@ export interface Margins {
288
407
  ml?: Spacing;
289
408
  }
290
409
  export type GoabBlockDirection = "row" | "column";
291
- export type GoabBlockAlignment = "center" | "start" | "end";
410
+ export type GoabBlockAlignment = "center" | "start" | "end" | "normal";
292
411
  export type GoabPageBlockSize = "full" | string;
293
412
  export type GoabLinkButtonType = "start" | "primary" | "secondary" | "tertiary";
294
413
  export type GoabTextMaxWidth = string | "none";
@@ -303,7 +422,11 @@ export type GoabFormField = {
303
422
  value: string;
304
423
  };
305
424
  export type GoabFormStorageType = "none" | "local" | "session";
425
+ /**
426
+ * Provides details used to register a callback at form mount time.
427
+ */
306
428
  export type GoabFormOnMountDetail = {
429
+ /** Callback used to set the next route or step. */
307
430
  fn: (next: string) => void;
308
431
  };
309
432
  export type GoabFormOnStateChange = {
@@ -339,9 +462,15 @@ export type GoabFieldsetSchema = {
339
462
  heading?: string;
340
463
  data?: GoabFieldsetData;
341
464
  };
465
+ /**
466
+ * Provides details when a fieldset continue action is triggered.
467
+ */
342
468
  export interface GoabFieldsetOnContinueDetail {
469
+ /** The fieldset element that triggered continue. */
343
470
  el: HTMLElement;
471
+ /** The fieldset state at trigger time. */
344
472
  state: Record<string, GoabFieldsetItemState>;
473
+ /** Indicates whether the action was canceled. */
345
474
  cancelled: boolean;
346
475
  }
347
476
  export type GoabPublicFormStatus = "initializing" | "complete";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/ui-components-common",
3
- "version": "2.0.0-dev.2",
3
+ "version": "2.0.0-dev.3",
4
4
  "bugs": {
5
5
  "url": "https://github.com/GovAlta/ui-components/issues"
6
6
  },