@warp-ds/elements 2.2.0-next.7 → 2.2.0-next.9

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 (67) hide show
  1. package/dist/api.js +1 -1
  2. package/dist/api.js.map +4 -4
  3. package/dist/custom-elements.json +1826 -1424
  4. package/dist/index.d.ts +1 -0
  5. package/dist/index.js +1256 -137
  6. package/dist/index.js.map +4 -4
  7. package/dist/packages/alert/index.js.map +1 -1
  8. package/dist/packages/alert/react.js.map +1 -1
  9. package/dist/packages/attention/attention.stories.d.ts +5 -0
  10. package/dist/packages/attention/attention.test.d.ts +1 -0
  11. package/dist/packages/attention/index.d.ts +48 -89
  12. package/dist/packages/attention/index.js +3354 -16
  13. package/dist/packages/attention/index.js.map +4 -4
  14. package/dist/packages/attention/layout-styles.d.ts +1 -0
  15. package/dist/packages/attention/react.d.ts +1 -0
  16. package/dist/packages/attention/react.js +3405 -0
  17. package/dist/packages/attention/react.js.map +7 -0
  18. package/dist/packages/attention/styles.d.ts +1 -0
  19. package/dist/packages/button/index.d.ts +1 -0
  20. package/dist/packages/button/index.js +214 -9
  21. package/dist/packages/button/index.js.map +4 -4
  22. package/dist/packages/button/react.js +213 -8
  23. package/dist/packages/button/react.js.map +4 -4
  24. package/dist/packages/datepicker/DatePicker.test.d.ts +1 -0
  25. package/dist/packages/datepicker/datepicker.d.ts +9 -0
  26. package/dist/packages/datepicker/index.js +87 -83
  27. package/dist/packages/datepicker/index.js.map +3 -3
  28. package/dist/packages/datepicker/react.d.ts +2 -0
  29. package/dist/packages/datepicker/react.js +2805 -0
  30. package/dist/packages/datepicker/react.js.map +7 -0
  31. package/dist/packages/link/index.d.ts +39 -0
  32. package/dist/packages/link/index.js +2646 -0
  33. package/dist/packages/link/index.js.map +7 -0
  34. package/dist/packages/link/link.stories.d.ts +20 -0
  35. package/dist/packages/link/link.test.d.ts +1 -0
  36. package/dist/packages/link/react.d.ts +2 -0
  37. package/dist/packages/link/react.js +2666 -0
  38. package/dist/packages/link/react.js.map +7 -0
  39. package/dist/packages/link/styles.d.ts +1 -0
  40. package/dist/packages/steps/index.d.ts +43 -0
  41. package/dist/packages/steps/index.js +2465 -0
  42. package/dist/packages/steps/index.js.map +7 -0
  43. package/dist/packages/steps/locales/da/messages.d.mts +1 -0
  44. package/dist/packages/steps/locales/en/messages.d.mts +1 -0
  45. package/dist/packages/steps/locales/fi/messages.d.mts +1 -0
  46. package/dist/packages/steps/locales/nb/messages.d.mts +1 -0
  47. package/dist/packages/steps/locales/sv/messages.d.mts +1 -0
  48. package/dist/packages/steps/react.d.ts +3 -0
  49. package/dist/packages/steps/react.js +2485 -0
  50. package/dist/packages/steps/react.js.map +7 -0
  51. package/dist/packages/steps/steps.stories.d.ts +12 -0
  52. package/dist/packages/steps/styles.d.ts +1 -0
  53. package/dist/packages/textfield/index.js +1 -1
  54. package/dist/packages/textfield/index.js.map +2 -2
  55. package/dist/packages/textfield/react.js +1 -1
  56. package/dist/packages/textfield/react.js.map +2 -2
  57. package/dist/packages/toast/api.d.ts +4 -45
  58. package/dist/packages/toast/index.d.ts +3 -3
  59. package/dist/packages/toast/index.js +2461 -22
  60. package/dist/packages/toast/index.js.map +4 -4
  61. package/dist/packages/toast/styles.d.ts +1 -0
  62. package/dist/packages/toast/toast-container.d.ts +12 -78
  63. package/dist/packages/toast/toast.d.ts +16 -29
  64. package/dist/packages/toast/types.d.ts +15 -0
  65. package/dist/vscode.html-custom-data.json +86 -34
  66. package/dist/web-types.json +199 -99
  67. package/package.json +11 -9
