@idealyst/components 1.2.142 → 1.2.143

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.142",
3
+ "version": "1.2.143",
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.142",
59
+ "@idealyst/theme": "^1.2.143",
60
60
  "@mdi/js": ">=7.0.0",
61
61
  "@mdi/react": ">=1.0.0",
62
62
  "@react-native-vector-icons/common": ">=12.0.0",
@@ -111,8 +111,8 @@
111
111
  },
112
112
  "devDependencies": {
113
113
  "@idealyst/blur": "^1.2.40",
114
- "@idealyst/theme": "^1.2.142",
115
- "@idealyst/tooling": "^1.2.142",
114
+ "@idealyst/theme": "^1.2.143",
115
+ "@idealyst/tooling": "^1.2.143",
116
116
  "@mdi/react": "^1.6.1",
117
117
  "@types/react": "^19.1.0",
118
118
  "react": "^19.1.0",
@@ -49,6 +49,7 @@ export const switchStyles = defineStyle('Switch', (theme: Theme) => ({
49
49
 
50
50
  switchContainer: (_props: SwitchDynamicProps) => ({
51
51
  justifyContent: 'center' as const,
52
+ alignItems: 'center' as const,
52
53
  variants: {
53
54
  disabled: {
54
55
  true: { _web: { cursor: 'not-allowed' } },
@@ -56,10 +57,12 @@ export const switchStyles = defineStyle('Switch', (theme: Theme) => ({
56
57
  },
57
58
  },
58
59
  _web: {
60
+ display: 'inline-flex',
59
61
  border: 'none',
60
62
  padding: 0,
61
63
  backgroundColor: 'transparent',
62
64
  width: 'fit-content',
65
+ verticalAlign: 'middle',
63
66
  },
64
67
  }),
65
68
 
@@ -13,6 +13,7 @@ interface TRProps {
13
13
  size?: TableSizeVariant;
14
14
  type?: TableType;
15
15
  clickable?: boolean;
16
+ dividers?: boolean;
16
17
  onPress?: () => void;
17
18
  testID?: string;
18
19
  }
@@ -42,6 +43,7 @@ function TR({
42
43
  size = 'md',
43
44
  type = 'standard',
44
45
  clickable = false,
46
+ dividers = false,
45
47
  onPress,
46
48
  testID,
47
49
  }: TRProps) {
@@ -49,6 +51,7 @@ function TR({
49
51
  size,
50
52
  type,
51
53
  clickable,
54
+ dividers,
52
55
  });
53
56
 
54
57
  const rowStyle = (tableStyles.row as any)({});
@@ -187,6 +190,7 @@ function TableInner<T = any>({
187
190
  size = 'md',
188
191
  stickyHeader: _stickyHeader = false,
189
192
  onRowPress,
193
+ dividers = false,
190
194
  emptyState,
191
195
  // Spacing variants from ContainerStyleProps
192
196
  gap,
@@ -289,6 +293,7 @@ function TableInner<T = any>({
289
293
  size={size}
290
294
  type={type}
291
295
  clickable={isClickable}
296
+ dividers={dividers}
292
297
  onPress={() => onRowPress?.(row, rowIndex)}
293
298
  testID={testID ? `${testID}-row-${rowIndex}` : undefined}
294
299
  >
@@ -19,6 +19,7 @@ export type TableDynamicProps = {
19
19
  size?: Size;
20
20
  type?: TableType;
21
21
  clickable?: boolean;
22
+ dividers?: boolean;
22
23
  sticky?: boolean;
23
24
  align?: CellAlign;
24
25
  gap?: ViewStyleSize;
@@ -116,8 +117,8 @@ export const tableStyles = defineStyle('Table', (theme: Theme) => ({
116
117
  variants: {
117
118
  size: {
118
119
  padding: theme.sizes.$table.padding,
119
- fontSize: theme.sizes.$table.fontSize,
120
- lineHeight: theme.sizes.$table.lineHeight,
120
+ fontSize: theme.sizes.$table.headerFontSize,
121
+ lineHeight: theme.sizes.$table.headerLineHeight,
121
122
  },
122
123
  },
123
124
  _web: {
@@ -128,8 +129,9 @@ export const tableStyles = defineStyle('Table', (theme: Theme) => ({
128
129
  } as const;
129
130
  },
130
131
 
131
- row: ({ type = 'standard', clickable = false }: TableDynamicProps) => {
132
- const typeStyles = type === 'bordered' || type === 'striped' ? {
132
+ row: ({ type = 'standard', clickable = false, dividers = false }: TableDynamicProps) => {
133
+ const showBorder = type === 'bordered' || type === 'striped' || dividers;
134
+ const typeStyles = showBorder ? {
133
135
  borderBottomWidth: 1,
134
136
  borderBottomColor: theme.colors.border.primary,
135
137
  } : {};
@@ -138,7 +140,7 @@ export const tableStyles = defineStyle('Table', (theme: Theme) => ({
138
140
  ...typeStyles,
139
141
  _web: {
140
142
  transition: 'background-color 0.15s ease',
141
- borderBottom: (type === 'bordered' || type === 'striped')
143
+ borderBottom: showBorder
142
144
  ? `1px solid ${theme.colors.border.primary}`
143
145
  : undefined,
144
146
  cursor: clickable ? 'pointer' : undefined,
@@ -173,8 +175,8 @@ export const tableStyles = defineStyle('Table', (theme: Theme) => ({
173
175
  },
174
176
  size: {
175
177
  padding: theme.sizes.$table.padding,
176
- fontSize: theme.sizes.$table.fontSize,
177
- lineHeight: theme.sizes.$table.lineHeight,
178
+ fontSize: theme.sizes.$table.headerFontSize,
179
+ lineHeight: theme.sizes.$table.headerLineHeight,
178
180
  },
179
181
  },
180
182
  _web: {
@@ -32,6 +32,7 @@ interface TRProps {
32
32
  size?: TableSizeVariant;
33
33
  type?: TableType;
34
34
  clickable?: boolean;
35
+ dividers?: boolean;
35
36
  onClick?: () => void;
36
37
  testID?: string;
37
38
  }
@@ -69,6 +70,7 @@ function TR({
69
70
  size = 'md',
70
71
  type = 'standard',
71
72
  clickable = false,
73
+ dividers = false,
72
74
  onClick,
73
75
  testID,
74
76
  }: TRProps) {
@@ -76,6 +78,7 @@ function TR({
76
78
  size,
77
79
  type,
78
80
  clickable,
81
+ dividers,
79
82
  });
80
83
 
81
84
  const rowProps = getWebProps([(tableStyles.row as any)({})]);
@@ -263,6 +266,7 @@ function Table<T = any>({
263
266
  stickyHeader = false,
264
267
  onRowPress,
265
268
  onColumnResize,
269
+ dividers = false,
266
270
  emptyState,
267
271
  // Spacing variants from ContainerStyleProps
268
272
  gap,
@@ -394,6 +398,7 @@ function Table<T = any>({
394
398
  size={size}
395
399
  type={type}
396
400
  clickable={isClickable}
401
+ dividers={dividers}
397
402
  onClick={() => onRowPress?.(row, rowIndex)}
398
403
  testID={testID ? `${testID}-row-${rowIndex}` : undefined}
399
404
  >
@@ -47,6 +47,11 @@ export interface TableProps<T = any> extends ContainerStyleProps, AccessibilityP
47
47
  type?: TableType;
48
48
  size?: TableSizeVariant;
49
49
  stickyHeader?: boolean;
50
+ /**
51
+ * Show dividers (horizontal borders) between rows.
52
+ * Works with any table `type`.
53
+ */
54
+ dividers?: boolean;
50
55
  onRowPress?: (row: T, index: number) => void;
51
56
  /**
52
57
  * Called when a column is resized via drag handle.