@aiquants/period-slider 0.4.2 → 0.6.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.
@@ -175,7 +175,7 @@
175
175
  display: flex;
176
176
  flex-direction: column;
177
177
  align-items: center;
178
- z-index: 2;
178
+ z-index: var(--aqps-z-handle-wrapper, 2);
179
179
  touch-action: none;
180
180
  }
181
181
 
@@ -188,7 +188,7 @@
188
188
  }
189
189
 
190
190
  .period-slider-handle-wrapper.is-active {
191
- z-index: 10;
191
+ z-index: var(--aqps-z-handle-wrapper-active, 10);
192
192
  }
193
193
 
194
194
  /* つまみ丸グラフィック (.period-slider-knob) */
@@ -303,13 +303,18 @@
303
303
  }
304
304
 
305
305
  /* つまみハンドル (.period-slider-handle) の階層 */
306
- .period-slider-handle {
307
- z-index: 30;
306
+ /* !important が無いと変数は一切効かない。コンポーネントが同じ層をインライン style でも書いており、
307
+ 通常宣言はインラインに常に負けるため。丸つまみだけを対象にするのは、ノギスの 4 つのつまみが
308
+ マクロ 15 / ミクロ 20 と互いに別の層を持ち、その差はインライン値にしか無いからで、
309
+ ここで一律に上書きすると上下段の前後関係が潰れる。
310
+ 前面側の規則は同詳細度 (0,2,0) で後ろに置くことで勝たせている (詳細度が同点なら後勝ち) */
311
+ .period-slider-handle:not(.period-slider-handle-vernier) {
312
+ z-index: var(--aqps-z-handle, 30) !important;
308
313
  }
309
314
 
310
315
  .period-slider-handle[data-front="true"],
311
316
  .period-slider-handle[data-active="true"] {
312
- z-index: 40 !important;
317
+ z-index: var(--aqps-z-handle-front, 40) !important;
313
318
  }
314
319
 
315
320
  /* インジケーターラベル (.period-slider-tooltip): ● (つまみ) の中心点 (top:50%, left:50%) を基準に配置 */
@@ -329,7 +334,7 @@
329
334
  transform: translate(var(--ps-tooltip-tx), var(--ps-tooltip-ty)) rotate(var(--ps-tooltip-rot)) scale(var(--ps-tooltip-scale)) !important;
330
335
  white-space: nowrap !important;
331
336
  pointer-events: none !important;
332
- z-index: 31 !important;
337
+ z-index: var(--aqps-z-label, 31) !important;
333
338
  transition:
334
339
  transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
335
340
  box-shadow 0.2s ease,
@@ -339,7 +344,7 @@
339
344
  /* 前面(クリック/操作中)ハンドルのツールチップ z-index */
340
345
  .period-slider-handle[data-front="true"] .period-slider-tooltip,
341
346
  .period-slider-handle[data-active="true"] .period-slider-tooltip {
342
- z-index: 41 !important;
347
+ z-index: var(--aqps-z-label-front, 41) !important;
343
348
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
344
349
  }
345
350
 
@@ -351,6 +356,19 @@
351
356
  0 0 22px rgba(56, 189, 248, 0.75);
352
357
  }
353
358
 
359
+ /* 同じ値が二重に描かれる 2 つの場合を 1 つの機構で隠す。
360
+ (1) 2 つのつまみが同じ値を持つとき、背面側のラベルは前面側と一字一句同じ文字列になる。
361
+ (2) ポインターがつまみと同じ値を指しているとき、追従ツールチップはそのつまみのラベルと同じ文字列になる。
362
+ display:none やアンマウントでは ResizeObserver が実寸を報告しなくなり (0px または通知停止)、
363
+ つまみが離れた瞬間に未実測の値で傾斜計算が走って配置が跳ねる。加えて追従ツールチップは
364
+ 出現アニメーションを持つため、値が一致するたびに消して作り直すと横切るだけで再生が繰り返される。
365
+ visibility:hidden ならボーダーボックスは残り実測も要素の同一性も続く一方、描画とアクセシビリティ
366
+ ツリーの双方からは外れる。!important は隣接宣言と同じく Tailwind ユーティリティ層へ勝つため */
367
+ .period-slider-tooltip[data-duplicate="true"],
368
+ .period-slider-hover-tooltip[data-duplicate="true"] {
369
+ visibility: hidden !important;
370
+ }
371
+
354
372
  /* 垂直モード (isVertical) 時のインジケーターラベル配置: つまみの左側 8px に垂直中央揃えで配置 */
