@k8slens/lds-tokens 0.58.0 → 0.59.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 +158 -4
- package/lib/docs/token-map.dark.d.ts +1 -1
- package/lib/docs/token-map.dark.js +48 -2
- package/lib/docs/token-map.light.d.ts +1 -1
- package/lib/docs/token-map.light.js +48 -2
- package/lib/electron/font-face.css +1 -1
- package/lib/electron/icons/action.js +1 -1
- package/lib/electron/icons/base.js +1 -1
- package/lib/electron/icons/commerce.js +1 -1
- package/lib/electron/icons/display.js +1 -1
- package/lib/electron/icons/idp.js +1 -1
- package/lib/electron/icons/misc.js +1 -1
- package/lib/electron/icons/navigation.js +1 -1
- package/lib/electron/icons/status.js +1 -1
- package/lib/electron/icons/user.js +1 -1
- package/lib/electron/images/index.js +1 -1
- package/lib/electron/tokens.base.css +1 -1
- package/lib/electron/tokens.base.js +1 -1
- package/lib/electron/tokens.base.ts +1 -1
- package/lib/electron/tokens.carousel.css +1 -1
- package/lib/electron/tokens.colors.css +1 -1
- package/lib/electron/tokens.colors.js +1 -1
- package/lib/electron/tokens.colors.ts +1 -1
- package/lib/electron/tokens.core.css +1 -1
- package/lib/electron/tokens.dark.css +1 -1
- package/lib/electron/tokens.dark.js +1 -1
- package/lib/electron/tokens.dark.scoped.css +1 -1
- package/lib/electron/tokens.dark.ts +1 -1
- package/lib/electron/tokens.form.css +1 -1
- package/lib/electron/tokens.light.css +1 -1
- package/lib/electron/tokens.light.js +1 -1
- package/lib/electron/tokens.light.scoped.css +1 -1
- package/lib/electron/tokens.light.ts +1 -1
- package/lib/electron/tokens.tips.css +1 -1
- package/lib/web/colors/dark.js +1 -1
- package/lib/web/colors/light.js +1 -1
- package/lib/web/font-imports.css +1 -1
- package/lib/web/icons/action.js +1 -1
- package/lib/web/icons/base.js +1 -1
- package/lib/web/icons/commerce.js +1 -1
- package/lib/web/icons/display.js +1 -1
- package/lib/web/icons/idp.js +1 -1
- package/lib/web/icons/misc.js +1 -1
- package/lib/web/icons/navigation.js +1 -1
- package/lib/web/icons/status.js +1 -1
- package/lib/web/icons/user.js +1 -1
- package/lib/web/images/index.js +1 -1
- package/lib/web/tailwind.config.cjs +1 -1
- package/lib/web/tailwind.config.js +1 -1
- package/lib/web/tokens.base.css +1 -1
- package/lib/web/tokens.base.js +1 -1
- package/lib/web/tokens.base.ts +1 -1
- package/lib/web/tokens.carousel.css +1 -1
- package/lib/web/tokens.colors.css +1 -1
- package/lib/web/tokens.colors.js +1 -1
- package/lib/web/tokens.colors.ts +1 -1
- package/lib/web/tokens.core.css +1 -1
- package/lib/web/tokens.dark.css +1 -1
- package/lib/web/tokens.dark.js +1 -1
- package/lib/web/tokens.dark.scoped.css +1 -1
- package/lib/web/tokens.dark.ts +1 -1
- package/lib/web/tokens.form.css +1 -1
- package/lib/web/tokens.light.css +1 -1
- package/lib/web/tokens.light.js +1 -1
- package/lib/web/tokens.light.scoped.css +1 -1
- package/lib/web/tokens.light.ts +1 -1
- package/lib/web/tokens.tips.css +1 -1
- package/llms.txt +178 -0
- package/package.json +7 -5
package/lib/web/icons/action.js
CHANGED
package/lib/web/icons/base.js
CHANGED
package/lib/web/icons/display.js
CHANGED
package/lib/web/icons/idp.js
CHANGED
package/lib/web/icons/misc.js
CHANGED
package/lib/web/icons/status.js
CHANGED
package/lib/web/icons/user.js
CHANGED
package/lib/web/images/index.js
CHANGED
package/lib/web/tokens.base.css
CHANGED
package/lib/web/tokens.base.js
CHANGED
package/lib/web/tokens.base.ts
CHANGED
package/lib/web/tokens.colors.js
CHANGED
package/lib/web/tokens.colors.ts
CHANGED
package/lib/web/tokens.core.css
CHANGED
package/lib/web/tokens.dark.css
CHANGED
package/lib/web/tokens.dark.js
CHANGED
package/lib/web/tokens.dark.ts
CHANGED
package/lib/web/tokens.form.css
CHANGED
package/lib/web/tokens.light.css
CHANGED
package/lib/web/tokens.light.js
CHANGED
package/lib/web/tokens.light.ts
CHANGED
package/lib/web/tokens.tips.css
CHANGED
package/llms.txt
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# @k8slens/lds-tokens
|
|
2
|
+
|
|
3
|
+
> Design tokens for the Lens Design System, providing a consistent foundation for colors, spacing, typography, and other visual properties across applications.
|
|
4
|
+
|
|
5
|
+
This package publishes design tokens in multiple formats for web applications. It includes CSS custom properties, JavaScript/TypeScript exports, and Tailwind CSS configuration. The tokens support both light and dark themes.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @k8slens/lds-tokens
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## CSS Variables
|
|
14
|
+
|
|
15
|
+
Import CSS files to use design tokens as CSS custom properties:
|
|
16
|
+
|
|
17
|
+
- `lib/electron/font-face.css` - Font face definitions (required)
|
|
18
|
+
- `lib/web/tokens.core.css` - Core token definitions (spacing, radius, shadows, typography)
|
|
19
|
+
- `lib/web/tokens.base.css` - Base design tokens
|
|
20
|
+
- `lib/web/tokens.colors.css` - Color palette definitions
|
|
21
|
+
- `lib/web/tokens.dark.css` - Dark theme semantic color mappings
|
|
22
|
+
- `lib/web/tokens.light.css` - Light theme semantic color mappings
|
|
23
|
+
- `lib/web/tokens.dark.scoped.css` - Scoped dark theme (for theme switching)
|
|
24
|
+
- `lib/web/tokens.light.scoped.css` - Scoped light theme (for theme switching)
|
|
25
|
+
|
|
26
|
+
Example usage:
|
|
27
|
+
|
|
28
|
+
```css
|
|
29
|
+
@import '@k8slens/lds-tokens/lib/electron/font-face.css';
|
|
30
|
+
@import '@k8slens/lds-tokens/lib/web/tokens.core.css';
|
|
31
|
+
@import '@k8slens/lds-tokens/lib/web/tokens.dark.css';
|
|
32
|
+
|
|
33
|
+
.my-component {
|
|
34
|
+
color: var(--alias-color-text-primary);
|
|
35
|
+
background: var(--alias-color-background-base);
|
|
36
|
+
padding: var(--spacing-4);
|
|
37
|
+
border-radius: var(--radius-default);
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## JavaScript/TypeScript Exports
|
|
42
|
+
|
|
43
|
+
Import tokens as JavaScript constants:
|
|
44
|
+
|
|
45
|
+
- `lib/web/tokens.dark.js` / `lib/web/tokens.dark.d.ts` - Dark theme token values
|
|
46
|
+
- `lib/web/tokens.light.js` / `lib/web/tokens.light.d.ts` - Light theme token values
|
|
47
|
+
- `lib/web/tokens.base.js` / `lib/web/tokens.base.d.ts` - Base token values
|
|
48
|
+
- `lib/web/tokens.colors.js` / `lib/web/tokens.colors.d.ts` - Color values
|
|
49
|
+
|
|
50
|
+
Example usage:
|
|
51
|
+
|
|
52
|
+
```typescript
|
|
53
|
+
import { AliasColorTextPrimary, AliasColorBackgroundBase } from '@k8slens/lds-tokens/lib/web/tokens.dark';
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Tailwind CSS Integration
|
|
57
|
+
|
|
58
|
+
Extend your Tailwind configuration with design system tokens:
|
|
59
|
+
|
|
60
|
+
- `lib/web/tailwind.config.js` - Full Tailwind config with token values
|
|
61
|
+
- `lib/web/tailwind.config.cjs` - CommonJS version
|
|
62
|
+
|
|
63
|
+
Example usage in `tailwind.config.js`:
|
|
64
|
+
|
|
65
|
+
```javascript
|
|
66
|
+
import ldsConfig from '@k8slens/lds-tokens/lib/web/tailwind.config.js';
|
|
67
|
+
|
|
68
|
+
/** @type {import('tailwindcss').Config} */
|
|
69
|
+
export default {
|
|
70
|
+
...ldsConfig,
|
|
71
|
+
// your additional config
|
|
72
|
+
theme: {
|
|
73
|
+
...ldsConfig.theme,
|
|
74
|
+
// your additional theme config
|
|
75
|
+
extend: {
|
|
76
|
+
...config.theme.extend,
|
|
77
|
+
// your additional theme extension config
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Icons
|
|
84
|
+
|
|
85
|
+
SVG icons organized by category. Two formats available:
|
|
86
|
+
|
|
87
|
+
**As React components** (recommended for bundlers with SVG support):
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
import { CopyPaste, Delete, Edit } from '@k8slens/lds-tokens/lib/web/icons/action.js';
|
|
91
|
+
import { Logo } from '@k8slens/lds-tokens/lib/web/icons/base.js';
|
|
92
|
+
import { Success, Warning } from '@k8slens/lds-tokens/lib/web/icons/status.js';
|
|
93
|
+
|
|
94
|
+
<Delete className="icon" />
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Categories: `action`, `base`, `commerce`, `display`, `idp`, `misc`, `navigation`, `status`, `user`
|
|
98
|
+
|
|
99
|
+
> Prefer `@k8slens/lds-icons` for React projects - provides themed components with "Icon" suffix naming.
|
|
100
|
+
|
|
101
|
+
**As inline base64 data** (for dynamic loading without bundler):
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
import actionIcons from '@k8slens/lds-tokens/lib/web/icons-inline/action.dark.json';
|
|
105
|
+
|
|
106
|
+
// Keys are kebab-case: "asset-icon-action-copy-paste"
|
|
107
|
+
const svgData = actionIcons['asset-icon-action-delete'];
|
|
108
|
+
const imgSrc = `data:image/svg+xml;base64,${svgData}`;
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Theme variants: `{category}.dark.json`, `{category}.light.json`, `{category}.brand.json`
|
|
112
|
+
|
|
113
|
+
## Images
|
|
114
|
+
|
|
115
|
+
SVG image assets as React components:
|
|
116
|
+
|
|
117
|
+
```tsx
|
|
118
|
+
import { ThankYouHero } from '@k8slens/lds-tokens/lib/web/images/index.js';
|
|
119
|
+
|
|
120
|
+
<ThankYouHero className="hero-image" />
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Favicons
|
|
124
|
+
|
|
125
|
+
Pre-generated favicon sets with all required sizes and formats:
|
|
126
|
+
|
|
127
|
+
- `lib/web/favicons/website/` - Standard website favicons
|
|
128
|
+
- `lib/web/favicons/lenscloud/` - Lens Cloud application favicons
|
|
129
|
+
|
|
130
|
+
**Usage:** Copy favicon files from `node_modules` to your public folder:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
cp -r node_modules/@k8slens/lds-tokens/lib/web/favicons/website/favicons/* public/
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Then add `<link>` tags to your HTML head using one of these options:
|
|
137
|
+
|
|
138
|
+
1. **Copy from HTML snippet** (`index.html` contains all required tags):
|
|
139
|
+
```bash
|
|
140
|
+
cat node_modules/@k8slens/lds-tokens/lib/web/favicons/website/index.html
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
2. **React component** (ensure paths match your public folder structure):
|
|
144
|
+
```tsx
|
|
145
|
+
import FaviconImports from '@k8slens/lds-tokens/lib/web/favicons/website/index.js';
|
|
146
|
+
<FaviconImports />
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
**Next.js:** Favicon naming follows Next.js App Router conventions. Copy `favicon.ico` and `apple-icon*.png` directly to your `app/` directory - Next.js will serve them automatically without additional configuration.
|
|
150
|
+
|
|
151
|
+
## Token Categories
|
|
152
|
+
|
|
153
|
+
### Colors
|
|
154
|
+
- Brand colors (`--alias-color-brand-*`)
|
|
155
|
+
- Text colors (`--alias-color-text-*`)
|
|
156
|
+
- Background colors (`--alias-color-background-*`)
|
|
157
|
+
- Border colors (`--alias-color-border-*`)
|
|
158
|
+
- Semantic colors (`--alias-color-danger`, `--alias-color-caution`, `--alias-color-ok`, `--alias-color-info`)
|
|
159
|
+
|
|
160
|
+
### Spacing
|
|
161
|
+
- Scale: 0.25, 0.5, 0.75, 1-96
|
|
162
|
+
- Usage: `var(--spacing-4)` or Tailwind `spacing-4`
|
|
163
|
+
|
|
164
|
+
### Border Radius
|
|
165
|
+
- Sizes: xs, sm, default, md, lg, xl, 2xl, 3xl
|
|
166
|
+
- Usage: `var(--radius-default)` or Tailwind `rounded-DEFAULT`
|
|
167
|
+
|
|
168
|
+
### Shadows
|
|
169
|
+
- Sizes: xs, default, md, lg, xl, 2xl, inner, dropdown
|
|
170
|
+
- Usage: `var(--shadow-default)` or Tailwind `shadow-default`
|
|
171
|
+
|
|
172
|
+
## Documentation
|
|
173
|
+
|
|
174
|
+
- [Lens Design System](https://lens-design-system.k8slens.dev/)
|
|
175
|
+
|
|
176
|
+
## Optional
|
|
177
|
+
|
|
178
|
+
- [npm Package](https://www.npmjs.com/package/@k8slens/lds-tokens)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@k8slens/lds-tokens",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.59.0",
|
|
4
4
|
"description": "Lens Design System – Design Tokens",
|
|
5
5
|
"author": "Mirantis Inc",
|
|
6
6
|
"license": "MIT",
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"sideEffects": false,
|
|
13
13
|
"module": "lib/web/tokens.dark",
|
|
14
14
|
"files": [
|
|
15
|
-
"lib/"
|
|
15
|
+
"lib/",
|
|
16
|
+
"llms.txt"
|
|
16
17
|
],
|
|
17
18
|
"scripts": {
|
|
18
19
|
"start": "concurrently --kill-others \"npx tsx src/index.ts\" \"nodemon --watch build --watch tokens --watch assets --watch '../**/src/**/tokens.json' --exec 'npm run build'\"",
|
|
@@ -21,8 +22,9 @@
|
|
|
21
22
|
"clean:src": "rimraf build",
|
|
22
23
|
"clean:lib": "rimraf lib",
|
|
23
24
|
"test": "npx jest",
|
|
24
|
-
"
|
|
25
|
-
"
|
|
25
|
+
"test:coverage": "npx jest --coverage",
|
|
26
|
+
"lint": "oxlint .",
|
|
27
|
+
"format": "oxlint --fix . && prettier --write ."
|
|
26
28
|
},
|
|
27
29
|
"devDependencies": {
|
|
28
30
|
"@capsizecss/core": "3.1.0",
|
|
@@ -41,5 +43,5 @@
|
|
|
41
43
|
"ts-node": "10.9.2",
|
|
42
44
|
"typescript": "5.0.4"
|
|
43
45
|
},
|
|
44
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "e41693e45edd36a94e34ab286d4ededba24f5daf"
|
|
45
47
|
}
|