@kws3/ui 4.5.0 → 4.5.2-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.mdx CHANGED
@@ -1,3 +1,18 @@
1
+ ## Unreleased
2
+ - Fix hardcoded color in `Radio` component
3
+ - Remove legacy additional `is-active` class from active buttons in `ToggleButtons` component
4
+ - Fix value type in `SearchableSelect`
5
+ - Make `AutoComplete`, `SearchableSelect` and `MultiSelect` components work in SSR mode
6
+ - Fix default colors and output radius for `RangeSlider`
7
+ - Fix default thumb and output radius for `RangeSlider`
8
+
9
+ ## 4.5.1
10
+ - Fix ActionReturn type for `popover` action
11
+ - Update popover arrow default colour to be border color
12
+ - Fix dark mode default text colour in `Timepicker` component
13
+ - Fix default border colours for active and checked rows in `Grid` component
14
+ - Allow border colours to be configured for checked and active rows in `Grid` component
15
+
1
16
  # 4.5.0 <span className="has-text-danger">[BREAKING]</span>
2
17
  - This version requires Bulma v1
3
18
  - Supports bulma dark mode
@@ -39,8 +39,9 @@ This property can be bound to, to fetch the current value, Default: `null`
39
39
  }}
40
40
  class="button is-{size} {fullwidth ? 'is-fullwidth' : ''} {value ===
41
41
  option.value
42
- ? 'is-active ' +
43
- (option.active_class ? option.active_class : active_class)
42
+ ? option.active_class
43
+ ? option.active_class
44
+ : active_class
44
45
  : option.inactive_class
45
46
  ? option.inactive_class
46
47
  : inactive_class}">
@@ -67,7 +67,7 @@ Default value: `<span>{option.label}</span>`
67
67
  style="border: none;"
68
68
  class="button delete paddingless is-small is-loading" />
69
69
  {/if}
