@14ch/svelte-ui 0.0.66 → 0.0.68

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.
@@ -124,7 +124,7 @@
124
124
  // 基本プロパティ
125
125
  name = '',
126
126
  value = $bindable(false),
127
- indeterminate = $bindable(false),
127
+ indeterminate = $bindable(),
128
128
 
129
129
  // HTML属性系
130
130
  id = `checkbox-${Math.random().toString(36).substring(2, 15)}`,
@@ -123,7 +123,7 @@
123
123
 
124
124
  let {
125
125
  // 基本プロパティ
126
- value = $bindable(''),
126
+ value = $bindable(),
127
127
 
128
128
  // HTML属性系
129
129
  id = `colorpicker-${Math.random().toString(36).substring(2, 15)}`,
@@ -377,8 +377,7 @@
377
377
  </script>
378
378
 
379
379
  <div
380
- class="color-picker
381
- focus-style-{focusStyle}"
380
+ class="color-picker"
382
381
  class:color-picker--full-width={fullWidth}
383
382
  class:color-picker--rounded={rounded}
384
383
  class:color-picker--clearable={clearable}
@@ -436,7 +435,7 @@
436
435
  <input
437
436
  type="color"
438
437
  aria-label={ariaLabel ?? t('colorpicker.chooseColor')}
439
- bind:value
438
+ bind:value={localValue}
440
439
  onchange={handleValueChange}
441
440
  onfocus={handleFocus}
442
441
  onblur={handleBlur}
@@ -201,7 +201,7 @@
201
201
  aria-label={ariaLabel ?? t('multiSelect.accessibleName')}
202
202
  style:min-width="{triggerWidth}px"
203
203
  >
204
- {#each options as option, i (option.value)}
204
+ {#each options as option (option.value)}
205
205
  <li role="presentation" class="multi-select__item">
206
206
  <Checkbox
207
207
  value={value.includes(option.value)}
@@ -250,10 +250,6 @@
250
250
  display: flex;
251
251
  align-items: center;
252
252
  }
253
- .multi-select__trigger:focus, .multi-select__trigger:focus-visible {
254
- outline: var(--svelte-ui-focus-outline-inner);
255
- outline-offset: var(--svelte-ui-focus-outline-offset-inner);
256
- }
257
253
 
258
254
  .multi-select__inner {
259
255
  position: relative;
@@ -311,10 +307,16 @@
311
307
  outline-offset: var(--svelte-ui-focus-outline-offset-inner);
312
308
  }
313
309
 
314
- .multi-select--focus-background .multi-select__trigger:focus {
310
+ /* デザインバリアントの背景指定より詳細度を上げるため .multi-select を併記 */
311
+ .multi-select.multi-select--focus-background .multi-select__trigger:focus {
312
+ outline: none;
315
313
  background: var(--svelte-ui-hover-overlay);
316
314
  }
317
315
 
316
+ .multi-select--focus-none .multi-select__trigger:focus {
317
+ outline: none;
318
+ }
319
+
318
320
  /* =============================================
319
321
  * 状態管理
320
322
  * ============================================= */
@@ -399,7 +399,7 @@
399
399
  }
400
400
  };
401
401
 
402
- const announceToScreenReader = () => {
402
+ const announceOpened = () => {
403
403
  if (!ariaLabel && !ariaLabelledby) return;
404
404
  announceOpenClose('Popup', true, ariaLabel);
405
405
  };
@@ -514,7 +514,7 @@
514
514
  focusFirstElement();
515
515
  }
516
516
 
517
- announceToScreenReader();
517
+ announceOpened();
518
518
  onOpen?.();
519
519
  }, 1);
520
520
  };
@@ -3,6 +3,7 @@
3
3
  <script lang="ts">
4
4
  import Popup from './Popup.svelte';
5
5
  import Icon from './Icon.svelte';
6
+ import { announceToScreenReader } from '../utils/accessibility';
6
7
  import type { MenuItem } from '../types/menuItem';
7
8
 
8
9
  import type { SvelteComponent } from 'svelte';
@@ -167,26 +168,13 @@
167
168
  activeIndex = index;
168
169
  };
169
170
 
170
- const announceMenuOpened = () => {
171
- const announcement = document.createElement('div');
172
- announcement.setAttribute('aria-live', 'polite');
173
- announcement.setAttribute('aria-atomic', 'true');
174
- announcement.className = 'sr-only';
175
- announcement.textContent = `${ariaLabel} opened with ${actionableItems.length} items`;
176
- document.body.appendChild(announcement);
177
-
178
- setTimeout(() => {
179
- document.body.removeChild(announcement);
180
- }, 1000);
181
- };
182
-
183
171
  const handlePopupOpen = () => {
184
172
  activeIndex = -1; // 初期状態ではハイライトなし
185
173
  tick().then(() => {
186
174
  menuContainerRef?.focus();
187
175
  });
188
176
 
189
- announceMenuOpened();
177
+ announceToScreenReader(`${ariaLabel} opened with ${actionableItems.length} items`);
190
178
  };
191
179
 
192
180
  const handlePopupClose = (reason: 'escape' | 'outside' | 'explicit') => {
@@ -255,7 +243,7 @@
255
243
  onkeydown={handleKeyDown}
256
244
  >
257
245
  <ul class="popup-menu__list" role="none">
258
- {#each menuItems as item, index}
246
+ {#each menuItems as item, index (item === 'separator' ? `separator-${index}` : item)}
259
247
  <li class="popup-menu__item" role="none">
260
248
  {#if item === 'separator'}
261
249
  <div class="popup-menu__separator" role="separator" aria-orientation="horizontal"></div>
@@ -125,7 +125,7 @@
125
125
  // 基本プロパティ
126
126
  name = '',
127
127
  value = '',
128
- currentValue = $bindable(null),
128
+ currentValue = $bindable(),
129
129
 
130
130
  // HTML属性系
131
131
  id = `radio-${Math.random().toString(36).substring(2, 15)}`,
@@ -412,12 +412,6 @@ select--focus-{focusStyle}"
412
412
  -webkit-appearance: none;
413
413
  -moz-appearance: none;
414
414
  appearance: none;
415
-
416
- &:focus,
417
- &:focus-visible {
418
- outline: var(--svelte-ui-focus-outline-inner);
419
- outline-offset: var(--svelte-ui-focus-outline-offset-inner);
420
- }
421
415
  }
422
416
 
423
417
  .select__dropdown-icon {
@@ -456,10 +450,16 @@ select--focus-{focusStyle}"
456
450
  outline-offset: var(--svelte-ui-focus-outline-offset-inner);
457
451
  }
458
452
 
459
- .select--focus-background select:focus {
453
+ /* デザインバリアントの背景指定より詳細度を上げるため .select を併記 */
454
+ .select.select--focus-background select:focus {
455
+ outline: none;
460
456
  background: var(--svelte-ui-hover-overlay);
461
457
  }
462
458
 
459
+ .select--focus-none select:focus {
460
+ outline: none;
461
+ }
462
+
463
463
  /* =============================================
464
464
  * 状態管理(disabled, readonly等)
465
465
  * ============================================= */
@@ -88,7 +88,7 @@
88
88
  // 基本プロパティ
89
89
  stepItems,
90
90
  items: itemsAlias,
91
- value = $bindable(''),
91
+ value = $bindable(),
92
92
  progress,
93
93
 
94
94
  // URL 方式
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.66",
5
+ "version": "0.0.68",
6
6
  "type": "module",
7
7
  "keywords": [
8
8
  "svelte",