blip-tokens 2.1.0 → 2.2.1
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 +40 -5
- package/build/assets/v1/manifest.json +3907 -1
- package/build/scss/extended-color.scss +1 -1
- package/build/scss/theme-dark.scss +1 -1
- package/build/scss/theme-high-contrast.scss +1 -1
- package/build/scss/theme-light.scss +1 -1
- package/build/scss/variables.scss +1 -1
- package/build/uai-icons/uai-icon.css +651 -0
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -518,6 +518,22 @@ There are two icon variants:
|
|
|
518
518
|
| **Outline** | `assets/icons/outline/` | `<name>-outline` |
|
|
519
519
|
| **Solid** | `assets/icons/solid/` | `<name>-solid` |
|
|
520
520
|
|
|
521
|
+
### UAI Icon font
|
|
522
|
+
|
|
523
|
+
The separate UAI icon set lives in `assets/uai-icons/outline/` and `assets/uai-icons/solid/`. Its SVGs are uploaded to the versioned CDN. The generated monochrome WOFF2 font and glyph data are published under `uai-icon/font/` and `uai-icon/glyphs.json` in the CDN. The npm package bundles only the CSS under `build/uai-icons/`, exported as `blip-tokens/uai-icons/css`; the CSS references the versioned CDN font. The legacy `assets/icons/` registry, names, and build remain independent.
|
|
524
|
+
|
|
525
|
+
The generated font uses `currentColor`, so icon color follows the CSS `color` property of the element (or an inherited color). Import the bundled stylesheet, then use the base class, glyph class, and a size class. The WOFF2 font and glyph manifest are available from the versioned CDN; only the stylesheet is included in the package.
|
|
526
|
+
|
|
527
|
+
```html
|
|
528
|
+
<link rel="stylesheet" href="node_modules/blip-tokens/build/uai-icons/uai-icon.css">
|
|
529
|
+
<i class="uai-icon uai-icon-outline-favorite uai-icon-32" aria-hidden="true"></i>
|
|
530
|
+
<span class="uai-icon uai-icon-solid-favorite uai-icon-24" style="color: #e2483d" aria-hidden="true"></span>
|
|
531
|
+
```
|
|
532
|
+
|
|
533
|
+
Supported size classes are `uai-icon-16`, `uai-icon-24`, and `uai-icon-32`. The glyph class is `uai-icon-<variant>-<name>`; when two icons share a leaf name, the category is included to disambiguate, for example `uai-icon-outline-file-video` and `uai-icon-outline-media-video`.
|
|
534
|
+
|
|
535
|
+
The build generates the font source from the UAI SVGs, replacing their monochrome fill/stroke colors with `currentColor`; transparent fills such as `fill="none"` are preserved. This transformation is isolated to the font source and does not modify the shipped UAI SVG assets.
|
|
536
|
+
|
|
521
537
|
### Adding New Icons
|
|
522
538
|
|
|
523
539
|
1. **Place the SVG file** in the correct folder:
|
|
@@ -650,7 +666,7 @@ Component artwork SVGs live in `assets/components/` and are registered under `as
|
|
|
650
666
|
|
|
651
667
|
## CDN Assets
|
|
652
668
|
|
|
653
|
-
|
|
669
|
+
Artwork families and UAI icons are delivered as standalone SVGs through the CDN, not embedded in the npm package. Import the packaged manifest to resolve an asset URL:
|
|
654
670
|
|
|
655
671
|
```javascript
|
|
656
672
|
import manifest from 'blip-tokens/assets/manifest' with { type: 'json' };
|
|
@@ -663,7 +679,25 @@ JSON import syntax depends on the consuming runtime or bundler. Each manifest en
|
|
|
663
679
|
|
|
664
680
|
The default URL pattern is `https://cdn.blip.ai/blip-tokens/<version>/<asset.path>`. Use the manifest shipped with the installed package so its version and asset paths stay aligned. A local build's `unreleased` directory is not published automatically.
|
|
665
681
|
|
|
666
|
-
|
|
682
|
+
### Figtree
|
|
683
|
+
|
|
684
|
+
The CDN manifest includes the variable Figtree WOFF2 subsets `font/figtree/latin`
|
|
685
|
+
and `font/figtree/latin-ext`, both covering weights 300–900. Resolve each URL from
|
|
686
|
+
the installed package's manifest; use both subsets with the matching
|
|
687
|
+
`unicode-range` declarations from the
|
|
688
|
+
[Google Fonts stylesheet](https://fonts.googleapis.com/css2?family=Figtree:wght@300..900&display=swap).
|
|
689
|
+
The same CDN manifest also includes `font/figtree/license` (`fonts/figtree/OFL.txt`).
|
|
690
|
+
The font and license are CDN-only and are not included in the npm package.
|
|
691
|
+
|
|
692
|
+
Figtree is redistributed under the SIL Open Font License 1.1. Keep the license
|
|
693
|
+
available alongside the font when using these assets. Source files are from
|
|
694
|
+
[Google Fonts' Figtree family](https://github.com/google/fonts/tree/main/ofl/figtree).
|
|
695
|
+
|
|
696
|
+
The generator validates SVG documents, active content, external references,
|
|
697
|
+
WOFF2 signatures, the Figtree license, source paths outside `assets/`, and
|
|
698
|
+
duplicate output paths. Add artwork to its registry as well as the filesystem;
|
|
699
|
+
CDN generation reads registries, while icon names/types are generated from the
|
|
700
|
+
filesystem.
|
|
667
701
|
|
|
668
702
|
---
|
|
669
703
|
|
|
@@ -690,7 +724,7 @@ The build clears previous outputs and runs four steps:
|
|
|
690
724
|
1. **Style Dictionary 2** (`config.cjs`) — transforms only color and theme tokens into the legacy JSON, CSS, and SCSS; artwork registries are not inputs
|
|
691
725
|
2. **Icon types generator** (`scripts/generate_icon_types.js`) — produces `build/icons.js` and `build/icons.d.ts`
|
|
692
726
|
3. **Figma token pipeline** (`scripts/build_tokens.js`) — validates the Figma snapshot, normalizes DTCG, resolves aliases and generates the `--uai-*` outputs with Style Dictionary 5. It runs after step 1 and writes only `uai-*` files, `tokens.js` and `tokens.d.ts`, so the legacy files are not touched
|
|
693
|
-
4. **CDN asset generator** (`scripts/generate_assets.cjs`) — reads the SVG source registries directly, validates and copies artwork, and generates the asset manifest without intermediate embedded JSON catalogs
|
|
727
|
+
4. **CDN asset generator** (`scripts/generate_assets.cjs`) — reads the SVG source registries directly, validates and copies artwork and Figtree font files, and generates the asset manifest without intermediate embedded JSON catalogs
|
|
694
728
|
|
|
695
729
|
Style Dictionary 5 is installed as the `style-dictionary-v5` alias next to
|
|
696
730
|
Style Dictionary 2, which the legacy and asset builds still use. Run `npm test`
|
|
@@ -728,8 +762,9 @@ build/
|
|
|
728
762
|
│ ├── theme-*.json # Legacy themes (light, dark, high-contrast)
|
|
729
763
|
│ └── extended-color.json # Legacy extended palette
|
|
730
764
|
├── assets/v1/
|
|
731
|
-
│ ├── manifest.json # Packaged
|
|
732
|
-
│
|
|
765
|
+
│ ├── manifest.json # Packaged inventory; used for validation, not uploaded
|
|
766
|
+
│ ├── .../*.svg # CDN upload only; excluded from npm
|
|
767
|
+
│ └── fonts/figtree/ # Variable WOFF2 subsets and OFL license; CDN only
|
|
733
768
|
├── tokens.js # ESM theme maps, styles and metadata
|
|
734
769
|
├── tokens.d.ts # Token, style and metadata types
|
|
735
770
|
├── icons.js # Runtime icon arrays + helpers
|