@app-studio/web 0.9.50 → 0.9.51
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/Form/Form.d.ts +1 -0
- package/dist/components/Form/Selector/Selector/Selector.props.d.ts +68 -0
- package/dist/components/Form/Selector/Selector/Selector.state.d.ts +19 -0
- package/dist/components/Form/Selector/Selector/Selector.style.d.ts +30 -0
- package/dist/components/Form/Selector/Selector/Selector.view.d.ts +9 -0
- package/dist/components/Form/Selector/Selector.d.ts +3 -0
- package/dist/components/Formik/Formik.Selector.d.ts +6 -0
- package/dist/components/Formik/index.d.ts +1 -0
- package/dist/utils/typography.d.ts +5 -4
- package/dist/web.cjs.development.js +358 -135
- 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 +358 -136
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +358 -135
- 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/components/Background.mdx +15 -0
- package/docs/components/Selector.mdx +78 -0
- package/docs/components/Title.mdx +93 -0
- package/package.json +2 -2
|
@@ -104,6 +104,21 @@ export const DefaultDemo = () => (
|
|
|
104
104
|
</Background.Gradient>
|
|
105
105
|
</Vertical>
|
|
106
106
|
|
|
107
|
+
<Vertical gap={16}>
|
|
108
|
+
<Text fontSize={14} color="color.gray.600">
|
|
109
|
+
Background Video
|
|
110
|
+
</Text>
|
|
111
|
+
<Background.Video
|
|
112
|
+
src="https://www.w3schools.com/html/mov_bbb.mp4"
|
|
113
|
+
height="200px"
|
|
114
|
+
overlay="rgba(0,0,0,0.3)"
|
|
115
|
+
>
|
|
116
|
+
<Text color="white" fontSize={18} fontWeight="500">
|
|
117
|
+
Video Background
|
|
118
|
+
</Text>
|
|
119
|
+
</Background.Video>
|
|
120
|
+
</Vertical>
|
|
121
|
+
|
|
107
122
|
<Vertical gap={16}>
|
|
108
123
|
<Text fontSize={14} color="color.gray.600">
|
|
109
124
|
Multi-color Gradient
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Selector
|
|
2
|
+
|
|
3
|
+
A segmented control UI component for selecting from a limited list of options, typically used for toggling states or selecting mutually exclusive options like complexity or priority.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
| Prop | Type | Description | Default |
|
|
8
|
+
| ---------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ------- |
|
|
9
|
+
| options | { label: string; value: string; color?: string }[] | Array of options for the selector. `color` defaults to primary theme color if not specified. | |
|
|
10
|
+
| label | string | Label for the selector group, displayed with an icon. | |
|
|
11
|
+
| id | string | ID for the form field. | |
|
|
12
|
+
| name | string | Name attribute for the form field. | |
|
|
13
|
+
| value | string | The currently selected value. | |
|
|
14
|
+
| onChange | (value: any) => void | Callback function when selection changes. | |
|
|
15
|
+
| views | SelectorStyles | Custom styles for internal sub-components (container, item, etc.). | |
|
|
16
|
+
|
|
17
|
+
### **Import**
|
|
18
|
+
```tsx
|
|
19
|
+
import { Selector } from '@app-studio/web';
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### **Default**
|
|
23
|
+
```tsx
|
|
24
|
+
import React from 'react';
|
|
25
|
+
import { Selector } from '@app-studio/web';
|
|
26
|
+
|
|
27
|
+
export const DefaultSelector = () => (
|
|
28
|
+
<Selector
|
|
29
|
+
options={[
|
|
30
|
+
{ label: 'Option A', value: 'A' },
|
|
31
|
+
{ label: 'Option B', value: 'B' },
|
|
32
|
+
{ label: 'Option C', value: 'C' },
|
|
33
|
+
]}
|
|
34
|
+
label="Standard Selection"
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### **Complexity Example (Colored Options)**
|
|
40
|
+
Display options with specific semantic colors for active states, suitable for indicating status levels like Low, Medium, High.
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
import React from 'react';
|
|
44
|
+
import { Selector } from '@app-studio/web';
|
|
45
|
+
|
|
46
|
+
export const ComplexitySelector = () => (
|
|
47
|
+
<Selector
|
|
48
|
+
label="Complexity"
|
|
49
|
+
options={[
|
|
50
|
+
{ label: 'Low', value: 'Low', color: 'color.emerald.500' },
|
|
51
|
+
{ label: 'Medium', value: 'Medium', color: 'color.amber.500' },
|
|
52
|
+
{ label: 'High', value: 'High', color: 'color.red.500' },
|
|
53
|
+
]}
|
|
54
|
+
/>
|
|
55
|
+
);
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### **Custom Styling**
|
|
59
|
+
Apply custom styles to the container or items using the `views` prop.
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
import React from 'react';
|
|
63
|
+
import { Selector } from '@app-studio/web';
|
|
64
|
+
|
|
65
|
+
export const CustomStyleSelector = () => (
|
|
66
|
+
<Selector
|
|
67
|
+
label="Custom Styled"
|
|
68
|
+
views={{
|
|
69
|
+
container: { backgroundColor: 'color.gray.50' },
|
|
70
|
+
item: { fontSize: '14px', fontStyle: 'italic' }
|
|
71
|
+
}}
|
|
72
|
+
options={[
|
|
73
|
+
{ label: 'One', value: '1' },
|
|
74
|
+
{ label: 'Two', value: '2' },
|
|
75
|
+
]}
|
|
76
|
+
/>
|
|
77
|
+
);
|
|
78
|
+
```
|
|
@@ -276,3 +276,96 @@ export const ResponsiveTitle = () => {
|
|
|
276
276
|
};
|
|
277
277
|
```
|
|
278
278
|
|
|
279
|
+
### **highlightTypewriter**
|
|
280
|
+
Adds a typewriter effect to the highlighted text.
|
|
281
|
+
|
|
282
|
+
- **Type:** `boolean`
|
|
283
|
+
- **Default:** `false`
|
|
284
|
+
|
|
285
|
+
```tsx
|
|
286
|
+
import React from 'react';
|
|
287
|
+
import { Title } from '@app-studio/web';
|
|
288
|
+
import { Vertical } from 'app-studio';
|
|
289
|
+
|
|
290
|
+
export const TypewriterTitle = () => (
|
|
291
|
+
<Vertical gap={32}>
|
|
292
|
+
<Title
|
|
293
|
+
size="md"
|
|
294
|
+
highlightText="Typewriter Effect"
|
|
295
|
+
highlightTypewriter={true}
|
|
296
|
+
highlightTypewriterDuration={3000}
|
|
297
|
+
highlightStyle="gradient"
|
|
298
|
+
highlightColor="theme.primary"
|
|
299
|
+
highlightSecondaryColor="theme.secondary"
|
|
300
|
+
>
|
|
301
|
+
Title with
|
|
302
|
+
</Title>
|
|
303
|
+
</Vertical>
|
|
304
|
+
);
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
### **highlightSlide**
|
|
308
|
+
Adds a slide entry effect to the highlighted text.
|
|
309
|
+
|
|
310
|
+
- **Type:** `boolean`
|
|
311
|
+
- **Default:** `false`
|
|
312
|
+
|
|
313
|
+
```tsx
|
|
314
|
+
import React from 'react';
|
|
315
|
+
import { Title } from '@app-studio/web';
|
|
316
|
+
import { Vertical } from 'app-studio';
|
|
317
|
+
|
|
318
|
+
export const SlideTitle = () => (
|
|
319
|
+
<Vertical gap={32}>
|
|
320
|
+
<Title
|
|
321
|
+
size="md"
|
|
322
|
+
highlightText="Slide Effect"
|
|
323
|
+
highlightSlide={true}
|
|
324
|
+
highlightSlideDuration={500}
|
|
325
|
+
highlightStyle="background"
|
|
326
|
+
highlightColor="theme.accent"
|
|
327
|
+
>
|
|
328
|
+
Title with
|
|
329
|
+
</Title>
|
|
330
|
+
|
|
331
|
+
<Title
|
|
332
|
+
size="md"
|
|
333
|
+
highlightText={["Slide", "Effect", "Multiple"]}
|
|
334
|
+
highlightSlide={true}
|
|
335
|
+
highlightSlideSequential={true}
|
|
336
|
+
highlightSlideStagger={200}
|
|
337
|
+
highlightStyle="underline"
|
|
338
|
+
highlightColor="theme.primary"
|
|
339
|
+
>
|
|
340
|
+
Sequential
|
|
341
|
+
</Title>
|
|
342
|
+
</Vertical>
|
|
343
|
+
);
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
### **alternateHighlightText**
|
|
347
|
+
Cycles through an array of strings, replacing the highlighted text.
|
|
348
|
+
|
|
349
|
+
- **Type:** `string[]`
|
|
350
|
+
|
|
351
|
+
```tsx
|
|
352
|
+
import React from 'react';
|
|
353
|
+
import { Title } from '@app-studio/web';
|
|
354
|
+
import { Vertical } from 'app-studio';
|
|
355
|
+
|
|
356
|
+
export const AlternateTitle = () => (
|
|
357
|
+
<Vertical gap={32}>
|
|
358
|
+
<Title
|
|
359
|
+
size="md"
|
|
360
|
+
highlightText="Amazing"
|
|
361
|
+
alternateHighlightText={['Incredible', 'Fantastic', 'Awesome']}
|
|
362
|
+
alternateAnimation={true}
|
|
363
|
+
alternateDuration={2000}
|
|
364
|
+
highlightStyle="underline"
|
|
365
|
+
highlightColor="theme.success"
|
|
366
|
+
>
|
|
367
|
+
Title with Rotating Words:
|
|
368
|
+
</Title>
|
|
369
|
+
</Vertical>
|
|
370
|
+
);
|
|
371
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@app-studio/web",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.51",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/components/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"@types/react-test-renderer": "^18.0.0",
|
|
113
113
|
"@typescript-eslint/eslint-plugin": "^5.59.7",
|
|
114
114
|
"@typescript-eslint/parser": "^5.59.7",
|
|
115
|
-
"app-studio": "^0.6.
|
|
115
|
+
"app-studio": "^0.6.46",
|
|
116
116
|
"async-mutex": "^0.5.0",
|
|
117
117
|
"babel-jest": "^29.5.0",
|
|
118
118
|
"babel-loader": "^9.1.2",
|