@putdotio/design 2.0.2 → 3.0.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.
package/system/README.md CHANGED
@@ -6,16 +6,25 @@ This folder holds the generated site tokens, preview cards, and design-system in
6
6
 
7
7
  ```
8
8
  project root/
9
+ ├── platforms/ ← per-platform binding contracts (DESIGN.md each)
9
10
  └── system/
10
11
  ├── index.html ← redirects to the design-system guide
11
12
  ├── design-system.html ← guide and preview-card index
12
13
  ├── design-system-light.html ← legacy redirect to design-system.html?theme=light
13
14
  ├── tokens.css ← generated from ../tokens/**/*.tokens.json
15
+ ├── components.css ← the tier-1 component layer (the web contract)
16
+ ├── tv.css ← TV / 10ft component CSS, scoped to .tv artboards
14
17
  ├── assets/ ← logos, favicons, retro marks, app icons
15
- └── preview/ ← atomic review cards for foundations + components + brand + platforms
16
- └── tv-shell.css ← TV / 10ft component CSS, scoped to .tv artboards (preview-only)
18
+ └── preview/ ← specimen cards for foundations + every platform tier
19
+ └── _*.css, _resize.js ← card chrome only (frame, tier strip, HIG/M3/Roku shells)
17
20
  ```
18
21
 
22
+ Cards are named `<platform>-<section><n>-<subject>.html` — section letter `f`
23
+ foundations, `c` components, `e` elements, `p` patterns, `s` screens
24
+ (`ios-e01-toggle.html`); the numbered `00-…13-…` files are the tier-0
25
+ foundations. Element cards are a fixed 1120×580 viewport: one control, its
26
+ states, a spec strip, a don't block.
27
+
19
28
  ## Fonts
20
29
 
