@kws3/ui 1.9.2 → 2.0.1

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 (81) hide show
  1. package/CHANGELOG.mdx +74 -48
  2. package/buttons/ConfirmButton.svelte +11 -3
  3. package/buttons/DeleteButton.svelte +2 -3
  4. package/buttons/ProcessButton.svelte +3 -4
  5. package/buttons/SubmitButton.svelte +11 -3
  6. package/charts/AreaChart.svelte +1 -1
  7. package/charts/BarChart.svelte +1 -1
  8. package/charts/Chart.svelte +1 -0
  9. package/charts/DonutChart.svelte +1 -1
  10. package/charts/LineChart.svelte +1 -1
  11. package/charts/MixedChart.svelte +1 -1
  12. package/charts/PieChart.svelte +1 -1
  13. package/charts/RadialChart.svelte +1 -1
  14. package/charts/utils.js +1 -0
  15. package/controls/Checkbox.svelte +10 -4
  16. package/controls/FileUpload.svelte +14 -8
  17. package/controls/NumberInput.svelte +19 -10
  18. package/controls/Radio.svelte +8 -2
  19. package/controls/RangeSlider.svelte +8 -2
  20. package/controls/Toggle.svelte +9 -2
  21. package/controls/ToggleButtons.svelte +10 -3
  22. package/datagrid/DataSearch/DataSearch.svelte +1 -1
  23. package/datagrid/GridView/GridCell.svelte +3 -0
  24. package/datagrid/GridView/GridRow.svelte +15 -0
  25. package/datagrid/GridView/GridView.svelte +21 -3
  26. package/datagrid/Pagination/Pagination.svelte +3 -3
  27. package/datagrid/TileView/TileView.svelte +46 -5
  28. package/datagrid/TileView/TileViewItem.svelte +4 -0
  29. package/form/index.js +160 -0
  30. package/forms/AutoComplete.svelte +78 -33
  31. package/forms/Datepicker.svelte +22 -5
  32. package/forms/PasswordValidator/PasswordValidator.svelte +8 -8
  33. package/forms/PasswordValidator/validatePassword.js +13 -2
  34. package/forms/SearchInput.svelte +180 -0
  35. package/forms/Timepicker.svelte +69 -4
  36. package/forms/actions.js +21 -15
  37. package/forms/colorpicker/Colorpicker.js +28 -3
  38. package/forms/colorpicker/Colorpicker.svelte +2 -2
  39. package/forms/select/MultiSelect.svelte +89 -30
  40. package/forms/select/SearchableSelect.svelte +6 -5
  41. package/helpers/CardModal.svelte +2 -1
  42. package/helpers/ClipboardCopier.svelte +4 -1
  43. package/helpers/Dialog/Dialog.svelte +13 -8
  44. package/helpers/Dialog/index.js +6 -0
  45. package/helpers/Divider.svelte +2 -2
  46. package/helpers/FloatingUI/Floatie.svelte +6 -6
  47. package/helpers/FloatingUI/index.js +2 -1
  48. package/helpers/Icon.svelte +25 -9
  49. package/helpers/Loader.svelte +10 -3
  50. package/helpers/Message.svelte +2 -2
  51. package/helpers/Modal.svelte +2 -1
  52. package/helpers/Notification.svelte +1 -1
  53. package/helpers/Popover.svelte +4 -4
  54. package/helpers/ScrollableList.svelte +12 -8
  55. package/helpers/Skeleton.svelte +4 -1
  56. package/helpers/Timeline/Timeline.svelte +1 -1
  57. package/helpers/Timeline/TimelineItem.svelte +5 -5
  58. package/helpers/Tooltip.js +1 -1
  59. package/index.js +10 -4
  60. package/{utils → internal}/fuzzy.js +64 -65
  61. package/internal/index.js +27 -0
  62. package/internal/scrollIntoActiveElement.js +22 -0
  63. package/keyboard/index.js +94 -0
  64. package/package.json +6 -3
  65. package/{utils/resizeObserver.js → resizeObserver/index.js} +0 -0
  66. package/search/index.js +52 -0
  67. package/settings.js +1 -1
  68. package/sliding-panes/SlidingPane.svelte +1 -4
  69. package/styles/AutoComplete.scss +2 -1
  70. package/styles/Datepicker.scss +1 -1
  71. package/styles/Grid.scss +14 -0
  72. package/styles/Pagination.scss +8 -5
  73. package/styles/Select.scss +2 -1
  74. package/transitions/components/Scale.svelte +1 -0
  75. package/transitions/components/getEasing.js +18 -5
  76. package/types/ambient.d.ts +16 -0
  77. package/types/index.d.ts +46 -0
  78. package/types/type-defs/index.ts +14 -0
  79. package/utils/index.js +110 -9
  80. package/utils/fuzzysearch.js +0 -42
  81. package/utils/keyboard-events.js +0 -32
