@idealyst/components 1.2.74 → 1.2.76

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idealyst/components",
3
- "version": "1.2.74",
3
+ "version": "1.2.76",
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.74",
59
+ "@idealyst/theme": "^1.2.76",
60
60
  "@mdi/js": ">=7.0.0",
61
61
  "@mdi/react": ">=1.0.0",
62
62
  "@react-native-vector-icons/common": ">=12.0.0",
@@ -107,7 +107,7 @@
107
107
  },
108
108
  "devDependencies": {
109
109
  "@idealyst/blur": "^1.2.40",
110
- "@idealyst/theme": "^1.2.74",
110
+ "@idealyst/theme": "^1.2.76",
111
111
  "@idealyst/tooling": "^1.2.30",
112
112
  "@mdi/react": "^1.6.1",
113
113
  "@types/react": "^19.1.0",
@@ -10,6 +10,10 @@ const Screen = forwardRef<IdealystElement, ScreenProps>(({
10
10
  children,
11
11
  background = 'screen',
12
12
  safeArea = true,
13
+ safeAreaTop,
14
+ safeAreaBottom,
15
+ safeAreaLeft,
16
+ safeAreaRight,
13
17
  scrollable = true,
14
18
  avoidKeyboard = true,
15
19
  contentInset,
@@ -28,6 +32,12 @@ const Screen = forwardRef<IdealystElement, ScreenProps>(({
28
32
  }, ref) => {
29
33
  const insets = useSafeAreaInsets();
30
34
 
35
+ // Resolve safe area per edge: specific prop > general safeArea prop
36
+ const applySafeAreaTop = safeAreaTop ?? safeArea;
37
+ const applySafeAreaBottom = safeAreaBottom ?? safeArea;
38
+ const applySafeAreaLeft = safeAreaLeft ?? safeArea;
39
+ const applySafeAreaRight = safeAreaRight ?? safeArea;
40
+
31
41
  // Animated keyboard offset
32
42
  const keyboardOffset = useSharedValue(0);
33
43
 
@@ -82,22 +92,22 @@ const Screen = forwardRef<IdealystElement, ScreenProps>(({
82
92
  // Call styles as functions to get theme-reactive styles
83
93
  const screenStyle = (screenStyles.screen as any)({});
84
94
 
85
- // Calculate safe area padding
86
- const safeAreaStyle = safeArea ? {
87
- paddingTop: insets.top,
88
- paddingBottom: insets.bottom,
89
- paddingLeft: insets.left,
90
- paddingRight: insets.right,
91
- } : undefined;
95
+ // Calculate safe area padding per edge
96
+ const safeAreaStyle = {
97
+ paddingTop: applySafeAreaTop ? insets.top : 0,
98
+ paddingBottom: applySafeAreaBottom ? insets.bottom : 0,
99
+ paddingLeft: applySafeAreaLeft ? insets.left : 0,
100
+ paddingRight: applySafeAreaRight ? insets.right : 0,
101
+ };
92
102
 
93
103
  if (scrollable) {
94
104
  // Content styles applied via View wrapper for Unistyles reactivity
95
105
  // (contentContainerStyle isn't reactive, only style prop is)
96
106
  const contentInsetStyle = contentInset ? {
97
- paddingTop: (safeArea ? insets.top : 0) + (contentInset.top ?? 0),
98
- paddingBottom: (safeArea ? insets.bottom : 0) + (contentInset.bottom ?? 0),
99
- paddingLeft: (safeArea ? insets.left : 0) + (contentInset.left ?? 0),
100
- paddingRight: (safeArea ? insets.right : 0) + (contentInset.right ?? 0),
107
+ paddingTop: safeAreaStyle.paddingTop + (contentInset.top ?? 0),
108
+ paddingBottom: safeAreaStyle.paddingBottom + (contentInset.bottom ?? 0),
109
+ paddingLeft: safeAreaStyle.paddingLeft + (contentInset.left ?? 0),
110
+ paddingRight: safeAreaStyle.paddingRight + (contentInset.right ?? 0),
101
111
  } : safeAreaStyle;
102
112
 
103
113
  return (
@@ -15,6 +15,10 @@ const Screen = forwardRef<IdealystElement, ScreenProps>(({
15
15
  children,
16
16
  background = 'screen',
17
17
  safeArea = false,
18
+ safeAreaTop: _safeAreaTop,
19
+ safeAreaBottom: _safeAreaBottom,
20
+ safeAreaLeft: _safeAreaLeft,
21
+ safeAreaRight: _safeAreaRight,
18
22
  onLayout,
19
23
  // Spacing variants from ContainerStyleProps
20
24
  gap,
@@ -20,10 +20,35 @@ export interface ScreenProps extends ContainerStyleProps {
20
20
  background?: Surface | 'transparent';
21
21
 
22
22
  /**
23
- * Safe area padding for mobile devices
23
+ * Safe area padding for all edges (lower precedence).
24
+ * Individual edge props (safeAreaTop, etc.) override this when set.
24
25
  */
25
26
  safeArea?: boolean;
26
27
 
28
+ /**
29
+ * Safe area padding for the top edge.
30
+ * Overrides safeArea for top when explicitly set.
31
+ */
32
+ safeAreaTop?: boolean;
33
+
34
+ /**
35
+ * Safe area padding for the bottom edge.
36
+ * Overrides safeArea for bottom when explicitly set.
37
+ */
38
+ safeAreaBottom?: boolean;
39
+
40
+ /**
41
+ * Safe area padding for the left edge.
42
+ * Overrides safeArea for left when explicitly set.
43
+ */
44
+ safeAreaLeft?: boolean;
45
+
46
+ /**
47
+ * Safe area padding for the right edge.
48
+ * Overrides safeArea for right when explicitly set.
49
+ */
50
+ safeAreaRight?: boolean;
51
+
27
52
  /**
28
53
  * Content inset padding for scrollable content (mobile only)
29
54
  * Adds padding to the scroll view's content container
@@ -126,7 +126,7 @@ export const textAreaStyles = defineStyle('TextArea', (theme: Theme) => ({
126
126
  size: {
127
127
  fontSize: theme.sizes.$textarea.fontSize,
128
128
  padding: theme.sizes.$textarea.padding,
129
- lineHeight: theme.sizes.$textarea.lineHeight,
129
+ lineHeight: 'auto',
130
130
  },
131
131
  autoGrow: {
132
132
  true: {