syntra-ui 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.
Files changed (45) hide show
  1. package/README.md +73 -0
  2. package/dist/components/button/Button.d.ts +19 -0
  3. package/dist/components/button/button.styles.d.ts +9 -0
  4. package/dist/components/button/index.d.ts +3 -0
  5. package/dist/components/index.d.ts +6 -0
  6. package/dist/components/input/Input.d.ts +18 -0
  7. package/dist/components/input/index.d.ts +3 -0
  8. package/dist/components/input/input.styles.d.ts +8 -0
  9. package/dist/components/spinner/Spinner.d.ts +13 -0
  10. package/dist/components/spinner/index.d.ts +2 -0
  11. package/dist/defaults/borders.d.ts +2 -0
  12. package/dist/defaults/colors.d.ts +3 -0
  13. package/dist/defaults/shadows.d.ts +3 -0
  14. package/dist/defaults/spacing.d.ts +2 -0
  15. package/dist/defaults/theme.d.ts +3 -0
  16. package/dist/defaults/transitions.d.ts +2 -0
  17. package/dist/defaults/typography.d.ts +2 -0
  18. package/dist/hooks/useSyntra.d.ts +2 -0
  19. package/dist/hooks/useSyntraMode.d.ts +2 -0
  20. package/dist/index.d.ts +15 -0
  21. package/dist/primitives/Box.d.ts +10 -0
  22. package/dist/primitives/Divider.d.ts +14 -0
  23. package/dist/primitives/Flex.d.ts +18 -0
  24. package/dist/primitives/Grid.d.ts +19 -0
  25. package/dist/primitives/Heading.d.ts +15 -0
  26. package/dist/primitives/Stack.d.ts +15 -0
  27. package/dist/primitives/Text.d.ts +19 -0
  28. package/dist/primitives/VisuallyHidden.d.ts +9 -0
  29. package/dist/primitives/index.d.ts +19 -0
  30. package/dist/primitives/polymorphic.d.ts +13 -0
  31. package/dist/primitives/style-props.d.ts +75 -0
  32. package/dist/provider/SyntraContext.d.ts +2 -0
  33. package/dist/provider/SyntraProvider.d.ts +10 -0
  34. package/dist/provider/cssVars.d.ts +6 -0
  35. package/dist/syntra-ui.cjs +135 -0
  36. package/dist/syntra-ui.mjs +1541 -0
  37. package/dist/types.d.ts +176 -0
  38. package/dist/utils/cn.d.ts +3 -0
  39. package/dist/utils/colorScale.d.ts +10 -0
  40. package/dist/utils/createSyntraTheme.d.ts +2 -0
  41. package/dist/utils/deepMerge.d.ts +1 -0
  42. package/dist/utils/use-styles.d.ts +1 -0
  43. package/dist/utils/use-syntra-context.d.ts +1 -0
  44. package/dist/vite.svg +1 -0
  45. package/package.json +55 -0
