@sudobility/components-rn 1.0.42 → 1.0.43
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/index.cjs.js +895 -299
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +896 -300
- package/dist/index.esm.js.map +1 -1
- package/dist/ui/Avatar/Avatar.d.ts.map +1 -1
- package/dist/ui/Breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/ui/BreadcrumbNav/BreadcrumbNav.d.ts.map +1 -1
- package/dist/ui/CTASection/CTASection.d.ts.map +1 -1
- package/dist/ui/Calendar/Calendar.d.ts.map +1 -1
- package/dist/ui/ChainBadge/ChainBadge.d.ts.map +1 -1
- package/dist/ui/Checkbox/Checkbox.d.ts +0 -22
- package/dist/ui/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/ui/Code/Code.d.ts +0 -17
- package/dist/ui/Code/Code.d.ts.map +1 -1
- package/dist/ui/CodeDisplay/CodeDisplay.d.ts +0 -21
- package/dist/ui/CodeDisplay/CodeDisplay.d.ts.map +1 -1
- package/dist/ui/CollapsibleSection/CollapsibleSection.d.ts.map +1 -1
- package/dist/ui/Combobox/Combobox.d.ts.map +1 -1
- package/dist/ui/Command/Command.d.ts.map +1 -1
- package/dist/ui/DashboardStatCard/DashboardStatCard.d.ts +0 -17
- package/dist/ui/DashboardStatCard/DashboardStatCard.d.ts.map +1 -1
- package/dist/ui/DataList/DataList.d.ts.map +1 -1
- package/dist/ui/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/ui/ExternalLink/ExternalLink.d.ts.map +1 -1
- package/dist/ui/FeatureCard/FeatureCard.d.ts.map +1 -1
- package/dist/ui/FeatureGrid/FeatureGrid.d.ts.map +1 -1
- package/dist/ui/GradientIconContainer/GradientIconContainer.d.ts +0 -13
- package/dist/ui/GradientIconContainer/GradientIconContainer.d.ts.map +1 -1
- package/dist/ui/HelperText/HelperText.d.ts.map +1 -1
- package/dist/ui/IconContainer/IconContainer.d.ts +0 -13
- package/dist/ui/IconContainer/IconContainer.d.ts.map +1 -1
- package/dist/ui/IconText/IconText.d.ts.map +1 -1
- package/dist/ui/InfiniteScroll/InfiniteScroll.d.ts.map +1 -1
- package/dist/ui/KeyValuePair/KeyValuePair.d.ts.map +1 -1
- package/dist/ui/Link/Link.d.ts.map +1 -1
- package/dist/ui/ListItemWithAction/ListItemWithAction.d.ts.map +1 -1
- package/dist/ui/Modal/Modal.d.ts.map +1 -1
- package/dist/ui/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/ui/NavigationList/NavigationList.d.ts.map +1 -1
- package/dist/ui/PageSectionHeader/PageSectionHeader.d.ts.map +1 -1
- package/dist/ui/Pagination/Pagination.d.ts.map +1 -1
- package/dist/ui/PhoneInput/PhoneInput.d.ts.map +1 -1
- package/dist/ui/PopupSelect/PopupSelect.d.ts.map +1 -1
- package/dist/ui/Progress/Progress.d.ts +0 -15
- package/dist/ui/Progress/Progress.d.ts.map +1 -1
- package/dist/ui/PromotionalBanner/PromotionalBanner.d.ts.map +1 -1
- package/dist/ui/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/ui/SectionHeader/SectionHeader.d.ts.map +1 -1
- package/dist/ui/Select/Select.d.ts.map +1 -1
- package/dist/ui/SettingsList/SettingsList.d.ts.map +1 -1
- package/dist/ui/Sheet/Sheet.d.ts.map +1 -1
- package/dist/ui/SideNav/SideNav.d.ts.map +1 -1
- package/dist/ui/SmartLink/SmartLink.d.ts.map +1 -1
- package/dist/ui/StatDisplay/StatDisplay.d.ts +0 -12
- package/dist/ui/StatDisplay/StatDisplay.d.ts.map +1 -1
- package/dist/ui/StepList/StepList.d.ts.map +1 -1
- package/dist/ui/Table/Table.d.ts.map +1 -1
- package/dist/ui/Tabs/Tabs.d.ts.map +1 -1
- package/dist/ui/TextArea/TextArea.d.ts.map +1 -1
- package/dist/ui/TextInputModal/TextInputModal.d.ts.map +1 -1
- package/dist/ui/Tooltip/Tooltip.d.ts +0 -20
- package/dist/ui/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/ui/TransferList/TransferList.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/ui/Avatar/Avatar.tsx +6 -5
- package/src/ui/Breadcrumb/Breadcrumb.tsx +8 -5
- package/src/ui/BreadcrumbNav/BreadcrumbNav.tsx +22 -3
- package/src/ui/CTASection/CTASection.tsx +8 -6
- package/src/ui/Calendar/Calendar.tsx +35 -6
- package/src/ui/ChainBadge/ChainBadge.tsx +67 -42
- package/src/ui/Checkbox/Checkbox.tsx +47 -20
- package/src/ui/Code/Code.tsx +51 -21
- package/src/ui/CodeDisplay/CodeDisplay.tsx +46 -20
- package/src/ui/CollapsibleSection/CollapsibleSection.tsx +7 -3
- package/src/ui/Combobox/Combobox.tsx +2 -1
- package/src/ui/Command/Command.tsx +2 -1
- package/src/ui/DashboardStatCard/DashboardStatCard.tsx +29 -11
- package/src/ui/DataList/DataList.tsx +23 -5
- package/src/ui/Dropdown/Dropdown.tsx +4 -1
- package/src/ui/ExternalLink/ExternalLink.tsx +5 -4
- package/src/ui/FeatureCard/FeatureCard.tsx +60 -29
- package/src/ui/FeatureGrid/FeatureGrid.tsx +7 -7
- package/src/ui/GradientIconContainer/GradientIconContainer.tsx +33 -8
- package/src/ui/HelperText/HelperText.tsx +9 -8
- package/src/ui/IconContainer/IconContainer.tsx +26 -9
- package/src/ui/IconText/IconText.tsx +6 -5
- package/src/ui/InfiniteScroll/InfiniteScroll.tsx +2 -1
- package/src/ui/KeyValuePair/KeyValuePair.tsx +12 -5
- package/src/ui/Link/Link.tsx +6 -5
- package/src/ui/ListItemWithAction/ListItemWithAction.tsx +2 -1
- package/src/ui/Modal/Modal.tsx +16 -2
- package/src/ui/MultiSelect/MultiSelect.tsx +2 -1
- package/src/ui/NavigationList/NavigationList.tsx +17 -3
- package/src/ui/PageSectionHeader/PageSectionHeader.tsx +2 -1
- package/src/ui/Pagination/Pagination.tsx +9 -6
- package/src/ui/PhoneInput/PhoneInput.tsx +3 -2
- package/src/ui/PopupSelect/PopupSelect.tsx +15 -14
- package/src/ui/Progress/Progress.tsx +63 -14
- package/src/ui/PromotionalBanner/PromotionalBanner.tsx +7 -4
- package/src/ui/SearchInput/SearchInput.tsx +3 -2
- package/src/ui/SectionHeader/SectionHeader.tsx +4 -1
- package/src/ui/Select/Select.tsx +20 -5
- package/src/ui/SettingsList/SettingsList.tsx +4 -1
- package/src/ui/Sheet/Sheet.tsx +20 -3
- package/src/ui/SideNav/SideNav.tsx +11 -2
- package/src/ui/SmartLink/SmartLink.tsx +6 -3
- package/src/ui/Spinner/Spinner.tsx +1 -1
- package/src/ui/StatDisplay/StatDisplay.tsx +59 -23
- package/src/ui/StepList/StepList.tsx +25 -3
- package/src/ui/Table/Table.tsx +22 -9
- package/src/ui/Tabs/Tabs.tsx +7 -2
- package/src/ui/TextArea/TextArea.tsx +2 -1
- package/src/ui/TextInputModal/TextInputModal.tsx +2 -1
- package/src/ui/Tooltip/Tooltip.tsx +47 -9
- package/src/ui/TransferList/TransferList.tsx +2 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { View, Text, Pressable } from 'react-native';
|
|
3
3
|
import { cn } from '../../lib/utils';
|
|
4
|
+
import { colors } from '@sudobility/design';
|
|
4
5
|
|
|
5
6
|
export interface PromotionalBannerProps {
|
|
6
7
|
/** Banner title */
|
|
@@ -52,8 +53,10 @@ export const PromotionalBanner: React.FC<PromotionalBannerProps> = ({
|
|
|
52
53
|
return (
|
|
53
54
|
<View
|
|
54
55
|
className={cn(
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
// Derive green palette from DS alert.success colors
|
|
57
|
+
colors.component.alert.success.base,
|
|
58
|
+
colors.component.alert.success.dark,
|
|
59
|
+
'border-b',
|
|
57
60
|
isProminent && 'border-b-2',
|
|
58
61
|
className
|
|
59
62
|
)}
|
|
@@ -62,7 +65,7 @@ export const PromotionalBanner: React.FC<PromotionalBannerProps> = ({
|
|
|
62
65
|
<View className='flex-row items-center justify-between gap-4 flex-wrap'>
|
|
63
66
|
{/* Left side: Badge + Title */}
|
|
64
67
|
<View className='flex-row items-center flex-1'>
|
|
65
|
-
{/* Badge */}
|
|
68
|
+
{/* Badge -- green-500 from colors.raw.green */}
|
|
66
69
|
<View className='bg-green-500 px-3 py-1 rounded-full mr-3'>
|
|
67
70
|
<Text className='text-white text-xs font-bold'>{badgeText}</Text>
|
|
68
71
|
</View>
|
|
@@ -85,7 +88,7 @@ export const PromotionalBanner: React.FC<PromotionalBannerProps> = ({
|
|
|
85
88
|
</View>
|
|
86
89
|
</View>
|
|
87
90
|
|
|
88
|
-
{/* CTA Button */}
|
|
91
|
+
{/* CTA Button -- success button from DS */}
|
|
89
92
|
<Pressable
|
|
90
93
|
onPress={onButtonPress}
|
|
91
94
|
className={cn(
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
TextInputProps,
|
|
10
10
|
} from 'react-native';
|
|
11
11
|
import { cn } from '../../lib/utils';
|
|
12
|
+
import { colors } from '@sudobility/design';
|
|
12
13
|
|
|
13
14
|
export interface SearchInputProps extends Omit<TextInputProps, 'onChange'> {
|
|
14
15
|
/** Current search query */
|
|
@@ -137,7 +138,7 @@ export const SearchInput: React.FC<SearchInputProps> = ({
|
|
|
137
138
|
disabled && 'opacity-50',
|
|
138
139
|
loading && 'opacity-60'
|
|
139
140
|
)}
|
|
140
|
-
placeholderTextColor=
|
|
141
|
+
placeholderTextColor={colors.raw.neutral[400]}
|
|
141
142
|
accessibilityRole='search'
|
|
142
143
|
accessibilityState={{ disabled }}
|
|
143
144
|
{...textInputProps}
|
|
@@ -159,7 +160,7 @@ export const SearchInput: React.FC<SearchInputProps> = ({
|
|
|
159
160
|
{/* Loading Spinner */}
|
|
160
161
|
{loading && (
|
|
161
162
|
<View className='absolute inset-y-0 right-0 flex items-center justify-center pr-3'>
|
|
162
|
-
<ActivityIndicator size='small' color=
|
|
163
|
+
<ActivityIndicator size='small' color={colors.raw.neutral[400]} />
|
|
163
164
|
</View>
|
|
164
165
|
)}
|
|
165
166
|
</View>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { View, Text, Pressable, ActivityIndicator } from 'react-native';
|
|
3
3
|
import { cn } from '../../lib/utils';
|
|
4
|
+
import { colors } from '@sudobility/design';
|
|
4
5
|
|
|
5
6
|
export interface SectionHeaderProps {
|
|
6
7
|
/** The header text/title */
|
|
@@ -53,7 +54,9 @@ export const SectionHeader: React.FC<SectionHeaderProps> = ({
|
|
|
53
54
|
{title}
|
|
54
55
|
</Text>
|
|
55
56
|
<View className='flex-row items-center gap-2'>
|
|
56
|
-
{loading &&
|
|
57
|
+
{loading && (
|
|
58
|
+
<ActivityIndicator size='small' color={colors.raw.blue[600]} />
|
|
59
|
+
)}
|
|
57
60
|
{actions}
|
|
58
61
|
{onAdd && (
|
|
59
62
|
<Pressable
|
package/src/ui/Select/Select.tsx
CHANGED
|
@@ -9,6 +9,9 @@ import {
|
|
|
9
9
|
SafeAreaView,
|
|
10
10
|
} from 'react-native';
|
|
11
11
|
import { cn } from '../../lib/utils';
|
|
12
|
+
import { designTokens } from '@sudobility/design';
|
|
13
|
+
|
|
14
|
+
const { typography } = designTokens;
|
|
12
15
|
|
|
13
16
|
export interface SelectOption {
|
|
14
17
|
label: string;
|
|
@@ -92,9 +95,9 @@ export const Select: React.FC<SelectProps> = ({
|
|
|
92
95
|
<View className='flex flex-row items-center justify-between'>
|
|
93
96
|
<Text
|
|
94
97
|
className={cn(
|
|
95
|
-
|
|
98
|
+
typography.size.base,
|
|
96
99
|
item.value === value
|
|
97
|
-
?
|
|
100
|
+
? `text-blue-600 dark:text-blue-400 ${typography.weight.medium}`
|
|
98
101
|
: 'text-gray-900 dark:text-gray-100'
|
|
99
102
|
)}
|
|
100
103
|
>
|
|
@@ -125,7 +128,8 @@ export const Select: React.FC<SelectProps> = ({
|
|
|
125
128
|
>
|
|
126
129
|
<Text
|
|
127
130
|
className={cn(
|
|
128
|
-
|
|
131
|
+
typography.size.base,
|
|
132
|
+
'flex-1',
|
|
129
133
|
selectedOption
|
|
130
134
|
? 'text-gray-900 dark:text-gray-100'
|
|
131
135
|
: 'text-gray-400 dark:text-gray-500'
|
|
@@ -149,11 +153,22 @@ export const Select: React.FC<SelectProps> = ({
|
|
|
149
153
|
{/* Header */}
|
|
150
154
|
<View className='flex flex-row items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700'>
|
|
151
155
|
<Pressable onPress={() => setIsOpen(false)}>
|
|
152
|
-
<Text
|
|
156
|
+
<Text
|
|
157
|
+
className={cn(
|
|
158
|
+
'text-blue-600 dark:text-blue-400',
|
|
159
|
+
typography.size.base
|
|
160
|
+
)}
|
|
161
|
+
>
|
|
153
162
|
Cancel
|
|
154
163
|
</Text>
|
|
155
164
|
</Pressable>
|
|
156
|
-
<Text
|
|
165
|
+
<Text
|
|
166
|
+
className={cn(
|
|
167
|
+
typography.size.base,
|
|
168
|
+
typography.weight.semibold,
|
|
169
|
+
'text-gray-900 dark:text-white'
|
|
170
|
+
)}
|
|
171
|
+
>
|
|
157
172
|
{title}
|
|
158
173
|
</Text>
|
|
159
174
|
<View style={{ width: 60 }} />
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { View, Text, Pressable } from 'react-native';
|
|
3
3
|
import { cn } from '../../lib/utils';
|
|
4
|
+
import { designTokens } from '@sudobility/design';
|
|
5
|
+
|
|
6
|
+
const { typography } = designTokens;
|
|
4
7
|
|
|
5
8
|
/**
|
|
6
9
|
* Setting item interface
|
|
@@ -88,7 +91,7 @@ export const SettingsList: React.FC<SettingsListProps> = ({
|
|
|
88
91
|
<View className='flex-1 min-w-0'>
|
|
89
92
|
<Text
|
|
90
93
|
className={cn(
|
|
91
|
-
|
|
94
|
+
typography.size.sm,
|
|
92
95
|
isSelected
|
|
93
96
|
? 'text-orange-700 dark:text-orange-300'
|
|
94
97
|
: 'text-gray-700 dark:text-gray-300'
|
package/src/ui/Sheet/Sheet.tsx
CHANGED
|
@@ -11,6 +11,9 @@ import {
|
|
|
11
11
|
PanResponder,
|
|
12
12
|
} from 'react-native';
|
|
13
13
|
import { cn } from '../../lib/utils';
|
|
14
|
+
import { designTokens } from '@sudobility/design';
|
|
15
|
+
|
|
16
|
+
const { typography } = designTokens;
|
|
14
17
|
|
|
15
18
|
const { height: SCREEN_HEIGHT, width: SCREEN_WIDTH } = Dimensions.get('window');
|
|
16
19
|
|
|
@@ -267,12 +270,24 @@ export const Sheet: React.FC<SheetProps> = ({
|
|
|
267
270
|
<View className='flex flex-row items-start justify-between'>
|
|
268
271
|
<View className='flex-1'>
|
|
269
272
|
{title && (
|
|
270
|
-
<Text
|
|
273
|
+
<Text
|
|
274
|
+
className={cn(
|
|
275
|
+
typography.size.lg,
|
|
276
|
+
typography.weight.semibold,
|
|
277
|
+
'text-gray-900 dark:text-white'
|
|
278
|
+
)}
|
|
279
|
+
>
|
|
271
280
|
{title}
|
|
272
281
|
</Text>
|
|
273
282
|
)}
|
|
274
283
|
{description && (
|
|
275
|
-
<Text
|
|
284
|
+
<Text
|
|
285
|
+
className={cn(
|
|
286
|
+
'mt-1',
|
|
287
|
+
typography.size.sm,
|
|
288
|
+
'text-gray-600 dark:text-gray-400'
|
|
289
|
+
)}
|
|
290
|
+
>
|
|
276
291
|
{description}
|
|
277
292
|
</Text>
|
|
278
293
|
)}
|
|
@@ -284,7 +299,9 @@ export const Sheet: React.FC<SheetProps> = ({
|
|
|
284
299
|
accessibilityRole='button'
|
|
285
300
|
accessibilityLabel='Close sheet'
|
|
286
301
|
>
|
|
287
|
-
<Text className=
|
|
302
|
+
<Text className={cn(typography.size.xl, 'text-gray-400')}>
|
|
303
|
+
✕
|
|
304
|
+
</Text>
|
|
288
305
|
</Pressable>
|
|
289
306
|
)}
|
|
290
307
|
</View>
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { View, Text, Pressable } from 'react-native';
|
|
3
3
|
import { cn } from '../../lib/utils';
|
|
4
|
+
import { designTokens } from '@sudobility/design';
|
|
5
|
+
|
|
6
|
+
const { typography } = designTokens;
|
|
4
7
|
|
|
5
8
|
export interface NavItem {
|
|
6
9
|
/** Unique identifier */
|
|
@@ -60,7 +63,8 @@ export const SideNav: React.FC<SideNavProps> = ({ items, className }) => {
|
|
|
60
63
|
{item.icon && <View className='w-5 h-5'>{item.icon}</View>}
|
|
61
64
|
<Text
|
|
62
65
|
className={cn(
|
|
63
|
-
'flex-1
|
|
66
|
+
'flex-1',
|
|
67
|
+
typography.weight.medium,
|
|
64
68
|
item.active
|
|
65
69
|
? 'text-blue-600 dark:text-blue-400'
|
|
66
70
|
: 'text-gray-700 dark:text-gray-300'
|
|
@@ -70,7 +74,12 @@ export const SideNav: React.FC<SideNavProps> = ({ items, className }) => {
|
|
|
70
74
|
</Text>
|
|
71
75
|
{item.badge !== undefined && (
|
|
72
76
|
<View className='px-2 py-0.5 bg-gray-200 dark:bg-gray-700 rounded'>
|
|
73
|
-
<Text
|
|
77
|
+
<Text
|
|
78
|
+
className={cn(
|
|
79
|
+
typography.size.xs,
|
|
80
|
+
'text-gray-700 dark:text-gray-300'
|
|
81
|
+
)}
|
|
82
|
+
>
|
|
74
83
|
{item.badge}
|
|
75
84
|
</Text>
|
|
76
85
|
</View>
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Text, Pressable, Linking, Alert } from 'react-native';
|
|
3
3
|
import { cn } from '../../lib/utils';
|
|
4
|
+
import { designTokens } from '@sudobility/design';
|
|
5
|
+
|
|
6
|
+
const { typography } = designTokens;
|
|
4
7
|
|
|
5
8
|
export interface SmartLinkProps {
|
|
6
9
|
/** Link destination - URL or internal path */
|
|
@@ -61,9 +64,9 @@ export const SmartLink: React.FC<SmartLinkProps> = ({
|
|
|
61
64
|
};
|
|
62
65
|
|
|
63
66
|
const sizeClasses = {
|
|
64
|
-
sm:
|
|
65
|
-
default:
|
|
66
|
-
lg:
|
|
67
|
+
sm: typography.size.sm,
|
|
68
|
+
default: typography.size.base,
|
|
69
|
+
lg: typography.size.lg,
|
|
67
70
|
};
|
|
68
71
|
|
|
69
72
|
const handlePress = async () => {
|
|
@@ -29,7 +29,7 @@ const sizeMap = {
|
|
|
29
29
|
// Spinner colors from design system raw palette
|
|
30
30
|
const colorMap = {
|
|
31
31
|
default: colors.raw.blue[600],
|
|
32
|
-
white:
|
|
32
|
+
white: colors.raw.neutral[0],
|
|
33
33
|
success: colors.raw.green[600],
|
|
34
34
|
warning: colors.raw.orange[600],
|
|
35
35
|
error: colors.raw.red[600],
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { View, Text } from 'react-native';
|
|
3
3
|
import { cn } from '../../lib/utils';
|
|
4
|
+
import { colors, designTokens } from '@sudobility/design';
|
|
4
5
|
|
|
5
6
|
export interface StatDisplayProps {
|
|
6
7
|
/** The main value/number to display */
|
|
@@ -33,31 +34,31 @@ export interface StatDisplayProps {
|
|
|
33
34
|
* <StatDisplay value="42" label="Active Users" variant="success" size="lg" />
|
|
34
35
|
* ```
|
|
35
36
|
*/
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
37
|
+
|
|
38
|
+
// Lazily derive stat display colors from DS to avoid ESM issues in tests.
|
|
39
|
+
let _statColors: ReturnType<typeof buildStatColors> | null = null;
|
|
40
|
+
function getStatColors() {
|
|
41
|
+
if (!_statColors) _statColors = buildStatColors();
|
|
42
|
+
return _statColors;
|
|
43
|
+
}
|
|
44
|
+
function buildStatColors() {
|
|
45
|
+
const alert = colors.component.alert;
|
|
46
|
+
// Extract text-* classes from DS alert icon strings
|
|
47
|
+
return {
|
|
47
48
|
primary: {
|
|
48
|
-
value:
|
|
49
|
+
value: `${alert.info.icon}`,
|
|
49
50
|
label: 'text-blue-600/70 dark:text-blue-400/70',
|
|
50
51
|
},
|
|
51
52
|
success: {
|
|
52
|
-
value:
|
|
53
|
+
value: `${alert.success.icon}`,
|
|
53
54
|
label: 'text-green-600/70 dark:text-green-400/70',
|
|
54
55
|
},
|
|
55
56
|
warning: {
|
|
56
|
-
value:
|
|
57
|
-
label: 'text-
|
|
57
|
+
value: `${alert.warning.icon}`,
|
|
58
|
+
label: 'text-orange-600/70 dark:text-orange-400/70',
|
|
58
59
|
},
|
|
59
60
|
danger: {
|
|
60
|
-
value:
|
|
61
|
+
value: `${alert.error.icon}`,
|
|
61
62
|
label: 'text-red-600/70 dark:text-red-400/70',
|
|
62
63
|
},
|
|
63
64
|
neutral: {
|
|
@@ -68,13 +69,38 @@ export const StatDisplay: React.FC<StatDisplayProps> = ({
|
|
|
68
69
|
value: 'text-white',
|
|
69
70
|
label: 'text-white/70',
|
|
70
71
|
},
|
|
71
|
-
};
|
|
72
|
+
} as Record<string, { value: string; label: string }>;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export const StatDisplay: React.FC<StatDisplayProps> = ({
|
|
76
|
+
value,
|
|
77
|
+
label,
|
|
78
|
+
variant = 'neutral',
|
|
79
|
+
size = 'md',
|
|
80
|
+
align = 'center',
|
|
81
|
+
icon,
|
|
82
|
+
iconPosition = 'top',
|
|
83
|
+
className,
|
|
84
|
+
}) => {
|
|
85
|
+
const variantClasses = getStatColors();
|
|
72
86
|
|
|
73
87
|
const sizeClasses = {
|
|
74
|
-
sm: {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
88
|
+
sm: {
|
|
89
|
+
value: designTokens.typography.size.xl,
|
|
90
|
+
label: designTokens.typography.size.xs,
|
|
91
|
+
},
|
|
92
|
+
md: {
|
|
93
|
+
value: designTokens.typography.size['2xl'],
|
|
94
|
+
label: designTokens.typography.size.sm,
|
|
95
|
+
},
|
|
96
|
+
lg: {
|
|
97
|
+
value: designTokens.typography.size['3xl'],
|
|
98
|
+
label: designTokens.typography.size.base,
|
|
99
|
+
},
|
|
100
|
+
xl: {
|
|
101
|
+
value: designTokens.typography.size['4xl'],
|
|
102
|
+
label: designTokens.typography.size.lg,
|
|
103
|
+
},
|
|
78
104
|
};
|
|
79
105
|
|
|
80
106
|
const alignClasses = {
|
|
@@ -98,7 +124,11 @@ export const StatDisplay: React.FC<StatDisplayProps> = ({
|
|
|
98
124
|
<View className={variantConfig.value}>{icon}</View>
|
|
99
125
|
<View>
|
|
100
126
|
<Text
|
|
101
|
-
className={cn(
|
|
127
|
+
className={cn(
|
|
128
|
+
designTokens.typography.weight.bold,
|
|
129
|
+
sizeConfig.value,
|
|
130
|
+
variantConfig.value
|
|
131
|
+
)}
|
|
102
132
|
>
|
|
103
133
|
{value}
|
|
104
134
|
</Text>
|
|
@@ -115,7 +145,13 @@ export const StatDisplay: React.FC<StatDisplayProps> = ({
|
|
|
115
145
|
{icon && iconPosition === 'top' && (
|
|
116
146
|
<View className={cn('mb-2', variantConfig.value)}>{icon}</View>
|
|
117
147
|
)}
|
|
118
|
-
<Text
|
|
148
|
+
<Text
|
|
149
|
+
className={cn(
|
|
150
|
+
designTokens.typography.weight.bold,
|
|
151
|
+
sizeConfig.value,
|
|
152
|
+
variantConfig.value
|
|
153
|
+
)}
|
|
154
|
+
>
|
|
119
155
|
{value}
|
|
120
156
|
</Text>
|
|
121
157
|
<Text className={cn(sizeConfig.label, variantConfig.label)}>{label}</Text>
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { View, Text } from 'react-native';
|
|
3
3
|
import { cn } from '../../lib/utils';
|
|
4
|
+
import { designTokens } from '@sudobility/design';
|
|
5
|
+
|
|
6
|
+
const { typography } = designTokens;
|
|
4
7
|
|
|
5
8
|
export interface StepListItem {
|
|
6
9
|
/** Step content */
|
|
@@ -53,14 +56,28 @@ export const StepList: React.FC<StepListProps> = ({
|
|
|
53
56
|
if (variant === 'enhanced') {
|
|
54
57
|
return (
|
|
55
58
|
<View className='w-6 h-6 bg-blue-600 rounded-full items-center justify-center mr-3'>
|
|
56
|
-
<Text
|
|
59
|
+
<Text
|
|
60
|
+
className={cn(
|
|
61
|
+
'text-white',
|
|
62
|
+
typography.size.sm,
|
|
63
|
+
typography.weight.medium
|
|
64
|
+
)}
|
|
65
|
+
>
|
|
66
|
+
{index + 1}
|
|
67
|
+
</Text>
|
|
57
68
|
</View>
|
|
58
69
|
);
|
|
59
70
|
}
|
|
60
71
|
if (variant === 'minimal') {
|
|
61
72
|
return (
|
|
62
73
|
<View className='w-6 h-6 bg-blue-100 dark:bg-blue-900/20 rounded-full items-center justify-center mr-3'>
|
|
63
|
-
<Text
|
|
74
|
+
<Text
|
|
75
|
+
className={cn(
|
|
76
|
+
'text-blue-600 dark:text-blue-400',
|
|
77
|
+
typography.size.sm,
|
|
78
|
+
typography.weight.medium
|
|
79
|
+
)}
|
|
80
|
+
>
|
|
64
81
|
{index + 1}
|
|
65
82
|
</Text>
|
|
66
83
|
</View>
|
|
@@ -121,7 +138,12 @@ export const StepList: React.FC<StepListProps> = ({
|
|
|
121
138
|
•
|
|
122
139
|
</Text>
|
|
123
140
|
{typeof subItem === 'string' ? (
|
|
124
|
-
<Text
|
|
141
|
+
<Text
|
|
142
|
+
className={cn(
|
|
143
|
+
typography.size.sm,
|
|
144
|
+
'text-gray-500 dark:text-gray-500 flex-1'
|
|
145
|
+
)}
|
|
146
|
+
>
|
|
125
147
|
{subItem}
|
|
126
148
|
</Text>
|
|
127
149
|
) : (
|
package/src/ui/Table/Table.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { View, Text, ScrollView, Pressable } from 'react-native';
|
|
3
3
|
import { cn } from '../../lib/utils';
|
|
4
|
+
import { ui, designTokens } from '@sudobility/design';
|
|
4
5
|
|
|
5
6
|
export interface TableColumn<T> {
|
|
6
7
|
/** Column key */
|
|
@@ -99,10 +100,11 @@ export function Table<T extends Record<string, unknown>>({
|
|
|
99
100
|
className={cn('w-full', className)}
|
|
100
101
|
>
|
|
101
102
|
<View className='flex-1'>
|
|
102
|
-
{/* Header */}
|
|
103
|
+
{/* Header -- using DS table.thead */}
|
|
103
104
|
<View
|
|
104
105
|
className={cn(
|
|
105
|
-
'flex-row
|
|
106
|
+
'flex-row',
|
|
107
|
+
ui.table.thead,
|
|
106
108
|
'border-b border-gray-200 dark:border-gray-700'
|
|
107
109
|
)}
|
|
108
110
|
>
|
|
@@ -126,7 +128,15 @@ export function Table<T extends Record<string, unknown>>({
|
|
|
126
128
|
alignClasses[column.align || 'left']
|
|
127
129
|
)}
|
|
128
130
|
>
|
|
129
|
-
<Text
|
|
131
|
+
<Text
|
|
132
|
+
className={cn(
|
|
133
|
+
designTokens.typography.size.xs,
|
|
134
|
+
designTokens.typography.weight.medium,
|
|
135
|
+
'text-gray-700 dark:text-gray-300',
|
|
136
|
+
designTokens.typography.transform.uppercase,
|
|
137
|
+
designTokens.typography.tracking.wider
|
|
138
|
+
)}
|
|
139
|
+
>
|
|
130
140
|
{column.label}
|
|
131
141
|
</Text>
|
|
132
142
|
{column.sortable && sort?.column === column.key && (
|
|
@@ -139,8 +149,8 @@ export function Table<T extends Record<string, unknown>>({
|
|
|
139
149
|
))}
|
|
140
150
|
</View>
|
|
141
151
|
|
|
142
|
-
{/* Body */}
|
|
143
|
-
<View className=
|
|
152
|
+
{/* Body -- using DS table.tr */}
|
|
153
|
+
<View className={ui.table.tr}>
|
|
144
154
|
{data.length === 0 ? (
|
|
145
155
|
<View className='px-4 py-8'>
|
|
146
156
|
<Text className='text-center text-sm text-gray-500 dark:text-gray-400'>
|
|
@@ -156,9 +166,7 @@ export function Table<T extends Record<string, unknown>>({
|
|
|
156
166
|
className={cn(
|
|
157
167
|
'flex-row',
|
|
158
168
|
'border-b border-gray-200 dark:border-gray-700',
|
|
159
|
-
striped &&
|
|
160
|
-
rowIndex % 2 === 1 &&
|
|
161
|
-
'bg-gray-50 dark:bg-gray-800/50'
|
|
169
|
+
striped && rowIndex % 2 === 1 && ui.table.trAlt
|
|
162
170
|
)}
|
|
163
171
|
accessibilityRole='button'
|
|
164
172
|
>
|
|
@@ -176,7 +184,12 @@ export function Table<T extends Record<string, unknown>>({
|
|
|
176
184
|
{column.render ? (
|
|
177
185
|
column.render(row, rowIndex)
|
|
178
186
|
) : (
|
|
179
|
-
<Text
|
|
187
|
+
<Text
|
|
188
|
+
className={cn(
|
|
189
|
+
designTokens.typography.size.sm,
|
|
190
|
+
'text-gray-900 dark:text-white'
|
|
191
|
+
)}
|
|
192
|
+
>
|
|
180
193
|
{String(row[column.key] ?? '')}
|
|
181
194
|
</Text>
|
|
182
195
|
)}
|
package/src/ui/Tabs/Tabs.tsx
CHANGED
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { useState, useCallback, createContext, useContext } from 'react';
|
|
3
3
|
import { View, Text, Pressable, ScrollView, ViewProps } from 'react-native';
|
|
4
4
|
import { cn } from '../../lib/utils';
|
|
5
|
+
import { designTokens } from '@sudobility/design';
|
|
5
6
|
|
|
6
7
|
// Context for tabs state
|
|
7
8
|
interface TabsContextValue {
|
|
@@ -104,7 +105,9 @@ export const TabsList: React.FC<TabsListProps> = ({
|
|
|
104
105
|
horizontal
|
|
105
106
|
showsHorizontalScrollIndicator={false}
|
|
106
107
|
className={cn(
|
|
107
|
-
'flex-row bg-gray-100 dark:bg-gray-800
|
|
108
|
+
'flex-row bg-gray-100 dark:bg-gray-800',
|
|
109
|
+
designTokens.radius.lg,
|
|
110
|
+
'p-1',
|
|
108
111
|
className
|
|
109
112
|
)}
|
|
110
113
|
contentContainerStyle={{ flexGrow: 1 }}
|
|
@@ -152,7 +155,9 @@ export const TabsTrigger: React.FC<TabsTriggerProps> = ({
|
|
|
152
155
|
>
|
|
153
156
|
<Text
|
|
154
157
|
className={cn(
|
|
155
|
-
|
|
158
|
+
designTokens.typography.size.sm,
|
|
159
|
+
designTokens.typography.weight.medium,
|
|
160
|
+
'text-center',
|
|
156
161
|
isSelected
|
|
157
162
|
? 'text-gray-900 dark:text-white'
|
|
158
163
|
: 'text-gray-600 dark:text-gray-400'
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { View, TextInput, Text, TextInputProps } from 'react-native';
|
|
3
3
|
import { cn } from '../../lib/utils';
|
|
4
|
+
import { colors } from '@sudobility/design';
|
|
4
5
|
|
|
5
6
|
export interface TextAreaProps extends Omit<TextInputProps, 'onChange'> {
|
|
6
7
|
/** Current value */
|
|
@@ -108,7 +109,7 @@ export const TextArea: React.FC<TextAreaProps> = ({
|
|
|
108
109
|
readOnly && 'bg-gray-50 dark:bg-gray-900',
|
|
109
110
|
inputClassName
|
|
110
111
|
)}
|
|
111
|
-
placeholderTextColor=
|
|
112
|
+
placeholderTextColor={colors.raw.neutral[400]}
|
|
112
113
|
accessibilityRole='text'
|
|
113
114
|
accessibilityState={{ disabled }}
|
|
114
115
|
{...textInputProps}
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
Platform,
|
|
12
12
|
} from 'react-native';
|
|
13
13
|
import { cn } from '../../lib/utils';
|
|
14
|
+
import { colors } from '@sudobility/design';
|
|
14
15
|
|
|
15
16
|
export interface TextInputModalProps {
|
|
16
17
|
/** Modal visibility */
|
|
@@ -151,7 +152,7 @@ export const TextInputModal: React.FC<TextInputModalProps> = ({
|
|
|
151
152
|
value={value}
|
|
152
153
|
onChangeText={setValue}
|
|
153
154
|
placeholder={placeholder}
|
|
154
|
-
placeholderTextColor=
|
|
155
|
+
placeholderTextColor={colors.raw.neutral[400]}
|
|
155
156
|
maxLength={maxLength}
|
|
156
157
|
editable={!isLoading}
|
|
157
158
|
autoFocus
|