@spaced-out/ui-design-system 0.3.34 → 0.3.36
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/CHANGELOG.md +14 -0
- package/lib/components/Modal/Modal.js +14 -4
- package/lib/components/Modal/Modal.js.flow +14 -4
- package/lib/components/Table/StaticTable.js +15 -1
- package/lib/components/Table/StaticTable.js.flow +14 -0
- package/lib/components/Table/Table.module.css +6 -0
- package/lib/styles/typography.module.css +3 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.3.36](https://github.com/spaced-out/ui-design-system/compare/v0.3.35...v0.3.36) (2025-04-24)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* class list sentry issue ([#335](https://github.com/spaced-out/ui-design-system/issues/335)) ([2936d0f](https://github.com/spaced-out/ui-design-system/commit/2936d0f0fd05c46a5000172139b48b7639ff3095))
|
|
11
|
+
|
|
12
|
+
### [0.3.35](https://github.com/spaced-out/ui-design-system/compare/v0.3.34...v0.3.35) (2025-04-14)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* fixes loader scrolling for a big table ([#333](https://github.com/spaced-out/ui-design-system/issues/333)) ([0fa6c74](https://github.com/spaced-out/ui-design-system/commit/0fa6c74db3d221a27890854a884602577345c6d9))
|
|
18
|
+
|
|
5
19
|
### [0.3.34](https://github.com/spaced-out/ui-design-system/compare/v0.3.33...v0.3.34) (2025-04-08)
|
|
6
20
|
|
|
7
21
|
|
|
@@ -90,12 +90,22 @@ function hasChildNode(nodeList) {
|
|
|
90
90
|
return false;
|
|
91
91
|
}
|
|
92
92
|
const fixBody = bodyEl => {
|
|
93
|
-
document.getElementsByTagName('body')[0]
|
|
94
|
-
|
|
93
|
+
const body = document.getElementsByTagName('body')[0];
|
|
94
|
+
if (body && body.classList) {
|
|
95
|
+
body.classList.add('fixed');
|
|
96
|
+
}
|
|
97
|
+
if (bodyEl) {
|
|
98
|
+
bodyEl.style.overflow = 'hidden';
|
|
99
|
+
}
|
|
95
100
|
};
|
|
96
101
|
const unfixBody = bodyEl => {
|
|
97
|
-
document.getElementsByTagName('body')[0]
|
|
98
|
-
|
|
102
|
+
const body = document.getElementsByTagName('body')[0];
|
|
103
|
+
if (body && body.classList) {
|
|
104
|
+
body.classList.remove('fixed');
|
|
105
|
+
}
|
|
106
|
+
if (bodyEl) {
|
|
107
|
+
bodyEl.style.overflow = '';
|
|
108
|
+
}
|
|
99
109
|
};
|
|
100
110
|
const checkAndAddBodyOverflow = bodyEl => {
|
|
101
111
|
const nodes = document.querySelectorAll('[id^="modal-root"]');
|
|
@@ -164,13 +164,23 @@ function hasChildNode(nodeList) {
|
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
const fixBody = (bodyEl: HTMLBodyElement) => {
|
|
167
|
-
document.getElementsByTagName('body')[0]
|
|
168
|
-
|
|
167
|
+
const body = document.getElementsByTagName('body')[0];
|
|
168
|
+
if (body && body.classList) {
|
|
169
|
+
body.classList.add('fixed');
|
|
170
|
+
}
|
|
171
|
+
if (bodyEl) {
|
|
172
|
+
bodyEl.style.overflow = 'hidden';
|
|
173
|
+
}
|
|
169
174
|
};
|
|
170
175
|
|
|
171
176
|
const unfixBody = (bodyEl: HTMLBodyElement) => {
|
|
172
|
-
document.getElementsByTagName('body')[0]
|
|
173
|
-
|
|
177
|
+
const body = document.getElementsByTagName('body')[0];
|
|
178
|
+
if (body && body.classList) {
|
|
179
|
+
body.classList.remove('fixed');
|
|
180
|
+
}
|
|
181
|
+
if (bodyEl) {
|
|
182
|
+
bodyEl.style.overflow = '';
|
|
183
|
+
}
|
|
174
184
|
};
|
|
175
185
|
|
|
176
186
|
const checkAndAddBodyOverflow = (bodyEl: HTMLBodyElement) => {
|
|
@@ -8,6 +8,8 @@ exports.StaticTable = StaticTable;
|
|
|
8
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _get = _interopRequireDefault(require("lodash/get"));
|
|
10
10
|
var _xor = _interopRequireDefault(require("lodash/xor"));
|
|
11
|
+
var _useWindowSize = require("../../hooks/useWindowSize");
|
|
12
|
+
var _size = require("../../styles/variables/_size");
|
|
11
13
|
var _classify = require("../../utils/classify");
|
|
12
14
|
var _makeClassNameComponent = require("../../utils/makeClassNameComponent");
|
|
13
15
|
var _DefaultRow = require("./DefaultRow");
|
|
@@ -62,6 +64,16 @@ function StaticTable(props) {
|
|
|
62
64
|
// this is a fallback and honestly probably doesn't need the
|
|
63
65
|
// memo'ing
|
|
64
66
|
const mappedKeys = React.useMemo(() => rowKeys ?? entries.map(e => (0, _get.default)(e, idName)), [entries, idName, rowKeys]);
|
|
67
|
+
const tableRef = React.useRef(null);
|
|
68
|
+
const {
|
|
69
|
+
width
|
|
70
|
+
} = (0, _useWindowSize.useWindowSize)();
|
|
71
|
+
const [tableWidth, setTableWidth] = React.useState();
|
|
72
|
+
React.useEffect(() => {
|
|
73
|
+
if (tableRef.current) {
|
|
74
|
+
setTableWidth(tableRef.current.offsetWidth);
|
|
75
|
+
}
|
|
76
|
+
}, [width]);
|
|
65
77
|
|
|
66
78
|
/**
|
|
67
79
|
* this function is also used to decide weather to show checkbox in header or not. so it's value is undefined incase selectedKeys is not there.
|
|
@@ -82,8 +94,10 @@ function StaticTable(props) {
|
|
|
82
94
|
return /*#__PURE__*/React.createElement("div", {
|
|
83
95
|
className: (0, _classify.classify)(_TableModule.default.tableContainer, classNames?.wrapper),
|
|
84
96
|
"data-id": "table-wrap",
|
|
97
|
+
ref: tableRef,
|
|
85
98
|
style: {
|
|
86
|
-
'--border-radius': borderRadius
|
|
99
|
+
'--border-radius': borderRadius,
|
|
100
|
+
'--table-width': tableWidth ? `${tableWidth}px` : _size.sizeFluid
|
|
87
101
|
}
|
|
88
102
|
}, /*#__PURE__*/React.createElement(BasicTable, {
|
|
89
103
|
"data-id": "basic-table",
|
|
@@ -4,6 +4,8 @@ import * as React from 'react';
|
|
|
4
4
|
import get from 'lodash/get';
|
|
5
5
|
import xor from 'lodash/xor';
|
|
6
6
|
|
|
7
|
+
import {useWindowSize} from '../../hooks/useWindowSize';
|
|
8
|
+
import {sizeFluid} from '../../styles/variables/_size';
|
|
7
9
|
import {classify} from '../../utils/classify';
|
|
8
10
|
import type {ClassNameComponent} from '../../utils/makeClassNameComponent';
|
|
9
11
|
import {makeClassNameComponent} from '../../utils/makeClassNameComponent';
|
|
@@ -75,6 +77,16 @@ export function StaticTable<Data: GenericObject, Extras: GenericObject>(props: {
|
|
|
75
77
|
[entries, idName, rowKeys],
|
|
76
78
|
);
|
|
77
79
|
|
|
80
|
+
const tableRef = React.useRef(null);
|
|
81
|
+
const {width} = useWindowSize();
|
|
82
|
+
const [tableWidth, setTableWidth] = React.useState();
|
|
83
|
+
|
|
84
|
+
React.useEffect(() => {
|
|
85
|
+
if (tableRef.current) {
|
|
86
|
+
setTableWidth(tableRef.current.offsetWidth);
|
|
87
|
+
}
|
|
88
|
+
}, [width]);
|
|
89
|
+
|
|
78
90
|
/**
|
|
79
91
|
* this function is also used to decide weather to show checkbox in header or not. so it's value is undefined incase selectedKeys is not there.
|
|
80
92
|
*/
|
|
@@ -97,8 +109,10 @@ export function StaticTable<Data: GenericObject, Extras: GenericObject>(props: {
|
|
|
97
109
|
<div
|
|
98
110
|
className={classify(css.tableContainer, classNames?.wrapper)}
|
|
99
111
|
data-id="table-wrap"
|
|
112
|
+
ref={tableRef}
|
|
100
113
|
style={{
|
|
101
114
|
'--border-radius': borderRadius,
|
|
115
|
+
'--table-width': tableWidth ? `${tableWidth}px` : sizeFluid,
|
|
102
116
|
}}
|
|
103
117
|
>
|
|
104
118
|
<BasicTable
|
|
@@ -16,12 +16,15 @@
|
|
|
16
16
|
@value (fontLineHeight170) from '../../styles/variables/_font.css';
|
|
17
17
|
@value (elevationCard) from '../../styles/variables/_elevation.css';
|
|
18
18
|
|
|
19
|
+
@value tableRowTotalPadding: calc(spaceMedium * 2);
|
|
20
|
+
|
|
19
21
|
.fooBar {
|
|
20
22
|
color: colorFillPrimary;
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
.tableContainer {
|
|
24
26
|
--border-radius: borderRadiusMedium;
|
|
27
|
+
--table-width: sizeFluid;
|
|
25
28
|
composes: borderPrimary from '../../styles/border.module.css';
|
|
26
29
|
width: sizeFluid;
|
|
27
30
|
overflow-x: auto;
|
|
@@ -167,6 +170,9 @@
|
|
|
167
170
|
|
|
168
171
|
.emptyRow {
|
|
169
172
|
display: flex;
|
|
173
|
+
width: calc(var(--table-width) - tableRowTotalPadding);
|
|
174
|
+
position: sticky;
|
|
175
|
+
left: spaceMedium;
|
|
170
176
|
flex: 0 0 auto;
|
|
171
177
|
align-items: center;
|
|
172
178
|
justify-content: center;
|
|
@@ -140,11 +140,13 @@
|
|
|
140
140
|
.menuTextMedium {
|
|
141
141
|
composes: buttonTextMedium;
|
|
142
142
|
line-height: fontLineHeight130;
|
|
143
|
+
letter-spacing: fontLetterSpacing0;
|
|
143
144
|
}
|
|
144
145
|
|
|
145
146
|
.menuTextSmall {
|
|
146
147
|
composes: buttonTextSmall;
|
|
147
|
-
letter-spacing:
|
|
148
|
+
letter-spacing: fontLetterSpacing0;
|
|
149
|
+
line-height: fontLineHeight130;
|
|
148
150
|
}
|
|
149
151
|
|
|
150
152
|
.formInputMedium {
|