oneslash-design-system 1.2.14 → 1.2.15

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.
@@ -3,12 +3,21 @@ import React from 'react';
3
3
 
4
4
  interface TableCellProps{
5
5
  children: React.ReactNode;
6
+ width?: string; // e.g., '200px', '25%', 'auto'
7
+ minWidth?: string;
8
+ align?: 'left' | 'center' | 'right';
6
9
  }
7
-
8
- export default function TableCell({children}: TableCellProps) {
10
+
11
+ export default function TableCell({children, width, minWidth, align = 'left'}: TableCellProps) {
12
+ const alignClass = align === 'center' ? 'text-center' : align === 'right' ? 'text-right' : 'text-left';
13
+ const widthStyle = width ? { width, minWidth: minWidth || width } : {};
14
+ const flexClass = width ? '' : 'flex-1';
9
15
 
10
16
  return (
11
- <div className="flex-1 p-2 text-body2 text-light-text-primary dark:text-dark-text-primary border-t border-light-misc-divider dark:border-dark-misc-divider">
17
+ <div
18
+ className={`${flexClass} p-2 text-body2 text-light-text-primary dark:text-dark-text-primary border-t border-light-misc-divider dark:border-dark-misc-divider ${alignClass}`}
19
+ style={widthStyle}
20
+ >
12
21
  {children}
13
22
  </div>
14
23
  );
@@ -3,12 +3,21 @@ import React from 'react';
3
3
 
4
4
  interface TableHeaderCellProps{
5
5
  children: React.ReactNode;
6
+ width?: string; // e.g., '200px', '25%', 'auto'
7
+ minWidth?: string;
8
+ align?: 'left' | 'center' | 'right';
6
9
  }
7
-
8
- export default function TableHeaderCell({children}: TableHeaderCellProps) {
10
+
11
+ export default function TableHeaderCell({children, width, minWidth, align = 'left'}: TableHeaderCellProps) {
12
+ const alignClass = align === 'center' ? 'text-center' : align === 'right' ? 'text-right' : 'text-left';
13
+ const widthStyle = width ? { width, minWidth: minWidth || width } : {};
14
+ const flexClass = width ? '' : 'flex-1';
9
15
 
10
16
  return (
11
- <div className="flex-1 p-2 text-body2 text-light-text-primary dark:text-dark-text-primary">
17
+ <div
18
+ className={`${flexClass} p-2 text-body2 text-light-text-primary dark:text-dark-text-primary ${alignClass}`}
19
+ style={widthStyle}
20
+ >
12
21
  {children}
13
22
  </div>
14
23
  );
@@ -1,6 +1,9 @@
1
1
  import React from 'react';
2
2
  interface TableCellProps {
3
3
  children: React.ReactNode;
4
+ width?: string;
5
+ minWidth?: string;
6
+ align?: 'left' | 'center' | 'right';
4
7
  }
5
- export default function TableCell({ children }: TableCellProps): React.JSX.Element;
8
+ export default function TableCell({ children, width, minWidth, align }: TableCellProps): React.JSX.Element;
6
9
  export {};
@@ -1,8 +1,11 @@
1
1
  'use client';
2
2
  import React from 'react';
3
3
  export default function TableCell(_a) {
4
- var children = _a.children;
5
- return (<div className="flex-1 p-2 text-body2 text-light-text-primary dark:text-dark-text-primary border-t border-light-misc-divider dark:border-dark-misc-divider">
4
+ var children = _a.children, width = _a.width, minWidth = _a.minWidth, _b = _a.align, align = _b === void 0 ? 'left' : _b;
5
+ var alignClass = align === 'center' ? 'text-center' : align === 'right' ? 'text-right' : 'text-left';
6
+ var widthStyle = width ? { width: width, minWidth: minWidth || width } : {};
7
+ var flexClass = width ? '' : 'flex-1';
8
+ return (<div className={"".concat(flexClass, " p-2 text-body2 text-light-text-primary dark:text-dark-text-primary border-t border-light-misc-divider dark:border-dark-misc-divider ").concat(alignClass)} style={widthStyle}>
6
9
  {children}
7
10
  </div>);
8
11
  }
@@ -1,6 +1,9 @@
1
1
  import React from 'react';
2
2
  interface TableHeaderCellProps {
3
3
  children: React.ReactNode;
4
+ width?: string;
5
+ minWidth?: string;
6
+ align?: 'left' | 'center' | 'right';
4
7
  }
5
- export default function TableHeaderCell({ children }: TableHeaderCellProps): React.JSX.Element;
8
+ export default function TableHeaderCell({ children, width, minWidth, align }: TableHeaderCellProps): React.JSX.Element;
6
9
  export {};
@@ -1,8 +1,11 @@
1
1
  'use client';
2
2
  import React from 'react';
3
3
  export default function TableHeaderCell(_a) {
4
- var children = _a.children;
5
- return (<div className="flex-1 p-2 text-body2 text-light-text-primary dark:text-dark-text-primary">
4
+ var children = _a.children, width = _a.width, minWidth = _a.minWidth, _b = _a.align, align = _b === void 0 ? 'left' : _b;
5
+ var alignClass = align === 'center' ? 'text-center' : align === 'right' ? 'text-right' : 'text-left';
6
+ var widthStyle = width ? { width: width, minWidth: minWidth || width } : {};
7
+ var flexClass = width ? '' : 'flex-1';
8
+ return (<div className={"".concat(flexClass, " p-2 text-body2 text-light-text-primary dark:text-dark-text-primary ").concat(alignClass)} style={widthStyle}>
6
9
  {children}
7
10
  </div>);
8
11
  }
package/dist/output.css CHANGED
@@ -944,9 +944,15 @@ video {
944
944
  padding-top: 3px;
945
945
  padding-bottom: 3px;
946
946
  }
947
+ .text-left {
948
+ text-align: left;
949
+ }
947
950
  .text-center {
948
951
  text-align: center;
949
952
  }
953
+ .text-right {
954
+ text-align: right;
955
+ }
950
956
  .text-body1 {
951
957
  font-size: 16px;
952
958
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "oneslash-design-system",
3
3
  "description": "A design system for the Oneslash projects",
4
- "version": "1.2.14",
4
+ "version": "1.2.15",
5
5
  "private": false,
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",