@tectra-ng/themes 0.2.5 → 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
@@ -11,6 +11,7 @@
11
11
  <a href="https://github.com/kulakovskyi/tectra-ng/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-2560e4" alt="MIT license" /></a>
12
12
  <a href="https://angular.dev"><img src="https://img.shields.io/badge/Angular-22-dd0031?logo=angular&logoColor=white" alt="Angular 22" /></a>
13
13
  <a href="https://www.bestpractices.dev/projects/16576"><img src="https://www.bestpractices.dev/projects/16576/badge" alt="OpenSSF Best Practices" /></a>
14
+ <a href="https://www.bestpractices.dev/projects/16576/baseline-2"><img src="https://www.bestpractices.dev/projects/16576/baseline" alt="OpenSSF Baseline" /></a>
14
15
  </p>
15
16
 
16
17
  <p align="center">
@@ -30,12 +31,12 @@ Gives the primitive tokens a meaning. A preset = semantic tokens for light + dar
30
31
  | File | What it does |
31
32
  |---|---|
32
33
  | `semantic/light.semantic.ts`, `semantic/dark.semantic.ts` | which step of which palette is `primary`, `surface.card`, `field.border`, `danger.hover`… in each mode |
33
- | `presets/tectra.preset.ts` | `createTectraPreset({ style, primary, surface })` — `style` from `TECTRA_STYLES` (`tectra` · `soft` · `edge` · `paper`), `primary` from `PRIMARY_ORDER` (`noir` follows the surface), `surface` from `SURFACE_PALETTES`; ready presets `Tectra` (default), `Soft`, `Edge`, `Paper` |
34
+ | `presets/tectra.preset.ts` | `createTectraPreset({ style, primary, surface })` — `style` is the style object (`tectraStyle` by default, `softStyle`, `edgeStyle`, `paperStyle`; only the one passed lands in the bundle, `TECTRA_STYLES[name]` picks one by name and ships them all), `primary` from `PRIMARY_ORDER` (`noir` follows the surface), `surface` from `SURFACE_PALETTES`; ready presets `Tectra` (default), `Soft`, `Edge`, `Paper` |
34
35
  | `styles/<name>/` | a style = component token overrides + semantic overrides + optional CSS on top of the default look: `tectra` — the default; `soft` — pill buttons, tags and segments, filled borderless fields, tonal secondary buttons, large card and overlay radii, glow focus; `edge` — sharp corners, strong borders, solid selection; `paper` — filled fields with an underline, elevation shadows, focus halos |
35
36
  | `semantic/contrast.ts` | `primaryBaseStep(scale)` — light primary is step 600, or 700 when white text on 600 is under 4.5:1 |
36
37
  | `define-preset.ts` | `definePreset(base, overrides)` — deep merge: override one token without copying the rest |
37
- | `components/*.tokens.ts` | design tokens of every component (`button`, `select`, `table`, `datePicker`, …) — every size, padding, colour per severity and variant; emitted as `--tx-<component>-…`, overridable per preset or per instance with `[dt]` |
38
- | `preset-to-css.ts` | `presetToCss(preset)` → `:root { --tx-… }` + `:root[data-tx-theme="dark"] { … }` |
38
+ | `components/*.tokens.ts` | design tokens of every component (`button`, `select`, `table`, `datePicker`, …) — every size, padding, colour per severity and variant; emitted as `--tx-<component>-…` once a component of that group is on the page (an app ships only the groups it uses), overridable per preset or per instance with `[dt]`; `preset.components` holds only the overrides of a style or `definePreset` |
39
+ | `preset-to-css.ts` | `presetBaseCss(preset)` → `:root { --tx-… }` + `:root[data-tx-theme="dark"] { … }` without component tokens; `componentTokensCss(group, tokens)` → the variables of one component group; `presetToCss(preset)` → everything at once (every component), for a page without Angular |
39
40
 
40
41
  Semantic groups (each becomes `--tx-<group>-<key>`): `primary`, `secondary`, `success`, `info`, `warn`, `danger`, `help`, `contrast`, `surface`, `text`, `field`, `highlight`, `list`, `mask`, `focus-ring`, `shadow`. Shared: `radius`, `space`, `font`, `motion`.
41
42