@sole-ui/react 0.0.0-stage → 0.1.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 +66 -2
- package/dist/index.d.ts +223 -0
- package/dist/index.js +678 -0
- package/dist/styles.css +59 -0
- package/dist/tokens.css +231 -0
- package/dist/tokens.json +677 -0
- package/package.json +51 -4
package/README.md
CHANGED
|
@@ -1,3 +1,67 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @sole-ui/react
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
Sole's design system. This first release (0.1.0) holds the design tokens: colour, label hues, type scale, radius, elevation and motion, copied from Sole HQ's stylesheet. The components come in later versions.
|
|
4
|
+
|
|
5
|
+
Light mode and desktop only.
|
|
6
|
+
|
|
7
|
+
Documentation and a live view of every token: https://mindninjax.github.io/sole-design-system/
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm install @sole-ui/react
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## With Tailwind CSS v4
|
|
16
|
+
|
|
17
|
+
Tailwind v4 is an optional peer dependency (`^4.1.0`). In your main stylesheet:
|
|
18
|
+
|
|
19
|
+
```css
|
|
20
|
+
@import "tailwindcss";
|
|
21
|
+
@import "@sole-ui/react/styles.css";
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
That gives you:
|
|
25
|
+
|
|
26
|
+
- the Sole colours as utilities (`bg-primary`, `text-muted-foreground`, `border-border`), the label hues (`.hue-blue` with `bg-tag-bg`, `text-tag-fg`) and the radius, shadow and type scales (`text-body`, `text-strong`, `text-micro`);
|
|
27
|
+
- Inter Variable as the sans font, through `@fontsource-variable/inter`, which installs with the package;
|
|
28
|
+
- the base layer: page background and text colour, tabular numbers on `time` and `kbd`, and no motion for people who asked their system for less.
|
|
29
|
+
|
|
30
|
+
## Without Tailwind
|
|
31
|
+
|
|
32
|
+
`tokens.css` is plain CSS custom properties on `:root`, plus the `.hue-*` classes. It works in any project:
|
|
33
|
+
|
|
34
|
+
```css
|
|
35
|
+
@import "@sole-ui/react/tokens.css";
|
|
36
|
+
|
|
37
|
+
.card {
|
|
38
|
+
background: var(--card);
|
|
39
|
+
border: 1px solid var(--border);
|
|
40
|
+
border-radius: var(--radius);
|
|
41
|
+
box-shadow: var(--elevation-sm);
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
(The `@theme` and `@utility` blocks in the file are for Tailwind. Other tools ignore them.)
|
|
46
|
+
|
|
47
|
+
## In JavaScript
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
import { tokens } from "@sole-ui/react";
|
|
51
|
+
|
|
52
|
+
tokens.color.primary.$value; // "#0270d6"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`tokens` is the token tree as a plain object, typed so that `tokens.color.primary` is checked by the compiler.
|
|
56
|
+
|
|
57
|
+
## tokens.json
|
|
58
|
+
|
|
59
|
+
`@sole-ui/react/tokens.json` is the same tree in the [DTCG](https://www.designtokens.org/) format (`$value`, `$type`, `$description`), for design tools and other generators:
|
|
60
|
+
|
|
61
|
+
```js
|
|
62
|
+
import tokens from "@sole-ui/react/tokens.json" with { type: "json" };
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Source
|
|
66
|
+
|
|
67
|
+
https://github.com/mindninjaX/sole-design-system. The values never change here first: if the look changes, it changes in Sole HQ, and the tokens follow.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/* Generated by packages/ui/scripts/build.ts. Do not edit. */
|
|
2
|
+
|
|
3
|
+
export type TokenType = 'color' | 'dimension' | 'fontFamily' | 'shadow' | 'cubicBezier' | 'number';
|
|
4
|
+
|
|
5
|
+
/** One design token in the DTCG shape. */
|
|
6
|
+
export interface Token {
|
|
7
|
+
readonly $value: string;
|
|
8
|
+
readonly $type: TokenType;
|
|
9
|
+
readonly $description?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** Sole's design tokens, the same tree as tokens.json. */
|
|
13
|
+
export declare const tokens: {
|
|
14
|
+
readonly color: {
|
|
15
|
+
readonly background: Token;
|
|
16
|
+
readonly foreground: Token;
|
|
17
|
+
readonly card: Token;
|
|
18
|
+
readonly "card-foreground": Token;
|
|
19
|
+
readonly popover: Token;
|
|
20
|
+
readonly "popover-foreground": Token;
|
|
21
|
+
readonly primary: Token;
|
|
22
|
+
readonly "primary-foreground": Token;
|
|
23
|
+
readonly "primary-hover": Token;
|
|
24
|
+
readonly brand: Token;
|
|
25
|
+
readonly link: Token;
|
|
26
|
+
readonly secondary: Token;
|
|
27
|
+
readonly "secondary-foreground": Token;
|
|
28
|
+
readonly muted: Token;
|
|
29
|
+
readonly "muted-foreground": Token;
|
|
30
|
+
readonly "subtle-foreground": Token;
|
|
31
|
+
readonly faint: Token;
|
|
32
|
+
readonly accent: Token;
|
|
33
|
+
readonly "accent-foreground": Token;
|
|
34
|
+
readonly "row-hover": Token;
|
|
35
|
+
readonly border: Token;
|
|
36
|
+
readonly hairline: Token;
|
|
37
|
+
readonly input: Token;
|
|
38
|
+
readonly field: Token;
|
|
39
|
+
readonly ring: Token;
|
|
40
|
+
readonly destructive: Token;
|
|
41
|
+
readonly "destructive-foreground": Token;
|
|
42
|
+
readonly "danger-text": Token;
|
|
43
|
+
readonly "danger-soft": Token;
|
|
44
|
+
readonly "danger-border": Token;
|
|
45
|
+
readonly warning: Token;
|
|
46
|
+
readonly "warning-text": Token;
|
|
47
|
+
readonly "warning-soft": Token;
|
|
48
|
+
readonly "warning-border": Token;
|
|
49
|
+
readonly success: Token;
|
|
50
|
+
readonly "success-text": Token;
|
|
51
|
+
readonly "success-soft": Token;
|
|
52
|
+
readonly "success-border": Token;
|
|
53
|
+
readonly "neutral-soft": Token;
|
|
54
|
+
readonly "neutral-text": Token;
|
|
55
|
+
readonly skeleton: Token;
|
|
56
|
+
readonly sidebar: Token;
|
|
57
|
+
readonly "sidebar-foreground": Token;
|
|
58
|
+
readonly "sidebar-accent": Token;
|
|
59
|
+
readonly "sidebar-accent-foreground": Token;
|
|
60
|
+
readonly "sidebar-hover": Token;
|
|
61
|
+
readonly "sidebar-border": Token;
|
|
62
|
+
readonly "sidebar-ring": Token;
|
|
63
|
+
readonly tooltip: Token;
|
|
64
|
+
readonly "tooltip-foreground": Token;
|
|
65
|
+
readonly overdue: Token;
|
|
66
|
+
readonly "overdue-foreground": Token;
|
|
67
|
+
readonly mark: Token;
|
|
68
|
+
readonly "state-backlog": Token;
|
|
69
|
+
readonly "state-unstarted": Token;
|
|
70
|
+
readonly "state-started": Token;
|
|
71
|
+
readonly "state-completed": Token;
|
|
72
|
+
readonly "state-cancelled": Token;
|
|
73
|
+
readonly "sticky-gray": Token;
|
|
74
|
+
readonly "sticky-peach": Token;
|
|
75
|
+
readonly "sticky-pink": Token;
|
|
76
|
+
readonly "sticky-orange": Token;
|
|
77
|
+
readonly "sticky-green": Token;
|
|
78
|
+
readonly "sticky-light-blue": Token;
|
|
79
|
+
readonly "sticky-dark-blue": Token;
|
|
80
|
+
readonly "sticky-purple": Token;
|
|
81
|
+
readonly "sticky-foreground": Token;
|
|
82
|
+
};
|
|
83
|
+
readonly hue: {
|
|
84
|
+
readonly slate: {
|
|
85
|
+
readonly bg: Token;
|
|
86
|
+
readonly border: Token;
|
|
87
|
+
readonly fg: Token;
|
|
88
|
+
readonly dot: Token;
|
|
89
|
+
};
|
|
90
|
+
readonly indigo: {
|
|
91
|
+
readonly bg: Token;
|
|
92
|
+
readonly border: Token;
|
|
93
|
+
readonly fg: Token;
|
|
94
|
+
readonly dot: Token;
|
|
95
|
+
};
|
|
96
|
+
readonly violet: {
|
|
97
|
+
readonly bg: Token;
|
|
98
|
+
readonly border: Token;
|
|
99
|
+
readonly fg: Token;
|
|
100
|
+
readonly dot: Token;
|
|
101
|
+
};
|
|
102
|
+
readonly blue: {
|
|
103
|
+
readonly bg: Token;
|
|
104
|
+
readonly border: Token;
|
|
105
|
+
readonly fg: Token;
|
|
106
|
+
readonly dot: Token;
|
|
107
|
+
};
|
|
108
|
+
readonly cyan: {
|
|
109
|
+
readonly bg: Token;
|
|
110
|
+
readonly border: Token;
|
|
111
|
+
readonly fg: Token;
|
|
112
|
+
readonly dot: Token;
|
|
113
|
+
};
|
|
114
|
+
readonly teal: {
|
|
115
|
+
readonly bg: Token;
|
|
116
|
+
readonly border: Token;
|
|
117
|
+
readonly fg: Token;
|
|
118
|
+
readonly dot: Token;
|
|
119
|
+
};
|
|
120
|
+
readonly green: {
|
|
121
|
+
readonly bg: Token;
|
|
122
|
+
readonly border: Token;
|
|
123
|
+
readonly fg: Token;
|
|
124
|
+
readonly dot: Token;
|
|
125
|
+
};
|
|
126
|
+
readonly lime: {
|
|
127
|
+
readonly bg: Token;
|
|
128
|
+
readonly border: Token;
|
|
129
|
+
readonly fg: Token;
|
|
130
|
+
readonly dot: Token;
|
|
131
|
+
};
|
|
132
|
+
readonly amber: {
|
|
133
|
+
readonly bg: Token;
|
|
134
|
+
readonly border: Token;
|
|
135
|
+
readonly fg: Token;
|
|
136
|
+
readonly dot: Token;
|
|
137
|
+
};
|
|
138
|
+
readonly orange: {
|
|
139
|
+
readonly bg: Token;
|
|
140
|
+
readonly border: Token;
|
|
141
|
+
readonly fg: Token;
|
|
142
|
+
readonly dot: Token;
|
|
143
|
+
};
|
|
144
|
+
readonly rose: {
|
|
145
|
+
readonly bg: Token;
|
|
146
|
+
readonly border: Token;
|
|
147
|
+
readonly fg: Token;
|
|
148
|
+
readonly dot: Token;
|
|
149
|
+
};
|
|
150
|
+
readonly pink: {
|
|
151
|
+
readonly bg: Token;
|
|
152
|
+
readonly border: Token;
|
|
153
|
+
readonly fg: Token;
|
|
154
|
+
readonly dot: Token;
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
readonly radius: {
|
|
158
|
+
readonly base: Token;
|
|
159
|
+
};
|
|
160
|
+
readonly shadow: {
|
|
161
|
+
readonly "elevation-sm": Token;
|
|
162
|
+
readonly "elevation-lg": Token;
|
|
163
|
+
readonly "focus-ring": Token;
|
|
164
|
+
};
|
|
165
|
+
readonly ease: {
|
|
166
|
+
readonly rise: Token;
|
|
167
|
+
};
|
|
168
|
+
readonly font: {
|
|
169
|
+
readonly sans: Token;
|
|
170
|
+
readonly mono: Token;
|
|
171
|
+
};
|
|
172
|
+
readonly text: {
|
|
173
|
+
readonly label: {
|
|
174
|
+
readonly size: Token;
|
|
175
|
+
readonly "line-height": Token;
|
|
176
|
+
readonly weight: Token;
|
|
177
|
+
};
|
|
178
|
+
readonly body: {
|
|
179
|
+
readonly size: Token;
|
|
180
|
+
readonly "line-height": Token;
|
|
181
|
+
};
|
|
182
|
+
readonly strong: {
|
|
183
|
+
readonly size: Token;
|
|
184
|
+
readonly "line-height": Token;
|
|
185
|
+
readonly weight: Token;
|
|
186
|
+
readonly "letter-spacing": Token;
|
|
187
|
+
};
|
|
188
|
+
readonly read: {
|
|
189
|
+
readonly size: Token;
|
|
190
|
+
readonly "line-height": Token;
|
|
191
|
+
};
|
|
192
|
+
readonly title: {
|
|
193
|
+
readonly size: Token;
|
|
194
|
+
readonly "line-height": Token;
|
|
195
|
+
readonly weight: Token;
|
|
196
|
+
readonly "letter-spacing": Token;
|
|
197
|
+
};
|
|
198
|
+
readonly page: {
|
|
199
|
+
readonly size: Token;
|
|
200
|
+
readonly "line-height": Token;
|
|
201
|
+
readonly weight: Token;
|
|
202
|
+
readonly "letter-spacing": Token;
|
|
203
|
+
};
|
|
204
|
+
readonly doc: {
|
|
205
|
+
readonly size: Token;
|
|
206
|
+
readonly "line-height": Token;
|
|
207
|
+
readonly weight: Token;
|
|
208
|
+
readonly "letter-spacing": Token;
|
|
209
|
+
};
|
|
210
|
+
readonly metric: {
|
|
211
|
+
readonly size: Token;
|
|
212
|
+
readonly "line-height": Token;
|
|
213
|
+
readonly weight: Token;
|
|
214
|
+
readonly "letter-spacing": Token;
|
|
215
|
+
};
|
|
216
|
+
readonly micro: {
|
|
217
|
+
readonly size: Token;
|
|
218
|
+
readonly "line-height": Token;
|
|
219
|
+
readonly weight: Token;
|
|
220
|
+
readonly "letter-spacing": Token;
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
};
|