@kws3/ui 1.6.8 → 1.6.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.mdx ADDED
@@ -0,0 +1,85 @@
1
+
2
+ ## 1.6.9
3
+ - New `Timeline`, `TimelineItem` and `TimelineHeader` components.
4
+
5
+ ## 1.6.8
6
+ - Vertically align `is-icon` cells in `Grid`
7
+
8
+ ## 1.6.7
9
+ - Added granular events `showing`, `shown`, `hiding` and `hidden` for `Popover`.
10
+ - Added `is-checked` class on `Grid` when a row is checked using the multiselect checkboxes.
11
+ - New colors for `is-checked` class on `Grid`
12
+
13
+ ## 1.6.6
14
+ - Enhance `Popover` with native `show` `hide` `enable` `disable` methods
15
+
16
+ ## 1.6.5
17
+ - Filter fix on `DataSearch`
18
+
19
+ ## 1.6.4
20
+ - Add support for `dropdown_portal` prop in `SearchableSelect`
21
+
22
+ ## 1.6.3
23
+ - Prevent submit call on `MultiSelect` when `Enter` key is pressed while searching
24
+ - Fix filter items going blank after search is initiated in `DataSearch`
25
+
26
+ ## 1.6.2
27
+ - Add `dropdown_portal` prop on `MultiSelect` to allow rendering dropdown in alternative locations
28
+
29
+ ## 1.6.1
30
+ - New `Portal` component
31
+ - Use `Portal` for `MultiSelect` and `SearchableSelect` components
32
+
33
+ ## 1.6.0
34
+ - Fix `DataSearch` responsiveness for mobile
35
+ - Fix `Pagination` CSS for mobile
36
+ - Fix `DataSort` responsiveness for mobile
37
+ - Fix functionality of `DataSearch`
38
+
39
+ ## 1.5.9
40
+ - Fix `z-index` issue with `SearchableSelect`
41
+
42
+ ## 1.5.8
43
+ - Showing `undefined` on total in `Pagination`
44
+
45
+ ## 1.5.7
46
+ - Width calculation on `DataSearch`
47
+ - More `text` validation `Nl2br`
48
+
49
+ ## 1.5.6
50
+ - Fix attribute of `MultiSelect`
51
+ - Fix `text` checking on `Nl2br`
52
+
53
+ ## 1.5.5
54
+ - Added `BarChart`
55
+ - Added `LineChart`
56
+ - Added `AreaChart`
57
+ - Added `RadialChart`
58
+ - Support `sparklines` in `Charts`
59
+ - Add `yAxisOptions` and `horizontal` bar for `Charts`
60
+ - Fix attribute of `ConfirmButton`
61
+ - Fix error Handling in `MixedChart`
62
+
63
+ ## 1.5.1
64
+ - Chart bugfixes
65
+ - Fix attribute of `NumberInput` for UI testing
66
+
67
+ ## 1.5.0
68
+ - Added `DonutChart`
69
+ - Added `MixedChart`
70
+ - Added `PieChart`
71
+
72
+ ## 1.4.7
73
+ - Fix value mismatch on `NumberInput`
74
+
75
+ ## 1.4.6
76
+ - Fix Typing bug on `NumberInput`
77
+
78
+ ## 1.4.5
79
+ - Fix **on:change** event on `NumberInput`
80
+
81
+ ## 1.4.4
82
+ - import `Floatie`, `FloatingUIOutput`, `FloatiesStore` from `@kws3/ui` for `FloatingUIOutput`
83
+
84
+ ## 1.4.3
85
+ - Rename `completion_timeout` to `error_timeout` in `Buttons`
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 KWS3 Media Ltd
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,28 @@
1
+ <!--
2
+ @component
3
+
4
+
5
+ @param {'left'|'center'|'right'} [align="left"] - Alignment of the Timeline child items, Default: `"left"`
6
+ @param {string} [class=""] - CSS classes for the Timeline container, Default: `""`
7
+
8
+ ### Slots
9
+ - `<slot name="default" />` - Default slot for placing all TimelineItem and TimelineHeader components
10
+
11
+ -->
12
+ <ul class="kws-timeline is-{align} {klass}">
13
+ <!--Default slot for placing all TimelineItem and TimelineHeader components--><slot />
14
+ </ul>
15
+
16
+ <script>
17
+ /**
18
+ * Alignment of the Timeline child items
19
+ * @type {'left'|'center'|'right'}
20
+ */
21
+ export let align = "left";
22
+
23
+ /**
24
+ * CSS classes for the Timeline container
25
+ */
26
+ let klass = "";
27
+ export { klass as class };
28
+ </script>
@@ -0,0 +1,21 @@
1
+ <!--
2
+ @component
3
+
4
+
5
+ @param {string} [class=""] - CSS classes for the TimelineItem container, Default: `""`
6
+
7
+ ### Slots
8
+ - `<slot name="default" />` - Content of the header, recommended to wrap with a `.tag` element.
9
+
10
+ -->
11
+ <header class="kws-timeline-header {klass}">
12
+ <!--Content of the header, recommended to wrap with a `.tag` element.--><slot />
13
+ </header>
14
+
15
+ <script>
16
+ /**
17
+ * CSS classes for the TimelineItem container
18
+ */
19
+ let klass = "";
20
+ export { klass as class };
21
+ </script>
@@ -0,0 +1,70 @@
1
+ <!--
2
+ @component
3
+
4
+
5
+ @param {''|'dark' | 'light' | 'warning' | 'info' | 'danger' | 'primary' | 'success'} [color="primary"] - Color of marker and border, Default: `"primary"`
6
+ @param {string} [marker_icon="null"] - Any icon name accepted by the Icon component, icon will be placed inside the marker, Default: `"null"`
7
+ @param {string} [marker_image="null"] - Any image URL, the image will be placed inside the marker, Default: `"null"`
8
+ @param {string} [class=""] - CSS classes for the TimelineItem container, Default: `""`
9
+
10
+ ### Slots
11
+ - `<slot name="above" />` - Optional text to be displayed above the main text
12
+ - `<slot name="default" />` - Default slot containing the main text
13
+ - `<slot name="below" />` - Optional text to be displayed below the main text
14
+ - `<slot name="thumbnail" />` - Optional thumbnail image do be displayed next to the main content
15
+
16
+ -->
17
+ <li class="kws-timeline-item is-{color} {klass}">
18
+ <div class="kws-timeline-marker">
19
+ {#if marker_icon && !marker_image}
20
+ <Icon icon={marker_icon} />
21
+ {/if}{#if marker_image && !marker_icon}
22
+ <figure class="image is-32x32"><img src={marker_image} alt="" /></figure>
23
+ {/if}
24
+ </div>
25
+ <div class="kws-timeline-content">
26
+ <span class="is-block has-text-grey"
27
+ ><!--Optional text to be displayed above the main text--><slot
28
+ name="above" /></span>
29
+ <span class="is-block description">
30
+ <!--Default slot containing the main text--><slot />
31
+ </span>
32
+
33
+ <span class="is-block has-text-grey">
34
+ <!--Optional text to be displayed below the main text--><slot
35
+ name="below" />
36
+ </span>
37
+ </div>
38
+ {#if $$slots.thumbnail}
39
+ <div class="kws-timeline-image">
40
+ <!--Optional thumbnail image do be displayed next to the main content--><slot
41
+ name="thumbnail" />
42
+ </div>
43
+ {/if}
44
+ </li>
45
+
46
+ <script>
47
+ import { Icon } from "@kws3/ui";
48
+
49
+ /**
50
+ * Color of marker and border
51
+ * @type {''|'dark' | 'light' | 'warning' | 'info' | 'danger' | 'primary' | 'success'}
52
+ */
53
+ export let color = "primary";
54
+ /**
55
+ * Any icon name accepted by the Icon component, icon will be placed inside the marker
56
+ * @type {string}
57
+ */
58
+ export let marker_icon = null;
59
+ /**
60
+ * Any image URL, the image will be placed inside the marker
61
+ * @type {string}
62
+ */
63
+ export let marker_image = null;
64
+
65
+ /**
66
+ * CSS classes for the TimelineItem container
67
+ */
68
+ let klass = "";
69
+ export { klass as class };
70
+ </script>
package/index.js CHANGED
@@ -10,6 +10,9 @@ export { default as Panel } from "./helpers/Panel.svelte";
10
10
  export { default as Notification } from "./helpers/Notification.svelte";
11
11
  export { default as Loader } from "./helpers/Loader.svelte";
12
12
  export { default as ActionSheet } from "./helpers/ActionSheet.svelte";
13
+ export { default as Timeline } from "./helpers/Timeline/Timeline.svelte";
14
+ export { default as TimelineItem } from "./helpers/Timeline/TimelineItem.svelte";
15
+ export { default as TimelineHeader } from "./helpers/Timeline/TimelineHeader.svelte";
13
16
  export { default as Nl2br } from "./helpers/Nl2br.svelte";
14
17
  export { default as ClipboardCopier } from "./helpers/ClipboardCopier.svelte";
15
18
  export { alert, confirm, prompt, default as Dialog } from "./helpers/Dialog";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kws3/ui",
3
- "version": "1.6.8",
3
+ "version": "1.6.9",
4
4
  "description": "UI components for use with Svelte v3 applications.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -29,5 +29,5 @@
29
29
  "text-mask-core": "^5.1.2",
30
30
  "tippy.js": "^6.3.1"
31
31
  },
32
- "gitHead": "f35ff4c73bff73bddc8c3af2dd88d5f4282ae6df"
32
+ "gitHead": "85f8066201dc00eef8977c9a41239b377a5ca878"
33
33
  }
@@ -2,7 +2,7 @@
2
2
  @component
3
3
 
4
4
 
5
- @param {boolean} [active=false] - Used to set the active pane., Default: `false`
5
+ @param {boolean} [active=false] - Used to set the active pane, Default: `false`
6
6
  @param {string} [style=""] - Inline CSS of component, Default: `""`
7
7
  @param {boolean} [v_center=true] - Vertical alignment of content inside the active pane., Default: `true`
8
8
  @param {boolean} [h_center=true] - Horizontal alignment of content inside the active pane., Default: `true`
@@ -40,7 +40,7 @@ This will work only when `track_height` is set to `true`
40
40
  const fire = createEventDispatcher();
41
41
 
42
42
  /**
43
- * Used to set the active pane.
43
+ * Used to set the active pane
44
44
  */
45
45
  export let active = false,
46
46
  /**
@@ -10,26 +10,23 @@
10
10
  - `<slot name="default" />`
11
11
 
12
12
  -->
13
- <div
14
- class="sliding-pane-set {vertical ? 'is-vertical' : ''} {classes}"
15
- {style}>
13
+ <div class="sliding-pane-set {vertical ? 'is-vertical' : ''} {klass}" {style}>
16
14
  <slot />
17
15
  </div>
18
16
 
19
17
  <script>
20
18
  /**
21
- * Additional classes
22
- * @type {string}
19
+ * Inline style of component
23
20
  */
24
- export let classes = "",
21
+ export let style = "",
25
22
  /**
26
- * Inline style of component
27
- * @type {string}
28
- */
29
- style = "",
30
- /**
31
- * Vertical Aligned - true/false
32
- * @type {boolean}
23
+ * Vertical transform of SlidingPane.
33
24
  */
34
25
  vertical = false;
26
+
27
+ /**
28
+ * CSS classes for the SlidingPaneSet
29
+ */
30
+ let klass = "";
31
+ export { klass as class };
35
32
  </script>
@@ -0,0 +1,164 @@
1
+ $kws-timeline-default-color: $grey !default;
2
+ $kws-timeline-default-color-invert: $light !default;
3
+
4
+ @mixin right-aligned-timeline-item {
5
+ flex-direction: row-reverse;
6
+ .kws-timeline-marker {
7
+ right: 0;
8
+ left: auto;
9
+ transform: translateX(50%);
10
+ }
11
+ .kws-timeline-content {
12
+ text-align: right;
13
+ padding-left: 0;
14
+ padding-right: 1.75rem;
15
+ }
16
+ &:before {
17
+ right: -0.5px;
18
+ left: auto;
19
+ }
20
+ }
21
+
22
+ .kws-timeline-item {
23
+ display: flex;
24
+ justify-content: center;
25
+ align-items: center;
26
+ position: relative;
27
+ padding: 0.5rem 0;
28
+ &:first-child {
29
+ padding-top: 0;
30
+ }
31
+ &:last-child {
32
+ padding-bottom: 0;
33
+ }
34
+ .kws-timeline-marker {
35
+ position: absolute;
36
+ left: 0;
37
+ background: $kws-timeline-default-color;
38
+ border: 1px solid $kws-timeline-default-color;
39
+ border-radius: 100%;
40
+ transform: translateX(-50%);
41
+ display: flex;
42
+ align-items: center;
43
+ justify-content: center;
44
+ padding: 0.25rem;
45
+ overflow: hidden;
46
+ &:empty {
47
+ min-height: 1rem;
48
+ min-width: 1rem;
49
+ padding: 0;
50
+ border-width: 4px;
51
+ background: $kws-timeline-default-color-invert;
52
+ }
53
+ .icon {
54
+ color: $kws-timeline-default-color-invert;
55
+ width: 16px;
56
+ height: 16px;
57
+ font-size: 0.75rem !important;
58
+ }
59
+ .image {
60
+ margin: -0.25rem;
61
+ img {
62
+ border-radius: 100%;
63
+ }
64
+ }
65
+ }
66
+ .kws-timeline-content {
67
+ padding-left: 1.75rem;
68
+ flex-grow: 1;
69
+ flex-shrink: 1;
70
+ }
71
+ .kws-timeline-image {
72
+ flex-grow: 0;
73
+ flex-shrink: 0;
74
+ width: 32px;
75
+ img {
76
+ max-width: 100%;
77
+ max-height: 100%;
78
+ border-radius: $radius;
79
+ box-shadow: 0 0.125rem 0.1875rem rgba(10, 10, 10, 0.1),
80
+ 0 0 0 0.0625rem rgba(10, 10, 10, 0.1);
81
+ }
82
+ }
83
+
84
+ &:before {
85
+ content: "";
86
+ background-color: $kws-timeline-default-color;
87
+ display: block;
88
+ width: 1px;
89
+ height: 100%;
90
+ position: absolute;
91
+ left: -0.5px;
92
+ top: 0;
93
+ }
94
+
95
+ @each $name, $pair in $colors {
96
+ $color: nth($pair, 1);
97
+ $color-invert: nth($pair, 2);
98
+ &.is-#{$name} {
99
+ .kws-timeline-marker {
100
+ border-color: $color;
101
+ background-color: $color;
102
+ &:empty {
103
+ background-color: $color-invert;
104
+ }
105
+ .icon {
106
+ color: $color-invert;
107
+ }
108
+ }
109
+ &:before {
110
+ background-color: $color;
111
+ }
112
+ }
113
+ }
114
+ }
115
+
116
+ .kws-timeline-header {
117
+ width: 4em;
118
+ min-width: 4em;
119
+ word-wrap: normal;
120
+ text-align: center;
121
+ transform: translateX(-25px);
122
+ + .kws-timeline-header {
123
+ padding-top: 0.5rem;
124
+ }
125
+ }
126
+
127
+ .kws-timeline {
128
+ list-style: none;
129
+ margin: 0;
130
+ padding: 1rem;
131
+ display: flex;
132
+ flex-direction: column;
133
+
134
+ &.is-center {
135
+ .kws-timeline-item {
136
+ width: 50%;
137
+ align-self: flex-end;
138
+ flex-direction: row;
139
+ &:nth-of-type(2n) {
140
+ align-self: flex-start;
141
+ @include right-aligned-timeline-item;
142
+ }
143
+ }
144
+ .kws-timeline-header {
145
+ width: 100%;
146
+ transform: none;
147
+ }
148
+ }
149
+
150
+ &.is-right {
151
+ justify-content: flex-end;
152
+ align-items: flex-end;
153
+ .kws-timeline-item {
154
+ width: 100%;
155
+ align-self: flex-end;
156
+ @include right-aligned-timeline-item;
157
+ }
158
+ .kws-timeline-header {
159
+ transform: translateX(25px);
160
+ width: 100%;
161
+ text-align: right;
162
+ }
163
+ }
164
+ }