355
373
  .period-slider-track[data-orientation="vertical"] .period-slider-tooltip,
356
374
  .period-slider[data-orientation="vertical"] .period-slider-tooltip {
@@ -372,6 +390,13 @@
372
390
  animation: period-slider-kirat 0.3s ease-out 0s forwards;
373
391
  }
374
392
 
393
+ /* トラック(バー)上ホバーガイド: 点と追従ツールチップを束ねる器。
394
+ z-index を持つ位置指定要素なので自身が積層文脈を作り、内部の --aqps-z-hover-tooltip は
395
+ 点との前後だけを決める。つまみ (--aqps-z-handle) との前後を決めるのは常にこちら */
396
+ .period-slider-hover-guide {
397
+ z-index: var(--aqps-z-hover-guide, 20);
398
+ }
399
+
375
400
  /* トラック(バー)上ホバーツールチップ */
376
401
  .period-slider-hover-tooltip {
377
402
  position: absolute !important;
@@ -383,7 +408,7 @@
383
408
  transform-origin: 50% 100% !important;
384
409
  white-space: nowrap !important;
385
410
  pointer-events: none !important;
386
- z-index: 25 !important;
411
+ z-index: var(--aqps-z-hover-tooltip, 25) !important;
387
412
  animation: period-slider-tooltip-pop 0.12s ease-out forwards;
388
413
  }
389
414
 
@@ -443,14 +468,16 @@
443
468
  justify-content: center;
444
469
  height: 16px;
445
470
  min-width: max-content;
446
- padding: 0 5px 1.5px 5px;
471
+ padding: var(--aqps-label-padding, 0.125rem 0.5rem) !important;
447
472
  border: 1px solid rgba(255, 255, 255, 0.3);
448
- background-color: #0284c7;
449
- color: #ffffff;
450
- font-size: 10px;
473
+ background-color: var(--aqps-label-bg, oklch(0.208 0.042 265.755)) !important;
474
+ color: var(--aqps-label-fg, #ffffff) !important;
475
+ font-size: var(--aqps-label-font-size, 0.75rem) !important;
451
476
  font-weight: 600;
452
- line-height: 1;
453
- border-radius: 3px;
477
+ /* 行送りは比率のまま持つ。文字寸法を --aqps-label-font-size で変えても行箱が追従し、
478
+ 固定の 16px 相当を書いた時のような半端な中央寄せ (サブピクセル位置の食い違い) が起きない */
479
+ line-height: calc(1 / 0.75);
480
+ border-radius: var(--aqps-label-radius, 0.25rem) !important;
454
481
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
455
482
  transition:
456
483
  background-color 0.15s ease,
@@ -480,8 +507,8 @@
480
507
  }
481
508
 
