@ronnydrori/jupiter-ui 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.
- package/README.md +483 -0
- package/dist/index.d.ts +396 -0
- package/dist/index.js +4774 -0
- package/package.json +73 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
import { ButtonProps } from '@mantine/core';
|
|
2
|
+
import { CheckboxProps } from '@mantine/core';
|
|
3
|
+
import { CSSVariablesResolver } from '@mantine/core';
|
|
4
|
+
import { default as default_2 } from 'react';
|
|
5
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
6
|
+
import { MantineColorsTuple } from '@mantine/core';
|
|
7
|
+
import { MantineTheme } from '@mantine/core';
|
|
8
|
+
import { MantineThemeOverride } from '@mantine/core';
|
|
9
|
+
import { ReactNode } from 'react';
|
|
10
|
+
import { SelectProps } from '@mantine/core';
|
|
11
|
+
import { StyledComponent } from '@emotion/styled';
|
|
12
|
+
import { TextInputProps } from '@mantine/core';
|
|
13
|
+
import { Theme } from '@emotion/react';
|
|
14
|
+
|
|
15
|
+
export declare const borderRadius: Partial<Record<TokenScaleKey, string>>;
|
|
16
|
+
|
|
17
|
+
export declare type BorderRadiusToken = keyof typeof borderRadius;
|
|
18
|
+
|
|
19
|
+
export declare const borderStyle: {
|
|
20
|
+
readonly solid: "solid";
|
|
21
|
+
readonly dashed: "dashed";
|
|
22
|
+
readonly dotted: "dotted";
|
|
23
|
+
readonly none: "none";
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export declare type BorderStyleToken = keyof typeof borderStyle;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Border tokens for the Jupiter Design System
|
|
30
|
+
* Follows Mantine's approach - borders are not theme properties in Mantine v7
|
|
31
|
+
* Use these tokens directly in your components or via the 'bd' style prop
|
|
32
|
+
*
|
|
33
|
+
* @see https://mantine.dev/styles/style-props/
|
|
34
|
+
*/
|
|
35
|
+
export declare const borderWidth: {
|
|
36
|
+
readonly none: "0";
|
|
37
|
+
readonly thin: "1px";
|
|
38
|
+
readonly base: "1px";
|
|
39
|
+
readonly medium: "2px";
|
|
40
|
+
readonly thick: "4px";
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export declare type BorderWidthToken = keyof typeof borderWidth;
|
|
44
|
+
|
|
45
|
+
export declare const breakpoints: Partial<Record<TokenScaleKey, string>>;
|
|
46
|
+
|
|
47
|
+
export declare type BreakpointToken = keyof typeof breakpoints;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Button variant mappings from Jupiter semantic variants to Mantine variants
|
|
51
|
+
*/
|
|
52
|
+
export declare const buttonVariants: Record<JupiterVariant, ButtonProps['variant']>;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Checkbox variant mappings from Jupiter semantic variants to Mantine variants
|
|
56
|
+
*/
|
|
57
|
+
export declare const checkboxVariants: Record<JupiterVariant, CheckboxProps['variant']>;
|
|
58
|
+
|
|
59
|
+
export declare const colorScaleToTuple: (scale?: Record<string | number, string>) => MantineColorsTuple;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Create Jupiter theme using only Mantine's theme structure
|
|
63
|
+
* All values come from design tokens - no hardcoded values
|
|
64
|
+
* Light/dark mode variations are handled via CSS variables
|
|
65
|
+
*/
|
|
66
|
+
export declare const createJupiterTheme: (colors: Record<string, Record<string | number, string>>) => MantineThemeOverride;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* CSS Variables resolver for light/dark mode specific values
|
|
70
|
+
* These variables will automatically switch based on the color scheme
|
|
71
|
+
*/
|
|
72
|
+
export declare const cssVariablesResolverFactory: (colors: Record<string, Record<string | number, string>>) => CSSVariablesResolver;
|
|
73
|
+
|
|
74
|
+
export declare const darkShadows: Partial<Record<TokenScaleKey, string>>;
|
|
75
|
+
|
|
76
|
+
export declare const fontFamily: {
|
|
77
|
+
readonly sans: "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif";
|
|
78
|
+
readonly serif: "Georgia, Cambria, \"Times New Roman\", Times, serif";
|
|
79
|
+
readonly mono: "Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace";
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export declare type FontFamilyToken = keyof typeof fontFamily;
|
|
83
|
+
|
|
84
|
+
export declare const fontSize: Partial<Record<TokenScaleKey, string>>;
|
|
85
|
+
|
|
86
|
+
export declare type FontSizeToken = keyof typeof fontSize;
|
|
87
|
+
|
|
88
|
+
export declare const fontWeight: {
|
|
89
|
+
readonly thin: 100;
|
|
90
|
+
readonly extralight: 200;
|
|
91
|
+
readonly light: 300;
|
|
92
|
+
readonly normal: 400;
|
|
93
|
+
readonly medium: 500;
|
|
94
|
+
readonly semibold: 600;
|
|
95
|
+
readonly bold: 700;
|
|
96
|
+
readonly extrabold: 800;
|
|
97
|
+
readonly black: 900;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export declare type FontWeightToken = keyof typeof fontWeight;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Input variant mappings from Jupiter semantic variants to Mantine variants
|
|
104
|
+
*/
|
|
105
|
+
export declare const inputVariants: Record<JupiterVariant, TextInputProps['variant']>;
|
|
106
|
+
|
|
107
|
+
export declare const JpButton: StyledComponent<Pick<Omit<JpButtonProps, "ref"> & default_2.RefAttributes<HTMLButtonElement>, "autoContrast" | "radius" | "fontWeight" | "fontSize" | "classNames" | "styles" | "vars" | "children" | "ref" | "variant" | "gradient" | "leftSection" | "rightSection" | "disabled" | "size" | "style" | "p" | "td" | "key" | "height" | "type" | "width" | "className" | "color" | "onClick" | "unstyled" | "data-disabled" | "justify" | "fullWidth" | "loading" | "loaderProps" | "__vars" | "__size" | "hiddenFrom" | "visibleFrom" | "lightHidden" | "darkHidden" | "mod" | "m" | "my" | "mx" | "mt" | "mb" | "ms" | "me" | "ml" | "mr" | "py" | "px" | "pt" | "pb" | "ps" | "pe" | "pl" | "pr" | "bd" | "bg" | "c" | "opacity" | "ff" | "fz" | "fw" | "lts" | "ta" | "lh" | "fs" | "tt" | "w" | "miw" | "maw" | "h" | "mih" | "mah" | "bgsz" | "bgp" | "bgr" | "bga" | "pos" | "top" | "left" | "bottom" | "right" | "inset" | "display" | "flex" | "padding" | "margin" | "asChild"> & {
|
|
108
|
+
theme?: Theme;
|
|
109
|
+
}, {}, {}>;
|
|
110
|
+
|
|
111
|
+
export declare interface JpButtonProps extends Omit<ButtonProps, 'variant' | 'size'> {
|
|
112
|
+
size?: BreakpointToken;
|
|
113
|
+
variant?: JupiterVariant;
|
|
114
|
+
onClick?: default_2.MouseEventHandler<HTMLButtonElement>;
|
|
115
|
+
/** Alias for fz (font size) */
|
|
116
|
+
fontSize?: ButtonProps['fz'];
|
|
117
|
+
/** Alias for fw (font weight) */
|
|
118
|
+
fontWeight?: ButtonProps['fw'];
|
|
119
|
+
/** Alias for w (width) */
|
|
120
|
+
width?: ButtonProps['w'];
|
|
121
|
+
/** Alias for h (height) */
|
|
122
|
+
height?: ButtonProps['h'];
|
|
123
|
+
/** Alias for p (padding) */
|
|
124
|
+
padding?: ButtonProps['p'];
|
|
125
|
+
/** Alias for m (margin) */
|
|
126
|
+
margin?: ButtonProps['m'];
|
|
127
|
+
/**
|
|
128
|
+
* Button type (submit, button, reset)
|
|
129
|
+
*/
|
|
130
|
+
type?: default_2.ButtonHTMLAttributes<HTMLButtonElement>['type'];
|
|
131
|
+
ref?: default_2.Ref<HTMLButtonElement>;
|
|
132
|
+
asChild?: boolean;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Jupiter theme extends MantineTheme with typed 'other' property
|
|
137
|
+
*/
|
|
138
|
+
export declare interface JupiterTheme extends MantineTheme {
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export declare const JupiterThemeProvider: ({ children, defaultMode, colors, }: JupiterThemeProviderProps) => JSX_2.Element;
|
|
142
|
+
|
|
143
|
+
export declare interface JupiterThemeProviderProps {
|
|
144
|
+
children: ReactNode;
|
|
145
|
+
defaultMode?: ThemeMode;
|
|
146
|
+
colors: Record<string, Record<string | number, string>>;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Jupiter semantic variants that describe intent
|
|
151
|
+
*/
|
|
152
|
+
export declare type JupiterVariant = 'primary' | 'secondary' | 'outline' | 'ghost';
|
|
153
|
+
|
|
154
|
+
export declare const letterSpacing: {
|
|
155
|
+
readonly tighter: "-0.05em";
|
|
156
|
+
readonly tight: "-0.025em";
|
|
157
|
+
readonly normal: "0em";
|
|
158
|
+
readonly wide: "0.025em";
|
|
159
|
+
readonly wider: "0.05em";
|
|
160
|
+
readonly widest: "0.1em";
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
export declare type LetterSpacingToken = keyof typeof letterSpacing;
|
|
164
|
+
|
|
165
|
+
export declare const lineHeight: {
|
|
166
|
+
readonly none: "1";
|
|
167
|
+
readonly tight: "1.25";
|
|
168
|
+
readonly snug: "1.375";
|
|
169
|
+
readonly normal: "1.5";
|
|
170
|
+
readonly relaxed: "1.625";
|
|
171
|
+
readonly loose: "2";
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
export declare type LineHeightToken = keyof typeof lineHeight;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Select variant mappings from Jupiter semantic variants to Mantine variants
|
|
178
|
+
*/
|
|
179
|
+
export declare const selectVariants: Record<JupiterVariant, SelectProps['variant']>;
|
|
180
|
+
|
|
181
|
+
export declare const semanticSpacing: Partial<Record<TokenScaleKey, string>>;
|
|
182
|
+
|
|
183
|
+
export declare type SemanticSpacingToken = keyof typeof semanticSpacing;
|
|
184
|
+
|
|
185
|
+
export declare const shadows: Partial<Record<TokenScaleKey, string>>;
|
|
186
|
+
|
|
187
|
+
export declare type ShadowToken = keyof typeof shadows;
|
|
188
|
+
|
|
189
|
+
export declare const spacing: {
|
|
190
|
+
readonly 0: "0px";
|
|
191
|
+
readonly 1: "4px";
|
|
192
|
+
readonly 2: "8px";
|
|
193
|
+
readonly 3: "12px";
|
|
194
|
+
readonly 4: "16px";
|
|
195
|
+
readonly 5: "20px";
|
|
196
|
+
readonly 6: "24px";
|
|
197
|
+
readonly 7: "28px";
|
|
198
|
+
readonly 8: "32px";
|
|
199
|
+
readonly 9: "36px";
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
export declare type SpacingToken = keyof typeof spacing;
|
|
203
|
+
|
|
204
|
+
export declare const textStyles: {
|
|
205
|
+
readonly h1: {
|
|
206
|
+
readonly fontSize: string | undefined;
|
|
207
|
+
readonly fontWeight: 700;
|
|
208
|
+
readonly lineHeight: "1.25";
|
|
209
|
+
readonly letterSpacing: "-0.025em";
|
|
210
|
+
};
|
|
211
|
+
readonly h2: {
|
|
212
|
+
readonly fontSize: string | undefined;
|
|
213
|
+
readonly fontWeight: 700;
|
|
214
|
+
readonly lineHeight: "1.25";
|
|
215
|
+
readonly letterSpacing: "-0.025em";
|
|
216
|
+
};
|
|
217
|
+
readonly h3: {
|
|
218
|
+
readonly fontSize: string | undefined;
|
|
219
|
+
readonly fontWeight: 600;
|
|
220
|
+
readonly lineHeight: "1.375";
|
|
221
|
+
readonly letterSpacing: "0em";
|
|
222
|
+
};
|
|
223
|
+
readonly h4: {
|
|
224
|
+
readonly fontSize: string | undefined;
|
|
225
|
+
readonly fontWeight: 600;
|
|
226
|
+
readonly lineHeight: "1.375";
|
|
227
|
+
readonly letterSpacing: "0em";
|
|
228
|
+
};
|
|
229
|
+
readonly h5: {
|
|
230
|
+
readonly fontSize: string | undefined;
|
|
231
|
+
readonly fontWeight: 600;
|
|
232
|
+
readonly lineHeight: "1.5";
|
|
233
|
+
readonly letterSpacing: "0em";
|
|
234
|
+
};
|
|
235
|
+
readonly h6: {
|
|
236
|
+
readonly fontSize: string | undefined;
|
|
237
|
+
readonly fontWeight: 600;
|
|
238
|
+
readonly lineHeight: "1.5";
|
|
239
|
+
readonly letterSpacing: "0em";
|
|
240
|
+
};
|
|
241
|
+
readonly body: {
|
|
242
|
+
readonly fontSize: string | undefined;
|
|
243
|
+
readonly fontWeight: 400;
|
|
244
|
+
readonly lineHeight: "1.5";
|
|
245
|
+
readonly letterSpacing: "0em";
|
|
246
|
+
};
|
|
247
|
+
readonly bodySmall: {
|
|
248
|
+
readonly fontSize: string | undefined;
|
|
249
|
+
readonly fontWeight: 400;
|
|
250
|
+
readonly lineHeight: "1.5";
|
|
251
|
+
readonly letterSpacing: "0em";
|
|
252
|
+
};
|
|
253
|
+
readonly caption: {
|
|
254
|
+
readonly fontSize: string | undefined;
|
|
255
|
+
readonly fontWeight: 400;
|
|
256
|
+
readonly lineHeight: "1.5";
|
|
257
|
+
readonly letterSpacing: "0.025em";
|
|
258
|
+
};
|
|
259
|
+
readonly button: {
|
|
260
|
+
readonly fontSize: string | undefined;
|
|
261
|
+
readonly fontWeight: 500;
|
|
262
|
+
readonly lineHeight: "1";
|
|
263
|
+
readonly letterSpacing: "0.025em";
|
|
264
|
+
};
|
|
265
|
+
readonly code: {
|
|
266
|
+
readonly fontFamily: "Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace";
|
|
267
|
+
readonly fontSize: string | undefined;
|
|
268
|
+
readonly fontWeight: 400;
|
|
269
|
+
readonly lineHeight: "1.5";
|
|
270
|
+
};
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
export declare type TextStyleToken = keyof typeof textStyles;
|
|
274
|
+
|
|
275
|
+
declare interface ThemeContextValue {
|
|
276
|
+
mode: ThemeMode;
|
|
277
|
+
toggleMode: () => void;
|
|
278
|
+
setMode: (mode: ThemeMode) => void;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
declare type ThemeMode = 'light' | 'dark';
|
|
282
|
+
|
|
283
|
+
declare type TokenScaleKey = 'none' | 'inner' | 'outline' | 'full' | 'xs' | 'sm' | 'md' | 'base' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl' | '9xl';
|
|
284
|
+
|
|
285
|
+
export declare function usePalette(projectName: string): {
|
|
286
|
+
primary: {
|
|
287
|
+
"50": string;
|
|
288
|
+
"100": string;
|
|
289
|
+
"200": string;
|
|
290
|
+
"300": string;
|
|
291
|
+
"400": string;
|
|
292
|
+
"500": string;
|
|
293
|
+
"600": string;
|
|
294
|
+
"700": string;
|
|
295
|
+
"800": string;
|
|
296
|
+
"900": string;
|
|
297
|
+
};
|
|
298
|
+
secondary: {
|
|
299
|
+
"50": string;
|
|
300
|
+
"100": string;
|
|
301
|
+
"200": string;
|
|
302
|
+
"300": string;
|
|
303
|
+
"400": string;
|
|
304
|
+
"500": string;
|
|
305
|
+
"600": string;
|
|
306
|
+
"700": string;
|
|
307
|
+
"800": string;
|
|
308
|
+
"900": string;
|
|
309
|
+
};
|
|
310
|
+
neutral: {
|
|
311
|
+
"50": string;
|
|
312
|
+
"100": string;
|
|
313
|
+
"200": string;
|
|
314
|
+
"300": string;
|
|
315
|
+
"400": string;
|
|
316
|
+
"500": string;
|
|
317
|
+
"600": string;
|
|
318
|
+
"700": string;
|
|
319
|
+
"800": string;
|
|
320
|
+
"900": string;
|
|
321
|
+
"950": string;
|
|
322
|
+
};
|
|
323
|
+
success: {
|
|
324
|
+
"50": string;
|
|
325
|
+
"100": string;
|
|
326
|
+
"200": string;
|
|
327
|
+
"300": string;
|
|
328
|
+
"400": string;
|
|
329
|
+
"500": string;
|
|
330
|
+
"600": string;
|
|
331
|
+
"700": string;
|
|
332
|
+
"800": string;
|
|
333
|
+
"900": string;
|
|
334
|
+
};
|
|
335
|
+
warning: {
|
|
336
|
+
"50": string;
|
|
337
|
+
"100": string;
|
|
338
|
+
"200": string;
|
|
339
|
+
"300": string;
|
|
340
|
+
"400": string;
|
|
341
|
+
"500": string;
|
|
342
|
+
"600": string;
|
|
343
|
+
"700": string;
|
|
344
|
+
"800": string;
|
|
345
|
+
"900": string;
|
|
346
|
+
};
|
|
347
|
+
error: {
|
|
348
|
+
"50": string;
|
|
349
|
+
"100": string;
|
|
350
|
+
"200": string;
|
|
351
|
+
"300": string;
|
|
352
|
+
"400": string;
|
|
353
|
+
"500": string;
|
|
354
|
+
"600": string;
|
|
355
|
+
"700": string;
|
|
356
|
+
"800": string;
|
|
357
|
+
"900": string;
|
|
358
|
+
};
|
|
359
|
+
info: {
|
|
360
|
+
"50": string;
|
|
361
|
+
"100": string;
|
|
362
|
+
"200": string;
|
|
363
|
+
"300": string;
|
|
364
|
+
"400": string;
|
|
365
|
+
"500": string;
|
|
366
|
+
"600": string;
|
|
367
|
+
"700": string;
|
|
368
|
+
"800": string;
|
|
369
|
+
"900": string;
|
|
370
|
+
};
|
|
371
|
+
general: {
|
|
372
|
+
white: string;
|
|
373
|
+
black: string;
|
|
374
|
+
transparent: string;
|
|
375
|
+
};
|
|
376
|
+
};
|
|
377
|
+
|
|
378
|
+
export declare function useThemeContext(): ThemeContextValue;
|
|
379
|
+
|
|
380
|
+
export declare const zIndex: {
|
|
381
|
+
readonly hide: -1;
|
|
382
|
+
readonly base: 0;
|
|
383
|
+
readonly dropdown: 1000;
|
|
384
|
+
readonly sticky: 1100;
|
|
385
|
+
readonly fixed: 1200;
|
|
386
|
+
readonly modalBackdrop: 1300;
|
|
387
|
+
readonly modal: 1400;
|
|
388
|
+
readonly popover: 1500;
|
|
389
|
+
readonly tooltip: 1600;
|
|
390
|
+
readonly notification: 1700;
|
|
391
|
+
readonly max: 9999;
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
export declare type ZIndexToken = keyof typeof zIndex;
|
|
395
|
+
|
|
396
|
+
export { }
|