twiddle-panel 0.6.1 → 0.7.1

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 CHANGED
@@ -35,13 +35,17 @@ if (import.meta.env.DEV) import('twiddle-panel');
35
35
  **Plain HTML prototypes** (no install needed)
36
36
 
37
37
  ```html
38
- <script src="https://cdn.jsdelivr.net/npm/twiddle-panel@0.6.1/dist/twiddle.js" defer></script>
38
+ <script src="https://cdn.jsdelivr.net/npm/twiddle-panel@0.7.1/dist/twiddle.js" defer></script>
39
39
  ```
40
40
 
41
41
  The prototype's CSS must use the `--twd-*` token variables
42
42
  (for example `border-radius: var(--twd-radius-control)`). Hard-coded values
43
43
  won't respond to the panel.
44
44
 
45
+ Optional weight tokens (contract v0.3), `--twd-weight-heading` and `--twd-weight-strong`, let headings and labels follow the Character pad's Subtle ↔ Bold.
46
+
47
+ Optional component tokens (contract v0.4) let the Shape tab restyle the main button (`--twd-button-bg`, `-fg`, `-border`, `-hover`: Solid, Soft, Outline, Ghost) and the default card (`--twd-card-bg`, `-border`, `-shadow`: Filled, Outlined, Elevated, Tinted). They default to today's look and point at the colour and shadow tokens, so they still follow Colour and the Character pad.
48
+
45
49
  Optional layout roles (token contract v0.2) name what a space is for:
46
50
  `--twd-page-pad`, `--twd-section-gap`, `--twd-card-pad`, `--twd-card-gap` and
47
51
  `--twd-control-gap`. Each points at a spacing step by default, so prototypes
@@ -49,7 +53,7 @@ that use them can be re-pointed in **Edit every token › Spacing › Roles**.
49
53
 
50
54
  ## Using the panel
51
55
 
52
- - The **Simple** page tweaks the whole page with broad knobs: the **Character** pad (drag up/down for spacing, left/right for shadow strength), then Fonts, Brand, Neutral, Mode and Corners (buttons and cards together). **Edit every token** opens a page per area (Fonts, Type scale, Colours, Spacing, Corners, Borders, Shadows): the area's knobs, then each of its tokens as a row you can set to a fixed value. An edited token shows **Custom** and its own reset, and stays put when you change the broad knobs. **Spacing › Roles** points each layout role (page padding, section gap, card padding, card gap, control gap, control padding) at another spacing step or a fixed value. **Copy link** shares the exact version (`?twd=…`).
56
+ - **Tabs** along the bottom: **Overview** (the **Character** pad: up/down for spacing, Subtle ↔ Bold for weights, borders, corners and shadows; plus a summary of the current look), **Colour** (four themes, then fine-tune with the Tailwind palette: a colour family and shade for the primary, a grey family for the neutrals, or any custom hex; Light/Dark), **Type** (font pairings as tiles, base size, scale), **Spacing** (density, layout roles), **Shape** (button style, corners and size; card style, corners and borders) and **Shadows**. Each tab ends with its tokens as rows you can set to a fixed value; an edited token shows **Custom** and its own reset. The header holds the global actions; **Copy link** shares the exact version (`?twd=…`).
53
57
  - **Pick** (crosshair) selects one element. The panel then shows only the sections that element uses. Choose **This element** or **All `.class` (n)** to set where the tweaks go. Add `data-twd="name"` to an element to control what counts as "all like this".
54
58
  - **Compare** (half circle): hold it, or press Alt+C, to see the original page.
55
59
  - **Undo / Redo** in the footer, or ⌘Z / ⇧⌘Z while the panel has focus. Reset can be undone too.
@@ -1,5 +1,5 @@
1
1
  /* ==========================================================
2
- Panel token contract — v0.2
2
+ Panel token contract — v0.4
3
3
  Default values for every role token. Prototypes use ONLY
4
4
  these variables; the panel overrides them live.
5
5
  ========================================================== */
@@ -21,6 +21,11 @@
21
21
  --twd-leading-tight: 1.2;
22
22
  --twd-leading-normal: 1.5;
23
23
 
24
+ /* Weights (v0.3). The Character pad's Subtle ↔ Bold moves them
25
+ (heading 400…800, strong 500…700); body text stays as it is. */
26
+ --twd-weight-heading: 600; /* headings, big numbers */
27
+ --twd-weight-strong: 600; /* buttons, labels, emphasis */
28
+
24
29
  /* ---------- Colour (roles) ---------- */
25
30
  --twd-bg: #fafafa;
26
31
  --twd-surface: #ffffff;
@@ -68,4 +73,16 @@
68
73
  --twd-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.06);
69
74
  --twd-shadow-md: 0 4px 12px rgb(0 0 0 / 0.08);
70
75
  --twd-shadow-lg: 0 12px 32px rgb(0 0 0 / 0.12);
76
+
77
+ /* ---------- Component styles (v0.4) ----------
78
+ Optional. The main button and the default card. Each points at
79
+ the tokens above, so Colour, Depth and the Character pad still
80
+ reach them; the panel's Shape › Style swaps the recipe. */
81
+ --twd-button-bg: var(--twd-primary);
82
+ --twd-button-fg: var(--twd-on-primary);
83
+ --twd-button-border: transparent;
84
+ --twd-button-hover: var(--twd-primary-hover); /* background on hover */
85
+ --twd-card-bg: var(--twd-surface);
86
+ --twd-card-border: var(--twd-border);
87
+ --twd-card-shadow: var(--twd-shadow-sm);
71
88
  }