@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/vue.d.ts ADDED
@@ -0,0 +1,420 @@
1
+ import type * as Components from "./src/index"
2
+ import type { LitElement } from "lit"
3
+ import type { DefineComponent } from "vue"
4
+
5
+ type WCProps<TWebComponent extends HTMLElement> = Partial<Omit<TWebComponent, keyof LitElement | "render">>
6
+
7
+ interface NordComponents {
8
+ "nord-avatar": DefineComponent<WCProps<Components.Avatar> & {}>
9
+
10
+ "nord-badge": DefineComponent<WCProps<Components.Badge> & {}>
11
+
12
+ "nord-banner": DefineComponent<WCProps<Components.Banner> & {}>
13
+
14
+ "nord-button": DefineComponent<WCProps<Components.Button> & {}>
15
+
16
+ "nord-button-group": DefineComponent<WCProps<Components.ButtonGroup> & {}>
17
+
18
+ "nord-calendar": DefineComponent<
19
+ WCProps<Components.Calendar> & {
20
+ /**
21
+ * Dispatched when a date is selected and the value changes.
22
+ */
23
+ onChange?: (event: Event) => void
24
+
25
+ /**
26
+ * Dispatched when the calendar's focused date changes.
27
+ */
28
+ onNordFocusDate?: (event: Event) => void
29
+ }
30
+ >
31
+
32
+ "nord-card": DefineComponent<WCProps<Components.Card> & {}>
33
+
34
+ "nord-checkbox": DefineComponent<
35
+ WCProps<Components.Checkbox> & {
36
+ /**
37
+ * Fired whenever the input's value is changed via user interaction.
38
+ */
39
+ onChange?: (event: Event) => void
40
+
41
+ /**
42
+ * Fired as the user types into the input.
43
+ */
44
+ onInput?: (event: Event) => void
45
+ }
46
+ >
47
+
48
+ "nord-command-menu": DefineComponent<
49
+ WCProps<Components.CommandMenu> & {
50
+ /**
51
+ * The command menu was closed.
52
+ */
53
+ onClose?: (event: Event) => void
54
+
55
+ /**
56
+ * User selected a command from the menu.
57
+ */
58
+ onNordSelect?: (event: Event) => void
59
+
60
+ /**
61
+ * The command menu was opened.
62
+ */
63
+ onOpen?: (event: Event) => void
64
+ }
65
+ >
66
+
67
+ "nord-date-picker": DefineComponent<
68
+ WCProps<Components.DatePicker> & {
69
+ /**
70
+ * Fired whenever the input's value is changed via user interaction.
71
+ */
72
+ onChange?: (event: Event) => void
73
+
74
+ /**
75
+ * Dispatched when the popout is closed.
76
+ */
77
+ onClose?: (event: Event) => void
78
+
79
+ /**
80
+ * Fired as the user types into the input.
81
+ */
82
+ onInput?: (event: Event) => void
83
+
84
+ /**
85
+ * Dispatched when the calendar's focused date changes.
86
+ */
87
+ onNordFocusDate?: (event: Event) => void
88
+
89
+ /**
90
+ * Dispatched when the popout is opened.
91
+ */
92
+ onOpen?: (event: Event) => void
93
+ }
94
+ >
95
+
96
+ "nord-divider": DefineComponent<WCProps<Components.Divider> & {}>
97
+
98
+ "nord-drawer": DefineComponent<WCProps<Components.Drawer> & {}>
99
+
100
+ "nord-dropdown": DefineComponent<
101
+ WCProps<Components.Dropdown> & {
102
+ /**
103
+ * Dispatched when the popout is closed.
104
+ */
105
+ onClose?: (event: Event) => void
106
+
107
+ /**
108
+ * Dispatched when the popout is opened.
109
+ */
110
+ onOpen?: (event: Event) => void
111
+ }
112
+ >
113
+
114
+ "nord-dropdown-group": DefineComponent<WCProps<Components.DropdownGroup> & {}>
115
+
116
+ "nord-dropdown-item": DefineComponent<WCProps<Components.DropdownItem> & {}>
117
+
118
+ "nord-empty-state": DefineComponent<WCProps<Components.EmptyState> & {}>
119
+
120
+ "nord-fieldset": DefineComponent<WCProps<Components.Fieldset> & {}>
121
+
122
+ "nord-footer": DefineComponent<WCProps<Components.Footer> & {}>
123
+
124
+ "nord-header": DefineComponent<WCProps<Components.Header> & {}>
125
+
126
+ "nord-icon": DefineComponent<WCProps<Components.Icon> & {}>
127
+
128
+ "nord-input": DefineComponent<
129
+ WCProps<Components.Input> & {
130
+ /**
131
+ * Fired whenever the input's value is changed via user interaction.
132
+ */
133
+ onChange?: (event: Event) => void
134
+
135
+ /**
136
+ * Fired as the user types into the input.
137
+ */
138
+ onInput?: (event: Event) => void
139
+
140
+ /**
141
+ * Fired when some text has been selected.
142
+ */
143
+ onSelect?: (event: Event) => void
144
+ }
145
+ >
146
+
147
+ "nord-layout": DefineComponent<WCProps<Components.Layout> & {}>
148
+
149
+ "nord-message": DefineComponent<WCProps<Components.Message> & {}>
150
+
151
+ "nord-modal": DefineComponent<
152
+ WCProps<Components.Modal> & {
153
+ /**
154
+ * Dispatched before the modal has closed when a user attempts to dismiss a modal. Call `preventDefault()` on the event to prevent the modal closing.
155
+ */
156
+ onCancel?: (event: Event) => void
157
+
158
+ /**
159
+ * Dispatched when a modal is closed for any reason.
160
+ */
161
+ onClose?: (event: Event) => void
162
+ }
163
+ >
164
+
165
+ "nord-nav-group": DefineComponent<
166
+ WCProps<Components.NavGroup> & {
167
+ /**
168
+ * Dispatched whenever a nav item has been marked as active
169
+ */
170
+ onActivate?: (event: Event) => void
171
+
172
+ /**
173
+ * Dispatched whenever a nav item's state changes between open and closed.
174
+ */
175
+ onToggle?: (event: Event) => void
176
+ }
177
+ >
178
+
179
+ "nord-navigation": DefineComponent<
180
+ WCProps<Components.Navigation> & {
181
+ /**
182
+ * Dispatched whenever a nav item has been marked as active
183
+ */
184
+ onActivate?: (event: Event) => void
185
+
186
+ /**
187
+ * Dispatched whenever a nav item's state changes between open and closed.
188
+ */
189
+ onToggle?: (event: Event) => void
190
+ }
191
+ >
192
+
193
+ "nord-nav-item": DefineComponent<
194
+ WCProps<Components.NavItem> & {
195
+ /**
196
+ * Dispatched whenever a nav item has been marked as active
197
+ */
198
+ onActivate?: (event: Event) => void
199
+
200
+ /**
201
+ * Dispatched whenever a nav item's state changes between open and closed.
202
+ */
203
+ onToggle?: (event: Event) => void
204
+ }
205
+ >
206
+
207
+ "nord-nav-toggle": DefineComponent<WCProps<Components.NavToggle> & {}>
208
+
209
+ "nord-notification": DefineComponent<
210
+ WCProps<Components.Notification> & {
211
+ /**
212
+ * 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.
213
+ */
214
+ onDismiss?: (event: Event) => void
215
+ }
216
+ >
217
+
218
+ "nord-notification-group": DefineComponent<
219
+ WCProps<Components.NotificationGroup> & {
220
+ /**
221
+ * 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.
222
+ */
223
+ onDismiss?: (event: Event) => void
224
+ }
225
+ >
226
+
227
+ "nord-popout": DefineComponent<
228
+ WCProps<Components.Popout> & {
229
+ /**
230
+ * Dispatched when the popout is closed.
231
+ */
232
+ onClose?: (event: Event) => void
233
+
234
+ /**
235
+ * Dispatched when the popout is opened.
236
+ */
237
+ onOpen?: (event: Event) => void
238
+ }
239
+ >
240
+
241
+ "nord-progress-bar": DefineComponent<WCProps<Components.ProgressBar> & {}>
242
+
243
+ "nord-qrcode": DefineComponent<WCProps<Components.Qrcode> & {}>
244
+
245
+ "nord-radio": DefineComponent<
246
+ WCProps<Components.Radio> & {
247
+ /**
248
+ * Fired whenever the input's value is changed via user interaction.
249
+ */
250
+ onChange?: (event: Event) => void
251
+
252
+ /**
253
+ * Fired as the user types into the input.
254
+ */
255
+ onInput?: (event: Event) => void
256
+ }
257
+ >
258
+
259
+ "nord-range": DefineComponent<
260
+ WCProps<Components.Range> & {
261
+ /**
262
+ * Fired whenever the input's value is changed via user interaction.
263
+ */
264
+ onChange?: (event: Event) => void
265
+
266
+ /**
267
+ * Fired as the user types into the input.
268
+ */
269
+ onInput?: (event: Event) => void
270
+ }
271
+ >
272
+
273
+ "nord-segmented-control": DefineComponent<
274
+ WCProps<Components.SegmentedControl> & {
275
+ /**
276
+ * Fired whenever a segmented control item has been checked.
277
+ */
278
+ onChange?: (event: Event) => void
279
+ }
280
+ >
281
+
282
+ "nord-segmented-control-item": DefineComponent<
283
+ WCProps<Components.SegmentedControlItem> & {
284
+ /**
285
+ * Fired whenever the segmented control item has been checked.
286
+ */
287
+ onChange?: (event: Event) => void
288
+
289
+ /**
290
+ * Fired as the user types into the input.
291
+ */
292
+ onInput?: (event: Event) => void
293
+ }
294
+ >
295
+
296
+ "nord-select": DefineComponent<
297
+ WCProps<Components.Select> & {
298
+ /**
299
+ * Fired whenever the input's value is changed via user interaction.
300
+ */
301
+ onChange?: (event: Event) => void
302
+
303
+ /**
304
+ * Fired as the user types into the input.
305
+ */
306
+ onInput?: (event: Event) => void
307
+ }
308
+ >
309
+
310
+ "nord-skeleton": DefineComponent<WCProps<Components.Skeleton> & {}>
311
+
312
+ "nord-spinner": DefineComponent<WCProps<Components.Spinner> & {}>
313
+
314
+ "nord-stack": DefineComponent<WCProps<Components.Stack> & {}>
315
+
316
+ "nord-tab": DefineComponent<WCProps<Components.Tab> & {}>
317
+
318
+ "nord-tab-group": DefineComponent<WCProps<Components.TabGroup> & {}>
319
+
320
+ "nord-table": DefineComponent<WCProps<Components.Table> & {}>
321
+
322
+ "nord-tab-panel": DefineComponent<WCProps<Components.TabPanel> & {}>
323
+
324
+ "nord-tag": DefineComponent<
325
+ WCProps<Components.Tag> & {
326
+ /**
327
+ * Fired whenever the tag has been checked or unchecked via user interaction.
328
+ */
329
+ onChange?: (event: Event) => void
330
+
331
+ /**
332
+ * Fired when the remove button is activated. This event should be used to remove the tag from the DOM.
333
+ */
334
+ onRemove?: (event: Event) => void
335
+ }
336
+ >
337
+
338
+ "nord-tag-group": DefineComponent<
339
+ WCProps<Components.TagGroup> & {
340
+ /**
341
+ * Fired whenever a tag has been checked or unchecked via user interaction.
342
+ */
343
+ onChange?: (event: Event) => void
344
+
345
+ /**
346
+ * Fired when the remove button is activated on a tag. This event should be used to remove the tag from the DOM.
347
+ */
348
+ onRemove?: (event: Event) => void
349
+ }
350
+ >
351
+
352
+ "nord-textarea": DefineComponent<
353
+ WCProps<Components.Textarea> & {
354
+ /**
355
+ * Fired whenever the input's value is changed via user interaction.
356
+ */
357
+ onChange?: (event: Event) => void
358
+
359
+ /**
360
+ * Fired as the user types into the input.
361
+ */
362
+ onInput?: (event: Event) => void
363
+
364
+ /**
365
+ * Fired when some text has been selected.
366
+ */
367
+ onSelect?: (event: Event) => void
368
+ }
369
+ >
370
+
371
+ "nord-toast": DefineComponent<
372
+ WCProps<Components.Toast> & {
373
+ /**
374
+ * 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.
375
+ */
376
+ onDismiss?: (event: Event) => void
377
+ }
378
+ >
379
+
380
+ "nord-toast-group": DefineComponent<
381
+ WCProps<Components.ToastGroup> & {
382
+ /**
383
+ * 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.
384
+ */
385
+ onDismiss?: (event: Event) => void
386
+ }
387
+ >
388
+
389
+ "nord-toggle": DefineComponent<
390
+ WCProps<Components.Toggle> & {
391
+ /**
392
+ * Fired whenever the input's value is changed via user interaction.
393
+ */
394
+ onChange?: (event: Event) => void
395
+
396
+ /**
397
+ * Fired as the user types into the input.
398
+ */
399
+ onInput?: (event: Event) => void
400
+ }
401
+ >
402
+
403
+ "nord-tooltip": DefineComponent<WCProps<Components.Tooltip> & {}>
404
+
405
+ "nord-top-bar": DefineComponent<WCProps<Components.TopBar> & {}>
406
+
407
+ "nord-visually-hidden": DefineComponent<WCProps<Components.VisuallyHidden> & {}>
408
+ }
409
+
410
+ declare module "vue" {
411
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
412
+ interface GlobalComponents extends NordComponents {}
413
+ }
414
+
415
+ declare global {
416
+ namespace JSX {
417
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
418
+ interface IntrinsicElements extends NordComponents {}
419
+ }
420
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nordhealth/components",
3
- "version": "4.0.0-alpha.2",
3
+ "version": "4.0.0",
4
4
  "description": "This package includes Nord Design System Web Components",
5
5
  "author": "Nordhealth <support@nordhealth.design>",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -20,7 +20,7 @@
20
20
  "start": "concurrently -k -n TSC,HTTP -c blue.bold,magenta.bold \"tsc -w --noEmit\" \"wds\"",
21
21
  "prebuild": "pnpm clean",
22
22
  "build": "rollup -c",
23
- "postbuild": "pnpm analyze",
23
+ "postbuild": "pnpm analyze && pnpm build:react-types && pnpm build:vue-types",
24
24
  "build:docker": "docker compose build test",
25
25
  "clean": "rm -rf lib/",
26
26
  "clean:snapshots": "rm -rf src/*/screenshots/*/failed/*.png",
@@ -30,30 +30,32 @@
30
30
  "test:capture": "pnpm test -- --update-visual-baseline",
31
31
  "test:local": "wtr --coverage --watch",
32
32
  "analyze": "custom-elements-manifest analyze --litelement",
33
- "scaffold": "node ./utils/scaffold.mjs"
33
+ "scaffold": "node ./scripts/scaffold.mjs",
34
+ "build:react-types": "node ./scripts/build-react-types.mjs",
35
+ "build:vue-types": "node ./scripts/build-vue-types.mjs"
34
36
  },
