@damarkuncoro/ui-library 0.0.1
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/LICENSE +21 -0
- package/README.md +122 -0
- package/lib/cjs/components/button/button-base.d.ts +3 -0
- package/lib/cjs/components/button/button-base.d.ts.map +1 -0
- package/lib/cjs/components/button/button-base.js +21 -0
- package/lib/cjs/components/button/button-base.js.map +1 -0
- package/lib/cjs/components/button/button-contract.d.ts +54 -0
- package/lib/cjs/components/button/button-contract.d.ts.map +1 -0
- package/lib/cjs/components/button/button-contract.js +32 -0
- package/lib/cjs/components/button/button-contract.js.map +1 -0
- package/lib/cjs/components/button/button-examples.d.ts +11 -0
- package/lib/cjs/components/button/button-examples.d.ts.map +1 -0
- package/lib/cjs/components/button/button-examples.js +67 -0
- package/lib/cjs/components/button/button-examples.js.map +1 -0
- package/lib/cjs/components/button/button-skin-contract.d.ts +133 -0
- package/lib/cjs/components/button/button-skin-contract.d.ts.map +1 -0
- package/lib/cjs/components/button/button-skin-contract.js +118 -0
- package/lib/cjs/components/button/button-skin-contract.js.map +1 -0
- package/lib/cjs/components/button/button-skin-native.d.ts +3 -0
- package/lib/cjs/components/button/button-skin-native.d.ts.map +1 -0
- package/lib/cjs/components/button/button-skin-native.js +62 -0
- package/lib/cjs/components/button/button-skin-native.js.map +1 -0
- package/lib/cjs/components/button/button-skin-tailwind.d.ts +15 -0
- package/lib/cjs/components/button/button-skin-tailwind.d.ts.map +1 -0
- package/lib/cjs/components/button/button-skin-tailwind.js +46 -0
- package/lib/cjs/components/button/button-skin-tailwind.js.map +1 -0
- package/lib/cjs/components/button/index.d.ts +8 -0
- package/lib/cjs/components/button/index.d.ts.map +1 -0
- package/lib/cjs/components/button/index.js +28 -0
- package/lib/cjs/components/button/index.js.map +1 -0
- package/lib/cjs/components/input/index.d.ts +8 -0
- package/lib/cjs/components/input/index.d.ts.map +1 -0
- package/lib/cjs/components/input/index.js +28 -0
- package/lib/cjs/components/input/index.js.map +1 -0
- package/lib/cjs/components/input/input-base.d.ts +9 -0
- package/lib/cjs/components/input/input-base.d.ts.map +1 -0
- package/lib/cjs/components/input/input-base.js +17 -0
- package/lib/cjs/components/input/input-base.js.map +1 -0
- package/lib/cjs/components/input/input-contract.d.ts +40 -0
- package/lib/cjs/components/input/input-contract.d.ts.map +1 -0
- package/lib/cjs/components/input/input-contract.js +32 -0
- package/lib/cjs/components/input/input-contract.js.map +1 -0
- package/lib/cjs/components/input/input-examples.d.ts +12 -0
- package/lib/cjs/components/input/input-examples.d.ts.map +1 -0
- package/lib/cjs/components/input/input-examples.js +67 -0
- package/lib/cjs/components/input/input-examples.js.map +1 -0
- package/lib/cjs/components/input/input-skin-contract.d.ts +93 -0
- package/lib/cjs/components/input/input-skin-contract.d.ts.map +1 -0
- package/lib/cjs/components/input/input-skin-contract.js +97 -0
- package/lib/cjs/components/input/input-skin-contract.js.map +1 -0
- package/lib/cjs/components/input/input-skin-native.d.ts +3 -0
- package/lib/cjs/components/input/input-skin-native.d.ts.map +1 -0
- package/lib/cjs/components/input/input-skin-native.js +68 -0
- package/lib/cjs/components/input/input-skin-native.js.map +1 -0
- package/lib/cjs/components/input/input-skin-tailwind.d.ts +18 -0
- package/lib/cjs/components/input/input-skin-tailwind.d.ts.map +1 -0
- package/lib/cjs/components/input/input-skin-tailwind.js +49 -0
- package/lib/cjs/components/input/input-skin-tailwind.js.map +1 -0
- package/lib/cjs/index.d.ts +4 -0
- package/lib/cjs/index.d.ts.map +1 -0
- package/lib/cjs/index.js +20 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/package.json +1 -0
- package/lib/cjs/test-setup.d.ts +2 -0
- package/lib/cjs/test-setup.d.ts.map +1 -0
- package/lib/cjs/test-setup.js +4 -0
- package/lib/cjs/test-setup.js.map +1 -0
- package/lib/cjs/theme/design-tokens.d.ts +200 -0
- package/lib/cjs/theme/design-tokens.d.ts.map +1 -0
- package/lib/cjs/theme/design-tokens.js +177 -0
- package/lib/cjs/theme/design-tokens.js.map +1 -0
- package/lib/cjs/theme/index.d.ts +3 -0
- package/lib/cjs/theme/index.d.ts.map +1 -0
- package/lib/cjs/theme/index.js +19 -0
- package/lib/cjs/theme/index.js.map +1 -0
- package/lib/cjs/theme/theme-provider.d.ts +16 -0
- package/lib/cjs/theme/theme-provider.d.ts.map +1 -0
- package/lib/cjs/theme/theme-provider.js +39 -0
- package/lib/cjs/theme/theme-provider.js.map +1 -0
- package/lib/cjs/usage-example.d.ts +2 -0
- package/lib/cjs/usage-example.d.ts.map +1 -0
- package/lib/cjs/usage-example.js +13 -0
- package/lib/cjs/usage-example.js.map +1 -0
- package/lib/esm/components/button/button-base.d.ts +3 -0
- package/lib/esm/components/button/button-base.d.ts.map +1 -0
- package/lib/esm/components/button/button-base.js +18 -0
- package/lib/esm/components/button/button-base.js.map +1 -0
- package/lib/esm/components/button/button-contract.d.ts +54 -0
- package/lib/esm/components/button/button-contract.d.ts.map +1 -0
- package/lib/esm/components/button/button-contract.js +29 -0
- package/lib/esm/components/button/button-contract.js.map +1 -0
- package/lib/esm/components/button/button-examples.d.ts +11 -0
- package/lib/esm/components/button/button-examples.d.ts.map +1 -0
- package/lib/esm/components/button/button-examples.js +52 -0
- package/lib/esm/components/button/button-examples.js.map +1 -0
- package/lib/esm/components/button/button-skin-contract.d.ts +133 -0
- package/lib/esm/components/button/button-skin-contract.d.ts.map +1 -0
- package/lib/esm/components/button/button-skin-contract.js +115 -0
- package/lib/esm/components/button/button-skin-contract.js.map +1 -0
- package/lib/esm/components/button/button-skin-native.d.ts +3 -0
- package/lib/esm/components/button/button-skin-native.d.ts.map +1 -0
- package/lib/esm/components/button/button-skin-native.js +59 -0
- package/lib/esm/components/button/button-skin-native.js.map +1 -0
- package/lib/esm/components/button/button-skin-tailwind.d.ts +15 -0
- package/lib/esm/components/button/button-skin-tailwind.d.ts.map +1 -0
- package/lib/esm/components/button/button-skin-tailwind.js +43 -0
- package/lib/esm/components/button/button-skin-tailwind.js.map +1 -0
- package/lib/esm/components/button/index.d.ts +8 -0
- package/lib/esm/components/button/index.d.ts.map +1 -0
- package/lib/esm/components/button/index.js +8 -0
- package/lib/esm/components/button/index.js.map +1 -0
- package/lib/esm/components/input/index.d.ts +8 -0
- package/lib/esm/components/input/index.d.ts.map +1 -0
- package/lib/esm/components/input/index.js +8 -0
- package/lib/esm/components/input/index.js.map +1 -0
- package/lib/esm/components/input/input-base.d.ts +9 -0
- package/lib/esm/components/input/input-base.d.ts.map +1 -0
- package/lib/esm/components/input/input-base.js +14 -0
- package/lib/esm/components/input/input-base.js.map +1 -0
- package/lib/esm/components/input/input-contract.d.ts +40 -0
- package/lib/esm/components/input/input-contract.d.ts.map +1 -0
- package/lib/esm/components/input/input-contract.js +29 -0
- package/lib/esm/components/input/input-contract.js.map +1 -0
- package/lib/esm/components/input/input-examples.d.ts +12 -0
- package/lib/esm/components/input/input-examples.d.ts.map +1 -0
- package/lib/esm/components/input/input-examples.js +51 -0
- package/lib/esm/components/input/input-examples.js.map +1 -0
- package/lib/esm/components/input/input-skin-contract.d.ts +93 -0
- package/lib/esm/components/input/input-skin-contract.d.ts.map +1 -0
- package/lib/esm/components/input/input-skin-contract.js +94 -0
- package/lib/esm/components/input/input-skin-contract.js.map +1 -0
- package/lib/esm/components/input/input-skin-native.d.ts +3 -0
- package/lib/esm/components/input/input-skin-native.d.ts.map +1 -0
- package/lib/esm/components/input/input-skin-native.js +65 -0
- package/lib/esm/components/input/input-skin-native.js.map +1 -0
- package/lib/esm/components/input/input-skin-tailwind.d.ts +18 -0
- package/lib/esm/components/input/input-skin-tailwind.d.ts.map +1 -0
- package/lib/esm/components/input/input-skin-tailwind.js +46 -0
- package/lib/esm/components/input/input-skin-tailwind.js.map +1 -0
- package/lib/esm/index.d.ts +4 -0
- package/lib/esm/index.d.ts.map +1 -0
- package/lib/esm/index.js +4 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/package.json +1 -0
- package/lib/esm/test-setup.d.ts +2 -0
- package/lib/esm/test-setup.d.ts.map +1 -0
- package/lib/esm/test-setup.js +2 -0
- package/lib/esm/test-setup.js.map +1 -0
- package/lib/esm/theme/design-tokens.d.ts +200 -0
- package/lib/esm/theme/design-tokens.d.ts.map +1 -0
- package/lib/esm/theme/design-tokens.js +174 -0
- package/lib/esm/theme/design-tokens.js.map +1 -0
- package/lib/esm/theme/index.d.ts +3 -0
- package/lib/esm/theme/index.d.ts.map +1 -0
- package/lib/esm/theme/index.js +3 -0
- package/lib/esm/theme/index.js.map +1 -0
- package/lib/esm/theme/theme-provider.d.ts +16 -0
- package/lib/esm/theme/theme-provider.d.ts.map +1 -0
- package/lib/esm/theme/theme-provider.js +34 -0
- package/lib/esm/theme/theme-provider.js.map +1 -0
- package/lib/esm/usage-example.d.ts +2 -0
- package/lib/esm/usage-example.d.ts.map +1 -0
- package/lib/esm/usage-example.js +10 -0
- package/lib/esm/usage-example.js.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
export declare const palette: {
|
|
2
|
+
readonly blue: {
|
|
3
|
+
readonly 400: "#60A5FA";
|
|
4
|
+
readonly 500: "#3B82F6";
|
|
5
|
+
readonly 600: "#2563EB";
|
|
6
|
+
readonly 700: "#1D4ED8";
|
|
7
|
+
readonly 800: "#1E40AF";
|
|
8
|
+
};
|
|
9
|
+
readonly gray: {
|
|
10
|
+
readonly 50: "#F9FAFB";
|
|
11
|
+
readonly 100: "#F3F4F6";
|
|
12
|
+
readonly 200: "#E5E7EB";
|
|
13
|
+
readonly 300: "#D1D5DB";
|
|
14
|
+
readonly 400: "#9CA3AF";
|
|
15
|
+
readonly 500: "#6B7280";
|
|
16
|
+
readonly 600: "#4B5563";
|
|
17
|
+
readonly 700: "#374151";
|
|
18
|
+
readonly 800: "#1F2937";
|
|
19
|
+
readonly 900: "#111827";
|
|
20
|
+
};
|
|
21
|
+
readonly red: {
|
|
22
|
+
readonly 400: "#F87171";
|
|
23
|
+
readonly 500: "#EF4444";
|
|
24
|
+
readonly 600: "#DC2626";
|
|
25
|
+
readonly 700: "#B91C1C";
|
|
26
|
+
readonly 900: "#7F1D1D";
|
|
27
|
+
};
|
|
28
|
+
readonly white: "#FFFFFF";
|
|
29
|
+
readonly black: "#000000";
|
|
30
|
+
readonly transparent: "transparent";
|
|
31
|
+
};
|
|
32
|
+
export declare const cssVars: {
|
|
33
|
+
readonly colors: {
|
|
34
|
+
readonly primary: {
|
|
35
|
+
readonly main: "var(--color-primary-main)";
|
|
36
|
+
readonly hover: "var(--color-primary-hover)";
|
|
37
|
+
readonly focus: "var(--color-primary-focus)";
|
|
38
|
+
readonly contrastText: "var(--color-primary-contrast)";
|
|
39
|
+
};
|
|
40
|
+
readonly secondary: {
|
|
41
|
+
readonly main: "var(--color-secondary-main)";
|
|
42
|
+
readonly hover: "var(--color-secondary-hover)";
|
|
43
|
+
readonly focus: "var(--color-secondary-focus)";
|
|
44
|
+
readonly contrastText: "var(--color-secondary-contrast)";
|
|
45
|
+
};
|
|
46
|
+
readonly danger: {
|
|
47
|
+
readonly main: "var(--color-danger-main)";
|
|
48
|
+
readonly hover: "var(--color-danger-hover)";
|
|
49
|
+
readonly focus: "var(--color-danger-focus)";
|
|
50
|
+
readonly contrastText: "var(--color-danger-contrast)";
|
|
51
|
+
};
|
|
52
|
+
readonly neutral: {
|
|
53
|
+
readonly border: "var(--color-neutral-border)";
|
|
54
|
+
readonly text: "var(--color-neutral-text)";
|
|
55
|
+
readonly textSecondary: "var(--color-neutral-text-secondary)";
|
|
56
|
+
readonly bg: "var(--color-neutral-bg)";
|
|
57
|
+
readonly bgSurface: "var(--color-neutral-bg-surface)";
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
readonly shadows: {
|
|
61
|
+
readonly focusRing: "var(--shadow-focus-ring)";
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
export declare const themes: {
|
|
65
|
+
light: {
|
|
66
|
+
'--color-primary-main': "#2563EB";
|
|
67
|
+
'--color-primary-hover': "#1D4ED8";
|
|
68
|
+
'--color-primary-focus': "#3B82F6";
|
|
69
|
+
'--color-primary-contrast': "#FFFFFF";
|
|
70
|
+
'--color-secondary-main': "#F3F4F6";
|
|
71
|
+
'--color-secondary-hover': "#E5E7EB";
|
|
72
|
+
'--color-secondary-focus': "#6B7280";
|
|
73
|
+
'--color-secondary-contrast': "#111827";
|
|
74
|
+
'--color-danger-main': "#DC2626";
|
|
75
|
+
'--color-danger-hover': "#B91C1C";
|
|
76
|
+
'--color-danger-focus': "#EF4444";
|
|
77
|
+
'--color-danger-contrast': "#FFFFFF";
|
|
78
|
+
'--color-neutral-border': "#D1D5DB";
|
|
79
|
+
'--color-neutral-text': "#374151";
|
|
80
|
+
'--color-neutral-text-secondary': "#6B7280";
|
|
81
|
+
'--color-neutral-bg': "#F9FAFB";
|
|
82
|
+
'--color-neutral-bg-surface': "#FFFFFF";
|
|
83
|
+
'--shadow-focus-ring': string;
|
|
84
|
+
};
|
|
85
|
+
dark: {
|
|
86
|
+
'--color-primary-main': "#3B82F6";
|
|
87
|
+
'--color-primary-hover': "#60A5FA";
|
|
88
|
+
'--color-primary-focus': "#2563EB";
|
|
89
|
+
'--color-primary-contrast': "#FFFFFF";
|
|
90
|
+
'--color-secondary-main': "#1F2937";
|
|
91
|
+
'--color-secondary-hover': "#374151";
|
|
92
|
+
'--color-secondary-focus': "#4B5563";
|
|
93
|
+
'--color-secondary-contrast': "#F3F4F6";
|
|
94
|
+
'--color-danger-main': "#EF4444";
|
|
95
|
+
'--color-danger-hover': "#F87171";
|
|
96
|
+
'--color-danger-focus': "#DC2626";
|
|
97
|
+
'--color-danger-contrast': "#FFFFFF";
|
|
98
|
+
'--color-neutral-border': "#4B5563";
|
|
99
|
+
'--color-neutral-text': "#F3F4F6";
|
|
100
|
+
'--color-neutral-text-secondary': "#9CA3AF";
|
|
101
|
+
'--color-neutral-bg': "#111827";
|
|
102
|
+
'--color-neutral-bg-surface': "#1F2937";
|
|
103
|
+
'--shadow-focus-ring': string;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
export declare const tokens: {
|
|
107
|
+
readonly colors: {
|
|
108
|
+
readonly transparent: "transparent";
|
|
109
|
+
readonly white: "#FFFFFF";
|
|
110
|
+
readonly black: "#000000";
|
|
111
|
+
readonly primary: {
|
|
112
|
+
readonly main: "var(--color-primary-main)";
|
|
113
|
+
readonly hover: "var(--color-primary-hover)";
|
|
114
|
+
readonly focus: "var(--color-primary-focus)";
|
|
115
|
+
readonly contrastText: "var(--color-primary-contrast)";
|
|
116
|
+
};
|
|
117
|
+
readonly secondary: {
|
|
118
|
+
readonly main: "var(--color-secondary-main)";
|
|
119
|
+
readonly hover: "var(--color-secondary-hover)";
|
|
120
|
+
readonly focus: "var(--color-secondary-focus)";
|
|
121
|
+
readonly contrastText: "var(--color-secondary-contrast)";
|
|
122
|
+
};
|
|
123
|
+
readonly danger: {
|
|
124
|
+
readonly main: "var(--color-danger-main)";
|
|
125
|
+
readonly hover: "var(--color-danger-hover)";
|
|
126
|
+
readonly focus: "var(--color-danger-focus)";
|
|
127
|
+
readonly contrastText: "var(--color-danger-contrast)";
|
|
128
|
+
};
|
|
129
|
+
readonly neutral: {
|
|
130
|
+
readonly border: "var(--color-neutral-border)";
|
|
131
|
+
readonly text: "var(--color-neutral-text)";
|
|
132
|
+
readonly textSecondary: "var(--color-neutral-text-secondary)";
|
|
133
|
+
readonly bg: "var(--color-neutral-bg)";
|
|
134
|
+
readonly bgSurface: "var(--color-neutral-bg-surface)";
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
readonly shadows: {
|
|
138
|
+
readonly focusRing: "var(--shadow-focus-ring)";
|
|
139
|
+
};
|
|
140
|
+
readonly ui: {
|
|
141
|
+
readonly outlineOffset: "2px";
|
|
142
|
+
readonly outlineWidth: "2px";
|
|
143
|
+
};
|
|
144
|
+
readonly borderRadius: {
|
|
145
|
+
readonly sm: "4px";
|
|
146
|
+
readonly md: "6px";
|
|
147
|
+
readonly lg: "8px";
|
|
148
|
+
readonly full: "9999px";
|
|
149
|
+
};
|
|
150
|
+
readonly spacing: {
|
|
151
|
+
readonly 2: "8px";
|
|
152
|
+
readonly 3: "12px";
|
|
153
|
+
readonly 4: "16px";
|
|
154
|
+
readonly 6: "24px";
|
|
155
|
+
};
|
|
156
|
+
readonly sizing: {
|
|
157
|
+
readonly 8: "32px";
|
|
158
|
+
readonly 10: "40px";
|
|
159
|
+
readonly 12: "48px";
|
|
160
|
+
readonly icon: {
|
|
161
|
+
readonly sm: "14px";
|
|
162
|
+
readonly md: "16px";
|
|
163
|
+
readonly lg: "20px";
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
readonly typography: {
|
|
167
|
+
readonly fontFamily: {
|
|
168
|
+
readonly sans: "ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif";
|
|
169
|
+
readonly mono: "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace";
|
|
170
|
+
};
|
|
171
|
+
readonly fontSize: {
|
|
172
|
+
readonly xs: "0.75rem";
|
|
173
|
+
readonly sm: "0.875rem";
|
|
174
|
+
readonly base: "1rem";
|
|
175
|
+
readonly lg: "1.125rem";
|
|
176
|
+
readonly xl: "1.25rem";
|
|
177
|
+
};
|
|
178
|
+
readonly fontWeight: {
|
|
179
|
+
readonly normal: "400";
|
|
180
|
+
readonly medium: "500";
|
|
181
|
+
readonly semibold: "600";
|
|
182
|
+
readonly bold: "700";
|
|
183
|
+
};
|
|
184
|
+
readonly lineHeight: {
|
|
185
|
+
readonly none: "1";
|
|
186
|
+
readonly tight: "1.25";
|
|
187
|
+
readonly snug: "1.375";
|
|
188
|
+
readonly normal: "1.5";
|
|
189
|
+
readonly relaxed: "1.625";
|
|
190
|
+
readonly loose: "2";
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
readonly opacity: {
|
|
194
|
+
readonly disabled: "0.5";
|
|
195
|
+
};
|
|
196
|
+
readonly transition: {
|
|
197
|
+
readonly base: "all 0.2s ease";
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
//# sourceMappingURL=design-tokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"design-tokens.d.ts","sourceRoot":"","sources":["../../../src/theme/design-tokens.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BV,CAAC;AAGX,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BV,CAAC;AAGX,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2DlB,CAAC;AAIF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuET,CAAC"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
export const palette = {
|
|
2
|
+
blue: {
|
|
3
|
+
400: '#60A5FA',
|
|
4
|
+
500: '#3B82F6',
|
|
5
|
+
600: '#2563EB',
|
|
6
|
+
700: '#1D4ED8',
|
|
7
|
+
800: '#1E40AF',
|
|
8
|
+
},
|
|
9
|
+
gray: {
|
|
10
|
+
50: '#F9FAFB',
|
|
11
|
+
100: '#F3F4F6',
|
|
12
|
+
200: '#E5E7EB',
|
|
13
|
+
300: '#D1D5DB',
|
|
14
|
+
400: '#9CA3AF',
|
|
15
|
+
500: '#6B7280',
|
|
16
|
+
600: '#4B5563',
|
|
17
|
+
700: '#374151',
|
|
18
|
+
800: '#1F2937',
|
|
19
|
+
900: '#111827',
|
|
20
|
+
},
|
|
21
|
+
red: {
|
|
22
|
+
400: '#F87171',
|
|
23
|
+
500: '#EF4444',
|
|
24
|
+
600: '#DC2626',
|
|
25
|
+
700: '#B91C1C',
|
|
26
|
+
900: '#7F1D1D',
|
|
27
|
+
},
|
|
28
|
+
white: '#FFFFFF',
|
|
29
|
+
black: '#000000',
|
|
30
|
+
transparent: 'transparent',
|
|
31
|
+
};
|
|
32
|
+
export const cssVars = {
|
|
33
|
+
colors: {
|
|
34
|
+
primary: {
|
|
35
|
+
main: 'var(--color-primary-main)',
|
|
36
|
+
hover: 'var(--color-primary-hover)',
|
|
37
|
+
focus: 'var(--color-primary-focus)',
|
|
38
|
+
contrastText: 'var(--color-primary-contrast)',
|
|
39
|
+
},
|
|
40
|
+
secondary: {
|
|
41
|
+
main: 'var(--color-secondary-main)',
|
|
42
|
+
hover: 'var(--color-secondary-hover)',
|
|
43
|
+
focus: 'var(--color-secondary-focus)',
|
|
44
|
+
contrastText: 'var(--color-secondary-contrast)',
|
|
45
|
+
},
|
|
46
|
+
danger: {
|
|
47
|
+
main: 'var(--color-danger-main)',
|
|
48
|
+
hover: 'var(--color-danger-hover)',
|
|
49
|
+
focus: 'var(--color-danger-focus)',
|
|
50
|
+
contrastText: 'var(--color-danger-contrast)',
|
|
51
|
+
},
|
|
52
|
+
neutral: {
|
|
53
|
+
border: 'var(--color-neutral-border)',
|
|
54
|
+
text: 'var(--color-neutral-text)',
|
|
55
|
+
textSecondary: 'var(--color-neutral-text-secondary)',
|
|
56
|
+
bg: 'var(--color-neutral-bg)',
|
|
57
|
+
bgSurface: 'var(--color-neutral-bg-surface)',
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
shadows: {
|
|
61
|
+
focusRing: 'var(--shadow-focus-ring)',
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
export const themes = {
|
|
65
|
+
light: {
|
|
66
|
+
'--color-primary-main': palette.blue[600],
|
|
67
|
+
'--color-primary-hover': palette.blue[700],
|
|
68
|
+
'--color-primary-focus': palette.blue[500],
|
|
69
|
+
'--color-primary-contrast': palette.white,
|
|
70
|
+
'--color-secondary-main': palette.gray[100],
|
|
71
|
+
'--color-secondary-hover': palette.gray[200],
|
|
72
|
+
'--color-secondary-focus': palette.gray[500],
|
|
73
|
+
'--color-secondary-contrast': palette.gray[900],
|
|
74
|
+
'--color-danger-main': palette.red[600],
|
|
75
|
+
'--color-danger-hover': palette.red[700],
|
|
76
|
+
'--color-danger-focus': palette.red[500],
|
|
77
|
+
'--color-danger-contrast': palette.white,
|
|
78
|
+
'--color-neutral-border': palette.gray[300],
|
|
79
|
+
'--color-neutral-text': palette.gray[700],
|
|
80
|
+
'--color-neutral-text-secondary': palette.gray[500],
|
|
81
|
+
'--color-neutral-bg': palette.gray[50],
|
|
82
|
+
'--color-neutral-bg-surface': palette.white,
|
|
83
|
+
'--shadow-focus-ring': '0 0 0 2px',
|
|
84
|
+
},
|
|
85
|
+
dark: {
|
|
86
|
+
'--color-primary-main': palette.blue[500],
|
|
87
|
+
'--color-primary-hover': palette.blue[400],
|
|
88
|
+
'--color-primary-focus': palette.blue[600],
|
|
89
|
+
'--color-primary-contrast': palette.white,
|
|
90
|
+
'--color-secondary-main': palette.gray[800],
|
|
91
|
+
'--color-secondary-hover': palette.gray[700],
|
|
92
|
+
'--color-secondary-focus': palette.gray[600],
|
|
93
|
+
'--color-secondary-contrast': palette.gray[100],
|
|
94
|
+
'--color-danger-main': palette.red[500],
|
|
95
|
+
'--color-danger-hover': palette.red[400],
|
|
96
|
+
'--color-danger-focus': palette.red[600],
|
|
97
|
+
'--color-danger-contrast': palette.white,
|
|
98
|
+
'--color-neutral-border': palette.gray[600],
|
|
99
|
+
'--color-neutral-text': palette.gray[100],
|
|
100
|
+
'--color-neutral-text-secondary': palette.gray[400],
|
|
101
|
+
'--color-neutral-bg': palette.gray[900],
|
|
102
|
+
'--color-neutral-bg-surface': palette.gray[800],
|
|
103
|
+
'--shadow-focus-ring': '0 0 0 2px',
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
export const tokens = {
|
|
107
|
+
colors: {
|
|
108
|
+
...cssVars.colors,
|
|
109
|
+
transparent: 'transparent',
|
|
110
|
+
white: '#FFFFFF',
|
|
111
|
+
black: '#000000',
|
|
112
|
+
},
|
|
113
|
+
shadows: cssVars.shadows,
|
|
114
|
+
ui: {
|
|
115
|
+
outlineOffset: '2px',
|
|
116
|
+
outlineWidth: '2px',
|
|
117
|
+
},
|
|
118
|
+
borderRadius: {
|
|
119
|
+
sm: '4px',
|
|
120
|
+
md: '6px',
|
|
121
|
+
lg: '8px',
|
|
122
|
+
full: '9999px',
|
|
123
|
+
},
|
|
124
|
+
spacing: {
|
|
125
|
+
2: '8px',
|
|
126
|
+
3: '12px',
|
|
127
|
+
4: '16px',
|
|
128
|
+
6: '24px',
|
|
129
|
+
},
|
|
130
|
+
sizing: {
|
|
131
|
+
8: '32px',
|
|
132
|
+
10: '40px',
|
|
133
|
+
12: '48px',
|
|
134
|
+
icon: {
|
|
135
|
+
sm: '14px',
|
|
136
|
+
md: '16px',
|
|
137
|
+
lg: '20px',
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
typography: {
|
|
141
|
+
fontFamily: {
|
|
142
|
+
sans: 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
|
|
143
|
+
mono: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',
|
|
144
|
+
},
|
|
145
|
+
fontSize: {
|
|
146
|
+
xs: '0.75rem',
|
|
147
|
+
sm: '0.875rem',
|
|
148
|
+
base: '1rem',
|
|
149
|
+
lg: '1.125rem',
|
|
150
|
+
xl: '1.25rem',
|
|
151
|
+
},
|
|
152
|
+
fontWeight: {
|
|
153
|
+
normal: '400',
|
|
154
|
+
medium: '500',
|
|
155
|
+
semibold: '600',
|
|
156
|
+
bold: '700',
|
|
157
|
+
},
|
|
158
|
+
lineHeight: {
|
|
159
|
+
none: '1',
|
|
160
|
+
tight: '1.25',
|
|
161
|
+
snug: '1.375',
|
|
162
|
+
normal: '1.5',
|
|
163
|
+
relaxed: '1.625',
|
|
164
|
+
loose: '2',
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
opacity: {
|
|
168
|
+
disabled: '0.5',
|
|
169
|
+
},
|
|
170
|
+
transition: {
|
|
171
|
+
base: 'all 0.2s ease',
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
//# sourceMappingURL=design-tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"design-tokens.js","sourceRoot":"","sources":["../../../src/theme/design-tokens.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,IAAI,EAAE;QACJ,GAAG,EAAE,SAAS;QACd,GAAG,EAAE,SAAS;QACd,GAAG,EAAE,SAAS;QACd,GAAG,EAAE,SAAS;QACd,GAAG,EAAE,SAAS;KACf;IACD,IAAI,EAAE;QACJ,EAAE,EAAE,SAAS;QACb,GAAG,EAAE,SAAS;QACd,GAAG,EAAE,SAAS;QACd,GAAG,EAAE,SAAS;QACd,GAAG,EAAE,SAAS;QACd,GAAG,EAAE,SAAS;QACd,GAAG,EAAE,SAAS;QACd,GAAG,EAAE,SAAS;QACd,GAAG,EAAE,SAAS;QACd,GAAG,EAAE,SAAS;KACf;IACD,GAAG,EAAE;QACH,GAAG,EAAE,SAAS;QACd,GAAG,EAAE,SAAS;QACd,GAAG,EAAE,SAAS;QACd,GAAG,EAAE,SAAS;QACd,GAAG,EAAE,SAAS;KACf;IACD,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,SAAS;IAChB,WAAW,EAAE,aAAa;CAClB,CAAC;AAGX,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,MAAM,EAAE;QACN,OAAO,EAAE;YACP,IAAI,EAAE,2BAA2B;YACjC,KAAK,EAAE,4BAA4B;YACnC,KAAK,EAAE,4BAA4B;YACnC,YAAY,EAAE,+BAA+B;SAC9C;QACD,SAAS,EAAE;YACT,IAAI,EAAE,6BAA6B;YACnC,KAAK,EA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E,eAAe;KACtB;CACO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/theme/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
type ThemeMode = 'light' | 'dark';
|
|
3
|
+
interface ThemeContextType {
|
|
4
|
+
mode: ThemeMode;
|
|
5
|
+
setMode: (mode: ThemeMode) => void;
|
|
6
|
+
toggleMode: () => void;
|
|
7
|
+
}
|
|
8
|
+
interface ThemeProviderProps {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
defaultMode?: ThemeMode;
|
|
11
|
+
themeOverrides?: Partial<Record<ThemeMode, Record<string, string>>>;
|
|
12
|
+
}
|
|
13
|
+
export declare const ThemeProvider: React.FC<ThemeProviderProps>;
|
|
14
|
+
export declare const useTheme: () => ThemeContextType;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=theme-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-provider.d.ts","sourceRoot":"","sources":["../../../src/theme/theme-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAkD,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzF,KAAK,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAElC,UAAU,gBAAgB;IACxB,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IACnC,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAID,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;CACrE;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAsCtD,CAAC;AAEF,eAAO,MAAM,QAAQ,QAAO,gBAM3B,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext, useEffect, useState } from 'react';
|
|
3
|
+
import { themes } from './design-tokens';
|
|
4
|
+
const ThemeContext = createContext(undefined);
|
|
5
|
+
export const ThemeProvider = ({ children, defaultMode = 'light', themeOverrides = {} }) => {
|
|
6
|
+
const [mode, setMode] = useState(defaultMode);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
const root = document.documentElement;
|
|
9
|
+
const defaultThemeValues = themes[mode];
|
|
10
|
+
const overrideValues = themeOverrides[mode] || {};
|
|
11
|
+
const finalThemeValues = { ...defaultThemeValues, ...overrideValues };
|
|
12
|
+
Object.entries(finalThemeValues).forEach(([key, value]) => {
|
|
13
|
+
root.style.setProperty(key, value);
|
|
14
|
+
});
|
|
15
|
+
if (mode === 'dark') {
|
|
16
|
+
root.classList.add('dark');
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
root.classList.remove('dark');
|
|
20
|
+
}
|
|
21
|
+
}, [mode]);
|
|
22
|
+
const toggleMode = () => {
|
|
23
|
+
setMode((prev) => (prev === 'light' ? 'dark' : 'light'));
|
|
24
|
+
};
|
|
25
|
+
return (_jsx(ThemeContext.Provider, { value: { mode, setMode, toggleMode }, children: children }));
|
|
26
|
+
};
|
|
27
|
+
export const useTheme = () => {
|
|
28
|
+
const context = useContext(ThemeContext);
|
|
29
|
+
if (!context) {
|
|
30
|
+
throw new Error('useTheme must be used within a ThemeProvider');
|
|
31
|
+
}
|
|
32
|
+
return context;
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=theme-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-provider.js","sourceRoot":"","sources":["../../../src/theme/theme-provider.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAa,MAAM,OAAO,CAAC;AACzF,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAUzC,MAAM,YAAY,GAAG,aAAa,CAA+B,SAAS,CAAC,CAAC;AAQ5E,MAAM,CAAC,MAAM,aAAa,GAAiC,CAAC,EAC1D,QAAQ,EACR,WAAW,GAAG,OAAO,EACrB,cAAc,GAAG,EAAE,EACpB,EAAE,EAAE;IACH,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAY,WAAW,CAAC,CAAC;IAGzD,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,IAAI,GAAG,QAAQ,CAAC,eAAe,CAAC;QACtC,MAAM,kBAAkB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QACxC,MAAM,cAAc,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QAElD,MAAM,gBAAgB,GAAG,EAAE,GAAG,kBAAkB,EAAE,GAAG,cAAc,EAAE,CAAC;QAEtE,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;YACxD,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;QAIH,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;YACpB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC7B,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAChC,CAAC;IAEH,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,MAAM,UAAU,GAAG,GAAG,EAAE;QACtB,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3D,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,YAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,YACxD,QAAQ,GACa,CACzB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAqB,EAAE;IAC7C,MAAM,OAAO,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;IACzC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-example.d.ts","sourceRoot":"","sources":["../../src/usage-example.tsx"],"names":[],"mappings":"AAwFA,wBAAgB,GAAG,4CAMlB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, ButtonNative, Input, ThemeProvider, useTheme } from './index';
|
|
3
|
+
const DemoContent = () => {
|
|
4
|
+
const { mode, toggleMode } = useTheme();
|
|
5
|
+
return (_jsx("div", { className: `min-h-screen p-8 transition-colors duration-300 ${mode === 'dark' ? 'bg-gray-900 text-white' : 'bg-gray-50 text-gray-900'}`, children: _jsxs("div", { className: "max-w-3xl mx-auto space-y-12", children: [_jsxs("header", { className: "flex items-center justify-between border-b border-gray-200 pb-6 dark:border-gray-700", children: [_jsxs("div", { children: [_jsx("h1", { className: "text-3xl font-bold", children: "UI Library Demo" }), _jsxs("p", { className: "mt-2 text-gray-500 dark:text-gray-400", children: ["Powered by ", _jsx("span", { className: "font-semibold text-primary-main", children: "Global Design Tokens" }), " \u2022 Current Theme: ", _jsx("span", { className: "font-mono font-bold uppercase", children: mode })] })] }), _jsx(Button, { onClick: toggleMode, variant: "outline", children: mode === 'light' ? '🌙 Switch to Dark' : '☀️ Switch to Light' })] }), _jsxs("section", { className: "space-y-4", children: [_jsx("h2", { className: "text-xl font-semibold", children: "1. Buttons (Themed)" }), _jsx("p", { className: "text-gray-600 dark:text-gray-400", children: "These buttons automatically adapt to the current theme colors." }), _jsxs("div", { className: "space-y-4 p-6 bg-white rounded-lg shadow-sm border border-gray-100 dark:bg-gray-800 dark:border-gray-700", children: [_jsxs("div", { className: "flex flex-wrap gap-4 items-center", children: [_jsx(Button, { variant: "primary", children: "Primary" }), _jsx(Button, { variant: "secondary", children: "Secondary" }), _jsx(Button, { variant: "outline", children: "Outline" }), _jsx(Button, { variant: "ghost", children: "Ghost" }), _jsx(Button, { variant: "danger", children: "Danger" }), _jsx(Button, { variant: "primary", disabled: true, children: "Disabled" }), _jsx(Button, { variant: "primary", isLoading: true, children: "Loading" })] }), _jsxs("div", { className: "flex flex-wrap gap-4 items-center border-t border-gray-100 dark:border-gray-700 pt-4", children: [_jsx("span", { className: "text-sm text-gray-500 w-full sm:w-auto", children: "Sizes:" }), _jsx(Button, { variant: "primary", size: "sm", children: "Small" }), _jsx(Button, { variant: "primary", size: "md", children: "Medium" }), _jsx(Button, { variant: "primary", size: "lg", children: "Large" })] })] })] }), _jsxs("section", { className: "space-y-4", children: [_jsx("h2", { className: "text-xl font-semibold", children: "2. Inputs (Themed)" }), _jsx("p", { className: "text-gray-600 dark:text-gray-400", children: "Inputs with support for icons and validation states." }), _jsxs("div", { className: "space-y-6 p-6 bg-white rounded-lg shadow-sm border border-gray-100 dark:bg-gray-800 dark:border-gray-700", children: [_jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [_jsx(Input, { placeholder: "Default Input" }), _jsx(Input, { placeholder: "Filled Input", variant: "filled" }), _jsx(Input, { placeholder: "Flushed Input", variant: "flushed" }), _jsx(Input, { placeholder: "Invalid Input", isInvalid: true }), _jsx(Input, { placeholder: "With Left Icon", leftIcon: _jsx("span", { children: "\uD83D\uDD0D" }) }), _jsx(Input, { placeholder: "With Right Icon", rightIcon: _jsx("span", { children: "\uD83D\uDC41\uFE0F" }) }), _jsx(Input, { placeholder: "Disabled Input", disabled: true })] }), _jsxs("div", { className: "border-t border-gray-100 dark:border-gray-700 pt-4", children: [_jsx("span", { className: "block mb-4 text-sm text-gray-500", children: "Sizes:" }), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-6", children: [_jsx(Input, { placeholder: "Small Input", size: "sm" }), _jsx(Input, { placeholder: "Medium Input", size: "md" }), _jsx(Input, { placeholder: "Large Input", size: "lg" })] })] })] })] }), _jsxs("section", { className: "space-y-4", children: [_jsx("h2", { className: "text-xl font-semibold", children: "3. Native Components" }), _jsx("p", { className: "text-gray-600 dark:text-gray-400", children: "Framework-agnostic components using inline styles." }), _jsxs("div", { className: "flex flex-wrap gap-4 items-center p-6 bg-white rounded-lg shadow-sm border border-gray-100 dark:bg-gray-800 dark:border-gray-700", children: [_jsx(ButtonNative, { variant: "primary", children: "Native Primary" }), _jsx(ButtonNative, { variant: "outline", children: "Native Outline" })] })] })] }) }));
|
|
6
|
+
};
|
|
7
|
+
export function App() {
|
|
8
|
+
return (_jsx(ThemeProvider, { defaultMode: "light", children: _jsx(DemoContent, {}) }));
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=usage-example.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-example.js","sourceRoot":"","sources":["../../src/usage-example.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,YAAY,E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AAI,EAAC,IAAI,GAAG,EAC9C,KAAC,KAAK,IAAC,WAAW,EAAC,aAAa,EAAC,IAAI,EAAC,IAAI,GAAG,IACzC,IACF,IACF,IACE,EAEV,mBAAS,SAAS,EAAC,WAAW,aAC5B,aAAI,SAAS,EAAC,uBAAuB,qCAA0B,EAC/D,YAAG,SAAS,EAAC,kCAAkC,mEAAuD,EACtG,eAAK,SAAS,EAAC,kIAAkI,aAC/I,KAAC,YAAY,IAAC,OAAO,EAAC,SAAS,+BAA8B,EAC7D,KAAC,YAAY,IAAC,OAAO,EAAC,SAAS,+BAA8B,IACzD,IACE,IACN,GACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG;IACjB,OAAO,CACL,KAAC,aAAa,IAAC,WAAW,EAAC,OAAO,YAChC,KAAC,WAAW,KAAG,GACD,CACjB,CAAC;AACJ,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@damarkuncoro/ui-library",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"main": "lib/cjs/index.js",
|
|
5
|
+
"module": "lib/esm/index.js",
|
|
6
|
+
"types": "lib/esm/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./lib/esm/index.d.ts",
|
|
10
|
+
"import": "./lib/esm/index.js",
|
|
11
|
+
"require": "./lib/cjs/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./package.json": "./package.json"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"lib"
|
|
17
|
+
],
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@damarkuncoro/meta-architecture": "latest"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"react": ">=18",
|
|
26
|
+
"react-dom": ">=18"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
30
|
+
"@testing-library/react": "^16.2.0",
|
|
31
|
+
"@types/node": "^25.2.0",
|
|
32
|
+
"@types/react": "^19.2.10",
|
|
33
|
+
"@types/react-dom": "^19.2.3",
|
|
34
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
35
|
+
"jsdom": "^26.0.0",
|
|
36
|
+
"react": "^19.2.4",
|
|
37
|
+
"react-dom": "^19.2.4",
|
|
38
|
+
"typescript": "^5.9.3",
|
|
39
|
+
"vite": "^6.0.11",
|
|
40
|
+
"vitest": "^4.0.18"
|
|
41
|
+
},
|
|
42
|
+
"author": "Damar Kuncoro",
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "rm -rf lib && tsc -p tsconfig.build.esm.json && tsc -p tsconfig.build.cjs.json && echo '{\"type\": \"module\"}' > lib/esm/package.json && echo '{\"type\": \"commonjs\"}' > lib/cjs/package.json",
|
|
45
|
+
"test": "vitest",
|
|
46
|
+
"meta-architecture": "meta-architecture"
|
|
47
|
+
}
|
|
48
|
+
}
|