@everchron/ec-shards 2.0.7 → 2.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everchron/ec-shards",
3
- "version": "2.0.7",
3
+ "version": "2.1.0",
4
4
  "private": false,
5
5
  "description": "Everchron Shards UI Library",
6
6
  "repository": "https://github.com/everchron/ec-shards.git",
@@ -4,24 +4,29 @@
4
4
  <ecs-checkbox @input="$emit('input', $event)" :disabled="disabled" :value="value" :value-false="valueFalse" :value-true="valueTrue" :indeterminate="indeterminate">
5
5
  <slot></slot>
6
6
  </ecs-checkbox>
7
+ <span v-if="suffix" class="after">{{suffix}}</span>
7
8
  </div>
8
9
 
9
10
  <div v-else-if="type === 'radiobutton'" class="ecs-popover-list-item control no-hover">
10
11
  <ecs-radiobutton @change="$emit('change', $event)" :disabled="disabled" :checked="value">
11
12
  <slot></slot>
12
13
  </ecs-radiobutton>
14
+ <span v-if="suffix" class="after">{{suffix}}</span>
13
15
  </div>
14
16
 
15
17
  <div v-else-if="type === 'switch'" class="ecs-popover-list-item control no-hover">
16
18
  <ecs-switch @input="$emit('input', $event)" :value="value" :value-false="valueFalse" :value-true="valueTrue" size="sml-toggle" :disabled="disabled">
17
19
  <slot></slot>
20
+ <span v-if="help" class="help">{{help}}</span>
18
21
  </ecs-switch>
22
+ <span v-if="suffix" class="after">{{suffix}}</span>
19
23
  </div>
20
24
 
21
25
  <div v-else-if="type === 'sort'" @click="$emit('click', $event)" class="ecs-popover-list-item control no-hover">
22
26
  <ecs-sortbutton :sort="sort" :disabled="disabled">
23
27
  <slot></slot>
24
28
  </ecs-sortbutton>
29
+ <span v-if="suffix" class="after">{{suffix}}</span>
25
30
  </div>
26
31
 
27
32
  <a v-else-if="type === 'link'" @click="$emit('click', $event)" class="ecs-popover-list-item"
@@ -41,21 +46,6 @@
41
46
  <ecs-icon v-if="hoverIcon" :type="hoverIcon" class="hover-icon" />
42
47
  </a>
43
48
 
44
- <button v-else-if="type === 'color'"
45
- class="ecs-popover-list-item"
46
- :class="[disabled ? `disabled` : '',
47
- noHover ? `no-hover` : '',
48
- color ? `has-color` : '',
49
- selected ? `selected` : '']"
50
- @click="$emit('click', $event)">
51
-
52
- <div class="ecs-popover-list-item-color" :style="{ backgroundColor: color }" />
53
- <slot></slot>
54
- <span v-if="suffix" class="after">{{suffix}}</span>
55
- <span v-if="help" class="help">{{help}}</span>
56
- <ecs-icon v-if="hoverIcon" :type="hoverIcon" class="hover-icon" />
57
- </button>
58
-
59
49
  <button v-else class="ecs-popover-list-item"
60
50
  :class="[iconClass,
61
51
  danger ? `danger` : '',
@@ -90,7 +80,7 @@
90
80
  /** Determines the type of popover list item.*/
91
81
  type: {
92
82
  type: String,
93
- validator: v => ['icon', 'checkbox', 'radiobutton', 'switch', 'sort', 'color', 'link', null].includes(v),
83
+ validator: v => ['icon', 'checkbox', 'radiobutton', 'switch', 'sort', 'link', null].includes(v),
94
84
  default: null
95
85
  },
96
86
  /** Adds a subtle suffix text to the right side of the list item. Should be very short. */
@@ -108,11 +98,6 @@
108
98
  type: String,
109
99
  default: null
110
100
  },
111
- /** The color value (HEX, or RGB), if the list item is type `color`. */
112
- color: {
113
- type: String,
114
- default: null
115
- },
116
101
  /** Adds a file icon. Should never be used together with `icon`. */
117
102
  fileIcon: {
118
103
  type: String,
@@ -195,6 +180,19 @@
195
180
  }
