@skf-design-system/ui-components 1.0.0-beta.3 → 1.0.0-beta.5

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 (54) hide show
  1. package/README.md +26 -6
  2. package/dist/components/alert/alert.component.js +20 -18
  3. package/dist/components/alert/alert.styles.js +50 -47
  4. package/dist/components/button/button.component.d.ts +2 -0
  5. package/dist/components/button/button.component.js +5 -5
  6. package/dist/components/checkbox/checkbox.styles.js +6 -1
  7. package/dist/components/icon/icon.styles.js +56 -54
  8. package/dist/components/input/input.component.d.ts +9 -0
  9. package/dist/components/input/input.component.js +32 -24
  10. package/dist/components/radio/radio.styles.js +7 -2
  11. package/dist/components/select/select.component.d.ts +5 -2
  12. package/dist/components/select/select.component.js +99 -86
  13. package/dist/components/select/select.controllers.js +5 -2
  14. package/dist/components/select/select.styles.js +15 -0
  15. package/dist/components/select-option/select-option.component.d.ts +2 -2
  16. package/dist/components/select-option/select-option.component.js +16 -10
  17. package/dist/components/switch/switch.styles.js +5 -0
  18. package/dist/components/toast/toast.component.d.ts +35 -0
  19. package/dist/components/toast/toast.component.js +52 -0
  20. package/dist/components/toast/toast.d.ts +8 -0
  21. package/dist/components/toast/toast.js +6 -0
  22. package/dist/components/toast/toast.singleton.d.ts +26 -0
  23. package/dist/components/toast/toast.singleton.js +53 -0
  24. package/dist/components/toast/toast.style.d.ts +1 -0
  25. package/dist/components/toast/toast.style.js +9 -0
  26. package/dist/components/toast-item/toast-item.component.d.ts +21 -0
  27. package/dist/components/toast-item/toast-item.component.js +65 -0
  28. package/dist/components/toast-item/toast-item.d.ts +6 -0
  29. package/dist/components/toast-item/toast-item.js +2 -0
  30. package/dist/components/toast-item/toast-item.style.d.ts +2 -0
  31. package/dist/components/toast-item/toast-item.style.js +16 -0
  32. package/dist/components/toast-wrapper/toast-wrapper.component.d.ts +24 -0
  33. package/dist/components/toast-wrapper/toast-wrapper.component.js +37 -0
  34. package/dist/components/toast-wrapper/toast-wrapper.d.ts +8 -0
  35. package/dist/components/toast-wrapper/toast-wrapper.js +6 -0
  36. package/dist/components/toast-wrapper/toast-wrapper.style.d.ts +1 -0
  37. package/dist/components/toast-wrapper/toast-wrapper.style.js +20 -0
  38. package/dist/custom-elements.json +450 -12
  39. package/dist/index.d.ts +1 -0
  40. package/dist/index.js +43 -40
  41. package/dist/internal/components/hint/hint.component.js +12 -10
  42. package/dist/internal/components/hint/hint.styles.js +26 -10
  43. package/dist/react/index.d.ts +2 -0
  44. package/dist/react/index.js +2 -0
  45. package/dist/react/skf-toast/index.d.ts +3 -0
  46. package/dist/react/skf-toast/index.js +13 -0
  47. package/dist/react/skf-toast-wrapper/index.d.ts +3 -0
  48. package/dist/react/skf-toast-wrapper/index.js +13 -0
  49. package/dist/styles/form-field.styles.js +4 -0
  50. package/dist/types/jsx/custom-element-jsx.d.ts +41 -3
  51. package/dist/types/vue/index.d.ts +42 -2
  52. package/dist/vscode.html-custom-data.json +40 -1
  53. package/dist/web-types.json +90 -4
  54. package/package.json +3 -3
@@ -1,22 +1,38 @@
1
- import { css as s } from "lit";
2
- const o = s`
3
- :host {
1
+ import { css as r } from "lit";
2
+ const s = r`
3
+ #root {
4
4
  align-items: center;
