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

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 (102) hide show
  1. package/dist/components/accordion/accordion.component.d.ts +9 -5
  2. package/dist/components/accordion/accordion.component.js +22 -19
  3. package/dist/components/accordion/accordion.d.ts +1 -1
  4. package/dist/components/accordion/accordion.styles.js +3 -3
  5. package/dist/components/alert/alert.component.d.ts +7 -4
  6. package/dist/components/alert/alert.component.js +1 -1
  7. package/dist/components/alert/alert.styles.js +1 -1
  8. package/dist/components/button/button.component.js +1 -1
  9. package/dist/components/button/button.styles.js +1 -1
  10. package/dist/components/card/card.component.d.ts +3 -3
  11. package/dist/components/card/card.component.js +16 -19
  12. package/dist/components/card/card.styles.js +11 -3
  13. package/dist/components/checkbox/checkbox.component.d.ts +9 -6
  14. package/dist/components/checkbox/checkbox.component.js +8 -8
  15. package/dist/components/checkbox/checkbox.styles.js +1 -1
  16. package/dist/components/checkbox/checkbox.test.d.ts +1 -0
  17. package/dist/components/collapse/collapse.component.d.ts +9 -6
  18. package/dist/components/collapse/collapse.component.js +39 -36
  19. package/dist/components/collapse/collapse.styles.js +3 -3
  20. package/dist/components/collapse/collapse.test.d.ts +1 -0
  21. package/dist/components/divider/divider.component.d.ts +13 -10
  22. package/dist/components/divider/divider.component.js +34 -29
  23. package/dist/components/divider/divider.styles.js +1 -5
  24. package/dist/components/heading/heading.component.d.ts +12 -2
  25. package/dist/components/heading/heading.component.js +14 -14
  26. package/dist/components/heading/heading.styles.js +1 -1
  27. package/dist/components/icon/icon.component.d.ts +14 -8
  28. package/dist/components/icon/icon.component.js +6 -6
  29. package/dist/components/icon/icon.styles.js +1 -1
  30. package/dist/components/input/input.component.d.ts +34 -29
  31. package/dist/components/input/input.component.js +36 -36
  32. package/dist/components/link/link.component.d.ts +15 -12
  33. package/dist/components/link/link.component.js +7 -7
  34. package/dist/components/link/link.styles.js +1 -1
  35. package/dist/components/loader/loader.component.d.ts +7 -7
  36. package/dist/components/loader/loader.component.js +35 -61
  37. package/dist/components/loader/loader.styles.js +42 -10
  38. package/dist/components/logo/logo.component.d.ts +5 -3
  39. package/dist/components/logo/logo.component.js +8 -8
  40. package/dist/components/logo/logo.styles.js +2 -2
  41. package/dist/components/radio/radio.component.d.ts +15 -13
  42. package/dist/components/radio/radio.component.js +3 -3
  43. package/dist/components/radio/radio.styles.js +3 -3
  44. package/dist/components/select/select.component.d.ts +137 -0
  45. package/dist/components/select/select.component.js +311 -0
  46. package/dist/components/select/select.controllers.d.ts +59 -0
  47. package/dist/components/select/select.controllers.js +169 -0
  48. package/dist/components/select/select.d.ts +8 -0
  49. package/dist/components/select/select.js +6 -0
  50. package/dist/components/select/select.styles.d.ts +1 -0
  51. package/dist/components/select/select.styles.js +116 -0
  52. package/dist/components/select-option/select-option.component.d.ts +77 -0
  53. package/dist/components/select-option/select-option.component.js +117 -0
  54. package/dist/components/select-option/select-option.controllers.d.ts +9 -0
  55. package/dist/components/select-option/select-option.d.ts +8 -0
  56. package/dist/components/select-option/select-option.js +6 -0
  57. package/dist/components/select-option/select-option.styles.d.ts +1 -0
  58. package/dist/components/select-option/select-option.styles.js +53 -0
  59. package/dist/components/select-option-group/select-option-group.component.d.ts +16 -0
  60. package/dist/components/select-option-group/select-option-group.component.js +31 -0
  61. package/dist/components/select-option-group/select-option-group.d.ts +8 -0
  62. package/dist/components/select-option-group/select-option-group.js +6 -0
  63. package/dist/components/select-option-group/select-option-group.style.d.ts +1 -0
  64. package/dist/components/select-option-group/select-option-group.style.js +18 -0
  65. package/dist/components/switch/switch.component.d.ts +2 -3
  66. package/dist/components/switch/switch.component.js +1 -1
  67. package/dist/components/switch/switch.styles.js +1 -1
  68. package/dist/components/switch/switch.test.d.ts +1 -0
  69. package/dist/components/tag/tag.component.d.ts +25 -4
  70. package/dist/components/tag/tag.component.js +66 -29
  71. package/dist/components/tag/tag.styles.js +6 -5
  72. package/dist/components/textarea/textarea.component.d.ts +26 -23
  73. package/dist/components/textarea/textarea.component.js +15 -12
  74. package/dist/custom-elements.json +960 -305
  75. package/dist/index.d.ts +3 -0
  76. package/dist/index.js +39 -30
  77. package/dist/internal/components/formBase.d.ts +18 -1
  78. package/dist/internal/components/formBase.js +25 -13
  79. package/dist/internal/components/skf-element.d.ts +4 -4
  80. package/dist/internal/components/skf-element.js +15 -19
  81. package/dist/internal/helpers/array.d.ts +4 -0
  82. package/dist/internal/helpers/findMatchingTags.d.ts +2 -0
  83. package/dist/internal/helpers/findMatchingTags.js +12 -0
  84. package/dist/internal/helpers/hintSeverity.d.ts +2 -0
  85. package/dist/internal/helpers/hintSeverity.js +6 -0
  86. package/dist/internal/helpers/raiseError.d.ts +28 -0
  87. package/dist/internal/helpers/raiseError.js +29 -0
  88. package/dist/internal/storybook/shadowRootTraverser.d.ts +16 -6
  89. package/dist/react/index.d.ts +3 -0
  90. package/dist/react/index.js +3 -0
  91. package/dist/react/skf-select/index.d.ts +21 -0
  92. package/dist/react/skf-select/index.js +21 -0
  93. package/dist/react/skf-select-option/index.d.ts +9 -0
  94. package/dist/react/skf-select-option/index.js +17 -0
  95. package/dist/react/skf-select-option-group/index.d.ts +3 -0
  96. package/dist/react/skf-select-option-group/index.js +13 -0
  97. package/dist/styles/form-field.styles.js +7 -7
  98. package/dist/types/jsx/custom-element-jsx.d.ts +290 -140
  99. package/dist/types/vue/index.d.ts +223 -90
  100. package/dist/vscode.html-custom-data.json +294 -97
  101. package/dist/web-types.json +614 -242
  102. package/package.json +34 -30
