@spaced-out/ui-design-system 0.1.97 → 0.1.99
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/FileUpload/FileUpload.js +5 -2
- package/lib/components/FileUpload/FileUpload.js.flow +12 -5
- package/lib/components/Grid/Grid.module.css +0 -7
- package/lib/components/Pagination/Pagination.js +6 -1
- package/lib/components/Pagination/Pagination.js.flow +7 -0
- package/lib/components/SearchInput/SearchInput.js +3 -1
- package/lib/components/SearchInput/SearchInput.js.flow +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.1.99](https://github.com/spaced-out/ui-design-system/compare/v0.1.98...v0.1.99) (2024-06-03)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* minor enhancements in fileupload, search input and pagination components ([#223](https://github.com/spaced-out/ui-design-system/issues/223)) ([902a55d](https://github.com/spaced-out/ui-design-system/commit/902a55d7d968d545cda0a1addc5c915160c59561))
|
|
11
|
+
|
|
12
|
+
### [0.1.98](https://github.com/spaced-out/ui-design-system/compare/v0.1.97...v0.1.98) (2024-05-31)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* removing grid-row fixed height and width ([#222](https://github.com/spaced-out/ui-design-system/issues/222)) ([4644961](https://github.com/spaced-out/ui-design-system/commit/46449611a3925d755c665c874bf766deb80f5c5b))
|
|
18
|
+
|
|
5
19
|
### [0.1.97](https://github.com/spaced-out/ui-design-system/compare/v0.1.96...v0.1.97) (2024-05-30)
|
|
6
20
|
|
|
7
21
|
|
|
@@ -85,7 +85,7 @@ const FileUploadBase = (props, ref) => {
|
|
|
85
85
|
[_FileUploadModule.default.disabled]: disabled || !shouldAcceptFiles,
|
|
86
86
|
[_FileUploadModule.default.dragActive]: isDragActive,
|
|
87
87
|
[_FileUploadModule.default.error]: error
|
|
88
|
-
})
|
|
88
|
+
}, classNames?.dropZone)
|
|
89
89
|
}), /*#__PURE__*/React.createElement("input", getInputProps()), /*#__PURE__*/React.createElement("div", {
|
|
90
90
|
className: (0, _classify.default)(_FileUploadModule.default.instruction, classNames?.instruction)
|
|
91
91
|
}, isDragActive ? draggingInstruction : instruction), /*#__PURE__*/React.createElement("div", {
|
|
@@ -97,7 +97,10 @@ const FileUploadBase = (props, ref) => {
|
|
|
97
97
|
}, /*#__PURE__*/React.createElement(_FileBlock.FileBlock, {
|
|
98
98
|
fileObject: fileObject,
|
|
99
99
|
onFileRefreshClick: onFileRefreshClick,
|
|
100
|
-
handleFileClear: handleFileDeletionExternally ? onFileClear : handleFileClear
|
|
100
|
+
handleFileClear: handleFileDeletionExternally ? onFileClear : handleFileClear,
|
|
101
|
+
classNames: {
|
|
102
|
+
wrapper: classNames?.files
|
|
103
|
+
}
|
|
101
104
|
})))));
|
|
102
105
|
};
|
|
103
106
|
const FileUpload = /*#__PURE__*/React.forwardRef(FileUploadBase);
|
|
@@ -19,6 +19,8 @@ type ClassNames = $ReadOnly<{
|
|
|
19
19
|
wrapper?: string,
|
|
20
20
|
instruction?: string,
|
|
21
21
|
secondaryInstruction?: string,
|
|
22
|
+
dropZone?: string,
|
|
23
|
+
files?: string,
|
|
22
24
|
}>;
|
|
23
25
|
|
|
24
26
|
export type FileProgress = number | 'indeterminate';
|
|
@@ -160,11 +162,15 @@ const FileUploadBase = (props: FileUploadProps, ref) => {
|
|
|
160
162
|
<UnstyledButton
|
|
161
163
|
disabled={disabled || !shouldAcceptFiles}
|
|
162
164
|
{...getRootProps()}
|
|
163
|
-
className={classify(
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
165
|
+
className={classify(
|
|
166
|
+
css.dropzone,
|
|
167
|
+
{
|
|
168
|
+
[css.disabled]: disabled || !shouldAcceptFiles,
|
|
169
|
+
[css.dragActive]: isDragActive,
|
|
170
|
+
[css.error]: error,
|
|
171
|
+
},
|
|
172
|
+
classNames?.dropZone,
|
|
173
|
+
)}
|
|
168
174
|
>
|
|
169
175
|
<input {...getInputProps()} />
|
|
170
176
|
<div className={classify(css.instruction, classNames?.instruction)}>
|
|
@@ -190,6 +196,7 @@ const FileUploadBase = (props: FileUploadProps, ref) => {
|
|
|
190
196
|
handleFileClear={
|
|
191
197
|
handleFileDeletionExternally ? onFileClear : handleFileClear
|
|
192
198
|
}
|
|
199
|
+
classNames={{wrapper: classNames?.files}}
|
|
193
200
|
/>
|
|
194
201
|
</React.Fragment>
|
|
195
202
|
))}
|
|
@@ -4,18 +4,11 @@
|
|
|
4
4
|
spaceLarge
|
|
5
5
|
) from '../../styles/variables/_space.css';
|
|
6
6
|
|
|
7
|
-
@value (
|
|
8
|
-
size960,
|
|
9
|
-
sizeFluid
|
|
10
|
-
) from '../../styles/variables/_size.css';
|
|
11
|
-
|
|
12
7
|
.gridRow {
|
|
13
8
|
--grid-repeat-count: 12;
|
|
14
9
|
--repeat-tracks: 1fr;
|
|
15
10
|
display: grid !important;
|
|
16
11
|
grid-template-columns: repeat(var(--grid-repeat-count), var(--repeat-tracks));
|
|
17
|
-
width: sizeFluid;
|
|
18
|
-
height: sizeFluid;
|
|
19
12
|
gap: spaceMedium;
|
|
20
13
|
padding: spaceNone spaceLarge;
|
|
21
14
|
grid-auto-flow: row;
|
|
@@ -16,6 +16,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
16
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
17
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
18
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
19
|
+
const LARGE_LIST_DROPDOWN_OPTIONS = 50;
|
|
19
20
|
const Pagination = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
20
21
|
const {
|
|
21
22
|
classNames,
|
|
@@ -39,6 +40,9 @@ const Pagination = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
39
40
|
onChange,
|
|
40
41
|
...restPaginationProps
|
|
41
42
|
});
|
|
43
|
+
const menuVirtualization = {
|
|
44
|
+
enable: totalPages > LARGE_LIST_DROPDOWN_OPTIONS ? true : false
|
|
45
|
+
};
|
|
42
46
|
const allPages = (0, _helpers.range)(1, totalPages);
|
|
43
47
|
const options = style !== 'secondary' ? [] : allPages.map(page => ({
|
|
44
48
|
key: page.toString(),
|
|
@@ -63,7 +67,8 @@ const Pagination = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
63
67
|
classNames: {
|
|
64
68
|
wrapper: _PaginationModule.default.menuWrapper
|
|
65
69
|
},
|
|
66
|
-
selectedKeys: currentPage ? [currentPage.toString()] : []
|
|
70
|
+
selectedKeys: currentPage ? [currentPage.toString()] : [],
|
|
71
|
+
virtualization: menuVirtualization
|
|
67
72
|
},
|
|
68
73
|
dropdownInputText: currentPage.toString(),
|
|
69
74
|
onChange: option => onChange?.(parseInt(option.key))
|
|
@@ -57,6 +57,8 @@ export type PaginationItemProps = {
|
|
|
57
57
|
type: PaginationItemType,
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
+
const LARGE_LIST_DROPDOWN_OPTIONS = 50;
|
|
61
|
+
|
|
60
62
|
export const Pagination: React$AbstractComponent<
|
|
61
63
|
PaginationProps,
|
|
62
64
|
HTMLDivElement,
|
|
@@ -83,6 +85,10 @@ export const Pagination: React$AbstractComponent<
|
|
|
83
85
|
...restPaginationProps,
|
|
84
86
|
});
|
|
85
87
|
|
|
88
|
+
const menuVirtualization = {
|
|
89
|
+
enable: totalPages > LARGE_LIST_DROPDOWN_OPTIONS ? true : false,
|
|
90
|
+
};
|
|
91
|
+
|
|
86
92
|
const allPages = range(1, totalPages);
|
|
87
93
|
const options =
|
|
88
94
|
style !== 'secondary'
|
|
@@ -112,6 +118,7 @@ export const Pagination: React$AbstractComponent<
|
|
|
112
118
|
isFluid: true,
|
|
113
119
|
classNames: {wrapper: css.menuWrapper},
|
|
114
120
|
selectedKeys: currentPage ? [currentPage.toString()] : [],
|
|
121
|
+
virtualization: menuVirtualization,
|
|
115
122
|
}}
|
|
116
123
|
dropdownInputText={currentPage.toString()}
|
|
117
124
|
onChange={(option) => onChange?.(parseInt(option.key))}
|
|
@@ -27,7 +27,9 @@ const SearchInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
27
27
|
...searchInputProps
|
|
28
28
|
} = _ref;
|
|
29
29
|
const handleClearClick = () => {
|
|
30
|
-
|
|
30
|
+
if (value && !(disabled || locked)) {
|
|
31
|
+
onClear?.();
|
|
32
|
+
}
|
|
31
33
|
};
|
|
32
34
|
return /*#__PURE__*/React.createElement("div", {
|
|
33
35
|
className: (0, _classify.default)(_SearchInputModule.default.searchInputWrapper, classNames?.wrapper)
|