package/CHANGELOG.mdx CHANGED
@@ -1,3 +1,29 @@
1
+ ## 2.0.1
2
+ - Hardcoded color bugfix on pagination styles
3
+
4
+ ## 2.0.0
5
+ - Add support for custom CSS classes for the table in `GridView` component
6
+ - Add support for displaying `GridView` table rows in a compact manner using `is_narrow` prop.
7
+ - Vertically center all rows by default in `GridView`.
8
+ - Add support for custom CSS classes for the wrapper in `TileView` component
9
+ - Add support for variable number of items per row in `TileView` component via `fluid_items_per_row` prop
10
+ - Fix keyboard scrolling issue on `AutoComplete`,`MultiSelect` and `SearchableSelect` component
11
+ - Fix `time_24hr` reactivity issue on `Timepicker`
12
+ - Expose `min_time`, `max_time` from `Timepicker`
13
+ - Expose `readonly` from `Datepicker` and `Timepicker` to prevent calendar opening on focus.
14
+ - New `SearchInput` component: search on multiple keys at the same time.
15
+ - Deprecated `@kws3/ui/utils/fuzzysearch` and `@kws3/ui/utils/some_module`.
16
+ - Expose factory function `makeSearchEngine` from `@kws3/ui/search`
17
+ - Expose `truncate`, `nl2br`, `cloneObject`, `rAF`, `debounce`, `capitaliseFirstLetter`, `createDate`, `currency`, `dateToOrdinal`, `randomIntegerFromInterval`, `randomPercent`, `fileDownloader` from `@kws3/ui/utils`.
18
+ - Expose keyboard events of `enter`, `tab`, `escape`, `space`, `leftarrow`, `rightarrow`, `downarrow`, `uparrow`, `backspace`, `del` from `@kws3/ui/keyboard`.
19
+ - Expose `hasResizeObserver`, `resizeObserver` from `@kws3/ui/resizeObserver`
20
+ - New utility `makeForms` exposed from `@kws3\ui\form`
21
+ - Add support for material symbols icon pack from https://fonts.google.com/icons
22
+ - Baby steps towards typings
23
+
24
+ ## 1.9.3
25
+ - Bug fix with fuzzy.js initial config hoisting
26
+
1
27
  ## 1.9.2
2
28
  - Bug fix with fuzzy.js and Vite prebundling
3
29
  - Debounce fuzzy searches
@@ -16,7 +42,7 @@
16
42
  - New `AutoComplete` component
17
43
  - Make options text size match the input `size` in `MultiSelect` and `SearchableSelect`.
18
44
  - Prevent default arrow up/down behaviour on `MultiSelect` and `SearchableSelect` when options dropdown is open.
19
-
45
+
20
46
  ## 1.8.3
21
47
  - Allow `clickableRows` and `bulk_actions` to work at the same time on `GridView`
22
48
  - Various bugfixes on `GridRow`
@@ -28,7 +54,7 @@
28
54
  - New `input_only`, `force_integer`, `style` and `class` props for `NumberInput`
29
55
  - Forward `focus`, `blur` input events for `NumberInput`
30
56
  - Use custom version of `fuzzysearch` for `SearchableSelect` and `MultiSelect`
31
-
57
+
32
58
  ## 1.8.1
33
59
  - New `ScrollableList` component
34
60
 
@@ -43,7 +69,7 @@
43
69
  - Added support for subscribing to chart events
44
70
  - Added support for distributed bar charts using new `distributed` prop on `BarChart` component
45
71
  - Added examples for leveraging advanced chart features
46
-
72
+
47
73
  ## 1.7.3
48
74
  - Fix docs for `Popover`
49
75
  - Increase performance for `SlidingPane` by using ResizeObserver when available
@@ -61,92 +87,92 @@
61
87
  - Added linting rules for ESLint. And corrected all resulting issues.