5
5
  color: var(--_skf-hint-color, var(--skf-text-color-secondary));
6
6
  display: flex;
7
7
  font-size: var(--skf-font-size-75);
8
8
  font-weight: var(--skf-font-weight-medium);
9
9
  gap: var(--skf-spacing-25);
10
- }
11
10
 
12
- :host([severity='error']) {
13
- --_skf-hint-color: var(--skf-severity-fg-color-error);
14
- }
11
+ :host-context(:disabled) & {
12
+ color: inherit;
13
+ }
14
+
15
+ :host([severity='alert']) & {
16
+ --_skf-hint-color: var(--skf-severity-fg-color-alert);
17
+ }
18
+
19
+ :host([severity='error']) & {
20
+ --_skf-hint-color: var(--skf-severity-fg-color-error);
21
+ }
22
+
23
+ :host([severity='info']) & {
24
+ --_skf-hint-color: var(--skf-severity-fg-color-info);
25
+ }
26
+
27
+ :host([severity='success']) & {
28
+ --_skf-hint-color: var(--skf-severity-fg-color-success);
29
+ }
15
30
 
16
- :host([severity='success']) {
17
- --_skf-hint-color: var(--skf-severity-fg-color-success);
31
+ :host([severity='warning']) & {
32
+ --_skf-hint-color: var(--skf-severity-fg-color-warning);
33
+ }
18
34
  }
19
35
  `;
20
36
  export {
21
- o as default
37
+ s as default
22
38
  };
@@ -18,3 +18,5 @@ export { default as SkfSelectOptionGroup } from './skf-select-option-group/index
18
18
  export { default as SkfSwitch } from './skf-switch/index.js';
19
19
  export { default as SkfTag } from './skf-tag/index.js';
20
20
  export { default as SkfTextArea } from './skf-textarea/index.js';
21
+ export { default as SkfToast } from './skf-toast/index.js';
22
+ export { default as SkfToastWrapper } from './skf-toast-wrapper/index.js';
@@ -18,3 +18,5 @@ export { default as SkfSelectOptionGroup } from './skf-select-option-group/index
18
18
  export { default as SkfSwitch } from './skf-switch/index.js';
19
19
  export { default as SkfTag } from './skf-tag/index.js';
20
20
  export { default as SkfTextArea } from './skf-textarea/index.js';
21
+ export { default as SkfToast } from './skf-toast/index.js';
22
+ export { default as SkfToastWrapper } from './skf-toast-wrapper/index.js';
@@ -0,0 +1,3 @@
1
+ import Component from '../../components/toast/toast.js';
2
+ declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {}>;
3
+ export default reactWrapper;
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ import { createComponent } from '@lit/react';
3
+ import Component from '../../components/toast/toast.js';
4
+ const tagName = 'skf-toast';
5
+ Component.define('skf-toast');
6
+ const reactWrapper = createComponent({
7
+ tagName,
8
+ elementClass: Component,
9
+ react: React,
10
+ events: {},
11
+ displayName: 'SkfToast',
12
+ });
13
+ export default reactWrapper;
@@ -0,0 +1,3 @@
1
+ import Component from '../../components/toast-wrapper/toast-wrapper.js';
2
+ declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {}>;
3
+ export default reactWrapper;
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ import { createComponent } from '@lit/react';
3
+ import Component from '../../components/toast-wrapper/toast-wrapper.js';
4
+ const tagName = 'skf-toast-wrapper';
5
+ Component.define('skf-toast-wrapper');
6
+ const reactWrapper = createComponent({
7
+ tagName,
8
+ elementClass: Component,
9
+ react: React,
10
+ events: {},
11
+ displayName: 'SkfToastWrapper',
12
+ });
13
+ export default reactWrapper;
@@ -11,6 +11,10 @@ const i = e`
11
11
  display: grid;
12
12
  gap: var(--skf-spacing-25);
13
13
 
