@rainersoft/design-tokens 1.0.3 → 1.0.5
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 +550 -544
- package/dist/index.d.ts +315 -25
- package/dist/index.mjs +1 -1115
- package/dist/index.mjs.map +1 -1
- package/formats/tailwind.config.ts +4 -3
- package/formats/tokens.json +2 -2
- package/package.json +32 -32
- package/tokens/utilities.ts +114 -8
- package/dist/index.cjs +0 -1190
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -5853
package/tokens/utilities.ts
CHANGED
|
@@ -41,14 +41,14 @@
|
|
|
41
41
|
* ```
|
|
42
42
|
*/
|
|
43
43
|
export const GRADIENT_DIRECTIONS = {
|
|
44
|
-
TO_TOP: 'bg-
|
|
45
|
-
TO_BOTTOM: 'bg-
|
|
46
|
-
TO_LEFT: 'bg-
|
|
47
|
-
TO_RIGHT: 'bg-
|
|
48
|
-
TO_TL: 'bg-
|
|
49
|
-
TO_TR: 'bg-
|
|
50
|
-
TO_BL: 'bg-
|
|
51
|
-
TO_BR: 'bg-
|
|
44
|
+
TO_TOP: 'bg-linear-to-t',
|
|
45
|
+
TO_BOTTOM: 'bg-linear-to-b',
|
|
46
|
+
TO_LEFT: 'bg-linear-to-l',
|
|
47
|
+
TO_RIGHT: 'bg-linear-to-r',
|
|
48
|
+
TO_TL: 'bg-linear-to-tl',
|
|
49
|
+
TO_TR: 'bg-linear-to-tr',
|
|
50
|
+
TO_BL: 'bg-linear-to-bl',
|
|
51
|
+
TO_BR: 'bg-linear-to-br',
|
|
52
52
|
} as const;
|
|
53
53
|
|
|
54
54
|
/**
|
|
@@ -129,6 +129,94 @@ export const GRADIENTS = {
|
|
|
129
129
|
* </div>
|
|
130
130
|
* ```
|
|
131
131
|
*/
|
|
132
|
+
/**
|
|
133
|
+
* Gradientes compostos - Direção + Cores (Padrão Enterprise)
|
|
134
|
+
*
|
|
135
|
+
* @description
|
|
136
|
+
* Combina direção e cores em um único token para uso direto.
|
|
137
|
+
* Elimina necessidade de concatenar strings manualmente.
|
|
138
|
+
* Padrão usado por grandes empresas (Google Material, Microsoft Fluent, Shopify Polaris).
|
|
139
|
+
*
|
|
140
|
+
* @type {Object}
|
|
141
|
+
* @property {string} HORIZONTAL_PRIMARY - Gradiente horizontal com cores primárias
|
|
142
|
+
* @property {string} HORIZONTAL_SECONDARY - Gradiente horizontal com cores secundárias
|
|
143
|
+
* @property {string} HORIZONTAL_DECORATIVE - Gradiente horizontal decorativo
|
|
144
|
+
* @property {string} VERTICAL_PRIMARY - Gradiente vertical com cores primárias
|
|
145
|
+
* @property {string} VERTICAL_SECONDARY - Gradiente vertical com cores secundárias
|
|
146
|
+
* @property {string} DIAGONAL_PRIMARY - Gradiente diagonal com cores primárias
|
|
147
|
+
* @property {string} DIAGONAL_SECONDARY - Gradiente diagonal com cores secundárias
|
|
148
|
+
*
|
|
149
|
+
* @constant
|
|
150
|
+
* @readonly
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* ```typescript
|
|
154
|
+
* import { GRADIENT_COMPOSITES } from '@rainersoft/design-tokens';
|
|
155
|
+
*
|
|
156
|
+
* // Usar diretamente sem concatenar
|
|
157
|
+
* <div className={GRADIENT_COMPOSITES.HORIZONTAL_PRIMARY}>
|
|
158
|
+
* Conteúdo
|
|
159
|
+
* </div>
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
export const GRADIENT_COMPOSITES = {
|
|
163
|
+
// Gradientes horizontais (left-to-right)
|
|
164
|
+
HORIZONTAL_PRIMARY: `${GRADIENT_DIRECTIONS.TO_RIGHT} ${GRADIENTS.BUTTON_CYAN_BLUE}`,
|
|
165
|
+
HORIZONTAL_SECONDARY: `${GRADIENT_DIRECTIONS.TO_RIGHT} ${GRADIENTS.BUTTON_PURPLE_PINK}`,
|
|
166
|
+
HORIZONTAL_DECORATIVE: `${GRADIENT_DIRECTIONS.TO_RIGHT} ${GRADIENTS.DECORATIVE_PRIMARY}`,
|
|
167
|
+
HORIZONTAL_CYAN_PURPLE: `${GRADIENT_DIRECTIONS.TO_RIGHT} ${GRADIENTS.DECORATIVE_CYAN_PURPLE}`,
|
|
168
|
+
|
|
169
|
+
// Gradientes verticais (top-to-bottom)
|
|
170
|
+
VERTICAL_PRIMARY: `${GRADIENT_DIRECTIONS.TO_BOTTOM} ${GRADIENTS.BUTTON_CYAN_BLUE}`,
|
|
171
|
+
VERTICAL_SECONDARY: `${GRADIENT_DIRECTIONS.TO_BOTTOM} ${GRADIENTS.BUTTON_PURPLE_PINK}`,
|
|
172
|
+
VERTICAL_DECORATIVE: `${GRADIENT_DIRECTIONS.TO_BOTTOM} ${GRADIENTS.DECORATIVE_PRIMARY}`,
|
|
173
|
+
|
|
174
|
+
// Gradientes diagonais
|
|
175
|
+
DIAGONAL_PRIMARY: `${GRADIENT_DIRECTIONS.TO_BR} ${GRADIENTS.DECORATIVE_PRIMARY}`,
|
|
176
|
+
DIAGONAL_SECONDARY: `${GRADIENT_DIRECTIONS.TO_BR} ${GRADIENTS.DECORATIVE_CYAN_PURPLE}`,
|
|
177
|
+
DIAGONAL_GREEN_EMERALD: `${GRADIENT_DIRECTIONS.TO_BR} ${GRADIENTS.DECORATIVE_GREEN_EMERALD}`,
|
|
178
|
+
} as const;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Gradientes de cores específicas usando tokens de cor
|
|
182
|
+
*
|
|
183
|
+
* @description
|
|
184
|
+
* Elimina valores hardcoded como "from-gray-500". Todos os gradientes
|
|
185
|
+
* usam tokens de cor do sistema para garantir consistência.
|
|
186
|
+
*
|
|
187
|
+
* @type {Object}
|
|
188
|
+
* @property {string} GRAY_SCALE - Gradiente em escala de cinza usando tokens
|
|
189
|
+
* @property {string} BLUE_SCALE - Gradiente em escala de azul usando tokens primários
|
|
190
|
+
* @property {string} SUCCESS_SCALE - Gradiente em escala de verde (sucesso) usando tokens
|
|
191
|
+
* @property {string} TEXT_MUTED - Gradiente para texto muted usando tokens
|
|
192
|
+
*
|
|
193
|
+
* @constant
|
|
194
|
+
* @readonly
|
|
195
|
+
*
|
|
196
|
+
* @example
|
|
197
|
+
* ```typescript
|
|
198
|
+
* import { GRADIENT_COLORS } from '@rainersoft/design-tokens';
|
|
199
|
+
*
|
|
200
|
+
* // Usar gradiente de cinza sem valores hardcoded
|
|
201
|
+
* <div className={GRADIENT_COLORS.GRAY_SCALE}>
|
|
202
|
+
* Conteúdo
|
|
203
|
+
* </div>
|
|
204
|
+
* ```
|
|
205
|
+
*/
|
|
206
|
+
export const GRADIENT_COLORS = {
|
|
207
|
+
// Escala de cinza usando tokens de texto
|
|
208
|
+
GRAY_SCALE: `${GRADIENT_DIRECTIONS.TO_RIGHT} from-[var(--color-text-tertiary)] to-[var(--color-text-secondary)]`,
|
|
209
|
+
|
|
210
|
+
// Escala de azul usando tokens primários
|
|
211
|
+
BLUE_SCALE: `${GRADIENT_DIRECTIONS.TO_RIGHT} from-[var(--color-primary-base)] to-[var(--color-primary-hover)]`,
|
|
212
|
+
|
|
213
|
+
// Escala de verde (sucesso) usando tokens de status
|
|
214
|
+
SUCCESS_SCALE: `${GRADIENT_DIRECTIONS.TO_RIGHT} from-[var(--color-status-success)] to-[var(--color-status-success-hover)]`,
|
|
215
|
+
|
|
216
|
+
// Gradiente para texto muted
|
|
217
|
+
TEXT_MUTED: `${GRADIENT_DIRECTIONS.TO_RIGHT} from-[var(--color-text-tertiary)] to-[var(--color-text-secondary)]`,
|
|
218
|
+
} as const;
|
|
219
|
+
|
|
132
220
|
export const BACKGROUND = {
|
|
133
221
|
// Background completo usando token CSS
|
|
134
222
|
FULL: 'bg-[var(--color-background-primary)]',
|
|
@@ -166,6 +254,24 @@ export type GradientDirections = typeof GRADIENT_DIRECTIONS;
|
|
|
166
254
|
*/
|
|
167
255
|
export type Gradients = typeof GRADIENTS;
|
|
168
256
|
|
|
257
|
+
/**
|
|
258
|
+
* Tipo TypeScript para gradientes compostos
|
|
259
|
+
*
|
|
260
|
+
* @typedef {Object} GradientComposites
|
|
261
|
+
* @description
|
|
262
|
+
* Tipo que representa todos os gradientes compostos (direção + cores).
|
|
263
|
+
*/
|
|
264
|
+
export type GradientComposites = typeof GRADIENT_COMPOSITES;
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Tipo TypeScript para gradientes de cores
|
|
268
|
+
*
|
|
269
|
+
* @typedef {Object} GradientColors
|
|
270
|
+
* @description
|
|
271
|
+
* Tipo que representa todos os gradientes de cores específicas.
|
|
272
|
+
*/
|
|
273
|
+
export type GradientColors = typeof GRADIENT_COLORS;
|
|
274
|
+
|
|
169
275
|
/**
|
|
170
276
|
* Tipo TypeScript para backgrounds
|
|
171
277
|
*
|