62
88
 
63
89
  ## 1.7.0
64
- - Ensure uniform usage of `$kws-theme-colors` across all components, this means `$kws-theme-colors` can be independent of the global `$colors` SCSS variable.
65
- - `DataSearch` component: Expand filters to fill area when main search input is not present.
66
- - `DataSort` component: Increase click area for activating dropdown, and provide visual segementation between label and dropdown.
67
- - New `Skeleton` component.
90
+ - Ensure uniform usage of `$kws-theme-colors` across all components, this means `$kws-theme-colors` can be independent of the global `$colors` SCSS variable.
91
+ - `DataSearch` component: Expand filters to fill area when main search input is not present.
92
+ - `DataSort` component: Increase click area for activating dropdown, and provide visual segementation between label and dropdown.
93
+ - New `Skeleton` component.
68
94
 
69
95
  ## 1.6.9
70
- - New `Timeline`, `TimelineItem` and `TimelineHeader` components.
96
+ - New `Timeline`, `TimelineItem` and `TimelineHeader` components.
71
97
 
72
98
  ## 1.6.8
73
- - Vertically align `is-icon` cells in `Grid`
99
+ - Vertically align `is-icon` cells in `Grid`
74
100
 
75
101
  ## 1.6.7
76
- - Added granular events `showing`, `shown`, `hiding` and `hidden` for `Popover`.
77
- - Added `is-checked` class on `Grid` when a row is checked using the multiselect checkboxes.
78
- - New colors for `is-checked` class on `Grid`
102
+ - Added granular events `showing`, `shown`, `hiding` and `hidden` for `Popover`.
103
+ - Added `is-checked` class on `Grid` when a row is checked using the multiselect checkboxes.
104
+ - New colors for `is-checked` class on `Grid`
79
105
 
80
106
  ## 1.6.6
81
- - Enhance `Popover` with native `show` `hide` `enable` `disable` methods
107
+ - Enhance `Popover` with native `show` `hide` `enable` `disable` methods
82
108
 
83
109
  ## 1.6.5
84
- - Filter fix on `DataSearch`
110
+ - Filter fix on `DataSearch`
85
111
 
86
112
  ## 1.6.4
87
- - Add support for `dropdown_portal` prop in `SearchableSelect`
113
+ - Add support for `dropdown_portal` prop in `SearchableSelect`
88
114
 
89
115
  ## 1.6.3
90
- - Prevent submit call on `MultiSelect` when `Enter` key is pressed while searching
91
- - Fix filter items going blank after search is initiated in `DataSearch`
116
+ - Prevent submit call on `MultiSelect` when `Enter` key is pressed while searching
117
+ - Fix filter items going blank after search is initiated in `DataSearch`
92
118
 
93
119
  ## 1.6.2
94
- - Add `dropdown_portal` prop on `MultiSelect` to allow rendering dropdown in alternative locations
120
+ - Add `dropdown_portal` prop on `MultiSelect` to allow rendering dropdown in alternative locations
95
121
 
96
122
  ## 1.6.1
97
- - New `Portal` component
98
- - Use `Portal` for `MultiSelect` and `SearchableSelect` components
123
+ - New `Portal` component
124
+ - Use `Portal` for `MultiSelect` and `SearchableSelect` components
99
125
 
100
126
  ## 1.6.0
101
- - Fix `DataSearch` responsiveness for mobile
102
- - Fix `Pagination` CSS for mobile
103
- - Fix `DataSort` responsiveness for mobile
104
- - Fix functionality of `DataSearch`
127
+ - Fix `DataSearch` responsiveness for mobile
128
+ - Fix `Pagination` CSS for mobile
129
+ - Fix `DataSort` responsiveness for mobile
130
+ - Fix functionality of `DataSearch`
105
131
 
106
132
  ## 1.5.9
107
- - Fix `z-index` issue with `SearchableSelect`
133
+ - Fix `z-index` issue with `SearchableSelect`
108
134
 
109
135
  ## 1.5.8
110
- - Showing `undefined` on total in `Pagination`
136
+ - Showing `undefined` on total in `Pagination`
111
137
 
112
138
  ## 1.5.7
113
- - Width calculation on `DataSearch`
114
- - More `text` validation `Nl2br`
139
+ - Width calculation on `DataSearch`
140
+ - More `text` validation `Nl2br`
115
141
 
