transitions-refine 0.3.3 → 0.3.4

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.
Files changed (2) hide show
  1. package/demo.html +73 -42
  2. package/package.json +1 -1
package/demo.html CHANGED
@@ -415,14 +415,14 @@
415
415
  @media (prefers-reduced-motion: reduce) { .tl-col-resizer-line { transition: none; } }
416
416
 
417
417
  /* ── value field (slider + input) — exact Figma "Value slider and input" ── */
418
- .tl-field-wrap { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
419
- .tl-field { position: relative; flex: 1; min-width: 0; height: 36px; border-radius: 8px;
418
+ .tl-field-wrap { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
419
+ .tl-field { position: relative; flex: 1; min-width: 0; height: 32px; border-radius: 8px;
420
420
  background: var(--c-field-bg); transition: box-shadow 0.12s ease; }
421
421
  /* focused: dual inset ring (Figma Focused state) */
422
422
  .tl-field.is-editing { box-shadow: inset 0 0 0 1px rgba(0,0,0,0.14), inset 0 0 0 0.5px rgba(255,255,255,0.06); }
423
423
  /* inner slider fill — Figma button/tiny: soft drop shadow + inset ring give the
424
424
  "raised block" look (shadow 0 1px 3px @4%, hairline border, bottom 1px). */
425
- .tl-field-fill { position: absolute; left: 0; top: 0; bottom: 0; min-width: 36px; border-radius: 8px;
425
+ .tl-field-fill { position: absolute; left: 0; top: 0; bottom: 0; min-width: 32px; border-radius: 8px;
426
426
  background: var(--c-fill);
427
427
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.02), inset 0 -1px 0 0 rgba(0,0,0,0.08), inset 0 0 0 1px rgba(191,191,191,0.10), 0 1px 3px 0 rgba(0,0,0,0.06);
428
428
  pointer-events: none; transition: background 0.12s ease, opacity 0.12s ease; z-index: 1; }
@@ -439,13 +439,13 @@
439
439
  text-align: right; border: none; background: transparent; font: inherit; font-size: 13px; font-weight: 500;
440
440
  color: var(--c-text); outline: none; z-index: 4; font-variant-numeric: tabular-nums; }
441
441
  /* thumb at the right edge of the fill (Figma #767676 2×20px, inset 8px, hover 60% / drag 100%) */
442
- .tl-field-thumb { position: absolute; right: 8px; top: 8px; height: 20px; width: 2px;
442
+ .tl-field-thumb { position: absolute; right: 8px; top: 7px; height: 18px; width: 2px;
443
443
  background: var(--c-thumb); border-radius: 20px; opacity: 0; pointer-events: none;
444
444
  transition: opacity 0.12s ease; z-index: 3; }
445
445
  .tl-field:hover .tl-field-thumb { opacity: 0.6; }
446
446
  .tl-field.is-dragging .tl-field-thumb { opacity: 1; }
447
447
  .tl-field.is-editing .tl-field-thumb { opacity: 0; }
448
- .tl-field-chevron { flex: none; width: 36px; height: 36px; border-radius: 8px; display: flex;
448
+ .tl-field-chevron { flex: none; width: 32px; height: 32px; border-radius: 8px; display: flex;
449
449
  align-items: center; justify-content: center; border: none; background: var(--c-field-bg);
450
450
  color: var(--c-ruler); cursor: pointer; transition: background 0.12s ease, scale 0.12s ease; }
451
451
  .tl-field-chevron:hover { background: var(--c-sec-h); }
@@ -492,7 +492,7 @@
492
492
  }
493
493
  /* easing select trigger (custom dropdown) */
494
494
  /* select trigger — Logram design system (node 13064:2418): flat #f7f7f7 fill */
495
- .tl-select { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 36px;
495
+ .tl-select { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 32px;
496
496
  border: none; border-radius: 8px; background: #f7f7f7; padding: 6px 10px 6px 12px;
497
497
  font: inherit; font-size: 13px; font-weight: 500; line-height: 16px; color: #1b1b1b; cursor: pointer; text-align: left;
498
498
  transition: background 0.12s ease; }
@@ -520,35 +520,84 @@
520
520
  .tl-custom-input { height: 30px; border: none; border-radius: 6px; background: var(--c-field-bg); padding: 0 8px;
521
521
  font: inherit; font-size: 12px; font-family: monospace; color: var(--c-text); outline: none;
522
522
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04); }
523
- .tl-bounce { background: #fff; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--c-hairline);
524
- padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
525
- .tl-bounce-title { font-size: 11px; color: var(--c-text-mut); font-weight: 600; }
526
- .tl-bounce-row { display: flex; align-items: center; gap: 8px; }
527
- .tl-bounce-row label { font-size: 11px; color: #737373; width: 54px; flex: none; }
528
- .tl-bounce-row input[type="range"] { flex: 1; height: 4px; -webkit-appearance: none; appearance: none;
529
- background: #e3e3e8; border-radius: 2px; outline: none; }
523
+ .tl-bounce { background: #fff; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--c-hairline);
524
+ padding: 12px; display: flex; flex-direction: column; gap: 11px; }
525
+ .tl-bounce-title { font-size: 11px; color: var(--c-text-mut); font-weight: 600; letter-spacing: 0.01em; }
526
+ .tl-bounce-row { display: flex; align-items: center; gap: 10px; }
527
+ .tl-bounce-row label { font-size: 12px; color: #585858; font-weight: 500; width: 58px; flex: none; }
528
+ .tl-bounce-row input[type="range"] { flex: 1; height: 5px; -webkit-appearance: none; appearance: none;
529
+ background: #e7e7ec; border-radius: 3px; outline: none; cursor: pointer; transition: filter 0.12s ease; }
530
+ .tl-bounce-row input[type="range"]:hover { filter: brightness(0.98); }
530
531
  .tl-bounce-row input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none;
531
- width: 12px; height: 12px; border-radius: 50%; background: var(--c-blue); cursor: pointer; }
532
- .tl-bounce-val { font-size: 11px; color: var(--c-blue); width: 34px; text-align: right; }
532
+ width: 14px; height: 14px; border-radius: 50%; background: var(--c-blue); cursor: pointer;
533
+ border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,113,226,0.4), 0 0 0 0.5px rgba(0,0,0,0.04);
534
+ transition: transform 0.12s cubic-bezier(0.22,1,0.36,1); }
535
+ .tl-bounce-row input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.12); }
536
+ .tl-bounce-row input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.18); }
537
+ .tl-bounce-row input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%;
538
+ background: var(--c-blue); cursor: pointer; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,113,226,0.4); }
539
+ .tl-bounce-val { font-size: 12px; font-weight: 600; color: var(--c-blue); width: 38px; text-align: right;
540
+ font-variant-numeric: tabular-nums; }
533
541
  .tl-bounce select { height: 26px; border: none; border-radius: 6px; background: var(--c-field-bg);
534
542
  font: inherit; font-size: 11px; color: var(--c-text); outline: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04); flex: 1; }