@@ -63,9 +63,9 @@ type BaseEvents = {};
63
63
  export type SkfAccordionProps = {
64
64
  /** If true, will animate the expand/collapse state */
65
65
  animated?: boolean | undefined;
66
- /** Controls which heading element will be rendered */
67
- "heading-as"?: Exclude<HeadingType, "h1">;
68
- /** If provided, adds a gap between each item */
66
+ /** Defines which heading element will be rendered */
67
+ "heading-as"?: "h1" | "h2" | "h3" | "h4";
68
+ /** If true, adds a gap between each item */
69
69
  gap?: boolean | undefined;
70
70
  /** If true, allowes multiple accordion items to open */
71
71
  multiple?: boolean | undefined;
@@ -76,14 +76,14 @@ export type SkfAccordionProps = {
76
76
  };
77
77
 
78
78
  export type SkfAlertProps = {
79
- /** If true, alert is being used as a toast with an close button */
79
+ /** If true, alert is being used as a toast (alertdialog) with an close button */
80
80
  closeable?: boolean | undefined;
81
81
  /** Close button aria-label */
82
82
  "button-label"?: string;
83
83
  /** If defined, displays leading icon */
84
84
  icon?: SkfIcon["name"] | undefined;
85
85
  /** If defined, gives the supplied appearance */
86
- severity?: SeverityFgColor | undefined;
86
+ severity?: "error" | "info" | "warning" | "success" | "alert";
87
87
 
88
88
  /** Fires when the close button is clicked */
89
89
  "onskf-alert-close"?: (e: CustomEvent<never>) => void;
@@ -261,11 +261,11 @@ export type SkfButtonProps = {
261
261
 
262
262
  export type SkfCardProps = {
263
263
  /** If true, removes border */
264
- "no-border"?: boolean;
264
+ "no-border"?: boolean | undefined;
265
265
  /** If true, removes padding */
266
- "no-padding"?: boolean;
266
+ "no-padding"?: boolean | undefined;
267
267
  /** If true, the Card fills the parent element height */
268
- stretch?: boolean;
268
+ stretch?: boolean | undefined;
269
269
  };
270
270
 
271
271
  export type SkfCheckboxProps = {
@@ -289,12 +289,12 @@ export type SkfCheckboxProps = {
289
289
  name?: string | undefined;
290
290
  /** If defined, renders an alternative A11y text for the asterisk */
291
291
  "required-label"?: string | undefined;
292
- /** Size of the checkbox */
293
- size?: "sm" | "md";
294
292
  /** If defined, styles checkbox using provided severity */
295
- severity?: FormFieldBaseProps["severity"] | undefined;
296
- /** If defined, displays valid state after interaction */
293
+ severity?: "alert" | "success" | "info" | "warning";
294
+ /** If true, displays valid state after interaction */
297
295
  "show-valid"?: boolean | undefined;
296
+ /** Size of the checkbox */
297
+ size?: "sm" | "md";
298
298
  /** The current value of the input field */
299
299
  value?: string;
300
300
 
@@ -304,44 +304,44 @@ export type SkfCheckboxProps = {
304
304
 
305
305
  export type SkfCollapseProps = {
306
306
  /** If true, will animate the expand/collapse state */
307
- animated?: boolean;
307
+ animated?: boolean | undefined;
308
308
  /** If true, will set the collapse to be expanded by default */
309
- expanded?: boolean;
309
+ expanded?: boolean | undefined;
310
310
  /** Heading for the collapse */
311
311
  heading?: string | undefined;
312
- /** Controls which heading element will be rendered */
313
- "heading-as"?: Exclude<HeadingType, "h1">;
312
+ /** Defines which heading element will be rendered */
313
+ "heading-as"?: "h1" | "h2" | "h3" | "h4";
314
314
  /** If true, renders the small version */
315
- small?: boolean;
315
+ small?: boolean | undefined;
316
316
  /** If true, will truncate the heading in collapsed state */
317
- truncate?: boolean;
317
+ truncate?: boolean | undefined;
318
318
 
319
319
  /** Event emitted when toggled */
320
320
  "onskf-collapse-toggle"?: (e: CustomEvent<CustomEvent>) => void;
321
321
  };
322
322
 
323
323
  export type SkfDividerProps = {
324
- /** If provided, alters the Divider color */
324
+ /** Defines the Divider color */
325
325
  color?: "emphasised" | "primary" | "secondary" | "tertiary" | "inverse";
326
326
  /** If true, renders a div for presentational purpose instead of the semantic hr-element */
327
- decorative?: boolean;
327
+ decorative?: boolean | undefined;
328
328
  /** If true, renders the divider vertically */
329
- vertical?: boolean;
329
+ vertical?: boolean | undefined;
330
330
  };
331
331
 
332
332
  export type SkfHeadingProps = {
333
- /** Controls which heading element will be rendered. Should not be used to affect appearance. */
334
- as?: HeadingType;
333
+ /** Controls which heading element will be rendered. Should not be used to affect appearance */
334
+ as?: "h1" | "h2" | "h3" | "h4";
335
335
  /** If provided, changes the appearance of the heading */
336
- "styled-as"?: HeadingType | undefined;
336
+ "styled-as"?: "h1" | "h2" | "h3" | "h4";
337
337
  };
338
338
 
339
339
  export type SkfIconProps = {
340
- /** */
340
+ /** Sets the color of the icon */
341
341
  color?: "primary" | "inverse" | "emphasised" | "secondary" | "success" | "info" | "warning" | "error" | "alert";
342
- /** If provided, adds an alternate description to use for assistive devices */
342
+ /** If defined, adds an alternate description to use for assistive devices */
343
343
  label?: string | undefined;
344
- /** */
344
+ /** Name of the icon to display */
345
345
  name?:
346
346
  | "arrowDown"
347
347
  | "arrowDownUp"
@@ -494,7 +494,7 @@ export type SkfIconProps = {
494
494
  | "warningDiamond"
495
495
  | "zoomIn"
496
496
  | "zoomOut";
497
- /** */
497
+ /** Size of the icon */
498
498
  size?: "xs" | "sm" | "md" | "lg";
499
499
  };
500
500
 
@@ -503,62 +503,79 @@ export type SkfInputProps = {
503
503
  disabled?: boolean;
504
504
  /** If true, value is required or must be checked for the form to be submittable */
505
505
  required?: boolean;
506
- /** If provided, renders a custom aria-label for the clear button **Notice!** Only applicable to type=search. */
506
+ /** Custom aria-label for the clear button. **Notice!** Only applicable to type=search. */
507
507
  "button-aria-label-clear"?: string;
508
- /** If provided, renders a custom aria-label for the visibility button. **Notice!** Only applicable to type=password. */
508
+ /** Custom aria-label for the visibility button. **Notice!** Only applicable to type=password. */
509
509
  "button-aria-label-hide"?: string;
510
- /** If provided, renders a custom aria-label for the visibility button **Notice!** Only applicable to type=password. */
510
+ /** Custom aria-label for the visibility button **Notice!** Only applicable to type=password. */
511
511
  "button-aria-label-show"?: string;
512
- /** If provided, forces component to invalid state until removed. Its value is used as hint text. */
512
+ /** If defined, forces component to invalid state until removed. Its value is used as hint text. */
513
513
  "custom-invalid"?: string;
514
- /** If provided, outputs helping hints in console */
515
- debug?: boolean;
514
+ /** If true, outputs helping hints in console */
515
+ debug?: boolean | undefined;
516
516
  /** If true, hides the label visually */
517
- "hide-label"?: boolean;
518
- /** If provided, displays informational text below the field */
517
+ "hide-label"?: boolean | undefined;
518
+ /** If defined, displays informational text below the field */
519
519
  hint?: string | undefined;
520
- /** If provided, tells what keyboard to use if applicable */
520
+ /** Tells what keyboard to use if applicable */
521
521
  inputmode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search";
522
- /** The input's label. Alternatively, you can use the `label` attribute. */
522
+ /** If defined, sets the input's label. Alternatively, you can use the `label` attribute. */
523
523
  label?: string | undefined;
524
- /** If provided, displays a prefix/adornment before the input-element */
524
+ /** If defined, displays a prefix/adornment before the input-element */
525
525
  leading?: string | undefined;
526
- /** If provided, sets the maximum value to accept for this input */
526
+ /** If defined, sets the maximum value to accept for this input */
527
527
  max?: number | string | undefined;
528
- /** If provided, sets the maximum character length to accept for this input */
528
+ /** If defined, sets the maximum character length to accept for this input */
529
529
  maxlength?: number | undefined;
530
- /** If provided, sets the minimum value to accept for this input */
530
+ /** If defined, sets the minimum value to accept for this input */
531
531
  min?: number | string | undefined;
532
- /** If provided, sets the minimum character length to accept for this input */
532
+ /** If defined, sets the minimum character length to accept for this input */
533
533
  minlength?: number | undefined;
534
- /** If provided, adds name to the input-element */
534
+ /** If defined, adds name to the input-element */
535
535
  name?: string | undefined;
536
- /** If provided, adds name to the input-element */
536
+ /** If defined, adds name to the input-element */
537
537
  pattern?: string | undefined;
538
- /** If provided, displays placeholder text */
538
+ /** If defined, displays placeholder text */
539
539
  placeholder?: string | undefined;
540
540
  /** If true, makes the element not mutable, meaning the user can not edit the control */
541
541
  readonly?: boolean | undefined;
542
- /** If provided, renders an alternative A11y text for the asterisk */
542
+ /** If defined, renders an alternative A11y text for the asterisk */
543
543
  "required-label"?: string | undefined;
544
- /** If provided, displays provided severity state */
545
- severity?: FormFieldBaseProps["severity"] | undefined;
546
- /** If provided, displays provided severity state */
544
+ /** If defined, displays provided severity state */
545
+ severity?: "alert" | "success" | "info" | "warning";
546
+ /** If true, displays valid state after interaction */
547
547
  "show-valid"?: boolean | undefined;
548
- /** If provided, displays an alternative size */
549
- size?: "sm" | "md" | undefined;
550
- /** If provided, displays a suffix/adornment after the input-element */
548
+ /** Size of the input */
549
+ size?: "sm" | "md";
550
+ /** If defined, displays a suffix/adornment after the input-element */
551
551
  trailing?: string | undefined;
552
- /** If provided, changes the type of form control */
553
- type?: Exclude<FormFieldBaseProps["type"], "checkbox" | "radio"> | undefined;
554
- /** If provided, sets validation start, "input", "change" or "submit" */
555
- "validate-on"?: "input" | "change" | "submit" | undefined;
552
+ /** Type of input control */
553
+ type?:
554
+ | "button"
555
+ | "color"
556
+ | "date"
557
+ | "datetime-local"
558
+ | "email"
559
+ | "file"
560
+ | "hidden"
561
+ | "image"
562
+ | "month"
563
+ | "number"
564
+ | "password"
565
+ | "range"
566
+ | "reset"
567
+ | "search"
568
+ | "submit"
569
+ | "tel"
570
+ | "text"
571
+ | "time"
572
+ | "url"
573
+ | "week";
574
+ /** Sets validation start */
575
+ "validate-on"?: "input" | "change" | "submit";
556
576
  /** The current value of the input field */
557
577
  value?: string;
558
- /** */
559
- _numberController?: string;
560
- /** */
561
- _passwordController?: string;
578
+
562
579
  /** Fires when the value of the input changes */
563
580
  onchange?: (e: CustomEvent<never>) => void;
564
581
  /** Fires when the input is invalid */
@@ -566,17 +583,17 @@ export type SkfInputProps = {
566
583
  };
567
584
 
568
585
  export type SkfLinkProps = {
569
- /** Specifies semantic element to render - */
586
+ /** Defines the semantic element to render */
570
587
  as?: "button" | "a";
571
- /** */
588
+ /** Defines the text-color */
572
589
  color?: "primary" | "inverse";
573
590
  /** If true, disables the link */
574
591
  disabled?: boolean | undefined;
575
- /** If provided, downloads the url */
592
+ /** If defined, downloads the url */
576
593
  download?: string | undefined;
577
- /** If provided, loads url on click */
594
+ /** If defined, loads url on click */
578
595
  href?: string | undefined;
579
- /** If provided, renders an icon before or after the text */
596
+ /** If defined, renders an icon before or after the text */
580
597
  icon?:
581
598
  | "arrowDown"
582
599
  | "arrowDownUp"
@@ -729,35 +746,39 @@ export type SkfLinkProps = {
729
746
  | "warningDiamond"
730
747
  | "zoomIn"
731
748
  | "zoomOut";
732
- /** Position of the icon in relation to the text - */
749
+ /** Defines the position of the icon in relation to the text */
733
750
  "icon-placement"?: "left" | "right";
734
- /** Specifies the relationship of the target object to the link object - */
751
+ /** Defines the relationship of the target object to the link object */
735
752
  rel?: string;
736
- /** If provided, used on conjunction with onClick property, second argument */
753
+ /** If defined, used on conjunction with onClick property, second argument */
737
754
  route?: string | undefined;
738
755
  /** If true, fills the parents horizontal axis */
739
756
  stretch?: boolean | undefined;
740
- /** If provided, specifies where to open the linked document */
757
+ /** If defined, specifies where to open the linked document */
741
758
  target?: "_blank" | "_parent" | "_self" | "_top" | undefined;
742
- /** Type of button - */
759
+ /** Defines the type of button */
743
760
  type?: "button" | "submit" | "reset";
744
761
  /** If provided, custom function triggered by click where the second return parameter enables custom routing. */
745
762
  onClick?: function;
746
763
  };
747
764
 
748
765
  export type SkfLoaderProps = {
749
- /** */
766
+ /** Defines the aria-label */
750
767
  "aria-label"?: string;
751
768
  /** If true, inverts the color (to be used on colored backgrounds) */
752
- invert?: boolean;
753
- /** If provided, displays an alternative size */
769
+ invert?: boolean | undefined;
770
+ /** Defines the size of the loader */
754
771
  size?: "md" | "sm" | undefined;
772
+ /** */
773
+ role?: string;
774
+ /** */
775
+ ariaLive?: string;
755
776
  };
756
777
 
757
778
  export type SkfLogoProps = {
758
- /** The title of the logo */
779
+ /** Defines the title of the logo */
759
780
  title?: string;
760
- /** If provided, sets color of the logo */
781
+ /** If defined, sets color of the logo */
761
782
  color?: "primary" | "secondary" | "inverse";
762
783
  };
763
784
 
@@ -766,25 +787,25 @@ export type SkfRadioProps = {
766
787
  disabled?: boolean;
767
788
  /** If true, value is required or must be checked for the form to be submittable */
768
789
  required?: boolean;
769
- /** If provided, outputs helping hints in console */
770
- debug?: boolean;
790
+ /** If true, outputs helping hints in console */
791
+ debug?: boolean | undefined;
771
792
  /** If true, outputs helping hints in console */
772
793
  checked?: boolean | undefined;
773
794
  /** If true, forces component to invalid state until removed */
774
795
  "custom-invalid"?: boolean | undefined;
775
796
  /** If true, hides the label visually */
776
- "hide-label"?: boolean;
777
- /** The input's label. Alternatively, you can use the `label` attribute. */
797
+ "hide-label"?: boolean | undefined;
798
+ /** If defined, sets the input's label unless the default slot is used. Alternatively, you can use the `label` attribute. */
778
799
  label?: string | undefined;
779
- /** If provided, adds name to the input-element */
800
+ /** If defined, adds name to the input-element */
780
801
  name?: string | undefined;
781
- /** If provided, renders an alternative A11y text for the asterisk */
802
+ /** If defined, renders an alternative A11y text for the asterisk */
782
803
  "required-label"?: string | undefined;
783
- /** If provided, displays an alternative size */
784
- size?: "sm" | "md" | undefined;
785
- /** If provided, displays provided severity state */
786
- severity?: FormFieldBaseProps["severity"] | undefined;
787
- /** If provided, displays valid state after interaction */
804
+ /** Size of the Radio */
805
+ size?: "sm" | "md";
806
+ /** If defined, displays provided severity state */
807
+ severity?: "success" | "info" | "warning" | "alert";
808
+ /** If true, displays valid state after interaction */
788
809
  "show-valid"?: boolean | undefined;
789
810
  /** The current value of the input field */
790
811
  value?: string;
@@ -793,6 +814,87 @@ export type SkfRadioProps = {
793
814
  onchange?: (e: CustomEvent<never>) => void;
794
815
  };
795
816
 
817
+ export type SkfSelectProps = {
818
+ /** If true, the select is disabled `default: false` */
819
+ disabled?: boolean;
820
+ /** Sets the first visible text on the component */
821
+ "button-label"?: string;
822
+ /** If defined, forces component to invalid state until removed */
823
+ "custom-invalid"?: string | undefined;
824
+ /** If true, hides the label visually */
825
+ "hide-label"?: boolean | undefined;
826
+ /** If true and mulltiple is true, no tags are displayed under the select */
827
+ "hide-tags"?: boolean | undefined;
828
+ /** If defined, sets the hint text under the select component in the form */
829
+ hint?: string | undefined;
830
+ /** If defined, displays provided label */
831
+ label?: string | undefined;
832
+ /** If defined, limits the number of selectable options */
833
+ max?: number | undefined;
834
+ /** If defined, sets the minimum number of required options */
835
+ min?: number | undefined;
836
+ /** If true, allows for multiple options to be selected */
837
+ multiple?: boolean | undefined;
838
+ /** If defined, set name of the component */
839
+ name?: string | undefined;
840
+ /** If defined, renders an alternative A11y text for the asterisk */
841
+ "required-label"?: string | undefined;
842
+ /** If defined, displays provided severity state */
843
+ severity?: FormFieldBaseProps["severity"] | undefined;
844
+ /** If true, displays valid state after interaction */
845
+ "show-valid"?: boolean | undefined;
846
+ /** Size of the Select */
847
+ size?: "sm" | "md";
848
+ /** A readonly property that returns the selected value(s) in a array */
849
+ getSelectedValues?: string;
850
+ /** A readonly property that returns the selected slot(s) text content in a array */
851
+ getSelectedOptionsText?: string;
852
+ /** Read only, returns the selected value. (if multiple: in a comma separated string) */
853
+ value?: string;
854
+ /** */
855
+ _selectedOptions?: array;
856
+ /** Fired when the selected option(s) changes */
857
+ onchange?: (e: CustomEvent<never>) => void;
858
+ /** Fired when the select is invalid */
859
+ oninvalid?: (e: CustomEvent<never>) => void;
860
+ /** Fired when the form is reset */
861
+ onreset?: (e: CustomEvent<never>) => void;
862
+ /** {detail: {expanded: boolean}} Fired when the select dropdown is toggled */
863
+ "onskf-select:dropdown"?: (e: CustomEvent<never>) => void;
864
+ /** {detail: {value: string | null, option: SkfSelectOption}} Fired when the select dropdown is toggled */
865
+ "onskf-select-option:select"?: (e: CustomEvent<never>) => void;
866
+ };
867
+
868
+ export type SkfSelectOptionProps = {
869
+ /** If true, prevents interaction with the option */
870
+ disabled?: boolean | undefined;
871
+ /** If defined, set an icon */
872
+ icon?: SkfIcon["name"] | undefined;
873
+ /** If defined, sets provided color on the icon */
874
+ "icon-color"?: IconColor | undefined;
875
+ /** If true, sets the option as selected */
876
+ selected?: boolean | undefined;
877
+ /** If defined, sets a short label */
878
+ "short-label"?: string | undefined;
879
+ /** Returns or sets the tags value. If value is omitted, defaults to the tags text. */
880
+ value?: string;
881
+ /** The option's label text (equivalent to the tags textContent) */
882
+ text?: string;
883
+ /** */
884
+ role?: string;
885
+ /** */
886
+ _parent?: string;
887
+ /** */
888
+ _shortcutUpdate?: boolean;
889
+ /** {detail: { value: string | null, option: SkfSelectOption }} Fires when the option is selected/deselected. */
890
+ "onskf-select-option:select"?: (e: CustomEvent<never>) => void;
891
+ };
892
+
893
+ export type SkfSelectOptionGroupProps = {
894
+ /** */
895
+ label?: string;
896
+ };
897
+
796
898
  export type SkfSwitchProps = {
797
899
  /** If true, sets disabled state */
798
900
  disabled?: boolean;
@@ -804,7 +906,7 @@ export type SkfSwitchProps = {
804
906
  checked?: boolean | undefined;
805
907
  /** If true, hides the label visually */
806
908
  "hide-label"?: boolean | undefined;
807
- /** If defined, sets the input's label. Alternatively, you can use the `label` attribute. */
909
+ /** If defined, sets the input's label unless the default slot is used. Alternatively, you can use the `label` attribute. */
808
910
  label?: string | undefined;
809
911
  /** If defined, adds name to the input-element */
810
912
  name?: string | undefined;
@@ -817,9 +919,9 @@ export type SkfSwitchProps = {
817
919
  };
818
920
 
819
921
  export type SkfTagProps = {
820
- /** Specifies Tag size - */
922
+ /** Specifies Tag size */
821
923
  size?: "sm" | "md" | "lg";
822
- /** If defined, displays leading/provided icon - */
924
+ /** If defined, displays leading/provided icon */
823
925
  icon?:
824
926
  | "arrowDown"
825
927
  | "arrowDownUp"
@@ -972,10 +1074,14 @@ export type SkfTagProps = {
972
1074
  | "warningDiamond"
973
1075
  | "zoomIn"
974
1076
  | "zoomOut";
975
- /** If defined, gives the supplied appearance - */
1077
+ /** If defined, gives the supplied appearance */
976
1078
  color?: "warning" | "success" | "info" | "error" | "alert";
977
1079
  /** If true, adds trailing button to remove tag */
978
1080
  removable?: boolean | undefined;
1081
+ /** If defined, accepts a function that runs on click */
1082
+ onClick?: string;
1083
+ /** If defined, accepts a function that runs on click. Self removal can be overridden by using `event.stopPropagation()`. */
1084
+ onRemove?: string;
979
1085
  };
980
1086
 
981
1087
  export type SkfTextAreaProps = {
@@ -983,40 +1089,40 @@ export type SkfTextAreaProps = {
983
1089
  disabled?: boolean;
984
1090
  /** If true, value is required or must be checked for the form to be submittable */
985
1091
  required?: boolean;
986
- /** If provided, sets the cols of the textarea */
987
- cols?: number;
988
- /** If provided, forces component to invalid state until removed. Its value is used as hint text. */
1092
+ /** If defined, sets the cols of the textarea */
1093
+ cols?: number | undefined;
1094
+ /** If defined, forces component to invalid state until removed. Its value is used as hint text. */
989
1095
  "custom-invalid"?: string;
990
- /** If provided, outputs helping hints in console */
991
- debug?: boolean;
992
- /** hide-label - If true, hides the label visually */
993
- "hide-label"?: boolean;
994
- /** If provided, displays informational text below the field */
1096
+ /** If true, outputs helping hints in console */
1097
+ debug?: boolean | undefined;
1098
+ /** If true, hides the label visually */
1099
+ "hide-label"?: boolean | undefined;
1100
+ /** If defined, displays informational text below the field */
995
1101
  hint?: string | undefined;
996
- /** The input's label. Alternatively, you can use the component slot. */
997
- label?: string;
998
- /** If provided, adds name to the input-element */
1102
+ /** If defined, sets the input's label unless the default slot is used. Alternatively, you can use the `label` attribute. */
1103
+ label?: string | undefined;
1104
+ /** If defined, adds name to the input-element */
999
1105
  name?: string | undefined;
1000
- /** If provided, sets the maximum character length to accept for this input */
1106
+ /** If defined, sets the maximum character length to accept for this input */
1001
1107
  maxlength?: number | undefined;
1002
- /** If provided, sets the minimum character length to accept for this input */
1108
+ /** If defined, sets the minimum character length to accept for this input */
1003
1109
  minlength?: number | undefined;
1004
- /** If provided, displays placeholder text */
1110
+ /** If defined, displays placeholder text */
1005
1111
  placeholder?: string | undefined;
1006
1112
  /** If true, makes the element not mutable, meaning the user can not edit the control */
1007
1113
  readonly?: boolean | undefined;
1008
- /** If provided, renders an alternative A11y text for the asterisk */
1114
+ /** If defined, renders an alternative A11y text for the asterisk */
1009
1115
  "required-label"?: string | undefined;
1010
- /** If provided, sets the rows of the textarea */
1011
- rows?: number;
1012
- /** If provided, displays provided severity state */
1013
- severity?: "success" | "error";
1116
+ /** If defined, sets the rows of the textarea */
1117
+ rows?: number | undefined;
1118
+ /** If defined, displays provided severity state */
1119
+ severity?: "success" | "info" | "warning" | "alert";
1014
1120
  /** If true, displays valid state after interaction */
1015
1121
  "show-valid"?: boolean | undefined;
1016
- /** If provided, displays an alternative size */
1122
+ /** Size of the Textarea */
1017
1123
  size?: "sm" | "md" | undefined;
1018
- /** If provided, sets validation start, "input", "change" or "submit" */
1019
- "validate-on"?: "input" | "change" | "submit" | undefined;
1124
+ /** Sets validation start */
1125
+ "validate-on"?: "input" | "change" | "submit";
1020
1126
  /** The current value of the text area */
1021
1127
  value?: string;
1022
1128
 
@@ -1030,14 +1136,14 @@ export type CustomElements = {
1030
1136
  /**
1031
1137
  * The `<skf-accordion>` component consists of multiple `<skf-collapse>`, working together.
1032
1138
  *
1033
- * See [InVision DSM](https://skf.invisionapp.com/dsm/ab-skf/4-web-applications/nav/5fa7caf78c01200018354495/asset/6256cb1b44eba592d319d92e) for design principles.
1139
+ * See [zeroheight](https://zeroheight.com/853e936c9/p/6590bf-accordion) for design principles.
1034
1140
  * ---
1035
1141
  *
1036
1142
  *
1037
1143
  * ### **Slots:**
1038
1144
  * - _default_ - Expects one or more <skf-accordion-item> element(s)
1039
1145
  */
1040
- "skf-accordion": Partial<SkfAccordionProps | BaseProps | BaseEvents>;
1146
+ "skf-accordion": Partial<SkfAccordionProps & BaseProps & BaseEvents>;
1041
1147
 
1042
1148
  /**
1043
1149
  * The `<skf-alert>` is a type of notification that appears in-line
@@ -1049,9 +1155,9 @@ export type CustomElements = {
1049
1155
  *
1050
1156
  * ### **Slots:**
1051
1157
  * - _default_ - Alert message. **Notice!** See design principles for approved content
1052
- * - **link** - lodjvodjvodjo
1158
+ * - **link** - Slot for the link
1053
1159
  */
1054
- "skf-alert": Partial<SkfAlertProps | BaseProps | BaseEvents>;
1160
+ "skf-alert": Partial<SkfAlertProps & BaseProps & BaseEvents>;
1055
1161
 
1056
1162
  /**
1057
1163
  * Component to be used in forms or for interactivity
@@ -1061,7 +1167,7 @@ export type CustomElements = {
1061
1167
  * ### **Slots:**
1062
1168
  * - _default_ - The Primary content
1063
1169
  */
1064
- "skf-button": Partial<SkfButtonProps | BaseProps | BaseEvents>;
1170
+ "skf-button": Partial<SkfButtonProps & BaseProps & BaseEvents>;
1065
1171
 
1066
1172
  /**
1067
1173
  * The `<skf-card>` can be used to group related subjects in a container
@@ -1071,7 +1177,7 @@ export type CustomElements = {
1071
1177
  * ### **Slots:**
1072
1178
  * - _default_ - The card's main content
1073
1179
  */
1074
- "skf-card": Partial<SkfCardProps | BaseProps | BaseEvents>;
1180
+ "skf-card": Partial<SkfCardProps & BaseProps & BaseEvents>;
1075
1181
 
1076
1182
  /**
1077
1183
  * The `<skf-checkbox>` component is used to create a checkbox input
@@ -1082,14 +1188,14 @@ export type CustomElements = {
1082
1188
  * - **change** - {object} - When the value of the input changes
1083
1189
  *
1084
1190
  * ### **Slots:**
1085
- * - **Default** - Alternatively, you can use the `label` attribute
1191
+ * - _default_ - The Radios label. Alternatively, you can use the `label` attribute.
1086
1192
  */
1087
- "skf-checkbox": Partial<SkfCheckboxProps | BaseProps | BaseEvents>;
1193
+ "skf-checkbox": Partial<SkfCheckboxProps & BaseProps & BaseEvents>;
1088
1194
 
1089
1195
  /**
1090
1196
  * The `<skf-collapse>` component is a general purpose container for content that can be collapsed / expanded.
1091
1197
  *
1092
- * See [InVision DSM](https://skf.invisionapp.com/dsm/ab-skf/4-web-applications/nav/5fa7caf78c01200018354495/asset/6229e2eb8a8dacf366dc3243) for design principles.
1198
+ * See [zeroheight](https://zeroheight.com/853e936c9/p/6590bf-accordion) for design principles.
1093
1199
  * ---
1094
1200
  *
1095
1201
  *
@@ -1103,10 +1209,10 @@ export type CustomElements = {
1103
1209
  * ### **Slots:**
1104
1210
  * - _default_ - Main content
1105
1211
  */
1106
- "skf-collapse": Partial<SkfCollapseProps | BaseProps | BaseEvents>;
1212
+ "skf-collapse": Partial<SkfCollapseProps & BaseProps & BaseEvents>;
1107
1213
 
1108
1214
  /**
1109
- * The `<Divider>` component can separate items from each other, to visually emphasize their lack of a relationship between groups of information.
1215
+ * The `<Divider>` component can separate items from each other, to visually emphasize their lack of a relationship between groups of information
1110
1216
  * ---
1111
1217
  *
1112
1218
  *
@@ -1114,22 +1220,25 @@ export type CustomElements = {
1114
1220
  * - **--skf-divider-spacing** - The amount of space the divider occupies. Pass valid CSS **margin-block** values when horizontal and **margin-inline** when vertical _(default: undefined)_
1115
1221
  * - **--skf-divider-inset** - The amount of space the divider should be indented. Pass valid CSS **margin-inline** values when horizontal and **margin-block** when vertical _(default: undefined)_
1116
1222
  */
1117
- "skf-divider": Partial<SkfDividerProps | BaseProps | BaseEvents>;
1223
+ "skf-divider": Partial<SkfDividerProps & BaseProps & BaseEvents>;
1118
1224
 
1119
1225
  /**
1120
1226
  * The `<Heading>` component is to deliniate content on a page. When using, take note not to skip heading levels.<br>
1121
1227
  * It extends the interface of native html `<h1>` to `<h4>` elements.
1122
1228
  * ---
1123
1229
  *
1230
+ *
1231
+ * ### **Slots:**
1232
+ * - _default_ - The headings content
1124
1233
  */
1125
- "skf-heading": Partial<SkfHeadingProps | BaseProps | BaseEvents>;
1234
+ "skf-heading": Partial<SkfHeadingProps & BaseProps & BaseEvents>;
1126
1235
 
1127
1236
  /**
1128
1237
  * The `<skf-icon>` component is used to clarify interface elements. When used, should always be paired with (possibly invisible) text
1129
1238
  * ---
1130
1239
  *
1131
1240
  */
1132
- "skf-icon": Partial<SkfIconProps | BaseProps | BaseEvents>;
1241
+ "skf-icon": Partial<SkfIconProps & BaseProps & BaseEvents>;
1133
1242
 
1134
1243
  /**
1135
1244
  * The skf-text-field is used to create a text input field. It can be used inside a form element or standalone.
@@ -1141,9 +1250,9 @@ export type CustomElements = {
1141
1250
  * - **invalid** - Fires when the input is invalid
1142
1251
  *
1143
1252
  * ### **Slots:**
1144
- * - **Default** - Alternatively, you can use the `label` attribute
1253
+ * - _default_ - The Inputs label. Alternatively, you can use the `label` attribute.
1145
1254
  */
1146
- "skf-input": Partial<SkfInputProps | BaseProps | BaseEvents>;
1255
+ "skf-input": Partial<SkfInputProps & BaseProps & BaseEvents>;
1147
1256
 
1148
1257
  /**
1149
1258
  * The `<skf-link>` can be used as either a regular link or a link styled semantic button
@@ -1153,14 +1262,14 @@ export type CustomElements = {
1153
1262
  * ### **Slots:**
1154
1263
  * - _default_ - The links' main content
1155
1264
  */
1156
- "skf-link": Partial<SkfLinkProps | BaseProps | BaseEvents>;
1265
+ "skf-link": Partial<SkfLinkProps & BaseProps & BaseEvents>;
1157
1266
 
1158
1267
  /**
1159
- * The `<skf-loader>` component is a progress indicator that uses circular indicators for short, indeterminate activities.
1268
+ * The `<skf-loader>` component is a progress indicator that uses circular indicators for short, indeterminate activities
1160
1269
  * ---
1161
1270
  *
1162
1271
  */
1163
- "skf-loader": Partial<SkfLoaderProps | BaseProps | BaseEvents>;
1272
+ "skf-loader": Partial<SkfLoaderProps & BaseProps & BaseEvents>;
1164
1273
 
1165
1274
  /**
1166
1275
  * The `<skf-logo>` component is used to display the SKF logo.
@@ -1170,7 +1279,7 @@ export type CustomElements = {
1170
1279
  * ### **CSS Properties:**
1171
1280
  * - **--skf-logo-height** - The height of the logo _(default: undefined)_
1172
1281
  */
1173
- "skf-logo": Partial<SkfLogoProps | BaseProps | BaseEvents>;
1282
+ "skf-logo": Partial<SkfLogoProps & BaseProps & BaseEvents>;
1174
1283
 
1175
1284
  /**
1176
1285
  * The `<skf-radio>` component is used to create a radio input
@@ -1181,19 +1290,60 @@ export type CustomElements = {
1181
1290
  * - **change** - {object} - When the value of the input changes
1182
1291
  *
1183
1292
  * ### **Slots:**
1184
- * - **Default** - Alternatively, you can use the `label` attribute
1293
+ * - _default_ - The radios label. Alternatively, you can use the `label` attribute.
1185
1294
  */
1186
- "skf-radio": Partial<SkfRadioProps | BaseProps | BaseEvents>;
1295
+ "skf-radio": Partial<SkfRadioProps & BaseProps & BaseEvents>;
1187
1296
 
1188
1297
  /**
1189
- * The `<skf-switch>` is a component that displays a list of actions or options
1298
+ * The `<skf-select>` is a component that displays a list of actions or options. A click in the options list toggle the selected state of the option. Use it together with the ´skf-select-option` tag.
1299
+ * ---
1300
+ *
1301
+ *
1302
+ * ### **Events:**
1303
+ * - **change** - Fired when the selected option(s) changes
1304
+ * - **invalid** - Fired when the select is invalid
1305
+ * - **reset** - Fired when the form is reset
1306
+ * - **skf-select:dropdown** - {detail: {expanded: boolean}} Fired when the select dropdown is toggled
1307
+ * - **skf-select-option:select** - {detail: {value: string | null, option: SkfSelectOption}} Fired when the select dropdown is toggled
1308
+ *
1309
+ * ### **Slots:**
1310
+ * - _default_ - The select's placeholder content
1311
+ */
1312
+ "skf-select": Partial<SkfSelectProps & BaseProps & BaseEvents>;
1313
+
1314
+ /**
1315
+ * The `<skf-select-option>` is a component is used nested in a skf-select or skf-select-option-group.
1316
+ * ---
1317
+ *
1318
+ *
1319
+ * ### **Events:**
1320
+ * - **skf-select-option:select** - {detail: { value: string | null, option: SkfSelectOption }} Fires when the option is selected/deselected.
1321
+ *
1322
+ * ### **Slots:**
1323
+ * - _default_ - The option's text content
1324
+ * - **icon** - The option's slot for icon or custom meta information (svg).
1325
+ */
1326
+ "skf-select-option": Partial<SkfSelectOptionProps & BaseProps & BaseEvents>;
1327
+
1328
+ /**
1329
+ * The `<skf-select-option-group>` is a component that groups select-options
1190
1330
  * ---
1191
1331
  *
1192
1332
  *
1193
1333
  * ### **Slots:**
1194
1334
  * - _default_ - The component's placeholder content
1195
1335
  */
1196
- "skf-switch": Partial<SkfSwitchProps | BaseProps | BaseEvents>;
1336
+ "skf-select-option-group": Partial<SkfSelectOptionGroupProps & BaseProps & BaseEvents>;
1337
+
1338
+ /**
1339
+ * The `<skf-switch>` is a component that displays a list of actions or options
1340
+ * ---
1341
+ *
1342
+ *
1343
+ * ### **Slots:**
1344
+ * - _default_ - The Switchs label. Alternatively, you can use the `label` attribute.
1345
+ */
1346
+ "skf-switch": Partial<SkfSwitchProps & BaseProps & BaseEvents>;
1197
1347
 
1198
1348
  /**
1199
1349
  * The `<skf-tag>` is a component that displays a list of actions or options
@@ -1203,7 +1353,7 @@ export type CustomElements = {
1203
1353
  * ### **Slots:**
1204
1354
  * - _default_ - The component's placeholder content
1205
1355
  */
1206
- "skf-tag": Partial<SkfTagProps | BaseProps | BaseEvents>;
1356
+ "skf-tag": Partial<SkfTagProps & BaseProps & BaseEvents>;
1207
1357
 
1208
1358
  /**
1209
1359
  * The skf-textarea is used to create a textarea. Use it inside a form element or wherever you like.
@@ -1215,7 +1365,7 @@ export type CustomElements = {
1215
1365
  * - **invalid** - Fires when the input is invalid
1216
1366
  *
1217
1367
  * ### **Slots:**
1218
- * - **The** - textareas label. Alternatively, you can use the `label` attribute.
1368
+ * - _default_ - The textareas label. Alternatively, you can use the `label` attribute.
1219
1369
  */
1220
- "skf-textarea": Partial<SkfTextAreaProps | BaseProps | BaseEvents>;
1370
+ "skf-textarea": Partial<SkfTextAreaProps & BaseProps & BaseEvents>;
1221
1371
  };