482
509
  .dark .period-slider-tooltip {
483
- background-color: #0284c7;
484
- color: #f8fafc;
510
+ background-color: var(--aqps-label-bg-dark, oklch(0.279 0.041 260.031)) !important;
511
+ color: var(--aqps-label-fg-dark, #ffffff) !important;
485
512
  }
486
513
 
487
514
  .dark .period-slider-tooltip.is-active {
@@ -497,25 +524,28 @@
497
524
  /* ------------------------------------------------------------- */
498
525
  /* ツールチップ: Balloon スタイル (旧水滴バルーン風) */
499
526
  /* ------------------------------------------------------------- */
500
- [data-tooltip-style="balloon"] .period-slider-tooltip {
501
- height: 28px;
502
- width: 28px;
503
- padding: 0;
504
- border: none;
505
- background-color: #5fc0f4;
506
- color: #ffffff;
507
- font-size: 10px;
508
- border-radius: 50% 50% 50% 0;
509
- transform: rotate(-45deg) translateY(-8px);
510
- box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
511
- }
512
-
513
- /* Balloon ツールチップ内の文字を水平に逆回転補正 */
514
- [data-tooltip-style="balloon"] .period-slider-tooltip > * {
515
- transform: rotate(45deg);
516
- }
517
-
518
- [data-tooltip-style="balloon"] .period-slider-tooltip.is-active {
527
+ /* data-tooltip-style はツールチップ要素自身に付くため、子孫結合子では一致しない (要素自身で選ぶ)。
528
+ 回転は基底ルールの transform (!important) が握っており、ここで transform を書いても効かない。
529
+ 仮に勝たせると衝突回避の平行移動ごと消えてラベルがつまみから外れるため、形は border-radius だけで作る。
530
+ !important は隣接する .period-slider-tooltip や [data-duplicate="true"] と同じ理由による。利用側が
531
+ Tailwind の場合、本 CSS はユーティリティ層より下のカスケードレイヤーへ取り込まれるため、詳細度が
532
+ 高くても !important 無しでは要素に付く bg-slate-900 / rounded / px-2 py-0.5 / text-xs が勝つ。
533
+ ユーティリティの無い height と border だけが適用される半端な見た目 (pill でも balloon でもない) を避ける */
534
+ .period-slider-tooltip[data-tooltip-style="balloon"] {
535
+ height: 28px !important;
536
+ /* 角丸の内側へ文字が潜らないよう、pill 既定 (5px) より広い左右余白を取る */
537
+ padding: 0 10px 1.5px 10px !important;
538
+ border: none !important;
539
+ background-color: #5fc0f4 !important;
540
+ color: #ffffff !important;
541
+ font-size: 10px !important;
542
+ /* 左下だけ角を残した吹き出しの尾。ラベル幅は文字列とロケールで変わるため、水平半径に % を使うと
543
+ 箱全体が楕円になって文字が欠ける。高さ 28px の半分を実寸で指定し、端は常に半円に保つ */
544
+ border-radius: 14px 14px 14px 0 !important;
545
+ box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2) !important;
546
+ }
547
+
548
+ .period-slider-tooltip[data-tooltip-style="balloon"].is-active {
519
549
  background-color: #0284c7;
520
550
  box-shadow:
521
551
  0 0 0 2px #ffffff,
@@ -867,10 +897,10 @@
867
897
  right: auto;
868
898
  }
869
899
 
870
- /* Vernier モードにおけるツールチップのクリアランス(上側 / 下側に 8px の数学的クリアランスを確保) */
900
+ /* Vernier モードにおけるツールチップのクリアランス(上側 / 下側に既定 8px の数学的クリアランスを確保) */
871
901
  .period-slider-handle-vernier[data-vernier-pos="top"] .period-slider-tooltip {
872
902
  top: auto !important;
873
- bottom: calc(100% + 8px) !important;
903
+ bottom: calc(100% + var(--aqps-label-rail-gap, 8px)) !important;
874
904
  left: 50% !important;
875
905
  right: auto !important;
876
906
  margin: 0 !important;
@@ -881,7 +911,7 @@
881
911
  }
882
912
 
883
913
  .period-slider-handle-vernier[data-vernier-pos="bottom"] .period-slider-tooltip {
884
- top: calc(100% + 8px) !important;
914
+ top: calc(100% + var(--aqps-label-rail-gap, 8px)) !important;
885
915
  bottom: auto !important;
886
916
  left: 50% !important;
887
917
  right: auto !important;
@@ -892,11 +922,11 @@
892
922
  transform: translate(var(--ps-tooltip-tx), var(--ps-tooltip-ty)) rotate(var(--ps-tooltip-rot)) scale(var(--ps-tooltip-scale)) !important;
893
923
  }
894
924
 
895
- /* 垂直ノギスにおけるツールチップ(左側 / 右側に 8px の数学的クリアランス、垂直中央揃えで相互衝突完全ゼロ) */
925
+ /* 垂直ノギスにおけるツールチップ(左側 / 右側に既定 8px の数学的クリアランス、垂直中央揃えで相互衝突完全ゼロ) */
896
926
  .period-slider-handle-vernier.is-vertical[data-vernier-pos="left"] .period-slider-tooltip {
897
927
  top: 50% !important;
898
928
  bottom: auto !important;
899
- right: calc(100% + 8px) !important;
929
+ right: calc(100% + var(--aqps-label-rail-gap, 8px)) !important;
900
930
  left: auto !important;
901
931
  margin: 0 !important;
902
932
  --ps-tooltip-tx: 0px;
@@ -908,7 +938,7 @@
908
938
  .period-slider-handle-vernier.is-vertical[data-vernier-pos="right"] .period-slider-tooltip {
909
939
  top: 50% !important;
910
940
  bottom: auto !important;
911
- left: calc(100% + 8px) !important;
941
+ left: calc(100% + var(--aqps-label-rail-gap, 8px)) !important;
912
942
  right: auto !important;
913
943
  margin: 0 !important;
914
944
  --ps-tooltip-tx: 0px;