onekijs-ui 0.18.2 → 0.19.0
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/dist/components/accordion/AccordionService.d.ts +2 -1
- package/dist/components/accordion/components/AccordionComponent.d.ts +1 -1
- package/dist/components/accordion/hooks/useAccordionPanel.d.ts +1 -1
- package/dist/components/accordion/index.d.ts +1 -1
- package/dist/components/accordion/typings.d.ts +5 -3
- package/dist/components/button/typings.d.ts +1 -0
- package/dist/components/icon/RefreshIcon.d.ts +4 -0
- package/dist/components/list/components/CollectionListComponent.d.ts +1 -1
- package/dist/components/list/components/ListBodyComponent.d.ts +1 -1
- package/dist/components/list/components/LoadingItem.d.ts +1 -0
- package/dist/components/list/components/VirtualListComponent.d.ts +1 -1
- package/dist/components/table/components/TableActionComponent.d.ts +3 -0
- package/dist/components/table/components/TableLoadingComponent.d.ts +1 -1
- package/dist/components/table/components/TableLoadingRowComponent.d.ts +2 -1
- package/dist/components/table/typings.d.ts +5 -0
- package/dist/index.js +190 -60
- package/dist/index.js.map +1 -1
- package/dist/index.module.js +190 -60
- package/dist/index.module.js.map +1 -1
- package/dist/styles/border.d.ts +1 -1
- package/dist/styles/size.d.ts +6 -6
- package/dist/styles/typings.d.ts +21 -7
- package/dist/styles/typography.d.ts +2 -2
- package/package.json +3 -3
- package/src/components/accordion/AccordionService.ts +21 -6
- package/src/components/accordion/components/AccordionComponent.tsx +2 -2
- package/src/components/accordion/components/AccordionPanel.tsx +6 -3
- package/src/components/accordion/hooks/useAccordionPanel.ts +2 -2
- package/src/components/accordion/index.ts +1 -1
- package/src/components/accordion/style.ts +2 -2
- package/src/components/accordion/typings.ts +5 -3
- package/src/components/button/style.ts +16 -7
- package/src/components/button/typings.ts +1 -0
- package/src/components/icon/RefreshIcon.tsx +41 -0
- package/src/components/list/components/CollectionListComponent.tsx +1 -1
- package/src/components/list/components/ListBodyComponent.tsx +18 -5
- package/src/components/list/components/LoadingItem.tsx +4 -2
- package/src/components/list/components/VirtualListComponent.tsx +2 -2
- package/src/components/list/hooks/useListView.tsx +4 -1
- package/src/components/notifications/components/NotificationsComponent.tsx +7 -1
- package/src/components/notifications/style.ts +13 -2
- package/src/components/select/components/SelectOptionComponent.tsx +4 -2
- package/src/components/table/components/ControllerTableComponent.tsx +38 -19
- package/src/components/table/components/TableActionComponent.tsx +22 -0
- package/src/components/table/components/TableBodyComponent.tsx +12 -4
- package/src/components/table/components/TableBodyRowComponent.tsx +15 -14
- package/src/components/table/components/TableLoadingComponent.tsx +1 -1
- package/src/components/table/components/TableLoadingRowComponent.tsx +7 -3
- package/src/components/table/style.ts +16 -1
- package/src/components/table/typings.ts +5 -0
- package/src/styles/typings.ts +21 -7
- package/src/theme/base.tsx +21 -7
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import React, { useEffect, useMemo, useRef } from 'react';
|
|
1
|
+
import React, { useEffect, useId, useMemo, useRef } from 'react';
|
|
2
2
|
import { addClassname } from '../../../utils/style';
|
|
3
3
|
import { TableConfigContext } from '../hooks/useTableConfig';
|
|
4
4
|
import { TableServiceContext } from '../hooks/useTableService';
|
|
5
5
|
import { TableStateContext } from '../hooks/useTableState';
|
|
6
6
|
import { ControllerTableProps, TableConfig } from '../typings';
|
|
7
|
+
import TableActionComponent from './TableActionComponent';
|
|
7
8
|
import TableBodyComponent from './TableBodyComponent';
|
|
8
9
|
import TableFooterComponent from './TableFooterComponent';
|
|
9
10
|
import TableHeaderComponent from './TableHeaderComponent';
|
|
10
11
|
import ExpandedCellComponent from './cells/ExpandedCellComponent';
|
|
11
12
|
|
|
12
13
|
const ControllerTableComponent: React.FC<ControllerTableProps> = ({
|
|
14
|
+
ActionComponent = TableActionComponent,
|
|
13
15
|
autoRefresh,
|
|
14
16
|
controller,
|
|
15
17
|
className,
|
|
@@ -27,6 +29,7 @@ const ControllerTableComponent: React.FC<ControllerTableProps> = ({
|
|
|
27
29
|
headerClassName,
|
|
28
30
|
HeaderComponent = TableHeaderComponent,
|
|
29
31
|
increment,
|
|
32
|
+
itemHeight,
|
|
30
33
|
LoadingComponent,
|
|
31
34
|
LoadingRowComponent,
|
|
32
35
|
NotFoundComponent,
|
|
@@ -42,8 +45,10 @@ const ControllerTableComponent: React.FC<ControllerTableProps> = ({
|
|
|
42
45
|
paddingStart,
|
|
43
46
|
parentRef,
|
|
44
47
|
preload,
|
|
48
|
+
refreshButtonKind = 'primary',
|
|
45
49
|
rowClassName,
|
|
46
50
|
RowComponent,
|
|
51
|
+
showRefreshButton,
|
|
47
52
|
sortable,
|
|
48
53
|
stripRows,
|
|
49
54
|
tail,
|
|
@@ -57,6 +62,7 @@ const ControllerTableComponent: React.FC<ControllerTableProps> = ({
|
|
|
57
62
|
|
|
58
63
|
const config: TableConfig = useMemo(() => {
|
|
59
64
|
return {
|
|
65
|
+
ActionComponent,
|
|
60
66
|
autoRefresh,
|
|
61
67
|
bodyClassName,
|
|
62
68
|
BodyComponent,
|
|
@@ -76,6 +82,7 @@ const ControllerTableComponent: React.FC<ControllerTableProps> = ({
|
|
|
76
82
|
height,
|
|
77
83
|
highlightRow,
|
|
78
84
|
increment,
|
|
85
|
+
itemHeight,
|
|
79
86
|
LoadingComponent,
|
|
80
87
|
LoadingRowComponent,
|
|
81
88
|
NotFoundComponent,
|
|
@@ -88,13 +95,16 @@ const ControllerTableComponent: React.FC<ControllerTableProps> = ({
|
|
|
88
95
|
paddingStart,
|
|
89
96
|
parentRef,
|
|
90
97
|
preload,
|
|
98
|
+
refreshButtonKind,
|
|
91
99
|
rowClassName,
|
|
92
100
|
RowComponent,
|
|
101
|
+
showRefreshButton,
|
|
93
102
|
sortable,
|
|
94
103
|
stripRows,
|
|
95
|
-
tail
|
|
104
|
+
tail,
|
|
96
105
|
};
|
|
97
106
|
}, [
|
|
107
|
+
ActionComponent,
|
|
98
108
|
autoRefresh,
|
|
99
109
|
bodyClassName,
|
|
100
110
|
BodyComponent,
|
|
@@ -114,6 +124,7 @@ const ControllerTableComponent: React.FC<ControllerTableProps> = ({
|
|
|
114
124
|
height,
|
|
115
125
|
highlightRow,
|
|
116
126
|
increment,
|
|
127
|
+
itemHeight,
|
|
117
128
|
LoadingComponent,
|
|
118
129
|
LoadingRowComponent,
|
|
119
130
|
NotFoundComponent,
|
|
@@ -126,8 +137,10 @@ const ControllerTableComponent: React.FC<ControllerTableProps> = ({
|
|
|
126
137
|
paddingStart,
|
|
127
138
|
parentRef,
|
|
128
139
|
preload,
|
|
140
|
+
refreshButtonKind,
|
|
129
141
|
rowClassName,
|
|
130
142
|
RowComponent,
|
|
143
|
+
showRefreshButton,
|
|
131
144
|
sortable,
|
|
132
145
|
stripRows,
|
|
133
146
|
tail,
|
|
@@ -154,27 +167,33 @@ const ControllerTableComponent: React.FC<ControllerTableProps> = ({
|
|
|
154
167
|
}
|
|
155
168
|
}, [service, ExpandedComponent]);
|
|
156
169
|
|
|
170
|
+
const id = useId();
|
|
171
|
+
|
|
157
172
|
return (
|
|
158
173
|
<TableServiceContext.Provider value={controller.asService()}>
|
|
159
174
|
<TableStateContext.Provider value={controller.state}>
|
|
160
175
|
<TableConfigContext.Provider value={config}>
|
|
161
|
-
<div
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
columns={columns}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
176
|
+
<div className={className}>
|
|
177
|
+
<ActionComponent />
|
|
178
|
+
<div
|
|
179
|
+
id={id}
|
|
180
|
+
className={classNames}
|
|
181
|
+
ref={tableRef}
|
|
182
|
+
style={{
|
|
183
|
+
maxHeight: height,
|
|
184
|
+
overflow: 'auto',
|
|
185
|
+
}}
|
|
186
|
+
>
|
|
187
|
+
{header && <HeaderComponent columns={columns} className={headerClassName} />}
|
|
188
|
+
<BodyComponent
|
|
189
|
+
items={items || []}
|
|
190
|
+
columns={columns}
|
|
191
|
+
tableRef={tableRef}
|
|
192
|
+
contentRef={contentRef}
|
|
193
|
+
className={bodyClassName}
|
|
194
|
+
/>
|
|
195
|
+
{footer && <FooterComponent columns={columns} className={footerClassName} />}
|
|
196
|
+
</div>
|
|
178
197
|
</div>
|
|
179
198
|
</TableConfigContext.Provider>
|
|
180
199
|
</TableStateContext.Provider>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import RefreshIcon from '../../icon/RefreshIcon';
|
|
2
|
+
import { useTableConfig } from '../hooks/useTableConfig';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import useTableService from '../hooks/useTableService';
|
|
5
|
+
import Button from '../../button';
|
|
6
|
+
|
|
7
|
+
const TableActionComponent: React.FC = () => {
|
|
8
|
+
const { showRefreshButton, refreshButtonKind } = useTableConfig();
|
|
9
|
+
const table = useTableService();
|
|
10
|
+
return (
|
|
11
|
+
<div className="o-table-actions">
|
|
12
|
+
<div className="o-table-action">
|
|
13
|
+
|
|
14
|
+
</div>
|
|
15
|
+
{showRefreshButton && <div className="o-table-refresh">
|
|
16
|
+
<Button kind={refreshButtonKind} size="small" IconComponent={() => <RefreshIcon />} onClick={() => table.reload()}>Refresh</Button>
|
|
17
|
+
</div>}
|
|
18
|
+
</div>
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default TableActionComponent;
|
|
@@ -12,6 +12,7 @@ import { TableBodyProps } from '../typings';
|
|
|
12
12
|
import TableBodyRowComponent from './TableBodyRowComponent';
|
|
13
13
|
import TableLoadingComponent from './TableLoadingComponent';
|
|
14
14
|
import TableNotFoundComponent from './TableNotFoundComponent';
|
|
15
|
+
import TableLoadingRowComponent from './TableLoadingRowComponent';
|
|
15
16
|
|
|
16
17
|
const TableBodyComponent: React.FC<TableBodyProps> = ({ className, tableRef, contentRef }) => {
|
|
17
18
|
const service = useTableService();
|
|
@@ -20,6 +21,7 @@ const TableBodyComponent: React.FC<TableBodyProps> = ({ className, tableRef, con
|
|
|
20
21
|
autoRefresh,
|
|
21
22
|
follow,
|
|
22
23
|
height,
|
|
24
|
+
itemHeight,
|
|
23
25
|
increment,
|
|
24
26
|
onRowClick,
|
|
25
27
|
onRowEnter,
|
|
@@ -32,18 +34,23 @@ const TableBodyComponent: React.FC<TableBodyProps> = ({ className, tableRef, con
|
|
|
32
34
|
rowClassName,
|
|
33
35
|
LoadingComponent = TableLoadingComponent,
|
|
34
36
|
NotFoundComponent = TableNotFoundComponent,
|
|
37
|
+
LoadingRowComponent = TableLoadingRowComponent,
|
|
35
38
|
tail,
|
|
36
39
|
} = useTableConfig();
|
|
37
40
|
|
|
38
|
-
const
|
|
39
|
-
|
|
41
|
+
const itemHeightFunction = useCallback((index: number) => {
|
|
42
|
+
if (typeof itemHeight === 'function') {
|
|
43
|
+
return itemHeight(index);
|
|
44
|
+
}
|
|
45
|
+
return itemHeight || 37;
|
|
40
46
|
}, []);
|
|
47
|
+
|
|
41
48
|
const { items, isVirtual, totalSize, virtualItems, measure, scrollToIndex } = useListView({
|
|
42
49
|
controller: service,
|
|
43
50
|
height: height,
|
|
44
51
|
ref: parentRef || tableRef,
|
|
45
52
|
overscan: 10,
|
|
46
|
-
itemHeight,
|
|
53
|
+
itemHeight: itemHeightFunction,
|
|
47
54
|
paddingEnd,
|
|
48
55
|
paddingStart,
|
|
49
56
|
preload,
|
|
@@ -55,7 +62,7 @@ const TableBodyComponent: React.FC<TableBodyProps> = ({ className, tableRef, con
|
|
|
55
62
|
const columns = useTableColumns();
|
|
56
63
|
const className =
|
|
57
64
|
typeof rowClassName === 'function' ? rowClassName(props.item, props.index, columns) : rowClassName;
|
|
58
|
-
|
|
65
|
+
return (
|
|
59
66
|
<RowComponent
|
|
60
67
|
{...props}
|
|
61
68
|
columns={columns}
|
|
@@ -88,6 +95,7 @@ const TableBodyComponent: React.FC<TableBodyProps> = ({ className, tableRef, con
|
|
|
88
95
|
follow={follow}
|
|
89
96
|
height={height}
|
|
90
97
|
ItemComponent={ItemComponentRef.current}
|
|
98
|
+
ItemLoadingComponent={LoadingRowComponent}
|
|
91
99
|
items={items}
|
|
92
100
|
onItemSelect={onRowClick}
|
|
93
101
|
onItemHighlight={onRowEnter}
|
|
@@ -9,19 +9,20 @@ import TableLoadingRowComponent from './TableLoadingRowComponent';
|
|
|
9
9
|
|
|
10
10
|
const timeout = 500;
|
|
11
11
|
|
|
12
|
-
const TableBodyRowComponent: FC<TableBodyRowProps> = ({
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
12
|
+
const TableBodyRowComponent: FC<TableBodyRowProps> = (props) => {
|
|
13
|
+
const {
|
|
14
|
+
item,
|
|
15
|
+
index,
|
|
16
|
+
columns,
|
|
17
|
+
CellComponent = TableBodyCellComponent,
|
|
18
|
+
className,
|
|
19
|
+
onExpand,
|
|
20
|
+
onExpanding,
|
|
21
|
+
onExpanded,
|
|
22
|
+
onCollapse,
|
|
23
|
+
onCollapsing,
|
|
24
|
+
onCollapsed,
|
|
25
|
+
} = props;
|
|
25
26
|
const [hover, setHover] = useState(false);
|
|
26
27
|
const {
|
|
27
28
|
highlightRow,
|
|
@@ -69,7 +70,7 @@ const TableBodyRowComponent: FC<TableBodyRowProps> = ({
|
|
|
69
70
|
return (
|
|
70
71
|
<div className={rowContainerClassName}>
|
|
71
72
|
<div className="o-table-body-row">
|
|
72
|
-
<LoadingRowComponent />
|
|
73
|
+
<LoadingRowComponent {...props} />
|
|
73
74
|
</div>
|
|
74
75
|
</div>
|
|
75
76
|
);
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import LoadingIcon from '../../icon/LoadingIcon';
|
|
4
4
|
|
|
5
|
-
const TableLoadingComponent: React.FC
|
|
5
|
+
const TableLoadingComponent: React.FC = (props) => {
|
|
6
6
|
return (
|
|
7
7
|
<div {...props}>
|
|
8
8
|
<LoadingIcon width="50px" height="50px" />
|
|
@@ -3,12 +3,16 @@ import styled, { css } from 'styled-components';
|
|
|
3
3
|
import { minHeight, width } from '../../../styles/size';
|
|
4
4
|
import { ComponentStyle } from '../../../styles/typings';
|
|
5
5
|
import LoadingItem from '../../list/components/LoadingItem';
|
|
6
|
+
import { TableBodyRowProps } from '../typings';
|
|
7
|
+
import { useTableConfig } from '../hooks/useTableConfig';
|
|
6
8
|
|
|
7
|
-
const TableLoadingRowComponent: React.FC<
|
|
8
|
-
|
|
9
|
+
const TableLoadingRowComponent: React.FC<TableBodyRowProps>= (props) => {
|
|
10
|
+
const { itemHeight } = useTableConfig();
|
|
11
|
+
const minHeight = typeof itemHeight === 'function' ? itemHeight(props.index) : itemHeight
|
|
12
|
+
return <LoadingItem {...props} minHeight={minHeight} />;
|
|
9
13
|
};
|
|
10
14
|
|
|
11
|
-
const style: ComponentStyle<
|
|
15
|
+
const style: ComponentStyle<TableBodyRowProps> = ({ theme }) => {
|
|
12
16
|
const t = theme.table;
|
|
13
17
|
return css`
|
|
14
18
|
${minHeight(t.loadingRowMinHeight)}
|
|
@@ -11,13 +11,14 @@ import {
|
|
|
11
11
|
boxShadow,
|
|
12
12
|
} from '../../styles/border';
|
|
13
13
|
import { display, visibility } from '../../styles/display';
|
|
14
|
-
import { flexDirection } from '../../styles/flex';
|
|
14
|
+
import { flexDirection, flexGrow } from '../../styles/flex';
|
|
15
15
|
import { boxSizing, cursor, outline, userSelect } from '../../styles/interactivity';
|
|
16
16
|
import { overflow, overflowX, overflowY } from '../../styles/overflow';
|
|
17
17
|
import { height, minWidth, width } from '../../styles/size';
|
|
18
18
|
import {
|
|
19
19
|
marginBottom,
|
|
20
20
|
marginLeft,
|
|
21
|
+
marginRight,
|
|
21
22
|
marginTop,
|
|
22
23
|
padding,
|
|
23
24
|
paddingBottom,
|
|
@@ -78,6 +79,18 @@ export const tableStyle: ComponentStyle<TableProps<any>> = ({ theme, fit = true
|
|
|
78
79
|
${() => (fit ? 'flex-grow: 1;' : '')}
|
|
79
80
|
}
|
|
80
81
|
|
|
82
|
+
.o-table-actions {
|
|
83
|
+
${display('flex')}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.o-table-action {
|
|
87
|
+
${flexGrow(1)}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.o-table-refresh {
|
|
91
|
+
${marginBottom('sm')}
|
|
92
|
+
${marginRight('xl')}
|
|
93
|
+
}
|
|
81
94
|
|
|
82
95
|
.o-table-not-found {
|
|
83
96
|
${display('flex')}
|
|
@@ -99,6 +112,7 @@ export const tableStyle: ComponentStyle<TableProps<any>> = ({ theme, fit = true
|
|
|
99
112
|
${borderBottomStyle(t.tdBorderBottomStyle)}
|
|
100
113
|
}
|
|
101
114
|
.o-table-body-row-expanded {
|
|
115
|
+
${fontSize('default')}
|
|
102
116
|
.o-table-body-row {
|
|
103
117
|
${backgroundColor(t.tdExpandedBgColor)}
|
|
104
118
|
}
|
|
@@ -300,6 +314,7 @@ export const tableStyle: ComponentStyle<TableProps<any>> = ({ theme, fit = true
|
|
|
300
314
|
|
|
301
315
|
|
|
302
316
|
&.o-form-table {
|
|
317
|
+
${flexGrow(1)}
|
|
303
318
|
${boxShadow('none')}
|
|
304
319
|
${paddingRight('none')}
|
|
305
320
|
.o-table-body-row:hover {
|
|
@@ -21,6 +21,7 @@ import { ListItemProps, ListItems, ListNotFoundProps, ListState, UseListOptions
|
|
|
21
21
|
import { FormSelectProps, SelectBroker, SelectItem, SelectProps } from '../select/typings';
|
|
22
22
|
import { TextareaProps } from '../textarea/typings';
|
|
23
23
|
import TableService from './TableService';
|
|
24
|
+
import { ButtonProps } from '../button/typings';
|
|
24
25
|
|
|
25
26
|
export type ArrayTableProps<T = any, I extends TableItem<T> = TableItem<T>> = TableConfig<T, I> & {
|
|
26
27
|
adapter?: TableItemAdapter<T>;
|
|
@@ -105,6 +106,7 @@ export type TableBodyRowProps<T = any, I extends TableItem<T> = TableItem<T>> =
|
|
|
105
106
|
};
|
|
106
107
|
|
|
107
108
|
export type TableConfig<T = any, I extends TableItem<T> = TableItem<T>> = {
|
|
109
|
+
ActionComponent?: React.FC;
|
|
108
110
|
autoRefresh?: number;
|
|
109
111
|
bodyClassName?: string;
|
|
110
112
|
BodyComponent?: React.FC<TableBodyProps<T, I>>;
|
|
@@ -124,6 +126,7 @@ export type TableConfig<T = any, I extends TableItem<T> = TableItem<T>> = {
|
|
|
124
126
|
height?: string | number;
|
|
125
127
|
highlightRow?: boolean;
|
|
126
128
|
increment?: number;
|
|
129
|
+
itemHeight?: number | ((index: number) => number);
|
|
127
130
|
LoadingComponent?: React.FC;
|
|
128
131
|
LoadingRowComponent?: React.FC;
|
|
129
132
|
NotFoundComponent?: React.FC<TableNotFoundProps> | null;
|
|
@@ -138,6 +141,8 @@ export type TableConfig<T = any, I extends TableItem<T> = TableItem<T>> = {
|
|
|
138
141
|
preload?: number;
|
|
139
142
|
rowClassName?: string | ((item: I | undefined, rowIndex: number, columns: TableColumn<T, I>[]) => string);
|
|
140
143
|
RowComponent?: React.FC<TableBodyRowProps<T, I>>;
|
|
144
|
+
refreshButtonKind?: ButtonProps['kind'];
|
|
145
|
+
showRefreshButton?: boolean;
|
|
141
146
|
sortable?: boolean;
|
|
142
147
|
stripRows?: boolean;
|
|
143
148
|
tail?: boolean;
|
package/src/styles/typings.ts
CHANGED
|
@@ -256,15 +256,21 @@ export type Theme = {
|
|
|
256
256
|
borderColor: ColorPropertyTheme | Property.BorderColor;
|
|
257
257
|
borderColorFlat: ColorPropertyTheme | Property.BackgroundColor;
|
|
258
258
|
borderColorOutline: ColorPropertyTheme | Property.BackgroundColor;
|
|
259
|
-
|
|
259
|
+
borderRadiusMedium: RadiusPropertyTheme | string;
|
|
260
|
+
borderRadiusSmall: RadiusPropertyTheme | string;
|
|
261
|
+
borderRadiusLarge: RadiusPropertyTheme | string;
|
|
260
262
|
borderStyle: Property.BorderStyle;
|
|
261
|
-
|
|
263
|
+
borderWidthSmall: Property.BorderWidth<TLength>;
|
|
264
|
+
borderWidthMedium: Property.BorderWidth<TLength>;
|
|
265
|
+
borderWidthLarge: Property.BorderWidth<TLength>;
|
|
262
266
|
color: ColorPropertyTheme | Property.Color;
|
|
263
267
|
colorFlat: ColorPropertyTheme | Property.BackgroundColor;
|
|
264
268
|
colorOutline: ColorPropertyTheme | Property.BackgroundColor;
|
|
265
269
|
cursor: Property.Cursor;
|
|
266
270
|
cursorDisabled: Property.Cursor;
|
|
267
|
-
|
|
271
|
+
fontSizeMedium: FontSizePropertyTheme | Property.FontSize<TLength>;
|
|
272
|
+
fontSmallSize: FontSizePropertyTheme | Property.FontSize<TLength>;
|
|
273
|
+
fontLargeSize: FontSizePropertyTheme | Property.FontSize<TLength>;
|
|
268
274
|
fontWeight: FontWeightPropertyTheme | Property.FontWeight;
|
|
269
275
|
hoverBgColor: ColorPropertyTheme | Property.BackgroundColor;
|
|
270
276
|
hoverBgColorFlat: ColorPropertyTheme | Property.BackgroundColor;
|
|
@@ -275,12 +281,20 @@ export type Theme = {
|
|
|
275
281
|
hoverColor: ColorPropertyTheme | Property.Color;
|
|
276
282
|
hoverColorFlat: ColorPropertyTheme | Property.BackgroundColor;
|
|
277
283
|
hoverColorOutline: ColorPropertyTheme | Property.BackgroundColor;
|
|
278
|
-
|
|
279
|
-
|
|
284
|
+
letterSpacingSmall: LetterSpacingPropertyTheme | Property.LetterSpacing<TLength>;
|
|
285
|
+
letterSpacingMedium: LetterSpacingPropertyTheme | Property.LetterSpacing<TLength>;
|
|
286
|
+
letterSpacingLarge: LetterSpacingPropertyTheme | Property.LetterSpacing<TLength>;
|
|
287
|
+
lineHeightSmall: LineHeightPropertyTheme | Property.LineHeight<TLength>;
|
|
288
|
+
lineHeightMedium: LineHeightPropertyTheme | Property.LineHeight<TLength>;
|
|
289
|
+
lineHeightLarge: LineHeightPropertyTheme | Property.LineHeight<TLength>;
|
|
280
290
|
opacity: Property.Opacity;
|
|
281
291
|
opacityDisabled: Property.Opacity;
|
|
282
|
-
|
|
283
|
-
|
|
292
|
+
paddingYMedium: SpacingPropertyTheme | Property.Padding<TLength>;
|
|
293
|
+
paddingXMedium: SpacingPropertyTheme | Property.Padding<TLength>;
|
|
294
|
+
paddingYSmall: SpacingPropertyTheme | Property.Padding<TLength>;
|
|
295
|
+
paddingXSmall: SpacingPropertyTheme | Property.Padding<TLength>;
|
|
296
|
+
paddingYLarge: SpacingPropertyTheme | Property.Padding<TLength>;
|
|
297
|
+
paddingXLarge: SpacingPropertyTheme | Property.Padding<TLength>;
|
|
284
298
|
textOverflow: Property.TextOverflow;
|
|
285
299
|
textTransform: Property.TextTransform;
|
|
286
300
|
whiteSpace: Property.WhiteSpace;
|
package/src/theme/base.tsx
CHANGED
|
@@ -484,15 +484,21 @@ export const baseTheme = (customTheme: Partial<Theme> = {}): Theme => {
|
|
|
484
484
|
borderColor: kind,
|
|
485
485
|
borderColorFlat: 'transparent',
|
|
486
486
|
borderColorOutline: kind,
|
|
487
|
-
|
|
487
|
+
borderRadiusMedium: 'sm',
|
|
488
|
+
borderRadiusSmall: 'sm',
|
|
489
|
+
borderRadiusLarge: 'sm',
|
|
488
490
|
borderStyle: 'solid',
|
|
489
|
-
|
|
491
|
+
borderWidthSmall: 1,
|
|
492
|
+
borderWidthMedium: 1,
|
|
493
|
+
borderWidthLarge: 1,
|
|
490
494
|
color: ['light', 'lightest', 'lighter', 'white'].includes(kind) ? 'darker' : 'white',
|
|
491
495
|
colorFlat: kind,
|
|
492
496
|
colorOutline: ['light', 'lightest', 'lighter', 'white'].includes(kind) ? 'darkest' : kind,
|
|
493
497
|
cursor: 'pointer',
|
|
494
498
|
cursorDisabled: 'not-allowed',
|
|
495
|
-
|
|
499
|
+
fontSizeMedium: 'md',
|
|
500
|
+
fontSizeSmall: 'sm',
|
|
501
|
+
fontSizeLarge: 'lg',
|
|
496
502
|
fontWeight: 'bold',
|
|
497
503
|
hoverColor: ['light', 'lightest', 'lighter', 'white'].includes(kind) ? 'black' : 'white',
|
|
498
504
|
hoverColorFlat: lighten(get<any>(theme.colors, kind, ''), 100),
|
|
@@ -503,12 +509,20 @@ export const baseTheme = (customTheme: Partial<Theme> = {}): Theme => {
|
|
|
503
509
|
hoverBorderColor: darken(get<any>(theme.colors, kind, ''), 100),
|
|
504
510
|
hoverBorderColorFlat: 'transparent',
|
|
505
511
|
hoverBorderColorOutline: kind,
|
|
506
|
-
|
|
507
|
-
|
|
512
|
+
letterSpacingMedium: 'normal',
|
|
513
|
+
letterSpacingSmall: 'normal',
|
|
514
|
+
letterSpacingLarge: 'normal',
|
|
515
|
+
lineHeightMedium: '3xl',
|
|
516
|
+
lineHeightSmall: '2xl',
|
|
517
|
+
lineHeightLarge: '4xl',
|
|
508
518
|
opacity: 1,
|
|
509
519
|
opacityDisabled: 0.6,
|
|
510
|
-
|
|
511
|
-
|
|
520
|
+
paddingYMedium: 'none',
|
|
521
|
+
paddingYSmall: 'none',
|
|
522
|
+
paddingYLarge: 'none',
|
|
523
|
+
paddingXMedium: 'lg',
|
|
524
|
+
paddingXSmall: 'md',
|
|
525
|
+
paddingXLarge: 'xl',
|
|
512
526
|
textOverflow: 'ellipsis',
|
|
513
527
|
textTransform: 'none',
|
|
514
528
|
whiteSpace: 'nowrap',
|