@app-studio/web 0.9.84 → 0.9.85
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/dist/components/Button/Button/Button.view.d.ts +1 -1
- package/dist/components/Formik/Formik.ColorInput.d.ts +1 -1
- package/dist/components/Gradient/Gradient.d.ts +4 -4
- package/dist/components/Title/Title/Title.props.d.ts +3 -3
- package/dist/components/Title/Title/Title.type.d.ts +1 -1
- package/dist/web.cjs.development.js +752 -781
- package/dist/web.cjs.development.js.map +1 -1
- package/dist/web.cjs.production.min.js +1 -1
- package/dist/web.cjs.production.min.js.map +1 -1
- package/dist/web.esm.js +752 -781
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +752 -781
- package/dist/web.umd.development.js.map +1 -1
- package/dist/web.umd.production.min.js +1 -1
- package/dist/web.umd.production.min.js.map +1 -1
- package/docs/app-studio/Components.md +8 -8
- package/docs/app-studio/Design.md +2 -2
- package/docs/app-studio/Events.md +31 -31
- package/docs/app-studio/Hooks.md +6 -6
- package/docs/app-studio/Providers.md +2 -2
- package/docs/app-studio/README.md +30 -30
- package/docs/app-studio/Responsive.md +3 -3
- package/docs/app-studio/Theming.md +114 -113
- package/docs/app-studio.md +2 -2
- package/docs/component-development/guide.md +10 -10
- package/docs/components/Background.mdx +2 -2
- package/docs/components/Badge.mdx +1 -1
- package/docs/components/Button.mdx +2 -2
- package/docs/components/Carousel.mdx +15 -15
- package/docs/components/Center.mdx +40 -40
- package/docs/components/Checkbox.mdx +5 -5
- package/docs/components/ColorInput.mdx +13 -13
- package/docs/components/ColorPicker.mdx +17 -17
- package/docs/components/ContextMenu.mdx +1 -1
- package/docs/components/DatePicker.mdx +6 -6
- package/docs/components/DragAndDrop.mdx +8 -8
- package/docs/components/Drawer.mdx +3 -3
- package/docs/components/Form.mdx +2 -2
- package/docs/components/Formik.mdx +3 -3
- package/docs/components/Gradient.mdx +32 -32
- package/docs/components/Horizontal.mdx +3 -3
- package/docs/components/HoverCard.mdx +3 -3
- package/docs/components/Icon.mdx +14 -14
- package/docs/components/Label.mdx +28 -28
- package/docs/components/Link.mdx +2 -2
- package/docs/components/Loader.mdx +16 -16
- package/docs/components/OTPInput.mdx +9 -9
- package/docs/components/Password.mdx +1 -1
- package/docs/components/ProgressBar.mdx +9 -9
- package/docs/components/Resizable.mdx +6 -6
- package/docs/components/Selector.mdx +4 -4
- package/docs/components/Sidebar.mdx +2 -2
- package/docs/components/Slider.mdx +10 -10
- package/docs/components/StatusIndicator.mdx +5 -5
- package/docs/components/Switch.mdx +1 -1
- package/docs/components/TagInput.mdx +8 -8
- package/docs/components/Text.mdx +1 -1
- package/docs/components/TextArea.mdx +2 -2
- package/docs/components/TextField.mdx +2 -2
- package/docs/components/Title.mdx +1 -1
- package/docs/components/Vertical.mdx +64 -64
- package/docs/components.md +4 -4
- package/docs/conventions.md +1 -1
- package/docs/design-system/theming.md +19 -19
- package/docs/tutorials/README.md +1 -1
- package/docs/tutorials/basic/creating-a-simple-form.md +2 -2
- package/package.json +2 -2
|
@@ -7,14 +7,14 @@ Theming is an essential part of any application. It allows you to maintain a con
|
|
|
7
7
|
App-Studio provides an extensive color system with three types of colors:
|
|
8
8
|
|
|
9
9
|
### 1. Singleton Colors (Basic Colors)
|
|
10
|
-
These are simple named colors accessible via `color
|
|
10
|
+
These are simple named colors accessible via `color-{name}`:
|
|
11
11
|
|
|
12
12
|
- **Basic Colors**: `white`, `black`, `red`, `green`, `blue`, `yellow`, `cyan`, `magenta`, `grey`, `orange`, `brown`, `purple`, `pink`, `lime`, `teal`, `navy`, `olive`, `maroon`, `gold`, `silver`, `indigo`, `violet`, `beige`, `turquoise`, `coral`, `chocolate`, `skyBlue`, `plum`, `darkGreen`, `salmon`
|
|
13
13
|
|
|
14
|
-
**Usage**: `color
|
|
14
|
+
**Usage**: `color-white`, `color-gold`, `color-turquoise`
|
|
15
15
|
|
|
16
16
|
### 2. Color Palettes (Shaded Colors)
|
|
17
|
-
Each palette has 9 shades (50, 100, 200, 300, 400, 500, 600, 700, 800, 900) accessible via `color
|
|
17
|
+
Each palette has 9 shades (50, 100, 200, 300, 400, 500, 600, 700, 800, 900) accessible via `color-{palette}-{shade}`:
|
|
18
18
|
|
|
19
19
|
**Available Palettes**:
|
|
20
20
|
- **Alpha Channels**: `whiteAlpha`, `blackAlpha` - RGBA colors with varying opacity
|
|
@@ -25,21 +25,22 @@ Each palette has 9 shades (50, 100, 200, 300, 400, 500, 600, 700, 800, 900) acce
|
|
|
25
25
|
- **Greens**: `teal`, `emerald`, `green`, `lime`
|
|
26
26
|
- **Yellows & Oranges**: `yellow`, `amber`, `orange`
|
|
27
27
|
|
|
28
|
-
**Usage**: `color
|
|
28
|
+
**Usage**: `color-blue-500`, `color-rose-200`, `color-gray-800`
|
|
29
29
|
|
|
30
30
|
### 3. Theme Colors
|
|
31
|
-
Custom theme colors defined in your theme configuration, accessible via `theme
|
|
31
|
+
Custom theme colors defined in your theme configuration, accessible via `theme-{path}`:
|
|
32
32
|
|
|
33
33
|
**Default Theme Colors**:
|
|
34
|
-
- `theme
|
|
35
|
-
- `theme
|
|
36
|
-
- `theme
|
|
37
|
-
- `theme
|
|
38
|
-
- `theme
|
|
39
|
-
- `theme
|
|
40
|
-
- `theme
|
|
34
|
+
- `theme-primary` - Main brand color (default: black)
|
|
35
|
+
- `theme-secondary` - Secondary brand color (default: blue)
|
|
36
|
+
- `theme-success` - Success state color (default: green-500)
|
|
37
|
+
- `theme-error` - Error state color (default: red-500)
|
|
38
|
+
- `theme-warning` - Warning state color (default: orange-500)
|
|
39
|
+
- `theme-info` - Info state color (default: blue-500)
|
|
40
|
+
- `theme-disabled` - Disabled state color (default: gray-500)
|
|
41
|
+
- `theme-loading` - Loading state color (default: dark-500)
|
|
41
42
|
|
|
42
|
-
You can extend these with custom theme paths like `theme
|
|
43
|
+
You can extend these with custom theme paths like `theme-button-background` or `theme-header-text`.
|
|
43
44
|
|
|
44
45
|
### 4. Mode-Specific Colors
|
|
45
46
|
Access light or dark mode colors directly, regardless of current theme:
|
|
@@ -47,25 +48,25 @@ Access light or dark mode colors directly, regardless of current theme:
|
|
|
47
48
|
- **Light Mode**: `light.{colorName}` or `light.{palette}.{shade}`
|
|
48
49
|
- **Dark Mode**: `dark.{colorName}` or `dark.{palette}.{shade}`
|
|
49
50
|
|
|
50
|
-
**Usage**: `light.white`, `dark.blue
|
|
51
|
+
**Usage**: `light.white`, `dark.blue-500`, `light.gray-100`
|
|
51
52
|
|
|
52
53
|
### Color System Hierarchy
|
|
53
54
|
```
|
|
54
|
-
color
|
|
55
|
-
├─ color
|
|
56
|
-
└─ color
|
|
55
|
+
color-* → Direct color access (current theme mode)
|
|
56
|
+
├─ color-white → Singleton colors
|
|
57
|
+
└─ color-blue-500 → Palette colors with shades
|
|
57
58
|
|
|
58
|
-
theme
|
|
59
|
-
├─ theme
|
|
60
|
-
└─ theme
|
|
59
|
+
theme-* → Custom theme configuration
|
|
60
|
+
├─ theme-primary
|
|
61
|
+
└─ theme-button-background
|
|
61
62
|
|
|
62
63
|
light.* → Always use light mode colors
|
|
63
64
|
├─ light.white
|
|
64
|
-
└─ light.blue
|
|
65
|
+
└─ light.blue-500
|
|
65
66
|
|
|
66
67
|
dark.* → Always use dark mode colors
|
|
67
68
|
├─ dark.white
|
|
68
|
-
└─ dark.red
|
|
69
|
+
└─ dark.red-200
|
|
69
70
|
```
|
|
70
71
|
|
|
71
72
|
## Setting up the Theme Object
|
|
@@ -134,10 +135,10 @@ Now that the theme is available, you can use it in your components. All color re
|
|
|
134
135
|
App-Studio supports multiple ways to reference colors:
|
|
135
136
|
|
|
136
137
|
1. **Direct Color Values**: `"#fff"`, `"rgb(255,0,0)"`, `"transparent"`
|
|
137
|
-
2. **Singleton Colors**: `"color
|
|
138
|
-
3. **Palette Colors**: `"color
|
|
139
|
-
4. **Theme Colors**: `"theme
|
|
140
|
-
5. **Mode-Specific Colors**: `"light.white"`, `"dark.blue
|
|
138
|
+
2. **Singleton Colors**: `"color-white"`, `"color-gold"`, `"color-turquoise"`
|
|
139
|
+
3. **Palette Colors**: `"color-blue-500"`, `"color-rose-200"`, `"color-gray-800"`
|
|
140
|
+
4. **Theme Colors**: `"theme-primary"`, `"theme-button-background"`
|
|
141
|
+
5. **Mode-Specific Colors**: `"light.white"`, `"dark.blue-500"`
|
|
141
142
|
|
|
142
143
|
### Examples
|
|
143
144
|
|
|
@@ -147,23 +148,23 @@ import { Button } from '@app-studio/web';
|
|
|
147
148
|
|
|
148
149
|
function Example() {
|
|
149
150
|
return (
|
|
150
|
-
<View backgroundColor="color
|
|
151
|
+
<View backgroundColor="color-blue">
|
|
151
152
|
{/* Using palette colors with shades */}
|
|
152
|
-
<View backgroundColor="color
|
|
153
|
-
<Text color="theme
|
|
153
|
+
<View backgroundColor="color-blueGray-500">
|
|
154
|
+
<Text color="theme-primary">Hello</Text>
|
|
154
155
|
</View>
|
|
155
156
|
|
|
156
157
|
{/* Using theme colors */}
|
|
157
|
-
<Button backgroundColor="theme
|
|
158
|
+
<Button backgroundColor="theme-button-background">Hello</Button>
|
|
158
159
|
|
|
159
160
|
{/* Using singleton colors */}
|
|
160
|
-
<View backgroundColor="color
|
|
161
|
-
<Text color="color
|
|
161
|
+
<View backgroundColor="color-turquoise" padding={10}>
|
|
162
|
+
<Text color="color-white">Turquoise Background</Text>
|
|
162
163
|
</View>
|
|
163
164
|
|
|
164
165
|
{/* Using alpha colors for transparency */}
|
|
165
|
-
<View backgroundColor="color
|
|
166
|
-
<Text color="color
|
|
166
|
+
<View backgroundColor="color-blackAlpha-500">
|
|
167
|
+
<Text color="color-whiteAlpha-900">Semi-transparent</Text>
|
|
167
168
|
</View>
|
|
168
169
|
</View>
|
|
169
170
|
);
|
|
@@ -175,46 +176,46 @@ function Example() {
|
|
|
175
176
|
Each palette below has shades: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900
|
|
176
177
|
|
|
177
178
|
**Alpha Transparency**:
|
|
178
|
-
- `color
|
|
179
|
-
- `color
|
|
179
|
+
- `color-whiteAlpha-{shade}` - White with alpha (rgba)
|
|
180
|
+
- `color-blackAlpha-{shade}` - Black with alpha (rgba)
|
|
180
181
|
|
|
181
182
|
**Neutral Colors**:
|
|
182
|
-
- `color
|
|
183
|
-
- `color
|
|
184
|
-
- `color
|
|
185
|
-
- `color
|
|
186
|
-
- `color
|
|
187
|
-
- `color
|
|
188
|
-
- `color
|
|
189
|
-
- `color
|
|
190
|
-
- `color
|
|
183
|
+
- `color-white-{shade}` - White to light gray scale
|
|
184
|
+
- `color-black-{shade}` - Black to dark gray scale
|
|
185
|
+
- `color-gray-{shade}` - True gray scale
|
|
186
|
+
- `color-dark-{shade}` - Dark neutral scale
|
|
187
|
+
- `color-light-{shade}` - Light neutral scale
|
|
188
|
+
- `color-warmGray-{shade}` - Warm gray tones
|
|
189
|
+
- `color-trueGray-{shade}` - True neutral gray
|
|
190
|
+
- `color-coolGray-{shade}` - Cool gray tones
|
|
191
|
+
- `color-blueGray-{shade}` - Blue-tinted gray
|
|
191
192
|
|
|
192
193
|
**Red & Pink Family**:
|
|
193
|
-
- `color
|
|
194
|
-
- `color
|
|
195
|
-
- `color
|
|
194
|
+
- `color-rose-{shade}` - Rose pink tones
|
|
195
|
+
- `color-pink-{shade}` - Pink tones
|
|
196
|
+
- `color-red-{shade}` - Red tones
|
|
196
197
|
|
|
197
198
|
**Purple Family**:
|
|
198
|
-
- `color
|
|
199
|
-
- `color
|
|
200
|
-
- `color
|
|
199
|
+
- `color-fuchsia-{shade}` - Bright purple-pink
|
|
200
|
+
- `color-purple-{shade}` - Purple tones
|
|
201
|
+
- `color-violet-{shade}` - Violet tones
|
|
201
202
|
|
|
202
203
|
**Blue Family**:
|
|
203
|
-
- `color
|
|
204
|
-
- `color
|
|
205
|
-
- `color
|
|
206
|
-
- `color
|
|
204
|
+
- `color-indigo-{shade}` - Deep blue-purple
|
|
205
|
+
- `color-blue-{shade}` - Blue tones
|
|
206
|
+
- `color-lightBlue-{shade}` - Light blue tones
|
|
207
|
+
- `color-cyan-{shade}` - Cyan tones
|
|
207
208
|
|
|
208
209
|
**Green Family**:
|
|
209
|
-
- `color
|
|
210
|
-
- `color
|
|
211
|
-
- `color
|
|
212
|
-
- `color
|
|
210
|
+
- `color-teal-{shade}` - Teal (blue-green)
|
|
211
|
+
- `color-emerald-{shade}` - Emerald green
|
|
212
|
+
- `color-green-{shade}` - Green tones
|
|
213
|
+
- `color-lime-{shade}` - Lime green
|
|
213
214
|
|
|
214
215
|
**Yellow & Orange Family**:
|
|
215
|
-
- `color
|
|
216
|
-
- `color
|
|
217
|
-
- `color
|
|
216
|
+
- `color-yellow-{shade}` - Yellow tones
|
|
217
|
+
- `color-amber-{shade}` - Amber (orange-yellow)
|
|
218
|
+
- `color-orange-{shade}` - Orange tones
|
|
218
219
|
|
|
219
220
|
### Accessing Specific Theme Mode Colors
|
|
220
221
|
|
|
@@ -229,9 +230,9 @@ function Example() {
|
|
|
229
230
|
{/* Always use light mode white color regardless of current theme mode */}
|
|
230
231
|
<Text color="light.white">Always light mode white</Text>
|
|
231
232
|
|
|
232
|
-
{/* Always use dark mode red
|
|
233
|
-
<View backgroundColor="dark.red
|
|
234
|
-
<Text>Always dark mode red
|
|
233
|
+
{/* Always use dark mode red-200 color regardless of current theme mode */}
|
|
234
|
+
<View backgroundColor="dark.red-200">
|
|
235
|
+
<Text>Always dark mode red-200 background</Text>
|
|
235
236
|
</View>
|
|
236
237
|
</View>
|
|
237
238
|
);
|
|
@@ -252,20 +253,20 @@ function Example() {
|
|
|
252
253
|
<View>
|
|
253
254
|
{/* Access light theme colors directly */}
|
|
254
255
|
<Text color="light.white">White text in light mode</Text>
|
|
255
|
-
<View backgroundColor="light.blue
|
|
256
|
+
<View backgroundColor="light.blue-500">
|
|
256
257
|
<Text>Light blue background</Text>
|
|
257
258
|
</View>
|
|
258
259
|
|
|
259
260
|
{/* Access dark theme colors directly */}
|
|
260
261
|
<Text color="dark.white">White text in dark mode</Text>
|
|
261
|
-
<View backgroundColor="dark.red
|
|
262
|
+
<View backgroundColor="dark.red-200">
|
|
262
263
|
<Text>Dark red background</Text>
|
|
263
264
|
</View>
|
|
264
265
|
|
|
265
266
|
{/* Mix and match in the same component */}
|
|
266
267
|
<View
|
|
267
|
-
backgroundColor="light.gray
|
|
268
|
-
borderColor="dark.gray
|
|
268
|
+
backgroundColor="light.gray-100"
|
|
269
|
+
borderColor="dark.gray-800"
|
|
269
270
|
borderWidth={1}
|
|
270
271
|
>
|
|
271
272
|
<Text>Mixed theme colors</Text>
|
|
@@ -275,7 +276,7 @@ function Example() {
|
|
|
275
276
|
}
|
|
276
277
|
```
|
|
277
278
|
|
|
278
|
-
This direct access syntax works with all color-related properties and can be used with both singleton colors (like `white`, `black`) and palette colors (like `red
|
|
279
|
+
This direct access syntax works with all color-related properties and can be used with both singleton colors (like `white`, `black`) and palette colors (like `red-200`, `blue-500`). It provides a convenient way to reference specific theme colors without having to use the `getColor` function from the `useTheme` hook.
|
|
279
280
|
|
|
280
281
|
### Smart Text Contrast
|
|
281
282
|
|
|
@@ -341,19 +342,19 @@ import { ThemeProvider, View, Text, Button } from 'app-studio';
|
|
|
341
342
|
// Custom theme configuration
|
|
342
343
|
const theme = {
|
|
343
344
|
main: {
|
|
344
|
-
primary: 'color
|
|
345
|
-
secondary: 'color
|
|
346
|
-
accent: 'color
|
|
345
|
+
primary: 'color-blue-600', // References a palette color
|
|
346
|
+
secondary: 'color-purple-500',
|
|
347
|
+
accent: 'color-orange-400'
|
|
347
348
|
},
|
|
348
349
|
components: {
|
|
349
350
|
button: {
|
|
350
|
-
background: 'color
|
|
351
|
-
text: 'color
|
|
352
|
-
disabled: 'color
|
|
351
|
+
background: 'color-emerald-500',
|
|
352
|
+
text: 'color-white',
|
|
353
|
+
disabled: 'color-gray-400'
|
|
353
354
|
},
|
|
354
355
|
card: {
|
|
355
|
-
background: 'color
|
|
356
|
-
border: 'color
|
|
356
|
+
background: 'color-white',
|
|
357
|
+
border: 'color-gray-200'
|
|
357
358
|
}
|
|
358
359
|
}
|
|
359
360
|
};
|
|
@@ -385,40 +386,40 @@ function Example() {
|
|
|
385
386
|
return (
|
|
386
387
|
<ThemeProvider theme={theme} colors={customColors} mode="light">
|
|
387
388
|
{/* Using theme colors */}
|
|
388
|
-
<View backgroundColor="theme
|
|
389
|
-
<Text color="theme
|
|
389
|
+
<View backgroundColor="theme-components-card-background" padding={20}>
|
|
390
|
+
<Text color="theme-main-primary" fontSize={24}>
|
|
390
391
|
Primary Theme Color
|
|
391
392
|
</Text>
|
|
392
|
-
|
|
393
|
+
|
|
393
394
|
{/* Using palette colors directly */}
|
|
394
|
-
<View backgroundColor="color
|
|
395
|
-
<Text color="color
|
|
395
|
+
<View backgroundColor="color-rose-100" padding={10} marginTop={10}>
|
|
396
|
+
<Text color="color-rose-900">Rose palette color</Text>
|
|
396
397
|
</View>
|
|
397
|
-
|
|
398
|
+
|
|
398
399
|
{/* Using singleton colors */}
|
|
399
|
-
<View backgroundColor="color
|
|
400
|
-
<Text color="color
|
|
400
|
+
<View backgroundColor="color-turquoise" padding={10} marginTop={10}>
|
|
401
|
+
<Text color="color-white">Turquoise singleton</Text>
|
|
401
402
|
</View>
|
|
402
|
-
|
|
403
|
+
|
|
403
404
|
{/* Using custom colors */}
|
|
404
|
-
<View backgroundColor="color
|
|
405
|
-
<Text color="color
|
|
405
|
+
<View backgroundColor="color-brand" padding={10} marginTop={10}>
|
|
406
|
+
<Text color="color-white">Custom brand color</Text>
|
|
406
407
|
</View>
|
|
407
|
-
|
|
408
|
+
|
|
408
409
|
{/* Using mode-specific colors */}
|
|
409
|
-
<View backgroundColor="light.gray
|
|
410
|
-
<Text color="dark.gray
|
|
410
|
+
<View backgroundColor="light.gray-100" padding={10} marginTop={10}>
|
|
411
|
+
<Text color="dark.gray-900">Always light background, dark text</Text>
|
|
411
412
|
</View>
|
|
412
|
-
|
|
413
|
+
|
|
413
414
|
{/* Using alpha transparency */}
|
|
414
|
-
<View backgroundColor="color
|
|
415
|
-
<Text color="color
|
|
415
|
+
<View backgroundColor="color-blackAlpha-500" padding={10} marginTop={10}>
|
|
416
|
+
<Text color="color-whiteAlpha-900">Semi-transparent overlay</Text>
|
|
416
417
|
</View>
|
|
417
|
-
|
|
418
|
+
|
|
418
419
|
{/* Button using theme */}
|
|
419
|
-
<Button
|
|
420
|
-
backgroundColor="theme
|
|
421
|
-
color="theme
|
|
420
|
+
<Button
|
|
421
|
+
backgroundColor="theme-components-button-background"
|
|
422
|
+
color="theme-components-button-text"
|
|
422
423
|
>
|
|
423
424
|
Themed Button
|
|
424
425
|
</Button>
|
|
@@ -434,27 +435,27 @@ When working with colors in App-Studio, use these patterns:
|
|
|
434
435
|
|
|
435
436
|
### Color Access Patterns
|
|
436
437
|
```javascript
|
|
437
|
-
// Pattern: color
|
|
438
|
-
"color
|
|
439
|
-
"color
|
|
440
|
-
"color
|
|
438
|
+
// Pattern: color-{name}
|
|
439
|
+
"color-white" // → "#FFFFFF" (in light mode) or "#000000" (in dark mode)
|
|
440
|
+
"color-gold" // → "#FFD700"
|
|
441
|
+
"color-turquoise" // → "#40E0D0"
|
|
441
442
|
|
|
442
|
-
// Pattern: color
|
|
443
|
-
"color
|
|
444
|
-
"color
|
|
445
|
-
"color
|
|
443
|
+
// Pattern: color-{palette}-{shade}
|
|
444
|
+
"color-blue-500" // → "#3b82f6" (light) or "#60a5fa" (dark)
|
|
445
|
+
"color-rose-200" // → "#fecdd3" (light) or "#6b112f" (dark)
|
|
446
|
+
"color-gray-800" // → "#27272a" (light) or "#f4f4f5" (dark)
|
|
446
447
|
|
|
447
|
-
// Pattern: theme
|
|
448
|
-
"theme
|
|
449
|
-
"theme
|
|
448
|
+
// Pattern: theme-{path}
|
|
449
|
+
"theme-primary" // → Resolves to your theme's primary color
|
|
450
|
+
"theme-button-background" // → Resolves to nested theme path
|
|
450
451
|
|
|
451
452
|
// Pattern: light.{name} or light.{palette}.{shade}
|
|
452
453
|
"light.white" // → Always "#FFFFFF" (light mode)
|
|
453
|
-
"light.blue
|
|
454
|
+
"light.blue-500" // → Always "#3b82f6" (light mode value)
|
|
454
455
|
|
|
455
456
|
// Pattern: dark.{name} or dark.{palette}.{shade}
|
|
456
457
|
"dark.white" // → Always "#000000" (dark mode white)
|
|
457
|
-
"dark.red
|
|
458
|
+
"dark.red-200" // → Always "#6b112f" (dark mode value)
|
|
458
459
|
|
|
459
460
|
// Direct values (unchanged)
|
|
460
461
|
"#ff0000" // → "#ff0000"
|
|
@@ -485,4 +486,4 @@ Each palette has these shades: `50, 100, 200, 300, 400, 500, 600, 700, 800, 900`
|
|
|
485
486
|
- **Light Mode**: Uses `defaultLightPalette` and `defaultLightColors`
|
|
486
487
|
- **Dark Mode**: Uses `defaultDarkPalette` and `defaultDarkColors`
|
|
487
488
|
- Colors automatically switch based on `themeMode` unless using `light.*` or `dark.*` prefix
|
|
488
|
-
- Color values are inverted for dark mode (e.g., `color
|
|
489
|
+
- Color values are inverted for dark mode (e.g., `color-white` becomes black in dark mode)
|
package/docs/app-studio.md
CHANGED
|
@@ -108,7 +108,7 @@ Start with the General Principles, then focus on the App Studio Specific Best Pr
|
|
|
108
108
|
|
|
109
109
|
* **Style Definitions:** Define style constants (sizes, colors, theme maps) in `.style.ts` or `.style.tsx`.
|
|
110
110
|
* **`styles` Prop:** Allow consumers to override specific parts of the component's style via the `styles` prop, which should accept an object mapping keys (e.g., `container`, `label`, `icon`) to `CSSProperties`. Define the structure of this `styles` object in `ComponentName.type.ts`.
|
|
111
|
-
* **Theme Variables:** Prefer using theme variables (e.g., `theme
|
|
111
|
+
* **Theme Variables:** Prefer using theme variables (e.g., `theme-primary`, `color-blueGray-700`) over hardcoded hex/rgb values to maintain theme consistency. Use `useTheme` hook if necessary to access theme values dynamically.
|
|
112
112
|
* **Inline Styles vs. `styles` Prop:** Use inline styles within `.view.tsx` for structural layout (using layout components) and dynamic styles based on state (e.g., hover effects). Use the `styles` prop for customizable theme/appearance overrides.
|
|
113
113
|
* **CSS Files:** Limit usage. Prefer inline styles passed via props or theme-based styling. Use CSS files (like `style.css` in `TextArea` and `TextField`) only for styles that cannot be easily applied via inline styles (e.g., pseudo-elements, complex selectors).
|
|
114
114
|
|
|
@@ -133,7 +133,7 @@ Start with the General Principles, then focus on the App Studio Specific Best Pr
|
|
|
133
133
|
* **Do** encapsulate component state and logic in `useComponentNameState` hooks.
|
|
134
134
|
* **Do** keep `ComponentName.view.tsx` purely presentational.
|
|
135
135
|
* **Do** use `Horizontal`, `Vertical`, `Center`, `View` for layout.
|
|
136
|
-
* **Do** use theme variables (`theme
|
|
136
|
+
* **Do** use theme variables (`theme-primary`) for colors.
|
|
137
137
|
* **Do** allow style overrides via the `styles` prop with a defined structure.
|
|
138
138
|
* **Do** create clear examples in the `examples/` directory for each component.
|
|
139
139
|
* **Do** keep `.mdx` documentation synchronized with examples and props.
|
|
@@ -196,19 +196,19 @@ export const getComponentNameVariants = (themeMode: 'light' | 'dark') => {
|
|
|
196
196
|
|
|
197
197
|
return {
|
|
198
198
|
default: {
|
|
199
|
-
backgroundColor: isDark ? 'color
|
|
200
|
-
color: isDark ? 'color
|
|
201
|
-
borderColor: isDark ? 'color
|
|
199
|
+
backgroundColor: isDark ? 'color-gray-800' : 'color-gray-100',
|
|
200
|
+
color: isDark ? 'color-gray-100' : 'color-gray-800',
|
|
201
|
+
borderColor: isDark ? 'color-gray-700' : 'color-gray-300',
|
|
202
202
|
},
|
|
203
203
|
primary: {
|
|
204
|
-
backgroundColor: 'theme
|
|
205
|
-
color: 'color
|
|
206
|
-
borderColor: 'theme
|
|
204
|
+
backgroundColor: 'theme-primary',
|
|
205
|
+
color: 'color-white',
|
|
206
|
+
borderColor: 'theme-primary',
|
|
207
207
|
},
|
|
208
208
|
secondary: {
|
|
209
|
-
backgroundColor: 'theme
|
|
210
|
-
color: 'color
|
|
211
|
-
borderColor: 'theme
|
|
209
|
+
backgroundColor: 'theme-secondary',
|
|
210
|
+
color: 'color-white',
|
|
211
|
+
borderColor: 'theme-secondary',
|
|
212
212
|
},
|
|
213
213
|
};
|
|
214
214
|
};
|
|
@@ -342,7 +342,7 @@ Use the layout components from `app-studio` for consistent layout:
|
|
|
342
342
|
Use the theme system via `useTheme` hook:
|
|
343
343
|
```typescript
|
|
344
344
|
const { getColor, themeMode } = useTheme();
|
|
345
|
-
const colorValue = getColor('theme
|
|
345
|
+
const colorValue = getColor('theme-primary', { themeMode });
|
|
346
346
|
```
|
|
347
347
|
|
|
348
348
|
### Style Customization
|
|
@@ -163,7 +163,7 @@ export const AnimatedButtons = () => (
|
|
|
163
163
|
Override the main color of the button.
|
|
164
164
|
- `backgroundColor`: Sets the primary background color (filled variant).
|
|
165
165
|
- `color`: Sets the main color token used for text/borders (outline/ghost variants).
|
|
166
|
-
- `textColor`: Explicitly sets the text color
|
|
166
|
+
- `textColor`: Explicitly sets the text color-
|
|
167
167
|
|
|
168
168
|
```tsx
|
|
169
169
|
import React from 'react';
|
|
@@ -174,7 +174,7 @@ export const ColoredButtons = () => (
|
|
|
174
174
|
<Horizontal gap={15}>
|
|
175
175
|
<Button backgroundColor="#F43F5E">Custom Red</Button>
|
|
176
176
|
<Button variant="outline" color="#10B981">Custom Green</Button>
|
|
177
|
-
<Button backgroundColor="theme
|
|
177
|
+
<Button backgroundColor="theme-primary" textColor="white">
|
|
178
178
|
Theme Primary
|
|
179
179
|
</Button>
|
|
180
180
|
</Horizontal>
|
|
@@ -17,10 +17,10 @@ import { Text } from 'app-studio';
|
|
|
17
17
|
export const DefaultDemo = () => {
|
|
18
18
|
// Create an array of slides with different background colors
|
|
19
19
|
const slides = [
|
|
20
|
-
{ color: 'color
|
|
21
|
-
{ color: 'color
|
|
22
|
-
{ color: 'color
|
|
23
|
-
{ color: 'color
|
|
20
|
+
{ color: 'color-blue-500', text: 'Slide 1' },
|
|
21
|
+
{ color: 'color-green-500', text: 'Slide 2' },
|
|
22
|
+
{ color: 'color-purple-500', text: 'Slide 3' },
|
|
23
|
+
{ color: 'color-orange-500', text: 'Slide 4' },
|
|
24
24
|
];
|
|
25
25
|
|
|
26
26
|
return (
|
|
@@ -64,10 +64,10 @@ import { Vertical } from 'app-studio';
|
|
|
64
64
|
export const AutoPlayDemo = () => {
|
|
65
65
|
// Create an array of slides with different background colors
|
|
66
66
|
const slides = [
|
|
67
|
-
{ color: 'color
|
|
68
|
-
{ color: 'color
|
|
69
|
-
{ color: 'color
|
|
70
|
-
{ color: 'color
|
|
67
|
+
{ color: 'color-red-500', text: 'Auto-play Slide 1' },
|
|
68
|
+
{ color: 'color-yellow-500', text: 'Auto-play Slide 2' },
|
|
69
|
+
{ color: 'color-teal-500', text: 'Auto-play Slide 3' },
|
|
70
|
+
{ color: 'color-pink-500', text: 'Auto-play Slide 4' },
|
|
71
71
|
];
|
|
72
72
|
|
|
73
73
|
return (
|
|
@@ -116,12 +116,12 @@ export const StepIndicesDemo = () => {
|
|
|
116
116
|
|
|
117
117
|
// Create an array of slides
|
|
118
118
|
const slides = [
|
|
119
|
-
{ color: 'color
|
|
120
|
-
{ color: 'color
|
|
121
|
-
{ color: 'color
|
|
122
|
-
{ color: 'color
|
|
123
|
-
{ color: 'color
|
|
124
|
-
{ color: 'color
|
|
119
|
+
{ color: 'color-blue-500', text: 'Introduction', id: 0 },
|
|
120
|
+
{ color: 'color-gray-400', text: 'Step 1', id: 1 },
|
|
121
|
+
{ color: 'color-gray-400', text: 'Step 2', id: 2 },
|
|
122
|
+
{ color: 'color-gray-400', text: 'Step 3', id: 3 },
|
|
123
|
+
{ color: 'color-gray-400', text: 'Step 4', id: 4 },
|
|
124
|
+
{ color: 'color-green-500', text: 'Summary', id: 5 },
|
|
125
125
|
];
|
|
126
126
|
|
|
127
127
|
// Only allow navigation to specific slides (introduction, steps 2 & 4, summary)
|
|
@@ -143,7 +143,7 @@ export const StepIndicesDemo = () => {
|
|
|
143
143
|
<View
|
|
144
144
|
key={index}
|
|
145
145
|
backgroundColor={
|
|
146
|
-
stepIndices.includes(index) ? slide.color : 'color
|
|
146
|
+
stepIndices.includes(index) ? slide.color : 'color-gray-400'
|
|
147
147
|
}
|
|
148
148
|
width="100%"
|
|
149
149
|
height="100%"
|