@atomic-ui/theme 0.2.0 → 0.3.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/README.md CHANGED
@@ -8,12 +8,13 @@ The design follows Strata, Impkt's most carefully designed product, and the Impk
8
8
 
9
9
  ## How it is built
10
10
 
11
- The stylesheet is generated, so do not edit `dist/theme.css`. `pnpm build` runs `scripts/build.ts`, which does four things.
11
+ The stylesheet is generated, so do not edit `dist/theme.css`. `pnpm build` runs `scripts/build.ts`, which does five things.
12
12
 
13
13
  1. It takes the Impkt brand inputs in `src/brand.ts`. They are the same values as the `BRAND` block in impkt-web's `content.py`, which gives the Impkt site its look in Strata.
14
14
  2. It derives the house tokens from them with `deriveTokens` from `@atomic-ui/design-tokens`, and writes them as `--impkt-*` custom properties with that package's own emitter, `toStylesheet`.
15
15
  3. It defines each `--ik-*` name in `src/theme.ts`. Where a house token has the same role and the same value, the name is defined as that token, for example `--ik-brand: var(--impkt-color-brand-default)`. The site and the products then follow one source. Where there is no house token for the role, or the derived value differs from the value the products were tuned to, the name keeps its 1.0.0 value, and `src/theme.ts` says why beside it. The dark theme keeps its 1.0.0 values, because the brand inputs describe a light brand only.
16
- 4. It measures every contrast pair in `src/contrast.ts` in both themes, and stops if any falls below WCAG 2.2 AA. Then it writes `dist/theme.css`, copies the fonts and their licence into `dist/fonts`, and copies the specimen page.
16
+ 4. It gives the house tokens the components read the products' values, in light and in dark, from `COMPONENT_TOKENS` in `src/theme.ts`, so an `@atomic-ui/ui` component on a product page looks like the product around it. Only literal values are written there, never a reference to a `--ik-*` name, because several of those names are defined by the same tokens and a reference back would empty both.
17
+ 5. It measures every contrast pair in `src/contrast.ts` in both themes, and stops if any falls below WCAG 2.2 AA. Then it writes `dist/theme.css`, copies the fonts and their licence into `dist/fonts`, and copies the specimen page.
17
18
 
18
19
  The component styles in `src/components.css` are the 1.0.0 rules, unchanged. The tests check that every `--ik-*` name and every class name from 1.0.0 is still there, that the component styles and dark values are unchanged, and that every name defined by a token comes to its 1.0.0 value.
19
20
 
@@ -39,6 +40,8 @@ The component styles in `src/components.css` are the 1.0.0 rules, unchanged. The
39
40
 
40
41
  6. Keep only the product's own CSS inline. Point the product's colour names at the theme's tokens, for example `--accent: var(--ik-brand)`, so existing rules pick up the theme in both light and dark.
41
42
 
43
+ 7. To use the components as well, copy them with `pnpm ui:copy ../impkt-tender` and load them after the stylesheet with `<script type="module" src="/atomic-ui.js"></script>`. The theme already holds their tokens, so they take the Impkt look and follow the theme into dark. The `@atomic-ui/ui` README describes the standalone file, and its `specimen/index.html` shows the app components on a product page.
44
+
42
45
  Every product token starts with `--ik-` and every new class with `.ik-`, so nothing collides with a product's own names. The house tokens they are built from start with `--impkt-`, and a product can read those too. The theme also styles the class names the products already share: `card`, `panel`, `pill` with `ok`, `warn`, `bad` and `info`, `alert` with the same tones, `tabs` with `on`, `muted`, `small` and `row`, and the `primary`, `ghost`, `danger` and `small` buttons. Element rules sit inside `:where()`, so they have no specificity and a product's own rule always wins.
43
46
 
44
47
  ## Principles
package/dist/theme.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Impkt product theme, @atomic-ui/theme version 0.2.0.
2
+ * Impkt product theme, @atomic-ui/theme version 0.3.0.
3
3
  * https://github.com/matthill8286/impkt-design-system/tree/main/packages/theme