535
543
 
536
544
  /* ── Easing / Springs tabs — Logram design system (node 13064:2552): trackless toggle pills ── */
537
- .tl-seg { display: flex; align-items: center; gap: 4px; margin-top: 12px; }
545
+ .tl-seg { display: flex; align-items: center; gap: 4px; margin-top: 10px; }
538
546
  .tl-seg-btn { height: 32px; padding: 6px 12px; border: none; border-radius: 8px; background: transparent;
539
547
  font: inherit; font-size: 13px; font-weight: 500; line-height: 14px; color: #676767; cursor: pointer;
540
548
  transition: background 0.14s ease, color 0.14s ease; }
541
549
  .tl-seg-btn:hover:not(.is-active) { background: rgba(170,170,170,0.06); color: #17181c; }
542
550
  .tl-seg-btn.is-active { background: rgba(170,170,170,0.1); color: #17181c; }
543
551
 
552
+ /* position preview (animated marker à la easing.dev) — collapsible accordion
553
+ (transitions.dev · 21-accordion: grid-rows 0fr↔1fr + vertical chevron flip) */
554
+ .tl-preview { margin-top: 10px; background: #fff; border-radius: 10px;
555
+ box-shadow: inset 0 0 0 1px var(--c-hairline); overflow: hidden;
556
+ --acc-dur: 260ms; --acc-ease: cubic-bezier(0.22, 1, 0.36, 1); }
557
+ .tl-preview-head { display: flex; align-items: center; justify-content: space-between; width: 100%;
558
+ padding: 9px 12px; border: none; background: transparent; cursor: pointer; font: inherit;
559
+ border-radius: 10px; transition: background 0.12s ease; }
560
+ .tl-preview-head:hover { background: rgba(170,170,170,0.06); }
561
+ .tl-preview-title { font-size: 11px; font-weight: 600; color: var(--c-text-mut); letter-spacing: 0.01em; }
562
+ .tl-preview-chevron { display: inline-flex; color: var(--c-ruler);
563
+ transform: scaleY(1); transform-origin: center; transition: transform var(--acc-dur) var(--acc-ease); }
564
+ .tl-preview[data-open="true"] .tl-preview-chevron { transform: scaleY(-1); }
565
+ .tl-preview-panel { display: grid; grid-template-rows: 0fr;
566
+ transition: grid-template-rows var(--acc-dur) var(--acc-ease); }
567
+ .tl-preview[data-open="true"] .tl-preview-panel { grid-template-rows: 1fr; }
568
+ .tl-preview-panel-inner { overflow: hidden; opacity: 0; filter: blur(2px); padding: 0 12px 12px;
569
+ transition: opacity var(--acc-dur) var(--acc-ease), filter var(--acc-dur) var(--acc-ease); }
570
+ .tl-preview[data-open="true"] .tl-preview-panel-inner { opacity: 1; filter: blur(0); }
571
+ .tl-preview-controls { display: flex; justify-content: flex-end; margin-bottom: 10px; }
572
+ .tl-preview-btn { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px 0 7px;
573
+ border: none; border-radius: 6px; background: var(--c-field-bg); color: var(--c-text-mut2);
574
+ font: inherit; font-size: 11px; font-weight: 500; cursor: pointer;
575
+ transition: background 0.12s ease, scale 0.12s ease; }
576
+ .tl-preview-btn:hover { background: var(--c-sec-h); }
577
+ .tl-preview-btn:active { scale: 0.96; }
578
+ .tl-preview-track { position: relative; height: 22px; }
579
+ .tl-preview-rail { position: absolute; left: 0; right: 0; top: 50%; height: 2px; transform: translateY(-50%);
580
+ background: var(--c-track); border-radius: 2px; }
581
+ .tl-preview-end { position: absolute; top: 50%; width: 2px; height: 10px; transform: translateY(-50%);
582
+ background: #d0d0d6; border-radius: 2px; }
583
+ .tl-preview-end.left { left: 0; }
584
+ .tl-preview-end.right { right: 0; }
585
+ .tl-preview-dot { position: absolute; left: 0; top: 50%; width: 18px; height: 18px; margin-top: -9px;
586
+ border-radius: 50%; background: var(--c-blue); border: 2px solid #fff;
587
+ box-shadow: 0 2px 6px rgba(0,113,226,0.4), 0 0 0 0.5px rgba(0,0,0,0.05);
588
+ will-change: transform; }
589
+ @media (prefers-reduced-motion: reduce) {
590
+ .tl-preview-panel, .tl-preview-panel-inner, .tl-preview-chevron { transition: none !important; }
591
+ }
592
+
544
593
  /* menu section header (non-clickable) — Figma node 580:1696 dropdown */
545
594
  .tl-menu-group { padding: 12px 8px 8px; font-size: 11px; font-weight: 400; line-height: 14px;
546
595
  color: #8b8b8b; pointer-events: none; }
547
596
  .tl-menu-group:first-child { padding-top: 4px; }
548
597
 
549
598
  /* spring params box (reuses bounce row layout) */
550
- .tl-spring-dur { display: flex; align-items: baseline; gap: 6px; font-size: 11px; color: var(--c-text-mut);
551
- padding-top: 2px; border-top: 1px solid var(--c-hairline); margin-top: 2px; }
599
+ .tl-spring-dur { display: flex; align-items: baseline; gap: 6px; font-size: 12px; color: var(--c-text-mut);
600
+ padding-top: 10px; border-top: 1px solid var(--c-hairline); margin-top: 0; }
552
601
  .tl-spring-dur b { color: var(--c-text); font-weight: 600; font-variant-numeric: tabular-nums; }
553
602
  .tl-spring-dur .tl-spring-dur-hint { color: var(--c-text-faint); }
554
603
 
@@ -592,9 +641,6 @@
592
641
  .tl-menu-item-label { flex: 1; min-width: 0; display: flex; align-items: center; }
593
642
  .tl-menu-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
594
643
  .tl-menu-dim { color: #979797; }
595
- .tl-menu-help { color: #c4c4cc; margin-left: 10px; flex: none; cursor: help; }
596
- .tl-menu-help:hover { color: var(--c-ruler); }
597
- .tl-menu-help svg { display: block; }
598
644
  .tl-menu-check { display: flex; color: var(--c-text-strong); flex: none; }
599
645
  .tl-menu-empty { padding: 10px 8px; color: var(--c-disabled); font-size: 13px; }
600
646
  .tl-menu-section { padding: 12px 8px 8px; font-size: 11px; font-weight: 400; line-height: 14px;
@@ -702,11 +748,6 @@
702
748
  }
703
749
  /* below-variant for triggers near the panel top edge */
704
750
  .t-tt.tl-tt-below { bottom: auto; top: calc(100% + 8px); transform-origin: 50% 0; font-size: 12px; }
705
- /* usage-variant: right-anchored, multi-line copy for token help icons */
706
- .t-tt.tl-tt-usage { left: auto; right: -6px; width: 224px; white-space: normal; text-align: left;
707
- font-size: 12px; line-height: 1.45; padding: 9px 11px; transform-origin: 100% 100%;
708
- text-wrap: balance; transform: translate(0, 4px) scale(var(--tt-scale)); }
709
- .t-tt-wrap:hover .t-tt.tl-tt-usage { transform: translate(0, 0) scale(1); }
710
751
 
711
752
  /* ═════ transitions.dev — panel reveal (per-phase distance/ease/scale) ═════ */
712
753
  /* base = closed / close-end state: resolved travel + scale come from the
@@ -1338,6 +1379,8 @@
1338
1379
  };
1339
1380
  ICONS.minimize = ICONS.chevron;
1340
1381
  ICONS.close = {vb:"0 0 16 16", svg:`<path d="M4 4L12 12M12 4L4 12" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>`};
1382
+ ICONS.play = {vb:"0 0 16 16", svg:`<path d="M5 3.5L12 8L5 12.5V3.5Z" fill="currentColor"/>`};
1383
+ ICONS.pause = {vb:"0 0 16 16", svg:`<path d="M5 3.5H6.8V12.5H5V3.5ZM9.2 3.5H11V12.5H9.2V3.5Z" fill="currentColor"/>`};
1341
1384
  // dots-vertical (Figma node 580:4819) — vertical "⋮" overflow icon
1342
1385
  ICONS.dotsv = {vb:"0 0 16 16", svg:`<path fill-rule="evenodd" clip-rule="evenodd" d="M6.66667 8C6.66667 7.26362 7.26362 6.66667 8 6.66667C8.73638 6.66667 9.33333 7.26362 9.33333 8C9.33333 8.73638 8.73638 9.33333 8 9.33333C7.26362 9.33333 6.66667 8.73638 6.66667 8Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M6.66667 3.33333C6.66667 2.59695 7.26362 2 8 2C8.73638 2 9.33333 2.59695 9.33333 3.33333C9.33333 4.06971 8.73638 4.66667 8 4.66667C7.26362 4.66667 6.66667 4.06971 6.66667 3.33333Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M6.66667 12.6667C6.66667 11.9303 7.26362 11.3333 8 11.3333C8.73638 11.3333 9.33333 11.9303 9.33333 12.6667C9.33333 13.403 8.73638 14 8 14C7.26362 14 6.66667 13.403 6.66667 12.6667Z" fill="currentColor"/>`};
1343
1386
  function Ic({name, size=16}){
@@ -1720,7 +1763,7 @@
1720
1763
  fFlat.length>0&&fGroups.length>0&&h("div",{className:"tl-menu-section"},"Ungrouped"),
1721
1764
  ...fFlat.map(flatItem))),
1722
1765
  h("span",{className:"tl-header-count"},
1723
- scanning?"Grouping…":entries.length+" transition"+(entries.length===1?"":"s")+" found"),
1766
+ scanning?"Scanning transitions…":entries.length+" transition"+(entries.length===1?"":"s")+" found"),
1724
1767
  h("button",{ref:gearRef,className:cx("tl-icon-btn",setg&&"is-active"),title:"Settings",onClick:()=>setSetg(v=>!v)},h(Ic,{name:"dotsv"})),
1725
1768
  h(Dropdown,{open:setg,onClose:()=>setSetg(false),triggerRef:gearRef,width:210,align:"right"},
1726
1769
  h(MenuItem,{onClick:()=>setSnap(v=>!v),right:snap&&h("span",{className:"tl-menu-check"},h(Ic,{name:"check"}))},"Snap to grid"),
@@ -1868,11 +1911,7 @@
1868
1911
  width:(wrapRef.current&&wrapRef.current.offsetWidth)||220,align:"right"},
1869
1912
  (tokens||[]).map(tk=>h(MenuItem,{key:tk.label,active:value===tk.ms,onClick:()=>{onChange(tk.ms);setMenu(false);},
1870
1913
  right:value===tk.ms&&h("span",{className:"tl-menu-check"},h(Ic,{name:"check"}))},
1871
- h("span",{className:"tl-menu-text"},tk.label,h("span",{className:"tl-menu-dim"}," "+tk.ms+"ms")),
1872
- tk.usage&&h("span",{className:"t-tt-wrap tl-menu-help",
1873
- onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation()},
1874
- h(Ic,{name:"help",size:13}),
1875
- h("span",{className:"t-tt tl-tt-usage",role:"tooltip"},tk.usage)))) ),
1914
+ h("span",{className:"tl-menu-text"},tk.label,h("span",{className:"tl-menu-dim"}," "+tk.ms+"ms")))) ),
1876
1915
  readOnly&&readOnlyHint&&h("span",{className:"t-tt",role:"tooltip"},readOnlyHint),
1877
1916
  );
1878
1917
  }
@@ -2011,11 +2050,7 @@
2011
2050
  : h(MenuItem,{key:"e"+i,active:selEaseIdx>=0?i===selEaseIdx:(o.value===mode),
2012
2051
  onClick:()=>pickEase(o.value),
2013
2052
  right:(i===selEaseIdx)&&h("span",{className:"tl-menu-check"},h(Ic,{name:"check"}))},
2014
- h("span",{className:"tl-menu-text"},o.label),
2015
- o.usage&&h("span",{className:"t-tt-wrap tl-menu-help",
2016
- onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation()},
2017
- h(Ic,{name:"help",size:13}),
2018
- h("span",{className:"t-tt tl-tt-usage",role:"tooltip"},o.usage))))),
2053
+ h("span",{className:"tl-menu-text"},o.label)))),
2019
2054
  h("div",{className:"tl-cubic-row"},
2020
2055
  ...[0,1,2,3].map(i=>h("input",{key:i,type:"number",step:0.05,min:i%2===0?0:undefined,max:i%2===0?1:undefined,
2021
2056
  value:cb[i],onChange:e=>setCubicVal(i,e.target.value)})),
@@ -2080,11 +2115,7 @@
2080
2115
  SPRING_PRESETS.map(p=>h(MenuItem,{key:p.label,active:p.label===presetName,
2081
2116
  onClick:()=>{applySpring(p.stiffness,p.damping,p.mass,p.label);setSpOpen(false);},
2082
2117
  right:p.label===presetName&&h("span",{className:"tl-menu-check"},h(Ic,{name:"check"}))},
2083
- h("span",{className:"tl-menu-text"},p.label),
2084
- p.usage&&h("span",{className:"t-tt-wrap tl-menu-help",
2085
- onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation()},
2086
- h(Ic,{name:"help",size:13}),
2087
- h("span",{className:"t-tt tl-tt-usage",role:"tooltip"},p.usage))))),
2118
+ h("span",{className:"tl-menu-text"},p.label)))),
2088
2119
  h("div",{className:"tl-bounce"},
2089
2120
  h("div",{className:"tl-bounce-title"},"Spring physics"),
2090
2121
  h("div",{className:"tl-bounce-row"},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "transitions-refine",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "Live, agent-driven Refine panel for CSS/Motion transitions — injects a timeline + Refine UI and runs transitions.dev suggestions via your coding agent.",
5
5
  "type": "module",
6
6
  "bin": {