@globalbrain/sefirot 2.16.0 → 2.17.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.
@@ -88,21 +88,19 @@ function getErrorMsg(validation: Validatable) {
88
88
 
89
89
  <style scoped lang="postcss">
90
90
  .SInputBase.mini {
91
- .label { padding-bottom: 6px; }
92
- .label-text-value { font-size: 12px; }
91
+ .label { padding-bottom: 6px; height: 22px; }
92
+ .label-text-value { font-size: var(--input-label-font-size, var(--input-mini-label-font-size)); }
93
93
  .label-text-info { width: 14px; height: 14px; }
94
94
  }
95
95
 
96
96
  .SInputBase.small {
97
- .label { padding-bottom: 8px; }
98
- .label-text-value { font-size: 14px; }
99
- .label-note, .check { transform: translateY(1px); }
97
+ .label { padding-bottom: 8px; height: 24px; }
98
+ .label-text-value { font-size: var(--input-label-font-size, var(--input-small-label-font-size)); }
100
99
  }
101
100
 
102
101
  .SInputBase.medium {
103
- .label { padding-bottom: 8px; }
104
- .label-text-value { font-size: 14px; }
105
- .label-note, .check { transform: translateY(1px); }
102
+ .label { padding-bottom: 8px; height: 24px; }
103
+ .label-text-value { font-size: var(--input-label-font-size, var(--input-medium-label-font-size)); }
106
104
  }
107
105
 
108
106
  .SInputBase.has-error {
@@ -113,7 +111,7 @@ function getErrorMsg(validation: Validatable) {
113
111
 
114
112
  .label {
115
113
  display: flex;
116
- align-items: center;
114
+ align-items: baseline;
117
115
  width: 100%;
118
116
  line-height: 16px;
119
117
  font-weight: 500;
@@ -17,6 +17,7 @@ const props = defineProps<{
17
17
  checkIcon?: IconifyIcon | DefineComponent
18
18
  checkText?: string
19
19
  checkColor?: Color
20
+ block?: boolean
20
21
  modelValue: Day | null
21
22
  validation?: Validatable
22
23
  hideError?: boolean
@@ -71,6 +72,7 @@ function emitBlur() {
71
72
  <input
72
73
  :id="name"
73
74
  class="input"
75
+ :class="{ block }"
74
76
  type="text"
75
77
  placeholder="YYYY-MM-DD"
76
78
  :value="inputValue"
@@ -113,5 +115,9 @@ function emitBlur() {
113
115
  font-weight: 500;
114
116
  color: var(--c-text-3);
115
117
  }
118
+
119
+ &.block {
120
+ max-width: none;
121
+ }
116
122
  }
117
123
  </style>
@@ -17,8 +17,8 @@ const props = defineProps<{
17
17
  note?: string
18
18
  help?: string
19
19
  placeholder?: string
20
- unitBefore?: string
21
- unitAfter?: string
20
+ unitBefore?: any
21
+ unitAfter?: any
22
22
  checkIcon?: IconifyIcon | DefineComponent
23
23
  checkText?: string
24
24
  checkColor?: Color
@@ -2,6 +2,7 @@
2
2
  import { IconifyIcon } from '@iconify/vue/dist/offline'
3
3
  import { DefineComponent, computed, ref } from 'vue'
4
4
  import { Validatable } from '../composables/Validation'
5
+ import { isString } from '../support/Utils'
5
6
  import SIcon from './SIcon.vue'
6
7
  import SInputBase from './SInputBase.vue'
7
8
 
@@ -18,12 +19,11 @@ const props = defineProps<{
18
19
  help?: string
19
20
  type?: string
20
21
  placeholder?: string
21
- unitBefore?: string
22
- unitAfter?: string
22
+ unitBefore?: any
23
+ unitAfter?: any
23
24
  checkIcon?: IconifyIcon | DefineComponent
24
25
  checkText?: string
25
26
  checkColor?: Color
26
- icon?: any
27
27
  align?: Align
28
28
  disabled?: boolean
29
29
  modelValue: string | null
@@ -113,13 +113,10 @@ function getValue(e: Event | FocusEvent | KeyboardEvent): string | null {
113
113
  <slot name="addon-before" />
114
114
  </div>
115
115
 
116
- <div v-if="icon" class="icon">
117
- <SIcon :icon="icon" class="icon-svg" />
118
- </div>
119
-
120
116
  <div class="value">
121
- <div v-if="props.unitBefore" class="unit before">
122
- {{ props.unitBefore }}
117
+ <div v-if="unitBefore" class="unit before">
118
+ <span v-if="isString(unitBefore)" class="unit-text">{{ unitBefore }}</span>
119
+ <SIcon v-else class="unit-icon" :icon="unitBefore" />
123
120
  </div>
124
121
 
125
122
  <div class="area">
@@ -142,8 +139,9 @@ function getValue(e: Event | FocusEvent | KeyboardEvent): string | null {
142
139
  </div>
143
140
  </div>
144
141
 
145
- <div v-if="props.unitAfter" class="unit after">
146
- {{ props.unitAfter }}
142
+ <div v-if="unitAfter" class="unit after">
143
+ <span v-if="isString(unitAfter)" class="unit-text">{{ unitAfter }}</span>
144
+ <SIcon v-else class="unit-icon" :icon="unitAfter" />
147
145
  </div>
148
146
  </div>
149
147
 
@@ -160,6 +158,7 @@ function getValue(e: Event | FocusEvent | KeyboardEvent): string | null {
160
158
  .box { min-height: 32px; }
161
159
  .value { min-height: 30px; }
162
160
  .area { min-height: 30px; }
161
+ .unit { min-height: 30px; }
163
162
 
164
163
  .input {
165
164
  padding: 3px 8px;
@@ -180,12 +179,7 @@ function getValue(e: Event | FocusEvent | KeyboardEvent): string | null {
180
179
  .unit.before { padding-right: 0; }
181
180
  .unit.after { padding-left: 0; }
182
181
 
183
- .icon {
184
- width: 22px;
185
- height: 30px;
186
- }
187
-
188
- .icon-svg {
182
+ .unit-icon {
189
183
  width: 16px;
190
184
  height: 16px;
191
185
  }
@@ -213,6 +207,7 @@ function getValue(e: Event | FocusEvent | KeyboardEvent): string | null {
213
207
  .box { min-height: 40px; }
214
208
  .value { min-height: 38px; }
215
209
  .area { min-height: 38px; }
210
+ .unit { min-height: 38px; }
216
211
 
217
212
  .input {
218
213
  padding: 7px 12px;
@@ -233,12 +228,7 @@ function getValue(e: Event | FocusEvent | KeyboardEvent): string | null {
233
228
  .unit.before { padding-right: 0; }
234
229
  .unit.after { padding-left: 0; }
235
230
 
236
- .icon {
237
- width: 26px;
238
- height: 38px;
239
- }
240
-
241
- .icon-svg {
231
+ .unit-icon {
242
232
  width: 16px;
243
233
  height: 16px;
244
234
  }
@@ -266,6 +256,7 @@ function getValue(e: Event | FocusEvent | KeyboardEvent): string | null {
266
256
  .box { min-height: 48px; }
267
257
  .value { min-height: 46px; }
268
258
  .area { min-height: 46px; }
259
+ .unit { min-height: 46px; }
269
260
 
270
261
  .input {
271
262
  padding: 11px 12px;
@@ -286,14 +277,9 @@ function getValue(e: Event | FocusEvent | KeyboardEvent): string | null {
286
277
  .unit.before { padding-right: 0; }
287
278
  .unit.after { padding-left: 0; }
288
279
 
289
- .icon {
290
- width: 28px;
291
- height: 46px;
292
- }
293
-
294
- .icon-svg {
295
- width: 18px;
296
- height: 18px;
280
+ .unit-icon {
281
+ width: 16px;
282
+ height: 16px;
297
283
  }
298
284
 
299
285
  :slotted(.SInputAddon) .action {
@@ -409,19 +395,14 @@ function getValue(e: Event | FocusEvent | KeyboardEvent): string | null {
409
395
  }
410
396
 
411
397
  .unit {
412
- font-weight: 500;
413
- color: var(--c-text-2);
414
- }
415
-
416
- .icon {
417
398
  display: flex;
418
399
  align-items: center;
419
- cursor: text;
400
+ justify-content: center;
420
401
  color: var(--c-text-2);
421
402
  }
422
403
 
423
- .icon-svg {
424
- fill: currentColor;
404
+ .unit-text {
405
+ font-weight: 500;
425
406
  }
426
407
 
427
408
  .addon {
@@ -19,7 +19,7 @@ const props = defineProps<{
19
19
  checkColor?: Color
20
20
  placeholder?: string
21
21
  disabled?: boolean
22
- rows?: number
22
+ rows?: number | 'fill'
23
23
  modelValue: string | null
24
24
  hideError?: boolean
25
25
  validation?: Validatable
@@ -31,7 +31,8 @@ const emit = defineEmits<{
31
31
 
32
32
  const classes = computed(() => [
33
33
  props.size ?? 'small',
34
- { disabled: props.disabled }
34
+ { disabled: props.disabled },
35
+ { fill: props.rows === 'fill' }
35
36
  ])
36
37
 
37
38
  function emitInput(e: Event): void {
@@ -62,6 +63,7 @@ function emitBlur(e: FocusEvent): void {
62
63
  <textarea
63
64
  :id="name"
64
65
  class="input"
66
+ :class="{ fill: rows === 'fill' }"
65
67
  :placeholder="placeholder"
66
68
  :rows="rows ?? 3"
67
69
  :disabled="disabled"
@@ -73,7 +75,7 @@ function emitBlur(e: FocusEvent): void {
73
75
  </SInputBase>
74
76
  </template>
75
77
 
76
- <style lang="postcss" scoped>
78
+ <style scoped lang="postcss">
77
79
  .SInputTextarea.mini {
78
80
  .input {
79
81
  padding: 6px 12px;
@@ -155,5 +157,9 @@ function emitBlur(e: FocusEvent): void {
155
157
  .dark &:hover:focus {
156
158
  border-color: var(--c-info);
157
159
  }
160
+
161
+ &.fill {
162
+ height: 100%;
163
+ }
158
164
  }
159
165
  </style>
@@ -658,4 +658,8 @@
658
658
  --input-mini-font-size: 14px;
659
659
  --input-small-font-size: 16px;
660
660
  --input-medium-font-size: 16px;
661
+
662
+ --input-mini-label-font-size: 12px;
663
+ --input-small-label-font-size: 14px;
664
+ --input-medium-label-font-size: 14px;
661
665
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@globalbrain/sefirot",
3
- "version": "2.16.0",
4
- "packageManager": "pnpm@7.26.0",
3
+ "version": "2.17.0",
4
+ "packageManager": "pnpm@7.26.2",
5
5
  "description": "Vue Components for Global Brain Design System.",
6
6
  "author": "Kia Ishii <ka.ishii@globalbrains.com>",
7
7
  "license": "MIT",