@kitlangton/knobs 0.4.0-next.2 → 0.4.0-next.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.
- package/README.md +62 -12
- package/dist/dev/{chunk-8mabjeyk.js → chunk-0w1xk9jc.js} +162 -1
- package/dist/dev/{chunk-1qzffbpa.js → chunk-76frnh2j.js} +78 -34
- package/dist/dev/{chunk-ayb292zj.js → chunk-rem3qrhz.js} +2 -2
- package/dist/dev/index.js +3 -3
- package/dist/panel.js +240 -34
- package/dist/themes.js +160 -0
- package/dist/types/tokens/schema.d.ts +180 -0
- package/dist/types/ui/compare-css.d.ts +1 -1
- package/dist/types/ui/compare-gpu.d.ts +0 -5
- package/dist/types/ui/compare-model.d.ts +31 -2
- package/dist/types/ui/compare.d.ts +17 -4
- package/dist/types/ui/history-css.d.ts +1 -0
- package/dist/types/ui/history-model.d.ts +236 -0
- package/dist/types/ui/history.d.ts +33 -0
- package/dist/types/ui/icons.d.ts +40 -0
- package/dist/types/ui/index.d.ts +4 -2
- package/dist/types/ui/selection-pill-css.d.ts +1 -0
- package/dist/types/ui/selection-pill.d.ts +103 -0
- package/dist/types/ui/timeline-model.d.ts +23 -0
- package/dist/types/ui/timeline.d.ts +11 -1
- package/dist/types/ui/tree.d.ts +3 -2
- package/dist/types/ui/walkthrough-blocks.d.ts +20 -1
- package/dist/types/ui/walkthrough-model.d.ts +59 -1
- package/dist/types/ui/walkthrough.d.ts +10 -2
- package/dist/ui-react.js +2027 -952
- package/dist/ui-solid.js +2027 -952
- package/dist/ui.js +2047 -952
- package/package.json +1 -1
package/dist/panel.js
CHANGED
|
@@ -1746,6 +1746,22 @@ var init_schema = __esm(() => {
|
|
|
1746
1746
|
source: css("var(--k-warn)"),
|
|
1747
1747
|
doc: "Modified lines."
|
|
1748
1748
|
},
|
|
1749
|
+
{
|
|
1750
|
+
name: "before",
|
|
1751
|
+
tier: "semantic",
|
|
1752
|
+
type: "color",
|
|
1753
|
+
group: "Data",
|
|
1754
|
+
source: css("var(--k-fg-3)"),
|
|
1755
|
+
doc: "Before in a comparison, and only Before: its label and side of the seam. Neutral unless a theme gives it a colour."
|
|
1756
|
+
},
|
|
1757
|
+
{
|
|
1758
|
+
name: "after",
|
|
1759
|
+
tier: "semantic",
|
|
1760
|
+
type: "color",
|
|
1761
|
+
group: "Data",
|
|
1762
|
+
source: css("var(--k-fg)"),
|
|
1763
|
+
doc: "After in a comparison, and only After."
|
|
1764
|
+
},
|
|
1749
1765
|
{
|
|
1750
1766
|
name: "series-1",
|
|
1751
1767
|
tier: "semantic",
|
|
@@ -1836,6 +1852,150 @@ var init_schema = __esm(() => {
|
|
|
1836
1852
|
source: value("288px"),
|
|
1837
1853
|
doc: "Panel width."
|
|
1838
1854
|
},
|
|
1855
|
+
{
|
|
1856
|
+
name: "space-inside",
|
|
1857
|
+
tier: "semantic",
|
|
1858
|
+
type: "length",
|
|
1859
|
+
group: "Space",
|
|
1860
|
+
source: css("var(--k-unit)"),
|
|
1861
|
+
doc: "Parts of one thing: an icon and its label, a meta line and its title."
|
|
1862
|
+
},
|
|
1863
|
+
{
|
|
1864
|
+
name: "space-sibling",
|
|
1865
|
+
tier: "semantic",
|
|
1866
|
+
type: "length",
|
|
1867
|
+
group: "Space",
|
|
1868
|
+
source: css("calc(var(--k-unit) * 2)"),
|
|
1869
|
+
doc: "Siblings in a group: buttons in a row, a list item's lines."
|
|
1870
|
+
},
|
|
1871
|
+
{
|
|
1872
|
+
name: "space-title",
|
|
1873
|
+
tier: "semantic",
|
|
1874
|
+
type: "length",
|
|
1875
|
+
group: "Space",
|
|
1876
|
+
source: css("calc(var(--k-unit) * 3)"),
|
|
1877
|
+
doc: "A heading and what it heads."
|
|
1878
|
+
},
|
|
1879
|
+
{
|
|
1880
|
+
name: "space-group",
|
|
1881
|
+
tier: "semantic",
|
|
1882
|
+
type: "length",
|
|
1883
|
+
group: "Space",
|
|
1884
|
+
source: css("calc(var(--k-unit) * 12)"),
|
|
1885
|
+
doc: "Groups inside a section (prose, video, diff), stacked media, feed items (a hairline in the middle)."
|
|
1886
|
+
},
|
|
1887
|
+
{
|
|
1888
|
+
name: "space-section",
|
|
1889
|
+
tier: "semantic",
|
|
1890
|
+
type: "length",
|
|
1891
|
+
group: "Space",
|
|
1892
|
+
source: css("calc(var(--k-unit) * 24)"),
|
|
1893
|
+
doc: "Sections of a page (the intro, the updates, each PR), a hairline in the middle."
|
|
1894
|
+
},
|
|
1895
|
+
{
|
|
1896
|
+
name: "space-column",
|
|
1897
|
+
tier: "semantic",
|
|
1898
|
+
type: "length",
|
|
1899
|
+
group: "Space",
|
|
1900
|
+
source: css("calc(var(--k-unit) * 6)"),
|
|
1901
|
+
doc: "Columns: a contents rail and the page, media side by side."
|
|
1902
|
+
},
|
|
1903
|
+
{
|
|
1904
|
+
name: "pad-page",
|
|
1905
|
+
tier: "semantic",
|
|
1906
|
+
type: "length",
|
|
1907
|
+
group: "Space",
|
|
1908
|
+
source: css("calc(var(--k-unit) * 6)"),
|
|
1909
|
+
doc: "A page's edge; 16px under 640px wide."
|
|
1910
|
+
},
|
|
1911
|
+
{
|
|
1912
|
+
name: "pad-card",
|
|
1913
|
+
tier: "semantic",
|
|
1914
|
+
type: "length",
|
|
1915
|
+
group: "Space",
|
|
1916
|
+
source: css("calc(var(--k-unit) * 3)"),
|
|
1917
|
+
doc: "Inside a card or popover."
|
|
1918
|
+
},
|
|
1919
|
+
{
|
|
1920
|
+
name: "type-heading",
|
|
1921
|
+
tier: "semantic",
|
|
1922
|
+
type: "length",
|
|
1923
|
+
group: "Type",
|
|
1924
|
+
source: value("20px"),
|
|
1925
|
+
doc: "Section headings (a PR's title, under its kicker), weight 500."
|
|
1926
|
+
},
|
|
1927
|
+
{
|
|
1928
|
+
name: "leading-heading",
|
|
1929
|
+
tier: "semantic",
|
|
1930
|
+
type: "length",
|
|
1931
|
+
group: "Type",
|
|
1932
|
+
source: value("28px"),
|
|
1933
|
+
doc: "Line height for type-heading."
|
|
1934
|
+
},
|
|
1935
|
+
{
|
|
1936
|
+
name: "type-title",
|
|
1937
|
+
tier: "semantic",
|
|
1938
|
+
type: "length",
|
|
1939
|
+
group: "Type",
|
|
1940
|
+
source: value("16px"),
|
|
1941
|
+
doc: "A page's title, weight 500."
|
|
1942
|
+
},
|
|
1943
|
+
{
|
|
1944
|
+
name: "leading-title",
|
|
1945
|
+
tier: "semantic",
|
|
1946
|
+
type: "length",
|
|
1947
|
+
group: "Type",
|
|
1948
|
+
source: value("24px"),
|
|
1949
|
+
doc: "Line height for type-title."
|
|
1950
|
+
},
|
|
1951
|
+
{
|
|
1952
|
+
name: "type-body",
|
|
1953
|
+
tier: "semantic",
|
|
1954
|
+
type: "length",
|
|
1955
|
+
group: "Type",
|
|
1956
|
+
source: value("13px"),
|
|
1957
|
+
doc: "Prose, questions, list rows, step titles; 400, or 500 for emphasis."
|
|
1958
|
+
},
|
|
1959
|
+
{
|
|
1960
|
+
name: "leading-body",
|
|
1961
|
+
tier: "semantic",
|
|
1962
|
+
type: "length",
|
|
1963
|
+
group: "Type",
|
|
1964
|
+
source: value("20px"),
|
|
1965
|
+
doc: "Line height for type-body."
|
|
1966
|
+
},
|
|
1967
|
+
{
|
|
1968
|
+
name: "type-label",
|
|
1969
|
+
tier: "semantic",
|
|
1970
|
+
type: "length",
|
|
1971
|
+
group: "Type",
|
|
1972
|
+
source: value("12px"),
|
|
1973
|
+
doc: "Labels over media, weight 500; mono inside body text."
|
|
1974
|
+
},
|
|
1975
|
+
{
|
|
1976
|
+
name: "leading-label",
|
|
1977
|
+
tier: "semantic",
|
|
1978
|
+
type: "length",
|
|
1979
|
+
group: "Type",
|
|
1980
|
+
source: value("16px"),
|
|
1981
|
+
doc: "Line height for type-label."
|
|
1982
|
+
},
|
|
1983
|
+
{
|
|
1984
|
+
name: "type-small",
|
|
1985
|
+
tier: "semantic",
|
|
1986
|
+
type: "length",
|
|
1987
|
+
group: "Type",
|
|
1988
|
+
source: value("11px"),
|
|
1989
|
+
doc: "Meta, controls, keys, timestamps; mono inside labels."
|
|
1990
|
+
},
|
|
1991
|
+
{
|
|
1992
|
+
name: "leading-small",
|
|
1993
|
+
tier: "semantic",
|
|
1994
|
+
type: "length",
|
|
1995
|
+
group: "Type",
|
|
1996
|
+
source: value("16px"),
|
|
1997
|
+
doc: "Line height for type-small."
|
|
1998
|
+
},
|
|
1839
1999
|
{
|
|
1840
2000
|
name: "font-size",
|
|
1841
2001
|
tier: "semantic",
|
|
@@ -2800,16 +2960,18 @@ function injectTokens(doc) {
|
|
|
2800
2960
|
style.textContent = rootCss;
|
|
2801
2961
|
doc.head.append(style);
|
|
2802
2962
|
}
|
|
2803
|
-
var ROOT_CLASS = "knobs-root", extras, spring, rootCss;
|
|
2963
|
+
var ROOT_CLASS = "knobs-root", extras, narrow, spring, rootCss;
|
|
2804
2964
|
var init_root = __esm(() => {
|
|
2805
2965
|
init_knobs();
|
|
2806
2966
|
init_css();
|
|
2807
2967
|
init_glide();
|
|
2808
2968
|
init_motion();
|
|
2809
2969
|
extras = `:where(.${ROOT_CLASS}){--_k-shadow-k:calc(var(--k-shadow-strength,calc(.48 - .32 * var(--_k-light,0))) / .48);--_k-glass-tone:var(--k-glass-tone,calc(.5 + .58 * var(--_k-light,0)));--_k-fill-base:var(--k-fill-base,var(--_k-fill-selected));--_k-fill-hover-mix:var(--k-fill-hover-mix,var(--k-fill-rest-mix,20%));--_k-reveal-ease:var(--k-ease,cubic-bezier(.2,.8,.2,1))}`;
|
|
2970
|
+
narrow = `@media(max-width:639.98px){:where(.${ROOT_CLASS}){--_k-pad-page:var(--k-pad-page,calc(var(--_k-unit) * 4))}}`;
|
|
2810
2971
|
spring = `:where(:root,:host){--k-fill-ease:${DEFAULT_LINEAR.easing};--k-fill-ms:${DEFAULT_LINEAR.ms}}`;
|
|
2811
2972
|
rootCss = `${tokensCss(knobs)}
|
|
2812
2973
|
${extras}
|
|
2974
|
+
${narrow}
|
|
2813
2975
|
${spring}
|
|
2814
2976
|
${DRIVERS}
|
|
2815
2977
|
${motionCss}`;
|
|
@@ -20909,12 +21071,20 @@ var compareCss = `
|
|
|
20909
21071
|
display:flex;flex-direction:column;gap:6px;width:100%;height:100%;min-height:160px;outline:none;user-select:none;-webkit-user-select:none;
|
|
20910
21072
|
font:var(--_k-weight) var(--_k-font-size)/1.35 var(--_k-font);color:var(--_k-fg);letter-spacing:normal;text-align:left}
|
|
20911
21073
|
:where(.knobs-ui) :is(.knobs-cmp-mode,.knobs-cmp-toggle){all:revert;box-sizing:border-box;font:inherit;color:inherit;letter-spacing:inherit;background:transparent;border:0;margin:0;padding:0;outline:none;box-shadow:none}
|
|
20912
|
-
.knobs-cmp-bar{flex:none;display:flex;align-items:center;gap:
|
|
20913
|
-
|
|
20914
|
-
|
|
20915
|
-
|
|
20916
|
-
.knobs-
|
|
20917
|
-
.knobs-ui .knobs-cmp-mode
|
|
21074
|
+
.knobs-cmp-bar{flex:none;display:flex;align-items:center;gap:var(--_k-gap);height:var(--_k-control-h)}
|
|
21075
|
+
/* The modes: one fill, the selection pill on the one picked; a mode isn't brighter for being
|
|
21076
|
+
picked: the pill's bright copy is. */
|
|
21077
|
+
.knobs-cmp-modes{position:relative;display:inline-flex;height:var(--_k-control-h);border-radius:var(--_k-radius);background:var(--_k-fill)}
|
|
21078
|
+
.knobs-cmp-modes[hidden]{display:none}
|
|
21079
|
+
.knobs-ui .knobs-cmp-mode{display:inline-flex;align-items:center;height:100%;padding:0 8px;border-radius:var(--_k-radius);color:var(--_k-fg-2);cursor:pointer;white-space:nowrap;
|
|
21080
|
+
transition:color calc(var(--_k-hover-out) * 1ms)}
|
|
21081
|
+
.knobs-ui .knobs-cmp-mode:is(:hover,:focus-visible){color:var(--_k-fg)}
|
|
21082
|
+
/* Toggles: icon buttons, the accent's wash when on. */
|
|
21083
|
+
.knobs-ui .knobs-cmp-toggle{display:inline-flex;align-items:center;justify-content:center;width:var(--_k-control-h);height:var(--_k-control-h);border-radius:var(--_k-radius);color:var(--_k-fg-3);cursor:pointer;
|
|
21084
|
+
transition:color calc(var(--_k-hover-out) * 1ms),background calc(var(--_k-hover-out) * 1ms)}
|
|
21085
|
+
.knobs-ui .knobs-cmp-toggle:is(:hover,:focus-visible){color:var(--_k-fg);background:var(--_ku-wash)}
|
|
21086
|
+
.knobs-ui .knobs-cmp-toggle[aria-pressed="true"]{color:var(--_k-accent-fg);background:var(--_k-accent-soft)}
|
|
21087
|
+
.knobs-cmp-toggle svg{display:block}
|
|
20918
21088
|
.knobs-cmp-fill{flex:1}
|
|
20919
21089
|
.knobs-cmp-toggle[hidden]{display:none}
|
|
20920
21090
|
/* One surface: on a card (a walkthrough's step, a split's pane, anything .knobs-surface) or marked
|
|
@@ -20929,7 +21099,8 @@ var compareCss = `
|
|
|
20929
21099
|
/* Unzoomed, a finger still scrolls the page up and down; zoomed, the stage takes every gesture. */
|
|
20930
21100
|
.knobs-compare[data-zoomed] .knobs-cmp-stage{cursor:grab;touch-action:none}
|
|
20931
21101
|
.knobs-compare[data-panning],.knobs-compare[data-panning] *{cursor:grabbing!important}
|
|
20932
|
-
.
|
|
21102
|
+
/* Wiping, the grip stands in for the cursor. */
|
|
21103
|
+
.knobs-compare[data-dragging],.knobs-compare[data-dragging] *{cursor:none!important}
|
|
20933
21104
|
.knobs-cmp-sizer{position:absolute;left:0;right:0;top:0;height:0;visibility:hidden;pointer-events:none}
|
|
20934
21105
|
.knobs-cmp-canvas{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none}
|
|
20935
21106
|
.knobs-cmp-media{position:absolute;left:0;top:0;display:block;max-width:none;margin:0;padding:0;border:0;object-fit:fill;transform-origin:0 0;pointer-events:none;will-change:transform}
|
|
@@ -20937,18 +21108,26 @@ var compareCss = `
|
|
|
20937
21108
|
/* Glass: what's behind shows through, blurred, on the knobs tokens. */
|
|
20938
21109
|
.knobs-cmp-label,.knobs-cmp-zoom{background:color-mix(in srgb,var(--_k-bg) 52%,transparent);-webkit-backdrop-filter:blur(14px) saturate(1.6);backdrop-filter:blur(14px) saturate(1.6);
|
|
20939
21110
|
box-shadow:inset 0 0 0 .5px var(--_k-border),inset 0 1px 0 var(--_k-rim),0 2px 10px rgba(0,0,0,calc(.18 * var(--_k-shadow-k,1)))}
|
|
20940
|
-
|
|
20941
|
-
.knobs-cmp-label
|
|
20942
|
-
|
|
20943
|
-
|
|
20944
|
-
|
|
21111
|
+
/* ✗ Before · ✓ After: Before quieter (fg-3), After in full text. Neutral: no colour of its own. */
|
|
21112
|
+
.knobs-cmp-label{position:absolute;left:0;top:0;display:flex;align-items:center;gap:4px;padding:1px 7px 1px 5px;border-radius:999px;font-size:var(--_k-text-meta);line-height:16px;font-weight:var(--_k-weight-label);
|
|
21113
|
+
white-space:nowrap;pointer-events:none;will-change:transform}
|
|
21114
|
+
.knobs-cmp-label[data-side="before"]{color:var(--_k-fg-3)}
|
|
21115
|
+
.knobs-cmp-label[data-side="after"]{color:var(--_k-fg)}
|
|
21116
|
+
.knobs-cmp-mark svg{display:block;width:12px;height:12px}
|
|
21117
|
+
/* The wipe: a hairline down the line with a raised grip at the pointer's height; a wider strip
|
|
21118
|
+
takes the hand and the keys (a slider). It fades with the mode; wiping, line and grip brighten. */
|
|
20945
21119
|
.knobs-cmp-handle{cursor:ew-resize;position:absolute;left:-12px;top:0;width:24px;height:0;opacity:0;pointer-events:none;outline:none;will-change:transform;transition:opacity .18s cubic-bezier(.4,0,1,1)}
|
|
20946
21120
|
.knobs-cmp-handle[data-on]{opacity:1;pointer-events:auto;transition:opacity .22s cubic-bezier(.2,.8,.2,1)}
|
|
20947
|
-
.knobs-cmp-handle::before{content:"";position:absolute;top:0;bottom:0;left:11.5px;width:1px;background:var(--_ku-cmp-line);box-shadow:0 0 0 .5px rgba(0,0,0,.28),0 0 6px rgba(0,0,0,.25)}
|
|
20948
|
-
.knobs-cmp-handle::
|
|
20949
|
-
|
|
20950
|
-
|
|
20951
|
-
.knobs-cmp-
|
|
21121
|
+
.knobs-cmp-handle::before{content:"";position:absolute;top:0;bottom:0;left:11.5px;width:1px;background:color-mix(in srgb,var(--_ku-cmp-line) 72%,transparent);box-shadow:0 0 0 .5px rgba(0,0,0,.28),0 0 6px rgba(0,0,0,.25)}
|
|
21122
|
+
.knobs-compare[data-dragging] .knobs-cmp-handle::before{background:var(--_ku-cmp-line)}
|
|
21123
|
+
.knobs-cmp-grip{position:absolute;top:0;left:4px;width:16px;height:28px;border-radius:min(8px,calc(var(--_k-radius) * 999));background:var(--_k-bg-overlay);
|
|
21124
|
+
box-shadow:var(--_k-shadow-overlay),inset 0 0 0 1px var(--_k-border),inset 0 1px 0 var(--_k-rim);will-change:transform;transition:box-shadow calc(var(--_k-hover-out) * 1ms)}
|
|
21125
|
+
.knobs-cmp-grip::before,.knobs-cmp-grip::after{content:"";position:absolute;top:10px;width:1px;height:8px;background:var(--_k-fg-3);transition:background calc(var(--_k-hover-out) * 1ms)}
|
|
21126
|
+
.knobs-cmp-grip::before{left:6px}
|
|
21127
|
+
.knobs-cmp-grip::after{left:9px}
|
|
21128
|
+
.knobs-compare[data-dragging] .knobs-cmp-grip{box-shadow:var(--_k-shadow-overlay),inset 0 0 0 1px var(--_k-border-strong),inset 0 1px 0 var(--_k-rim)}
|
|
21129
|
+
.knobs-compare[data-dragging] .knobs-cmp-grip::before,.knobs-compare[data-dragging] .knobs-cmp-grip::after{background:var(--_k-fg)}
|
|
21130
|
+
.knobs-cmp-handle:focus-visible .knobs-cmp-grip,.knobs-compare[data-keyboard] .knobs-cmp-handle:focus .knobs-cmp-grip{box-shadow:var(--_k-shadow-overlay),0 0 0 2px var(--_k-accent)}
|
|
20952
21131
|
/* The split's hairline, down the middle side by side. */
|
|
20953
21132
|
.knobs-cmp-split{position:absolute;left:0;top:0;width:1px;height:0;margin-left:-.5px;background:color-mix(in srgb,var(--_k-bg) 72%,transparent);pointer-events:none;will-change:transform,opacity}
|
|
20954
21133
|
/* Zoomed: how far, and a way back, in the stage's corner; it fades in and out, nothing shifts. */
|
|
@@ -20957,12 +21136,12 @@ var compareCss = `
|
|
|
20957
21136
|
opacity:0;scale:.96;pointer-events:none;transition:opacity .16s cubic-bezier(.4,0,1,1),scale .16s cubic-bezier(.4,0,1,1)}
|
|
20958
21137
|
.knobs-cmp-zoom[data-on]{opacity:1;scale:1;pointer-events:auto;transition:opacity .2s cubic-bezier(.2,.8,.2,1),scale .2s cubic-bezier(.2,.8,.2,1)}
|
|
20959
21138
|
:where(.knobs-ui) .knobs-cmp-zoom-reset{all:revert;box-sizing:border-box;font:inherit;letter-spacing:inherit;margin:0;border:0;outline:none;box-shadow:none;
|
|
20960
|
-
height:20px;padding:0
|
|
21139
|
+
display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border-radius:999px;background:transparent;color:var(--_k-fg-2);cursor:pointer;transition:color .15s,background .15s}
|
|
20961
21140
|
:where(.knobs-ui) .knobs-cmp-zoom-reset:is(:hover,:focus-visible){color:var(--_k-fg);background:color-mix(in srgb,var(--_k-fg) 12%,transparent)}
|
|
20962
21141
|
.knobs-cmp-note{position:absolute;left:50%;top:50%;translate:-50% -50%;color:var(--_k-fg-3);font-size:var(--_k-text-meta);pointer-events:none}
|
|
20963
21142
|
.knobs-cmp-note:empty{display:none}
|
|
20964
21143
|
.knobs-cmp-strip-host{flex:none;height:60px;min-height:0}
|
|
20965
|
-
.knobs-cmp-timeline-host{flex:none;
|
|
21144
|
+
.knobs-cmp-timeline-host{flex:none;min-height:0}
|
|
20966
21145
|
/* The frame strip: Before over After per column, a difference bar under them, a dot where it peaks. */
|
|
20967
21146
|
.knobs-ui.knobs-cmp-strip{--_ku-cmp-diff:var(--k-compare-diff,var(--_k-ok));position:relative;width:100%;height:100%;min-height:40px;overflow:hidden;cursor:col-resize;touch-action:none;
|
|
20968
21147
|
font:var(--_k-weight) var(--_k-font-size)/1.35 var(--_k-font);color:var(--_k-fg)}
|
|
@@ -21105,7 +21284,7 @@ var init_picker_css = __esm(() => {
|
|
|
21105
21284
|
.knobs-picker-suggested{flex:none;color:var(--_k-fg-3);font-size:var(--_k-text-meta)}
|
|
21106
21285
|
.knobs-picker-check{flex:none;display:flex;width:14px;height:14px;color:var(--_k-accent);opacity:0;scale:.6;filter:blur(2px);
|
|
21107
21286
|
transition:opacity .11s ease-in,scale .11s ease-in,filter .11s ease-in}
|
|
21108
|
-
.knobs-picker-check svg{display:block;width:
|
|
21287
|
+
.knobs-picker-check svg{display:block;width:12px;height:12px}
|
|
21109
21288
|
.knobs-picker-option[data-chosen] .knobs-picker-check{opacity:1;scale:1;filter:none;transition:opacity .15s ease-out,scale var(--kp-snappy-ms) var(--kp-snappy),filter .15s ease-out}
|
|
21110
21289
|
.knobs-picker-body{position:relative;overflow:visible}
|
|
21111
21290
|
.knobs-picker-body[data-moving]{overflow:hidden}
|
|
@@ -21209,6 +21388,15 @@ var readoutCss = `
|
|
|
21209
21388
|
@media(prefers-reduced-motion:reduce){.knobs-rd :where(*){transition:none!important}}
|
|
21210
21389
|
`;
|
|
21211
21390
|
|
|
21391
|
+
// src/ui/selection-pill-css.ts
|
|
21392
|
+
var selectionPillCss = `
|
|
21393
|
+
.knobs-pick-pill,.knobs-pick-copy{position:absolute;left:0;top:0;width:0;height:0;pointer-events:none;transition:opacity .1s linear}
|
|
21394
|
+
.knobs-pick-pill{background:var(--_k-fill-selected);will-change:transform}
|
|
21395
|
+
.knobs-pick-copy{overflow:hidden;will-change:transform}
|
|
21396
|
+
.knobs-pick-copy-rows{position:absolute;left:0;top:0;width:0;height:0}
|
|
21397
|
+
:is(.knobs-pick-pill,.knobs-pick-copy)[data-off]{opacity:0}
|
|
21398
|
+
`;
|
|
21399
|
+
|
|
21212
21400
|
// src/ui/look.ts
|
|
21213
21401
|
function injectUiStyles(doc) {
|
|
21214
21402
|
injectTokens(doc);
|
|
@@ -21295,6 +21483,12 @@ var css3 = `
|
|
|
21295
21483
|
--_ku-pane-bg and --_ku-pane-ring so this reaches them. */
|
|
21296
21484
|
:where(.knobs-surface,.knobs-pane:not([data-nested])>.knobs-pane-clip) .knobs-ui:not(.knobs-surface),.knobs-ui[data-nested]{--_ku-gap:var(--k-ui-gap,0px);--_ku-pane-bg:transparent;--_ku-pane-ring:none;
|
|
21297
21485
|
--_ku-divider:var(--_k-split-gutter);--_kd-bg:transparent}
|
|
21486
|
+
/* What draws its box without those: a picker's card keeps its fill as the highlight but drops its
|
|
21487
|
+
ring; a timeline's track drops its well for a hairline under the lane; an inline panel sheds its
|
|
21488
|
+
card (--k-chrome 0). A full-window step is the one raised exception (it is the surface). */
|
|
21489
|
+
:is(.knobs-surface,.knobs-pane:not([data-nested])>.knobs-pane-clip) .knobs-picker-card,.knobs-ui[data-nested] .knobs-picker-card{box-shadow:none}
|
|
21490
|
+
:is(.knobs-surface,.knobs-pane:not([data-nested])>.knobs-pane-clip) .knobs-tl-track,.knobs-ui[data-nested] .knobs-tl-track{background:transparent;border-radius:0;box-shadow:inset 0 -1px 0 var(--_k-border-subtle)}
|
|
21491
|
+
:where(.knobs-surface,.knobs-pane:not([data-nested])>.knobs-pane-clip) .knobs-panel.knobs-inline:not(.knobs-page){--k-chrome:0}
|
|
21298
21492
|
/* Only the pieces' own elements take their type and resets: what you put in a pane is yours. */
|
|
21299
21493
|
.knobs-ui{box-sizing:border-box}
|
|
21300
21494
|
:where(.knobs-split>*,.knobs-pane-clip,.knobs-pane-inner,.knobs-pane-body,.knobs-pane-head,.knobs-pane-head *,.knobs-pane-rail,.knobs-pane-rail *,.knobs-tree,.knobs-tree *,.knobs-tree-ghost){box-sizing:border-box}
|
|
@@ -21429,11 +21623,9 @@ var css3 = `
|
|
|
21429
21623
|
.knobs-tree:focus .knobs-tree-row[data-active][aria-selected="true"]::before{background:var(--_ku-select-focus)}
|
|
21430
21624
|
.knobs-tree-row[data-drop="into"]::before{opacity:1;background:color-mix(in srgb,var(--_k-accent) 30%,transparent)}
|
|
21431
21625
|
.knobs-tree-row[data-dragged]{opacity:.38}
|
|
21432
|
-
/* glide:
|
|
21433
|
-
.knobs-tree-
|
|
21434
|
-
|
|
21435
|
-
.knobs-tree-cursor[data-on]{opacity:1}
|
|
21436
|
-
.knobs-tree:focus .knobs-tree-cursor{background:var(--_ku-select-focus)}
|
|
21626
|
+
/* glide: the selection pill on the selected row, in the selection's colour (the row's own stays off). */
|
|
21627
|
+
.knobs-tree>.knobs-pick-pill{background:var(--_ku-select)}
|
|
21628
|
+
.knobs-tree:focus>.knobs-pick-pill{background:var(--_ku-select-focus)}
|
|
21437
21629
|
.knobs-tree[data-glide] .knobs-tree-row[aria-selected="true"]::before{opacity:0!important}
|
|
21438
21630
|
.knobs-tree-row>*{position:relative}
|
|
21439
21631
|
.knobs-tree-caret{flex:none;display:flex;align-items:center;justify-content:center;width:16px;height:100%;color:var(--_k-fg-3);transition:transform var(--_ku-ease-ms) var(--_ku-ease)}
|
|
@@ -21465,22 +21657,20 @@ var css3 = `
|
|
|
21465
21657
|
box-shadow:0 0 0 1px var(--_k-border-strong),0 6px 18px rgba(0,0,0,calc(.35 * var(--_k-shadow-k,1)));pointer-events:none;white-space:nowrap;font:var(--_k-weight) var(--_k-font-size)/1.6 var(--_k-font)}
|
|
21466
21658
|
.knobs-tree-empty{padding:10px var(--_k-inset);color:var(--_k-fg-3)}
|
|
21467
21659
|
|
|
21468
|
-
/* Timeline:
|
|
21469
|
-
|
|
21660
|
+
/* Timeline: play beside a track: the ruler's canvas over a lane of markers, ranges as soft bands,
|
|
21661
|
+
and the playhead, a hairline in the accent with a cap. No clock: the time shows under the
|
|
21662
|
+
pointer on the track (the tag), in seconds, while hovering or scrubbing. */
|
|
21470
21663
|
:where(.knobs-timeline,.knobs-timeline *){box-sizing:border-box}
|
|
21471
21664
|
.knobs-ui.knobs-timeline{display:flex;align-items:stretch;gap:10px;width:100%;height:100%;min-height:52px;padding:6px var(--_k-inset) 8px 8px;outline:none;user-select:none;-webkit-user-select:none;
|
|
21472
21665
|
font:var(--_k-weight) var(--_k-font-size)/1.35 var(--_k-font);color:var(--_k-fg);letter-spacing:normal;text-align:left}
|
|
21473
21666
|
:where(.knobs-ui) :is(.knobs-tl-play,.knobs-tl-edit){all:revert;box-sizing:border-box;font:inherit;color:inherit;letter-spacing:inherit;background:transparent;border:0;margin:0;padding:0;outline:none;box-shadow:none}
|
|
21474
|
-
.knobs-tl-transport{flex:none;display:flex;align-items:center
|
|
21667
|
+
.knobs-tl-transport{flex:none;display:flex;align-items:center}
|
|
21475
21668
|
.knobs-ui .knobs-tl-play{flex:none;display:inline-flex;align-items:center;justify-content:center;width:var(--_k-control-h);height:var(--_k-control-h);min-width:22px;min-height:22px;border-radius:calc(var(--_k-radius) * 999);
|
|
21476
21669
|
background:var(--_k-fill-selected);color:var(--_k-fg);cursor:pointer;transition:background .15s,transform .15s var(--_ku-ease)}
|
|
21477
21670
|
.knobs-ui .knobs-tl-play:hover{background:color-mix(in srgb,var(--_k-fg) 16%,transparent)}
|
|
21478
21671
|
.knobs-ui .knobs-tl-play:active{transform:scale(.94)}
|
|
21479
21672
|
.knobs-tl-play svg{width:12px;height:12px}
|
|
21480
21673
|
.knobs-timeline[data-playing] .knobs-tl-play{background:var(--_k-accent);color:var(--_k-bg)}
|
|
21481
|
-
.knobs-tl-time{display:flex;flex-direction:column;line-height:1.2;font-variant-numeric:tabular-nums;font-feature-settings:"tnum"}
|
|
21482
|
-
.knobs-tl-now{font:var(--_k-weight) var(--_k-value-size)/1.2 var(--_k-value-font);font-variant-numeric:tabular-nums;font-feature-settings:"tnum";color:var(--_k-fg);white-space:nowrap}
|
|
21483
|
-
.knobs-tl-sub{font-size:var(--_k-text-meta);color:var(--_k-fg-3);white-space:nowrap}
|
|
21484
21674
|
.knobs-tl-track{position:relative;flex:1;min-width:0;overflow:hidden;border-radius:var(--_k-radius);background:var(--_k-fill);cursor:col-resize;touch-action:none;
|
|
21485
21675
|
transition:background calc(var(--_k-hover-out) * 1ms)}
|
|
21486
21676
|
.knobs-timeline:focus-visible .knobs-tl-track,.knobs-timeline[data-keyboard]:focus .knobs-tl-track{background:color-mix(in srgb,var(--_k-fill-selected) 80%,transparent)}
|
|
@@ -21504,7 +21694,8 @@ var css3 = `
|
|
|
21504
21694
|
.knobs-tl-pin{position:absolute;top:13px;left:-5px;width:10px;height:10px;pointer-events:auto;cursor:grab}
|
|
21505
21695
|
.knobs-tl-pin::after{content:"";position:absolute;inset:1.5px;border-radius:min(2px,var(--_k-radius));background:var(--knobs-tl-c);rotate:45deg;transition:background .15s,scale .2s var(--_ku-ease)}
|
|
21506
21696
|
.knobs-tl-mlabel{position:absolute;top:26px;left:3px;max-width:140px;padding:0 6px;border-radius:max(0px,calc(var(--_k-radius) - 3px));background:var(--_k-fill-selected);color:var(--_k-fg);
|
|
21507
|
-
font-size:var(--_k-text-meta);line-height:17px;white-space:nowrap;
|
|
21697
|
+
font-size:var(--_k-text-meta);line-height:17px;white-space:nowrap;pointer-events:auto;cursor:grab;transition:background .15s,color .15s}
|
|
21698
|
+
.knobs-tl-mtext{display:block;overflow:hidden;white-space:nowrap}
|
|
21508
21699
|
.knobs-tl-marker[data-selected]{--knobs-tl-c:var(--_k-accent)}
|
|
21509
21700
|
.knobs-tl-marker[data-selected] .knobs-tl-mlabel{background:color-mix(in srgb,var(--_k-accent) 24%,var(--_k-fill-selected))}
|
|
21510
21701
|
.knobs-tl-marker[data-selected] .knobs-tl-pin::after{scale:1.2}
|
|
@@ -21525,7 +21716,22 @@ var css3 = `
|
|
|
21525
21716
|
.knobs-timeline[data-scrubbing] .knobs-tl-hover{opacity:0}
|
|
21526
21717
|
@media(prefers-reduced-motion:reduce){.knobs-timeline :where(*,::before,::after){transition:none!important}}
|
|
21527
21718
|
@media(prefers-reduced-motion:reduce){:is(.knobs-tree,.knobs-split>.knobs-divider,.knobs-pane-head,.knobs-pane-rail) :where(*,::before,::after){transition:none!important}}
|
|
21528
|
-
|
|
21719
|
+
.knobs-tl-tag{position:absolute;left:0;bottom:2px;font-size:var(--_k-text-meta);line-height:16px;color:var(--_k-fg);font-variant-numeric:tabular-nums;font-feature-settings:"tnum";white-space:nowrap;pointer-events:none;opacity:0}
|
|
21720
|
+
.knobs-tl-tag[data-on]{opacity:1}
|
|
21721
|
+
/* The lane (variant: "lane"): one slim track of ticks under a compare or a video; markers are
|
|
21722
|
+
faint chapter ticks, the current one in text colour; nothing to edit. */
|
|
21723
|
+
.knobs-ui.knobs-timeline[data-variant="lane"]{height:auto;min-height:0;padding:0;gap:var(--_k-gap)}
|
|
21724
|
+
.knobs-timeline[data-variant="lane"] .knobs-tl-track{height:var(--_k-control-h)}
|
|
21725
|
+
.knobs-timeline[data-variant="lane"] .knobs-tl-ruler{height:100%}
|
|
21726
|
+
.knobs-timeline[data-variant="lane"] .knobs-tl-lane{top:0}
|
|
21727
|
+
.knobs-timeline[data-variant="lane"] .knobs-tl-marker{top:0}
|
|
21728
|
+
.knobs-timeline[data-variant="lane"] .knobs-tl-marker::before{top:0;bottom:50%;left:-.75px;width:1.5px;background:var(--_k-fg-3)}
|
|
21729
|
+
.knobs-timeline[data-variant="lane"] .knobs-tl-marker[data-current]::before{background:var(--_k-fg)}
|
|
21730
|
+
.knobs-timeline[data-variant="lane"] :is(.knobs-tl-pin,.knobs-tl-mlabel,.knobs-tl-rlabel){display:none}
|
|
21731
|
+
.knobs-timeline[data-variant="lane"] .knobs-tl-head::before{top:0}
|
|
21732
|
+
.knobs-timeline[data-variant="lane"] .knobs-tl-head::after{content:none}
|
|
21733
|
+
.knobs-timeline[data-variant="lane"] .knobs-tl-tag{top:2px;bottom:auto}
|
|
21734
|
+
`, uiCss = () => aliased(css3 + readoutCss + overlayCss + bentoCss + activityCss + pickerCss + compareCss + selectionPillCss) + rolling_css_default, lookDefaults, svg = (body, box = 16) => `<svg viewBox="0 0 ${box} ${box}" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">${body}</svg>`, ICONS2;
|
|
21529
21735
|
var init_look = __esm(() => {
|
|
21530
21736
|
init_appearance();
|
|
21531
21737
|
init_activity_css();
|
package/dist/themes.js
CHANGED
|
@@ -447,6 +447,22 @@ var TOKENS = [
|
|
|
447
447
|
source: css("var(--k-warn)"),
|
|
448
448
|
doc: "Modified lines."
|
|
449
449
|
},
|
|
450
|
+
{
|
|
451
|
+
name: "before",
|
|
452
|
+
tier: "semantic",
|
|
453
|
+
type: "color",
|
|
454
|
+
group: "Data",
|
|
455
|
+
source: css("var(--k-fg-3)"),
|
|
456
|
+
doc: "Before in a comparison, and only Before: its label and side of the seam. Neutral unless a theme gives it a colour."
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
name: "after",
|
|
460
|
+
tier: "semantic",
|
|
461
|
+
type: "color",
|
|
462
|
+
group: "Data",
|
|
463
|
+
source: css("var(--k-fg)"),
|
|
464
|
+
doc: "After in a comparison, and only After."
|
|
465
|
+
},
|
|
450
466
|
{
|
|
451
467
|
name: "series-1",
|
|
452
468
|
tier: "semantic",
|
|
@@ -537,6 +553,150 @@ var TOKENS = [
|
|
|
537
553
|
source: value("288px"),
|
|
538
554
|
doc: "Panel width."
|
|
539
555
|
},
|
|
556
|
+
{
|
|
557
|
+
name: "space-inside",
|
|
558
|
+
tier: "semantic",
|
|
559
|
+
type: "length",
|
|
560
|
+
group: "Space",
|
|
561
|
+
source: css("var(--k-unit)"),
|
|
562
|
+
doc: "Parts of one thing: an icon and its label, a meta line and its title."
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
name: "space-sibling",
|
|
566
|
+
tier: "semantic",
|
|
567
|
+
type: "length",
|
|
568
|
+
group: "Space",
|
|
569
|
+
source: css("calc(var(--k-unit) * 2)"),
|
|
570
|
+
doc: "Siblings in a group: buttons in a row, a list item's lines."
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
name: "space-title",
|
|
574
|
+
tier: "semantic",
|
|
575
|
+
type: "length",
|
|
576
|
+
group: "Space",
|
|
577
|
+
source: css("calc(var(--k-unit) * 3)"),
|
|
578
|
+
doc: "A heading and what it heads."
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
name: "space-group",
|
|
582
|
+
tier: "semantic",
|
|
583
|
+
type: "length",
|
|
584
|
+
group: "Space",
|
|
585
|
+
source: css("calc(var(--k-unit) * 12)"),
|
|
586
|
+
doc: "Groups inside a section (prose, video, diff), stacked media, feed items (a hairline in the middle)."
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
name: "space-section",
|
|
590
|
+
tier: "semantic",
|
|
591
|
+
type: "length",
|
|
592
|
+
group: "Space",
|
|
593
|
+
source: css("calc(var(--k-unit) * 24)"),
|
|
594
|
+
doc: "Sections of a page (the intro, the updates, each PR), a hairline in the middle."
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
name: "space-column",
|
|
598
|
+
tier: "semantic",
|
|
599
|
+
type: "length",
|
|
600
|
+
group: "Space",
|
|
601
|
+
source: css("calc(var(--k-unit) * 6)"),
|
|
602
|
+
doc: "Columns: a contents rail and the page, media side by side."
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
name: "pad-page",
|
|
606
|
+
tier: "semantic",
|
|
607
|
+
type: "length",
|
|
608
|
+
group: "Space",
|
|
609
|
+
source: css("calc(var(--k-unit) * 6)"),
|
|
610
|
+
doc: "A page's edge; 16px under 640px wide."
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
name: "pad-card",
|
|
614
|
+
tier: "semantic",
|
|
615
|
+
type: "length",
|
|
616
|
+
group: "Space",
|
|
617
|
+
source: css("calc(var(--k-unit) * 3)"),
|
|
618
|
+
doc: "Inside a card or popover."
|
|
619
|
+
},
|
|
620
|
+
{
|
|
621
|
+
name: "type-heading",
|
|
622
|
+
tier: "semantic",
|
|
623
|
+
type: "length",
|
|
624
|
+
group: "Type",
|
|
625
|
+
source: value("20px"),
|
|
626
|
+
doc: "Section headings (a PR's title, under its kicker), weight 500."
|
|
627
|
+
},
|
|
628
|
+
{
|
|
629
|
+
name: "leading-heading",
|
|
630
|
+
tier: "semantic",
|
|
631
|
+
type: "length",
|
|
632
|
+
group: "Type",
|
|
633
|
+
source: value("28px"),
|
|
634
|
+
doc: "Line height for type-heading."
|
|
635
|
+
},
|
|
636
|
+
{
|
|
637
|
+
name: "type-title",
|
|
638
|
+
tier: "semantic",
|
|
639
|
+
type: "length",
|
|
640
|
+
group: "Type",
|
|
641
|
+
source: value("16px"),
|
|
642
|
+
doc: "A page's title, weight 500."
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
name: "leading-title",
|
|
646
|
+
tier: "semantic",
|
|
647
|
+
type: "length",
|
|
648
|
+
group: "Type",
|
|
649
|
+
source: value("24px"),
|
|
650
|
+
doc: "Line height for type-title."
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
name: "type-body",
|
|
654
|
+
tier: "semantic",
|
|
655
|
+
type: "length",
|
|
656
|
+
group: "Type",
|
|
657
|
+
source: value("13px"),
|
|
658
|
+
doc: "Prose, questions, list rows, step titles; 400, or 500 for emphasis."
|
|
659
|
+
},
|
|
660
|
+
{
|
|
661
|
+
name: "leading-body",
|
|
662
|
+
tier: "semantic",
|
|
663
|
+
type: "length",
|
|
664
|
+
group: "Type",
|
|
665
|
+
source: value("20px"),
|
|
666
|
+
doc: "Line height for type-body."
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
name: "type-label",
|
|
670
|
+
tier: "semantic",
|
|
671
|
+
type: "length",
|
|
672
|
+
group: "Type",
|
|
673
|
+
source: value("12px"),
|
|
674
|
+
doc: "Labels over media, weight 500; mono inside body text."
|
|
675
|
+
},
|
|
676
|
+
{
|
|
677
|
+
name: "leading-label",
|
|
678
|
+
tier: "semantic",
|
|
679
|
+
type: "length",
|
|
680
|
+
group: "Type",
|
|
681
|
+
source: value("16px"),
|
|
682
|
+
doc: "Line height for type-label."
|
|
683
|
+
},
|
|
684
|
+
{
|
|
685
|
+
name: "type-small",
|
|
686
|
+
tier: "semantic",
|
|
687
|
+
type: "length",
|
|
688
|
+
group: "Type",
|
|
689
|
+
source: value("11px"),
|
|
690
|
+
doc: "Meta, controls, keys, timestamps; mono inside labels."
|
|
691
|
+
},
|
|
692
|
+
{
|
|
693
|
+
name: "leading-small",
|
|
694
|
+
tier: "semantic",
|
|
695
|
+
type: "length",
|
|
696
|
+
group: "Type",
|
|
697
|
+
source: value("16px"),
|
|
698
|
+
doc: "Line height for type-small."
|
|
699
|
+
},
|
|
540
700
|
{
|
|
541
701
|
name: "font-size",
|
|
542
702
|
tier: "semantic",
|