@lessonkit/themes 0.9.2 → 1.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.
Files changed (2) hide show
  1. package/README.md +17 -34
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,13 +1,10 @@
1
- # `@lessonkit/themes`
1
+ # @lessonkit/themes
2
2
 
3
- [![CI](https://github.com/eddiethedean/lessonkit/actions/workflows/ci.yml/badge.svg)](https://github.com/eddiethedean/lessonkit/actions/workflows/ci.yml)
4
- [![Documentation](https://readthedocs.org/projects/lessonkit/badge/?version=latest)](https://lessonkit.readthedocs.io/en/latest/)
5
3
  [![npm](https://img.shields.io/npm/v/@lessonkit/themes.svg)](https://www.npmjs.com/package/@lessonkit/themes)
4
+ [![Documentation](https://readthedocs.org/projects/lessonkit/badge/?version=latest)](https://lessonkit.readthedocs.io/en/latest/reference/theming.html)
6
5
  [![License](https://img.shields.io/github/license/eddiethedean/lessonkit)](https://github.com/eddiethedean/lessonkit/blob/main/LICENSE)
7
6
 
8
- Design tokens and theme utilities for LessonKit.
9
-
10
- **Docs:** [Theming reference](https://lessonkit.readthedocs.io/en/latest/reference/theming.html) · [Theming & accessibility guide](https://lessonkit.readthedocs.io/en/latest/guides/react-developers/theming-and-accessibility.html)
7
+ Design tokens, presets, and CSS variable utilities for LessonKit.
11
8
 
12
9
  ## Install
13
10
 
@@ -15,41 +12,27 @@ Design tokens and theme utilities for LessonKit.
15
12
  npm install @lessonkit/themes
16
13
  ```
17
14
 
18
- ## API (0.6.0)
19
-
20
- ### Types
15
+ ## Usage
21
16
 
22
- - `LessonkitThemeV1` — full token schema v1
23
- - `LessonkitTheme` alias for `LessonkitThemeV1`
24
- - `PartialLessonkitThemeV1` — partial overrides for merge / `ThemeProvider`
17
+ ```typescript
18
+ import { getPresetTheme, mergeThemes, themeToCssVariables } from "@lessonkit/themes";
25
19
 
26
- ### Presets
20
+ const theme = mergeThemes(getPresetTheme("light"), { colors: { primary: "#0066cc" } });
21
+ const vars = themeToCssVariables(theme); // { "--lk-color-primary": "#0066cc", ... }
22
+ ```
27
23
 
28
- - `defaultTheme`, `lightTheme`, `darkTheme`, `brandTheme`, `brandThemeOverrides`
29
- - `getPresetTheme(preset)` — `default` | `light` | `dark` | `brand` (full themes for catalog/validation)
24
+ **Presets:** `default`, `light`, `dark`, `brand` via `getPresetTheme()`
30
25
 
31
- In `ThemeProvider`, `preset="default"` uses the mode palette only; `preset="brand"` merges `brandThemeOverrides` onto the active mode (see [theming reference](https://lessonkit.readthedocs.io/en/latest/reference/theming.html)).
26
+ **Utilities:** `validateTheme()`, `mergeThemes()`, `themeToCssDeclarationBlock()`, `buildThemeCatalog()`
32
27
 
33
- ### Utilities
28
+ **Assets:** `theme-contract.v1.json`, `theme-catalog.v1.json`, `base.css`
34
29
 
35
- - `validateTheme(input)` validate unknown input
36
- - `mergeThemes(base, ...overrides)` — deep merge, last writer wins
37
- - `themeToCssVariables(theme)` — flat `--lk-*` map (sorted keys)
38
- - `themeToCssDeclarationBlock(theme)` — `:root { ... }` text
39
- - `buildThemeCatalog()` — enumerable token metadata
30
+ Pair with `ThemeProvider` from `@lessonkit/react` for runtime theming.
40
31
 
41
- ### Machine-readable exports
32
+ ## Docs
42
33
 
43
- ```json
44
- {
45
- "imports": {
46
- "@lessonkit/themes/theme-contract.v1.json": "./theme-contract.v1.json",
47
- "@lessonkit/themes/theme-catalog.v1.json": "./theme-catalog.v1.json",
48
- "@lessonkit/themes/base.css": "./base.css"
49
- }
50
- }
51
- ```
34
+ [Theming reference](https://lessonkit.readthedocs.io/en/latest/reference/theming.html)
52
35
 
53
- ## Docs
36
+ ## License
54
37
 
55
- See the [theming reference](https://lessonkit.readthedocs.io/en/latest/reference/theming.html) for the CSS variable contract and override rules.
38
+ Apache-2.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lessonkit/themes",
3
- "version": "0.9.2",
3
+ "version": "1.0.0",
4
4
  "private": false,
5
5
  "description": "Theme primitives and tokens for LessonKit.",
6
6
  "license": "Apache-2.0",