116
142
  ## 1.5.6
117
- - Fix attribute of `MultiSelect`
118
- - Fix `text` checking on `Nl2br`
143
+ - Fix attribute of `MultiSelect`
144
+ - Fix `text` checking on `Nl2br`
119
145
 
120
146
  ## 1.5.5
121
- - Added `BarChart`
122
- - Added `LineChart`
123
- - Added `AreaChart`
124
- - Added `RadialChart`
125
- - Support `sparklines` in `Charts`
126
- - Add `yAxisOptions` and `horizontal` bar for `Charts`
127
- - Fix attribute of `ConfirmButton`
128
- - Fix error Handling in `MixedChart`
147
+ - Added `BarChart`
148
+ - Added `LineChart`
149
+ - Added `AreaChart`
150
+ - Added `RadialChart`
151
+ - Support `sparklines` in `Charts`
152
+ - Add `yAxisOptions` and `horizontal` bar for `Charts`
153
+ - Fix attribute of `ConfirmButton`
154
+ - Fix error Handling in `MixedChart`
129
155
 
130
156
  ## 1.5.1
131
- - Chart bugfixes
132
- - Fix attribute of `NumberInput` for UI testing
157
+ - Chart bugfixes
158
+ - Fix attribute of `NumberInput` for UI testing
133
159
 
134
160
  ## 1.5.0
135
- - Added `DonutChart`
136
- - Added `MixedChart`
137
- - Added `PieChart`
161
+ - Added `DonutChart`
162
+ - Added `MixedChart`
163
+ - Added `PieChart`
138
164
 
139
165
  ## 1.4.7
140
- - Fix value mismatch on `NumberInput`
166
+ - Fix value mismatch on `NumberInput`
141
167
 
142
168
  ## 1.4.6
143
- - Fix Typing bug on `NumberInput`
169
+ - Fix Typing bug on `NumberInput`
144
170
 
145
171
  ## 1.4.5
146
- - Fix **on:change** event on `NumberInput`
172
+ - Fix **on:change** event on `NumberInput`
147
173
 
148
174
  ## 1.4.4
149
- - import `Floatie`, `FloatingUIOutput`, `FloatiesStore` from `@kws3/ui` for `FloatingUIOutput`
175
+ - import `Floatie`, `FloatingUIOutput`, `FloatiesStore` from `@kws3/ui` for `FloatingUIOutput`
150
176
 
151
177
  ## 1.4.3
152
- - Rename `completion_timeout` to `error_timeout` in `Buttons`
178
+ - Rename `completion_timeout` to `error_timeout` in `Buttons`
@@ -1,7 +1,6 @@
1
1
  <!--
2
2
  @component
3
3
 
4
-
5
4
  @param {string} [button_class=""] - CSS classes for the Confirm button, Default: `""`
6
5
  @param {string} [text=""] - Button text, Default: `""`
7
6
  @param {''|'small'|'medium'|'large'} [size=""] - Size of the Button, Default: `""`
@@ -82,6 +81,11 @@
82
81
 
83
82
  const fire = createEventDispatcher();
84
83
 
84
+ /**
85
+ * @typedef {import('@kws3/ui/types').ColorOptions} ColorOptions
86
+ * @typedef {import('@kws3/ui/types').SizeOptions} SizeOptions
87
+ */
88
+
85
89
  /**
86
90
  * CSS classes for the Confirm button
87
91
  */
@@ -92,7 +96,7 @@
92
96
  text = "",
93
97
  /**
94
98
  * Size of the Button
95
- * @type {''|'small'|'medium'|'large'}
99
+ * @type {SizeOptions}
96
100
  */
97
101
  size = "",
98
102
  /**
@@ -101,7 +105,7 @@
101
105
  icon = "check",
102
106
  /**
103
107
  * Color of the Button
104
- * @type {''|'dark' | 'light' | 'warning' | 'info' | 'danger' | 'primary' | 'success'}
108
+ * @type {ColorOptions}
105
109
  */
106
110
  color = "primary",
107
111
  /**
@@ -154,6 +158,10 @@
154
158
  let confirm = false;
155
159
 
156
160
  $: main_color = "is-" + color;
161
+ /**
162
+ * Icon Size
163
+ * @type {SizeOptions}
164
+ */
157
165
  $: icon_size = "small";
158
166
  $: _confirm = should_confirm && confirm;
