Skip to content

Commit 22d480f

Browse files
committed
update styles to allow for not having a span element for wrapping
1 parent eae1ec3 commit 22d480f

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

packages/react-storage/src/components/StorageBrowser/Views/LocationsView/Controls/DataTable.tsx

+4-12
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { capitalize } from '@aws-amplify/ui';
55
import {
66
DataTable,
77
TABLE_DATA_BUTTON_CLASS,
8-
TABLE_DATA_TEXT_CLASS_NAME,
8+
// TABLE_DATA_TEXT_CLASS_NAME,
99
TABLE_HEADER_BUTTON_CLASS_NAME,
1010
TABLE_HEADER_CLASS_NAME,
1111
} from '../../../components/DataTable';
@@ -16,7 +16,7 @@ import { compareStrings } from '../../../context/controls/Table';
1616
import {
1717
ButtonElement,
1818
IconElement,
19-
SpanElement,
19+
// SpanElement,
2020
} from '../../../context/elements';
2121

2222
export type SortDirection = 'ascending' | 'descending' | 'none';
@@ -120,19 +120,11 @@ const getLocationsData = ({
120120
},
121121
{
122122
key: `td-type-${index}`,
123-
children: (
124-
<SpanElement className={TABLE_DATA_TEXT_CLASS_NAME}>
125-
{location.type}
126-
</SpanElement>
127-
),
123+
children: location.type,
128124
},
129125
{
130126
key: `td-permission-${index}`,
131-
children: (
132-
<SpanElement className={TABLE_DATA_TEXT_CLASS_NAME}>
133-
{location.permission}
134-
</SpanElement>
135-
),
127+
children: location.permission,
136128
},
137129
]);
138130

packages/react-storage/src/components/StorageBrowser/context/elements/defaults.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ const TableHead = React.forwardRef<HTMLTableSectionElement, TableHeadProps>(
173173

174174
const TableData = React.forwardRef<HTMLTableCellElement, TableCellProps>(
175175
function TableData(props, ref) {
176-
return <_TableCell padding="xxxs" {...props} ref={ref} />;
176+
return <_TableCell {...props} ref={ref} />;
177177
}
178178
);
179179

@@ -185,7 +185,7 @@ const TableRow = React.forwardRef<HTMLTableRowElement, TableRowProps>(
185185

186186
const TableHeader = React.forwardRef<HTMLTableCellElement, TableHeadProps>(
187187
function TableHeader(props, ref) {
188-
return <_TableCell padding="xxxs" as="th" {...props} ref={ref} />;
188+
return <_TableCell as="th" {...props} ref={ref} />;
189189
}
190190
);
191191

packages/react-storage/src/styles/storage-browser.css

+13-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.storage-browser {
2-
--storage-browser-gap-small: 0.375rem;
2+
--storage-browser-gap-small: 0.3rem;
33
--storage-browser-gap: 0.6rem;
44
--storage-browser-status-error: hsl(0, 95%, 30%);
55
--storage-browser-status-success: hsl(130, 33%, 37%);
@@ -161,6 +161,7 @@
161161
}
162162

163163
.storage-browser__table__header {
164+
padding: var(--storage-browser-gap-small);
164165
text-align: start;
165166
}
166167
.storage-browser__table__header__button {
@@ -169,17 +170,24 @@
169170
align-items: center;
170171
}
171172

172-
.storage-browser__table__data__text,
173+
.storage-browser__table__data:not(:has(.storage-browser__table__data__button)),
173174
.storage-browser__table__data__button {
174-
display: inline-block;
175-
width: 100%;
176-
padding: var(--storage-browser-gap-small);
177175
text-overflow: ellipsis;
178176
overflow: hidden;
179177
white-space: nowrap;
180178
text-align: start;
181179
}
182180

181+
.storage-browser__table__data:not(:has(.storage-browser__table__data__button)) {
182+
padding: var(--storage-browser-gap);
183+
}
184+
185+
.storage-browser__table__data__button {
186+
display: inline-block;
187+
width: 100%;
188+
padding: var(--storage-browser-gap-small);
189+
}
190+
183191
.storage-browser__table__data__icon,
184192
.storage-browser__action-status {
185193
vertical-align: middle;

0 commit comments

Comments
 (0)