14
+ :host([disabled]) & {
15
+ --_skf-field-color: var(--skf-interactive-text-color-disabled);
16
+ }
17
+
14
18
  :host([size='sm']) & {
15
19
  font-size: var(--skf-font-size-75);
16
20
  font-weight: var(--skf-font-weight-medium);
@@ -846,9 +846,9 @@ export type SkfSelectProps = {
846
846
  /** Size of the Select */
847
847
  size?: "sm" | "md";
848
848
  /** A readonly property that returns the selected value(s) in a array */
849
- getSelectedValues?: string;
849
+ selectedValues?: string;
850
850
  /** A readonly property that returns the selected slot(s) text content in a array */
851
- getSelectedOptionsText?: string;
851
+ selectedOptionsText?: string;
852
852
  /** Read only, returns the selected value. (if multiple: in a comma separated string) */
853
853
  value?: string;
854
854
  /** */
@@ -871,7 +871,7 @@ export type SkfSelectOptionProps = {
871
871
  /** If defined, set an icon */
872
872
  icon?: SkfIcon["name"] | undefined;
873
873
  /** If defined, sets provided color on the icon */
874
- "icon-color"?: IconColor | undefined;
874
+ "icon-color"?: SeverityFgColor | undefined;
875
875
  /** If true, sets the option as selected */
876
876
  selected?: boolean | undefined;
877
877
  /** If defined, sets a short label */
@@ -1132,6 +1132,24 @@ export type SkfTextAreaProps = {
1132
1132
  oninvalid?: (e: CustomEvent<never>) => void;
1133
1133
  };
1134
1134
 
1135
+ export type SkfToastProps = {
1136
+ /** If provided, adds a close button to the toast and will not disapear until user actively dismisses it. */
1137
+ closeable?: boolean;
1138
+ /** */
1139
+ debug?: boolean;
1140
+ /** Severity of the toast. */
1141
+ severity?: "info" | "success" | "warning" | "error";
1142
+ /** Time in seconds before the toast disappears. */
1143
+ timer?: number;
1144
+ /** offsets where toasts emerge vertically */
1145
+ topOffset?: number | undefined;
1146
+ };
1147
+
1148
+ export type SkfToastWrapperProps = {
1149
+ /** */
1150
+ debug?: boolean;
1151
+ };
1152
+
1135
1153
  export type CustomElements = {
1136
1154
  /**
1137
1155
  * The `<skf-accordion>` component consists of multiple `<skf-collapse>`, working together.
@@ -1368,4 +1386,24 @@ export type CustomElements = {
1368
1386
  * - _default_ - The textareas label. Alternatively, you can use the `label` attribute.
1369
1387
  */
1370
1388
  "skf-textarea": Partial<SkfTextAreaProps & BaseProps & BaseEvents>;
1389
+
1390
+ /**
1391
+ * A simple toast component that displays a message to the user. Use by appending a &lt;skf-toast&gt; tag to the DOM. Position in DOM is irrelevant.
1392
+ * ---
1393
+ *
1394
+ *
1395
+ * ### **Slots:**
1396
+ * - _default_ - The component's placeholder content
1397
+ */
1398
+ "skf-toast": Partial<SkfToastProps & BaseProps & BaseEvents>;
1399
+
1400
+ /**
1401
+ * The `<skf-toast-wrapper>` is a component without UI that positions where the toast shows up on the screen. The toast-wrapper is used internally by the toast component.
1402
+ * ---
1403
+ *
1404
+ *
1405
+ * ### **Slots:**
1406
+ * - _default_ - The alert components that the toast creates will render here.
1407
+ */
1408
+ "skf-toast-wrapper": Partial<SkfToastWrapperProps & BaseProps & BaseEvents>;
1371
1409
  };
@@ -20,6 +20,8 @@ import type { SkfSelectOptionGroup } from "../../components/select-option-group/
20
20
  import type { SkfSwitch } from "../../components/switch/switch.component.js";
21
21
  import type { SkfTag } from "../../components/tag/tag.component.js";
22
22
  import type { SkfTextArea } from "../../components/textarea/textarea.component.js";
23
+ import type { SkfToast } from "../../components/toast/toast.component.js";
24
+ import type { SkfToastWrapper } from "../../components/toast-wrapper/toast-wrapper.component.js";
23
25
 
24
26
  type SkfAccordionProps = {
25
27
  /** If true, will animate the expand/collapse state */
@@ -334,9 +336,9 @@ type SkfSelectProps = {
334
336
  /** Size of the Select */
335
337
  size?: SkfSelect["size"];
336
338
  /** A readonly property that returns the selected value(s) in a array */
337
- getSelectedValues?: SkfSelect["getSelectedValues"];
339
+ selectedValues?: SkfSelect["selectedValues"];
338
340
  /** A readonly property that returns the selected slot(s) text content in a array */
339
- getSelectedOptionsText?: SkfSelect["getSelectedOptionsText"];
341
+ selectedOptionsText?: SkfSelect["selectedOptionsText"];
340
342
  /** Read only, returns the selected value. (if multiple: in a comma separated string) */
341
343
  value?: SkfSelect["value"];
342
344
  /** */
@@ -469,6 +471,24 @@ type SkfTextAreaProps = {
469
471
  oninvalid?: (e: CustomEvent<never>) => void;
470
472
  };
471
473
 
474
+ type SkfToastProps = {
475
+ /** If provided, adds a close button to the toast and will not disapear until user actively dismisses it. */
476
+ closeable?: SkfToast["closeable"];
477
+ /** */
478
+ debug?: SkfToast["debug"];
479
+ /** Severity of the toast. */
480
+ severity?: SkfToast["severity"];
481
+ /** Time in seconds before the toast disappears. */
482
+ timer?: SkfToast["timer"];
483
+ /** offsets where toasts emerge vertically */
484
+ topOffset?: SkfToast["topOffset"];
485
+ };
486
+
487
+ type SkfToastWrapperProps = {
488
+ /** */
489
+ debug?: SkfToastWrapper["debug"];
490
+ };
491
+
472
492
  export type CustomElements = {
473
493
  /**
474
494
  * The `<skf-accordion>` component consists of multiple `<skf-collapse>`, working together.
@@ -705,6 +725,26 @@ export type CustomElements = {
705
725
  * - _default_ - The textareas label. Alternatively, you can use the `label` attribute.
706
726
  */
707
727
  "skf-textarea": DefineComponent<SkfTextAreaProps>;
728
+
729
+ /**
730
+ * A simple toast component that displays a message to the user. Use by appending a &lt;skf-toast&gt; tag to the DOM. Position in DOM is irrelevant.
731
+ * ---
732
+ *
733
+ *
734
+ * ### **Slots:**
735
+ * - _default_ - The component's placeholder content
736
+ */
737
+ "skf-toast": DefineComponent<SkfToastProps>;
738
+
739
+ /**
740
+ * The `<skf-toast-wrapper>` is a component without UI that positions where the toast shows up on the screen. The toast-wrapper is used internally by the toast component.
741
+ * ---
742
+ *
743
+ *
744
+ * ### **Slots:**
745
+ * - _default_ - The alert components that the toast creates will render here.
746
+ */
747
+ "skf-toast-wrapper": DefineComponent<SkfToastWrapperProps>;
708
748
  };
709
749
 
710
750
  declare module "vue" {
@@ -1308,7 +1308,7 @@
1308
1308
  {
1309
1309
  "name": "icon-color",
1310
1310
  "description": "If defined, sets provided color on the icon",
1311
- "values": [{ "name": "IconColor" }]
1311
+ "values": [{ "name": "SeverityFgColor" }]
1312
1312
  },
1313
1313
  {
1314
1314
  "name": "selected",
@@ -1691,6 +1691,45 @@
1691
1691
  }
1692
1692
  ],
1693
1693
  "references": []
1694
+ },
1695
+ {
1696
+ "name": "skf-toast",
1697
+ "description": "A simple toast component that displays a message to the user. Use by appending a &lt;skf-toast&gt; tag to the DOM. Position in DOM is irrelevant.\n---\n\n\n### **Slots:**\n - _default_ - The component's placeholder content",
1698
+ "attributes": [
1699
+ {
1700
+ "name": "closeable",
1701
+ "description": "If provided, adds a close button to the toast and will not disapear until user actively dismisses it.",
1702
+ "values": []
1703
+ },
1704
+ { "name": "debug", "values": [] },
1705
+ {
1706
+ "name": "severity",
1707
+ "description": "Severity of the toast.",
1708
+ "values": [
1709
+ { "name": "info" },
1710
+ { "name": "success" },
1711
+ { "name": "warning" },
1712
+ { "name": "error" }
1713
+ ]
1714
+ },
1715
+ {
1716
+ "name": "timer",
1717
+ "description": "Time in seconds before the toast disappears.",
1718
+ "values": []
1719
+ },
1720
+ {
1721
+ "name": "topOffset",
1722
+ "description": "offsets where toasts emerge vertically",
1723
+ "values": []
1724
+ }
1725
+ ],
1726
+ "references": []
1727
+ },
1728
+ {
1729
+ "name": "skf-toast-wrapper",
1730
+ "description": "The `<skf-toast-wrapper>` is a component without UI that positions where the toast shows up on the screen. The toast-wrapper is used internally by the toast component.\n---\n\n\n### **Slots:**\n - _default_ - The alert components that the toast creates will render here.",
1731
+ "attributes": [{ "name": "debug", "values": [] }],
1732
+ "references": []
1694
1733
  }
1695
1734
  ]
1696
1735
  }
@@ -1532,11 +1532,11 @@
1532
1532
  "type": "string | undefined"
1533
1533
  },
1534
1534
  {
1535
- "name": "getSelectedValues",
1535
+ "name": "selectedValues",
1536
1536
  "description": "A readonly property that returns the selected value(s) in a array"
1537
1537
  },
1538
1538
  {
1539
- "name": "getSelectedOptionsText",
1539
+ "name": "selectedOptionsText",
1540
1540
  "description": "A readonly property that returns the selected slot(s) text content in a array"
1541
1541
  },
1542
1542
  {
@@ -1632,7 +1632,7 @@
1632
1632
  {
1633
1633
  "name": "icon-color",
1634
1634
  "description": "If defined, sets provided color on the icon",
1635
- "value": { "type": "IconColor | undefined" }
1635
+ "value": { "type": "SeverityFgColor | undefined" }
1636
1636
  },
1637
1637
  {
1638
1638
  "name": "selected",
@@ -1678,7 +1678,7 @@
1678
1678
  {
1679
1679
  "name": "iconColor",
1680
1680
  "description": "If defined, sets provided color on the icon",
1681
- "type": "IconColor | undefined"
1681
+ "type": "SeverityFgColor | undefined"
1682
1682
  },
1683
1683
  {
1684
1684
  "name": "selected",
@@ -2136,6 +2136,92 @@
2136
2136
  }
2137
2137
  ]
2138
2138
  }
2139
+ },
2140
+ {
2141
+ "name": "skf-toast",
2142
+ "description": "A simple toast component that displays a message to the user. Use by appending a &lt;skf-toast&gt; tag to the DOM. Position in DOM is irrelevant.\n---\n\n\n### **Slots:**\n - _default_ - The component's placeholder content",
2143
+ "doc-url": "",
2144
+ "attributes": [
2145
+ {
2146
+ "name": "closeable",
2147
+ "description": "If provided, adds a close button to the toast and will not disapear until user actively dismisses it.",
2148
+ "value": { "type": "boolean", "default": "false" }
2149
+ },
2150
+ {
2151
+ "name": "debug",
2152
+ "value": { "type": "boolean", "default": "false" }
2153
+ },
2154
+ {
2155
+ "name": "severity",
2156
+ "description": "Severity of the toast.",
2157
+ "value": {
2158
+ "type": "'info' | 'success' | 'warning' | 'error'",
2159
+ "default": "'info'"
2160
+ }
2161
+ },
2162
+ {
2163
+ "name": "timer",
2164
+ "description": "Time in seconds before the toast disappears.",
2165
+ "value": { "type": "number", "default": "5" }
2166
+ },
2167
+ {
2168
+ "name": "topOffset",
2169
+ "description": "offsets where toasts emerge vertically",
2170
+ "value": { "type": "number | undefined" }
2171
+ }
2172
+ ],
2173
+ "slots": [
2174
+ { "name": "", "description": "The component's placeholder content" }
2175
+ ],
2176
+ "events": [],
2177
+ "js": {
2178
+ "properties": [
2179
+ {
2180
+ "name": "closeable",
2181
+ "description": "If provided, adds a close button to the toast and will not disapear until user actively dismisses it.",
2182
+ "type": "boolean"
2183
+ },
2184
+ { "name": "debug", "type": "boolean" },
2185
+ {
2186
+ "name": "severity",
2187
+ "description": "Severity of the toast.",
2188
+ "type": "'info' | 'success' | 'warning' | 'error'"
2189
+ },
2190
+ {
2191
+ "name": "timer",
2192
+ "description": "Time in seconds before the toast disappears.",
2193
+ "type": "number"
2194
+ },
2195
+ {
2196
+ "name": "topOffset",
2197
+ "description": "offsets where toasts emerge vertically",
2198
+ "type": "number | undefined"
2199
+ }
2200
+ ],
2201
+ "events": []
2202
+ }
2203
+ },
2204
+ {
2205
+ "name": "skf-toast-wrapper",
2206
+ "description": "The `<skf-toast-wrapper>` is a component without UI that positions where the toast shows up on the screen. The toast-wrapper is used internally by the toast component.\n---\n\n\n### **Slots:**\n - _default_ - The alert components that the toast creates will render here.",
2207
+ "doc-url": "",
2208
+ "attributes": [
2209
+ {
2210
+ "name": "debug",
2211
+ "value": { "type": "boolean", "default": "false" }
2212
+ }
2213
+ ],
2214
+ "slots": [
2215
+ {
2216
+ "name": "",
2217
+ "description": "The alert components that the toast creates will render here."
2218
+ }
2219
+ ],
2220
+ "events": [],
2221
+ "js": {
2222
+ "properties": [{ "name": "debug", "type": "boolean" }],
2223
+ "events": []
2224
+ }
2139
2225
  }