159
167
 
@@ -1,7 +1,6 @@
1
1
  <!--
2
2
  @component
3
3
 
4
-
5
4
  @param {string} [button_class=""] - CSS classes for the Delete button, Default: `""`
6
5
  @param {string} [text="Delete"] - Button text, Default: `"Delete"`
7
6
  @param {''|'small'|'medium'|'large'} [size=""] - Size of the Button, Default: `""`
@@ -70,7 +69,7 @@
70
69
  text = "Delete",
71
70
  /**
72
71
  * Size of the Button
73
- * @type {''|'small'|'medium'|'large'}
72
+ * @type {import('@kws3/ui/types').SizeOptions}
74
73
  */
75
74
  size = "",
76
75
  /**
@@ -79,7 +78,7 @@
79
78
  icon = "minus-circle",
80
79
  /**
81
80
  * Color of the Button
82
- * @type {''|'dark' | 'light' | 'warning' | 'info' | 'danger' | 'primary' | 'success'}
81
+ * @type {import('@kws3/ui/types').ColorOptions}
83
82
  */
84
83
  color = "danger",
85
84
  /**
@@ -1,7 +1,6 @@
1
1
  <!--
2
2
  @component
3
3
 
4
-
5
4
  @param {string} [button_class=""] - CSS classes for the Process button, Default: `""`
6
5
  @param {string} [text="Click Me"] - Button text, Default: `"Click Me"`
7
6
  @param {''|'small'|'medium'|'large'} [size=""] - Size of the Button, Default: `""`
@@ -71,7 +70,7 @@
71
70
  text = "Click Me",
72
71
  /**
73
72
  * Size of the Button
74
- * @type {''|'small'|'medium'|'large'}
73
+ * @type {import('@kws3/ui/types').SizeOptions}
75
74
  */
76
75
  size = "",
77
76
  /**
@@ -80,7 +79,7 @@
80
79
  icon = "check",
81
80
  /**
82
81
  * Color of the Button
83
- * @type {''|'dark' | 'light' | 'warning' | 'info' | 'danger' | 'primary' | 'success'}
82
+ * @type {import('@kws3/ui/types').ColorOptions}
84
83
  */
85
84
  color = "primary",
86
85
  /**
@@ -98,7 +97,7 @@
98
97
  /**
99
98
  * Context property
100
99
  */
101
- context = null,
100
+ context = "",
102
101
  /**
103
102
  * Removes text, and text space in the button
104
103
  */
@@ -1,7 +1,6 @@
1
1
  <!--
2
2
  @component
3
3
 
4
-
5
4
  @param {''|'small'|'medium'|'large'} [size=""] - Size of the Button, Default: `""`
6
5
  @param {''|'primary'|'warning'|'info'|'danger'|'dark'|'light'} [color="primary"] - Color of the Button, Default: `"primary"`
7
6
  @param {string} [text="Save Changes"] - Button text, Default: `"Save Changes"`
@@ -53,14 +52,19 @@
53
52
 
54
53
  const fire = createEventDispatcher();
55
54
 
55
+ /**
56
+ * @typedef {import('@kws3/ui/types').ColorOptions} ColorOptions
57
+ * @typedef {import('@kws3/ui/types').SizeOptions} SizeOptions
58
+ */
59
+
56
60
  /**
57
61
  * Size of the Button
58
- * @type {''|'small'|'medium'|'large'}
62
+ * @type {SizeOptions}
59
63
  */
60
64
  export let size = "",
61
65
  /**
62
66
  * Color of the Button
63
- * @type {''|'primary'|'warning'|'info'|'danger'|'dark'|'light'}
67
+ * @type {Exclude<ColorOptions , 'success'>}
64
68
  */
65
69
  color = "primary",
66
70
  /**
@@ -174,5 +178,9 @@
174
178
  }
175
179
 
176
180
  $: err_text = error_text === "" ? text : error_text;
181
+ /**
182
+ * Icon Size
183
+ * @type {SizeOptions}
184
+ */
177
185
  $: icon_size = size === "large" ? "" : "small";
178
186
  </script>
@@ -115,7 +115,7 @@ This is to prevent unnecessary event subscriptions., Default: `[]`
115
115
  * Send an array of colors to override the default colors, or do not send anything to use the default colors
116
116
  * @type {array}
117
117
  */
