@crystin001/theme-settings-lib 1.0.0 → 1.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.
- package/README.md +71 -38
- package/dist/components/ThemeShowcase.d.ts +10 -0
- package/dist/components/ThemeShowcase.d.ts.map +1 -0
- package/dist/components/ThemeShowcase.js +357 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/stories/ThemeStories.d.ts +6 -0
- package/dist/stories/ThemeStories.d.ts.map +1 -0
- package/dist/stories/ThemeStories.js +285 -0
- package/dist/stories/index.d.ts +2 -0
- package/dist/stories/index.d.ts.map +1 -0
- package/dist/stories/index.js +4 -0
- package/dist/theme-validation.d.ts +27 -0
- package/dist/theme-validation.d.ts.map +1 -0
- package/dist/theme-validation.js +114 -0
- package/dist/theme.d.ts +15 -0
- package/dist/theme.d.ts.map +1 -1
- package/dist/theme.js +263 -7
- package/package.json +26 -14
package/README.md
CHANGED
|
@@ -24,7 +24,9 @@ Add to your `package.json`:
|
|
|
24
24
|
}
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
Then run `npm install`.
|
|
27
|
+
Then run `npm install`. The library will automatically build during installation.
|
|
28
|
+
|
|
29
|
+
**Note:** The library requires TypeScript to build. It will be installed automatically as a dev dependency and the build will run during `npm install`.
|
|
28
30
|
|
|
29
31
|
To install a specific version or branch:
|
|
30
32
|
|
|
@@ -36,18 +38,20 @@ To install a specific version or branch:
|
|
|
36
38
|
}
|
|
37
39
|
```
|
|
38
40
|
|
|
39
|
-
### Option B: Local Package (
|
|
41
|
+
### Option B: Local Package (Development)
|
|
40
42
|
|
|
41
|
-
|
|
43
|
+
For local development, you can use a file path to link the library directly:
|
|
42
44
|
|
|
43
45
|
```json
|
|
44
46
|
{
|
|
45
47
|
"dependencies": {
|
|
46
|
-
"@crystin001/theme-settings-lib": "file:../
|
|
48
|
+
"@crystin001/theme-settings-lib": "file:../theme-settings-lib"
|
|
47
49
|
}
|
|
48
50
|
}
|
|
49
51
|
```
|
|
50
52
|
|
|
53
|
+
**Note:** Make sure to run `npm run build` in the library directory after making changes.
|
|
54
|
+
|
|
51
55
|
### Option C: npm Package (Future)
|
|
52
56
|
|
|
53
57
|
```bash
|
|
@@ -302,42 +306,15 @@ import { ensureContrast } from '@crystin001/theme-settings-lib';
|
|
|
302
306
|
const readableColor = ensureContrast('#888888', '#FFFFFF', 'AA');
|
|
303
307
|
```
|
|
304
308
|
|
|
305
|
-
## Development
|
|
306
|
-
|
|
307
|
-
### Building the Library
|
|
308
|
-
|
|
309
|
-
```bash
|
|
310
|
-
npm run build
|
|
311
|
-
```
|
|
312
|
-
|
|
313
|
-
This compiles TypeScript to JavaScript and generates type declaration files in the `dist/` folder.
|
|
314
|
-
|
|
315
|
-
### Project Structure
|
|
316
|
-
|
|
317
|
-
```
|
|
318
|
-
theme-settings-lib/
|
|
319
|
-
├── src/
|
|
320
|
-
│ ├── hooks/ # React hooks
|
|
321
|
-
│ ├── theme.ts # Theme definitions
|
|
322
|
-
│ ├── i18n.ts # Internationalization setup
|
|
323
|
-
│ ├── settings-context.tsx # Settings provider
|
|
324
|
-
│ ├── color-utils.ts # Color utility functions
|
|
325
|
-
│ └── index.ts # Main exports
|
|
326
|
-
├── dist/ # Compiled output (generated)
|
|
327
|
-
├── package.json
|
|
328
|
-
└── tsconfig.json
|
|
329
|
-
```
|
|
330
|
-
|
|
331
|
-
## Updating the Library
|
|
309
|
+
## Contributing / Development
|
|
332
310
|
|
|
333
|
-
|
|
311
|
+
For information about developing the library, including:
|
|
312
|
+
- Building the library
|
|
313
|
+
- Running the example app for visual theme development
|
|
314
|
+
- Project structure
|
|
315
|
+
- Development workflow
|
|
334
316
|
|
|
335
|
-
|
|
336
|
-
2. Run `npm run build` to compile
|
|
337
|
-
3. Update the version in `package.json`
|
|
338
|
-
4. Commit and push to the repository
|
|
339
|
-
5. In each app, update the dependency version and run `npm install`
|
|
340
|
-
6. Apps will automatically get the latest themes and translations
|
|
317
|
+
See [SETUP.md](./SETUP.md) in the repository.
|
|
341
318
|
|
|
342
319
|
## Versioning
|
|
343
320
|
|
|
@@ -347,6 +324,57 @@ The library follows [Semantic Versioning](https://semver.org/):
|
|
|
347
324
|
- **Minor** (0.x.0) - New themes, features, or languages
|
|
348
325
|
- **Patch** (0.0.x) - Bug fixes and theme adjustments
|
|
349
326
|
|
|
327
|
+
## Troubleshooting
|
|
328
|
+
|
|
329
|
+
### "Unable to resolve path to module" Error
|
|
330
|
+
|
|
331
|
+
If you get an error like `Unable to resolve path to module '@crystin001/theme-settings-lib'`, try these steps:
|
|
332
|
+
|
|
333
|
+
1. **The library should build automatically during installation.** If you're using a local file path and made changes, rebuild:
|
|
334
|
+
```bash
|
|
335
|
+
cd theme-settings-lib
|
|
336
|
+
npm run build
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
**Note:** When installing from git, the library builds automatically via the `prepare` script. You only need to manually build if using a local `file:` path and making changes.
|
|
340
|
+
|
|
341
|
+
2. **Clear Metro cache and restart:**
|
|
342
|
+
```bash
|
|
343
|
+
# In your app directory
|
|
344
|
+
npx react-native start --reset-cache
|
|
345
|
+
# Or for Expo:
|
|
346
|
+
npx expo start --clear
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
3. **Reinstall dependencies:**
|
|
350
|
+
```bash
|
|
351
|
+
# In your app directory
|
|
352
|
+
rm -rf node_modules
|
|
353
|
+
npm install
|
|
354
|
+
# Or if using yarn:
|
|
355
|
+
rm -rf node_modules
|
|
356
|
+
yarn install
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
4. **If using local file path, verify the path is correct:**
|
|
360
|
+
```json
|
|
361
|
+
{
|
|
362
|
+
"dependencies": {
|
|
363
|
+
"@crystin001/theme-settings-lib": "file:../theme-settings-lib"
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
```
|
|
367
|
+
Make sure the relative path from your app's `package.json` to the library is correct.
|
|
368
|
+
|
|
369
|
+
5. **For Expo projects, you may need to restart the development server completely:**
|
|
370
|
+
```bash
|
|
371
|
+
# Stop the server, then:
|
|
372
|
+
npx expo start --clear
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
6. **Check that `dist/` folder exists and contains compiled files:**
|
|
376
|
+
The library must be built before it can be used. Run `npm run build` in the library directory.
|
|
377
|
+
|
|
350
378
|
## Peer Dependencies
|
|
351
379
|
|
|
352
380
|
This library requires the following peer dependencies (installed by your app):
|
|
@@ -366,3 +394,8 @@ MIT
|
|
|
366
394
|
## Repository
|
|
367
395
|
|
|
368
396
|
[https://github.com/trial-and-code/theme-settings-lib](https://github.com/trial-and-code/theme-settings-lib)
|
|
397
|
+
|
|
398
|
+
---
|
|
399
|
+
|
|
400
|
+
**For developers:** See [SETUP.md](./SETUP.md) for development setup, building the library, and running the example app.
|
|
401
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ThemeShowcase Component
|
|
3
|
+
*
|
|
4
|
+
* A visual component to showcase all available themes for development purposes.
|
|
5
|
+
* Displays all theme families with their light and dark variants, showing
|
|
6
|
+
* color palettes and sample UI components.
|
|
7
|
+
*/
|
|
8
|
+
import React from 'react';
|
|
9
|
+
export declare function ThemeShowcase(): React.JSX.Element;
|
|
10
|
+
//# sourceMappingURL=ThemeShowcase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemeShowcase.d.ts","sourceRoot":"","sources":["../../src/components/ThemeShowcase.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAmB,MAAM,OAAO,CAAC;AAmIxC,wBAAgB,aAAa,sBA0E5B"}
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ThemeShowcase Component
|
|
4
|
+
*
|
|
5
|
+
* A visual component to showcase all available themes for development purposes.
|
|
6
|
+
* Displays all theme families with their light and dark variants, showing
|
|
7
|
+
* color palettes and sample UI components.
|
|
8
|
+
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
+
var ownKeys = function(o) {
|
|
27
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
+
var ar = [];
|
|
29
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
+
return ar;
|
|
31
|
+
};
|
|
32
|
+
return ownKeys(o);
|
|
33
|
+
};
|
|
34
|
+
return function (mod) {
|
|
35
|
+
if (mod && mod.__esModule) return mod;
|
|
36
|
+
var result = {};
|
|
37
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
+
__setModuleDefault(result, mod);
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
})();
|
|
42
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
+
exports.ThemeShowcase = ThemeShowcase;
|
|
44
|
+
const react_1 = __importStar(require("react"));
|
|
45
|
+
const react_native_1 = require("react-native");
|
|
46
|
+
const theme_1 = require("../theme");
|
|
47
|
+
const settings_context_1 = require("../settings-context");
|
|
48
|
+
const { width } = react_native_1.Dimensions.get('window');
|
|
49
|
+
const CARD_WIDTH = width > 600 ? (width - 60) / 2 : width - 40;
|
|
50
|
+
function ColorSwatch({ label, color, textColor }) {
|
|
51
|
+
return (<react_native_1.View style={[styles.swatch, { backgroundColor: color }]}>
|
|
52
|
+
<react_native_1.Text style={[styles.swatchLabel, { color: textColor || '#000' }]} numberOfLines={1}>
|
|
53
|
+
{label}
|
|
54
|
+
</react_native_1.Text>
|
|
55
|
+
<react_native_1.Text style={[styles.swatchValue, { color: textColor || '#000' }]} numberOfLines={1}>
|
|
56
|
+
{color}
|
|
57
|
+
</react_native_1.Text>
|
|
58
|
+
</react_native_1.View>);
|
|
59
|
+
}
|
|
60
|
+
function ThemeCard({ themeName, colors, isSelected, onSelect }) {
|
|
61
|
+
const displayName = themeName.replace(/-/g, ' ').replace(/\b\w/g, (l) => l.toUpperCase());
|
|
62
|
+
const isDark = themeName.endsWith('-dark');
|
|
63
|
+
return (<react_native_1.Pressable onPress={onSelect} style={[
|
|
64
|
+
styles.themeCard,
|
|
65
|
+
{
|
|
66
|
+
backgroundColor: colors.card,
|
|
67
|
+
borderColor: isSelected ? colors.primary : colors.border,
|
|
68
|
+
borderWidth: isSelected ? 3 : 1,
|
|
69
|
+
},
|
|
70
|
+
isSelected && styles.selectedCard,
|
|
71
|
+
]}>
|
|
72
|
+
<react_native_1.View style={[styles.themeHeader, { backgroundColor: colors.background }]}>
|
|
73
|
+
<react_native_1.Text style={[styles.themeTitle, { color: colors.text }]}>{displayName}</react_native_1.Text>
|
|
74
|
+
{isSelected && (<react_native_1.View style={[styles.selectedBadge, { backgroundColor: colors.primary }]}>
|
|
75
|
+
<react_native_1.Text style={[styles.selectedBadgeText, { color: colors.buttonText }]}>Active</react_native_1.Text>
|
|
76
|
+
</react_native_1.View>)}
|
|
77
|
+
</react_native_1.View>
|
|
78
|
+
|
|
79
|
+
<react_native_1.View style={styles.colorGrid}>
|
|
80
|
+
<ColorSwatch label="Background" color={colors.background} textColor={colors.text}/>
|
|
81
|
+
<ColorSwatch label="Text" color={colors.text}/>
|
|
82
|
+
<ColorSwatch label="Primary" color={colors.primary}/>
|
|
83
|
+
<ColorSwatch label="Secondary" color={colors.secondary}/>
|
|
84
|
+
<ColorSwatch label="Tint" color={colors.tint}/>
|
|
85
|
+
<ColorSwatch label="Card" color={colors.card} textColor={colors.cardText}/>
|
|
86
|
+
</react_native_1.View>
|
|
87
|
+
|
|
88
|
+
<react_native_1.View style={styles.sampleSection}>
|
|
89
|
+
<react_native_1.Text style={[styles.sampleLabel, { color: colors.text }]}>Sample UI:</react_native_1.Text>
|
|
90
|
+
|
|
91
|
+
<react_native_1.View style={[styles.sampleCard, { backgroundColor: colors.card, borderColor: colors.border }]}>
|
|
92
|
+
<react_native_1.Text style={[styles.sampleText, { color: colors.cardText }]}>
|
|
93
|
+
Sample card content
|
|
94
|
+
</react_native_1.Text>
|
|
95
|
+
</react_native_1.View>
|
|
96
|
+
|
|
97
|
+
<react_native_1.View style={styles.buttonRow}>
|
|
98
|
+
<react_native_1.Pressable style={[styles.sampleButton, { backgroundColor: colors.button }]} onPress={() => { }}>
|
|
99
|
+
<react_native_1.Text style={[styles.sampleButtonText, { color: colors.buttonText }]}>
|
|
100
|
+
Primary
|
|
101
|
+
</react_native_1.Text>
|
|
102
|
+
</react_native_1.Pressable>
|
|
103
|
+
<react_native_1.Pressable style={[styles.sampleButton, styles.sampleButtonSecondary, { backgroundColor: colors.buttonSecondary }]} onPress={() => { }}>
|
|
104
|
+
<react_native_1.Text style={[styles.sampleButtonText, { color: colors.buttonSecondaryText }]}>
|
|
105
|
+
Secondary
|
|
106
|
+
</react_native_1.Text>
|
|
107
|
+
</react_native_1.Pressable>
|
|
108
|
+
</react_native_1.View>
|
|
109
|
+
|
|
110
|
+
<react_native_1.View style={styles.statusRow}>
|
|
111
|
+
<react_native_1.View style={[styles.statusBadge, { backgroundColor: colors.success }]}>
|
|
112
|
+
<react_native_1.Text style={[styles.statusText, { color: '#FFF' }]}>Success</react_native_1.Text>
|
|
113
|
+
</react_native_1.View>
|
|
114
|
+
<react_native_1.View style={[styles.statusBadge, { backgroundColor: colors.warning }]}>
|
|
115
|
+
<react_native_1.Text style={[styles.statusText, { color: '#000' }]}>Warning</react_native_1.Text>
|
|
116
|
+
</react_native_1.View>
|
|
117
|
+
<react_native_1.View style={[styles.statusBadge, { backgroundColor: colors.error }]}>
|
|
118
|
+
<react_native_1.Text style={[styles.statusText, { color: '#FFF' }]}>Error</react_native_1.Text>
|
|
119
|
+
</react_native_1.View>
|
|
120
|
+
<react_native_1.View style={[styles.statusBadge, { backgroundColor: colors.info }]}>
|
|
121
|
+
<react_native_1.Text style={[styles.statusText, { color: '#FFF' }]}>Info</react_native_1.Text>
|
|
122
|
+
</react_native_1.View>
|
|
123
|
+
</react_native_1.View>
|
|
124
|
+
|
|
125
|
+
<react_native_1.View style={[styles.sampleInput, { backgroundColor: colors.input, borderColor: colors.inputBorder }]}>
|
|
126
|
+
<react_native_1.Text style={[styles.sampleInputText, { color: colors.inputText }]}>
|
|
127
|
+
Sample input field
|
|
128
|
+
</react_native_1.Text>
|
|
129
|
+
</react_native_1.View>
|
|
130
|
+
</react_native_1.View>
|
|
131
|
+
</react_native_1.Pressable>);
|
|
132
|
+
}
|
|
133
|
+
function ThemeShowcase() {
|
|
134
|
+
const { currentTheme, setThemeFamily, availableThemeFamilies } = (0, settings_context_1.useSettings)();
|
|
135
|
+
const [filter, setFilter] = (0, react_1.useState)('all');
|
|
136
|
+
const themeEntries = Object.entries(theme_1.Themes);
|
|
137
|
+
const filteredThemes = themeEntries.filter(([name]) => {
|
|
138
|
+
if (filter === 'light')
|
|
139
|
+
return name.endsWith('-light');
|
|
140
|
+
if (filter === 'dark')
|
|
141
|
+
return name.endsWith('-dark');
|
|
142
|
+
return true;
|
|
143
|
+
});
|
|
144
|
+
const handleThemeSelect = (themeName) => {
|
|
145
|
+
// Extract theme family from theme name (e.g., 'neon-surf-light' -> 'neon-surf')
|
|
146
|
+
const family = themeName.replace(/-light$|-dark$/, '');
|
|
147
|
+
setThemeFamily(family);
|
|
148
|
+
};
|
|
149
|
+
return (<react_native_1.View style={styles.container}>
|
|
150
|
+
<react_native_1.View style={styles.header}>
|
|
151
|
+
<react_native_1.Text style={styles.headerTitle}>Theme Showcase</react_native_1.Text>
|
|
152
|
+
<react_native_1.Text style={styles.headerSubtitle}>
|
|
153
|
+
Tap any theme card to apply it
|
|
154
|
+
</react_native_1.Text>
|
|
155
|
+
</react_native_1.View>
|
|
156
|
+
|
|
157
|
+
<react_native_1.View style={styles.filterContainer}>
|
|
158
|
+
<react_native_1.TouchableOpacity style={[styles.filterButton, filter === 'all' && styles.filterButtonActive]} onPress={() => setFilter('all')}>
|
|
159
|
+
<react_native_1.Text style={[styles.filterText, filter === 'all' && styles.filterTextActive]}>
|
|
160
|
+
All
|
|
161
|
+
</react_native_1.Text>
|
|
162
|
+
</react_native_1.TouchableOpacity>
|
|
163
|
+
<react_native_1.TouchableOpacity style={[styles.filterButton, filter === 'light' && styles.filterButtonActive]} onPress={() => setFilter('light')}>
|
|
164
|
+
<react_native_1.Text style={[styles.filterText, filter === 'light' && styles.filterTextActive]}>
|
|
165
|
+
Light
|
|
166
|
+
</react_native_1.Text>
|
|
167
|
+
</react_native_1.TouchableOpacity>
|
|
168
|
+
<react_native_1.TouchableOpacity style={[styles.filterButton, filter === 'dark' && styles.filterButtonActive]} onPress={() => setFilter('dark')}>
|
|
169
|
+
<react_native_1.Text style={[styles.filterText, filter === 'dark' && styles.filterTextActive]}>
|
|
170
|
+
Dark
|
|
171
|
+
</react_native_1.Text>
|
|
172
|
+
</react_native_1.TouchableOpacity>
|
|
173
|
+
</react_native_1.View>
|
|
174
|
+
|
|
175
|
+
<react_native_1.ScrollView style={styles.scrollView} contentContainerStyle={styles.scrollContent} showsVerticalScrollIndicator={true}>
|
|
176
|
+
{filteredThemes.map(([themeName, colors]) => {
|
|
177
|
+
const isSelected = currentTheme === themeName;
|
|
178
|
+
return (<ThemeCard key={themeName} themeName={themeName} colors={colors} isSelected={isSelected} onSelect={() => handleThemeSelect(themeName)}/>);
|
|
179
|
+
})}
|
|
180
|
+
</react_native_1.ScrollView>
|
|
181
|
+
</react_native_1.View>);
|
|
182
|
+
}
|
|
183
|
+
const styles = react_native_1.StyleSheet.create({
|
|
184
|
+
container: {
|
|
185
|
+
flex: 1,
|
|
186
|
+
backgroundColor: '#F5F5F5',
|
|
187
|
+
},
|
|
188
|
+
header: {
|
|
189
|
+
padding: 20,
|
|
190
|
+
paddingTop: 40,
|
|
191
|
+
backgroundColor: '#FFF',
|
|
192
|
+
borderBottomWidth: 1,
|
|
193
|
+
borderBottomColor: '#E0E0E0',
|
|
194
|
+
},
|
|
195
|
+
headerTitle: {
|
|
196
|
+
fontSize: 28,
|
|
197
|
+
fontWeight: 'bold',
|
|
198
|
+
color: '#000',
|
|
199
|
+
marginBottom: 4,
|
|
200
|
+
},
|
|
201
|
+
headerSubtitle: {
|
|
202
|
+
fontSize: 14,
|
|
203
|
+
color: '#666',
|
|
204
|
+
},
|
|
205
|
+
filterContainer: {
|
|
206
|
+
flexDirection: 'row',
|
|
207
|
+
padding: 12,
|
|
208
|
+
backgroundColor: '#FFF',
|
|
209
|
+
borderBottomWidth: 1,
|
|
210
|
+
borderBottomColor: '#E0E0E0',
|
|
211
|
+
gap: 8,
|
|
212
|
+
},
|
|
213
|
+
filterButton: {
|
|
214
|
+
paddingHorizontal: 16,
|
|
215
|
+
paddingVertical: 8,
|
|
216
|
+
borderRadius: 20,
|
|
217
|
+
backgroundColor: '#F0F0F0',
|
|
218
|
+
},
|
|
219
|
+
filterButtonActive: {
|
|
220
|
+
backgroundColor: '#007AFF',
|
|
221
|
+
},
|
|
222
|
+
filterText: {
|
|
223
|
+
fontSize: 14,
|
|
224
|
+
color: '#666',
|
|
225
|
+
fontWeight: '500',
|
|
226
|
+
},
|
|
227
|
+
filterTextActive: {
|
|
228
|
+
color: '#FFF',
|
|
229
|
+
},
|
|
230
|
+
scrollView: {
|
|
231
|
+
flex: 1,
|
|
232
|
+
},
|
|
233
|
+
scrollContent: {
|
|
234
|
+
padding: 20,
|
|
235
|
+
gap: 20,
|
|
236
|
+
},
|
|
237
|
+
themeCard: {
|
|
238
|
+
width: CARD_WIDTH,
|
|
239
|
+
alignSelf: 'center',
|
|
240
|
+
borderRadius: 12,
|
|
241
|
+
padding: 16,
|
|
242
|
+
marginBottom: 8,
|
|
243
|
+
shadowColor: '#000',
|
|
244
|
+
shadowOffset: { width: 0, height: 2 },
|
|
245
|
+
shadowOpacity: 0.1,
|
|
246
|
+
shadowRadius: 4,
|
|
247
|
+
elevation: 3,
|
|
248
|
+
},
|
|
249
|
+
selectedCard: {
|
|
250
|
+
shadowOpacity: 0.2,
|
|
251
|
+
shadowRadius: 8,
|
|
252
|
+
elevation: 6,
|
|
253
|
+
},
|
|
254
|
+
themeHeader: {
|
|
255
|
+
flexDirection: 'row',
|
|
256
|
+
justifyContent: 'space-between',
|
|
257
|
+
alignItems: 'center',
|
|
258
|
+
marginBottom: 16,
|
|
259
|
+
padding: 12,
|
|
260
|
+
borderRadius: 8,
|
|
261
|
+
},
|
|
262
|
+
themeTitle: {
|
|
263
|
+
fontSize: 18,
|
|
264
|
+
fontWeight: 'bold',
|
|
265
|
+
flex: 1,
|
|
266
|
+
},
|
|
267
|
+
selectedBadge: {
|
|
268
|
+
paddingHorizontal: 8,
|
|
269
|
+
paddingVertical: 4,
|
|
270
|
+
borderRadius: 12,
|
|
271
|
+
},
|
|
272
|
+
selectedBadgeText: {
|
|
273
|
+
fontSize: 12,
|
|
274
|
+
fontWeight: '600',
|
|
275
|
+
},
|
|
276
|
+
colorGrid: {
|
|
277
|
+
flexDirection: 'row',
|
|
278
|
+
flexWrap: 'wrap',
|
|
279
|
+
gap: 8,
|
|
280
|
+
marginBottom: 16,
|
|
281
|
+
},
|
|
282
|
+
swatch: {
|
|
283
|
+
width: (CARD_WIDTH - 48) / 3 - 6,
|
|
284
|
+
height: 60,
|
|
285
|
+
borderRadius: 6,
|
|
286
|
+
padding: 6,
|
|
287
|
+
justifyContent: 'flex-end',
|
|
288
|
+
},
|
|
289
|
+
swatchLabel: {
|
|
290
|
+
fontSize: 10,
|
|
291
|
+
fontWeight: '600',
|
|
292
|
+
marginBottom: 2,
|
|
293
|
+
},
|
|
294
|
+
swatchValue: {
|
|
295
|
+
fontSize: 9,
|
|
296
|
+
opacity: 0.8,
|
|
297
|
+
},
|
|
298
|
+
sampleSection: {
|
|
299
|
+
marginTop: 8,
|
|
300
|
+
},
|
|
301
|
+
sampleLabel: {
|
|
302
|
+
fontSize: 14,
|
|
303
|
+
fontWeight: '600',
|
|
304
|
+
marginBottom: 8,
|
|
305
|
+
},
|
|
306
|
+
sampleCard: {
|
|
307
|
+
padding: 12,
|
|
308
|
+
borderRadius: 8,
|
|
309
|
+
borderWidth: 1,
|
|
310
|
+
marginBottom: 12,
|
|
311
|
+
},
|
|
312
|
+
sampleText: {
|
|
313
|
+
fontSize: 14,
|
|
314
|
+
},
|
|
315
|
+
buttonRow: {
|
|
316
|
+
flexDirection: 'row',
|
|
317
|
+
gap: 8,
|
|
318
|
+
marginBottom: 12,
|
|
319
|
+
},
|
|
320
|
+
sampleButton: {
|
|
321
|
+
flex: 1,
|
|
322
|
+
paddingVertical: 10,
|
|
323
|
+
paddingHorizontal: 16,
|
|
324
|
+
borderRadius: 6,
|
|
325
|
+
alignItems: 'center',
|
|
326
|
+
},
|
|
327
|
+
sampleButtonSecondary: {
|
|
328
|
+
// Additional styles if needed
|
|
329
|
+
},
|
|
330
|
+
sampleButtonText: {
|
|
331
|
+
fontSize: 14,
|
|
332
|
+
fontWeight: '600',
|
|
333
|
+
},
|
|
334
|
+
statusRow: {
|
|
335
|
+
flexDirection: 'row',
|
|
336
|
+
flexWrap: 'wrap',
|
|
337
|
+
gap: 8,
|
|
338
|
+
marginBottom: 12,
|
|
339
|
+
},
|
|
340
|
+
statusBadge: {
|
|
341
|
+
paddingHorizontal: 10,
|
|
342
|
+
paddingVertical: 6,
|
|
343
|
+
borderRadius: 12,
|
|
344
|
+
},
|
|
345
|
+
statusText: {
|
|
346
|
+
fontSize: 11,
|
|
347
|
+
fontWeight: '600',
|
|
348
|
+
},
|
|
349
|
+
sampleInput: {
|
|
350
|
+
padding: 12,
|
|
351
|
+
borderRadius: 6,
|
|
352
|
+
borderWidth: 1,
|
|
353
|
+
},
|
|
354
|
+
sampleInputText: {
|
|
355
|
+
fontSize: 14,
|
|
356
|
+
},
|
|
357
|
+
});
|
package/dist/index.d.ts
CHANGED
|
@@ -23,5 +23,6 @@ export * from './i18n';
|
|
|
23
23
|
export * from './hooks/use-theme-color';
|
|
24
24
|
export * from './hooks/use-translation';
|
|
25
25
|
export * from './color-utils';
|
|
26
|
+
export * from './theme-validation';
|
|
26
27
|
export { default as i18n } from './i18n';
|
|
27
28
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,cAAc,SAAS,CAAC;AAGxB,cAAc,oBAAoB,CAAC;AAGnC,cAAc,QAAQ,CAAC;AAGvB,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AAGxC,cAAc,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,cAAc,SAAS,CAAC;AAGxB,cAAc,oBAAoB,CAAC;AAGnC,cAAc,QAAQ,CAAC;AAGvB,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AAGxC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AAGnC,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -48,6 +48,7 @@ __exportStar(require("./hooks/use-theme-color"), exports);
|
|
|
48
48
|
__exportStar(require("./hooks/use-translation"), exports);
|
|
49
49
|
// Utility exports
|
|
50
50
|
__exportStar(require("./color-utils"), exports);
|
|
51
|
+
__exportStar(require("./theme-validation"), exports);
|
|
51
52
|
// Re-export i18n instance for apps that need direct access
|
|
52
53
|
var i18n_1 = require("./i18n");
|
|
53
54
|
Object.defineProperty(exports, "i18n", { enumerable: true, get: function () { return __importDefault(i18n_1).default; } });
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const AllThemes: () => React.JSX.Element;
|
|
3
|
+
export declare const LightThemes: () => React.JSX.Element;
|
|
4
|
+
export declare const DarkThemes: () => React.JSX.Element;
|
|
5
|
+
export declare const IndividualThemes: () => React.JSX.Element;
|
|
6
|
+
//# sourceMappingURL=ThemeStories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemeStories.d.ts","sourceRoot":"","sources":["../../src/stories/ThemeStories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAkG1B,eAAO,MAAM,SAAS,yBAgBrB,CAAC;AAGF,eAAO,MAAM,WAAW,yBAevB,CAAC;AAGF,eAAO,MAAM,UAAU,yBAetB,CAAC;AAGF,eAAO,MAAM,gBAAgB,yBAsB5B,CAAC"}
|