@kitlangton/knobs 0.4.0-next.0 → 0.4.0-next.10

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 (74) hide show
  1. package/README.md +451 -54
  2. package/dist/dev/{chunk-7xgkerd2.js → chunk-3ygqgy1x.js} +23 -1
  3. package/dist/dev/{chunk-stbcgz1y.js → chunk-5pb7ymrd.js} +567 -471
  4. package/dist/dev/{chunk-t68smqkc.js → chunk-a7cjgy8x.js} +13 -11
  5. package/dist/dev/{chunk-pmkvb9ep.js → chunk-dyq4m24m.js} +2081 -507
  6. package/dist/dev/index.js +10 -5
  7. package/dist/index.js +25 -1
  8. package/dist/panel.js +3187 -1341
  9. package/dist/react.js +294 -6
  10. package/dist/review-react.js +18580 -0
  11. package/dist/review-solid.js +18482 -0
  12. package/dist/review.js +18488 -0
  13. package/dist/solid.js +292 -4
  14. package/dist/themes.js +1767 -7
  15. package/dist/types/core/adapter.d.ts +6 -2
  16. package/dist/types/core/appearance.d.ts +44 -0
  17. package/dist/types/core/glide.d.ts +7 -0
  18. package/dist/types/core/motion.d.ts +66 -0
  19. package/dist/types/core/root.d.ts +13 -0
  20. package/dist/types/core/store.d.ts +18 -5
  21. package/dist/types/core/theme.d.ts +10 -3
  22. package/dist/types/index.d.ts +2 -1
  23. package/dist/types/panel/gpu/color.d.ts +6 -0
  24. package/dist/types/panel/motion.d.ts +1 -1
  25. package/dist/types/panel/styles.d.ts +2 -3
  26. package/dist/types/review/font.d.ts +13 -0
  27. package/dist/types/review/foundations.d.ts +175 -0
  28. package/dist/types/review/index.d.ts +13 -0
  29. package/dist/types/review/react.d.ts +1 -0
  30. package/dist/types/review/solid.d.ts +1 -0
  31. package/dist/types/themes/define.d.ts +104 -0
  32. package/dist/types/themes/index.d.ts +16 -0
  33. package/dist/types/themes/knobs.d.ts +5 -0
  34. package/dist/types/themes/review.d.ts +8 -0
  35. package/dist/types/themes/void.d.ts +8 -0
  36. package/dist/types/tokens/color.d.ts +42 -0
  37. package/dist/types/tokens/css.d.ts +13 -0
  38. package/dist/types/tokens/evaluate.d.ts +8 -0
  39. package/dist/types/tokens/index.d.ts +4 -0
  40. package/dist/types/tokens/schema.d.ts +1280 -0
  41. package/dist/types/ui/bento-css.d.ts +1 -1
  42. package/dist/types/ui/compare-css.d.ts +1 -1
  43. package/dist/types/ui/compare-gpu.d.ts +6 -6
  44. package/dist/types/ui/compare-model.d.ts +85 -2
  45. package/dist/types/ui/compare.d.ts +18 -4
  46. package/dist/types/ui/diff.d.ts +4 -5
  47. package/dist/types/ui/history-css.d.ts +1 -0
  48. package/dist/types/ui/history-model.d.ts +249 -0
  49. package/dist/types/ui/history.d.ts +38 -0
  50. package/dist/types/ui/icons.d.ts +40 -0
  51. package/dist/types/ui/index.d.ts +9 -5
  52. package/dist/types/ui/look.d.ts +18 -13
  53. package/dist/types/ui/overlay-css.d.ts +1 -1
  54. package/dist/types/ui/player-css.d.ts +1 -0
  55. package/dist/types/ui/player.d.ts +51 -0
  56. package/dist/types/ui/readout-css.d.ts +1 -1
  57. package/dist/types/ui/readout-model.d.ts +5 -1
  58. package/dist/types/ui/review-look.d.ts +6 -0
  59. package/dist/types/ui/review-options.d.ts +28 -0
  60. package/dist/types/ui/rgba.d.ts +11 -0
  61. package/dist/types/ui/selection-pill-css.d.ts +1 -0
  62. package/dist/types/ui/selection-pill.d.ts +106 -0
  63. package/dist/types/ui/timeline-model.d.ts +27 -0
  64. package/dist/types/ui/timeline.d.ts +16 -1
  65. package/dist/types/ui/tree.d.ts +3 -2
  66. package/dist/types/ui/walkthrough-annotations.d.ts +42 -0
  67. package/dist/types/ui/walkthrough-blocks.d.ts +87 -0
  68. package/dist/types/ui/walkthrough-media.d.ts +30 -1
  69. package/dist/types/ui/walkthrough-model.d.ts +469 -5
  70. package/dist/types/ui/walkthrough.d.ts +27 -5
  71. package/dist/ui-react.js +8087 -2350
  72. package/dist/ui-solid.js +8100 -2363
  73. package/dist/ui.js +9751 -3963
  74. package/package.json +13 -1