118
- colors = null,
118
+ colors = [],
119
119
  /**
120
120
  * String array of event names that will be captured and fired as svelte events.
121
121
  * This is to prevent unnecessary event subscriptions.
@@ -135,7 +135,7 @@ This is to prevent unnecessary event subscriptions., Default: `[]`
135
135
  * Send an array of colors to override the default colors, or do not send anything to use the default colors
136
136
  * @type {array}
137
137
  */
138
- colors = null,
138
+ colors = [],
139
139
  /**
140
140
  * String array of event names that will be captured and fired as svelte events.
141
141
  * This is to prevent unnecessary event subscriptions.
@@ -140,6 +140,7 @@ This is to prevent unnecessary event subscriptions., Default: `[]`
140
140
 
141
141
  if (canvas) {
142
142
  chart = new ApexCharts(canvas, config);
143
+ //@ts-ignore
143
144
  chart.render();
144
145
  }
145
146
  };
@@ -105,7 +105,7 @@ This is to prevent unnecessary event subscriptions., Default: `[]`
105
105
  * Send an array of colors to override the default colors, or do not send anything to use the default colors
106
106
  * @type {array}
107
107
  */
108
- colors = null,
108
+ colors = [],
109
109
  /**
110
110
  * String array of event names that will be captured and fired as svelte events.
111
111
  * This is to prevent unnecessary event subscriptions.
@@ -115,7 +115,7 @@ This is to prevent unnecessary event subscriptions., Default: `[]`
115
115
  * Send an array of colors to override the default colors, or do not send anything to use the default colors
116
116
  * @type {array}
117
117
  */
118
- colors = null,
118
+ colors = [],
119
119
  /**
120
120
  * String array of event names that will be captured and fired as svelte events.
121
121
  * This is to prevent unnecessary event subscriptions.
@@ -120,7 +120,7 @@ This is to prevent unnecessary event subscriptions., Default: `[]`
120
120
  * Send an array of colors to override the default colors, or do not send anything to use the default colors
121
121
  * @type {array}
122
122
  */
123
- colors = null,
123
+ colors = [],
124
124
  /**
125
125
  * String array of event names that will be captured and fired as svelte events.
126
126
  * This is to prevent unnecessary event subscriptions.
@@ -105,7 +105,7 @@ This is to prevent unnecessary event subscriptions., Default: `[]`
105
105
  * Send an array of colors to override the default colors, or do not send anything to use the default colors
106
106
  * @type {array}
107
107
  */
108
- colors = null,
108
+ colors = [],
109
109
  /**
110
110
  * String array of event names that will be captured and fired as svelte events.
111
111
  * This is to prevent unnecessary event subscriptions.
@@ -115,7 +115,7 @@ This is to prevent unnecessary event subscriptions., Default: `[]`
115
115
  * Send an array of colors to override the default colors, or do not send anything to use the default colors
116
116
  * @type {array}
117
117
  */
118
- colors = null,
118
+ colors = [],
119
119
  /**
120
120
  * String array of event names that will be captured and fired as svelte events.
121
121
  * This is to prevent unnecessary event subscriptions.
package/charts/utils.js CHANGED
@@ -9,6 +9,7 @@ const themeColors = [
9
9
  "#77ED11",
10
10
  ];
11
11
 
12
+ //@ts-ignore
12
13
  export const merge = ApexCharts.merge;
13
14
 
14
15
  export function pieChartOptions(labels, is_sparkline) {
@@ -46,14 +46,20 @@ Ultimately defaults to `fa`, if family is not set anywhere, Default: `"null"`
46
46
  <script>
47
47
  import { Icon } from "@kws3/ui";
48
48
 
49
+ /**
50
+ *
51
+ * @typedef {import('@kws3/ui/types').ColorOptions} ColorOptions
52
+ * @typedef {import('@kws3/ui/types').SizeOptions} SizeOptions
53
+ *
54
+ */
49
55
  /**
50
56
  * Size of the Checkbox
51
- * @type {''|'small'|'medium'|'large'}
57
+ * @type {SizeOptions}
52
58
  */
53
59
  export let size = "",
54
60
  /**
55
61
  * Colour of the Checkbox
56
- * @type {''|'primary'|'warning'|'info'|'danger'|'dark'|'light'}
62
+ * @type {Exclude<ColorOptions, 'success'>}
57
63
  */
