@everchron/ec-shards 2.1.7 → 2.1.8

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.1.7",
3
+ "version": "2.1.8",
4
4
  "private": false,
5
5
  "description": "Everchron Shards UI Library",
6
6
  "repository": "https://github.com/everchron/ec-shards.git",
@@ -21,15 +21,17 @@
21
21
  :for="id || _uid">
22
22
 
23
23
  <slot />
24
+ <ecs-text v-if="$slots.default && help" type="form">{{ help }}</ecs-text>
24
25
  </label>
25
26
  </ecs-form-check>
26
27
  </template>
27
28
 
28
29
  <script>
29
30
  import EcsFormCheck from '../form-check/form-check'
31
+ import EcsText from '../text/text'
30
32
 
31
33
  export default {
32
- components: { EcsFormCheck },
34
+ components: { EcsFormCheck, EcsText },
33
35
  props: {
34
36
  /** Name attribute of the input. */
35
37
  name: {
@@ -71,7 +73,11 @@
71
73
  default: false
72
74
  },
73
75
  /** Unique ID */
74
- id: [String, Number]
76
+ id: [String, Number],
77
+ /** Help text that appears underneath (or next to, for inline checkboxes) the label. */
78
+ help: {
79
+ type: String
80
+ }
75
81
  },
76
82
 
77
83
  data() {
@@ -145,7 +151,8 @@
145
151
  width: 18px;
146
152
  height: 18px;
147
153
  left: 0;
148
- top: 0;
154
+ top: 50%;
155
+ margin-top: -9px;
149
156
  background: svg-uri('<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18"><polyline fill="none" stroke="#{$color-blue-10}" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7" points="6 9.259 8.347 11.998 12 6"/></svg>');
150
157
  }
151
158
 
@@ -157,7 +164,8 @@
157
164
  height: 2px;
158
165
  border-radius: 1px;
159
166
  left: 5px;
160
- top: 8px;
167
+ top: 50%;
168
+ margin-top: -1px;
161
169
  }
162
170
 
163
171
  &[type="checkbox"].indeterminate + label:before{
@@ -165,4 +173,13 @@
165
173
  border-color: rgba($color-blue-10, .3);
166
174
  }
167
175
  }
176
+
177
+ .ecs-text{
178
+ min-width: 100%;
179
+ }
180
+
181
+ .ecs-form-check-inline .ecs-text{
182
+ min-width: auto;
183
+ margin-left: $spacing-10;
184
+ }
168
185
  </style>
