@sudobility/components-rn 1.0.42 → 1.0.44
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 +3 -3
- 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
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { useState, useRef, useEffect } from 'react';
|
|
3
3
|
import { View, Text, Pressable, Modal, Animated } from 'react-native';
|
|
4
4
|
import { cn } from '../../lib/utils';
|
|
5
|
+
import { colors, designTokens } from '@sudobility/design';
|
|
5
6
|
|
|
6
7
|
export interface TooltipProps {
|
|
7
8
|
/** Content to display in the tooltip */
|
|
@@ -40,6 +41,45 @@ export interface TooltipProps {
|
|
|
40
41
|
* </Tooltip>
|
|
41
42
|
* ```
|
|
42
43
|
*/
|
|
44
|
+
|
|
45
|
+
// Lazily derive tooltip colors from DS to avoid ESM issues in tests.
|
|
46
|
+
let _tooltipColors: Record<string, string> | null = null;
|
|
47
|
+
function getTooltipColors() {
|
|
48
|
+
if (!_tooltipColors) {
|
|
49
|
+
const btn = colors.component.button;
|
|
50
|
+
// Extract bg-* from DS button base for solid tooltip backgrounds
|
|
51
|
+
function extractBg(base: string, darkStr: string) {
|
|
52
|
+
const bg =
|
|
53
|
+
base
|
|
54
|
+
.split(' ')
|
|
55
|
+
.find(
|
|
56
|
+
c =>
|
|
57
|
+
c.startsWith('bg-') &&
|
|
58
|
+
!c.includes('hover:') &&
|
|
59
|
+
!c.includes('active:')
|
|
60
|
+
) || '';
|
|
61
|
+
const darkBg =
|
|
62
|
+
darkStr
|
|
63
|
+
.split(' ')
|
|
64
|
+
.find(
|
|
65
|
+
c =>
|
|
66
|
+
c.startsWith('dark:bg-') &&
|
|
67
|
+
!c.includes('hover:') &&
|
|
68
|
+
!c.includes('active:')
|
|
69
|
+
) || '';
|
|
70
|
+
return `${bg} ${darkBg}`;
|
|
71
|
+
}
|
|
72
|
+
_tooltipColors = {
|
|
73
|
+
default: 'bg-gray-900 dark:bg-gray-700',
|
|
74
|
+
info: extractBg(btn.primary.base, btn.primary.dark),
|
|
75
|
+
success: extractBg(btn.success.base, btn.success.dark),
|
|
76
|
+
warning: 'bg-yellow-600 dark:bg-yellow-500', // DS has no yellow button; local fallback
|
|
77
|
+
error: extractBg(btn.destructive.base, btn.destructive.dark),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
return _tooltipColors;
|
|
81
|
+
}
|
|
82
|
+
|
|
43
83
|
export const Tooltip: React.FC<TooltipProps> = ({
|
|
44
84
|
content,
|
|
45
85
|
children,
|
|
@@ -98,14 +138,8 @@ export const Tooltip: React.FC<TooltipProps> = ({
|
|
|
98
138
|
setIsVisible(false);
|
|
99
139
|
};
|
|
100
140
|
|
|
101
|
-
// Variant styles
|
|
102
|
-
const variantClasses =
|
|
103
|
-
default: 'bg-gray-900 dark:bg-gray-700',
|
|
104
|
-
info: 'bg-blue-600 dark:bg-blue-500',
|
|
105
|
-
success: 'bg-green-600 dark:bg-green-500',
|
|
106
|
-
warning: 'bg-yellow-600 dark:bg-yellow-500',
|
|
107
|
-
error: 'bg-red-600 dark:bg-red-500',
|
|
108
|
-
};
|
|
141
|
+
// Variant styles from DS
|
|
142
|
+
const variantClasses = getTooltipColors();
|
|
109
143
|
|
|
110
144
|
// Calculate tooltip position
|
|
111
145
|
const getTooltipPosition = () => {
|
|
@@ -173,7 +207,11 @@ export const Tooltip: React.FC<TooltipProps> = ({
|
|
|
173
207
|
className
|
|
174
208
|
)}
|
|
175
209
|
>
|
|
176
|
-
<Text
|
|
210
|
+
<Text
|
|
211
|
+
className={`${designTokens.typography.size.xs} ${designTokens.typography.weight.medium} text-white`}
|
|
212
|
+
>
|
|
213
|
+
{content}
|
|
214
|
+
</Text>
|
|
177
215
|
</View>
|
|
178
216
|
</Animated.View>
|
|
179
217
|
</Pressable>
|
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { useState, useCallback } from 'react';
|
|
3
3
|
import { View, Text, TextInput, Pressable, ScrollView } from 'react-native';
|
|
4
4
|
import { cn } from '../../lib/utils';
|
|
5
|
+
import { colors } from '@sudobility/design';
|
|
5
6
|
|
|
6
7
|
export interface TransferListItem {
|
|
7
8
|
/** Item ID */
|
|
@@ -173,7 +174,7 @@ export const TransferList: React.FC<TransferListProps> = ({
|
|
|
173
174
|
value={searchValue}
|
|
174
175
|
onChangeText={onSearchChange}
|
|
175
176
|
placeholder={searchPlaceholder}
|
|
176
|
-
placeholderTextColor=
|
|
177
|
+
placeholderTextColor={colors.raw.neutral[400]}
|
|
177
178
|
className='px-3 py-2 text-sm bg-gray-50 dark:bg-gray-800 text-gray-900 dark:text-white border border-gray-300 dark:border-gray-700 rounded-md'
|
|
178
179
|
/>
|
|
179
180
|
</View>
|