58
64
  color = "",
59
65
  /**
@@ -100,9 +106,9 @@ Ultimately defaults to `fa`, if family is not set anywhere, Default: `"null"`
100
106
  *
101
107
  * Ultimately defaults to `fa`, if family is not set anywhere
102
108
  *
103
- * @type {''|'fa'|'lar'|'las'|'gg'|'unicons'}
109
+ * @type {string|''|'fa'|'lar'|'las'|'gg'|'unicons'|'material'}
104
110
  */
105
- icon_family = null;
111
+ icon_family = "";
106
112
 
107
113
  /**
108
114
  * CSS classes of the Checkbox
@@ -37,9 +37,9 @@ The following functions are returned in `event.detail`:
37
37
  {#if _is_uploading}
38
38
  <span class="loader" />
39
39
  {:else if _is_finished}
40
- <Icon size="" icon="check-circle" fa_class="fa-lg" />
40
+ <Icon size="" icon="check-circle" class="fa-lg" />
41
41
  {:else}
42
- <Icon size="" icon="upload" fa_class="fa-lg" />
42
+ <Icon size="" icon="upload" class="fa-lg" />
43
43
  {/if}
44
44
  </div>
45
45
  <div class="file">
@@ -88,6 +88,12 @@ The following functions are returned in `event.detail`:
88
88
  import { onMount, createEventDispatcher } from "svelte";
89
89
  import { Icon } from "@kws3/ui";
90
90
 
91
+ /**
92
+ *
93
+ * @typedef {import('@kws3/ui/types').ColorOptions} ColorOptions
94
+ * @typedef {import('@kws3/ui/types').SizeOptions} SizeOptions
95
+ *
96
+ */
91
97
  const fire = createEventDispatcher();
92
98
 
93
99
  /**
@@ -106,7 +112,7 @@ The following functions are returned in `event.detail`:
106
112
  info = "",
107
113
  /**
108
114
  * Color of the information text
109
- * @type {''|'grey'|'primary'|'warning'|'success'|'info'|'danger'|'dark'|'light'}
115
+ * @type {ColorOptions | 'grey'}
110
116
  */
111
117
  info_color = "grey",
112
118
  /**
@@ -124,12 +130,12 @@ The following functions are returned in `event.detail`:
124
130
  disabled = false,
125
131
  /**
126
132
  * Size of the File Input
127
- * @type {''|'small'|'medium'|'large'}
133
+ * @type {SizeOptions}
128
134
  */
129
135
  size = "",
130
136
  /**
131
137
  * Color of the File Input
132
- * @type {''|'primary'|'warning'|'success'|'info'|'danger'|'dark'|'light'}
138
+ * @type {ColorOptions}
133
139
  */
134
140
  color = "";
135
141
 
@@ -157,13 +163,13 @@ The following functions are returned in `event.detail`:
157
163
  return "N/A";
158
164
  }
159
165
  if (n > 1073741824) {
160
- return Math.round(n / 1073741824, 1) + " GB";
166
+ return Math.round(n / 1073741824) + " GB";
161
167
  }
162
168
  if (n > 1048576) {
163
- return Math.round(n / 1048576, 1) + " MB";
169
+ return Math.round(n / 1048576) + " MB";
164
170
  }
165
171
  if (n > 1024) {
166
- return Math.round(n / 1024, 1) + " KB";
172
+ return Math.round(n / 1024) + " KB";
167
173
  }
168
174
  return n + " b";
169
175
  }
@@ -40,8 +40,8 @@ This will be overridden if `min` is higher, or `max` is lower, Default: `0`
40
40
  ? 'danger'
41
41
  : ''}"
42
42
  type="number"
43
- min
44
- max
43
+ {min}
44
+ {max}
45
45
  {step}
46
46
  {disabled}
47
47
  readonly={!typeable}
@@ -72,8 +72,8 @@ This will be overridden if `min` is higher, or `max` is lower, Default: `0`
72
72
  ? 'danger'
73
73
  : ''}"
74
74
  type="number"
75
- min
76
- max
75
+ {min}
76
+ {max}
77
77
  {step}
78
78
  {disabled}
79
79
  readonly={!typeable}
@@ -124,11 +124,17 @@ This will be overridden if `min` is higher, or `max` is lower, Default: `0`
124
124
  import { onMount, createEventDispatcher } from "svelte";
