@impulse-ui-native/theme 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.
@@ -0,0 +1,379 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ DarkTheme: () => DarkTheme,
24
+ LightTheme: () => LightTheme,
25
+ StylePropsSet: () => StylePropsSet,
26
+ ThemeProvider: () => ThemeProvider,
27
+ createStyleKey: () => createStyleKey,
28
+ extractStyleProps: () => extractStyleProps,
29
+ useBorder: () => useBorder,
30
+ useColors: () => useColors,
31
+ useRadii: () => useRadii,
32
+ useSpace: () => useSpace,
33
+ useStyleProps: () => useStyleProps,
34
+ useTheme: () => useTheme,
35
+ useThemeContext: () => useThemeContext,
36
+ useThemedStyles: () => useThemedStyles
37
+ });
38
+ module.exports = __toCommonJS(index_exports);
39
+
40
+ // src/constants/style.constants.ts
41
+ var StylePropsSet = /* @__PURE__ */ new Set([
42
+ // Spacing
43
+ "margin",
44
+ "marginTop",
45
+ "marginBottom",
46
+ "marginLeft",
47
+ "marginRight",
48
+ "marginHorizontal",
49
+ "marginVertical",
50
+ "padding",
51
+ "paddingTop",
52
+ "paddingBottom",
53
+ "paddingLeft",
54
+ "paddingRight",
55
+ "paddingHorizontal",
56
+ "paddingVertical",
57
+ // Appearance
58
+ "color",
59
+ "backgroundColor",
60
+ "opacity",
61
+ "borderRadius",
62
+ "borderColor",
63
+ "borderWidth",
64
+ "borderStyle",
65
+ "shadowColor",
66
+ "shadowOpacity",
67
+ "shadowRadius",
68
+ "shadowOffset",
69
+ "elevation",
70
+ // Typography (TextStyle)
71
+ "fontSize",
72
+ "fontFamily",
73
+ "fontWeight",
74
+ "fontStyle",
75
+ "letterSpacing",
76
+ "lineHeight",
77
+ "textAlign",
78
+ "textDecorationLine",
79
+ "textDecorationStyle",
80
+ "textDecorationColor",
81
+ "textTransform",
82
+ "includeFontPadding",
83
+ "textAlignVertical",
84
+ "writingDirection",
85
+ // Flex (ViewStyle)
86
+ "flex",
87
+ "flexGrow",
88
+ "flexShrink",
89
+ "flexBasis",
90
+ "flexDirection",
91
+ "flexWrap",
92
+ "justifyContent",
93
+ "alignItems",
94
+ "alignSelf",
95
+ "alignContent",
96
+ "gap",
97
+ "rowGap",
98
+ "columnGap",
99
+ // Positioning (commonly used with flex layouts)
100
+ "position",
101
+ "top",
102
+ "right",
103
+ "bottom",
104
+ "left"
105
+ ]);
106
+
107
+ // src/hooks/use-border.hook.ts
108
+ var import_react2 = require("react");
109
+
110
+ // src/providers/theme.provider.tsx
111
+ var import_core = require("@impulse-ui-native/core");
112
+ var import_react = require("react");
113
+
114
+ // src/theme/tokens.theme.ts
115
+ var SpaceTokens = {
116
+ none: 0,
117
+ auto: "auto",
118
+ xxs: 4,
119
+ xs: 8,
120
+ mxs: 12,
121
+ sm: 16,
122
+ msm: 24,
123
+ md: 32,
124
+ lg: 48,
125
+ xl: 64,
126
+ xxl: 96
127
+ };
128
+ var BorderSizeTokens = {
129
+ sm: 1,
130
+ md: 2,
131
+ lg: 3,
132
+ xl: 5,
133
+ xxl: 10
134
+ };
135
+ var RadiiTokens = {
136
+ sm: 4,
137
+ md: 8,
138
+ lg: 16,
139
+ xl: 32,
140
+ xxl: 64,
141
+ xxxl: 128,
142
+ round: 1e5
143
+ };
144
+ var FontSizeTokens = {
145
+ xxs: 8,
146
+ xs: 12,
147
+ xsm: 14,
148
+ sm: 16,
149
+ md: 18,
150
+ lg: 20,
151
+ xl: 24,
152
+ xxl: 32,
153
+ xxxl: 40,
154
+ huge: 48,
155
+ massive: 56
156
+ };
157
+ var NeutralColorTokens = {
158
+ "0": "#ffffff",
159
+ "1": "#f8f9fa",
160
+ "2": "#f1f3f5",
161
+ "3": "#e9ecef",
162
+ "4": "#dee2e6",
163
+ "5": "#ced4da",
164
+ "6": "#adb5bd",
165
+ "7": "#868e96",
166
+ "8": "#495057",
167
+ "9": "#343a40",
168
+ "10": "#212529",
169
+ "11": "#16191d",
170
+ "12": "#0d0f12",
171
+ "13": "#000000"
172
+ };
173
+ var FontFamilyTokens = {
174
+ thin: "Montserrat-Thin",
175
+ thinItalic: "Montserrat-ThinItalic",
176
+ extraLight: "Montserrat-ExtraLight",
177
+ extraLightItalic: "Montserrat-ExtraLightItalic",
178
+ light: "Montserrat-Light",
179
+ lightItalic: "Montserrat-LightItalic",
180
+ regular: "Montserrat-Regular",
181
+ italic: "Montserrat-Italic",
182
+ medium: "Montserrat-Medium",
183
+ mediumItalic: "Montserrat-MediumItalic",
184
+ semiBold: "Montserrat-SemiBold",
185
+ semiBoldItalic: "Montserrat-SemiBoldItalic",
186
+ bold: "Montserrat-Bold",
187
+ boldItalic: "Montserrat-BoldItalic",
188
+ extraBold: "Montserrat-ExtraBold",
189
+ extraBoldItalic: "Montserrat-ExtraBoldItalic",
190
+ black: "Montserrat-Black",
191
+ blackItalic: "Montserrat-BlackItalic"
192
+ };
193
+
194
+ // src/theme/light.theme.ts
195
+ var LightTheme = {
196
+ colors: {
197
+ primary: "#f55d6b",
198
+ secondary: "#f55d6b",
199
+ neutral: NeutralColorTokens,
200
+ white: NeutralColorTokens["0"],
201
+ black: NeutralColorTokens["13"],
202
+ error: "#c92a2a",
203
+ warning: "#e67700",
204
+ success: "#7a9908",
205
+ info: "#1864ab",
206
+ text: {
207
+ primary: NeutralColorTokens["11"],
208
+ secondary: NeutralColorTokens["10"]
209
+ },
210
+ background: {
211
+ primary: NeutralColorTokens["2"],
212
+ secondary: NeutralColorTokens["0"]
213
+ }
214
+ },
215
+ spacing: SpaceTokens,
216
+ radii: RadiiTokens,
217
+ borderSize: BorderSizeTokens,
218
+ fontFamily: FontFamilyTokens,
219
+ fontSize: FontSizeTokens
220
+ };
221
+
222
+ // src/theme/dark.theme.ts
223
+ var DarkTheme = {
224
+ colors: {
225
+ primary: "#f55d6b",
226
+ secondary: "#f55d6b",
227
+ neutral: NeutralColorTokens,
228
+ white: NeutralColorTokens["0"],
229
+ black: NeutralColorTokens["13"],
230
+ error: "#c92a2a",
231
+ warning: "#e67700",
232
+ success: "#7a9908",
233
+ info: "#1864ab",
234
+ text: {
235
+ primary: NeutralColorTokens["11"],
236
+ secondary: NeutralColorTokens["10"]
237
+ },
238
+ background: {
239
+ primary: NeutralColorTokens["2"],
240
+ secondary: NeutralColorTokens["0"]
241
+ }
242
+ },
243
+ spacing: SpaceTokens,
244
+ radii: RadiiTokens,
245
+ borderSize: BorderSizeTokens,
246
+ fontFamily: FontFamilyTokens,
247
+ fontSize: FontSizeTokens
248
+ };
249
+
250
+ // src/providers/theme.provider.tsx
251
+ var import_montserrat = require("@expo-google-fonts/montserrat");
252
+ var ThemeContext = (0, import_react.createContext)(void 0);
253
+ var ThemeProvider = (0, import_react.memo)(function ThemeProvider2(props) {
254
+ const scheme = props.scheme ?? "light";
255
+ const [loaded] = (0, import_montserrat.useFonts)({
256
+ Montserrat_100Thin: import_montserrat.Montserrat_100Thin,
257
+ Montserrat_100Thin_Italic: import_montserrat.Montserrat_100Thin_Italic,
258
+ Montserrat_200ExtraLight: import_montserrat.Montserrat_200ExtraLight,
259
+ Montserrat_200ExtraLight_Italic: import_montserrat.Montserrat_200ExtraLight_Italic,
260
+ Montserrat_300Light: import_montserrat.Montserrat_300Light,
261
+ Montserrat_300Light_Italic: import_montserrat.Montserrat_300Light_Italic,
262
+ Montserrat_400Regular: import_montserrat.Montserrat_400Regular,
263
+ Montserrat_400Regular_Italic: import_montserrat.Montserrat_400Regular_Italic,
264
+ Montserrat_500Medium: import_montserrat.Montserrat_500Medium,
265
+ Montserrat_500Medium_Italic: import_montserrat.Montserrat_500Medium_Italic,
266
+ Montserrat_600SemiBold: import_montserrat.Montserrat_600SemiBold,
267
+ Montserrat_600SemiBold_Italic: import_montserrat.Montserrat_600SemiBold_Italic,
268
+ Montserrat_700Bold: import_montserrat.Montserrat_700Bold,
269
+ Montserrat_700Bold_Italic: import_montserrat.Montserrat_700Bold_Italic,
270
+ Montserrat_800ExtraBold: import_montserrat.Montserrat_800ExtraBold,
271
+ Montserrat_800ExtraBold_Italic: import_montserrat.Montserrat_800ExtraBold_Italic,
272
+ Montserrat_900Black: import_montserrat.Montserrat_900Black,
273
+ Montserrat_900Black_Italic: import_montserrat.Montserrat_900Black_Italic
274
+ });
275
+ const context = (0, import_react.useMemo)(() => {
276
+ const baseTheme = scheme === "light" ? LightTheme : DarkTheme;
277
+ return {
278
+ loaded,
279
+ theme: (0, import_core.merge)(baseTheme, props.theme?.[scheme])
280
+ };
281
+ }, [props.theme?.light, props.theme?.dark]);
282
+ return /* @__PURE__ */ React.createElement(ThemeContext.Provider, { value: context }, props.children);
283
+ });
284
+ function useThemeContext() {
285
+ const context = (0, import_react.useContext)(ThemeContext);
286
+ if (!context) {
287
+ throw new Error("useThemeContext must be used within a ThemeProvider");
288
+ }
289
+ return context;
290
+ }
291
+
292
+ // src/hooks/use-border.hook.ts
293
+ function useBorder() {
294
+ const context = useThemeContext();
295
+ return (0, import_react2.useMemo)(() => context.theme.borderSize, [context.theme.borderSize]);
296
+ }
297
+
298
+ // src/hooks/use-colors.hook.ts
299
+ var import_react3 = require("react");
300
+ function useColors() {
301
+ const context = useThemeContext();
302
+ return (0, import_react3.useMemo)(() => context.theme.colors, [context.theme.colors]);
303
+ }
304
+
305
+ // src/hooks/use-radii.hook.ts
306
+ var import_react4 = require("react");
307
+ function useRadii() {
308
+ const context = useThemeContext();
309
+ return (0, import_react4.useMemo)(() => context.theme.radii, [context.theme.radii]);
310
+ }
311
+
312
+ // src/hooks/use-space.hook.ts
313
+ var import_react5 = require("react");
314
+ function useSpace() {
315
+ const context = useThemeContext();
316
+ return (0, import_react5.useMemo)(() => context.theme.spacing, [context.theme.spacing]);
317
+ }
318
+
319
+ // src/hooks/use-style-props.hook.ts
320
+ var import_react6 = require("react");
321
+
322
+ // src/utils/style.utils.ts
323
+ var isStylePropKey = (k) => StylePropsSet.has(k);
324
+ var extractStyleProps = (props) => {
325
+ const style = {};
326
+ for (const k in props) {
327
+ if (isStylePropKey(k) && props[k] !== void 0) {
328
+ style[k] = props[k];
329
+ }
330
+ }
331
+ return style;
332
+ };
333
+ var createStyleKey = (props) => {
334
+ let key = "";
335
+ for (const k in props) {
336
+ if (isStylePropKey(k)) {
337
+ key += String(props[k]);
338
+ }
339
+ }
340
+ return key;
341
+ };
342
+
343
+ // src/hooks/use-style-props.hook.ts
344
+ function useStyleProps(props) {
345
+ const key = createStyleKey(props);
346
+ return (0, import_react6.useMemo)(() => extractStyleProps(props), [key]);
347
+ }
348
+
349
+ // src/hooks/use-theme.hook.ts
350
+ var import_react7 = require("react");
351
+ function useTheme() {
352
+ const context = useThemeContext();
353
+ return (0, import_react7.useMemo)(() => context.theme, [context.theme]);
354
+ }
355
+
356
+ // src/hooks/use-themed-styles.ts
357
+ var import_react8 = require("react");
358
+ var useThemedStyles = (styledFunction, props) => {
359
+ const theme = useTheme();
360
+ return (0, import_react8.useMemo)(() => styledFunction(theme, props), [theme, props]);
361
+ };
362
+ // Annotate the CommonJS export names for ESM import in node:
363
+ 0 && (module.exports = {
364
+ DarkTheme,
365
+ LightTheme,
366
+ StylePropsSet,
367
+ ThemeProvider,
368
+ createStyleKey,
369
+ extractStyleProps,
370
+ useBorder,
371
+ useColors,
372
+ useRadii,
373
+ useSpace,
374
+ useStyleProps,
375
+ useTheme,
376
+ useThemeContext,
377
+ useThemedStyles
378
+ });
379
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/constants/style.constants.ts","../src/hooks/use-border.hook.ts","../src/providers/theme.provider.tsx","../src/theme/tokens.theme.ts","../src/theme/light.theme.ts","../src/theme/dark.theme.ts","../src/hooks/use-colors.hook.ts","../src/hooks/use-radii.hook.ts","../src/hooks/use-space.hook.ts","../src/hooks/use-style-props.hook.ts","../src/utils/style.utils.ts","../src/hooks/use-theme.hook.ts","../src/hooks/use-themed-styles.ts"],"sourcesContent":["export * from './constants';\r\nexport * from './hooks';\r\nexport * from './providers';\r\nexport * from './theme';\r\nexport * from './types';\r\nexport * from './utils';\r\n","import { StyleProps } from \"../types\";\r\n\r\nexport const StylePropsSet = new Set<keyof StyleProps>([\r\n // Spacing\r\n \"margin\",\r\n \"marginTop\",\r\n \"marginBottom\",\r\n \"marginLeft\",\r\n \"marginRight\",\r\n \"marginHorizontal\",\r\n \"marginVertical\",\r\n \"padding\",\r\n \"paddingTop\",\r\n \"paddingBottom\",\r\n \"paddingLeft\",\r\n \"paddingRight\",\r\n \"paddingHorizontal\",\r\n \"paddingVertical\",\r\n\r\n // Appearance\r\n \"color\",\r\n \"backgroundColor\",\r\n \"opacity\",\r\n \"borderRadius\",\r\n \"borderColor\",\r\n \"borderWidth\",\r\n \"borderStyle\",\r\n \"shadowColor\",\r\n \"shadowOpacity\",\r\n \"shadowRadius\",\r\n \"shadowOffset\",\r\n \"elevation\",\r\n\r\n // Typography (TextStyle)\r\n \"fontSize\",\r\n \"fontFamily\",\r\n \"fontWeight\",\r\n \"fontStyle\",\r\n \"letterSpacing\",\r\n \"lineHeight\",\r\n \"textAlign\",\r\n \"textDecorationLine\",\r\n \"textDecorationStyle\",\r\n \"textDecorationColor\",\r\n \"textTransform\",\r\n \"includeFontPadding\",\r\n \"textAlignVertical\",\r\n \"writingDirection\",\r\n\r\n // Flex (ViewStyle)\r\n \"flex\",\r\n \"flexGrow\",\r\n \"flexShrink\",\r\n \"flexBasis\",\r\n \"flexDirection\",\r\n \"flexWrap\",\r\n \"justifyContent\",\r\n \"alignItems\",\r\n \"alignSelf\",\r\n \"alignContent\",\r\n \"gap\",\r\n \"rowGap\",\r\n \"columnGap\",\r\n\r\n // Positioning (commonly used with flex layouts)\r\n \"position\",\r\n \"top\",\r\n \"right\",\r\n \"bottom\",\r\n \"left\",\r\n]);\r\n","import { useMemo } from \"react\";\r\nimport { useThemeContext } from \"../providers\";\r\nimport { BorderSizes } from \"../types\";\r\n\r\nexport function useBorder(): BorderSizes {\r\n const context = useThemeContext();\r\n\r\n return useMemo(() => context.theme.borderSize, [context.theme.borderSize]);\r\n}\r\n","import { DeepPartial, merge } from \"@impulse-ui-native/core\";\r\nimport {\r\n createContext,\r\n memo,\r\n PropsWithChildren,\r\n useContext,\r\n useMemo,\r\n} from \"react\";\r\nimport { AppTheme, DarkTheme, LightTheme } from \"../theme\";\r\nimport { ColorScheme, ThemeContextData } from \"../types\";\r\n\r\nimport {\r\n Montserrat_100Thin,\r\n Montserrat_100Thin_Italic,\r\n Montserrat_200ExtraLight,\r\n Montserrat_200ExtraLight_Italic,\r\n Montserrat_300Light,\r\n Montserrat_300Light_Italic,\r\n Montserrat_400Regular,\r\n Montserrat_400Regular_Italic,\r\n Montserrat_500Medium,\r\n Montserrat_500Medium_Italic,\r\n Montserrat_600SemiBold,\r\n Montserrat_600SemiBold_Italic,\r\n Montserrat_700Bold,\r\n Montserrat_700Bold_Italic,\r\n Montserrat_800ExtraBold,\r\n Montserrat_800ExtraBold_Italic,\r\n Montserrat_900Black,\r\n Montserrat_900Black_Italic,\r\n useFonts,\r\n} from \"@expo-google-fonts/montserrat\";\r\n\r\nconst ThemeContext = createContext<ThemeContextData | undefined>(undefined);\r\n\r\ninterface ThemeProviderProps {\r\n scheme: ColorScheme;\r\n theme: {\r\n light: AppTheme;\r\n dark: AppTheme;\r\n };\r\n}\r\n\r\nexport const ThemeProvider = memo(function ThemeProvider(\r\n props: PropsWithChildren<DeepPartial<ThemeProviderProps>>\r\n) {\r\n const scheme = props.scheme ?? \"light\";\r\n\r\n const [loaded] = useFonts({\r\n Montserrat_100Thin,\r\n Montserrat_100Thin_Italic,\r\n Montserrat_200ExtraLight,\r\n Montserrat_200ExtraLight_Italic,\r\n Montserrat_300Light,\r\n Montserrat_300Light_Italic,\r\n Montserrat_400Regular,\r\n Montserrat_400Regular_Italic,\r\n Montserrat_500Medium,\r\n Montserrat_500Medium_Italic,\r\n Montserrat_600SemiBold,\r\n Montserrat_600SemiBold_Italic,\r\n Montserrat_700Bold,\r\n Montserrat_700Bold_Italic,\r\n Montserrat_800ExtraBold,\r\n Montserrat_800ExtraBold_Italic,\r\n Montserrat_900Black,\r\n Montserrat_900Black_Italic,\r\n });\r\n\r\n const context = useMemo<ThemeContextData>(() => {\r\n const baseTheme = scheme === \"light\" ? LightTheme : DarkTheme;\r\n\r\n return {\r\n loaded,\r\n theme: merge(baseTheme, props.theme?.[scheme]),\r\n };\r\n }, [props.theme?.light, props.theme?.dark]);\r\n\r\n return (\r\n <ThemeContext.Provider value={context}>\r\n {props.children}\r\n </ThemeContext.Provider>\r\n );\r\n});\r\n\r\nexport function useThemeContext() {\r\n const context = useContext(ThemeContext);\r\n\r\n if (!context) {\r\n throw new Error(\"useThemeContext must be used within a ThemeProvider\");\r\n }\r\n\r\n return context;\r\n}\r\n","import {\r\n BorderSizes,\r\n FontFamilyMap,\r\n FontSizes,\r\n FontWeights,\r\n NeutralColors,\r\n Radii,\r\n Space,\r\n} from \"../types\";\r\n\r\nexport const SpaceTokens: Space = {\r\n none: 0,\r\n auto: \"auto\",\r\n xxs: 4,\r\n xs: 8,\r\n mxs: 12,\r\n sm: 16,\r\n msm: 24,\r\n md: 32,\r\n lg: 48,\r\n xl: 64,\r\n xxl: 96,\r\n};\r\n\r\nexport const BorderSizeTokens: BorderSizes = {\r\n sm: 1,\r\n md: 2,\r\n lg: 3,\r\n xl: 5,\r\n xxl: 10,\r\n};\r\n\r\nexport const RadiiTokens: Radii = {\r\n sm: 4,\r\n md: 8,\r\n lg: 16,\r\n xl: 32,\r\n xxl: 64,\r\n xxxl: 128,\r\n round: 100000,\r\n};\r\n\r\nexport const FontSizeTokens: FontSizes = {\r\n xxs: 8,\r\n xs: 12,\r\n xsm: 14,\r\n sm: 16,\r\n md: 18,\r\n lg: 20,\r\n xl: 24,\r\n xxl: 32,\r\n xxxl: 40,\r\n huge: 48,\r\n massive: 56,\r\n};\r\n\r\nexport const NeutralColorTokens: NeutralColors = {\r\n \"0\": \"#ffffff\",\r\n \"1\": \"#f8f9fa\",\r\n \"2\": \"#f1f3f5\",\r\n \"3\": \"#e9ecef\",\r\n \"4\": \"#dee2e6\",\r\n \"5\": \"#ced4da\",\r\n \"6\": \"#adb5bd\",\r\n \"7\": \"#868e96\",\r\n \"8\": \"#495057\",\r\n \"9\": \"#343a40\",\r\n \"10\": \"#212529\",\r\n \"11\": \"#16191d\",\r\n \"12\": \"#0d0f12\",\r\n \"13\": \"#000000\",\r\n};\r\n\r\nexport const FontWeightTokens: FontWeights = {\r\n thin: \"100\",\r\n extraLight: \"200\",\r\n light: \"300\",\r\n regular: \"400\",\r\n medium: \"500\",\r\n semiBold: \"600\",\r\n bold: \"700\",\r\n extraBold: \"800\",\r\n black: \"900\",\r\n};\r\n\r\nexport const FontFamilyTokens: FontFamilyMap = {\r\n thin: \"Montserrat-Thin\",\r\n thinItalic: \"Montserrat-ThinItalic\",\r\n extraLight: \"Montserrat-ExtraLight\",\r\n extraLightItalic: \"Montserrat-ExtraLightItalic\",\r\n light: \"Montserrat-Light\",\r\n lightItalic: \"Montserrat-LightItalic\",\r\n regular: \"Montserrat-Regular\",\r\n italic: \"Montserrat-Italic\",\r\n medium: \"Montserrat-Medium\",\r\n mediumItalic: \"Montserrat-MediumItalic\",\r\n semiBold: \"Montserrat-SemiBold\",\r\n semiBoldItalic: \"Montserrat-SemiBoldItalic\",\r\n bold: \"Montserrat-Bold\",\r\n boldItalic: \"Montserrat-BoldItalic\",\r\n extraBold: \"Montserrat-ExtraBold\",\r\n extraBoldItalic: \"Montserrat-ExtraBoldItalic\",\r\n black: \"Montserrat-Black\",\r\n blackItalic: \"Montserrat-BlackItalic\",\r\n};\r\n","import { DeepPartial } from \"@impulse-ui-native/core\";\r\nimport {\r\n BorderSizes,\r\n FontFamilyMap,\r\n FontSizes,\r\n NeutralColors,\r\n Radii,\r\n Space,\r\n TypographyPresetKey,\r\n TypographyProps,\r\n} from \"../types\";\r\nimport {\r\n BorderSizeTokens,\r\n FontFamilyTokens,\r\n FontSizeTokens,\r\n NeutralColorTokens,\r\n RadiiTokens,\r\n SpaceTokens,\r\n} from \"./tokens.theme\";\r\n\r\nexport const LightTheme: AppTheme = {\r\n colors: {\r\n primary: \"#f55d6b\",\r\n secondary: \"#f55d6b\",\r\n neutral: NeutralColorTokens,\r\n white: NeutralColorTokens[\"0\"],\r\n black: NeutralColorTokens[\"13\"],\r\n error: \"#c92a2a\",\r\n warning: \"#e67700\",\r\n success: \"#7a9908\",\r\n info: \"#1864ab\",\r\n text: {\r\n primary: NeutralColorTokens[\"11\"],\r\n secondary: NeutralColorTokens[\"10\"],\r\n },\r\n background: {\r\n primary: NeutralColorTokens[\"2\"],\r\n secondary: NeutralColorTokens[\"0\"],\r\n },\r\n },\r\n spacing: SpaceTokens,\r\n radii: RadiiTokens,\r\n borderSize: BorderSizeTokens,\r\n fontFamily: FontFamilyTokens,\r\n fontSize: FontSizeTokens,\r\n};\r\n\r\nexport interface ThemeColors {\r\n primary: string;\r\n secondary: string;\r\n neutral: NeutralColors;\r\n\r\n white: string;\r\n black: string;\r\n\r\n error: string;\r\n warning: string;\r\n success: string;\r\n info: string;\r\n\r\n text: {\r\n primary: string;\r\n secondary: string;\r\n };\r\n\r\n background: {\r\n primary: string;\r\n secondary: string;\r\n };\r\n}\r\n\r\nexport interface ComponentsThemes {\r\n typography: Record<TypographyPresetKey, TypographyProps>;\r\n}\r\n\r\nexport interface AppTheme {\r\n colors: ThemeColors;\r\n spacing: Space;\r\n radii: Radii;\r\n borderSize: BorderSizes;\r\n fontFamily: FontFamilyMap;\r\n fontSize: FontSizes;\r\n components?: DeepPartial<ComponentsThemes>;\r\n}\r\n","import { AppTheme } from './light.theme';\r\nimport {\r\n BorderSizeTokens,\r\n FontFamilyTokens,\r\n FontSizeTokens,\r\n NeutralColorTokens,\r\n RadiiTokens,\r\n SpaceTokens,\r\n} from './tokens.theme';\r\n\r\nexport const DarkTheme: AppTheme = {\r\n colors: {\r\n primary: '#f55d6b',\r\n secondary: '#f55d6b',\r\n neutral: NeutralColorTokens,\r\n white: NeutralColorTokens['0'],\r\n black: NeutralColorTokens['13'],\r\n error: '#c92a2a',\r\n warning: '#e67700',\r\n success: '#7a9908',\r\n info: '#1864ab',\r\n text: {\r\n primary: NeutralColorTokens['11'],\r\n secondary: NeutralColorTokens['10'],\r\n },\r\n background: {\r\n primary: NeutralColorTokens['2'],\r\n secondary: NeutralColorTokens['0'],\r\n },\r\n },\r\n spacing: SpaceTokens,\r\n radii: RadiiTokens,\r\n borderSize: BorderSizeTokens,\r\n fontFamily: FontFamilyTokens,\r\n fontSize: FontSizeTokens,\r\n};\r\n","import { useMemo } from \"react\";\r\nimport { useThemeContext } from \"../providers\";\r\nimport { ThemeColors } from \"../theme/light.theme\";\r\n\r\nexport function useColors(): ThemeColors {\r\n const context = useThemeContext();\r\n\r\n return useMemo(() => context.theme.colors, [context.theme.colors]);\r\n}\r\n","import { useMemo } from \"react\";\r\nimport { useThemeContext } from \"../providers\";\r\nimport { Radii } from \"../types\";\r\n\r\nexport function useRadii(): Radii {\r\n const context = useThemeContext();\r\n\r\n return useMemo(() => context.theme.radii, [context.theme.radii]);\r\n}\r\n","import { useMemo } from \"react\";\r\nimport { useThemeContext } from \"../providers\";\r\nimport { Space } from \"../types\";\r\n\r\nexport function useSpace(): Space {\r\n const context = useThemeContext();\r\n\r\n return useMemo(() => context.theme.spacing, [context.theme.spacing]);\r\n}\r\n","import { useMemo } from 'react';\r\nimport { createStyleKey, extractStyleProps } from '../utils';\r\n\r\nexport function useStyleProps<Props extends object>(props: Props) {\r\n const key = createStyleKey(props);\r\n\r\n return useMemo(() => extractStyleProps(props), [key]);\r\n}\r\n","import { StylePropsSet } from '../constants';\r\nimport { StylePropKey, StyleProps } from '../types';\r\n\r\nconst isStylePropKey = (k: string): k is StylePropKey =>\r\n StylePropsSet.has(k as StylePropKey);\r\n\r\nexport const extractStyleProps = <Props extends object>(\r\n props: Props\r\n): StyleProps => {\r\n const style: StyleProps = {};\r\n \r\n for (const k in props) {\r\n if (isStylePropKey(k) && props[k] !== undefined) {\r\n style[k] = props[k] as any;\r\n }\r\n }\r\n \r\n return style;\r\n};\r\n\r\nexport const createStyleKey = <Props extends object>(props: Props) => {\r\n let key = '';\r\n\r\n for (const k in props) {\r\n if (isStylePropKey(k)) {\r\n key += String(props[k as keyof Props]);\r\n }\r\n }\r\n \r\n return key;\r\n};\r\n","import { useMemo } from \"react\";\r\nimport { useThemeContext } from \"../providers\";\r\nimport { AppTheme } from \"../theme\";\r\n\r\nexport function useTheme(): AppTheme {\r\n const context = useThemeContext();\r\n\r\n return useMemo(() => context.theme, [context.theme]);\r\n}\r\n","import { useMemo } from \"react\";\r\nimport { StyleSheet } from \"react-native\";\r\nimport { AppTheme } from \"../theme\";\r\nimport { useTheme } from \"./use-theme.hook\";\r\n\r\ntype ThemedStyles<T extends StyleSheet.NamedStyles<T>> = T;\r\n\r\ntype StyledFunction<\r\n Props extends object,\r\n T extends StyleSheet.NamedStyles<T>\r\n> = (theme: AppTheme, props: Props) => ThemedStyles<T>;\r\n\r\nexport const useThemedStyles = <\r\n Props extends object,\r\n T extends StyleSheet.NamedStyles<T>\r\n>(\r\n styledFunction: StyledFunction<Props, T>,\r\n props: Props\r\n): ThemedStyles<T> => {\r\n const theme = useTheme();\r\n\r\n return useMemo(() => styledFunction(theme, props), [theme, props]);\r\n};\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEO,IAAM,gBAAgB,oBAAI,IAAsB;AAAA;AAAA,EAErD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;;;ACtED,IAAAA,gBAAwB;;;ACAxB,kBAAmC;AACnC,mBAMO;;;ACGA,IAAM,cAAqB;AAAA,EAChC,MAAM;AAAA,EACN,MAAM;AAAA,EACN,KAAK;AAAA,EACL,IAAI;AAAA,EACJ,KAAK;AAAA,EACL,IAAI;AAAA,EACJ,KAAK;AAAA,EACL,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,KAAK;AACP;AAEO,IAAM,mBAAgC;AAAA,EA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eAAe,CAAC,KAAK,MAAM,CAAC,MAAM,QAAW;AAC/C,YAAM,CAAC,IAAI,MAAM,CAAC;AAAA,IACpB;AAAA,EACF;AAEA,SAAO;AACT;AAEO,IAAM,iBAAiB,CAAuB,UAAiB;AACpE,MAAI,MAAM;AAEV,aAAW,KAAK,OAAO;AACrB,QAAI,eAAe,CAAC,GAAG;AACrB,aAAO,OAAO,MAAM,CAAgB,CAAC;AAAA,IACvC;AAAA,EACF;AAEA,SAAO;AACT;;;AD3BO,SAAS,cAAoC,OAAc;AAChE,QAAM,MAAM,eAAe,KAAK;AAEhC,aAAO,uBAAQ,MAAM,kBAAkB,KAAK,GAAG,CAAC,GAAG,CAAC;AACtD;;;AEPA,IAAAC,gBAAwB;AAIjB,SAAS,WAAqB;AACnC,QAAM,UAAU,gBAAgB;AAEhC,aAAO,uBAAQ,MAAM,QAAQ,OAAO,CAAC,QAAQ,KAAK,CAAC;AACrD;;;ACRA,IAAAC,gBAAwB;AAYjB,IAAM,kBAAkB,CAI7B,gBACA,UACoB;AACpB,QAAM,QAAQ,SAAS;AAEvB,aAAO,uBAAQ,MAAM,eAAe,OAAO,KAAK,GAAG,CAAC,OAAO,KAAK,CAAC;AACnE;","names":["import_react","ThemeProvider","import_react","import_react","import_react","import_react","import_react","import_react"]}
@@ -0,0 +1,185 @@
1
+ import { ViewStyle, TextStyle, DimensionValue, StyleSheet } from 'react-native';
2
+ import { DeepPartial } from '@impulse-ui-native/core';
3
+ import * as react from 'react';
4
+ import { PropsWithChildren } from 'react';
5
+
6
+ declare const StylePropsSet: Set<keyof SpacingProps | keyof ColorProps | keyof ShadowProps | keyof BorderProps | keyof TypographyProps | keyof FlexProps>;
7
+
8
+ type BorderProps = {
9
+ borderRadius?: ViewStyle['borderRadius'];
10
+ borderColor?: ViewStyle['borderColor'];
11
+ borderWidth?: ViewStyle['borderWidth'];
12
+ borderStyle?: ViewStyle['borderStyle'];
13
+ };
14
+
15
+ type ColorProps = {
16
+ color?: TextStyle['color'];
17
+ backgroundColor?: ViewStyle['backgroundColor'];
18
+ opacity?: ViewStyle['opacity'];
19
+ };
20
+
21
+ type ComponentSize = "small" | "medium" | "large";
22
+
23
+ type FlexProps = {
24
+ flex?: ViewStyle["flex"];
25
+ flexGrow?: ViewStyle["flexGrow"];
26
+ flexShrink?: ViewStyle["flexShrink"];
27
+ flexBasis?: ViewStyle["flexBasis"];
28
+ flexDirection?: ViewStyle["flexDirection"];
29
+ flexWrap?: ViewStyle["flexWrap"];
30
+ justifyContent?: ViewStyle["justifyContent"];
31
+ alignItems?: ViewStyle["alignItems"];
32
+ alignSelf?: ViewStyle["alignSelf"];
33
+ alignContent?: ViewStyle["alignContent"];
34
+ gap?: ViewStyle["gap"];
35
+ rowGap?: ViewStyle["rowGap"];
36
+ columnGap?: ViewStyle["columnGap"];
37
+ position?: ViewStyle["position"];
38
+ top?: ViewStyle["top"];
39
+ right?: ViewStyle["right"];
40
+ bottom?: ViewStyle["bottom"];
41
+ left?: ViewStyle["left"];
42
+ };
43
+
44
+ type ShadowProps = {
45
+ shadowColor?: ViewStyle['shadowColor'];
46
+ shadowOpacity?: ViewStyle['shadowOpacity'];
47
+ shadowRadius?: ViewStyle['shadowRadius'];
48
+ shadowOffset?: ViewStyle['shadowOffset'];
49
+ elevation?: ViewStyle['elevation'];
50
+ };
51
+
52
+ type SpacingProps = {
53
+ margin?: ViewStyle['margin'];
54
+ marginTop?: ViewStyle['marginTop'];
55
+ marginBottom?: ViewStyle['marginBottom'];
56
+ marginLeft?: ViewStyle['marginLeft'];
57
+ marginRight?: ViewStyle['marginRight'];
58
+ marginHorizontal?: ViewStyle['marginHorizontal'];
59
+ marginVertical?: ViewStyle['marginVertical'];
60
+ padding?: ViewStyle['padding'];
61
+ paddingTop?: ViewStyle['paddingTop'];
62
+ paddingBottom?: ViewStyle['paddingBottom'];
63
+ paddingLeft?: ViewStyle['paddingLeft'];
64
+ paddingRight?: ViewStyle['paddingRight'];
65
+ paddingHorizontal?: ViewStyle['paddingHorizontal'];
66
+ paddingVertical?: ViewStyle['paddingVertical'];
67
+ };
68
+
69
+ type TypographyProps = {
70
+ fontSize?: TextStyle['fontSize'];
71
+ fontFamily?: TextStyle['fontFamily'];
72
+ fontWeight?: TextStyle['fontWeight'];
73
+ fontStyle?: TextStyle['fontStyle'];
74
+ letterSpacing?: TextStyle['letterSpacing'];
75
+ lineHeight?: TextStyle['lineHeight'];
76
+ textAlign?: TextStyle['textAlign'];
77
+ textDecorationLine?: TextStyle['textDecorationLine'];
78
+ textDecorationStyle?: TextStyle['textDecorationStyle'];
79
+ textDecorationColor?: TextStyle['textDecorationColor'];
80
+ textTransform?: TextStyle['textTransform'];
81
+ includeFontPadding?: TextStyle['includeFontPadding'];
82
+ textAlignVertical?: TextStyle['textAlignVertical'];
83
+ writingDirection?: TextStyle['writingDirection'];
84
+ };
85
+ type TypographyPresetKey = 'Master' | 'DisplayLarge' | 'DisplayMedium' | 'DisplaySmall' | 'Title1' | 'Title2' | 'Title3' | 'Title4' | 'Title5' | 'Title6' | 'Subtitle1' | 'Subtitle2' | 'BodyLarge' | 'Body' | 'BodySmall' | 'Caption' | 'Label' | 'Overline' | 'Helper' | 'Code' | 'Quote' | 'Eyebrow';
86
+
87
+ type StyleProps = Partial<SpacingProps & ColorProps & ShadowProps & BorderProps & TypographyProps & FlexProps>;
88
+ type StylePropKey = keyof StyleProps;
89
+
90
+ declare const LightTheme: AppTheme;
91
+ interface ThemeColors {
92
+ primary: string;
93
+ secondary: string;
94
+ neutral: NeutralColors;
95
+ white: string;
96
+ black: string;
97
+ error: string;
98
+ warning: string;
99
+ success: string;
100
+ info: string;
101
+ text: {
102
+ primary: string;
103
+ secondary: string;
104
+ };
105
+ background: {
106
+ primary: string;
107
+ secondary: string;
108
+ };
109
+ }
110
+ interface ComponentsThemes {
111
+ typography: Record<TypographyPresetKey, TypographyProps>;
112
+ }
113
+ interface AppTheme {
114
+ colors: ThemeColors;
115
+ spacing: Space;
116
+ radii: Radii;
117
+ borderSize: BorderSizes;
118
+ fontFamily: FontFamilyMap;
119
+ fontSize: FontSizes;
120
+ components?: DeepPartial<ComponentsThemes>;
121
+ }
122
+
123
+ declare const DarkTheme: AppTheme;
124
+
125
+ interface ThemeContextData {
126
+ loaded: boolean;
127
+ theme: AppTheme;
128
+ }
129
+ type ColorScheme = "light" | "dark";
130
+
131
+ type SpaceSizesKeys = "none" | "auto" | "xxs" | "xs" | "mxs" | "sm" | "msm" | "md" | "lg" | "xl" | "xxl";
132
+ type Space = Record<SpaceSizesKeys, DimensionValue>;
133
+ type FontSizesKeys = "xxs" | "xs" | "xsm" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "huge" | "massive";
134
+ type FontSizes = Record<FontSizesKeys, number>;
135
+ type LineHeightKeys = "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
136
+ type LineHeights = Record<LineHeightKeys, string>;
137
+ type FontWeightKey = "thin" | "extraLight" | "light" | "regular" | "medium" | "semiBold" | "bold" | "extraBold" | "black";
138
+ type FontWeights = Record<FontWeightKey, "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900">;
139
+ type LetterSpacingKey = "tightest" | "tighter" | "tight" | "normal" | "wide" | "wider" | "widest" | "ultraWide";
140
+ type LetterSpacings = Record<LetterSpacingKey, number>;
141
+ type BorderSizeKey = "sm" | "md" | "lg" | "xl" | "xxl";
142
+ type BorderSizes = Record<BorderSizeKey, number>;
143
+ type RadiusKey = "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "round";
144
+ type Radii = Record<RadiusKey, number>;
145
+ type RadiusDrawnKey = "drawn1" | "drawn2" | "drawn3" | "drawn4" | "drawn5" | "drawn6";
146
+ type RadiiDrawn = Record<RadiusDrawnKey, string>;
147
+ type RadiusBlobKey = "blob1" | "blob2" | "blob3" | "blob4" | "blob5";
148
+ type RadiiBlob = Record<RadiusBlobKey, string>;
149
+ type RadiusConditionalKey = "conditional1" | "conditional2" | "conditional3" | "conditional4" | "conditional5" | "conditional6";
150
+ type RadiiConditional = Record<RadiusConditionalKey, string>;
151
+ type NeutralColorKey = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13";
152
+ type NeutralColors = Record<NeutralColorKey, string>;
153
+ type FontFamilyKey = "thin" | "thinItalic" | "extraLight" | "extraLightItalic" | "light" | "lightItalic" | "regular" | "italic" | "medium" | "mediumItalic" | "semiBold" | "semiBoldItalic" | "bold" | "boldItalic" | "extraBold" | "extraBoldItalic" | "black" | "blackItalic";
154
+ type FontFamilyMap = Record<FontFamilyKey, string>;
155
+
156
+ declare function useBorder(): BorderSizes;
157
+
158
+ declare function useColors(): ThemeColors;
159
+
160
+ declare function useRadii(): Radii;
161
+
162
+ declare function useSpace(): Space;
163
+
164
+ declare function useStyleProps<Props extends object>(props: Props): Partial<SpacingProps & ColorProps & ShadowProps & BorderProps & TypographyProps & FlexProps>;
165
+
166
+ declare function useTheme(): AppTheme;
167
+
168
+ type ThemedStyles<T extends StyleSheet.NamedStyles<T>> = T;
169
+ type StyledFunction<Props extends object, T extends StyleSheet.NamedStyles<T>> = (theme: AppTheme, props: Props) => ThemedStyles<T>;
170
+ declare const useThemedStyles: <Props extends object, T extends StyleSheet.NamedStyles<T>>(styledFunction: StyledFunction<Props, T>, props: Props) => ThemedStyles<T>;
171
+
172
+ interface ThemeProviderProps {
173
+ scheme: ColorScheme;
174
+ theme: {
175
+ light: AppTheme;
176
+ dark: AppTheme;
177
+ };
178
+ }
179
+ declare const ThemeProvider: react.NamedExoticComponent<PropsWithChildren<DeepPartial<ThemeProviderProps>>>;
180
+ declare function useThemeContext(): ThemeContextData;
181
+
182
+ declare const extractStyleProps: <Props extends object>(props: Props) => StyleProps;
183
+ declare const createStyleKey: <Props extends object>(props: Props) => string;
184
+
185
+ export { type AppTheme, type BorderProps, type BorderSizeKey, type BorderSizes, type ColorProps, type ColorScheme, type ComponentSize, DarkTheme, type FlexProps, type FontFamilyKey, type FontFamilyMap, type FontSizes, type FontSizesKeys, type FontWeightKey, type FontWeights, type LetterSpacingKey, type LetterSpacings, LightTheme, type LineHeightKeys, type LineHeights, type NeutralColorKey, type NeutralColors, type Radii, type RadiiBlob, type RadiiConditional, type RadiiDrawn, type RadiusBlobKey, type RadiusConditionalKey, type RadiusDrawnKey, type RadiusKey, type ShadowProps, type Space, type SpaceSizesKeys, type SpacingProps, type StylePropKey, type StyleProps, StylePropsSet, type ThemeContextData, ThemeProvider, type TypographyPresetKey, type TypographyProps, createStyleKey, extractStyleProps, useBorder, useColors, useRadii, useSpace, useStyleProps, useTheme, useThemeContext, useThemedStyles };