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

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