125
125
  import { Icon } from "@kws3/ui";
126
126
 
127
+ /**
128
+ *
129
+ * @typedef {import('@kws3/ui/types').ColorOptions} ColorOptions
130
+ * @typedef {import('@kws3/ui/types').SizeOptions} SizeOptions
131
+ *
132
+ */
127
133
  const fire = createEventDispatcher();
128
134
 
129
135
  /**
130
136
  * Size of the component
131
- * @type {''|'small'|'medium'|'large'}
137
+ * @type {SizeOptions}
132
138
  */
133
139
  export let size = "",
134
140
  /**
@@ -137,6 +143,7 @@ This will be overridden if `min` is higher, or `max` is lower, Default: `0`
137
143
  * This property can be bound to, to fetch the current value
138
144
  *
139
145
  * This will be overridden if `min` is higher, or `max` is lower
146
+ * @type {number}
140
147
  */
141
148
  value = 0,
142
149
  /**
@@ -145,10 +152,12 @@ This will be overridden if `min` is higher, or `max` is lower, Default: `0`
145
152
  step = 1,
146
153
  /**
147
154
  * Minumum permitted value
155
+ * @type {number}
148
156
  */
149
157
  min = 0,
150
158
  /**
151
159
  * Maximum permitted value
160
+ * @type {number}
152
161
  */
153
162
  max = 100,
154
163
  /**
@@ -169,12 +178,12 @@ This will be overridden if `min` is higher, or `max` is lower, Default: `0`
169
178
  minus_icon = "minus",
170
179
  /**
171
180
  * Color of the Minus Icon
172
- * @type {''|'success'|'primary'|'warning'|'info'|'danger'|'dark'|'light'}
181
+ * @type {ColorOptions}
173
182
  */
174
183
  minus_icon_color = "danger",
175
184
  /**
176
185
  * Color of the Minus Button
177
- * @type {''|'success'|'primary'|'warning'|'info'|'danger'|'dark'|'light'}
186
+ * @type {ColorOptions}
178
187
  */
179
188
  minus_button_color = "",
180
189
  /**
@@ -183,12 +192,12 @@ This will be overridden if `min` is higher, or `max` is lower, Default: `0`
183
192
  plus_icon = "plus",
184
193
  /**
185
194
  * Color of the Plus Icon
186
- * @type {''|'success'|'primary'|'warning'|'info'|'danger'|'dark'|'light'}
195
+ * @type {ColorOptions}
187
196
  */
188
197
  plus_icon_color = "success",
189
198
  /**
190
199
  * Color of the Plus Button
191
- * @type {''|'success'|'primary'|'warning'|'info'|'danger'|'dark'|'light'}
200
+ * @type {ColorOptions}
192
201
  */
193
202
  plus_button_color = "",
194
203
  /**
@@ -231,7 +240,7 @@ This will be overridden if `min` is higher, or `max` is lower, Default: `0`
231
240
  const count = (i) => () => {
232
241
  if (typeof value == "undefined" || value === null) value = min;
233
242
  value = Number(value) + i * step;
234
- if (step % 1 !== 0) value = value.toFixed(1);
243
+ if (step % 1 !== 0) value = Number(value.toFixed(1));
235
244
  };
236
245
 
237
246
  function validateInput() {
@@ -38,6 +38,12 @@ See: https://svelte.dev/docs#bind_group, Default: `null`
38
38
  </label>
39
39
 
40
40
  <script>
41
+ /**
42
+ *
43
+ * @typedef {import('@kws3/ui/types').ColorOptions} ColorOptions
44
+ * @typedef {import('@kws3/ui/types').SizeOptions} SizeOptions
45
+ *
46
+ */
41
47
  /**
42
48
  * Value of radio button
43
49
  */
@@ -52,12 +58,12 @@ See: https://svelte.dev/docs#bind_group, Default: `null`
52
58
  label_style = "",
53
59
  /**
54
60
  * Size of the Radio Button
55
- * @type {''|'small'|'medium'|'large'}
61
+ * @type {SizeOptions}
56
62
  */
57
63
  size = "",
58
64
  /**
59
65
  * Color of the Radio button when selected
60
- * @type {''|'primary'|'warning'|'success'|'info'|'danger'|'dark'|'light'}
66
+ * @type {ColorOptions}
61
67
  */
62
68
  color = "",
63
69
  /**