@@ -32,7 +32,7 @@
32
32
  .ecs-form-check {
33
33
  position: relative;
34
34
  display: block;
35
- height: 18px;
35
+ min-height: 18px;
36
36
  margin-bottom: $spacing-25;
37
37
 
38
38
  &.stand-alone{
@@ -49,6 +49,10 @@
49
49
  &-inline{
50
50
  display: inline-block;
51
51
  margin-right: 30px;
52
+
53
+ .ecs-form-check-label{
54
+ display: inline-flex;
55
+ }
52
56
  }
53
57
 
54
58
  &.disabled {
@@ -72,10 +76,11 @@
72
76
 
73
77
  .ecs-form-check-label {
74
78
  min-width: 18px;
75
- height: 18px;
79
+ min-height: 18px;
76
80
  margin-bottom: 0;
77
81
  padding-left: 30px;
78
- display: inline-flex;
82
+ display: flex;
83
+ flex-wrap: wrap;
79
84
  align-items: center;
80
85
  }
81
86
 
@@ -95,7 +100,8 @@
95
100
  vertical-align: text-top;
96
101
  position: absolute;
97
102
  left: 0;
98
- top: 0;
103
+ top: 50%;
104
+ margin-top: -9px;
99
105
  width: 18px;
100
106
  height: 18px;
101
107
  background: white;
@@ -126,7 +132,7 @@
126
132
  label{
127
133
  display: inline-block;
128
134
  font-size: $type-scale-3-font-size;
129
- line-height: 18px;
135
+ line-height: $type-scale-3-line-height;
130
136
  margin-bottom: $spacing-10;
131
137
  -webkit-user-select: none;
132
138
  -moz-user-select: none;
@@ -239,10 +239,5 @@
239
239
  align-items: center;
240
240
  width: 100%;
241
241
  }
242
-
243
- .ecs-form-check-input + label:before,
244
- .ecs-form-check-input + label:after{
245
- top: auto !important;
246
- }
247
242
  }
248
243
  </style>
@@ -21,14 +21,17 @@
21
21
  :for="id">
22
22
 
23
23
  <slot />
24
+ <ecs-text v-if="$slots.default && help" type="form">{{ help }}</ecs-text>
24
25
  </label>
25
26
  </ecs-form-check>
26
27
  </template>
27
28
 
28
29
  <script>
29
30
  import EcsFormCheck from '../form-check/form-check'
31
+ import EcsText from '../text/text'
32
+
30
33
  export default {
31
- components: { EcsFormCheck },
34
+ components: { EcsFormCheck, EcsText },
32
35
 
33
36
  model: {
34
37
  prop: 'checked',
@@ -62,6 +65,10 @@
62
65
  inline: {
63
66
  type: Boolean,
64
67
  default: false
68
+ },
69
+ /** Help text that appears underneath (or next to, for inline radiobuttons) the label. */
70
+ help: {
71
+ type: String
65
72
  }
66
73
  },
67
74
 
@@ -133,8 +140,18 @@
133
140
  background: $color-blue-10;
134
141
  width: 6px;
135
142
  height: 6px;
136
- top: 6px;
143
+ top: 50%;
144
+ margin-top: -3px;
137
145
  left: 6px;
138
146
  }
139
147
  }
148
+
149
+ .ecs-text{
150
+ min-width: 100%;
151
+ }
152
+
153
+ .ecs-form-check-inline .ecs-text{
154
+ min-width: auto;
155
+ margin-left: $spacing-10;
156
+ }
140
157
  </style>
@@ -6,6 +6,12 @@ import { Meta } from '@storybook/addon-docs/blocks';
6
6
  Changelog
7
7
  </h1>
8
8
 
9
+ ## Version 2.1.8 (30 October 2022)
10
+
11
+ ### Features
12
+
13
+ - Added `help` prop to EcsCheckbox and EcsRadiobutton to render a small helper text underneath the label.
14
+
9
15
  ## Version 2.1.6 (28 October 2022)
10
16
 
11
17
  ### Features
@@ -31,12 +37,6 @@ import { Meta } from '@storybook/addon-docs/blocks';
31
37
  - Refactor EcsFormGroup error text with EcsText component
32
38
  - Added some padding to EcsTreeListItem suffix
33
39
 
34
- ## Version 2.1.1 (11 October 2022)
35
-
36
- ### Features
37
-
38
- - Added `help` prop to EcsCheckbox and EcsRadiobutton to render a small helper text underneath the label.
39
-
40
40
  ## Version 2.1.0 (11 October 2022)
41
41
 
42
42
  ### Breaking Changes
@@ -47,3 +47,11 @@ export const checkboxIndeterminate = () => ({
47
47
  <ecs-checkbox indeterminate inline name="apple">Apples</ecs-checkbox>
48
48
  </div>`,
49
49
  });
50
+
51
+ export const checkboxHelpText = () => ({
52
+ components: { EcsCheckbox },
53
+ template: `<div>
54
+ <ecs-checkbox help="Help Text Label" name="apple">Apple</ecs-checkbox>
55
+ <ecs-checkbox help="Help Text Label" inline name="apple">Apple</ecs-checkbox>
56
+ </div>`,
57
+ });
@@ -37,3 +37,16 @@ export const radiobuttonInline = () => ({
37
37
  Selected: {{ selected }}
38
38
  </div>`,
39
39
  });
40
+
41
+ export const radiobuttonHelpText = () => ({
42
+ components: { EcsRadiobutton },
43
+ data() {
44
+ return {
45
+ selected: 'apple'
46
+ }
47
+ },
48
+ template: `<div>
49
+ <ecs-radiobutton name="fruits" v-model="selected" value="orange" help="Help Text Label">Label</ecs-radiobutton>
50
+ <ecs-radiobutton name="fruits" v-model="selected" inline value="apple" help="Help Text Label">Label</ecs-radiobutton>
51
+ </div>`,
52
+ });