@@ -0,0 +1 @@
1
+ export declare const styles: import("lit").CSSResult;
@@ -1,82 +1,16 @@
1
- /**
2
- * Toast helper function options
3
- * @typedef {Object} ToastOptions
4
- * @property {(number|string)} [id] Custom identifier
5
- * @property {('success'|'error'|'warning')} [type] Type of alert
6
- * @property {String} [text] The toast message. Only needed when updating text on existing toast
7
- * @property {(number|string)} [duration] Duration of toast in milliseconds. Defaults to 5000. For accessibility reasons, toasts should never be interactive and therefore need to auto remove. If you must disable auto remove, set duration to Number.POSITIVE_INFINITY.
8
- * @property {Boolean} [canClose] Whether the toast can be dismissed. Defaults to false. WARNING! For accessibility reasons, toasts should not be interactive and canclose should always be false. If the toast absolutely must be dismissble, set this to true.
9
- */
10
- /**
11
- * You should probably not include this component in HTML markup.
12
- *
13
- * As long as the element definition is imported in your application you can use the toast JS API to create toasts.
14
- *
15
- * ```js
16
- * import from '@warp-ds/elements/components/toast';
17
- * import { toast, removeToast, updateToast } from '@warp-ds/elements/toast';
18
- * ```
19
- *
20
- * [See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/overlays-toast--docs)
21
- *
22
- * @internal
23
- */
24
- export class WarpToastContainer extends WarpElement {
25
- static styles: (import("lit").CSSResult | (import("lit").CSSResult | CSSStyleSheet | import("lit").CSSResultArray)[])[];
26
- static properties: {
27
- /** @internal */
28
- _toasts: {
29
- state: boolean;
30
- };
31
- };
1
+ import { LitElement } from 'lit';
2
+ import type { ToastOptions, ToastInternal } from './types';
3
+ export declare class WarpToastContainer extends LitElement {
4
+ static styles: import("lit").CSSResult[];
5
+ private _toasts;
6
+ private _interval;
7
+ connectedCallback(): void;
8
+ disconnectedCallback(): void;
32
9
  static init(): Element;
33
- _toasts: Map<any, any>;
34
- _interval: NodeJS.Timeout;
35
10
  /** @internal */
36
- get _toastsArray(): any[];
37
- /**
38
- *
39
- * @param {String|Number} id
40
- * @returns {ToastOptions}
41
- */
42
- get(id: string | number): ToastOptions;
43
- /**
44
- *
45
- * @param {Object} toast
46
- * @returns {WarpToastContainer}
47
- */
48
- set(toast: any): WarpToastContainer;
49
- /**
50
- *
51
- * @param {String|Number} id
52
- * @returns {ToastOptions | false}
53
- */
54
- del(id: string | number): ToastOptions | false;
11
+ get _toastsArray(): ToastInternal[];
12
+ get(id: string | number): ToastInternal | undefined;
13
+ set(toast: ToastOptions): Map<string | number, ToastInternal>;
14
+ del(id: string | number): Promise<boolean>;
55
15
  render(): import("lit").TemplateResult<1>;
56
16
  }
57
- /**
58
- * Toast helper function options
59
- */
60
- export type ToastOptions = {
61
- /**
62
- * Custom identifier
63
- */
64
- id?: (number | string);
65
- /**
66
- * Type of alert
67
- */
68
- type?: ("success" | "error" | "warning");
69
- /**
70
- * The toast message. Only needed when updating text on existing toast
71
- */
72
- text?: string;
73
- /**
74
- * Duration of toast in milliseconds. Defaults to 5000. For accessibility reasons, toasts should never be interactive and therefore need to auto remove. If you must disable auto remove, set duration to Number.POSITIVE_INFINITY.
75
- */
76
- duration?: (number | string);
77
- /**
78
- * Whether the toast can be dismissed. Defaults to false. WARNING! For accessibility reasons, toasts should not be interactive and canclose should always be false. If the toast absolutely must be dismissble, set this to true.
79
- */
80
- canClose?: boolean;
81
- };
82
- import WarpElement from '@warp-ds/elements-core';
@@ -1,3 +1,9 @@
1
+ import { LitElement } from 'lit';
2
+ import '@warp-ds/icons/elements/warning-16';
3
+ import '@warp-ds/icons/elements/error-16';
4
+ import '@warp-ds/icons/elements/success-16';
5
+ import '@warp-ds/icons/elements/close-16';
6
+ import type { ToastType } from './types';
1
7
  /**
2
8
  * You should probably not include this component in HTML markup.
3
9
  *
@@ -12,35 +18,18 @@
12
18
  *
13
19
  * @internal
14
20
  */
15
- export class WarpToast extends WarpElement {
16
- static styles: (import("lit").CSSResult | (import("lit").CSSResult | CSSStyleSheet | import("lit").CSSResultArray)[])[];
17
- static properties: {
18
- id: {
19
- type: StringConstructor;
20
- attribute: boolean;
21
- reflect: boolean;
22
- };
23
- type: {
24
- type: StringConstructor;
25
- attribute: boolean;
26
- reflect: boolean;
27
- };
28
- text: {
29
- type: StringConstructor;
30
- attribute: boolean;
31
- reflect: boolean;
32
- };
33
- canclose: {
34
- type: BooleanConstructor;
35
- attribute: boolean;
36
- reflect: boolean;
37
- };
38
- };
39
- type: string;
21
+ export declare class WarpToast extends LitElement {
22
+ #private;
23
+ static styles: import("lit").CSSResult[];
24
+ id: string;
25
+ type: ToastType;
40
26
  text: string;
41
27
  canclose: boolean;
28
+ private _expanded;
29
+ constructor();
30
+ connectedCallback(): void;
31
+ disconnectedCallback(): void;
42
32
  updated(): void;
43
- _expanded: boolean;
44
33
  /** @internal */
45
34
  get _wrapper(): HTMLElement;
46
35
  /** @internal */
@@ -53,9 +42,7 @@ export class WarpToast extends WarpElement {
53
42
  get _typeLabel(): string;
54
43
  /** @internal */
55
44
  get _iconMarkup(): import("lit").TemplateResult<1>;
56
- collapse(): Promise<any>;
45
+ collapse(): Promise<void>;
57
46
  close(): void;
58
47
  render(): import("lit").TemplateResult<1>;
59
- #private;
60
48
  }
61
- import WarpElement from '@warp-ds/elements-core';
@@ -0,0 +1,15 @@
1
+ export type ToastType = 'success' | 'error' | 'warning';
2
+ export interface ToastOptions {
3
+ id?: string | number;
4
+ type?: ToastType;
5
+ text?: string;
6
+ duration?: number;
7
+ canclose?: boolean;
8
+ }
9
+ export interface ToastInternal {
10
+ id: string | number;
11
+ type: ToastType;
12
+ text: string;
13
+ duration: number;
14
+ canclose: boolean;
15
+ }
@@ -2,6 +2,25 @@
2
2
  "$schema": "https://raw.githubusercontent.com/microsoft/vscode-html-languageservice/main/docs/customData.schema.json",
3
3
  "version": 1.1,
4
4
  "tags": [
5
+ {
6
+ "name": "w-affix",
7
+ "description": "This component is usually used in other components like form elements to show a prefix or suffix. See for example `w-textfield`.\n\n[See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/forms-affix--docs)\n\n---\n\n",
8
+ "attributes": [
9
+ { "name": "aria-label", "values": [] },
10
+ {
11
+ "name": "clear",
12
+ "description": "Add this property to render a clickable Warp close icon.\n\nSet an `aria-label` that explains the action when using this.",
13
+ "values": []
14
+ },
15
+ {
16
+ "name": "search",
17
+ "description": "Add this property to render a clickable Warp search icon.\n\nSet an `aria-label` that explains the action when using this.",
18
+ "values": []
19
+ },
20
+ { "name": "label", "values": [] }
21
+ ],
22
+ "references": []
23
+ },
5
24
  {
6
25
  "name": "w-alert",
7
26
  "description": "Alert is an inline component used for displaying different types of messages.\n\nFor accessibility reasons, alert should appear close to the element that triggered it.\n\n[See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/feedback-alert--docs)\n\n---\n\n",
@@ -21,21 +40,25 @@
21
40
  "references": []
22
41
  },
23
42
  {
24
- "name": "w-affix",
25
- "description": "This component is usually used in other components like form elements to show a prefix or suffix. See for example `w-textfield`.\n\n[See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/forms-affix--docs)\n\n---\n\n",
43
+ "name": "w-attention",
44
+ "description": "\n\n---\n\n",
26
45
  "attributes": [
27
- { "name": "aria-label", "values": [] },
28
- {
29
- "name": "clear",
30
- "description": "Add this property to render a clickable Warp close icon.\n\nSet an `aria-label` that explains the action when using this.",
31
- "values": []
32
- },
46
+ { "name": "show", "values": [] },
47
+ { "name": "placement", "values": [{ "name": "Directions" }] },
48
+ { "name": "tooltip", "values": [] },
49
+ { "name": "callout", "values": [] },
50
+ { "name": "popover", "values": [] },
51
+ { "name": "highlight", "values": [] },
52
+ { "name": "can-close", "values": [] },
53
+ { "name": "no-arrow", "values": [] },
54
+ { "name": "distance", "values": [] },
55
+ { "name": "skidding", "values": [] },
56
+ { "name": "flip", "values": [] },
57
+ { "name": "cross-axis", "values": [] },
33
58
  {
34
- "name": "search",
35
- "description": "Add this property to render a clickable Warp search icon.\n\nSet an `aria-label` that explains the action when using this.",
36
- "values": []
37
- },
38
- { "name": "label", "values": [] }
59
+ "name": "fallback-placements",
60
+ "values": [{ "name": "Directions[]" }]
61
+ }
39
62
  ],
40
63
  "references": []
41
64
  },
@@ -86,6 +109,37 @@
86
109
  "attributes": [{ "name": "aria-label", "values": [] }],
87
110
  "references": []
88
111
  },
112
+ {
113
+ "name": "w-link",
114
+ "description": "Buttons are used to perform actions, with different visuals for different needs.\n\n[See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/buttons-link--docs)\n\n---\n\n",
115
+ "attributes": [
116
+ { "name": "autofocus", "values": [] },
117
+ {
118
+ "name": "variant",
119
+ "values": [
120
+ { "name": "negative" },
121
+ { "name": "primary" },
122
+ { "name": "secondary" },
123
+ { "name": "negativeQuiet" },
124
+ { "name": "utility" },
125
+ { "name": "pill" },
126
+ { "name": "link" },
127
+ { "name": "quiet" },
128
+ { "name": "utilityQuiet" }
129
+ ]
130
+ },
131
+ { "name": "quiet", "values": [] },
132
+ { "name": "small", "values": [] },
133
+ { "name": "href", "values": [] },
134
+ { "name": "disabled", "values": [] },
135
+ { "name": "target", "values": [] },
136
+ { "name": "rel", "values": [] },
137
+ { "name": "full-width", "values": [] },
138
+ { "name": "button-class", "values": [] },
139
+ { "name": "name", "values": [] }
140
+ ],
141
+ "references": []
142
+ },
89
143
  {
90
144
  "name": "w-button",
91
145
  "description": "Buttons are used to perform actions, widh different visuals for different needs.\n\n[See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/buttons-button--docs)\n\n---\n\n",
@@ -312,6 +366,24 @@
312
366
  ],
313
367
  "references": []
314
368
  },
369
+ {
370
+ "name": "w-steps",
371
+ "description": "Steps are used to show progress through a process or to guide users through a multi-step task.\n\n[See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/components-steps--docs)\n\n---\n\n",
372
+ "attributes": [
373
+ { "name": "horizontal", "values": [] },
374
+ { "name": "right", "values": [] }
375
+ ],
376
+ "references": []
377
+ },
378
+ {
379
+ "name": "w-step",
380
+ "description": "Individual step component that shows a single step in a process\n\n---\n\n",
381
+ "attributes": [
382
+ { "name": "active", "values": [] },
383
+ { "name": "completed", "values": [] }
384
+ ],
385
+ "references": []
386
+ },
315
387
  {
316
388
  "name": "w-switch",
317
389
  "description": "\n\n---\n\n\n\n### **Events:**\n - **change**",
@@ -329,7 +401,7 @@
329
401
  { "name": "invalid", "values": [] },
330
402
  { "name": "id", "values": [] },
331
403
  { "name": "label", "values": [] },
332
- { "name": "helpText", "values": [] },
404
+ { "name": "help-text", "values": [] },
333
405
  { "name": "size", "values": [] },
334
406
  { "name": "max", "values": [] },
335
407
  { "name": "min", "values": [] },
@@ -344,26 +416,6 @@
344
416
  { "name": "name", "values": [] }
345
417
  ],
346
418
  "references": []
347
- },
348
- {
349
- "name": "w-attention",
350
- "description": "\n\n---\n\n",
351
- "attributes": [
352
- { "name": "show", "values": [] },
353
- { "name": "placement", "values": [] },
354
- { "name": "tooltip", "values": [] },
355
- { "name": "callout", "values": [] },
356
- { "name": "popover", "values": [] },
357
- { "name": "highlight", "values": [] },
358
- { "name": "canClose", "values": [] },
359
- { "name": "noArrow", "values": [] },
360
- { "name": "distance", "values": [] },
361
- { "name": "skidding", "values": [] },
362
- { "name": "flip", "values": [] },
363
- { "name": "crossAxis", "values": [] },
364
- { "name": "fallbackPlacements", "values": [{ "name": "array" }] }
365
- ],
366
- "references": []
367
419
  }
368
420
  ]
369
421
  }