21
30
  Preview pages load the public put.io font CSS from `static.put.io` (the same
@@ -65,15 +74,16 @@ Web package consumers import the package CSS export:
65
74
  @import "@putdotio/design/css";
66
75
  ```
67
76
 
68
- For **TV preview cards**, also load `preview/tv-shell.css` — it adds the `.tv`,
69
- `.scr`, `.row`, solid surface tiers, and player chrome on top of the tokens.
70
- Every component selector is scoped under `.tv`, so the file is safe to bundle
71
- globally without bleeding into web components. This is preview-only support CSS;
72
- platform repos implement TV components in their native UI stacks:
77
+ For **TV preview cards**, also load `tv.css` — it adds the `.tv`, `.scr`,
78
+ `.row`, solid surface tiers, and player chrome on top of the tokens, authored
79
+ 1:1 at 1920×1080 (a px in the file is a px on the TV). Every component selector
80
+ is scoped under `.tv`, so the file is safe to bundle globally without bleeding
81
+ into web components. Platform repos still implement TV components in their
82
+ native UI stacks:
73
83
 
74
84
  ```html
75
85
  <link rel="stylesheet" href="./tokens.css">
76
- <link rel="stylesheet" href="./preview/tv-shell.css">
86
+ <link rel="stylesheet" href="./tv.css">
77
87
  ```
78
88
 
79
89
  TV surfaces are **solid token colors** — no `backdrop-filter`, no translucent
@@ -98,8 +108,35 @@ into the web scales: TV has no mono face, and TV orders `--tv-z-overlay` (300)
98
108
  - **Icons: Phosphor-style inline SVG.** No emoji, ever.
99
109
  - **One design, two modes.** Light and dark are the same markup and components with different token values. Toggle `.dark` on `<html>`; do not fork the page or rebuild a light-specific copy. Components must consume semantic tokens (`--bg`, `--text`, `--border`, `--accent`, …), not raw `#hex` or `hsl()`.
100
110
  - **Fields and panels use the shared aliases** (`--field-*`, `--panel-*`) — full rules, including the `aria-invalid` red-border-only requirement, in [`../DESIGN.md`](../DESIGN.md) (Components).
111
+ - **Wordmarks are optically pre-centred.** All three logo SVGs carry built-in top padding in the viewBox (retro pair `0 -16 376 112`, `logo.svg` `0 -24.44 621.79 176.055`). Flex-centre as-is; never add a `translateY` nudge. Height-set placements size boxes at 7/6 of the ink height.
101
112
  - **Content-agnostic.** put.io doesn't know what the user's files are. Never parse `The.Wire.S03E04.1080p.mkv` into `The Wire`. Raw filenames only. See the root [`DESIGN.md`](../DESIGN.md) for the full principle.
102
113
 
114
+ ## Binding tiers
115
+
116
+ ADR 0009 (putio-frontend `docs/decisions/0009-design-binding-tiers.md`): **a
117
+ web-rendered mock is never a native spec**. Every specimen card declares its
118
+ tier in a strip above the artboard (`preview/_tier.css` — the only place the
119
+ tier text lives besides `../DESIGN.md`; change both in the same PR).
120
+
121
+ | Tier | Surfaces | What binds |
122
+ | --- | --- | --- |
123
+ | 0 | Foundations | The token graph. Binds all tiers, values only |
124
+ | 1 | www · app · auth | The full system — `components.css` recipes are the contract, here and only here |
125
+ | 2 | iOS · iPadOS · tvOS · watchOS · Android · Android TV | Tokens only; every control from the platform HIG / Material 3 |
126
+ | 3 | Roku | Tier-2 token inheritance + put.io conventions in custom SceneGraph components |
127
+ | 4 | tv.put.io · Tizen · webOS | The web system, restrained to a list-first 10-foot interface |
128
+
129
+ A tier-1/3/4 card is a **Component** (put.io owns the recipe); a tier-2 card is
130
+ an **Element** (the platform owns the control; the card documents how it is
131
+ tokenized). Never read an Element card as a build-a-custom-control instruction.
132
+
133
+ Native cards are drawn 1:1 in their own unit — iPhone 393×852pt, iPad
134
+ 1024×768pt, Apple Watch 176×215pt, Android 412×915dp, TV 1920×1080px — so a
135
+ number written on a card is the number in the HIG or the Material spec. Those
136
+ metrics are Apple's and Google's; they are **not** put.io spacing tokens and
137
+ must never be promoted into the graph. Device bezels and on-video chrome stay
138
+ deliberately un-tokenised.
139
+
103
140
  ## Theme System
104
141
 
105
142
  The guide (`design-system.html`) owns the theme toggle. It writes
@@ -112,8 +149,10 @@ the parent broadcast when embedded. A URL query (`?theme=light` or
112
149
 
113
150
  Fixed-mode previews opt out with `<html data-theme-lock="dark">`. This is only
114
151
  for product mockups whose visual language is intrinsically one mode — a 10-foot
115
- screen and on-video player chrome are dark-only surfaces, so `tv-*.html`,
116
- `mobile-shell.html`, and `components-player-web.html` are locked. Locked previews ignore both `localStorage` and parent broadcasts.
152
+ screen, a native app mockup, and on-video player chrome are fixed-mode
153
+ surfaces, so the `ios-*`, `android-*`, `androidtv-*`, `tvos-*`, `watchos-*`,
154
+ `roku-*`, and `tv-*` cards plus `web-p06-player.html` are locked. Locked
155
+ previews ignore both `localStorage` and parent broadcasts.
117
156
  If you write a new component preview, you almost certainly don't want the
118
157
  lock — let the tokens do the work and your specimen will render correctly in
119
158
  both modes.
@@ -158,7 +197,7 @@ they describe the role exactly. shadcn-imported code prefers the short names.
158
197
  Base UI / headless primitives set
159
198
  `data-state="open|closed|checked|unchecked|active|completed|pending|loading"`
160
199
  on the DOM. Our components target those same attribute values in CSS — see the
161
- wizard step bar in `components-form-layouts.html`
200
+ wizard step bar in `web-p00-form-layouts.html`
162
201
  (`.step[data-state="completed"]`) and the menu/table cards. Prefer `data-state`
163
202
  over inventing class flags (`.is-active`, `.on`, `.current`) so the same DOM
164
203
  contract works whether the controlling code is React, Vue, vanilla JS, or
@@ -169,7 +208,7 @@ hand-written HTML, and so devtools can read the component's state at a glance.
169
208
  shadcn marks parts of compound components with `data-slot="card-header"`,
170
209
  `data-slot="card-title"`, etc. We do the same on the folder picker
171
210
  (`data-slot="modal" / "modal-header" / "modal-body" / "modal-footer"`) and the
172
- auth card in `components-form-layouts.html` (`data-slot="auth" / "auth-header"
211
+ auth card in `web-p00-form-layouts.html` (`data-slot="auth" / "auth-header"
173
212
  / "auth-body"`). This lets external CSS tweak one part without inventing
174
213
  nested class chains.
175
214
 
Binary file
Binary file
@@ -358,7 +358,9 @@ input, textarea, select { text-transform: none; letter-spacing: normal; }
358
358
  .form-group .label-row a:hover { color: var(--text); }
359
359
 
360
360
  /* Floating-menu surface — one recipe for dropdowns, context menus,
361
- submenus, and on-player popovers. Cards keep their item styles local. */
361
+ submenus, and on-player popovers. Cards keep their item styles local.
362
+ Consumed by web-c09-menu.html and web-p06-player.html — it looks unused
363
+ from this file alone, so do not delete it. */
362
364
  /* Reads the --menu-* aliases for surface, border, radius and shadow. The
363
365
  generic scale is close but not identical, and using it here would silently
364
366
  break --menu-* retheming for every consumer of this recipe. */