@idealyst/components 1.0.82 → 1.0.84
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/CLAUDE.md +199 -232
- package/README.md +5 -5
- package/package.json +25 -7
- package/plugin/README.md +272 -0
- package/plugin/test-cases.jsx +112 -0
- package/plugin/web-legacy.js +320 -0
- package/plugin/web.js +422 -124
- package/src/Accordion/Accordion.native.tsx +182 -0
- package/src/Accordion/Accordion.styles.tsx +260 -0
- package/src/Accordion/Accordion.web.tsx +147 -0
- package/src/Accordion/index.native.tsx +3 -0
- package/src/Accordion/index.ts +3 -0
- package/src/Accordion/index.web.tsx +3 -0
- package/src/Accordion/types.ts +23 -0
- package/src/ActivityIndicator/ActivityIndicator.native.tsx +17 -12
- package/src/ActivityIndicator/ActivityIndicator.styles.tsx +83 -109
- package/src/ActivityIndicator/ActivityIndicator.web.tsx +23 -17
- package/src/ActivityIndicator/index.ts +5 -2
- package/src/ActivityIndicator/index.web.ts +5 -2
- package/src/ActivityIndicator/types.ts +15 -10
- package/src/Alert/Alert.native.tsx +113 -0
- package/src/Alert/Alert.styles.tsx +304 -0
- package/src/Alert/Alert.web.tsx +123 -0
- package/src/Alert/index.native.ts +5 -0
- package/src/Alert/index.ts +5 -0
- package/src/Alert/index.web.ts +5 -0
- package/src/Alert/types.ts +21 -0
- package/src/Avatar/Avatar.native.tsx +8 -6
- package/src/Avatar/Avatar.styles.tsx +64 -58
- package/src/Avatar/Avatar.web.tsx +13 -8
- package/src/Avatar/index.ts +5 -2
- package/src/Avatar/index.web.ts +5 -2
- package/src/Avatar/types.ts +19 -13
- package/src/Badge/Badge.native.tsx +59 -14
- package/src/Badge/Badge.styles.tsx +125 -139
- package/src/Badge/Badge.web.tsx +72 -16
- package/src/Badge/index.ts +5 -2
- package/src/Badge/index.web.ts +5 -2
- package/src/Badge/types.ts +23 -11
- package/src/Breadcrumb/Breadcrumb.native.tsx +225 -0
- package/src/Breadcrumb/Breadcrumb.styles.tsx +234 -0
- package/src/Breadcrumb/Breadcrumb.web.tsx +268 -0
- package/src/Breadcrumb/index.native.ts +5 -0
- package/src/Breadcrumb/index.ts +5 -0
- package/src/Breadcrumb/index.web.ts +5 -0
- package/src/Breadcrumb/types.ts +56 -0
- package/src/Button/Button.native.tsx +75 -24
- package/src/Button/Button.styles.tsx +248 -205
- package/src/Button/Button.web.tsx +82 -25
- package/src/Button/index.ts +5 -5
- package/src/Button/index.web.ts +5 -3
- package/src/Button/types.ts +32 -15
- package/src/Card/Card.native.tsx +14 -11
- package/src/Card/Card.styles.tsx +146 -220
- package/src/Card/Card.web.tsx +20 -21
- package/src/Card/index.ts +5 -5
- package/src/Card/index.web.ts +5 -3
- package/src/Card/types.ts +24 -17
- package/src/Checkbox/Checkbox.native.tsx +24 -34
- package/src/Checkbox/Checkbox.styles.tsx +223 -275
- package/src/Checkbox/Checkbox.web.tsx +30 -37
- package/src/Checkbox/index.ts +5 -5
- package/src/Checkbox/index.web.ts +5 -3
- package/src/Checkbox/types.ts +26 -20
- package/src/Chip/Chip.native.tsx +126 -0
- package/src/Chip/Chip.styles.tsx +138 -0
- package/src/Chip/Chip.web.tsx +154 -0
- package/src/Chip/index.native.ts +5 -0
- package/src/Chip/index.ts +5 -0
- package/src/Chip/index.web.ts +5 -0
- package/src/Chip/types.ts +51 -0
- package/src/Dialog/Dialog.native.tsx +65 -12
- package/src/Dialog/Dialog.styles.tsx +154 -136
- package/src/Dialog/Dialog.web.tsx +16 -11
- package/src/Dialog/index.ts +5 -2
- package/src/Dialog/index.web.ts +5 -2
- package/src/Dialog/types.ts +22 -16
- package/src/Divider/Divider.native.tsx +19 -14
- package/src/Divider/Divider.styles.tsx +273 -595
- package/src/Divider/Divider.web.tsx +19 -12
- package/src/Divider/index.ts +5 -5
- package/src/Divider/index.web.ts +5 -3
- package/src/Divider/types.ts +28 -19
- package/src/Icon/Icon.native.tsx +17 -24
- package/src/Icon/Icon.styles.tsx +64 -48
- package/src/Icon/Icon.web.tsx +14 -11
- package/src/Icon/IconSvg/IconSvg.native.tsx +42 -0
- package/src/Icon/IconSvg/IconSvg.web.tsx +40 -0
- package/src/Icon/IconSvg/index.native.ts +1 -0
- package/src/Icon/IconSvg/index.ts +1 -0
- package/src/Icon/icon-resolver.native.ts +27 -0
- package/src/Icon/icon-resolver.ts +70 -0
- package/src/Icon/index.ts +5 -5
- package/src/Icon/index.web.ts +5 -3
- package/src/Icon/types.ts +17 -11
- package/src/Image/Image.native.tsx +86 -0
- package/src/Image/Image.styles.tsx +57 -0
- package/src/Image/Image.web.tsx +92 -0
- package/src/Image/index.native.ts +5 -0
- package/src/Image/index.ts +5 -0
- package/src/Image/types.ts +21 -0
- package/src/Input/Input.native.tsx +103 -26
- package/src/Input/Input.styles.tsx +240 -177
- package/src/Input/Input.web.tsx +141 -38
- package/src/Input/index.ts +5 -5
- package/src/Input/index.web.ts +5 -3
- package/src/Input/types.ts +43 -20
- package/src/List/List.native.tsx +56 -0
- package/src/List/List.styles.tsx +257 -0
- package/src/List/List.web.tsx +43 -0
- package/src/List/ListContext.tsx +16 -0
- package/src/List/ListItem.native.tsx +111 -0
- package/src/List/ListItem.web.tsx +110 -0
- package/src/List/ListSection.native.tsx +31 -0
- package/src/List/ListSection.web.tsx +33 -0
- package/src/List/index.native.tsx +5 -0
- package/src/List/index.ts +5 -0
- package/src/List/index.web.tsx +5 -0
- package/src/List/types.ts +42 -0
- package/src/Menu/Menu.native.tsx +150 -0
- package/src/Menu/Menu.styles.tsx +185 -0
- package/src/Menu/Menu.web.tsx +99 -0
- package/src/Menu/MenuItem.native.tsx +66 -0
- package/src/Menu/MenuItem.styles.tsx +119 -0
- package/src/Menu/MenuItem.web.tsx +67 -0
- package/src/Menu/index.native.ts +3 -0
- package/src/Menu/index.ts +3 -0
- package/src/Menu/index.web.ts +3 -0
- package/src/Menu/types.ts +30 -0
- package/src/Popover/Popover.native.tsx +102 -32
- package/src/Popover/Popover.styles.tsx +100 -67
- package/src/Popover/Popover.web.tsx +36 -260
- package/src/Popover/index.ts +5 -2
- package/src/Popover/index.web.ts +5 -2
- package/src/Popover/types.ts +14 -13
- package/src/Pressable/Pressable.native.tsx +7 -6
- package/src/Pressable/Pressable.web.tsx +8 -6
- package/src/Pressable/index.ts +5 -2
- package/src/Pressable/index.web.ts +5 -2
- package/src/Pressable/types.ts +11 -10
- package/src/Progress/Progress.native.tsx +179 -0
- package/src/Progress/Progress.styles.tsx +164 -0
- package/src/Progress/Progress.web.tsx +144 -0
- package/src/Progress/index.native.ts +1 -0
- package/src/Progress/index.ts +5 -0
- package/src/Progress/index.web.ts +5 -0
- package/src/Progress/types.ts +21 -0
- package/src/RadioButton/RadioButton.native.tsx +88 -0
- package/src/RadioButton/RadioButton.styles.tsx +163 -0
- package/src/RadioButton/RadioButton.web.tsx +85 -0
- package/src/RadioButton/RadioGroup.native.tsx +43 -0
- package/src/RadioButton/RadioGroup.web.tsx +49 -0
- package/src/RadioButton/index.native.ts +2 -0
- package/src/RadioButton/index.ts +2 -0
- package/src/RadioButton/index.web.ts +2 -0
- package/src/RadioButton/types.ts +29 -0
- package/src/SVGImage/SVGImage.native.tsx +9 -7
- package/src/SVGImage/SVGImage.styles.tsx +63 -55
- package/src/SVGImage/SVGImage.web.tsx +16 -13
- package/src/SVGImage/index.ts +5 -5
- package/src/SVGImage/index.web.ts +5 -2
- package/src/SVGImage/types.ts +7 -3
- package/src/Screen/Screen.native.tsx +43 -17
- package/src/Screen/Screen.styles.tsx +58 -54
- package/src/Screen/Screen.web.tsx +11 -5
- package/src/Screen/index.ts +5 -2
- package/src/Screen/index.web.ts +5 -2
- package/src/Screen/types.ts +23 -9
- package/src/Select/Select.native.tsx +347 -0
- package/src/Select/Select.styles.tsx +335 -0
- package/src/Select/Select.web.tsx +276 -0
- package/src/Select/index.native.ts +2 -0
- package/src/Select/index.ts +5 -0
- package/src/Select/index.web.ts +5 -0
- package/src/Select/types.ts +124 -0
- package/src/Skeleton/Skeleton.native.tsx +139 -0
- package/src/Skeleton/Skeleton.styles.tsx +59 -0
- package/src/Skeleton/Skeleton.web.tsx +112 -0
- package/src/Skeleton/index.native.ts +4 -0
- package/src/Skeleton/index.ts +5 -0
- package/src/Skeleton/index.web.ts +5 -0
- package/src/Skeleton/types.ts +75 -0
- package/src/Slider/Slider.native.tsx +248 -0
- package/src/Slider/Slider.styles.tsx +241 -0
- package/src/Slider/Slider.web.tsx +226 -0
- package/src/Slider/index.native.ts +3 -0
- package/src/Slider/index.ts +5 -0
- package/src/Slider/index.web.ts +5 -0
- package/src/Slider/types.ts +31 -0
- package/src/Switch/Switch.native.tsx +131 -0
- package/src/Switch/Switch.styles.tsx +169 -0
- package/src/Switch/Switch.web.tsx +121 -0
- package/src/Switch/index.native.ts +3 -0
- package/src/Switch/index.ts +5 -0
- package/src/Switch/index.web.ts +5 -0
- package/src/Switch/types.ts +21 -0
- package/src/TabBar/TabBar.native.tsx +142 -0
- package/src/TabBar/TabBar.styles.tsx +399 -0
- package/src/TabBar/TabBar.web.tsx +205 -0
- package/src/TabBar/index.native.tsx +3 -0
- package/src/TabBar/index.ts +3 -0
- package/src/TabBar/index.web.tsx +3 -0
- package/src/TabBar/types.ts +26 -0
- package/src/Table/Table.native.tsx +122 -0
- package/src/Table/Table.styles.tsx +283 -0
- package/src/Table/Table.web.tsx +112 -0
- package/src/Table/index.native.tsx +3 -0
- package/src/Table/index.ts +3 -0
- package/src/Table/index.web.tsx +3 -0
- package/src/Table/types.ts +28 -0
- package/src/Text/Text.native.tsx +12 -11
- package/src/Text/Text.styles.tsx +76 -64
- package/src/Text/Text.web.tsx +14 -9
- package/src/Text/index.ts +5 -5
- package/src/Text/index.web.ts +5 -3
- package/src/Text/types.ts +20 -13
- package/src/TextArea/TextArea.native.tsx +134 -0
- package/src/TextArea/TextArea.styles.tsx +175 -0
- package/src/TextArea/TextArea.web.tsx +156 -0
- package/src/TextArea/index.native.ts +3 -0
- package/src/TextArea/index.ts +3 -0
- package/src/TextArea/index.web.ts +3 -0
- package/src/TextArea/types.ts +30 -0
- package/src/Tooltip/Tooltip.native.tsx +165 -0
- package/src/Tooltip/Tooltip.styles.tsx +73 -0
- package/src/Tooltip/Tooltip.web.tsx +87 -0
- package/src/Tooltip/index.native.ts +3 -0
- package/src/Tooltip/index.ts +3 -0
- package/src/Tooltip/types.ts +18 -0
- package/src/Video/Video.native.tsx +105 -0
- package/src/Video/Video.styles.tsx +39 -0
- package/src/Video/Video.web.tsx +115 -0
- package/src/Video/index.native.ts +5 -0
- package/src/Video/index.ts +5 -0
- package/src/Video/types.ts +29 -0
- package/src/View/View.native.tsx +9 -14
- package/src/View/View.styles.tsx +101 -93
- package/src/View/View.web.tsx +16 -17
- package/src/View/index.ts +5 -5
- package/src/View/index.web.ts +5 -3
- package/src/View/types.ts +29 -21
- package/src/examples/AccordionExamples.tsx +126 -0
- package/src/examples/AlertExamples.tsx +280 -0
- package/src/examples/AvatarExamples.tsx +23 -23
- package/src/examples/BadgeExamples.tsx +109 -41
- package/src/examples/BreadcrumbExamples.tsx +312 -0
- package/src/examples/ButtonExamples.tsx +160 -33
- package/src/examples/CardExamples.tsx +40 -40
- package/src/examples/CheckboxExamples.tsx +12 -12
- package/src/examples/ChipExamples.tsx +197 -0
- package/src/examples/DialogExamples.tsx +22 -22
- package/src/examples/DividerExamples.tsx +49 -49
- package/src/examples/IconExamples.tsx +270 -54
- package/src/examples/ImageExamples.tsx +174 -0
- package/src/examples/InputExamples.tsx +75 -17
- package/src/examples/ListExamples.tsx +288 -0
- package/src/examples/MenuExamples.tsx +144 -0
- package/src/examples/PopoverExamples.tsx +69 -73
- package/src/examples/ProgressExamples.tsx +137 -0
- package/src/examples/RadioButtonExamples.tsx +161 -0
- package/src/examples/SVGImageExamples.tsx +19 -17
- package/src/examples/ScreenExamples.tsx +31 -31
- package/src/examples/SelectExamples.tsx +423 -0
- package/src/examples/SkeletonExamples.tsx +206 -0
- package/src/examples/SliderExamples.tsx +200 -0
- package/src/examples/SwitchExamples.tsx +182 -0
- package/src/examples/TabBarExamples.tsx +143 -0
- package/src/examples/TableExamples.tsx +280 -0
- package/src/examples/TextAreaExamples.tsx +173 -0
- package/src/examples/TextExamples.tsx +28 -32
- package/src/examples/ThemeExtensionExamples.tsx +10 -10
- package/src/examples/TooltipExamples.tsx +126 -0
- package/src/examples/VideoExamples.tsx +144 -0
- package/src/examples/ViewExamples.tsx +64 -56
- package/src/examples/index.ts +18 -3
- package/src/hooks/useMergeRefs.ts +16 -0
- package/src/hooks/useSmartPosition.native.ts +169 -0
- package/src/index.native.ts +80 -9
- package/src/index.ts +75 -1
- package/src/internal/BoundedModalContent.native.tsx +58 -0
- package/src/internal/PositionedPortal.tsx +254 -0
- package/src/internal/SafeAreaDebugOverlay.native.tsx +173 -0
- package/src/unistyles.d.ts +6 -0
- package/src/utils/buildSizeVariants.ts +16 -0
- package/src/utils/deepMerge.ts +43 -0
- package/src/utils/positionUtils.native.ts +280 -0
- package/src/utils/styleHelpers.ts +48 -0
- package/LLM-ACCESS-GUIDE.md +0 -143
- package/src/ActivityIndicator/README.md +0 -132
- package/src/Avatar/README.md +0 -139
- package/src/Badge/README.md +0 -170
- package/src/Button/Button.types.ts +0 -12
- package/src/Button/README.md +0 -262
- package/src/Card/README.md +0 -258
- package/src/Checkbox/README.md +0 -102
- package/src/Dialog/README.md +0 -210
- package/src/Divider/README.md +0 -108
- package/src/Icon/README.md +0 -81
- package/src/Input/README.md +0 -100
- package/src/SVGImage/README.md +0 -209
- package/src/Screen/README.md +0 -86
- package/src/Text/README.md +0 -94
- package/src/View/README.md +0 -107
- package/src/examples/AllExamples.tsx +0 -84
- package/src/examples/README.md +0 -136
- package/src/examples/ValidationExamples.tsx +0 -95
- package/src/examples/extendedTheme.ts +0 -329
- package/src/theme/breakpoints.ts +0 -8
- package/src/theme/colorResolver.ts +0 -218
- package/src/theme/colors.ts +0 -315
- package/src/theme/defaultThemes.ts +0 -326
- package/src/theme/index.ts +0 -188
- package/src/theme/themeBuilder.ts +0 -602
- package/src/theme/unistyles.d.ts +0 -6
- package/src/theme/variantHelpers.ts +0 -584
- package/src/theme/variants.ts +0 -56
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Screen, View, Text, Badge, Button } from '@idealyst/components';
|
|
3
|
+
import Table from '../Table';
|
|
4
|
+
import type { TableColumn } from '../Table/types';
|
|
5
|
+
|
|
6
|
+
interface User {
|
|
7
|
+
id: number;
|
|
8
|
+
name: string;
|
|
9
|
+
email: string;
|
|
10
|
+
role: string;
|
|
11
|
+
status: 'active' | 'inactive';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface Product {
|
|
15
|
+
id: number;
|
|
16
|
+
name: string;
|
|
17
|
+
category: string;
|
|
18
|
+
price: number;
|
|
19
|
+
stock: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const TableExamples: React.FC = () => {
|
|
23
|
+
const users: User[] = [
|
|
24
|
+
{ id: 1, name: 'John Doe', email: 'john@example.com', role: 'Admin', status: 'active' },
|
|
25
|
+
{ id: 2, name: 'Jane Smith', email: 'jane@example.com', role: 'User', status: 'active' },
|
|
26
|
+
{ id: 3, name: 'Bob Johnson', email: 'bob@example.com', role: 'User', status: 'inactive' },
|
|
27
|
+
{ id: 4, name: 'Alice Williams', email: 'alice@example.com', role: 'Manager', status: 'active' },
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
const products: Product[] = [
|
|
31
|
+
{ id: 1, name: 'Laptop', category: 'Electronics', price: 999.99, stock: 15 },
|
|
32
|
+
{ id: 2, name: 'Mouse', category: 'Electronics', price: 29.99, stock: 150 },
|
|
33
|
+
{ id: 3, name: 'Keyboard', category: 'Electronics', price: 79.99, stock: 75 },
|
|
34
|
+
{ id: 4, name: 'Monitor', category: 'Electronics', price: 299.99, stock: 30 },
|
|
35
|
+
{ id: 5, name: 'Desk', category: 'Furniture', price: 399.99, stock: 10 },
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
const userColumns: TableColumn<User>[] = [
|
|
39
|
+
{
|
|
40
|
+
key: 'name',
|
|
41
|
+
title: 'Name',
|
|
42
|
+
dataIndex: 'name',
|
|
43
|
+
width: '200px',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
key: 'email',
|
|
47
|
+
title: 'Email',
|
|
48
|
+
dataIndex: 'email',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
key: 'role',
|
|
52
|
+
title: 'Role',
|
|
53
|
+
dataIndex: 'role',
|
|
54
|
+
width: '120px',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
key: 'status',
|
|
58
|
+
title: 'Status',
|
|
59
|
+
dataIndex: 'status',
|
|
60
|
+
width: '100px',
|
|
61
|
+
render: (status: string) => (
|
|
62
|
+
<Badge
|
|
63
|
+
type="filled"
|
|
64
|
+
color={status === 'active' ? 'green' : 'gray'}
|
|
65
|
+
>
|
|
66
|
+
{status}
|
|
67
|
+
</Badge>
|
|
68
|
+
),
|
|
69
|
+
},
|
|
70
|
+
];
|
|
71
|
+
|
|
72
|
+
const productColumns: TableColumn<Product>[] = [
|
|
73
|
+
{
|
|
74
|
+
key: 'name',
|
|
75
|
+
title: 'Product',
|
|
76
|
+
dataIndex: 'name',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
key: 'category',
|
|
80
|
+
title: 'Category',
|
|
81
|
+
dataIndex: 'category',
|
|
82
|
+
width: '150px',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
key: 'price',
|
|
86
|
+
title: 'Price',
|
|
87
|
+
dataIndex: 'price',
|
|
88
|
+
width: '120px',
|
|
89
|
+
align: 'right',
|
|
90
|
+
render: (price: number) => `$${price.toFixed(2)}`,
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
key: 'stock',
|
|
94
|
+
title: 'Stock',
|
|
95
|
+
dataIndex: 'stock',
|
|
96
|
+
width: '100px',
|
|
97
|
+
align: 'center',
|
|
98
|
+
render: (stock: number) => (
|
|
99
|
+
<Badge
|
|
100
|
+
type="filled"
|
|
101
|
+
color={stock > 50 ? 'green' : stock > 20 ? 'yellow' : 'red'}
|
|
102
|
+
>
|
|
103
|
+
{stock}
|
|
104
|
+
</Badge>
|
|
105
|
+
),
|
|
106
|
+
},
|
|
107
|
+
];
|
|
108
|
+
|
|
109
|
+
const actionColumns: TableColumn<User>[] = [
|
|
110
|
+
{
|
|
111
|
+
key: 'name',
|
|
112
|
+
title: 'Name',
|
|
113
|
+
dataIndex: 'name',
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
key: 'email',
|
|
117
|
+
title: 'Email',
|
|
118
|
+
dataIndex: 'email',
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
key: 'actions',
|
|
122
|
+
title: 'Actions',
|
|
123
|
+
width: '200px',
|
|
124
|
+
render: (_, user) => (
|
|
125
|
+
<View style={{ flexDirection: 'row', gap: 8 }}>
|
|
126
|
+
<Button size="sm" type="outlined" onPress={() => console.log('Edit', user.id)}>
|
|
127
|
+
Edit
|
|
128
|
+
</Button>
|
|
129
|
+
<Button size="sm" type="outlined" intent="error" onPress={() => console.log('Delete', user.id)}>
|
|
130
|
+
Delete
|
|
131
|
+
</Button>
|
|
132
|
+
</View>
|
|
133
|
+
),
|
|
134
|
+
},
|
|
135
|
+
];
|
|
136
|
+
|
|
137
|
+
return (
|
|
138
|
+
<Screen background="primary" padding="lg">
|
|
139
|
+
<View spacing="lg">
|
|
140
|
+
<Text size="xl" weight="bold">Table Examples</Text>
|
|
141
|
+
|
|
142
|
+
<View spacing="md">
|
|
143
|
+
<Text size="lg" weight="semibold">Basic Table</Text>
|
|
144
|
+
<Table columns={userColumns} data={users} />
|
|
145
|
+
</View>
|
|
146
|
+
|
|
147
|
+
<View spacing="md">
|
|
148
|
+
<Text size="lg" weight="semibold">Variants</Text>
|
|
149
|
+
<View spacing="sm">
|
|
150
|
+
<View spacing="xs">
|
|
151
|
+
<Text size="sm" weight="medium">Default</Text>
|
|
152
|
+
<Table
|
|
153
|
+
columns={userColumns}
|
|
154
|
+
data={users}
|
|
155
|
+
type="standard"
|
|
156
|
+
/>
|
|
157
|
+
</View>
|
|
158
|
+
<View spacing="xs">
|
|
159
|
+
<Text size="sm" weight="medium">Bordered</Text>
|
|
160
|
+
<Table
|
|
161
|
+
columns={userColumns}
|
|
162
|
+
data={users}
|
|
163
|
+
type="bordered"
|
|
164
|
+
/>
|
|
165
|
+
</View>
|
|
166
|
+
<View spacing="xs">
|
|
167
|
+
<Text size="sm" weight="medium">Striped</Text>
|
|
168
|
+
<Table
|
|
169
|
+
columns={userColumns}
|
|
170
|
+
data={users}
|
|
171
|
+
type="striped"
|
|
172
|
+
/>
|
|
173
|
+
</View>
|
|
174
|
+
</View>
|
|
175
|
+
</View>
|
|
176
|
+
|
|
177
|
+
<View spacing="md">
|
|
178
|
+
<Text size="lg" weight="semibold">Sizes</Text>
|
|
179
|
+
<View spacing="sm">
|
|
180
|
+
<View spacing="xs">
|
|
181
|
+
<Text size="sm" weight="medium">Small</Text>
|
|
182
|
+
<Table
|
|
183
|
+
columns={userColumns}
|
|
184
|
+
data={users.slice(0, 2)}
|
|
185
|
+
size="sm"
|
|
186
|
+
type="bordered"
|
|
187
|
+
/>
|
|
188
|
+
</View>
|
|
189
|
+
<View spacing="xs">
|
|
190
|
+
<Text size="sm" weight="medium">Medium (default)</Text>
|
|
191
|
+
<Table
|
|
192
|
+
columns={userColumns}
|
|
193
|
+
data={users.slice(0, 2)}
|
|
194
|
+
size="md"
|
|
195
|
+
type="bordered"
|
|
196
|
+
/>
|
|
197
|
+
</View>
|
|
198
|
+
<View spacing="xs">
|
|
199
|
+
<Text size="sm" weight="medium">Large</Text>
|
|
200
|
+
<Table
|
|
201
|
+
columns={userColumns}
|
|
202
|
+
data={users.slice(0, 2)}
|
|
203
|
+
size="lg"
|
|
204
|
+
type="bordered"
|
|
205
|
+
/>
|
|
206
|
+
</View>
|
|
207
|
+
</View>
|
|
208
|
+
</View>
|
|
209
|
+
|
|
210
|
+
<View spacing="md">
|
|
211
|
+
<Text size="lg" weight="semibold">Custom Rendering</Text>
|
|
212
|
+
<Table columns={productColumns} data={products} type="striped" />
|
|
213
|
+
</View>
|
|
214
|
+
|
|
215
|
+
<View spacing="md">
|
|
216
|
+
<Text size="lg" weight="semibold">Clickable Rows</Text>
|
|
217
|
+
<Table
|
|
218
|
+
columns={userColumns}
|
|
219
|
+
data={users}
|
|
220
|
+
type="bordered"
|
|
221
|
+
onRowPress={(user) => console.log('Clicked user:', user)}
|
|
222
|
+
/>
|
|
223
|
+
<Text size="sm" color="secondary">
|
|
224
|
+
Click any row to see console output
|
|
225
|
+
</Text>
|
|
226
|
+
</View>
|
|
227
|
+
|
|
228
|
+
<View spacing="md">
|
|
229
|
+
<Text size="lg" weight="semibold">With Actions</Text>
|
|
230
|
+
<Table
|
|
231
|
+
columns={actionColumns}
|
|
232
|
+
data={users}
|
|
233
|
+
type="bordered"
|
|
234
|
+
/>
|
|
235
|
+
</View>
|
|
236
|
+
|
|
237
|
+
<View spacing="md">
|
|
238
|
+
<Text size="lg" weight="semibold">Column Alignment</Text>
|
|
239
|
+
<Table
|
|
240
|
+
columns={[
|
|
241
|
+
{ key: 'name', title: 'Product', dataIndex: 'name', align: 'left' },
|
|
242
|
+
{ key: 'category', title: 'Category', dataIndex: 'category', align: 'center', width: '150px' },
|
|
243
|
+
{ key: 'price', title: 'Price', dataIndex: 'price', align: 'right', width: '120px', render: (price: number) => `$${price.toFixed(2)}` },
|
|
244
|
+
]}
|
|
245
|
+
data={products.slice(0, 3)}
|
|
246
|
+
type="bordered"
|
|
247
|
+
/>
|
|
248
|
+
</View>
|
|
249
|
+
|
|
250
|
+
<View spacing="md">
|
|
251
|
+
<Text size="lg" weight="semibold">Fixed Column Widths</Text>
|
|
252
|
+
<Table
|
|
253
|
+
columns={[
|
|
254
|
+
{ key: 'id', title: 'ID', dataIndex: 'id', width: '60px' },
|
|
255
|
+
{ key: 'name', title: 'Name', dataIndex: 'name', width: '200px' },
|
|
256
|
+
{ key: 'email', title: 'Email', dataIndex: 'email' },
|
|
257
|
+
{ key: 'role', title: 'Role', dataIndex: 'role', width: '120px' },
|
|
258
|
+
]}
|
|
259
|
+
data={users}
|
|
260
|
+
type="bordered"
|
|
261
|
+
/>
|
|
262
|
+
</View>
|
|
263
|
+
|
|
264
|
+
<View spacing="md">
|
|
265
|
+
<Text size="lg" weight="semibold">Empty Table</Text>
|
|
266
|
+
<Table
|
|
267
|
+
columns={userColumns}
|
|
268
|
+
data={[]}
|
|
269
|
+
type="bordered"
|
|
270
|
+
/>
|
|
271
|
+
<Text size="sm" color="secondary">
|
|
272
|
+
No data to display
|
|
273
|
+
</Text>
|
|
274
|
+
</View>
|
|
275
|
+
</View>
|
|
276
|
+
</Screen>
|
|
277
|
+
);
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
export default TableExamples;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Screen, View, Text } from '@idealyst/components';
|
|
3
|
+
import TextArea from '../TextArea';
|
|
4
|
+
|
|
5
|
+
export const TextAreaExamples: React.FC = () => {
|
|
6
|
+
const [basicValue, setBasicValue] = useState('');
|
|
7
|
+
const [limitedValue, setLimitedValue] = useState('');
|
|
8
|
+
const [errorValue, setErrorValue] = useState('');
|
|
9
|
+
const [autoGrowValue, setAutoGrowValue] = useState('');
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<Screen background="primary" padding="lg">
|
|
13
|
+
<View spacing="lg">
|
|
14
|
+
<Text size="xl" weight="bold">TextArea Examples</Text>
|
|
15
|
+
|
|
16
|
+
<View spacing="md">
|
|
17
|
+
<Text size="lg" weight="semibold">Basic TextArea</Text>
|
|
18
|
+
<TextArea
|
|
19
|
+
value={basicValue}
|
|
20
|
+
onChange={setBasicValue}
|
|
21
|
+
placeholder="Enter your text here..."
|
|
22
|
+
rows={4}
|
|
23
|
+
/>
|
|
24
|
+
</View>
|
|
25
|
+
|
|
26
|
+
<View spacing="md">
|
|
27
|
+
<Text size="lg" weight="semibold">Auto-Growing TextArea</Text>
|
|
28
|
+
<TextArea
|
|
29
|
+
label="Auto-grow with min/max height"
|
|
30
|
+
value={autoGrowValue}
|
|
31
|
+
onChange={setAutoGrowValue}
|
|
32
|
+
placeholder="Type multiple lines to see auto-grow in action..."
|
|
33
|
+
autoGrow
|
|
34
|
+
minHeight={60}
|
|
35
|
+
maxHeight={200}
|
|
36
|
+
helperText="This textarea grows as you type, up to 200px"
|
|
37
|
+
/>
|
|
38
|
+
</View>
|
|
39
|
+
|
|
40
|
+
<View spacing="md">
|
|
41
|
+
<Text size="lg" weight="semibold">With Label</Text>
|
|
42
|
+
<TextArea
|
|
43
|
+
label="Description"
|
|
44
|
+
value={basicValue}
|
|
45
|
+
onChange={setBasicValue}
|
|
46
|
+
placeholder="Enter description..."
|
|
47
|
+
helperText="Provide a detailed description"
|
|
48
|
+
/>
|
|
49
|
+
</View>
|
|
50
|
+
|
|
51
|
+
<View spacing="md">
|
|
52
|
+
<Text size="lg" weight="semibold">Sizes</Text>
|
|
53
|
+
<View spacing="sm">
|
|
54
|
+
<TextArea
|
|
55
|
+
size="sm"
|
|
56
|
+
placeholder="Small textarea"
|
|
57
|
+
rows={3}
|
|
58
|
+
/>
|
|
59
|
+
<TextArea
|
|
60
|
+
size="md"
|
|
61
|
+
placeholder="Medium textarea (default)"
|
|
62
|
+
rows={3}
|
|
63
|
+
/>
|
|
64
|
+
<TextArea
|
|
65
|
+
size="lg"
|
|
66
|
+
placeholder="Large textarea"
|
|
67
|
+
rows={3}
|
|
68
|
+
/>
|
|
69
|
+
</View>
|
|
70
|
+
</View>
|
|
71
|
+
|
|
72
|
+
<View spacing="md">
|
|
73
|
+
<Text size="lg" weight="semibold">Intent Colors</Text>
|
|
74
|
+
<View spacing="sm">
|
|
75
|
+
<TextArea
|
|
76
|
+
intent="primary"
|
|
77
|
+
placeholder="Primary intent"
|
|
78
|
+
rows={2}
|
|
79
|
+
/>
|
|
80
|
+
<TextArea
|
|
81
|
+
intent="success"
|
|
82
|
+
placeholder="Success intent"
|
|
83
|
+
rows={2}
|
|
84
|
+
/>
|
|
85
|
+
<TextArea
|
|
86
|
+
intent="warning"
|
|
87
|
+
placeholder="Warning intent"
|
|
88
|
+
rows={2}
|
|
89
|
+
/>
|
|
90
|
+
<TextArea
|
|
91
|
+
intent="neutral"
|
|
92
|
+
placeholder="Neutral intent"
|
|
93
|
+
rows={2}
|
|
94
|
+
/>
|
|
95
|
+
</View>
|
|
96
|
+
</View>
|
|
97
|
+
|
|
98
|
+
<View spacing="md">
|
|
99
|
+
<Text size="lg" weight="semibold">With Character Limit</Text>
|
|
100
|
+
<TextArea
|
|
101
|
+
label="Limited Input"
|
|
102
|
+
value={limitedValue}
|
|
103
|
+
onChange={setLimitedValue}
|
|
104
|
+
placeholder="Maximum 100 characters"
|
|
105
|
+
maxLength={100}
|
|
106
|
+
showCharacterCount
|
|
107
|
+
rows={3}
|
|
108
|
+
/>
|
|
109
|
+
</View>
|
|
110
|
+
|
|
111
|
+
<View spacing="md">
|
|
112
|
+
<Text size="lg" weight="semibold">Error State</Text>
|
|
113
|
+
<TextArea
|
|
114
|
+
label="Required Field"
|
|
115
|
+
value={errorValue}
|
|
116
|
+
onChange={setErrorValue}
|
|
117
|
+
placeholder="This field is required"
|
|
118
|
+
error="This field cannot be empty"
|
|
119
|
+
rows={3}
|
|
120
|
+
/>
|
|
121
|
+
</View>
|
|
122
|
+
|
|
123
|
+
<View spacing="md">
|
|
124
|
+
<Text size="lg" weight="semibold">Resize Options</Text>
|
|
125
|
+
<View spacing="sm">
|
|
126
|
+
<TextArea
|
|
127
|
+
placeholder="Resize: none"
|
|
128
|
+
resize="none"
|
|
129
|
+
rows={2}
|
|
130
|
+
/>
|
|
131
|
+
<TextArea
|
|
132
|
+
placeholder="Resize: vertical"
|
|
133
|
+
resize="vertical"
|
|
134
|
+
rows={2}
|
|
135
|
+
/>
|
|
136
|
+
<TextArea
|
|
137
|
+
placeholder="Resize: horizontal"
|
|
138
|
+
resize="horizontal"
|
|
139
|
+
rows={2}
|
|
140
|
+
/>
|
|
141
|
+
<TextArea
|
|
142
|
+
placeholder="Resize: both"
|
|
143
|
+
resize="both"
|
|
144
|
+
rows={2}
|
|
145
|
+
/>
|
|
146
|
+
</View>
|
|
147
|
+
</View>
|
|
148
|
+
|
|
149
|
+
<View spacing="md">
|
|
150
|
+
<Text size="lg" weight="semibold">Custom Styling</Text>
|
|
151
|
+
<TextArea
|
|
152
|
+
label="Monospace Font"
|
|
153
|
+
placeholder="Code or monospace text..."
|
|
154
|
+
textareaStyle={{ fontFamily: 'monospace' }}
|
|
155
|
+
rows={4}
|
|
156
|
+
/>
|
|
157
|
+
</View>
|
|
158
|
+
|
|
159
|
+
<View spacing="md">
|
|
160
|
+
<Text size="lg" weight="semibold">Disabled State</Text>
|
|
161
|
+
<TextArea
|
|
162
|
+
label="Disabled"
|
|
163
|
+
value="This textarea is disabled"
|
|
164
|
+
disabled
|
|
165
|
+
rows={3}
|
|
166
|
+
/>
|
|
167
|
+
</View>
|
|
168
|
+
</View>
|
|
169
|
+
</Screen>
|
|
170
|
+
);
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export default TextAreaExamples;
|
|
@@ -1,28 +1,27 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { Screen, View, Text } from '../index';
|
|
3
2
|
|
|
4
3
|
export const TextExamples = () => {
|
|
5
4
|
return (
|
|
6
5
|
<Screen background="primary" padding="lg">
|
|
7
6
|
<View spacing="none">
|
|
8
|
-
<Text size="
|
|
7
|
+
<Text size="lg" weight="bold" align="center">
|
|
9
8
|
Text Examples
|
|
10
9
|
</Text>
|
|
11
|
-
|
|
10
|
+
|
|
12
11
|
{/* Text Sizes */}
|
|
13
12
|
<View spacing="md">
|
|
14
|
-
<Text size="
|
|
13
|
+
<Text size="md" weight="semibold">Sizes</Text>
|
|
15
14
|
<View spacing="sm" style={{ gap: 10 }}>
|
|
16
|
-
<Text size="
|
|
17
|
-
<Text size="
|
|
18
|
-
<Text size="
|
|
19
|
-
<Text size="
|
|
15
|
+
<Text size="sm">Small text - Lorem ipsum dolor sit amet</Text>
|
|
16
|
+
<Text size="md">Medium text - Lorem ipsum dolor sit amet</Text>
|
|
17
|
+
<Text size="lg">Large text - Lorem ipsum dolor sit amet</Text>
|
|
18
|
+
<Text size="xl">Extra large text - Lorem ipsum dolor sit amet</Text>
|
|
20
19
|
</View>
|
|
21
20
|
</View>
|
|
22
21
|
|
|
23
22
|
{/* Text Weights */}
|
|
24
23
|
<View spacing="md">
|
|
25
|
-
<Text size="
|
|
24
|
+
<Text size="md" weight="semibold">Weights</Text>
|
|
26
25
|
<View spacing="sm" style={{ gap: 10 }}>
|
|
27
26
|
<Text weight="light">Light weight text</Text>
|
|
28
27
|
<Text weight="normal">Normal weight text</Text>
|
|
@@ -32,35 +31,35 @@ export const TextExamples = () => {
|
|
|
32
31
|
</View>
|
|
33
32
|
</View>
|
|
34
33
|
|
|
35
|
-
{/* Text Colors */}
|
|
34
|
+
{/* Semantic Text Colors */}
|
|
36
35
|
<View spacing="md">
|
|
37
|
-
<Text size="
|
|
36
|
+
<Text size="md" weight="semibold">Semantic Text Colors</Text>
|
|
38
37
|
<View spacing="sm" style={{ gap: 10 }}>
|
|
39
|
-
<Text color="primary">Primary
|
|
40
|
-
<Text color="secondary">Secondary
|
|
41
|
-
<Text color="
|
|
42
|
-
<Text color="green">Green color text</Text>
|
|
43
|
-
<Text color="red">Red color text</Text>
|
|
44
|
-
<Text color="orange">Orange color text</Text>
|
|
38
|
+
<Text color="primary">Primary text - Main text color</Text>
|
|
39
|
+
<Text color="secondary">Secondary text - Subdued text</Text>
|
|
40
|
+
<Text color="tertiary">Tertiary text - More subdued text</Text>
|
|
45
41
|
</View>
|
|
46
42
|
</View>
|
|
47
43
|
|
|
48
|
-
{/* Text
|
|
44
|
+
{/* Inverse Text Colors */}
|
|
49
45
|
<View spacing="md">
|
|
50
|
-
<Text size="
|
|
46
|
+
<Text size="md" weight="semibold">Inverse Text Colors (on dark backgrounds)</Text>
|
|
51
47
|
<View spacing="sm" style={{ gap: 10 }}>
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
48
|
+
<View background="inverse" spacing="sm" radius="sm">
|
|
49
|
+
<Text color="inverse">Inverse (of primary) - Light text on dark background</Text>
|
|
50
|
+
</View>
|
|
51
|
+
<View background="inverse" spacing="sm" radius="sm">
|
|
52
|
+
<Text color="inverse-secondary">Inverse secondary (90% opacity)</Text>
|
|
53
|
+
</View>
|
|
54
|
+
<View background="inverse" spacing="sm" radius="sm">
|
|
55
|
+
<Text color="inverse-tertiary">Inverse tertiary (70% opacity)</Text>
|
|
56
|
+
</View>
|
|
58
57
|
</View>
|
|
59
58
|
</View>
|
|
60
59
|
|
|
61
60
|
{/* Text Alignment */}
|
|
62
61
|
<View spacing="md">
|
|
63
|
-
<Text size="
|
|
62
|
+
<Text size="md" weight="semibold">Alignment</Text>
|
|
64
63
|
<View spacing="sm" style={{ gap: 10 }}>
|
|
65
64
|
<Text align="left">Left aligned text</Text>
|
|
66
65
|
<Text align="center">Center aligned text</Text>
|
|
@@ -70,17 +69,14 @@ export const TextExamples = () => {
|
|
|
70
69
|
|
|
71
70
|
{/* Combined Examples */}
|
|
72
71
|
<View spacing="md">
|
|
73
|
-
<Text size="
|
|
72
|
+
<Text size="md" weight="semibold">Combined Examples</Text>
|
|
74
73
|
<View spacing="sm" style={{ gap: 10 }}>
|
|
75
|
-
<Text size="
|
|
74
|
+
<Text size="lg" weight="bold" color="primary" align="center">
|
|
76
75
|
Large Bold Primary Centered
|
|
77
76
|
</Text>
|
|
78
|
-
<Text size="
|
|
77
|
+
<Text size="sm" weight="light" color="secondary" align="right">
|
|
79
78
|
Small Light Secondary Right
|
|
80
79
|
</Text>
|
|
81
|
-
<Text size="medium" weight="semibold" color="green">
|
|
82
|
-
Medium Semibold Green
|
|
83
|
-
</Text>
|
|
84
80
|
</View>
|
|
85
81
|
</View>
|
|
86
82
|
</View>
|
|
@@ -5,13 +5,13 @@ export const ThemeExtensionExamples = () => {
|
|
|
5
5
|
return (
|
|
6
6
|
<Screen background="primary" padding="lg">
|
|
7
7
|
<View spacing="lg">
|
|
8
|
-
<Text size="
|
|
8
|
+
<Text size="lg" weight="bold" align="center">
|
|
9
9
|
Extended Theme Test
|
|
10
10
|
</Text>
|
|
11
11
|
|
|
12
12
|
{/* Extended Colors */}
|
|
13
13
|
<View spacing="md">
|
|
14
|
-
<Text size="
|
|
14
|
+
<Text size="md" weight="semibold">Extended Colors</Text>
|
|
15
15
|
<View style={{ flexDirection: 'row', gap: 8, flexWrap: 'wrap' }}>
|
|
16
16
|
<Badge color={"orange" as any}>Orange</Badge>
|
|
17
17
|
<Badge color={"teal" as any}>Teal</Badge>
|
|
@@ -31,7 +31,7 @@ export const ThemeExtensionExamples = () => {
|
|
|
31
31
|
|
|
32
32
|
{/* Extended Intents */}
|
|
33
33
|
<View spacing="md">
|
|
34
|
-
<Text size="
|
|
34
|
+
<Text size="md" weight="semibold">Extended Intents</Text>
|
|
35
35
|
<View style={{ flexDirection: 'row', gap: 8, flexWrap: 'wrap' }}>
|
|
36
36
|
<Button intent={"accent" as any}>Accent Button</Button>
|
|
37
37
|
<Button intent={"feature" as any}>Feature Button</Button>
|
|
@@ -39,21 +39,21 @@ export const ThemeExtensionExamples = () => {
|
|
|
39
39
|
</View>
|
|
40
40
|
|
|
41
41
|
<View style={{ flexDirection: 'row', gap: 8, flexWrap: 'wrap' }}>
|
|
42
|
-
<Button intent={"accent" as any}
|
|
43
|
-
<Button intent={"feature" as any}
|
|
44
|
-
<Button intent={"highlight" as any}
|
|
42
|
+
<Button intent={"accent" as any} type="outlined">Accent Outlined</Button>
|
|
43
|
+
<Button intent={"feature" as any} type="outlined">Feature Outlined</Button>
|
|
44
|
+
<Button intent={"highlight" as any} type="outlined">Highlight Outlined</Button>
|
|
45
45
|
</View>
|
|
46
46
|
</View>
|
|
47
47
|
|
|
48
48
|
{/* Mixed Usage */}
|
|
49
49
|
<View spacing="md">
|
|
50
|
-
<Text size="
|
|
50
|
+
<Text size="md" weight="semibold">Mixed Extended Usage</Text>
|
|
51
51
|
|
|
52
52
|
<Card>
|
|
53
53
|
<View spacing="sm">
|
|
54
54
|
<Text color={"orange" as any} weight="bold">Orange Card Header</Text>
|
|
55
55
|
<Text color="secondary">This card uses extended orange color for the header</Text>
|
|
56
|
-
<Button intent={"accent" as any} size="
|
|
56
|
+
<Button intent={"accent" as any} size="sm">Accent Action</Button>
|
|
57
57
|
</View>
|
|
58
58
|
</Card>
|
|
59
59
|
|
|
@@ -61,14 +61,14 @@ export const ThemeExtensionExamples = () => {
|
|
|
61
61
|
<View spacing="sm">
|
|
62
62
|
<Text color={"teal" as any} weight="bold">Teal Card Header</Text>
|
|
63
63
|
<Text color="secondary">This card uses extended teal color for the header</Text>
|
|
64
|
-
<Button intent={"feature" as any} size="
|
|
64
|
+
<Button intent={"feature" as any} size="sm">Feature Action</Button>
|
|
65
65
|
</View>
|
|
66
66
|
</Card>
|
|
67
67
|
</View>
|
|
68
68
|
|
|
69
69
|
{/* Form with Extended Colors */}
|
|
70
70
|
<View spacing="md">
|
|
71
|
-
<Text size="
|
|
71
|
+
<Text size="md" weight="semibold">Form with Extended Styling</Text>
|
|
72
72
|
|
|
73
73
|
<Input
|
|
74
74
|
placeholder="Input with accent intent"
|