2140
2226
  ]
2141
2227
  }
package/package.json CHANGED
@@ -34,7 +34,7 @@
34
34
  "sideEffects": true,
35
35
  "type": "module",
36
36
  "types": "./dist/index.d.ts",
37
- "version": "1.0.0-beta.3",
37
+ "version": "1.0.0-beta.5",
38
38
  "dependencies": {
39
39
  "@floating-ui/dom": "^1.6.11"
40
40
  },
@@ -47,6 +47,7 @@
47
47
  "@lit/react": "^1.0.6",
48
48
  "@playwright/test": "^1.48.1",
49
49
  "@skf-design-system/ui-assets": "0.1.3-beta.1",
50
+ "@skf-design-system/wc-storybook-helpers": "^0.0.1",
50
51
  "@storybook/addon-a11y": "^8.3.6",
51
52
  "@storybook/addon-essentials": "^8.3.6",
52
53
  "@storybook/addon-interactions": "^8.3.6",
@@ -89,8 +90,7 @@
89
90
  "typescript": "^5.6.3",
90
91
  "typescript-eslint": "^8.10.0",
91
92
  "vite": "^5.4.9",
92
- "vite-tsconfig-paths": "^5.0.1",
93
- "wc-storybook-helpers": "^2.0.3"
93
+ "vite-tsconfig-paths": "^5.0.1"
94
94
  },
95
95
  "peerDependencies": {
96
96
  "@lit/react": "^1.0.5",