70
- {#if rootContainer}
70
+ {#if typeof window !== "undefined"}
71
71
  <div
72
72
  class="kws-autocomplete is-{color || 'primary'}"
73
73
  use:portal={dropdown_portal}>
@@ -237,18 +237,11 @@ Default value: `<span>{option.label}</span>`
237
237
  let klass = "";
238
238
  export { klass as class };
239
239
 
240
+ let rootContainer;
241
+
240
242
  if (!search && (!options || !options.length))
241
243
  console.error(`Missing options`);
242
244
 
243
- //ensure we have a root container for all our hoisitng related stuff
244
-
245
- let rootContainer = document.getElementById(rootContainerId);
246
- if (!rootContainer) {
247
- rootContainer = document.createElement("div");
248
- rootContainer.id = rootContainerId;
249
- document.body.appendChild(rootContainer);
250
- }
251
-
252
245
  const fire = createEventDispatcher();
253
246
 
254
247
  let el, //whole wrapping element
@@ -337,6 +330,16 @@ Default value: `<span>{option.label}</span>`
337
330
  const debouncedTriggerSearch = debounce(triggerExternalSearch, 150, false);
338
331
 
339
332
  onMount(() => {
333
+ //ensure we have a root container for all our hoisitng related stuff
334
+ if (typeof window !== "undefined") {
335
+ rootContainer = document.getElementById(rootContainerId);
336
+ if (!rootContainer) {
337
+ rootContainer = document.createElement("div");
338
+ rootContainer.id = rootContainerId;
339
+ document.body.appendChild(rootContainer);
340
+ }
341
+ }
342
+
340
343
  POPPER = createPopper(el, dropdown, {
341
344
  strategy: popper_strategy,
342
345
  placement: "bottom-start",
@@ -96,7 +96,7 @@ This property can be bound to, to fetch the current colour, Default: `"000000"`
96
96
  _colorpicker;
97
97
 
98
98
  /**
99
- * @type {import("svelte/action").Action}
99
+ * @type {import("svelte/action").Action<HTMLElement, string>}
100
100
  */
101
101
  function colorpicker(node) {
102
102
  _colorpicker = new ColorPicker(node);
@@ -120,7 +120,7 @@ Default value: `<span>{option[search_key] || option}</span>`
120
120
  on:click|stopPropagation={removeAll}
121
121
  style={shouldShowClearAll ? "" : "display: none;"} />
122
122
  {/if}
123
- {#if rootContainer}
123
+ {#if typeof window !== "undefined"}
124
124
  <div
125
125
  class="kws-searchableselect is-{color || 'primary'}"
126
126
  use:portal={dropdown_portal}>
@@ -335,6 +335,8 @@ Default value: `<span>{option[search_key] || option}</span>`
335
335
  let klass = "";
336
336
  export { klass as class };
337
337
 
338
+ let rootContainer;
339
+
338
340
  if (!search && (!options || !options.length))
339
341
  console.error(`Missing options`);
340
342
 
@@ -342,15 +344,6 @@ Default value: `<span>{option[search_key] || option}</span>`
342
344
  throw new TypeError(`max must be null or positive integer, got ${max}`);
343
345
  }
344
346
 
345
- //ensure we have a root container for all our hoisitng related stuff
346
-
347
- let rootContainer = document.getElementById(rootContainerId);
348
- if (!rootContainer) {
349
- rootContainer = document.createElement("div");
350
- rootContainer.id = rootContainerId;
351
- document.body.appendChild(rootContainer);
352
- }
353
-
354
347
  const fire = createEventDispatcher();
355
348
 
356
349
  let el, //whole wrapping element
@@ -532,6 +525,16 @@ Default value: `<span>{option[search_key] || option}</span>`
532
525
  const debouncedTriggerSearch = debounce(triggerSearch, 150, false);
533
526
 
534
527
  onMount(() => {
528
+ //ensure we have a root container for all our hoisitng related stuff
529
+ if (typeof window !== "undefined") {
530
+ rootContainer = document.getElementById(rootContainerId);
531
+ if (!rootContainer) {
532
+ rootContainer = document.createElement("div");
533
+ rootContainer.id = rootContainerId;
534
+ document.body.appendChild(rootContainer);
535
+ }
536
+ }
537
+
535
538
  POPPER = createPopper(el, dropdown, {
536
539
  strategy: popper_strategy,
537
540
  placement: "bottom-start",
@@ -2,7 +2,7 @@
2
2
  @component
3
3
 
4
4
 
5
- @param {object} [value=null] - Value of the Input
5
+ @param {any} [value=null] - Value of the Input
6
6
 
7
7
  This property can be bound to, to fetch the current value, Default: `null`
8
8
  @param {string} [placeholder="Please select..."] - Placeholder text for the input, Default: `"Please select..."`
@@ -96,7 +96,7 @@ Default value: `<span>{option[search_key] || option}</span>`
96
96
  * Value of the Input
97
97
  *
98
98
  * This property can be bound to, to fetch the current value
99
- * @type {object}
99
+ * @type {any}
100
100
  */
101
101
  export let value = null;
102
102
  /**
@@ -15,7 +15,7 @@ If you would like to trigger the popover programatically only, you can use `manu
15
15
  Available options: <a target="_blank" href="https://atomiks.github.io/tippyjs/v6/all-props/#placement">https://atomiks.github.io/tippyjs/v6/all-props/#placement</a>, Default: `auto`
16
16
  @param {boolean} [interactive=false] - Allows you to interact with the Popover content, when turned on, Default: `false`
17
17
  @param {boolean} [hide_on_click=true] - Whether the popover should hide on clicking outside of it, Default: `true`
18
- @param {object} [external_target=null] - Specify a target node reference to use as the Popover content
18
+ @param {HTMLElement | null} [external_target=null] - Specify a target node reference to use as the Popover content
19
19
 
20
20
  When set to `null`, it will use the content of the `popover` slot, Default: `null`
21
21
  @param {string} [max_width="none"] - Maximum allowed width of the popover
@@ -126,6 +126,7 @@ It can be any CSS value associated with `max-width` property, including `"none"`
126
126
  * Specify a target node reference to use as the Popover content
127
127
  *
128
128
  * When set to `null`, it will use the content of the `popover` slot
129
+ * @type {HTMLElement | null}
129
130
  */
130
131
  export let external_target = null;
131
132
  /**
@@ -1,5 +1,9 @@
1
1
  /**
2
2
  * @typedef {import('@kws3/ui/types').TippyPositions} TippyPositions
3
+ *
4
+ * @typedef {import("svelte/action").Action<HTMLElement, {
5
+ * content?: HTMLElement
6
+ * }>} TippyAction
3
7
  */
4
8
  /**
5
9
  * Activates tooltips via event delegation
@@ -8,12 +12,15 @@
8
12
  */
9
13
  export function activateTooltips(container: string, opts?: object | null): void;
10
14
  /**
11
- * @type {import("svelte/action").Action}
15
+ * @type {TippyAction}
12
16
  */
13
- export let popover: import("svelte/action").Action;
17
+ export let popover: TippyAction;
14
18
  /**
15
- * @type {import("svelte/action").Action}
19
+ * @type {TippyAction}
16
20
  */
17
- export let tooltip: import("svelte/action").Action;
21
+ export let tooltip: TippyAction;
18
22
  export type TippyPositions = import('@kws3/ui/types').TippyPositions;
23
+ export type TippyAction = import("svelte/action").Action<HTMLElement, {
24
+ content?: HTMLElement;
25
+ }>;
19
26
  //# sourceMappingURL=Tooltip.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["Tooltip.js"],"names":[],"mappings":"AAEA;;GAEG;AAEH;;;;GAIG;AACH,4CAHW,MAAM,SACN,MAAM,eAmBhB;AA8DD;;GAEG;AACH,oBAFU,OAAO,eAAe,EAAE,MAAM,CAkBrC;AAEH;;GAEG;AACH,oBAFU,OAAO,eAAe,EAAE,MAAM,CAWrC;6BAxHU,OAAO,gBAAgB,EAAE,cAAc"}
1
+ {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["Tooltip.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH;;;;GAIG;AACH,4CAHW,MAAM,SACN,MAAM,eAmBhB;AA8DD;;GAEG;AACH,oBAFU,WAAW,CAkBlB;AAEH;;GAEG;AACH,oBAFU,WAAW,CAWlB;6BA5HU,OAAO,gBAAgB,EAAE,cAAc;0BAEvC,OAAO,eAAe,EAAE,MAAM,CAAC,WAAW,EAAE;IACxD,OAAS,CAAC,EAAE,WAAW,CAAA;CACpB,CAAC"}
@@ -2,6 +2,10 @@ import tippy, { delegate } from "tippy.js";
2
2
 
3
3
  /**
4
4
  * @typedef {import('@kws3/ui/types').TippyPositions} TippyPositions
5
+ *
6
+ * @typedef {import("svelte/action").Action<HTMLElement, {
7
+ * content?: HTMLElement
8
+ * }>} TippyAction
5
9
  */
6
10
 
7
11
  /**
@@ -22,7 +26,7 @@ export function activateTooltips(container, opts = {}) {
22
26
  offset: [0, 15],
23
27
  touch: true,
24
28
  },
25
- opts
29
+ opts,
26
30
  );
27
31
 
28
32
  delegate(container, _opts);
@@ -89,7 +93,7 @@ function createTippyAction(defaultOpts) {
89
93
  }
90
94
 
91
95
  /**
92
- * @type {import("svelte/action").Action}
96
+ * @type {TippyAction}
93
97
  */
94
98
  export let popover = createTippyAction({
95
99
  appendTo: () => document.body,
@@ -110,7 +114,7 @@ export let popover = createTippyAction({
110
114
  });
111
115
 
112
116
  /**
113
- * @type {import("svelte/action").Action}
117
+ * @type {TippyAction}
114
118
  */
115
119
  export let tooltip = createTippyAction({
116
120
  animation: "scale",
package/package.json CHANGED
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "name": "@kws3/ui",
3
- "version": "4.5.0",
3
+ "version": "4.5.2-alpha.0",
4
4
  "description": "UI components for use with Svelte v3 applications.",
5
5
  "main": "index.js",
6
- "svelte": "index.js",
7
6
  "scripts": {
8
7
  "test": "echo \"Error: no test specified\" && exit 1"
9
8
  },
@@ -24,13 +23,24 @@
24
23
  "publishConfig": {
25
24
  "access": "public"
26
25
  },
26
+ "svelte": "index.js",
27
27
  "types": "./index.d.ts",
28
+ "exports": {
29
+ "./utils": {
30
+ "types": "./utils/index.d.ts",
31
+ "default": "./utils/index.js"
32
+ },
33
+ ".": {
34
+ "types": "./index.d.ts",
35
+ "svelte": "./index.js"
36
+ }
37
+ },
28
38
  "peerDependencies": {
29
39
  "bulma": "^1.0.0",
30
40
  "svelte": "^4.2.10"
31
41
  },
32
42
  "dependencies": {
33
- "@kws3/text-mask-core": "^5.1.3",
43
+ "@kws3/text-mask-core": "^5.1.4",
34
44
  "apexcharts": "3.33.2",
35
45
  "flatpickr": "^4.5.2",
36
46
  "svelte-portal": "^2.2.1",
@@ -39,5 +49,5 @@
39
49
  "devDependencies": {
40
50
  "typescript": "^5.2.2"
41
51
  },
42
- "gitHead": "79ec200c7ffc1728fa4bae3bb3ff7b275425e889"
52
+ "gitHead": "b6b31eef1ad27066780cef8cfa230bb958cec969"
43
53
  }
@@ -90,7 +90,7 @@ $focus-box-shadow-color: hsla(
90
90
  input[type="radio"]:checked + .kws-checkbox-label {
91
91
  &:after {
92
92
  transform: none;
93
- border: 0.25em solid #fff;
93
+ border: 0.25em solid $check-color-invert;
94
94
  background: $check-color;
95
95
  width: 1em;
96
96
  height: 1em;
@@ -34,7 +34,7 @@ $dragover-hilight-color: cv.getVar("success-soft") !default;
34
34
  }
35
35
 
36
36
  .color-picker {
37
- position: absolute;
37
+ position: fixed;
38
38
  top: 0;
39
39
  left: 0;
40
40
  z-index: 9999;
package/styles/Grid.scss CHANGED
@@ -8,16 +8,16 @@ $tag-margin: 0 0.125rem 0.125rem 0 !default;
8
8
  $icon-size: 1.5em !default;
9
9
  $checked-row-background: cv.getVar("info-light") !default;
10
10
  $checked-row-color: cv.getVar("info") !default;
11
+ $checked-row-border-color: $checked-row-color !default;
11
12
  $active-row-background: cv.getVar("table-row-active-background-color") !default;
12
13
  $active-row-color: cv.getVar("table-row-active-color") !default;
14
+ $active-row-border-color: $active-row-color !default;
13
15
  $background: cv.getVar("table-background-color") !default;
14
16
  $striped-row-background: cv.getVar(
15
17
  "table-striped-row-even-background-color"
16
18
  ) !default;
17
19
  $sticky-column-border-color: cv.getVar("border") !default;
18
- $sticky-column-active-row-border-color: cv.getVar(
19
- "table-row-active-color"
20
- ) !default;
20
+ $sticky-column-active-row-border-color: $active-row-border-color !default;
21
21
  $hover-background-color: cv.getVar("table-row-hover-background-color") !default;
22
22
  $even-row-hover-background-color: cv.getVar(
23
23
  "table-striped-row-even-hover-background-color"
@@ -73,6 +73,8 @@ $cell-border-color: cv.getVar("table-cell-border-color") !default;
73
73
  td {
74
74
  background-color: $checked-row-background !important;
75
75
  color: $checked-row-color !important;
76
+ border-color: $checked-row-border-color !important;
77
+ box-shadow: inset 0 1px 0 $checked-row-border-color;
76
78
  }
77
79
  }
78
80
 
@@ -125,6 +127,8 @@ $cell-border-color: cv.getVar("table-cell-border-color") !default;
125
127
  td {
126
128
  background: $active-row-background;
127
129
  color: $active-row-color;
130
+ border-color: $active-row-border-color;
131
+ box-shadow: inset 0 1px 0 $active-row-border-color;
128
132
  }
129
133
  }
130
134
  }
@@ -164,7 +168,17 @@ $cell-border-color: cv.getVar("table-cell-border-color") !default;
164
168
  tr.is-selected {
165
169
  td.is-sticky-column,
166
170
  th.is-sticky-column {
167
- box-shadow: inset -1px 0 0 $sticky-column-active-row-border-color;
171
+ box-shadow:
172
+ inset -1px 0 0 $sticky-column-active-row-border-color,
173
+ inset 0 1px 0 $sticky-column-active-row-border-color;
174
+ }
175
+ }
176
+ tr.is-checked {
177
+ td.is-sticky-column,
178
+ th.is-sticky-column {
179
+ box-shadow:
180
+ inset -1px 0 0 $checked-row-border-color,
181
+ inset 0 1px 0 $checked-row-border-color;
168
182
  }
169
183
  }
170
184
  }
@@ -8,14 +8,14 @@ $track-radius: cv.getVar("radius") !default;
8
8
  $track-border: 0px solid cv.getVar("border") !default;
9
9
  $track-shadow: cv.getVar("input-shadow") !default;
10
10
  $thumb-background: cv.getVar("text-invert") !default;
11
- $thumb-radius: cv.getVar("radius-small") !default;
11
+ $thumb-radius: cv.getVar("radius") !default;
12
12
  $thumb-border: 1px solid cv.getVar("border") !default;
13
13
  $thumb-shadow: none !default;
14
14
  $thumb-to-track-ratio: 2 !default;
15
15
  $output-width: 3rem !default;
16
- $output-background: cv.getVar("scheme-invert-ter") !default;
17
- $output-color: cv.getVar("text-invert") !default;
18
- $output-radius: cv.getVar("radius-small") !default;
16
+ $output-background: cv.getVar("border-weak") !default;
17
+ $output-color: cv.getVar("text") !default;
18
+ $output-radius: cv.getVar("radius") !default;
19
19
 
20
20
  @use "sass:math";
21
21
 
@@ -56,10 +56,11 @@ $radius: cv.getVar("radius") !default;
56
56
  border: 1px solid $color;
57
57
  input,
58
58
  .flatpickr-am-pm {
59
- color: $color-dark;
59
+ color: $text;
60
60
  &:hover,
61
61
  &:focus {
62
62
  background: $color-light;
63
+ color: $color-dark;
63
64
  }
64
65
  }
65
66
  .numInputWrapper {
@@ -10,7 +10,7 @@ $radius: cv.getVar("radius-small") !default;
10
10
  $shadow: 0 5px 10px -5px hsla(cv.getVar("shadow-h"), cv.getVar("shadow-s"), cv.getVar("shadow-l"), 0.4) !default;
11
11
  $popover-background: cv.getVar("background") !default;
12
12
  $popover-color: cv.getVar("text") !default;
13
- $popover-arrow-color: cv.getVar("background") !default;
13
+ $popover-arrow-color: cv.getVar("border") !default;
14
14
  $popover-shadow: $shadow !default;
15
15
  $popover-radius: $radius !default;
16
16