4
4
  *
5
5
  * Generated from the Impkt brand inputs by @atomic-ui/design-tokens. Do not edit this file:
@@ -412,6 +412,112 @@
412
412
  color-scheme: dark;
413
413
  }
414
414
 
415
+ /* ----------------------------------------------------- component tokens */
416
+
417
+ /* The house tokens the @atomic-ui/ui components read, given the products' values, so a component looks like the product around it in light and in dark. */
418
+
419
+ :root {
420
+ --impkt-color-surface-inset: #F0EBE5;
421
+ --impkt-color-surface-subtle: #F5F1F7;
422
+ --impkt-color-text-heading: #241a2e;
423
+ --impkt-color-text-muted: #645C57;
424
+ --impkt-color-text-placeholder: #645C57;
425
+ --impkt-color-text-link-hover: #4E3A5E;
426
+ --impkt-color-border-default: #8A8079;
427
+ --impkt-color-border-strong: #645C57;
428
+ --impkt-color-brand-hover: #5C4569;
429
+ --impkt-color-brand-active: #4E3A5E;
430
+ --impkt-color-brand-subtle: #EFEAF2;
431
+ --impkt-color-status-danger-text: #A2404B;
432
+ --impkt-color-status-danger-subtle: #FBEDEE;
433
+ --impkt-color-status-warning-default: #9A8318;
434
+ --impkt-color-status-warning-text: #7A6410;
435
+ --impkt-color-status-warning-subtle: #FBF4D8;
436
+ --impkt-color-status-success-text: #356E4D;
437
+ --impkt-color-status-success-subtle: #EAF3EC;
438
+ --impkt-color-status-info-text: #336C96;
439
+ --impkt-color-status-info-subtle: #EAF2F8;
440
+ --impkt-focus-ring-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px #241A2E;
441
+ }
442
+
443
+ @media (prefers-color-scheme: dark) {
444
+ :root:not([data-theme="light"]) {
445
+ --impkt-color-surface-page: #15111A;
446
+ --impkt-color-surface-card: #211A28;
447
+ --impkt-color-surface-inset: #1C1622;
448
+ --impkt-color-surface-subtle: #261E2E;
449
+ --impkt-color-text-default: #F4EFF6;
450
+ --impkt-color-text-heading: #F4EFF6;
451
+ --impkt-color-text-muted: #B3AAB8;
452
+ --impkt-color-text-placeholder: #B3AAB8;
453
+ --impkt-color-text-link: #CDB8DC;
454
+ --impkt-color-text-link-hover: #E4D7EC;
455
+ --impkt-color-text-on-brand: #1A1420;
456
+ --impkt-color-border-default: #7D7086;
457
+ --impkt-color-border-strong: #B3AAB8;
458
+ --impkt-color-brand-default: #B9A0CB;
459
+ --impkt-color-brand-hover: #CDB8DC;
460
+ --impkt-color-brand-active: #D6C3E2;
461
+ --impkt-color-brand-subtle: #2E2438;
462
+ --impkt-color-brand-on: #1A1420;
463
+ --impkt-color-status-danger-default: #F0979E;
464
+ --impkt-color-status-danger-text: #F0979E;
465
+ --impkt-color-status-danger-subtle: #3A1D24;
466
+ --impkt-color-status-warning-default: #E6C95A;
467
+ --impkt-color-status-warning-text: #E6C95A;
468
+ --impkt-color-status-warning-subtle: #38301A;
469
+ --impkt-color-status-success-default: #8FD0A0;
470
+ --impkt-color-status-success-text: #8FD0A0;
471
+ --impkt-color-status-success-subtle: #1B3123;
472
+ --impkt-color-status-info-default: #8DC0E6;
473
+ --impkt-color-status-info-text: #8DC0E6;
474
+ --impkt-color-status-info-subtle: #1A2B3A;
475
+ --impkt-focus-ring-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px #241A2E;
476
+ --impkt-color-status-danger-on: #1A1420;
477
+ --impkt-color-status-warning-on: #1A1420;
478
+ --impkt-color-status-success-on: #1A1420;
479
+ --impkt-color-status-info-on: #1A1420;
480
+ }
481
+ }
482
+
483
+ :root[data-theme="dark"] {
484
+ --impkt-color-surface-page: #15111A;
485
+ --impkt-color-surface-card: #211A28;
486
+ --impkt-color-surface-inset: #1C1622;
487
+ --impkt-color-surface-subtle: #261E2E;
488
+ --impkt-color-text-default: #F4EFF6;
489
+ --impkt-color-text-heading: #F4EFF6;
490
+ --impkt-color-text-muted: #B3AAB8;
491
+ --impkt-color-text-placeholder: #B3AAB8;
492
+ --impkt-color-text-link: #CDB8DC;
493
+ --impkt-color-text-link-hover: #E4D7EC;
494
+ --impkt-color-text-on-brand: #1A1420;
495
+ --impkt-color-border-default: #7D7086;
496
+ --impkt-color-border-strong: #B3AAB8;
497
+ --impkt-color-brand-default: #B9A0CB;
498
+ --impkt-color-brand-hover: #CDB8DC;
499
+ --impkt-color-brand-active: #D6C3E2;
500
+ --impkt-color-brand-subtle: #2E2438;
501
+ --impkt-color-brand-on: #1A1420;
502
+ --impkt-color-status-danger-default: #F0979E;
503
+ --impkt-color-status-danger-text: #F0979E;
504
+ --impkt-color-status-danger-subtle: #3A1D24;
505
+ --impkt-color-status-warning-default: #E6C95A;
506
+ --impkt-color-status-warning-text: #E6C95A;
507
+ --impkt-color-status-warning-subtle: #38301A;
508
+ --impkt-color-status-success-default: #8FD0A0;
509
+ --impkt-color-status-success-text: #8FD0A0;
510
+ --impkt-color-status-success-subtle: #1B3123;
511
+ --impkt-color-status-info-default: #8DC0E6;
512
+ --impkt-color-status-info-text: #8DC0E6;
513
+ --impkt-color-status-info-subtle: #1A2B3A;
514
+ --impkt-focus-ring-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px #241A2E;
515
+ --impkt-color-status-danger-on: #1A1420;
516
+ --impkt-color-status-warning-on: #1A1420;
517
+ --impkt-color-status-success-on: #1A1420;
518
+ --impkt-color-status-info-on: #1A1420;
519
+ }
520
+
415
521
  @media (pointer: coarse) { :root { --ik-control-height: 44px; } }