@@ -0,0 +1,8 @@
1
+ /**
2
+ * For OLED and video review: true black page and panel with Apple's `#1c1c1e` / `#2c2c2e` raised
3
+ * surfaces, text capped at `#ededed` to limit halation, a white accent, flat with solid
4
+ * hairlines, and a black stage behind compared media. Neutral (no tint) so the chrome doesn't
5
+ * bias colour judgement. The light pair is generated from the same dials, with a neutral
6
+ * near-black accent.
7
+ */
8
+ export declare const voidTheme: import("./define.js").Theme;
@@ -0,0 +1,42 @@
1
+ /**
2
+ * The colour maths the theme generator needs and nothing more: OKLCH ↔ sRGB (Björn Ottosson's
3
+ * OKLab matrices), hex parsing and formatting with alpha, and APCA 0.0.98G contrast.
4
+ */
5
+ /** Linear-light sRGB, each channel 0–1, plus straight (not premultiplied) alpha. */
6
+ export type Rgba = readonly [r: number, g: number, b: number, a: number];
7
+ export interface Oklch {
8
+ /** Perceived lightness, 0–1. */
9
+ readonly l: number;
10
+ readonly c: number;
11
+ /** Hue in degrees. */
12
+ readonly h: number;
13
+ readonly alpha?: number;
14
+ }
15
+ export declare const toLinear: (c: number) => number;
16
+ export declare const toGamma: (c: number) => number;
17
+ /** Linear sRGB → OKLCH. */
18
+ export declare function linearToOklch([r, g, b, a]: Rgba): Oklch;
19
+ /** OKLCH → linear sRGB, unclamped (may fall outside the gamut). */
20
+ export declare function oklchToLinear({ l: L, c, h, alpha }: Oklch): Rgba;
21
+ /** OKLCH → linear sRGB inside the gamut, reducing chroma (keeping L and h) when it doesn't fit. */
22
+ export declare function oklchToLinearInGamut(color: Oklch): Rgba;
23
+ /** Parses `#rgb`, `#rgba`, `#rrggbb`, `#rrggbbaa`, `oklch(L% C H / A)` and `rgb()/rgba()`. */
24
+ export declare function parseColor(input: string): Rgba;
25
+ export declare const toOklch: (input: string) => Oklch;
26
+ /** Linear sRGB → `#rrggbb`, or `#rrggbbaa` when not opaque. */
27
+ export declare function formatHex([r, g, b, a]: Rgba): string;
28
+ export declare const oklchToHex: (color: Oklch) => string;
29
+ /** Rounds to the 8-bit hex grid, so values compare and serialise the same everywhere. */
30
+ export declare const normalize: (input: string) => string;
31
+ /** `color` at `alpha` (multiplying any alpha it already has). */
32
+ export declare function withAlpha(input: string, alpha: number): string;
33
+ /** `top` composited over an opaque `bottom` in gamma-encoded sRGB (what browsers paint). */
34
+ export declare function over(top: string, bottom: string): string;
35
+ /** `a` mixed toward `b` by `t` (0–1) in OKLCH, the hue taking the shorter arc. */
36
+ export declare function mixOklch(a: string, b: string, t: number): string;
37
+ /**
38
+ * APCA 0.0.98G lightness contrast of `text` on `background`, as an absolute Lc (light text on
39
+ * dark is negative in APCA; this returns its magnitude). A translucent text colour is composited
40
+ * over the background first.
41
+ */
42
+ export declare function apca(text: string, background: string): number;
@@ -0,0 +1,13 @@
1
+ import type { Theme } from "../themes/define.js";
2
+ export declare const APPEARANCE_CSS: string;
3
+ /**
4
+ * The default token sheet for `theme`, in `@layer knobs.tokens` so any host assignment wins: the
5
+ * theme's values (inputs, generated colours as `light-dark()` pairs, literals) as public tokens on
6
+ * `:where(:root,:host)`, every token resolved privately (`--_k-*`) on `:where(.knobs-root)`, and
7
+ * the appearance rules. Component styles read only the private names.
8
+ */
9
+ export declare function tokensCss(theme: Theme): string;
10
+ /** One block of everything `theme` declares, under `selector`, to theme part of a page. */
11
+ export declare function themeCss(theme: Theme, selector: string): string;
12
+ /** The README token reference: every public token with its values in `theme`, then the renames. */
13
+ export declare function tokensTable(theme: Theme): string;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Evaluates the small CSS colour language the token derivations are written in: `var(--k-…)`
3
+ * (with fallbacks), `color-mix(in oklch, A p, B q)` (premultiplied, shorter hue, as browsers do),
4
+ * `calc(N% * var(--k-contrast))` percentages, and plain colours. The same strings are emitted as
5
+ * CSS, so the TypeScript-resolved maps and the browser agree by construction.
6
+ */
7
+ export type Lookup = (cssName: string) => string | undefined;
8
+ export declare function evaluate(input: string, lookup: Lookup): string;
@@ -0,0 +1,4 @@
1
+ export { apca, formatHex, mixOklch, normalize, type Oklch, oklchToHex, over, parseColor, type Rgba, toOklch, withAlpha, } from "./color.js";
2
+ export { APPEARANCE_CSS, themeCss, tokensCss, tokensTable } from "./css.js";
3
+ export { evaluate } from "./evaluate.js";
4
+ export { type ColorTokenName, cssName, DEPRECATED, type HookName, type PublicTokenName, RETIRED_INTERNAL, type SemanticTokenName, THEME_DIALS, type ThemeTokenName, type Tier, TOKEN_BY_NAME, TOKENS, type TokenDef, type TokenName, type TokenProperty, type TokenSource, type TokenType, tokenForProperty, } from "./schema.js";