@@ -0,0 +1,176 @@
1
+ export type DeepPartial<T> = {
2
+ [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
3
+ };
4
+ export interface ColorScale {
5
+ 50: string;
6
+ 100: string;
7
+ 200: string;
8
+ 300: string;
9
+ 400: string;
10
+ 500: string;
11
+ 600: string;
12
+ 700: string;
13
+ 800: string;
14
+ 900: string;
15
+ 950: string;
16
+ }
17
+ export interface GrayScale extends ColorScale {
18
+ 25: string;
19
+ }
20
+ export interface SemanticColor {
21
+ default: string;
22
+ emphasis: string;
23
+ muted: string;
24
+ subtle: string;
25
+ }
26
+ export type ColorInput = string | Partial<ColorScale>;
27
+ export interface SyntraColors {
28
+ primary: ColorScale;
29
+ gray: GrayScale;
30
+ red: ColorScale;
31
+ orange: ColorScale;
32
+ yellow: ColorScale;
33
+ green: ColorScale;
34
+ teal: ColorScale;
35
+ blue: ColorScale;
36
+ indigo: ColorScale;
37
+ purple: ColorScale;
38
+ pink: ColorScale;
39
+ background: SemanticColor;
40
+ foreground: SemanticColor;
41
+ border: SemanticColor;
42
+ }
43
+ export interface SyntraTypography {
44
+ fontFamily: {
45
+ sans: string;
46
+ mono: string;
47
+ };
48
+ fontSize: {
49
+ '2xs': string;
50
+ xs: string;
51
+ sm: string;
52
+ base: string;
53
+ md: string;
54
+ lg: string;
55
+ xl: string;
56
+ '2xl': string;
57
+ '3xl': string;
58
+ '4xl': string;
59
+ };
60
+ fontWeight: {
61
+ regular: number;
62
+ medium: number;
63
+ semibold: number;
64
+ bold: number;
65
+ };
66
+ lineHeight: {
67
+ tight: string;
68
+ normal: string;
69
+ relaxed: string;
70
+ };
71
+ letterSpacing: {
72
+ tight: string;
73
+ normal: string;
74
+ wide: string;
75
+ };
76
+ }
77
+ export interface SyntraSpacing {
78
+ px: string;
79
+ 0: string;
80
+ 0.5: string;
81
+ 1: string;
82
+ 1.5: string;
83
+ 2: string;
84
+ 2.5: string;
85
+ 3: string;
86
+ 4: string;
87
+ 5: string;
88
+ 6: string;
89
+ 8: string;
90
+ 10: string;
91
+ 12: string;
92
+ 16: string;
93
+ 20: string;
94
+ 24: string;
95
+ }
96
+ export interface SyntraBorderRadius {
97
+ none: string;
98
+ xs: string;
99
+ sm: string;
100
+ md: string;
101
+ lg: string;
102
+ xl: string;
103
+ '2xl': string;
104
+ full: string;
105
+ }
106
+ export interface SyntraShadows {
107
+ none: string;
108
+ xs: string;
109
+ sm: string;
110
+ md: string;
111
+ lg: string;
112
+ xl: string;
113
+ '2xl': string;
114
+ }
115
+ export interface SyntraTransitions {
116
+ duration: {
117
+ fast: string;
118
+ normal: string;
119
+ slow: string;
120
+ slower: string;
121
+ };
122
+ easing: {
123
+ default: string;
124
+ in: string;
125
+ out: string;
126
+ inOut: string;
127
+ spring: string;
128
+ };
129
+ }
130
+ export interface SyntraTheme {
131
+ colors: SyntraColors;
132
+ typography: SyntraTypography;
133
+ spacing: SyntraSpacing;
134
+ borderRadius: SyntraBorderRadius;
135
+ shadows: SyntraShadows;
136
+ transitions: SyntraTransitions;
137
+ }
138
+ export type SyntraMode = 'light' | 'dark' | 'system';
139
+ export type ResolvedMode = 'light' | 'dark';
140
+ export interface SyntraColorsInput {
141
+ primary?: ColorInput;
142
+ gray?: ColorInput;
143
+ red?: ColorInput;
144
+ orange?: ColorInput;
145
+ yellow?: ColorInput;
146
+ green?: ColorInput;
147
+ teal?: ColorInput;
148
+ blue?: ColorInput;
149
+ indigo?: ColorInput;
150
+ purple?: ColorInput;
151
+ pink?: ColorInput;
152
+ background?: Partial<SemanticColor>;
153
+ foreground?: Partial<SemanticColor>;
154
+ border?: Partial<SemanticColor>;
155
+ }
156
+ export interface SyntraThemeInput {
157
+ colors?: SyntraColorsInput;
158
+ typography?: DeepPartial<SyntraTypography>;
159
+ spacing?: Partial<SyntraSpacing>;
160
+ borderRadius?: Partial<SyntraBorderRadius>;
161
+ shadows?: Partial<SyntraShadows>;
162
+ transitions?: DeepPartial<SyntraTransitions>;
163
+ }
164
+ export interface SyntraConfigInput {
165
+ theme?: SyntraThemeInput;
166
+ darkTheme?: SyntraThemeInput;
167
+ mode?: SyntraMode;
168
+ cssVarPrefix?: string;
169
+ }
170
+ export interface SyntraContextValue {
171
+ theme: SyntraTheme;
172
+ mode: SyntraMode;
173
+ resolvedMode: ResolvedMode;
174
+ setMode: (mode: SyntraMode) => void;
175
+ cssVarPrefix: string;
176
+ }
@@ -0,0 +1,3 @@
1
+ type ClassValue = string | number | boolean | null | undefined | ClassValue[];
2
+ export declare function cn(...inputs: ClassValue[]): string;
3
+ export {};
@@ -0,0 +1,10 @@
1
+ import { ColorScale } from '../types';
2
+ interface HSL {
3
+ h: number;
4
+ s: number;
5
+ l: number;
6
+ }
7
+ export declare function hexToHsl(hex: string): HSL;
8
+ export declare function hslToHex(hsl: HSL): string;
9
+ export declare function generateColorScale(hex: string): ColorScale;
10
+ export {};
@@ -0,0 +1,2 @@
1
+ import { SyntraTheme, SyntraThemeInput } from '../types';
2
+ export declare function createSyntraTheme(input?: SyntraThemeInput, base?: 'light' | 'dark'): SyntraTheme;
@@ -0,0 +1 @@
1
+ export declare function deepMerge<T extends Record<string, unknown>>(target: T, ...sources: Partial<T>[]): T;
@@ -0,0 +1 @@
1
+ export declare function useStyles(id: string, css: string): void;
@@ -0,0 +1 @@
1
+ export declare function useSyntraContext(): string;
package/dist/vite.svg ADDED
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "syntra-ui",
3
+ "version": "0.1.0",
4
+ "description": "A lightweight, themeable React UI component library with design tokens and CSS variables",
5
+ "license": "MIT",
6
+ "author": "sherzod-uralov",
7
+ "keywords": ["react", "ui", "components", "design-system", "css-variables", "themeable"],
8
+ "type": "module",
9
+ "main": "dist/syntra-ui.cjs",
10
+ "module": "dist/syntra-ui.mjs",
11
+ "types": "dist/index.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "import": {
15
+ "types": "./dist/index.d.ts",
16
+ "default": "./dist/syntra-ui.mjs"
17
+ },
18
+ "require": {
19
+ "types": "./dist/index.d.ts",
20
+ "default": "./dist/syntra-ui.cjs"
21
+ }
22
+ }
23
+ },
24
+ "files": [
25
+ "dist"
26
+ ],
27
+ "sideEffects": false,
28
+ "scripts": {
29
+ "dev": "vite",
30
+ "build": "tsc -b && vite build",
31
+ "lint": "eslint .",
32
+ "preview": "vite preview"
33
+ },
34
+ "peerDependencies": {
35
+ "react": "^18.0.0 || ^19.0.0",
36
+ "react-dom": "^18.0.0 || ^19.0.0"
37
+ },
38
+ "devDependencies": {
39
+ "@eslint/js": "^9.39.1",
40
+ "@types/node": "^24.10.1",
41
+ "@types/react": "^19.2.7",
42
+ "@types/react-dom": "^19.2.3",
43
+ "@vitejs/plugin-react": "^5.1.1",
44
+ "eslint": "^9.39.1",
45
+ "eslint-plugin-react-hooks": "^7.0.1",
46
+ "eslint-plugin-react-refresh": "^0.4.24",
47
+ "globals": "^16.5.0",
48
+ "react": "^19.2.0",
49
+ "react-dom": "^19.2.0",
50
+ "typescript": "~5.9.3",
51
+ "typescript-eslint": "^8.48.0",
52
+ "vite": "^7.3.1",
53
+ "vite-plugin-dts": "^4.5.4"
54
+ }
55
+ }