@14ch/svelte-ui 0.0.70 → 0.0.71

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.
@@ -385,7 +385,6 @@
385
385
  class:color-picker--readonly={readonly}
386
386
  class:color-picker--focused={isFocused}
387
387
  data-testid="color-picker"
388
- style={customStyle}
389
388
  >
390
389
  <Input
391
390
  id={id ? `${id}-input` : undefined}
@@ -1104,13 +1104,17 @@
1104
1104
  * 機能バリエーション
1105
1105
  * ============================================= */
1106
1106
  /* clearable */
1107
+ /* 装飾はテキストと同じ content box を基準に中央寄せする(padding-block: inherit)。
1108
+ 絶対配置の基準はルートの padding box なので、そのままだと padding が上下非対称なときにズレる */
1107
1109
  .input__clear-button {
1110
+ display: flex;
1111
+ justify-content: center;
1112
+ align-items: center;
1108
1113
  position: absolute;
1109
- top: 50%;
1114
+ inset-block: 0;
1110
1115
  right: 4px;
1111
1116
  width: 32px;
1112
- height: 32px;
1113
- transform: translate(0, -50%);
1117
+ padding-block: inherit;
1114
1118
  opacity: 0;
1115
1119
  transition: var(--svelte-ui-transition-duration);
1116
1120
  }
@@ -1137,11 +1141,10 @@
1137
1141
  justify-content: center;
1138
1142
  align-items: center;
1139
1143
  position: absolute;
1140
- top: 50%;
1144
+ inset-block: 0;
1141
1145
  left: 4px;
1142
1146
  width: 32px;
1143
- height: 32px;
1144
- transform: translateY(-50%);
1147
+ padding-block: inherit;
1145
1148
  color: var(--svelte-ui-input-icon-color);
1146
1149
  pointer-events: none;
1147
1150
  z-index: 1;
@@ -1152,11 +1155,10 @@
1152
1155
  justify-content: center;
1153
1156
  align-items: center;
1154
1157
  position: absolute;
1155
- top: 50%;
1158
+ inset-block: 0;
1156
1159
  right: 4px;
1157
1160
  width: 32px;
1158
- height: 32px;
1159
- transform: translateY(-50%);
1161
+ padding-block: inherit;
1160
1162
  color: var(--svelte-ui-input-icon-color);
1161
1163
  pointer-events: none;
1162
1164
  z-index: 2;
@@ -186,9 +186,9 @@
186
186
  {:else if placeholder}
187
187
  <span class="multi-select__placeholder">{placeholder}</span>
188
188
  {/if}
189
- <span class="multi-select__dropdown-icon" aria-hidden="true">
190
- <Icon>arrow_drop_down</Icon>
191
- </span>
189
+ </span>
190
+ <span class="multi-select__dropdown-icon" aria-hidden="true">
191
+ <Icon>arrow_drop_down</Icon>
192
192
  </span>
193
193
  </button>
194
194
 
@@ -247,6 +247,7 @@
247
247
  * トリガーボタン
248
248
  * ============================================= */
249
249
  .multi-select__trigger {
250
+ position: relative;
250
251
  width: 100%;
251
252
  min-height: var(--svelte-ui-select-height);
252
253
  padding: var(--svelte-ui-select-padding);
@@ -287,16 +288,17 @@
287
288
  flex: 1;
288
289
  }
289
290
 
291
+ /* アイコンはテキストと同じ content box を基準に中央寄せする(padding-block: inherit)。
292
+ 絶対配置の基準はトリガーの padding box なので、そのままだと padding が上下非対称なときにズレる */
290
293
  .multi-select__dropdown-icon {
291
294
  display: flex;
292
295
  justify-content: center;
293
296
  align-items: center;
294
297
  position: absolute;
295
- top: 50%;
298
+ inset-block: 0;
296
299
  right: 4px;
297
- transform: translateY(-50%);
298
300
  width: 32px;
299
- height: 32px;
301
+ padding-block: inherit;
300
302
  color: var(--svelte-ui-select-dropdown-icon-color);
301
303
  pointer-events: none;
302
304
  }
@@ -368,9 +370,12 @@
368
370
  min-height: 1lh;
369
371
  }
370
372
  .multi-select.multi-select--inline .multi-select__dropdown-icon {
371
- top: calc((1lh - 32px) / 2);
373
+ /* 複数行になりうるので、箱の中央ではなく最初の行にそろえる */
374
+ bottom: auto;
375
+ box-sizing: content-box;
376
+ height: 1lh;
377
+ padding-bottom: 0;
372
378
  right: 0;
373
- transform: none;
374
379
  }
375
380
 
376
381
  /* =============================================
@@ -405,9 +405,9 @@
405
405
  {:else if placeholder}
406
406
  <span class="select__placeholder">{placeholder}</span>
407
407
  {/if}
408
- <span class="select__dropdown-icon" aria-hidden="true">
409
- <Icon>arrow_drop_down</Icon>
410
- </span>
408
+ </span>
409
+ <span class="select__dropdown-icon" aria-hidden="true">
410
+ <Icon>arrow_drop_down</Icon>
411
411
  </span>
412
412
  </button>
413
413
 
@@ -490,6 +490,7 @@
490
490
  .select__trigger {
491
491
  display: flex;
492
492
  align-items: center;
493
+ position: relative;
493
494
  width: 100%;
494
495
  min-height: var(--svelte-ui-select-height);
495
496
  padding: var(--svelte-ui-select-padding);
@@ -525,16 +526,17 @@
525
526
  color: var(--svelte-ui-select-placeholder-color);
526
527
  }
527
528
 
529
+ /* アイコンはテキストと同じ content box を基準に中央寄せする(padding-block: inherit)。
530
+ 絶対配置の基準はトリガーの padding box なので、そのままだと padding が上下非対称なときにズレる */
528
531
  .select__dropdown-icon {
529
532
  display: flex;
530
533
  justify-content: center;
531
534
  align-items: center;
532
535
  position: absolute;
533
- top: 50%;
536
+ inset-block: 0;
534
537
  right: 4px;
535
- transform: translateY(-50%);
536
538
  width: 32px;
537
- height: 32px;
539
+ padding-block: inherit;
538
540
  color: var(--svelte-ui-select-dropdown-icon-color);
539
541
  pointer-events: none;
540
542
  }
@@ -606,9 +608,12 @@
606
608
  min-height: 1lh;
607
609
  }
608
610
  .select.select--inline .select__dropdown-icon {
609
- top: calc((1lh - 32px) / 2);
611
+ /* 複数行になりうるので、箱の中央ではなく最初の行にそろえる */
612
+ bottom: auto;
613
+ box-sizing: content-box;
614
+ height: 1lh;
615
+ padding-bottom: 0;
610
616
  right: 0;
611
- transform: none;
612
617
  }
613
618
 
614
619
  /* =============================================
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@14ch/svelte-ui",
3
3
  "description": "Modern Svelte UI components library with TypeScript support",
4
4
  "private": false,
5
- "version": "0.0.70",
5
+ "version": "0.0.71",
6
6
  "type": "module",
7
7
  "keywords": [
8
8
  "svelte",