@x-plat/design-system 0.5.4 → 0.5.6

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.
@@ -130,6 +130,8 @@ var TableCell = import_react4.default.memo((props) => {
130
130
  children,
131
131
  align = "center",
132
132
  isSticky = false,
133
+ width,
134
+ nowrap = false,
133
135
  onClick
134
136
  } = props;
135
137
  const { registerStickyCell, stickyCells } = useTableRowContext();
@@ -173,9 +175,13 @@ var TableCell = import_react4.default.memo((props) => {
173
175
  isSticky && "table-sticky",
174
176
  isLastSticky && stickyShadow && "right-shadow",
175
177
  onClick && "clickable",
176
- enableHover && "cell-hover"
178
+ enableHover && "cell-hover",
179
+ nowrap && "nowrap"
177
180
  ),
178
- style: isSticky ? { left } : void 0,
181
+ style: {
182
+ ...isSticky ? { left } : null,
183
+ ...width != null ? { width: typeof width === "number" ? `${width}px` : width } : null
184
+ },
179
185
  onClick,
180
186
  children
181
187
  }
@@ -4,6 +4,7 @@
4
4
  width: 100%;
5
5
  height: 100%;
6
6
  position: relative;
7
+ overflow: auto;
7
8
  }
8
9
  .lib-xplat-table-wrapper > .lib-xplat-table {
9
10
  width: 100%;
@@ -76,6 +77,20 @@
76
77
  min-width: 80px;
77
78
  padding: var(--spacing-space-2);
78
79
  vertical-align: middle;
80
+ word-break: keep-all;
81
+ overflow-wrap: anywhere;
82
+ }
83
+ .lib-xplat-table-wrapper > .lib-xplat-table > thead > tr > td.nowrap,
84
+ .lib-xplat-table-wrapper > .lib-xplat-table > thead > tr > th.nowrap,
85
+ .lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr > td.nowrap,
86
+ .lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr > th.nowrap {
87
+ white-space: nowrap;
88
+ overflow-wrap: normal;
89
+ }
90
+ .lib-xplat-table-wrapper > .lib-xplat-table > thead > tr > td,
91
+ .lib-xplat-table-wrapper > .lib-xplat-table > thead > tr > th,
92
+ .lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr > td,
93
+ .lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr > th {
79
94
  transition: background-color 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94);
80
95
  }
81
96
  .lib-xplat-table-wrapper > .lib-xplat-table > thead > tr > td.clickable,
@@ -25,6 +25,8 @@ interface TableCellProps {
25
25
  children: React.ReactNode;
26
26
  align?: "start" | "center" | "end";
27
27
  isSticky?: boolean;
28
+ width?: string | number;
29
+ nowrap?: boolean;
28
30
  onClick?: (e: React.MouseEvent<HTMLTableCellElement>) => void;
29
31
  }
30
32
  declare const TableCell: React.NamedExoticComponent<TableCellProps>;
@@ -25,6 +25,8 @@ interface TableCellProps {
25
25
  children: React.ReactNode;
26
26
  align?: "start" | "center" | "end";
27
27
  isSticky?: boolean;
28
+ width?: string | number;
29
+ nowrap?: boolean;
28
30
  onClick?: (e: React.MouseEvent<HTMLTableCellElement>) => void;
29
31
  }
30
32
  declare const TableCell: React.NamedExoticComponent<TableCellProps>;
@@ -90,6 +90,8 @@ var TableCell = React4.memo((props) => {
90
90
  children,
91
91
  align = "center",
92
92
  isSticky = false,
93
+ width,
94
+ nowrap = false,
93
95
  onClick
94
96
  } = props;
95
97
  const { registerStickyCell, stickyCells } = useTableRowContext();
@@ -133,9 +135,13 @@ var TableCell = React4.memo((props) => {
133
135
  isSticky && "table-sticky",
134
136
  isLastSticky && stickyShadow && "right-shadow",
135
137
  onClick && "clickable",
136
- enableHover && "cell-hover"
138
+ enableHover && "cell-hover",
139
+ nowrap && "nowrap"
137
140
  ),
138
- style: isSticky ? { left } : void 0,
141
+ style: {
142
+ ...isSticky ? { left } : null,
143
+ ...width != null ? { width: typeof width === "number" ? `${width}px` : width } : null
144
+ },
139
145
  onClick,
140
146
  children
141
147
  }