@spaced-out/ui-design-system 0.3.33 → 0.3.35

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 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.35](https://github.com/spaced-out/ui-design-system/compare/v0.3.34...v0.3.35) (2025-04-14)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * 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))
11
+
12
+ ### [0.3.34](https://github.com/spaced-out/ui-design-system/compare/v0.3.33...v0.3.34) (2025-04-08)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * added updates in Table stories ([#332](https://github.com/spaced-out/ui-design-system/issues/332)) ([43d5c6b](https://github.com/spaced-out/ui-design-system/commit/43d5c6b68617387fcd906ed78d53f8d98d467ca8))
18
+
5
19
  ### [0.3.33](https://github.com/spaced-out/ui-design-system/compare/v0.3.32...v0.3.33) (2025-04-03)
6
20
 
7
21
 
@@ -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: fontLineHeight130;
148
+ letter-spacing: fontLetterSpacing0;
149
+ line-height: fontLineHeight130;
148
150
  }
149
151
 
150
152
  .formInputMedium {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spaced-out/ui-design-system",
3
- "version": "0.3.33",
3
+ "version": "0.3.35",
4
4
  "main": "index.js",
5
5
  "description": "Sense UI components library",
6
6
  "author": {