@hattisar/design-tokens 0.3.11 → 0.3.12

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/package.json +1 -1
  2. package/tokens.css +48 -39
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hattisar/design-tokens",
3
- "version": "0.3.11",
3
+ "version": "0.3.12",
4
4
  "description": "Shared design tokens (colors, type, radius, spacing, motion) and base primitives (reset, buttons, inputs, cards, modals, auth shell) for every Hattisar frontend.",
5
5
  "main": "tokens.css",
6
6
  "files": [
package/tokens.css CHANGED
@@ -352,17 +352,35 @@
352
352
  --sidebar-width-collapsed: 64px;
353
353
  --sidebar-height: calc(100vh - var(--header-height));
354
354
 
355
- /* Three content widths, not one — simple field-only forms (Credit
356
- Memos, Settings CRUD, ...), structured views with a sidebar or grid
357
- (Dashboard, Customer/Vendor forms, Modules), and line-item-heavy
358
- documents (Invoices, Purchase Orders, ...) don't read well at the
359
- same width. Every page that opts into one of these also centers via
360
- margin: 0 auto (see .record-form-layout > form, .wide-form-layout >
361
- form, .dashboard-page-content, .settings-layout-content below) —
362
- instead of each page picking its own guess at either. */
363
- --page-width-small: 800px;
364
- --page-width-medium: 1152px;
365
- --page-width-large: 1600px;
355
+ /* Two widths, because a page is one of two things.
356
+ Measured against Shopify at 1920: their product *list* runs
357
+ 256→1888, effectively the full area, and their product *form* runs
358
+ 605→1554 — 950px, centred, with 365px of gap either side. A table
359
+ wants every pixel; a form wants a column you can read across
360
+ without your eyes travelling.
361
+
362
+ There were three before — 800 for plain field lists, 1152 for
363
+ forms with a sidebar, 1600 for line-item documents — and they were
364
+ flush left. Three caps left-aligned is the worst of both: the
365
+ right edge moves between pages *and* so does the amount of empty
366
+ space, so the app reads as if it cannot decide how wide it is.
367
+
368
+ --page-width-content is 1152 rather than Shopify's 950 for a
369
+ reason that is ours and not theirs: their product form has no
370
+ line-item grid and every one of our documents does. A sales order
371
+ at 950 would scroll its item table sideways on every visit, and
372
+ trading a horizontal scroll on the busiest form in the app for
373
+ 200px of symmetry is a bad deal. */
374
+ --page-width-content: 1152px;
375
+
376
+ /* Kept as aliases: several rules and a handful of pages still name
377
+ them, and pointing all three at the same value is what makes the
378
+ consolidation a one-line change rather than a sweep through forty
379
+ files. They resolve to the same width now — the modifier classes
380
+ are inert. */
381
+ --page-width-small: var(--page-width-content);
382
+ --page-width-medium: var(--page-width-content);
383
+ --page-width-large: var(--page-width-content);
366
384
 
367
385
  color-scheme: light dark;
368
386
  }
@@ -1299,37 +1317,28 @@ input[type="radio"] {
1299
1317
  margin-bottom: 12px;
1300
1318
  }
1301
1319
 
1302
- /* Capped, NOT centered — small by default, the right width for a plain
1303
- field-only form (Credit Memos, Vendor Payments, most Settings CRUD
1304
- pages, ...). Flush left, same edge as the page's own <h2> title (a
1305
- separate sibling outside this box) and the same edge every list page
1306
- (.reports-layout-content/.settings-layout-content) already starts
1307
- from — centering via margin:0 auto instead used to drift this box's
1308
- left edge away from both of those, and away from itself between a
1309
- wide table and a two-field form, reading as content jumping around
1310
- from page to page instead of a page that's simply narrower. */
1311
- .record-form-layout > form {
1312
- flex: 1;
1313
- min-width: 0;
1314
- max-width: var(--page-width-small);
1315
- }
1320
+ /* Capped and centred, one width for every form.
1321
+ This reverses the note that stood here, so the reasoning it replaces
1322
+ is worth keeping rather than deleting: centring was rejected before
1323
+ because it drifted the form's left edge away from the page's own
1324
+ title and away from the list pages' left edge, so content appeared
1325
+ to jump around between pages.
1316
1326
 
1317
- /* Structured forms that need more room than a plain field list but
1318
- aren't a line-item document — a sidebar panel (Customer/Vendor +
1319
- Notes/Tags) or a longer component list (Builds). Opt in with both
1320
- classes: className="record-form-layout medium-form-layout". */
1321
- .record-form-layout.medium-form-layout > form {
1322
- max-width: var(--page-width-medium);
1323
- }
1327
+ That was true, and it was true *because there were three widths*. A
1328
+ centred box only moves if the box keeps changing size — with one
1329
+ width the left edge is the same on every form in the app, which is
1330
+ the thing the old note actually wanted. The page title moves with
1331
+ it, so the two stay aligned.
1324
1332
 
1325
- /* Wide-table document forms (Invoices, Purchase Orders, Sales Orders,
1326
- ...) need more room than --page-width-medium for their line-items
1327
- table, but a truly unbounded max-width stretches those rows into
1328
- awkward proportions on an ultra-wide monitor — capped generously
1329
- instead, still full-bleed on any normal screen. Flush left, same
1330
- reasoning as .record-form-layout > form above. */
1333
+ Tables are untouched and stay full width, which is what Shopify does
1334
+ and what a table wants. */
1335
+ .record-form-layout > form,
1336
+ .record-form-layout.medium-form-layout > form,
1331
1337
  .wide-form-layout > form {
1332
- max-width: var(--page-width-large);
1338
+ flex: 1;
1339
+ min-width: 0;
1340
+ max-width: var(--page-width-content);
1341
+ margin-inline: auto;
1333
1342
  }
1334
1343
 
1335
1344
  .wide-form-layout .party-form-columns {