@nordhealth/components 4.0.0-alpha.2 → 4.0.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/lib/react.d.ts ADDED
@@ -0,0 +1,420 @@
1
+ import type * as Components from "./src/index"
2
+ import type { LitElement } from "lit"
3
+ import type * as React from "react"
4
+
5
+ type WCProps<TWebComponent extends HTMLElement> = Partial<Omit<TWebComponent, keyof LitElement | "render">>
6
+
7
+ type MapEvents<T> = {
8
+ [K in keyof T as K extends `on${infer E}` ? `on${Lowercase<E>}` : K]: T[K]
9
+ }
10
+
11
+ declare module "react" {
12
+ namespace JSX {
13
+ interface IntrinsicElements {
14
+ "nord-avatar": WCProps<Components.Avatar> & React.HTMLAttributes<HTMLElement> & React.Attributes & {}
15
+
16
+ "nord-badge": WCProps<Components.Badge> & React.HTMLAttributes<HTMLElement> & React.Attributes & {}
17
+
18
+ "nord-banner": WCProps<Components.Banner> & React.HTMLAttributes<HTMLElement> & React.Attributes & {}
19
+
20
+ "nord-button": WCProps<Components.Button> & React.HTMLAttributes<HTMLElement> & React.Attributes & {}
21
+
22
+ "nord-button-group": WCProps<Components.ButtonGroup> & React.HTMLAttributes<HTMLElement> & React.Attributes & {}
23
+
24
+ "nord-calendar": WCProps<Components.Calendar> &
25
+ React.HTMLAttributes<HTMLElement> &
26
+ React.Attributes & {
27
+ /**
28
+ * Dispatched when a date is selected and the value changes.
29
+ */
30
+ onchange?: (event: Event) => void
31
+
32
+ /**
33
+ * Dispatched when the calendar's focused date changes.
34
+ */
35
+ "onnord-focus-date"?: (event: Event) => void
36
+ }
37
+
38
+ "nord-card": WCProps<Components.Card> & React.HTMLAttributes<HTMLElement> & React.Attributes & {}
39
+
40
+ "nord-checkbox": WCProps<Components.Checkbox> &
41
+ React.HTMLAttributes<HTMLElement> &
42
+ React.Attributes & {
43
+ /**
44
+ * Fired whenever the input's value is changed via user interaction.
45
+ */
46
+ onchange?: (event: Event) => void
47
+
48
+ /**
49
+ * Fired as the user types into the input.
50
+ */
51
+ oninput?: (event: Event) => void
52
+ }
53
+
54
+ "nord-command-menu": WCProps<Components.CommandMenu> &
55
+ React.HTMLAttributes<HTMLElement> &
56
+ React.Attributes & {
57
+ /**
58
+ * The command menu was closed.
59
+ */
60
+ onclose?: (event: Event) => void
61
+
62
+ /**
63
+ * User selected a command from the menu.
64
+ */
65
+ "onnord-select"?: (event: Event) => void
66
+
67
+ /**
68
+ * The command menu was opened.
69
+ */
70
+ onopen?: (event: Event) => void
71
+ }
72
+
73
+ "nord-date-picker": WCProps<Components.DatePicker> &
74
+ React.HTMLAttributes<HTMLElement> &
75
+ React.Attributes & {
76
+ /**
77
+ * Fired whenever the input's value is changed via user interaction.
78
+ */
79
+ onchange?: (event: Event) => void
80
+
81
+ /**
82
+ * Dispatched when the popout is closed.
83
+ */
84
+ onclose?: (event: Event) => void
85
+
86
+ /**
87
+ * Fired as the user types into the input.
88
+ */
89
+ oninput?: (event: Event) => void
90
+
91
+ /**
92
+ * Dispatched when the calendar's focused date changes.
93
+ */
94
+ "onnord-focus-date"?: (event: Event) => void
95
+
96
+ /**
97
+ * Dispatched when the popout is opened.
98
+ */
99
+ onopen?: (event: Event) => void
100
+ }
101
+
102
+ "nord-divider": WCProps<Components.Divider> & React.HTMLAttributes<HTMLElement> & React.Attributes & {}
103
+
104
+ "nord-drawer": WCProps<Components.Drawer> & React.HTMLAttributes<HTMLElement> & React.Attributes & {}
105
+
106
+ "nord-dropdown": WCProps<Components.Dropdown> &
107
+ React.HTMLAttributes<HTMLElement> &
108
+ React.Attributes & {
109
+ /**
110
+ * Dispatched when the popout is closed.
111
+ */
112
+ onclose?: (event: Event) => void
113
+
114
+ /**
115
+ * Dispatched when the popout is opened.
116
+ */
117
+ onopen?: (event: Event) => void
118
+ }
119
+
120
+ "nord-dropdown-group": WCProps<Components.DropdownGroup> &
121
+ React.HTMLAttributes<HTMLElement> &
122
+ React.Attributes & {}
123
+
124
+ "nord-dropdown-item": WCProps<Components.DropdownItem> & React.HTMLAttributes<HTMLElement> & React.Attributes & {}
125
+
126
+ "nord-empty-state": WCProps<Components.EmptyState> & React.HTMLAttributes<HTMLElement> & React.Attributes & {}
127
+
128
+ "nord-fieldset": WCProps<Components.Fieldset> & React.HTMLAttributes<HTMLElement> & React.Attributes & {}
129
+
130
+ "nord-footer": WCProps<Components.Footer> & React.HTMLAttributes<HTMLElement> & React.Attributes & {}
131
+
132
+ "nord-header": WCProps<Components.Header> & React.HTMLAttributes<HTMLElement> & React.Attributes & {}
133
+
134
+ "nord-icon": WCProps<Components.Icon> & React.HTMLAttributes<HTMLElement> & React.Attributes & {}
135
+
136
+ "nord-input": WCProps<Components.Input> &
137
+ React.HTMLAttributes<HTMLElement> &
138
+ React.Attributes & {
139
+ /**
140
+ * Fired whenever the input's value is changed via user interaction.
141
+ */
142
+ onchange?: (event: Event) => void
143
+
144
+ /**
145
+ * Fired as the user types into the input.
146
+ */
147
+ oninput?: (event: Event) => void
148
+
149
+ /**
150
+ * Fired when some text has been selected.
151
+ */
152
+ onselect?: (event: Event) => void
153
+ }
154
+
155
+ "nord-layout": WCProps<Components.Layout> & React.HTMLAttributes<HTMLElement> & React.Attributes & {}
156
+
157
+ "nord-message": WCProps<Components.Message> & React.HTMLAttributes<HTMLElement> & React.Attributes & {}
158
+
159
+ "nord-modal": WCProps<Components.Modal> &
160
+ React.HTMLAttributes<HTMLElement> &
161
+ React.Attributes & {
162
+ /**
163
+ * Dispatched before the modal has closed when a user attempts to dismiss a modal. Call `preventDefault()` on the event to prevent the modal closing.
164
+ */
165
+ oncancel?: (event: Event) => void
166
+
167
+ /**
168
+ * Dispatched when a modal is closed for any reason.
169
+ */
170
+ onclose?: (event: Event) => void
171
+ }
172
+
173
+ "nord-nav-group": WCProps<Components.NavGroup> &
174
+ React.HTMLAttributes<HTMLElement> &
175
+ React.Attributes & {
176
+ /**
177
+ * Dispatched whenever a nav item has been marked as active
178
+ */
179
+ onactivate?: (event: Event) => void
180
+
181
+ /**
182
+ * Dispatched whenever a nav item's state changes between open and closed.
183
+ */
184
+ ontoggle?: (event: Event) => void
185
+ }
186
+
187
+ "nord-navigation": WCProps<Components.Navigation> &
188
+ React.HTMLAttributes<HTMLElement> &
189
+ React.Attributes & {
190
+ /**
191
+ * Dispatched whenever a nav item has been marked as active
192
+ */
193
+ onactivate?: (event: Event) => void
194
+
195
+ /**
196
+ * Dispatched whenever a nav item's state changes between open and closed.
197
+ */
198
+ ontoggle?: (event: Event) => void
199
+ }
200
+
201
+ "nord-nav-item": WCProps<Components.NavItem> &
202
+ React.HTMLAttributes<HTMLElement> &
203
+ React.Attributes & {
204
+ /**
205
+ * Dispatched whenever a nav item has been marked as active
206
+ */
207
+ onactivate?: (event: Event) => void
208
+
209
+ /**
210
+ * Dispatched whenever a nav item's state changes between open and closed.
211
+ */
212
+ ontoggle?: (event: Event) => void
213
+ }
214
+
215
+ "nord-nav-toggle": WCProps<Components.NavToggle> & React.HTMLAttributes<HTMLElement> & React.Attributes & {}
216
+
217
+ "nord-notification": WCProps<Components.Notification> &
218
+ React.HTMLAttributes<HTMLElement> &
219
+ React.Attributes & {
220
+ /**
221
+ * Fired when the notification is dismissed, and its exit animation has completed. This event should be used to remove the dismissed notification from the DOM.
222
+ */
223
+ ondismiss?: (event: Event) => void
224
+ }
225
+
226
+ "nord-notification-group": WCProps<Components.NotificationGroup> &
227
+ React.HTMLAttributes<HTMLElement> &
228
+ React.Attributes & {
229
+ /**
230
+ * Fired when a notification is dismissed, and its exit animation has completed. This event should be used to remove the dismissed notification from the DOM.
231
+ */
232
+ ondismiss?: (event: Event) => void
233
+ }
234
+
235
+ "nord-popout": WCProps<Components.Popout> &
236
+ React.HTMLAttributes<HTMLElement> &
237
+ React.Attributes & {
238
+ /**
239
+ * Dispatched when the popout is closed.
240
+ */
241
+ onclose?: (event: Event) => void
242
+
243
+ /**
244
+ * Dispatched when the popout is opened.
245
+ */
246
+ onopen?: (event: Event) => void
247
+ }
248
+
249
+ "nord-progress-bar": WCProps<Components.ProgressBar> & React.HTMLAttributes<HTMLElement> & React.Attributes & {}
250
+
251
+ "nord-qrcode": WCProps<Components.Qrcode> & React.HTMLAttributes<HTMLElement> & React.Attributes & {}
252
+
253
+ "nord-radio": WCProps<Components.Radio> &
254
+ React.HTMLAttributes<HTMLElement> &
255
+ React.Attributes & {
256
+ /**
257
+ * Fired whenever the input's value is changed via user interaction.
258
+ */
259
+ onchange?: (event: Event) => void
260
+
261
+ /**
262
+ * Fired as the user types into the input.
263
+ */
264
+ oninput?: (event: Event) => void
265
+ }
266
+
267
+ "nord-range": WCProps<Components.Range> &
268
+ React.HTMLAttributes<HTMLElement> &
269
+ React.Attributes & {
270
+ /**
271
+ * Fired whenever the input's value is changed via user interaction.
272
+ */
273
+ onchange?: (event: Event) => void
274
+
275
+ /**
276
+ * Fired as the user types into the input.
277
+ */
278
+ oninput?: (event: Event) => void
279
+ }
280
+
281
+ "nord-segmented-control": WCProps<Components.SegmentedControl> &
282
+ React.HTMLAttributes<HTMLElement> &
283
+ React.Attributes & {
284
+ /**
285
+ * Fired whenever a segmented control item has been checked.
286
+ */
287
+ onchange?: (event: Event) => void
288
+ }
289
+
290
+ "nord-segmented-control-item": WCProps<Components.SegmentedControlItem> &
291
+ React.HTMLAttributes<HTMLElement> &
292
+ React.Attributes & {
293
+ /**
294
+ * Fired whenever the segmented control item has been checked.
295
+ */
296
+ onchange?: (event: Event) => void
297
+
298
+ /**
299
+ * Fired as the user types into the input.
300
+ */
301
+ oninput?: (event: Event) => void
302
+ }
303
+
304
+ "nord-select": WCProps<Components.Select> &
305
+ React.HTMLAttributes<HTMLElement> &
306
+ React.Attributes & {
307
+ /**
308
+ * Fired whenever the input's value is changed via user interaction.
309
+ */
310
+ onchange?: (event: Event) => void
311
+
312
+ /**
313
+ * Fired as the user types into the input.
314
+ */
315
+ oninput?: (event: Event) => void
316
+ }
317
+
318
+ "nord-skeleton": WCProps<Components.Skeleton> & React.HTMLAttributes<HTMLElement> & React.Attributes & {}
319
+
320
+ "nord-spinner": WCProps<Components.Spinner> & React.HTMLAttributes<HTMLElement> & React.Attributes & {}
321
+
322
+ "nord-stack": WCProps<Components.Stack> & React.HTMLAttributes<HTMLElement> & React.Attributes & {}
323
+
324
+ "nord-tab": WCProps<Components.Tab> & React.HTMLAttributes<HTMLElement> & React.Attributes & {}
325
+
326
+ "nord-tab-group": WCProps<Components.TabGroup> & React.HTMLAttributes<HTMLElement> & React.Attributes & {}
327
+
328
+ "nord-table": WCProps<Components.Table> & React.HTMLAttributes<HTMLElement> & React.Attributes & {}
329
+
330
+ "nord-tab-panel": WCProps<Components.TabPanel> & React.HTMLAttributes<HTMLElement> & React.Attributes & {}
331
+
332
+ "nord-tag": WCProps<Components.Tag> &
333
+ React.HTMLAttributes<HTMLElement> &
334
+ React.Attributes & {
335
+ /**
336
+ * Fired whenever the tag has been checked or unchecked via user interaction.
337
+ */
338
+ onchange?: (event: Event) => void
339
+
340
+ /**
341
+ * Fired when the remove button is activated. This event should be used to remove the tag from the DOM.
342
+ */
343
+ onremove?: (event: Event) => void
344
+ }
345
+
346
+ "nord-tag-group": WCProps<Components.TagGroup> &
347
+ React.HTMLAttributes<HTMLElement> &
348
+ React.Attributes & {
349
+ /**
350
+ * Fired whenever a tag has been checked or unchecked via user interaction.
351
+ */
352
+ onchange?: (event: Event) => void
353
+
354
+ /**
355
+ * Fired when the remove button is activated on a tag. This event should be used to remove the tag from the DOM.
356
+ */
357
+ onremove?: (event: Event) => void
358
+ }
359
+
360
+ "nord-textarea": WCProps<Components.Textarea> &
361
+ React.HTMLAttributes<HTMLElement> &
362
+ React.Attributes & {
363
+ /**
364
+ * Fired whenever the input's value is changed via user interaction.
365
+ */
366
+ onchange?: (event: Event) => void
367
+
368
+ /**
369
+ * Fired as the user types into the input.
370
+ */
371
+ oninput?: (event: Event) => void
372
+
373
+ /**
374
+ * Fired when some text has been selected.
375
+ */
376
+ onselect?: (event: Event) => void
377
+ }
378
+
379
+ "nord-toast": WCProps<Components.Toast> &
380
+ React.HTMLAttributes<HTMLElement> &
381
+ React.Attributes & {
382
+ /**
383
+ * Fired when the toast is dismissed (via user action or auto-dismiss), and its exit animation has completed. This event should be used to remove the dismissed toast from the DOM.
384
+ */
385
+ ondismiss?: (event: Event) => void
386
+ }
387
+
388
+ "nord-toast-group": WCProps<Components.ToastGroup> &
389
+ React.HTMLAttributes<HTMLElement> &
390
+ React.Attributes & {
391
+ /**
392
+ * Fired when a toast is dismissed (via user action or auto-dismiss), and its exit animation has completed. This event should be used to remove the dismissed toast from the DOM.
393
+ */
394
+ ondismiss?: (event: Event) => void
395
+ }
396
+
397
+ "nord-toggle": WCProps<Components.Toggle> &
398
+ React.HTMLAttributes<HTMLElement> &
399
+ React.Attributes & {
400
+ /**
401
+ * Fired whenever the input's value is changed via user interaction.
402
+ */
403
+ onchange?: (event: Event) => void
404
+
405
+ /**
406
+ * Fired as the user types into the input.
407
+ */
408
+ oninput?: (event: Event) => void
409
+ }
410
+
411
+ "nord-tooltip": WCProps<Components.Tooltip> & React.HTMLAttributes<HTMLElement> & React.Attributes & {}
412
+
413
+ "nord-top-bar": WCProps<Components.TopBar> & React.HTMLAttributes<HTMLElement> & React.Attributes & {}
414
+
415
+ "nord-visually-hidden": WCProps<Components.VisuallyHidden> &
416
+ React.HTMLAttributes<HTMLElement> &
417
+ React.Attributes & {}
418
+ }
419
+ }
420
+ }