@spaced-out/ui-design-system 0.0.38 → 0.0.40
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/.cspell/custom-words.txt +3 -0
- package/.storybook/public/images/personas/1.png +0 -0
- package/.storybook/public/images/personas/2.png +0 -0
- package/.storybook/public/images/personas/3.png +0 -0
- package/.storybook/public/images/personas/4.png +0 -0
- package/.storybook/public/images/personas/5.png +0 -0
- package/.storybook/public/images/personas/6.png +0 -0
- package/CHANGELOG.md +20 -0
- package/design-tokens/color/base-color.json +128 -0
- package/design-tokens/size/base-size.json +9 -0
- package/lib/components/Checkbox/Checkbox.js.flow +5 -0
- package/lib/components/Checkbox/Checkbox.module.css +1 -1
- package/lib/components/Input/Input.js +22 -2
- package/lib/components/Input/Input.js.flow +37 -1
- package/lib/components/Input/Input.module.css +27 -1
- package/lib/components/Input/index.js +11 -7
- package/lib/components/Input/index.js.flow +1 -2
- package/lib/components/Menu/Menu.js +1 -1
- package/lib/components/Menu/Menu.js.flow +2 -2
- package/lib/components/Menu/MenuOptionButton.js.flow +1 -1
- package/lib/components/Menu/index.js +1 -1
- package/lib/components/Menu/index.js.flow +1 -1
- package/lib/components/Table/Cell.js +114 -0
- package/lib/components/Table/Cell.js.flow +123 -0
- package/lib/components/Table/Row.js +96 -0
- package/lib/components/Table/Row.js.flow +145 -0
- package/lib/components/Table/StaticTable.js +124 -0
- package/lib/components/Table/StaticTable.js.flow +170 -0
- package/lib/components/Table/Table.js +61 -0
- package/lib/components/Table/Table.js.flow +101 -0
- package/lib/components/Table/Table.module.css +252 -0
- package/lib/components/Table/TableHeader.js +146 -0
- package/lib/components/Table/TableHeader.js.flow +236 -0
- package/lib/components/Table/hooks.js +68 -0
- package/lib/components/Table/hooks.js.flow +91 -0
- package/lib/components/Table/index.js +63 -0
- package/lib/components/Table/index.js.flow +14 -0
- package/lib/components/Tabs/TabList/TabList.js +1 -1
- package/lib/components/Tabs/TabList/TabList.js.flow +1 -1
- package/lib/styles/variables/_size.css +6 -0
- package/lib/styles/variables/_size.js +8 -2
- package/lib/styles/variables/_size.js.flow +6 -0
- package/lib/utils/makeClassNameComponent.js +1 -1
- package/lib/utils/makeClassNameComponent.js.flow +1 -1
- package/package.json +4 -3
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
// @flow strict
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
|
|
5
|
+
import type {ColorTypes} from '../../types/typography';
|
|
6
|
+
import classify from '../../utils/classify';
|
|
7
|
+
import type {ClassNameComponent} from '../../utils/makeClassNameComponent';
|
|
8
|
+
import {makeClassNameComponent} from '../../utils/makeClassNameComponent';
|
|
9
|
+
import {Checkbox} from '../Checkbox';
|
|
10
|
+
import {Icon} from '../Icon';
|
|
11
|
+
import {SubTitleExtraSmall, TEXT_COLORS} from '../Text';
|
|
12
|
+
|
|
13
|
+
import type {SortDirection} from './hooks';
|
|
14
|
+
import {BasicRow} from './Row';
|
|
15
|
+
import type {GenericObject} from './Table';
|
|
16
|
+
|
|
17
|
+
import css from './Table.module.css';
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
export type GenericHeaderItem<T: GenericObject, U: GenericObject> = {
|
|
21
|
+
label: React.Node,
|
|
22
|
+
key: $Keys<T>,
|
|
23
|
+
className?: string,
|
|
24
|
+
filterIcon?: React.Node,
|
|
25
|
+
filtered?: boolean,
|
|
26
|
+
subtext?: string,
|
|
27
|
+
sortable?: boolean,
|
|
28
|
+
headerIconClassName?: string,
|
|
29
|
+
sticky?: boolean,
|
|
30
|
+
render?: React.ComponentType<{
|
|
31
|
+
data: T,
|
|
32
|
+
extras?: U,
|
|
33
|
+
className?: string,
|
|
34
|
+
selected?: boolean,
|
|
35
|
+
}>,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type GenericHeaderItems<T, U> = GenericHeaderItem<T, U>[];
|
|
39
|
+
|
|
40
|
+
export const BasicHeadCell: ClassNameComponent<'th'> = makeClassNameComponent(
|
|
41
|
+
css.defaultHeaderCell,
|
|
42
|
+
'th',
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
export const BasicTableHead: ClassNameComponent<'thead'> =
|
|
46
|
+
makeClassNameComponent(css.defaultTableHead, 'thead');
|
|
47
|
+
|
|
48
|
+
export type TableHeaderProps<T, U> = {
|
|
49
|
+
className?: string,
|
|
50
|
+
tableHeaderClassName?: string,
|
|
51
|
+
sortable?: boolean,
|
|
52
|
+
columns: GenericHeaderItems<T, U>,
|
|
53
|
+
handleSortClick?: (sortKey: $Keys<T>) => mixed,
|
|
54
|
+
sortKey?: $Keys<T>,
|
|
55
|
+
sortDirection?: SortDirection,
|
|
56
|
+
checked?: 'true' | 'false' | 'mixed',
|
|
57
|
+
handleCheckboxClick?: ({value: string, checked: boolean}) => mixed,
|
|
58
|
+
disabled?: boolean,
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const SortIcon = ({
|
|
62
|
+
sortDirection,
|
|
63
|
+
color,
|
|
64
|
+
className,
|
|
65
|
+
}: {
|
|
66
|
+
sortDirection: SortDirection,
|
|
67
|
+
className: string,
|
|
68
|
+
color: ColorTypes,
|
|
69
|
+
}) => {
|
|
70
|
+
if (sortDirection === 'original') {
|
|
71
|
+
return (
|
|
72
|
+
<Icon
|
|
73
|
+
color={color}
|
|
74
|
+
name="caret-down"
|
|
75
|
+
size="small"
|
|
76
|
+
type="solid"
|
|
77
|
+
className={className}
|
|
78
|
+
/>
|
|
79
|
+
);
|
|
80
|
+
} else if (sortDirection === 'asc') {
|
|
81
|
+
return (
|
|
82
|
+
<Icon
|
|
83
|
+
color={color}
|
|
84
|
+
name="arrow-up"
|
|
85
|
+
size="small"
|
|
86
|
+
type="regular"
|
|
87
|
+
className={className}
|
|
88
|
+
/>
|
|
89
|
+
);
|
|
90
|
+
} else if (sortDirection === 'desc') {
|
|
91
|
+
return (
|
|
92
|
+
<Icon
|
|
93
|
+
color={color}
|
|
94
|
+
name="arrow-down"
|
|
95
|
+
size="small"
|
|
96
|
+
type="regular"
|
|
97
|
+
className={className}
|
|
98
|
+
/>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export function DefaultTableHeader<T: GenericObject, U: GenericObject>(
|
|
104
|
+
props: TableHeaderProps<T, U>,
|
|
105
|
+
): React.Node {
|
|
106
|
+
const {
|
|
107
|
+
tableHeaderClassName,
|
|
108
|
+
className,
|
|
109
|
+
sortable = false,
|
|
110
|
+
columns,
|
|
111
|
+
handleSortClick,
|
|
112
|
+
sortKey,
|
|
113
|
+
sortDirection = 'original',
|
|
114
|
+
handleCheckboxClick,
|
|
115
|
+
checked,
|
|
116
|
+
disabled,
|
|
117
|
+
} = props;
|
|
118
|
+
|
|
119
|
+
const tableHeaderCells = () => (
|
|
120
|
+
<>
|
|
121
|
+
{columns.map((columnData, index) => {
|
|
122
|
+
const {
|
|
123
|
+
key,
|
|
124
|
+
label,
|
|
125
|
+
subtext,
|
|
126
|
+
filterIcon,
|
|
127
|
+
filtered,
|
|
128
|
+
className,
|
|
129
|
+
sticky,
|
|
130
|
+
sortable: columnSortable = false,
|
|
131
|
+
} = columnData;
|
|
132
|
+
let headerClassName;
|
|
133
|
+
const filterable = Boolean(filterIcon);
|
|
134
|
+
if ((sortable && columnSortable) || filterable) {
|
|
135
|
+
headerClassName = classify(
|
|
136
|
+
css.defaultHeaderCellSortable,
|
|
137
|
+
{
|
|
138
|
+
[css.filtered]: filtered,
|
|
139
|
+
[css.stickyHeaderCell]: sticky,
|
|
140
|
+
},
|
|
141
|
+
css[sortDirection],
|
|
142
|
+
className,
|
|
143
|
+
);
|
|
144
|
+
} else {
|
|
145
|
+
headerClassName = classify(className, {
|
|
146
|
+
[css.stickyHeaderCell]: sticky,
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const headCellClickHandler = () => {
|
|
151
|
+
if (sortable && columnSortable && handleSortClick) {
|
|
152
|
+
handleSortClick(key);
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
let columnSortDirection = 'original';
|
|
156
|
+
|
|
157
|
+
if (sortKey === key) {
|
|
158
|
+
columnSortDirection = sortDirection;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return (
|
|
162
|
+
<BasicHeadCell
|
|
163
|
+
className={classify(
|
|
164
|
+
{
|
|
165
|
+
[css.selectedHeader]:
|
|
166
|
+
sortKey === key && columnSortDirection !== 'original',
|
|
167
|
+
},
|
|
168
|
+
headerClassName,
|
|
169
|
+
)}
|
|
170
|
+
key={index}
|
|
171
|
+
scope="col"
|
|
172
|
+
onClick={headCellClickHandler}
|
|
173
|
+
>
|
|
174
|
+
<div className={classify(css.labelContents)}>
|
|
175
|
+
<div className={css.labelContainer}>
|
|
176
|
+
<SubTitleExtraSmall
|
|
177
|
+
color={TEXT_COLORS.secondary}
|
|
178
|
+
className={classify({
|
|
179
|
+
[css.selectedHeader]:
|
|
180
|
+
sortKey === key && columnSortDirection !== 'original',
|
|
181
|
+
})}
|
|
182
|
+
>
|
|
183
|
+
{label}
|
|
184
|
+
</SubTitleExtraSmall>
|
|
185
|
+
<span className={css.headerSubtext}>{subtext && subtext}</span>
|
|
186
|
+
</div>
|
|
187
|
+
{(sortable || filterIcon != null) && (
|
|
188
|
+
<div className={css.headerIconContainer}>
|
|
189
|
+
{columnSortable && (
|
|
190
|
+
<SortIcon
|
|
191
|
+
color={TEXT_COLORS.secondary}
|
|
192
|
+
className={classify(css.sortArrow, {
|
|
193
|
+
[css.selectedSortArrow]: sortKey === key,
|
|
194
|
+
})}
|
|
195
|
+
sortDirection={columnSortDirection}
|
|
196
|
+
/>
|
|
197
|
+
)}
|
|
198
|
+
{filterIcon != null && (
|
|
199
|
+
<div className={css.filterIcon}>{filterIcon}</div>
|
|
200
|
+
)}
|
|
201
|
+
</div>
|
|
202
|
+
)}
|
|
203
|
+
</div>
|
|
204
|
+
</BasicHeadCell>
|
|
205
|
+
);
|
|
206
|
+
})}
|
|
207
|
+
</>
|
|
208
|
+
);
|
|
209
|
+
|
|
210
|
+
return (
|
|
211
|
+
<BasicTableHead
|
|
212
|
+
className={classify(
|
|
213
|
+
css.tableHeaderSortable,
|
|
214
|
+
tableHeaderClassName,
|
|
215
|
+
className,
|
|
216
|
+
)}
|
|
217
|
+
>
|
|
218
|
+
<BasicRow className={css.defaultHeaderRow}>
|
|
219
|
+
{handleCheckboxClick && (
|
|
220
|
+
<BasicHeadCell scope="col">
|
|
221
|
+
<div className={css.checkbox}>
|
|
222
|
+
<Checkbox
|
|
223
|
+
value="all"
|
|
224
|
+
checked={checked === 'true' ? true : false}
|
|
225
|
+
indeterminate={checked === 'mixed'}
|
|
226
|
+
onChange={handleCheckboxClick}
|
|
227
|
+
disabled={disabled}
|
|
228
|
+
/>
|
|
229
|
+
</div>
|
|
230
|
+
</BasicHeadCell>
|
|
231
|
+
)}
|
|
232
|
+
{tableHeaderCells()}
|
|
233
|
+
</BasicRow>
|
|
234
|
+
</BasicTableHead>
|
|
235
|
+
);
|
|
236
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useSortableEntries = useSortableEntries;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _get = _interopRequireDefault(require("lodash/get"));
|
|
9
|
+
var _sortBy = _interopRequireDefault(require("lodash/sortBy"));
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
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); }
|
|
12
|
+
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; }
|
|
13
|
+
|
|
14
|
+
function useSortableEntries(entries, idName, _ref) {
|
|
15
|
+
let {
|
|
16
|
+
defaultSortKey = 'id',
|
|
17
|
+
defaultSortDirection = 'original',
|
|
18
|
+
onSort
|
|
19
|
+
} = _ref;
|
|
20
|
+
const [sortKey, setSortKey] = React.useState(defaultSortKey);
|
|
21
|
+
const [sortDirection, setSortDirection] = React.useState(defaultSortDirection);
|
|
22
|
+
const getNextDirection = direction => {
|
|
23
|
+
switch (direction) {
|
|
24
|
+
case 'original':
|
|
25
|
+
return 'desc';
|
|
26
|
+
case 'asc':
|
|
27
|
+
return 'original';
|
|
28
|
+
case 'desc':
|
|
29
|
+
return 'asc';
|
|
30
|
+
default:
|
|
31
|
+
return 'original';
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const advanceSortDirection = dir => {
|
|
35
|
+
const nextDirection = getNextDirection(dir);
|
|
36
|
+
setSortDirection(dir => nextDirection);
|
|
37
|
+
return nextDirection;
|
|
38
|
+
};
|
|
39
|
+
const handleSortClick = React.useCallback(nextSortKey => {
|
|
40
|
+
let nextSortDirection = sortDirection;
|
|
41
|
+
if (nextSortKey === sortKey) {
|
|
42
|
+
nextSortDirection = advanceSortDirection(sortDirection);
|
|
43
|
+
} else {
|
|
44
|
+
setSortKey(nextSortKey);
|
|
45
|
+
setSortDirection('desc');
|
|
46
|
+
}
|
|
47
|
+
onSort?.(nextSortKey, nextSortDirection);
|
|
48
|
+
}, [sortKey, sortDirection, entries]);
|
|
49
|
+
const sortedEntries = React.useMemo(() => {
|
|
50
|
+
if (sortDirection === 'original') {
|
|
51
|
+
return entries;
|
|
52
|
+
}
|
|
53
|
+
const sortedDesc = (0, _sortBy.default)(entries, sortKey);
|
|
54
|
+
if (sortDirection === 'asc') {
|
|
55
|
+
return sortedDesc;
|
|
56
|
+
} else {
|
|
57
|
+
return sortedDesc.reverse();
|
|
58
|
+
}
|
|
59
|
+
}, [sortDirection, sortKey, entries]);
|
|
60
|
+
const sortedKeys = React.useMemo(() => sortedEntries.map(ent => (0, _get.default)(ent, idName)), [sortedEntries]);
|
|
61
|
+
return {
|
|
62
|
+
sortedEntries,
|
|
63
|
+
sortedKeys,
|
|
64
|
+
sortDirection,
|
|
65
|
+
sortKey,
|
|
66
|
+
handleSortClick
|
|
67
|
+
};
|
|
68
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// @flow strict
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import get from 'lodash/get';
|
|
5
|
+
import sortBy from 'lodash/sortBy';
|
|
6
|
+
|
|
7
|
+
import type {GenericObject} from './Table';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export type SortDirection = 'asc' | 'desc' | 'original';
|
|
11
|
+
|
|
12
|
+
export function useSortableEntries<T: GenericObject>(
|
|
13
|
+
entries: Array<T>,
|
|
14
|
+
idName: $Keys<T>,
|
|
15
|
+
{
|
|
16
|
+
defaultSortKey = 'id',
|
|
17
|
+
defaultSortDirection = 'original',
|
|
18
|
+
onSort,
|
|
19
|
+
}: {
|
|
20
|
+
defaultSortKey?: $Keys<T>,
|
|
21
|
+
defaultSortDirection?: SortDirection,
|
|
22
|
+
onSort?: (sortKey: string, sortDirection: SortDirection) => mixed,
|
|
23
|
+
},
|
|
24
|
+
): {
|
|
25
|
+
handleSortClick: (sortKey: $Keys<T>) => mixed,
|
|
26
|
+
sortDirection: SortDirection,
|
|
27
|
+
sortKey?: string,
|
|
28
|
+
sortedEntries: T[],
|
|
29
|
+
sortedKeys: $Keys<T>[],
|
|
30
|
+
} {
|
|
31
|
+
const [sortKey, setSortKey] = React.useState(defaultSortKey);
|
|
32
|
+
const [sortDirection, setSortDirection] =
|
|
33
|
+
React.useState<SortDirection>(defaultSortDirection);
|
|
34
|
+
|
|
35
|
+
const getNextDirection = (direction: SortDirection): SortDirection => {
|
|
36
|
+
switch (direction) {
|
|
37
|
+
case 'original':
|
|
38
|
+
return 'desc';
|
|
39
|
+
case 'asc':
|
|
40
|
+
return 'original';
|
|
41
|
+
case 'desc':
|
|
42
|
+
return 'asc';
|
|
43
|
+
default:
|
|
44
|
+
return 'original';
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const advanceSortDirection = (dir: SortDirection) => {
|
|
48
|
+
const nextDirection = getNextDirection(dir);
|
|
49
|
+
setSortDirection((dir) => nextDirection);
|
|
50
|
+
return nextDirection;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const handleSortClick = React.useCallback(
|
|
54
|
+
(nextSortKey: string) => {
|
|
55
|
+
let nextSortDirection = sortDirection;
|
|
56
|
+
if (nextSortKey === sortKey) {
|
|
57
|
+
nextSortDirection = advanceSortDirection(sortDirection);
|
|
58
|
+
} else {
|
|
59
|
+
setSortKey(nextSortKey);
|
|
60
|
+
setSortDirection('desc');
|
|
61
|
+
}
|
|
62
|
+
onSort?.(nextSortKey, nextSortDirection);
|
|
63
|
+
},
|
|
64
|
+
[sortKey, sortDirection, entries],
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
const sortedEntries = React.useMemo(() => {
|
|
68
|
+
if (sortDirection === 'original') {
|
|
69
|
+
return entries;
|
|
70
|
+
}
|
|
71
|
+
const sortedDesc = sortBy(entries, sortKey);
|
|
72
|
+
if (sortDirection === 'asc') {
|
|
73
|
+
return sortedDesc;
|
|
74
|
+
} else {
|
|
75
|
+
return sortedDesc.reverse();
|
|
76
|
+
}
|
|
77
|
+
}, [sortDirection, sortKey, entries]);
|
|
78
|
+
|
|
79
|
+
const sortedKeys = React.useMemo(
|
|
80
|
+
() => sortedEntries.map((ent) => get(ent, idName)),
|
|
81
|
+
[sortedEntries],
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
return {
|
|
85
|
+
sortedEntries,
|
|
86
|
+
sortedKeys,
|
|
87
|
+
sortDirection,
|
|
88
|
+
sortKey,
|
|
89
|
+
handleSortClick,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "BasicSingleCell", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _Cell.BasicSingleCell;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "DateCell", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _Cell.DateCell;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "DefaultRow", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _Row.DefaultRow;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "DoubleCell", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _Cell.DoubleCell;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "Monogram", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _Cell.Monogram;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "MonogramCell", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _Cell.MonogramCell;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "SingleCell", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _Cell.SingleCell;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "StaticTable", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _StaticTable.StaticTable;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "Table", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _Table.Table;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
var _Cell = require("./Cell");
|
|
61
|
+
var _Row = require("./Row");
|
|
62
|
+
var _StaticTable = require("./StaticTable");
|
|
63
|
+
var _Table = require("./Table");
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// @flow strict
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
BasicSingleCell,
|
|
5
|
+
DateCell,
|
|
6
|
+
DoubleCell,
|
|
7
|
+
Monogram,
|
|
8
|
+
MonogramCell,
|
|
9
|
+
SingleCell,
|
|
10
|
+
} from './Cell';
|
|
11
|
+
export {DefaultRow} from './Row';
|
|
12
|
+
export {StaticTable} from './StaticTable';
|
|
13
|
+
export type {TableProps} from './Table';
|
|
14
|
+
export {Table} from './Table';
|
|
@@ -8,7 +8,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _size = require("../../../styles/variables/_size");
|
|
9
9
|
var _space = require("../../../styles/variables/_space");
|
|
10
10
|
var _classify = require("../../../utils/classify");
|
|
11
|
-
var _TabDropdown = require("./TabDropdown
|
|
11
|
+
var _TabDropdown = require("./TabDropdown");
|
|
12
12
|
var _TabListModule = _interopRequireDefault(require("./TabList.module.css"));
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
14
|
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); }
|
|
@@ -6,7 +6,7 @@ import {size36, size100} from '../../../styles/variables/_size';
|
|
|
6
6
|
import {spaceMedium} from '../../../styles/variables/_space';
|
|
7
7
|
import {classify} from '../../../utils/classify';
|
|
8
8
|
|
|
9
|
-
import {TabDropdown} from './TabDropdown
|
|
9
|
+
import {TabDropdown} from './TabDropdown';
|
|
10
10
|
|
|
11
11
|
import css from './TabList.module.css';
|
|
12
12
|
|
|
@@ -32,10 +32,14 @@
|
|
|
32
32
|
|
|
33
33
|
@value size42: 42px;
|
|
34
34
|
|
|
35
|
+
@value size48: 48px;
|
|
36
|
+
|
|
35
37
|
@value size58: 58px;
|
|
36
38
|
|
|
37
39
|
@value size60: 60px;
|
|
38
40
|
|
|
41
|
+
@value size90: 90px;
|
|
42
|
+
|
|
39
43
|
@value size100: 100px;
|
|
40
44
|
|
|
41
45
|
@value size110: 110px;
|
|
@@ -71,3 +75,5 @@
|
|
|
71
75
|
@value sizeFluid: 100%;
|
|
72
76
|
|
|
73
77
|
@value sizeFullViewportHeight: 100vh;
|
|
78
|
+
|
|
79
|
+
@value sizeFullViewportWidth: 100vw;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.sizeFullViewportHeight = exports.sizeFluid = exports.size960 = exports.size8 = exports.size720 = exports.size60 = exports.size580 = exports.size58 = exports.size500 = exports.size5 = exports.size480 = exports.size42 = exports.size400 = exports.size40 = exports.size4 = exports.size380 = exports.size38 = exports.size36 = exports.size34 = exports.size300 = exports.size30 = exports.size276 = exports.size260 = exports.size26 = exports.size240 = exports.size24 = exports.size228 = exports.size22 = exports.size20 = exports.size2 = exports.size18 = exports.size160 = exports.size140 = exports.size12 = exports.size110 = exports.size100 = exports.size10 = void 0;
|
|
6
|
+
exports.sizeFullViewportWidth = exports.sizeFullViewportHeight = exports.sizeFluid = exports.size960 = exports.size90 = exports.size8 = exports.size720 = exports.size60 = exports.size580 = exports.size58 = exports.size500 = exports.size5 = exports.size480 = exports.size48 = exports.size42 = exports.size400 = exports.size40 = exports.size4 = exports.size380 = exports.size38 = exports.size36 = exports.size34 = exports.size300 = exports.size30 = exports.size276 = exports.size260 = exports.size26 = exports.size240 = exports.size24 = exports.size228 = exports.size22 = exports.size20 = exports.size2 = exports.size18 = exports.size160 = exports.size140 = exports.size12 = exports.size110 = exports.size100 = exports.size10 = void 0;
|
|
7
7
|
|
|
8
8
|
const size2 = '2px';
|
|
9
9
|
exports.size2 = size2;
|
|
@@ -39,10 +39,14 @@ const size40 = '40px';
|
|
|
39
39
|
exports.size40 = size40;
|
|
40
40
|
const size42 = '42px';
|
|
41
41
|
exports.size42 = size42;
|
|
42
|
+
const size48 = '48px';
|
|
43
|
+
exports.size48 = size48;
|
|
42
44
|
const size58 = '58px';
|
|
43
45
|
exports.size58 = size58;
|
|
44
46
|
const size60 = '60px';
|
|
45
47
|
exports.size60 = size60;
|
|
48
|
+
const size90 = '90px';
|
|
49
|
+
exports.size90 = size90;
|
|
46
50
|
const size100 = '100px';
|
|
47
51
|
exports.size100 = size100;
|
|
48
52
|
const size110 = '110px';
|
|
@@ -78,4 +82,6 @@ exports.size960 = size960;
|
|
|
78
82
|
const sizeFluid = '100%';
|
|
79
83
|
exports.sizeFluid = sizeFluid;
|
|
80
84
|
const sizeFullViewportHeight = '100vh';
|
|
81
|
-
exports.sizeFullViewportHeight = sizeFullViewportHeight;
|
|
85
|
+
exports.sizeFullViewportHeight = sizeFullViewportHeight;
|
|
86
|
+
const sizeFullViewportWidth = '100vw';
|
|
87
|
+
exports.sizeFullViewportWidth = sizeFullViewportWidth;
|
|
@@ -34,10 +34,14 @@ export const size40 = '40px';
|
|
|
34
34
|
|
|
35
35
|
export const size42 = '42px';
|
|
36
36
|
|
|
37
|
+
export const size48 = '48px';
|
|
38
|
+
|
|
37
39
|
export const size58 = '58px';
|
|
38
40
|
|
|
39
41
|
export const size60 = '60px';
|
|
40
42
|
|
|
43
|
+
export const size90 = '90px';
|
|
44
|
+
|
|
41
45
|
export const size100 = '100px';
|
|
42
46
|
|
|
43
47
|
export const size110 = '110px';
|
|
@@ -73,3 +77,5 @@ export const size960 = '960px';
|
|
|
73
77
|
export const sizeFluid = '100%';
|
|
74
78
|
|
|
75
79
|
export const sizeFullViewportHeight = '100vh';
|
|
80
|
+
|
|
81
|
+
export const sizeFullViewportWidth = '100vw';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.makeClassNameComponent = makeClassNameComponent;
|
|
7
7
|
exports.makeClassNameComponentCustom = makeClassNameComponentCustom;
|
|
8
8
|
exports.nameHoc = nameHoc;
|
|
9
9
|
var React = _interopRequireWildcard(require("react"));
|
|
@@ -21,7 +21,7 @@ export type ClassNameComponent<
|
|
|
21
21
|
I = React.ElementRef<T>,
|
|
22
22
|
> = React.AbstractComponent<React.ElementConfig<T>, I>;
|
|
23
23
|
|
|
24
|
-
export
|
|
24
|
+
export function makeClassNameComponent<C: string>(
|
|
25
25
|
baseClassName: string,
|
|
26
26
|
// $FlowFixMe not sure how to type this correctly
|
|
27
27
|
ComponentType: C = 'div',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spaced-out/ui-design-system",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.40",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"description": "Sense UI components library",
|
|
6
6
|
"author": {
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@floating-ui/react-dom": "^1.0.0",
|
|
47
47
|
"@floating-ui/react-dom-interactions": "^0.10.1",
|
|
48
|
+
"date-fns": "^2.29.3",
|
|
48
49
|
"lodash": "^4.17.21"
|
|
49
50
|
},
|
|
50
51
|
"devDependencies": {
|
|
@@ -66,6 +67,7 @@
|
|
|
66
67
|
"@storybook/testing-react": "^1.3.0",
|
|
67
68
|
"@storybook/theming": "^6.5.13",
|
|
68
69
|
"@testing-library/react": "^11.2.7",
|
|
70
|
+
"all-contributors-cli": "^6.20.0",
|
|
69
71
|
"babel-eslint": "^10.1.0",
|
|
70
72
|
"babel-jest": "^28.1.3",
|
|
71
73
|
"babel-loader": "^8.2.5",
|
|
@@ -102,8 +104,7 @@
|
|
|
102
104
|
"standard-version": "^9.5.0",
|
|
103
105
|
"storybook-css-modules": "^1.0.8",
|
|
104
106
|
"storybook-vscode-component": "^1.0.8",
|
|
105
|
-
"style-dictionary": "^3.7.1"
|
|
106
|
-
"all-contributors-cli": "^6.20.0"
|
|
107
|
+
"style-dictionary": "^3.7.1"
|
|
107
108
|
},
|
|
108
109
|
"homepage": "https://spaced-out.github.io/ui-design-system",
|
|
109
110
|
"repository": {
|