196
181
  </script>
197
182
 
183
+ <style lang="scss">
184
+ .ecs-popover-list-item{
185
+ .ecs-switch-has-label + label{
186
+ flex-wrap: wrap;
187
+ flex: 1;
188
+
189
+ .help{
190
+ min-width: 100%;
191
+ }
192
+ }
193
+ }
194
+ </style>
195
+
198
196
  <style lang="scss" scoped>
199
197
  @import "../../tokens/build/scss/tokens.scss";
200
198
  @import "../mixins/svg-uri";
@@ -260,10 +258,6 @@
260
258
  }
261
259
  }
262
260
 
263
- &.has-color{
264
- padding-left: 36px;
265
- }
266
-
267
261
  &.danger{
268
262
  &.has-icon .icon{
269
263
  color: $color-gray-8;
@@ -299,20 +293,19 @@
299
293
  .ecs-switch-wrapper{
300
294
  margin: -7px 0;
301
295
  }
302
- }
303
296
 
304
- &-color{
305
- width: 14px;
306
- height: 14px;
307
- border-radius: 100%;
308
- top: 13px;
309
- left: 12px;
310
- position: absolute;
297
+ .after{
298
+ position: absolute;
299
+ right: 12px;
300
+ top: 50%;
301
+ margin-top: -8px;
302
+ }
311
303
  }
312
304
 
313
305
  .after{
314
306
  opacity: .4;
315
307
  font-size: $type-scale-2-font-size;
308
+ line-height: $type-scale-2-line-height;
316
309
  float: right;
317
310
 
318
311
  &-highlight{
@@ -6,6 +6,16 @@ import { Meta } from '@storybook/addon-docs/blocks';
6
6
  Changelog
7
7
  </h1>
8
8
 
9
+ ## Version 2.1.0 (11 October 2022)
10
+
11
+ ### Breaking Changes
12
+
13
+ - Deprecated the `type="color"` and `color` props of EcsPopoverListItem. Since EcsSwatchesPicker is now fully implemented, this component variant will no longer be needed.
14
+
15
+ ### Fixes
16
+
17
+ - Allows `suffix` and `help` text for control type popover-list-items components.
18
+
9
19
  ## Version 2.0.7 (10 October 2022)
10
20
 
11
21
  ### Fixes
@@ -37,20 +37,17 @@ export const popoverListItemIcon = () => ({
37
37
  </ecs-popover-list>`,
38
38
  });
39
39
 
40
- export const popoverListItemColor = () => ({
41
- components: { EcsPopoverListItem, EcsPopoverList },
42
- template: `<ecs-popover-list>
43
- <ecs-popover-list-item type="color" color="#F9DF00">Yellow</ecs-popover-list-item>
44
- <ecs-popover-list-item type="color" color="#F3A100">Orange</ecs-popover-list-item>
45
- </ecs-popover-list>`,
46
- });
47
-
48
40
  export const popoverListItemControls = () => ({
49
41
  components: { EcsPopoverListItem, EcsPopoverList },
50
42
  template: `<ecs-popover-list>
51
43
  <ecs-popover-list-item type="checkbox">List Item Checkbox</ecs-popover-list-item>
44
+ <ecs-popover-list-item type="checkbox" suffix="Suffix">List Item Checkbox</ecs-popover-list-item>
52
45
  <ecs-popover-list-item type="radiobutton">List Item Radio</ecs-popover-list-item>
46
+ <ecs-popover-list-item type="radiobutton" suffix="Suffix">List Item Radio</ecs-popover-list-item>
53
47
  <ecs-popover-list-item type="sort">List Item Sort</ecs-popover-list-item>
48
+ <ecs-popover-list-item type="sort" suffix="Suffix">List Item Sort</ecs-popover-list-item>
54
49
  <ecs-popover-list-item type="switch">List Item Switch</ecs-popover-list-item>
50
+ <ecs-popover-list-item type="switch" help="This is a helper text.">List Item Switch</ecs-popover-list-item>
51
+ <ecs-popover-list-item type="switch" suffix="TXT">List Item Switch</ecs-popover-list-item>
55
52
  </ecs-popover-list>`,
56
53
  });