416
522
 
417
523
  @media (min-width: 641px) { :root { --ik-gutter: 24px; } }
@@ -642,3 +748,10 @@ input:not([type="checkbox"], [type="radio"], [type="file"], [type="range"], [typ
642
748
  transition-duration: 0.01ms !important; scroll-behavior: auto !important;
643
749
  }
644
750
  }
751
+
752
+ /* --------------------------------------------------------------- header overflow (0.3.0) */
753
+ /* When the controls on the right are wide, the product name shortens with an ellipsis
754
+ instead of running under them, and the controls stay on one row. */
755
+ .ik-brand { flex: 0 1 auto; overflow: hidden; }
756
+ .ik-brand > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
757
+ .ik-header > .ik-brand ~ * { flex: none; flex-wrap: nowrap; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atomic-ui/theme",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "The Impkt product theme: one stylesheet and the Urbanist fonts for the plain HTML products, generated from the Impkt brand by @atomic-ui/design-tokens.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -21,7 +21,7 @@
21
21
  "tsx": "^4.16.0",
22
22
  "typescript": "^5.5.0",
23
23
  "vitest": "^2.0.0",
24
- "@atomic-ui/design-tokens": "^0.2.0"
24
+ "@atomic-ui/design-tokens": "^0.3.0"
25
25
  },
26
26
  "files": [
27
27
  "dist",