35
37
  "dependencies": {
36
- "@floating-ui/dom": "^1.6.11",
37
- "@nordhealth/icons": "^3.7.0",
38
- "@paulmillr/qr": "^0.3.0",
39
- "lit": "^3.2.0",
38
+ "@floating-ui/dom": "^1.6.13",
39
+ "@nordhealth/icons": "^3.7.1",
40
+ "lit": "^3.3.0",
41
+ "qr": "^0.4.2",
40
42
  "tinykeys": "^1.4.0"
41
43
  },
42
44
  "devDependencies": {
43
- "@custom-elements-manifest/analyzer": "^0.10.3",
45
+ "@custom-elements-manifest/analyzer": "^0.10.4",
44
46
  "@lit-labs/testing": "^0.2.7",
45
- "@nordhealth/css": "^4.0.0-alpha.2",
46
- "@nordhealth/fonts": "^3.0.2",
47
- "@nordhealth/themes": "^9.0.0-alpha.2",
48
- "@nordhealth/tokens": "^8.0.0-alpha.2",
47
+ "@nordhealth/css": "^4.0.0",
48
+ "@nordhealth/fonts": "^3.0.3",
49
+ "@nordhealth/themes": "^9.0.0",
50
+ "@nordhealth/tokens": "^8.0.0",
49
51
  "@open-wc/eslint-config": "^12.0.3",
50
52
  "@open-wc/testing": "^4.0.0",
51
53
  "@rollup/plugin-node-resolve": "^15.2.3",
52
54
  "@rollup/plugin-replace": "^5.0.7",
53
55
  "@rollup/plugin-terser": "^0.4.4",
54
56
  "@rollup/plugin-typescript": "^11.1.6",
55
- "@types/mocha": "^10.0.8",
56
- "@types/node": "^22.5.5",
57
+ "@types/mocha": "^10.0.10",
58
+ "@types/node": "^22.15.3",
57
59
  "@typescript-eslint/eslint-plugin": "^8.6.0",
58
60
  "@typescript-eslint/parser": "^8.6.0",
59
61
  "@web/dev-server": "^0.4.6",
@@ -62,14 +64,14 @@
62
64
  "@web/test-runner": "~0.16.1",
63
65
  "@web/test-runner-commands": "~0.7.0",
64
66
  "@web/test-runner-visual-regression": "~0.8.3",
65
- "concurrently": "^9.0.1",
67
+ "concurrently": "^9.1.2",
66
68
  "eslint": "^8.57.1",
67
69
  "eslint-config-prettier": "^9.1.0",
68
70
  "eslint-plugin-import": "^2.30.0",
69
71
  "eslint-plugin-lit": "^1.15.0",
70
72
  "eslint-plugin-lit-a11y": "^4.1.4",
71
73
  "eslint-plugin-wc": "^1.5.0",
72
- "glob": "^11.0.0",
74
+ "glob": "^11.0.2",
73
75
  "prettier": "^3.3.3",
74
76
  "rollup": "~4.21.3",
75
77
  "rollup-plugin-lit-css": "^5.0.1",
@@ -176,5 +178,5 @@
176
178
  }
177
179
  ]
178
180
  },
179
- "gitHead": "9ab4379321de78115736f8500aaa5a6c3e3f89fe"
181
+ "gitHead": "8cae3cda227b8a90d2dff83870aabc9658b87247"
180
182
  }