@idealyst/components 1.2.20 → 1.2.22
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/package.json +3 -3
- package/src/Accordion/Accordion.native.tsx +0 -1
- package/src/ActivityIndicator/ActivityIndicator.native.tsx +1 -1
- package/src/ActivityIndicator/ActivityIndicator.web.tsx +1 -1
- package/src/Alert/Alert.native.tsx +1 -1
- package/src/Alert/Alert.web.tsx +1 -1
- package/src/Avatar/Avatar.native.tsx +1 -1
- package/src/Avatar/Avatar.web.tsx +1 -1
- package/src/Badge/Badge.native.tsx +1 -1
- package/src/Button/Button.native.tsx +1 -12
- package/src/Card/Card.native.tsx +2 -3
- package/src/Card/Card.web.tsx +2 -2
- package/src/Checkbox/Checkbox.native.tsx +2 -2
- package/src/Chip/Chip.native.tsx +1 -1
- package/src/Dialog/Dialog.native.tsx +2 -2
- package/src/Divider/Divider.native.tsx +1 -1
- package/src/Divider/Divider.styles.tsx +0 -1
- package/src/Divider/Divider.web.tsx +1 -1
- package/src/Icon/Icon.native.tsx +0 -3
- package/src/Icon/Icon.web.tsx +1 -2
- package/src/Image/Image.native.tsx +1 -1
- package/src/Input/Input.web.tsx +1 -1
- package/src/List/List.native.tsx +1 -1
- package/src/List/ListItem.native.tsx +1 -1
- package/src/List/ListItem.web.tsx +4 -6
- package/src/List/ListSection.native.tsx +1 -1
- package/src/List/types.ts +1 -1
- package/src/Menu/Menu.native.tsx +1 -1
- package/src/Menu/MenuItem.native.tsx +1 -2
- package/src/Popover/Popover.native.tsx +2 -3
- package/src/Popover/Popover.web.tsx +1 -1
- package/src/Pressable/Pressable.native.tsx +2 -2
- package/src/Pressable/Pressable.web.tsx +1 -1
- package/src/Progress/Progress.native.tsx +1 -2
- package/src/RadioButton/RadioGroup.native.tsx +1 -1
- package/src/SVGImage/SVGImage.native.tsx +1 -1
- package/src/Screen/Screen.native.tsx +1 -1
- package/src/Screen/Screen.web.tsx +1 -1
- package/src/Select/Select.native.tsx +1 -1
- package/src/Select/Select.styles.tsx +1 -1
- package/src/Skeleton/Skeleton.native.tsx +3 -3
- package/src/Skeleton/Skeleton.web.tsx +1 -1
- package/src/Slider/Slider.native.tsx +1 -1
- package/src/Slider/Slider.styles.tsx +2 -2
- package/src/TabBar/TabBar.native.tsx +1 -1
- package/src/TabBar/TabBar.styles.tsx +3 -3
- package/src/Table/Table.native.tsx +1 -1
- package/src/Table/Table.styles.tsx +2 -2
- package/src/Table/Table.web.tsx +2 -2
- package/src/Table/types.ts +1 -1
- package/src/Text/Text.native.tsx +1 -1
- package/src/Text/Text.styles.tsx +1 -1
- package/src/Text/Text.web.tsx +1 -1
- package/src/TextArea/TextArea.native.tsx +1 -1
- package/src/TextArea/TextArea.styles.tsx +1 -1
- package/src/Tooltip/Tooltip.native.tsx +1 -1
- package/src/Video/Video.native.tsx +7 -7
- package/src/View/View.native.tsx +1 -1
- package/src/examples/AlertExamples.tsx +2 -2
- package/src/examples/AvatarExamples.tsx +0 -1
- package/src/examples/BadgeExamples.tsx +0 -1
- package/src/examples/BreadcrumbExamples.tsx +1 -2
- package/src/examples/CardExamples.tsx +0 -1
- package/src/examples/CheckboxExamples.tsx +1 -1
- package/src/examples/ChipExamples.tsx +1 -1
- package/src/examples/DividerExamples.tsx +0 -1
- package/src/examples/IconExamples.tsx +1 -1
- package/src/examples/InputExamples.tsx +1 -1
- package/src/examples/LinkExamples.tsx +0 -1
- package/src/examples/ScreenExamples.tsx +0 -1
- package/src/examples/SelectExamples.tsx +2 -3
- package/src/examples/SkeletonExamples.tsx +0 -1
- package/src/internal/BoundedModalContent.native.tsx +1 -1
- package/src/utils/styleHelpers.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@idealyst/components",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.22",
|
|
4
4
|
"description": "Shared component library for React and React Native",
|
|
5
5
|
"documentation": "https://github.com/IdealystIO/idealyst-framework/tree/main/packages/components#readme",
|
|
6
6
|
"readme": "README.md",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"publish:npm": "npm publish"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"@idealyst/theme": "^1.2.
|
|
59
|
+
"@idealyst/theme": "^1.2.22",
|
|
60
60
|
"@mdi/js": ">=7.0.0",
|
|
61
61
|
"@mdi/react": ">=1.0.0",
|
|
62
62
|
"@react-native-vector-icons/common": ">=12.0.0",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
}
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
|
-
"@idealyst/theme": "^1.2.
|
|
109
|
+
"@idealyst/theme": "^1.2.22",
|
|
110
110
|
"@idealyst/tooling": "^1.2.4",
|
|
111
111
|
"@mdi/react": "^1.6.1",
|
|
112
112
|
"@types/react": "^19.1.0",
|
|
@@ -41,7 +41,6 @@ const AccordionItem: React.FC<AccordionItemProps> = ({
|
|
|
41
41
|
const itemStyle = (accordionStyles.item as any)({ type, isLast });
|
|
42
42
|
const headerStyle = (accordionStyles.header as any)({});
|
|
43
43
|
const iconStyle = (accordionStyles.icon as any)({});
|
|
44
|
-
const contentStyle = (accordionStyles.content as any)({});
|
|
45
44
|
const titleStyle = (accordionStyles.title as any)({});
|
|
46
45
|
const contentInnerStyle = (accordionStyles.contentInner as any)({});
|
|
47
46
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { forwardRef, useMemo } from 'react';
|
|
2
2
|
import { ActivityIndicator as RNActivityIndicator, View } from 'react-native';
|
|
3
3
|
import { ActivityIndicatorProps } from './types';
|
|
4
4
|
import { activityIndicatorStyles } from './ActivityIndicator.styles';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { forwardRef, useMemo } from 'react';
|
|
2
2
|
import { getWebProps } from 'react-native-unistyles/web';
|
|
3
3
|
import { ActivityIndicatorProps } from './types';
|
|
4
4
|
import { activityIndicatorStyles } from './ActivityIndicator.styles';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { isValidElement, forwardRef, ComponentRef } from 'react';
|
|
2
2
|
import { View, Text, TouchableOpacity } from 'react-native';
|
|
3
3
|
import MaterialDesignIcons from '@react-native-vector-icons/material-design-icons';
|
|
4
4
|
import { alertStyles } from './Alert.styles';
|
package/src/Alert/Alert.web.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { isValidElement, forwardRef } from 'react';
|
|
2
2
|
import { View, Text } from 'react-native';
|
|
3
3
|
import MaterialDesignIcons from '@react-native-vector-icons/material-design-icons';
|
|
4
4
|
import { BadgeProps } from './types';
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ComponentRef, forwardRef, useMemo } from 'react';
|
|
2
2
|
import { ActivityIndicator, StyleSheet as RNStyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
|
3
3
|
import MaterialDesignIcons from '@react-native-vector-icons/material-design-icons';
|
|
4
4
|
import Svg, { Defs, LinearGradient, Stop, Rect } from 'react-native-svg';
|
|
5
5
|
import { buttonStyles } from './Button.styles';
|
|
6
6
|
import { ButtonProps } from './types';
|
|
7
7
|
import { getNativeInteractiveAccessibilityProps } from '../utils/accessibility';
|
|
8
|
-
import { useUnistyles } from 'react-native-unistyles';
|
|
9
8
|
|
|
10
9
|
const Button = forwardRef<ComponentRef<typeof TouchableOpacity>, ButtonProps>((props, ref) => {
|
|
11
10
|
const {
|
|
@@ -57,16 +56,6 @@ const Button = forwardRef<ComponentRef<typeof TouchableOpacity>, ButtonProps>((p
|
|
|
57
56
|
// Gradient is only applicable to contained buttons
|
|
58
57
|
const showGradient = gradient && type === 'contained';
|
|
59
58
|
|
|
60
|
-
// Get gradient overlay colors (transparent to semi-transparent black/white)
|
|
61
|
-
// Note: Use explicit rgba(0,0,0,0) instead of 'transparent' for RN SVG compatibility
|
|
62
|
-
const getGradientColors = (): [string, string] => {
|
|
63
|
-
switch (gradient) {
|
|
64
|
-
case 'darken': return ['rgba(0, 0, 0, 0)', 'rgba(0, 0, 0, 0.15)'];
|
|
65
|
-
case 'lighten': return ['rgba(255, 255, 255, 0)', 'rgba(255, 255, 255, 0.2)'];
|
|
66
|
-
default: return ['rgba(0, 0, 0, 0)', 'rgba(0, 0, 0, 0)'];
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
|
|
70
59
|
// Map button size to icon size
|
|
71
60
|
const iconSizeMap: Record<string, number> = {
|
|
72
61
|
xs: 12,
|
package/src/Card/Card.native.tsx
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { forwardRef, ComponentRef, useMemo } from 'react';
|
|
2
2
|
import { View, Pressable } from 'react-native';
|
|
3
|
-
import { useUnistyles } from 'react-native-unistyles';
|
|
4
3
|
import { CardProps } from './types';
|
|
5
4
|
import { cardStyles } from './Card.styles';
|
|
6
5
|
import { getNativeInteractiveAccessibilityProps } from '../utils/accessibility';
|
|
@@ -9,7 +8,7 @@ const Card = forwardRef<ComponentRef<typeof View> | ComponentRef<typeof Pressabl
|
|
|
9
8
|
children,
|
|
10
9
|
type = 'elevated',
|
|
11
10
|
radius = 'md',
|
|
12
|
-
intent = 'neutral',
|
|
11
|
+
intent: _intent = 'neutral',
|
|
13
12
|
clickable = false,
|
|
14
13
|
onPress,
|
|
15
14
|
disabled = false,
|
package/src/Card/Card.web.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { forwardRef, useMemo } from 'react';
|
|
2
2
|
import { getWebProps } from 'react-native-unistyles/web';
|
|
3
3
|
import { CardProps } from './types';
|
|
4
4
|
import { cardStyles } from './Card.styles';
|
|
@@ -14,7 +14,7 @@ const Card = forwardRef<HTMLDivElement | HTMLButtonElement, CardProps>(({
|
|
|
14
14
|
type: typeProp,
|
|
15
15
|
variant,
|
|
16
16
|
radius = 'md',
|
|
17
|
-
intent,
|
|
17
|
+
intent: _intent,
|
|
18
18
|
clickable = false,
|
|
19
19
|
onPress,
|
|
20
20
|
disabled = false,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useState, useEffect, forwardRef, useMemo } from 'react';
|
|
2
2
|
import { View, Text, Pressable } from 'react-native';
|
|
3
3
|
import MaterialDesignIcons from '@react-native-vector-icons/material-design-icons';
|
|
4
4
|
import { CheckboxProps } from './types';
|
|
@@ -21,7 +21,7 @@ const Checkbox = forwardRef<View, CheckboxProps>(({
|
|
|
21
21
|
marginHorizontal,
|
|
22
22
|
style,
|
|
23
23
|
testID,
|
|
24
|
-
required = false,
|
|
24
|
+
required: _required = false,
|
|
25
25
|
error,
|
|
26
26
|
helperText,
|
|
27
27
|
id,
|
package/src/Chip/Chip.native.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { isValidElement, forwardRef, ComponentRef } from 'react';
|
|
2
2
|
import { Pressable, Text, View } from 'react-native';
|
|
3
3
|
import MaterialDesignIcons from '@react-native-vector-icons/material-design-icons';
|
|
4
4
|
import { chipStyles } from './Chip.styles';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useEffect, forwardRef, useMemo } from 'react';
|
|
2
2
|
import { Modal, View, Text, TouchableOpacity, TouchableWithoutFeedback, BackHandler, GestureResponderEvent } from 'react-native';
|
|
3
3
|
import Animated, { useSharedValue, useAnimatedStyle, withTiming, Easing } from 'react-native-reanimated';
|
|
4
4
|
import { DialogProps } from './types';
|
|
@@ -14,7 +14,7 @@ const Dialog = forwardRef<View, DialogProps>(({
|
|
|
14
14
|
type = 'default',
|
|
15
15
|
showCloseButton = true,
|
|
16
16
|
closeOnBackdropClick = true,
|
|
17
|
-
animationType = 'fade',
|
|
17
|
+
animationType: _animationType = 'fade',
|
|
18
18
|
style,
|
|
19
19
|
testID,
|
|
20
20
|
id,
|
|
@@ -16,7 +16,6 @@ type DividerThickness = 'thin' | 'md' | 'thick';
|
|
|
16
16
|
type DividerType = 'solid' | 'dashed' | 'dotted';
|
|
17
17
|
type DividerIntent = Intent | 'secondary' | 'neutral' | 'info';
|
|
18
18
|
type DividerSpacing = 'none' | 'sm' | 'md' | 'lg';
|
|
19
|
-
type DividerLength = 'full' | 'auto';
|
|
20
19
|
|
|
21
20
|
export type DividerDynamicProps = {
|
|
22
21
|
orientation?: DividerOrientation;
|
package/src/Icon/Icon.native.tsx
CHANGED
|
@@ -2,7 +2,6 @@ import { forwardRef, useMemo } from 'react';
|
|
|
2
2
|
import MaterialDesignIcons from '@react-native-vector-icons/material-design-icons';
|
|
3
3
|
import { IconProps } from './types';
|
|
4
4
|
import { iconStyles } from './Icon.styles';
|
|
5
|
-
import { useUnistyles } from 'react-native-unistyles';
|
|
6
5
|
|
|
7
6
|
const Icon = forwardRef<any, IconProps>(({
|
|
8
7
|
name,
|
|
@@ -15,8 +14,6 @@ const Icon = forwardRef<any, IconProps>(({
|
|
|
15
14
|
accessibilityLabel,
|
|
16
15
|
id,
|
|
17
16
|
}: IconProps, ref) => {
|
|
18
|
-
const { theme } = useUnistyles();
|
|
19
|
-
|
|
20
17
|
// Call dynamic style with variants - includes theme-reactive color
|
|
21
18
|
const iconStyle = (iconStyles.icon as any)({ color, textColor, intent, size });
|
|
22
19
|
|
package/src/Icon/Icon.web.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
2
|
import MdiIcon from '@mdi/react';
|
|
3
3
|
import { IconProps } from './types';
|
|
4
4
|
import { iconStyles } from './Icon.styles';
|
|
@@ -23,7 +23,6 @@ const Icon = forwardRef<HTMLSpanElement, IconProps>((props, ref) => {
|
|
|
23
23
|
testID,
|
|
24
24
|
accessibilityLabel,
|
|
25
25
|
id,
|
|
26
|
-
...restProps
|
|
27
26
|
} = props;
|
|
28
27
|
|
|
29
28
|
const { theme } = useUnistyles();
|
package/src/Input/Input.web.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import { isIconName } from '../Icon/icon-resolver';
|
|
|
6
6
|
import useMergeRefs from '../hooks/useMergeRefs';
|
|
7
7
|
import { inputStyles } from './Input.styles';
|
|
8
8
|
import { InputProps } from './types';
|
|
9
|
-
import { getWebFormAriaProps
|
|
9
|
+
import { getWebFormAriaProps } from '../utils/accessibility';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Text input field with support for icons, password visibility toggle, and validation states.
|
package/src/List/List.native.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { forwardRef, useMemo, Children, isValidElement, cloneElement } from 'react';
|
|
2
2
|
import { View, ScrollView } from 'react-native';
|
|
3
3
|
import { listStyles } from './List.styles';
|
|
4
4
|
import type { ListProps } from './types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { isValidElement, forwardRef, ComponentRef, useMemo } from 'react';
|
|
2
2
|
import { View, Pressable, Text } from 'react-native';
|
|
3
3
|
import { useUnistyles } from 'react-native-unistyles';
|
|
4
4
|
import MaterialDesignIcons from '@react-native-vector-icons/material-design-icons';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { isValidElement } from 'react';
|
|
2
2
|
import { getWebProps } from 'react-native-unistyles/web';
|
|
3
3
|
import { useUnistyles } from 'react-native-unistyles';
|
|
4
4
|
import { getColorFromString, Intent, Theme, Color } from '@idealyst/theme';
|
|
@@ -9,7 +9,7 @@ import { isIconName } from '../Icon/icon-resolver';
|
|
|
9
9
|
import { useListContext } from './ListContext';
|
|
10
10
|
|
|
11
11
|
const ListItem: React.FC<ListItemProps & { isLast?: boolean }> = ({
|
|
12
|
-
id,
|
|
12
|
+
id: _id,
|
|
13
13
|
label,
|
|
14
14
|
children,
|
|
15
15
|
leading,
|
|
@@ -46,14 +46,12 @@ const ListItem: React.FC<ListItemProps & { isLast?: boolean }> = ({
|
|
|
46
46
|
const labelStyle = (listStyles.label as any)({ disabled, selected });
|
|
47
47
|
const leadingStyle = (listStyles.leading as any)({});
|
|
48
48
|
const trailingStyle = (listStyles.trailing as any)({});
|
|
49
|
-
const trailingIconStyle = (listStyles.trailingIcon as any)({});
|
|
50
49
|
const labelContainerStyle = (listStyles.labelContainer as any)({});
|
|
51
50
|
|
|
52
51
|
const itemProps = getWebProps([itemStyle, style]);
|
|
53
52
|
const labelProps = getWebProps([labelStyle]);
|
|
54
53
|
const leadingProps = getWebProps([leadingStyle]);
|
|
55
54
|
const trailingProps = getWebProps([trailingStyle]);
|
|
56
|
-
const trailingIconProps = getWebProps([trailingStyle, trailingIconStyle]);
|
|
57
55
|
|
|
58
56
|
const handleClick = () => {
|
|
59
57
|
if (!disabled && onPress) {
|
|
@@ -74,7 +72,7 @@ const ListItem: React.FC<ListItemProps & { isLast?: boolean }> = ({
|
|
|
74
72
|
|
|
75
73
|
// Helper to render leading/trailing icons
|
|
76
74
|
// IconSvg uses size="1em" by default, sized by container's fontSize from styles
|
|
77
|
-
const renderElement = (element: typeof leading | typeof trailing
|
|
75
|
+
const renderElement = (element: typeof leading | typeof trailing) => {
|
|
78
76
|
if (!element) return null;
|
|
79
77
|
|
|
80
78
|
if (isIconName(element)) {
|
|
@@ -112,7 +110,7 @@ const ListItem: React.FC<ListItemProps & { isLast?: boolean }> = ({
|
|
|
112
110
|
|
|
113
111
|
{trailing && (
|
|
114
112
|
<div {...trailingProps}>
|
|
115
|
-
{renderElement(trailing
|
|
113
|
+
{renderElement(trailing)}
|
|
116
114
|
</div>
|
|
117
115
|
)}
|
|
118
116
|
</>
|
package/src/List/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { StyleProp, ViewStyle
|
|
1
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
import type { IconName } from '../Icon/icon-types';
|
|
4
4
|
import { Size, Color, Intent } from '@idealyst/theme';
|
package/src/Menu/Menu.native.tsx
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { isValidElement, forwardRef, ComponentRef } from 'react';
|
|
2
2
|
import { Pressable, Text, View } from 'react-native';
|
|
3
|
-
import { Icon } from '../Icon';
|
|
4
3
|
import { menuItemStyles } from './MenuItem.styles';
|
|
5
4
|
import type { MenuItem as MenuItemType, MenuSizeVariant } from './types';
|
|
6
5
|
import MaterialDesignIcons from '@react-native-vector-icons/material-design-icons';
|
|
@@ -3,7 +3,7 @@ import { Modal, View, TouchableWithoutFeedback, BackHandler, Dimensions } from '
|
|
|
3
3
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
4
|
import { PopoverProps } from './types';
|
|
5
5
|
import { popoverStyles } from './Popover.styles';
|
|
6
|
-
import { calculateSmartPosition
|
|
6
|
+
import { calculateSmartPosition } from '../utils/positionUtils.native';
|
|
7
7
|
import { BoundedModalContent } from '../internal/BoundedModalContent.native';
|
|
8
8
|
import { getNativeInteractiveAccessibilityProps } from '../utils/accessibility';
|
|
9
9
|
|
|
@@ -24,7 +24,7 @@ const Popover = forwardRef<View, PopoverProps>(({
|
|
|
24
24
|
accessibilityHint,
|
|
25
25
|
accessibilityRole,
|
|
26
26
|
accessibilityHidden,
|
|
27
|
-
},
|
|
27
|
+
}, _ref) => {
|
|
28
28
|
// Generate native accessibility props
|
|
29
29
|
const nativeA11yProps = useMemo(() => {
|
|
30
30
|
return getNativeInteractiveAccessibilityProps({
|
|
@@ -34,7 +34,6 @@ const Popover = forwardRef<View, PopoverProps>(({
|
|
|
34
34
|
accessibilityHidden,
|
|
35
35
|
});
|
|
36
36
|
}, [accessibilityLabel, accessibilityHint, accessibilityRole, accessibilityHidden]);
|
|
37
|
-
const popoverRef = useRef<View>(null);
|
|
38
37
|
const [popoverPosition, setPopoverPosition] = useState({ top: 0, left: 0, width: 0 });
|
|
39
38
|
const [popoverSize, setPopoverSize] = useState({ width: 0, height: 0 });
|
|
40
39
|
const anchorMeasurements = useRef({ x: 0, y: 0, width: 0, height: 0 });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
2
|
import { TouchableWithoutFeedback, View } from 'react-native';
|
|
3
3
|
import { PressableProps } from './types';
|
|
4
4
|
import { pressableStyles } from './Pressable.styles';
|
|
@@ -16,7 +16,7 @@ const Pressable = forwardRef<View, PressableProps>(({
|
|
|
16
16
|
style,
|
|
17
17
|
testID,
|
|
18
18
|
accessibilityLabel,
|
|
19
|
-
accessibilityRole,
|
|
19
|
+
accessibilityRole: _accessibilityRole,
|
|
20
20
|
id,
|
|
21
21
|
}, ref) => {
|
|
22
22
|
// Apply spacing variants
|
|
@@ -20,7 +20,7 @@ const Pressable = forwardRef<HTMLDivElement, PressableProps>(({
|
|
|
20
20
|
accessibilityRole = 'button',
|
|
21
21
|
id,
|
|
22
22
|
}, ref) => {
|
|
23
|
-
const [
|
|
23
|
+
const [_isPressed, setIsPressed] = useState(false);
|
|
24
24
|
|
|
25
25
|
const handleMouseDown = useCallback(() => {
|
|
26
26
|
if (disabled) return;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useEffect, forwardRef } from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import Animated, {
|
|
4
4
|
useSharedValue,
|
|
@@ -44,7 +44,6 @@ const Progress = forwardRef<View, ProgressProps>(({
|
|
|
44
44
|
const dynamicProps = { intent };
|
|
45
45
|
const linearBarStyle = (progressStyles.linearBar as any)(dynamicProps);
|
|
46
46
|
const indeterminateBarStyle = (progressStyles.indeterminateBar as any)(dynamicProps);
|
|
47
|
-
const circularBarStyle = (progressStyles.circularBar as any)(dynamicProps);
|
|
48
47
|
|
|
49
48
|
// Animation values
|
|
50
49
|
const animatedValue = useSharedValue(0);
|
|
@@ -56,7 +56,7 @@ export const selectStyles = defineStyle('Select', (theme: Theme) => ({
|
|
|
56
56
|
marginBottom: 4,
|
|
57
57
|
}),
|
|
58
58
|
|
|
59
|
-
trigger: ({ type = 'outlined', intent = 'neutral', disabled = false, error = false, focused = false }: SelectDynamicProps) => ({
|
|
59
|
+
trigger: ({ type: _type = 'outlined', intent: _intent = 'neutral', disabled = false, error: _error = false, focused: _focused = false }: SelectDynamicProps) => ({
|
|
60
60
|
position: 'relative' as const,
|
|
61
61
|
flexDirection: 'row' as const,
|
|
62
62
|
alignItems: 'center' as const,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useEffect, forwardRef, useMemo } from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import Animated, {
|
|
4
4
|
useSharedValue,
|
|
@@ -13,8 +13,8 @@ import type { SkeletonProps, SkeletonGroupProps } from './types';
|
|
|
13
13
|
import { getNativeLiveRegionAccessibilityProps } from '../utils/accessibility';
|
|
14
14
|
|
|
15
15
|
const Skeleton = forwardRef<View, SkeletonProps>(({
|
|
16
|
-
width = '100%',
|
|
17
|
-
height = 20,
|
|
16
|
+
width: _width = '100%',
|
|
17
|
+
height: _height = 20,
|
|
18
18
|
shape = 'rectangle',
|
|
19
19
|
borderRadius,
|
|
20
20
|
animation = 'pulse',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
2
|
import { getWebProps } from 'react-native-unistyles/web';
|
|
3
3
|
import { skeletonStyles } from './Skeleton.styles';
|
|
4
4
|
import type { SkeletonProps, SkeletonGroupProps } from './types';
|
|
@@ -31,11 +31,11 @@ function createIntentVariants(theme: Theme) {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
// Create compound variants for intent-specific styles
|
|
34
|
-
function
|
|
34
|
+
function _createSliderCompoundVariants(theme: Theme): CompoundVariants<keyof SliderVariants> {
|
|
35
35
|
const compoundVariants: CompoundVariants<keyof SliderVariants> = [];
|
|
36
36
|
|
|
37
37
|
for (const intent in theme.intents) {
|
|
38
|
-
const
|
|
38
|
+
const _intentValue = theme.intents[intent as Intent];
|
|
39
39
|
|
|
40
40
|
// filledTrack intent colors are handled inline since they need per-element targeting
|
|
41
41
|
// thumb border color by intent
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useState, useRef, useEffect, forwardRef, ReactNode, useMemo } from 'react';
|
|
2
2
|
import { View, TouchableOpacity, Text, ScrollView, LayoutChangeEvent } from 'react-native';
|
|
3
3
|
import Animated, { useSharedValue, useAnimatedStyle, withSpring } from 'react-native-reanimated';
|
|
4
4
|
import {
|
|
@@ -91,7 +91,7 @@ export const tabBarStyles = defineStyle('TabBar', (theme: Theme) => ({
|
|
|
91
91
|
} as const;
|
|
92
92
|
},
|
|
93
93
|
|
|
94
|
-
tab: ({ type = 'standard', size = 'md', active = false, pillMode = 'light', disabled = false, iconPosition = 'left', justify = 'start' }: TabBarDynamicProps) => {
|
|
94
|
+
tab: ({ type = 'standard', size = 'md', active = false, pillMode: _pillMode = 'light', disabled = false, iconPosition = 'left', justify = 'start' }: TabBarDynamicProps) => {
|
|
95
95
|
// Tab padding for pills
|
|
96
96
|
const paddingMap: Record<Size, { paddingVertical: number; paddingHorizontal: number }> = {
|
|
97
97
|
xs: { paddingVertical: 2, paddingHorizontal: 10 },
|
|
@@ -141,7 +141,7 @@ export const tabBarStyles = defineStyle('TabBar', (theme: Theme) => ({
|
|
|
141
141
|
} as const;
|
|
142
142
|
},
|
|
143
143
|
|
|
144
|
-
tabLabel: ({ type = 'standard', active = false, pillMode = 'light', disabled = false }: TabBarDynamicProps) => {
|
|
144
|
+
tabLabel: ({ type = 'standard', active = false, pillMode: _pillMode = 'light', disabled = false }: TabBarDynamicProps) => {
|
|
145
145
|
let color = active ? theme.colors.text.primary : theme.colors.text.secondary;
|
|
146
146
|
if (active) {
|
|
147
147
|
if (type === 'pills') color = theme.colors.text.primary;
|
|
@@ -163,7 +163,7 @@ export const tabBarStyles = defineStyle('TabBar', (theme: Theme) => ({
|
|
|
163
163
|
} as const;
|
|
164
164
|
},
|
|
165
165
|
|
|
166
|
-
tabIcon: ({ active = false, disabled = false, iconPosition = 'left' }: TabBarDynamicProps) => ({
|
|
166
|
+
tabIcon: ({ active: _active = false, disabled = false, iconPosition = 'left' }: TabBarDynamicProps) => ({
|
|
167
167
|
display: 'flex' as const,
|
|
168
168
|
alignItems: 'center' as const,
|
|
169
169
|
justifyContent: 'center' as const,
|
|
@@ -34,7 +34,7 @@ export type TableDynamicProps = {
|
|
|
34
34
|
* Table styles with type/size handling.
|
|
35
35
|
*/
|
|
36
36
|
export const tableStyles = defineStyle('Table', (theme: Theme) => ({
|
|
37
|
-
container: ({ type = 'standard' }: TableDynamicProps) => ({
|
|
37
|
+
container: ({ type: _type = 'standard' }: TableDynamicProps) => ({
|
|
38
38
|
width: '100%',
|
|
39
39
|
borderWidth: 1,
|
|
40
40
|
borderStyle: 'solid' as const,
|
|
@@ -113,7 +113,7 @@ export const tableStyles = defineStyle('Table', (theme: Theme) => ({
|
|
|
113
113
|
} as const;
|
|
114
114
|
},
|
|
115
115
|
|
|
116
|
-
headerCell: ({ type = 'standard', align = 'left' }: TableDynamicProps) => ({
|
|
116
|
+
headerCell: ({ type = 'standard', align: _align = 'left' }: TableDynamicProps) => ({
|
|
117
117
|
flexDirection: 'row' as const,
|
|
118
118
|
alignItems: 'center' as const,
|
|
119
119
|
fontWeight: '600' as const,
|
package/src/Table/Table.web.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useMemo, ReactNode } from 'react';
|
|
2
2
|
import { getWebProps } from 'react-native-unistyles/web';
|
|
3
3
|
import { tableStyles } from './Table.styles';
|
|
4
4
|
import type { TableProps, TableColumn, TableType, TableSizeVariant, TableAlignVariant } from './types';
|
|
@@ -139,7 +139,7 @@ function Table<T = any>({
|
|
|
139
139
|
data,
|
|
140
140
|
type = 'standard',
|
|
141
141
|
size = 'md',
|
|
142
|
-
stickyHeader = false,
|
|
142
|
+
stickyHeader: _stickyHeader = false,
|
|
143
143
|
onRowPress,
|
|
144
144
|
// Spacing variants from ContainerStyleProps
|
|
145
145
|
gap,
|
package/src/Table/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { StyleProp, ViewStyle
|
|
1
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
import { Size } from '@idealyst/theme';
|
|
4
4
|
import { ContainerStyleProps } from '../utils/viewStyleProps';
|
package/src/Text/Text.native.tsx
CHANGED
package/src/Text/Text.styles.tsx
CHANGED
|
@@ -67,7 +67,7 @@ declare module '@idealyst/theme' {
|
|
|
67
67
|
*/
|
|
68
68
|
// @ts-ignore - $iterator patterns are expanded by Babel
|
|
69
69
|
export const textStyles = defineStyle('Text', (theme: Theme) => ({
|
|
70
|
-
text: ({ color, typography, weight, align }: TextStyleParams) => ({
|
|
70
|
+
text: ({ color, typography: _typography, weight: _weight, align: _align }: TextStyleParams) => ({
|
|
71
71
|
margin: 0,
|
|
72
72
|
padding: 0,
|
|
73
73
|
// Base color - can be overridden by extensions using any of the params
|
package/src/Text/Text.web.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useState, forwardRef, useMemo } from 'react';
|
|
2
2
|
import { View, TextInput, NativeSyntheticEvent, TextInputContentSizeChangeEventData } from 'react-native';
|
|
3
3
|
import { textAreaStyles } from './TextArea.styles';
|
|
4
4
|
import Text from '../Text';
|
|
@@ -25,7 +25,7 @@ export type TextAreaVariants = {
|
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
// Create intent variants dynamically from theme
|
|
28
|
-
function
|
|
28
|
+
function _createIntentVariants(theme: Theme) {
|
|
29
29
|
const variants: Record<string, object> = {};
|
|
30
30
|
for (const intent in theme.intents) {
|
|
31
31
|
variants[intent] = {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
|
-
import { View
|
|
2
|
+
import { View } from 'react-native';
|
|
3
3
|
import { videoStyles } from './Video.styles';
|
|
4
|
-
import type { VideoProps
|
|
4
|
+
import type { VideoProps } from './types';
|
|
5
5
|
import { getNativeAccessibilityProps } from '../utils/accessibility';
|
|
6
6
|
|
|
7
7
|
// Import react-native-video - it's a peer dependency
|
|
@@ -17,8 +17,8 @@ try {
|
|
|
17
17
|
const Video = React.forwardRef<View, VideoProps>(({
|
|
18
18
|
source,
|
|
19
19
|
poster,
|
|
20
|
-
width,
|
|
21
|
-
height,
|
|
20
|
+
width: _width,
|
|
21
|
+
height: _height,
|
|
22
22
|
aspectRatio,
|
|
23
23
|
controls = true,
|
|
24
24
|
autoPlay = false,
|
|
@@ -26,8 +26,8 @@ const Video = React.forwardRef<View, VideoProps>(({
|
|
|
26
26
|
muted = false,
|
|
27
27
|
onLoad,
|
|
28
28
|
onError,
|
|
29
|
-
onPlay,
|
|
30
|
-
onPause,
|
|
29
|
+
onPlay: _onPlay,
|
|
30
|
+
onPause: _onPause,
|
|
31
31
|
onEnd,
|
|
32
32
|
onProgress,
|
|
33
33
|
borderRadius,
|
|
@@ -73,7 +73,7 @@ const Video = React.forwardRef<View, VideoProps>(({
|
|
|
73
73
|
style,
|
|
74
74
|
];
|
|
75
75
|
|
|
76
|
-
const handleLoad = (
|
|
76
|
+
const handleLoad = (_data: any) => {
|
|
77
77
|
onLoad?.();
|
|
78
78
|
};
|
|
79
79
|
|
package/src/View/View.native.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
2
|
import { View as RNView, ScrollView as RNScrollView, ViewStyle, StyleSheet } from 'react-native';
|
|
3
3
|
import { useResponsiveStyle, ResponsiveStyle } from '@idealyst/theme';
|
|
4
4
|
import { ViewProps } from './types';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Alert, Screen, View, Text,
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { Alert, Screen, View, Text, Button } from '../index';
|
|
3
3
|
export const AlertExamples = () => {
|
|
4
4
|
const [successVisible, setSuccessVisible] = useState(true);
|
|
5
5
|
const [errorVisible, setErrorVisible] = useState(true);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Screen, View , Text, Breadcrumb, Divider, Icon, BreadcrumbItem } from '../index';
|
|
1
|
+
import { Screen, View , Text, Breadcrumb, Icon, BreadcrumbItem } from '../index';
|
|
3
2
|
|
|
4
3
|
export const BreadcrumbExamples = () => {
|
|
5
4
|
const basicItems: BreadcrumbItem[] = [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Screen, View, Text, Select, Card, Button,
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { Screen, View, Text, Select, Card, Button, Divider } from '../index';
|
|
3
3
|
|
|
4
4
|
// Mock data for examples
|
|
5
5
|
const fruitOptions = [
|
|
@@ -58,7 +58,6 @@ const statusOptions = [
|
|
|
58
58
|
export const SelectExamples = () => {
|
|
59
59
|
// State for all select examples
|
|
60
60
|
const [basicSelect, setBasicSelect] = useState('');
|
|
61
|
-
const [fruitSelect, setFruitSelect] = useState('apple');
|
|
62
61
|
const [countrySelect, setCountrySelect] = useState('');
|
|
63
62
|
const [prioritySelect, setPrioritySelect] = useState('medium');
|
|
64
63
|
const [statusSelect, setStatusSelect] = useState('draft');
|
|
@@ -35,7 +35,7 @@ export function deepMerge<T extends Record<string, any>, S extends Record<string
|
|
|
35
35
|
return result as T & S
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
export function buildSizeVariants
|
|
38
|
+
export function buildSizeVariants(
|
|
39
39
|
theme: Theme,
|
|
40
40
|
component: string,
|
|
41
41
|
builder: (value: any) => any
|