@bolio-ui/core 1.1.7 → 1.1.8
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/README.md +0 -4
- package/package.json +26 -24
- package/esm/Avatar/stories.js +0 -113
- package/esm/Badge/stories.js +0 -92
- package/esm/Breadcrumbs/stories.js +0 -51
- package/esm/Button/stories.js +0 -221
- package/esm/ButtonDropdown/stories.js +0 -92
- package/esm/ButtonGroup/stories.js +0 -66
- package/esm/Capacity/stories.js +0 -85
- package/esm/Card/stories.js +0 -175
- package/esm/Checkbox/stories.js +0 -84
- package/esm/Code/stories.js +0 -53
- package/esm/Collapse/stories.js +0 -48
- package/esm/Description/stories.js +0 -23
- package/esm/Divider/stories.js +0 -41
- package/esm/Dot/stories.js +0 -40
- package/esm/Drawer/stories.js +0 -79
- package/esm/Fieldset/stories.js +0 -72
- package/esm/Grid/stories.js +0 -212
- package/esm/Icon/stories.js +0 -36
- package/esm/Image/stories.js +0 -73
- package/esm/Input/stories.js +0 -145
- package/esm/Keyboard/stories.js +0 -43
- package/esm/Link/stories.js +0 -59
- package/esm/Loading/stories.js +0 -75
- package/esm/Modal/stories.js +0 -165
- package/esm/Note/stories.js +0 -68
- package/esm/Page/stories.js +0 -54
- package/esm/Pagination/stories.js +0 -49
- package/esm/Popover/stories.js +0 -84
- package/esm/Progress/stories.js +0 -114
- package/esm/Radio/stories.js +0 -98
- package/esm/Rating/stories.js +0 -72
- package/esm/Select/stories.js +0 -239
- package/esm/Slider/stories.js +0 -134
- package/esm/Snippet/stories.js +0 -177
- package/esm/Spacer/stories.js +0 -54
- package/esm/Spinner/stories.js +0 -13
- package/esm/Table/stories.js +0 -269
- package/esm/Tabs/stories.js +0 -92
- package/esm/Tag/stories.js +0 -58
- package/esm/Text/stories.js +0 -104
- package/esm/Textarea/stories.js +0 -104
- package/esm/Toggle/stories.js +0 -55
- package/esm/Tooltip/stories.js +0 -183
- package/examples/create-redwoodjs/.redwood/README.md +0 -44
package/esm/Slider/stories.js
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import React, { useState } from 'react';
|
|
3
|
-
import Slider from '.';
|
|
4
|
-
import Grid from '../Grid';
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Data Entry/Slider',
|
|
7
|
-
component: Slider
|
|
8
|
-
};
|
|
9
|
-
export var Default = function Default() {
|
|
10
|
-
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
11
|
-
gap: 2
|
|
12
|
-
}, /*#__PURE__*/React.createElement(Grid, {
|
|
13
|
-
xs: 12,
|
|
14
|
-
md: 12
|
|
15
|
-
}, /*#__PURE__*/React.createElement(Slider, {
|
|
16
|
-
initialValue: 40
|
|
17
|
-
})));
|
|
18
|
-
};
|
|
19
|
-
export var Type = function Type() {
|
|
20
|
-
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
21
|
-
gap: 2
|
|
22
|
-
}, /*#__PURE__*/React.createElement(Grid, {
|
|
23
|
-
xs: 12,
|
|
24
|
-
md: 12
|
|
25
|
-
}, /*#__PURE__*/React.createElement(Slider, {
|
|
26
|
-
initialValue: 40
|
|
27
|
-
})), /*#__PURE__*/React.createElement(Grid, {
|
|
28
|
-
xs: 12,
|
|
29
|
-
md: 12
|
|
30
|
-
}, /*#__PURE__*/React.createElement(Slider, {
|
|
31
|
-
type: "primary",
|
|
32
|
-
initialValue: 20
|
|
33
|
-
})), /*#__PURE__*/React.createElement(Grid, {
|
|
34
|
-
xs: 12,
|
|
35
|
-
md: 12
|
|
36
|
-
}, /*#__PURE__*/React.createElement(Slider, {
|
|
37
|
-
type: "secondary",
|
|
38
|
-
initialValue: 70
|
|
39
|
-
})), /*#__PURE__*/React.createElement(Grid, {
|
|
40
|
-
xs: 12,
|
|
41
|
-
md: 12
|
|
42
|
-
}, /*#__PURE__*/React.createElement(Slider, {
|
|
43
|
-
type: "success",
|
|
44
|
-
initialValue: 60
|
|
45
|
-
})), /*#__PURE__*/React.createElement(Grid, {
|
|
46
|
-
xs: 12,
|
|
47
|
-
md: 12
|
|
48
|
-
}, /*#__PURE__*/React.createElement(Slider, {
|
|
49
|
-
type: "warning",
|
|
50
|
-
initialValue: 10
|
|
51
|
-
})), /*#__PURE__*/React.createElement(Grid, {
|
|
52
|
-
xs: 12,
|
|
53
|
-
md: 12
|
|
54
|
-
}, /*#__PURE__*/React.createElement(Slider, {
|
|
55
|
-
type: "error",
|
|
56
|
-
initialValue: 80
|
|
57
|
-
})), /*#__PURE__*/React.createElement(Grid, {
|
|
58
|
-
xs: 12,
|
|
59
|
-
md: 12
|
|
60
|
-
}, /*#__PURE__*/React.createElement(Slider, {
|
|
61
|
-
type: "info",
|
|
62
|
-
initialValue: 90
|
|
63
|
-
})));
|
|
64
|
-
};
|
|
65
|
-
export var Disabled = function Disabled() {
|
|
66
|
-
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
67
|
-
gap: 2
|
|
68
|
-
}, /*#__PURE__*/React.createElement(Grid, {
|
|
69
|
-
xs: 12,
|
|
70
|
-
md: 12
|
|
71
|
-
}, /*#__PURE__*/React.createElement(Slider, {
|
|
72
|
-
initialValue: 50,
|
|
73
|
-
disabled: true
|
|
74
|
-
})));
|
|
75
|
-
};
|
|
76
|
-
export var Markers = function Markers() {
|
|
77
|
-
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
78
|
-
gap: 2
|
|
79
|
-
}, /*#__PURE__*/React.createElement(Grid, {
|
|
80
|
-
xs: 12,
|
|
81
|
-
md: 12
|
|
82
|
-
}, /*#__PURE__*/React.createElement(Slider, {
|
|
83
|
-
step: 10,
|
|
84
|
-
showMarkers: true,
|
|
85
|
-
width: "75%"
|
|
86
|
-
})));
|
|
87
|
-
};
|
|
88
|
-
export var Range = function Range() {
|
|
89
|
-
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
90
|
-
gap: 2
|
|
91
|
-
}, /*#__PURE__*/React.createElement(Grid, {
|
|
92
|
-
xs: 12,
|
|
93
|
-
md: 12
|
|
94
|
-
}, /*#__PURE__*/React.createElement(Slider, {
|
|
95
|
-
step: 5,
|
|
96
|
-
max: 50,
|
|
97
|
-
min: 10,
|
|
98
|
-
initialValue: 25,
|
|
99
|
-
showMarkers: true,
|
|
100
|
-
width: "75%"
|
|
101
|
-
})), /*#__PURE__*/React.createElement(Grid, {
|
|
102
|
-
xs: 12,
|
|
103
|
-
md: 12
|
|
104
|
-
}, /*#__PURE__*/React.createElement(Slider, {
|
|
105
|
-
step: 0.2,
|
|
106
|
-
max: 1,
|
|
107
|
-
min: 0.2,
|
|
108
|
-
initialValue: 0.4,
|
|
109
|
-
showMarkers: true,
|
|
110
|
-
width: "75%"
|
|
111
|
-
})));
|
|
112
|
-
};
|
|
113
|
-
export var Event = function Event() {
|
|
114
|
-
var _useState = useState(),
|
|
115
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
116
|
-
value = _useState2[0],
|
|
117
|
-
setValue = _useState2[1];
|
|
118
|
-
|
|
119
|
-
var handler = function handler(val) {
|
|
120
|
-
console.log(val);
|
|
121
|
-
setValue(val);
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
125
|
-
gap: 2
|
|
126
|
-
}, /*#__PURE__*/React.createElement(Grid, {
|
|
127
|
-
xs: 12,
|
|
128
|
-
md: 12
|
|
129
|
-
}, /*#__PURE__*/React.createElement(Slider, {
|
|
130
|
-
value: value,
|
|
131
|
-
onChange: handler,
|
|
132
|
-
width: "50%"
|
|
133
|
-
})));
|
|
134
|
-
};
|
package/esm/Snippet/stories.js
DELETED
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
import Snippet from '.';
|
|
2
|
-
import Grid from '../Grid';
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Others/Snippet',
|
|
5
|
-
component: Snippet
|
|
6
|
-
};
|
|
7
|
-
export var Default = function Default() {
|
|
8
|
-
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
9
|
-
gap: 2
|
|
10
|
-
}, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Snippet, {
|
|
11
|
-
text: "yarn add @bolio-ui/core",
|
|
12
|
-
width: "300px"
|
|
13
|
-
})));
|
|
14
|
-
};
|
|
15
|
-
export var Width = function Width() {
|
|
16
|
-
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
17
|
-
gap: 2
|
|
18
|
-
}, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Snippet, {
|
|
19
|
-
text: "yarn add @bolio-ui/core",
|
|
20
|
-
width: "100%"
|
|
21
|
-
})));
|
|
22
|
-
};
|
|
23
|
-
export var Types = function Types() {
|
|
24
|
-
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
25
|
-
gap: 2
|
|
26
|
-
}, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Snippet, {
|
|
27
|
-
text: "yarn add @bolio-ui/core",
|
|
28
|
-
width: "300px"
|
|
29
|
-
})), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Snippet, {
|
|
30
|
-
text: "yarn add @bolio-ui/core",
|
|
31
|
-
type: "primary",
|
|
32
|
-
width: "300px"
|
|
33
|
-
})), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Snippet, {
|
|
34
|
-
text: "yarn add @bolio-ui/core",
|
|
35
|
-
type: "secondary",
|
|
36
|
-
width: "300px"
|
|
37
|
-
})), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Snippet, {
|
|
38
|
-
text: "yarn add @bolio-ui/core",
|
|
39
|
-
type: "success",
|
|
40
|
-
width: "300px"
|
|
41
|
-
})), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Snippet, {
|
|
42
|
-
text: "yarn add @bolio-ui/core",
|
|
43
|
-
type: "warning",
|
|
44
|
-
width: "300px"
|
|
45
|
-
})), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Snippet, {
|
|
46
|
-
text: "yarn add @bolio-ui/core",
|
|
47
|
-
type: "error",
|
|
48
|
-
width: "300px"
|
|
49
|
-
})), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Snippet, {
|
|
50
|
-
text: "yarn add @bolio-ui/core",
|
|
51
|
-
type: "secondary",
|
|
52
|
-
width: "300px"
|
|
53
|
-
})), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Snippet, {
|
|
54
|
-
text: "yarn add @bolio-ui/core",
|
|
55
|
-
type: "lite",
|
|
56
|
-
width: "300px"
|
|
57
|
-
})), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Snippet, {
|
|
58
|
-
text: "yarn add @bolio-ui/core",
|
|
59
|
-
type: "dark",
|
|
60
|
-
width: "300px"
|
|
61
|
-
})));
|
|
62
|
-
};
|
|
63
|
-
export var Rounded = function Rounded() {
|
|
64
|
-
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
65
|
-
gap: 2
|
|
66
|
-
}, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Snippet, {
|
|
67
|
-
text: "yarn add @bolio-ui/core",
|
|
68
|
-
width: "300px",
|
|
69
|
-
rounded: true
|
|
70
|
-
})), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Snippet, {
|
|
71
|
-
text: "yarn add @bolio-ui/core",
|
|
72
|
-
type: "primary",
|
|
73
|
-
width: "300px",
|
|
74
|
-
rounded: true
|
|
75
|
-
})), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Snippet, {
|
|
76
|
-
text: "yarn add @bolio-ui/core",
|
|
77
|
-
type: "secondary",
|
|
78
|
-
width: "300px",
|
|
79
|
-
rounded: true
|
|
80
|
-
})), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Snippet, {
|
|
81
|
-
text: "yarn add @bolio-ui/core",
|
|
82
|
-
type: "success",
|
|
83
|
-
width: "300px",
|
|
84
|
-
rounded: true
|
|
85
|
-
})), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Snippet, {
|
|
86
|
-
text: "yarn add @bolio-ui/core",
|
|
87
|
-
type: "warning",
|
|
88
|
-
width: "300px",
|
|
89
|
-
rounded: true
|
|
90
|
-
})), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Snippet, {
|
|
91
|
-
text: "yarn add @bolio-ui/core",
|
|
92
|
-
type: "error",
|
|
93
|
-
width: "300px",
|
|
94
|
-
rounded: true
|
|
95
|
-
})), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Snippet, {
|
|
96
|
-
text: "yarn add @bolio-ui/core",
|
|
97
|
-
type: "lite",
|
|
98
|
-
width: "300px",
|
|
99
|
-
rounded: true
|
|
100
|
-
})), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Snippet, {
|
|
101
|
-
text: "yarn add @bolio-ui/core",
|
|
102
|
-
type: "dark",
|
|
103
|
-
width: "300px",
|
|
104
|
-
rounded: true
|
|
105
|
-
})));
|
|
106
|
-
};
|
|
107
|
-
export var Multiline = function Multiline() {
|
|
108
|
-
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
109
|
-
gap: 2
|
|
110
|
-
}, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Snippet, {
|
|
111
|
-
text: ['cd project', 'now'],
|
|
112
|
-
width: "300px"
|
|
113
|
-
})));
|
|
114
|
-
};
|
|
115
|
-
export var DisabledCopy = function DisabledCopy() {
|
|
116
|
-
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
117
|
-
gap: 2
|
|
118
|
-
}, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Snippet, {
|
|
119
|
-
copy: "prevent",
|
|
120
|
-
text: "yarn add @bolio-ui/core",
|
|
121
|
-
width: "300px"
|
|
122
|
-
})));
|
|
123
|
-
};
|
|
124
|
-
export var CustomSymbol = function CustomSymbol() {
|
|
125
|
-
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
126
|
-
gap: 2
|
|
127
|
-
}, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Snippet, {
|
|
128
|
-
symbol: ">",
|
|
129
|
-
text: "yarn add @bolio-ui/core",
|
|
130
|
-
width: "300px"
|
|
131
|
-
})));
|
|
132
|
-
};
|
|
133
|
-
export var CustomToast = function CustomToast() {
|
|
134
|
-
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
135
|
-
gap: 2
|
|
136
|
-
}, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Snippet, {
|
|
137
|
-
toastText: "Code copied!",
|
|
138
|
-
toastType: "secondary",
|
|
139
|
-
text: "yarn add @bolio-ui/core",
|
|
140
|
-
width: "300px"
|
|
141
|
-
})));
|
|
142
|
-
};
|
|
143
|
-
export var Filled = function Filled() {
|
|
144
|
-
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
145
|
-
gap: 2
|
|
146
|
-
}, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Snippet, {
|
|
147
|
-
text: "yarn add @bolio-ui/core",
|
|
148
|
-
type: "primary",
|
|
149
|
-
filled: true,
|
|
150
|
-
width: "300px"
|
|
151
|
-
})), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Snippet, {
|
|
152
|
-
text: "yarn add @bolio-ui/core",
|
|
153
|
-
type: "secondary",
|
|
154
|
-
filled: true,
|
|
155
|
-
width: "300px"
|
|
156
|
-
})), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Snippet, {
|
|
157
|
-
text: "yarn add @bolio-ui/core",
|
|
158
|
-
type: "success",
|
|
159
|
-
filled: true,
|
|
160
|
-
width: "300px"
|
|
161
|
-
})), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Snippet, {
|
|
162
|
-
text: "yarn add @bolio-ui/core",
|
|
163
|
-
type: "warning",
|
|
164
|
-
filled: true,
|
|
165
|
-
width: "300px"
|
|
166
|
-
})), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Snippet, {
|
|
167
|
-
text: "yarn add @bolio-ui/core",
|
|
168
|
-
type: "error",
|
|
169
|
-
filled: true,
|
|
170
|
-
width: "300px"
|
|
171
|
-
})), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Snippet, {
|
|
172
|
-
text: "yarn add @bolio-ui/core",
|
|
173
|
-
type: "info",
|
|
174
|
-
filled: true,
|
|
175
|
-
width: "300px"
|
|
176
|
-
})));
|
|
177
|
-
};
|
package/esm/Spacer/stories.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import Spacer from '.';
|
|
2
|
-
import Grid from '../Grid';
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Layout/Spacer',
|
|
5
|
-
component: Spacer
|
|
6
|
-
};
|
|
7
|
-
export var Vertical = function Vertical() {
|
|
8
|
-
return /*#__PURE__*/React.createElement(Grid.Container, null, /*#__PURE__*/React.createElement(Grid, {
|
|
9
|
-
xs: 12,
|
|
10
|
-
style: {
|
|
11
|
-
background: '#444',
|
|
12
|
-
borderRadius: '15px'
|
|
13
|
-
}
|
|
14
|
-
}, /*#__PURE__*/React.createElement(Spacer, {
|
|
15
|
-
h: 2
|
|
16
|
-
})), /*#__PURE__*/React.createElement(Spacer, {
|
|
17
|
-
h: 2
|
|
18
|
-
}), /*#__PURE__*/React.createElement(Grid, {
|
|
19
|
-
xs: 12,
|
|
20
|
-
style: {
|
|
21
|
-
background: '#666',
|
|
22
|
-
borderRadius: '15px'
|
|
23
|
-
}
|
|
24
|
-
}, /*#__PURE__*/React.createElement(Spacer, {
|
|
25
|
-
h: 3
|
|
26
|
-
})), /*#__PURE__*/React.createElement(Spacer, {
|
|
27
|
-
h: 3
|
|
28
|
-
}), /*#__PURE__*/React.createElement(Grid, {
|
|
29
|
-
xs: 12,
|
|
30
|
-
style: {
|
|
31
|
-
background: '#999',
|
|
32
|
-
borderRadius: '15px'
|
|
33
|
-
}
|
|
34
|
-
}, /*#__PURE__*/React.createElement(Spacer, {
|
|
35
|
-
h: 4
|
|
36
|
-
})));
|
|
37
|
-
};
|
|
38
|
-
export var Horizontal = function Horizontal() {
|
|
39
|
-
return /*#__PURE__*/React.createElement(Grid.Container, null, /*#__PURE__*/React.createElement(Grid, {
|
|
40
|
-
xs: 4,
|
|
41
|
-
style: {
|
|
42
|
-
background: '#444',
|
|
43
|
-
borderRadius: '15px'
|
|
44
|
-
}
|
|
45
|
-
}), /*#__PURE__*/React.createElement(Spacer, {
|
|
46
|
-
w: 5
|
|
47
|
-
}), /*#__PURE__*/React.createElement(Grid, {
|
|
48
|
-
xs: 4,
|
|
49
|
-
style: {
|
|
50
|
-
background: '#444',
|
|
51
|
-
borderRadius: '15px'
|
|
52
|
-
}
|
|
53
|
-
}));
|
|
54
|
-
};
|
package/esm/Spinner/stories.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import Spinner from '.';
|
|
2
|
-
import Grid from '../Grid';
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Feedback/Spinner',
|
|
5
|
-
component: Spinner
|
|
6
|
-
};
|
|
7
|
-
export var Default = function Default() {
|
|
8
|
-
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
9
|
-
gap: 2
|
|
10
|
-
}, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Spinner, {
|
|
11
|
-
scale: 2
|
|
12
|
-
})));
|
|
13
|
-
};
|
package/esm/Table/stories.js
DELETED
|
@@ -1,269 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
-
import React, { useState } from 'react';
|
|
4
|
-
import Table from '.';
|
|
5
|
-
import Code from '../Code';
|
|
6
|
-
import Text from '../Text';
|
|
7
|
-
import Button from '../Button';
|
|
8
|
-
export default {
|
|
9
|
-
title: 'Data Display/Table',
|
|
10
|
-
component: Table
|
|
11
|
-
};
|
|
12
|
-
export var Default = function Default() {
|
|
13
|
-
var data = [{
|
|
14
|
-
property: 'type',
|
|
15
|
-
description: 'Content type',
|
|
16
|
-
type: 'secondary | warning',
|
|
17
|
-
"default": '-'
|
|
18
|
-
}, {
|
|
19
|
-
property: 'Component',
|
|
20
|
-
description: 'DOM element to use',
|
|
21
|
-
type: 'string',
|
|
22
|
-
"default": '-'
|
|
23
|
-
}, {
|
|
24
|
-
property: 'bold',
|
|
25
|
-
description: 'Bold style',
|
|
26
|
-
type: 'boolean',
|
|
27
|
-
"default": 'true'
|
|
28
|
-
}];
|
|
29
|
-
return /*#__PURE__*/React.createElement(Table, {
|
|
30
|
-
data: data
|
|
31
|
-
}, /*#__PURE__*/React.createElement(Table.Column, {
|
|
32
|
-
prop: "property",
|
|
33
|
-
label: "property"
|
|
34
|
-
}), /*#__PURE__*/React.createElement(Table.Column, {
|
|
35
|
-
prop: "description",
|
|
36
|
-
label: "description"
|
|
37
|
-
}), /*#__PURE__*/React.createElement(Table.Column, {
|
|
38
|
-
prop: "type",
|
|
39
|
-
label: "type"
|
|
40
|
-
}), /*#__PURE__*/React.createElement(Table.Column, {
|
|
41
|
-
prop: "default",
|
|
42
|
-
label: "default"
|
|
43
|
-
}));
|
|
44
|
-
};
|
|
45
|
-
export var Compose = function Compose() {
|
|
46
|
-
var data = [{
|
|
47
|
-
property: 'type',
|
|
48
|
-
description: 'Content type',
|
|
49
|
-
type: 'secondary | warning',
|
|
50
|
-
"default": '-'
|
|
51
|
-
}, {
|
|
52
|
-
property: 'Component',
|
|
53
|
-
description: 'DOM element to use',
|
|
54
|
-
type: /*#__PURE__*/React.createElement(Code, null, "string"),
|
|
55
|
-
"default": '-'
|
|
56
|
-
}, {
|
|
57
|
-
property: /*#__PURE__*/React.createElement(Text, {
|
|
58
|
-
b: true
|
|
59
|
-
}, "bold"),
|
|
60
|
-
description: 'Bold style',
|
|
61
|
-
type: /*#__PURE__*/React.createElement(Code, null, "boolean"),
|
|
62
|
-
"default": /*#__PURE__*/React.createElement(Code, null, "true")
|
|
63
|
-
}];
|
|
64
|
-
return /*#__PURE__*/React.createElement(Table, {
|
|
65
|
-
data: data
|
|
66
|
-
}, /*#__PURE__*/React.createElement(Table.Column, {
|
|
67
|
-
prop: "property",
|
|
68
|
-
label: "property"
|
|
69
|
-
}), /*#__PURE__*/React.createElement(Table.Column, {
|
|
70
|
-
prop: "description",
|
|
71
|
-
label: "description"
|
|
72
|
-
}), /*#__PURE__*/React.createElement(Table.Column, {
|
|
73
|
-
prop: "type",
|
|
74
|
-
label: "type"
|
|
75
|
-
}), /*#__PURE__*/React.createElement(Table.Column, {
|
|
76
|
-
prop: "default",
|
|
77
|
-
label: "default"
|
|
78
|
-
}));
|
|
79
|
-
};
|
|
80
|
-
export var Width = function Width() {
|
|
81
|
-
var data = [{
|
|
82
|
-
property: 'type',
|
|
83
|
-
description: 'Content type',
|
|
84
|
-
type: 'secondary | warning',
|
|
85
|
-
"default": '-'
|
|
86
|
-
}, {
|
|
87
|
-
property: 'Component',
|
|
88
|
-
description: 'DOM element to use',
|
|
89
|
-
type: /*#__PURE__*/React.createElement(Code, null, "string"),
|
|
90
|
-
"default": '-'
|
|
91
|
-
}, {
|
|
92
|
-
property: /*#__PURE__*/React.createElement(Text, {
|
|
93
|
-
b: true
|
|
94
|
-
}, "bold"),
|
|
95
|
-
description: 'Bold style',
|
|
96
|
-
type: /*#__PURE__*/React.createElement(Code, null, "boolean"),
|
|
97
|
-
"default": /*#__PURE__*/React.createElement(Code, null, "true")
|
|
98
|
-
}];
|
|
99
|
-
return /*#__PURE__*/React.createElement(Table, {
|
|
100
|
-
data: data
|
|
101
|
-
}, /*#__PURE__*/React.createElement(Table.Column, {
|
|
102
|
-
prop: "property",
|
|
103
|
-
label: "property",
|
|
104
|
-
width: 50
|
|
105
|
-
}), /*#__PURE__*/React.createElement(Table.Column, {
|
|
106
|
-
prop: "description",
|
|
107
|
-
label: "description"
|
|
108
|
-
}), /*#__PURE__*/React.createElement(Table.Column, {
|
|
109
|
-
prop: "type",
|
|
110
|
-
label: "type"
|
|
111
|
-
}), /*#__PURE__*/React.createElement(Table.Column, {
|
|
112
|
-
prop: "default",
|
|
113
|
-
label: "default"
|
|
114
|
-
}));
|
|
115
|
-
};
|
|
116
|
-
export var Actions = function Actions() {
|
|
117
|
-
var dataSource = [{
|
|
118
|
-
property: 'type',
|
|
119
|
-
description: 'Content type',
|
|
120
|
-
operation: ''
|
|
121
|
-
}, {
|
|
122
|
-
property: 'Component',
|
|
123
|
-
description: 'DOM element to use',
|
|
124
|
-
operation: ''
|
|
125
|
-
}, {
|
|
126
|
-
property: /*#__PURE__*/React.createElement(Text, {
|
|
127
|
-
b: true
|
|
128
|
-
}, "bold"),
|
|
129
|
-
description: 'Bold style',
|
|
130
|
-
operation: ''
|
|
131
|
-
}];
|
|
132
|
-
|
|
133
|
-
var _useState = useState(dataSource),
|
|
134
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
135
|
-
data = _useState2[0],
|
|
136
|
-
setData = _useState2[1];
|
|
137
|
-
|
|
138
|
-
var renderAction = function renderAction(value, rowData, index) {
|
|
139
|
-
var removeHandler = function removeHandler() {
|
|
140
|
-
setData(function (last) {
|
|
141
|
-
return last.filter(function (_, dataIndex) {
|
|
142
|
-
return dataIndex !== index;
|
|
143
|
-
});
|
|
144
|
-
});
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
return /*#__PURE__*/React.createElement(Button, {
|
|
148
|
-
type: "error",
|
|
149
|
-
auto: true,
|
|
150
|
-
scale: 1 / 3,
|
|
151
|
-
font: "12px",
|
|
152
|
-
onClick: removeHandler
|
|
153
|
-
}, "Remove");
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
return /*#__PURE__*/React.createElement(Table, {
|
|
157
|
-
data: data,
|
|
158
|
-
onChange: function onChange(value) {
|
|
159
|
-
return setData(value);
|
|
160
|
-
}
|
|
161
|
-
}, /*#__PURE__*/React.createElement(Table.Column, {
|
|
162
|
-
prop: "property",
|
|
163
|
-
label: "property"
|
|
164
|
-
}), /*#__PURE__*/React.createElement(Table.Column, {
|
|
165
|
-
prop: "description",
|
|
166
|
-
label: "description"
|
|
167
|
-
}), /*#__PURE__*/React.createElement(Table.Column, {
|
|
168
|
-
prop: "operation",
|
|
169
|
-
label: "operation",
|
|
170
|
-
width: 150,
|
|
171
|
-
render: renderAction
|
|
172
|
-
}));
|
|
173
|
-
};
|
|
174
|
-
export var UpdateRow = function UpdateRow() {
|
|
175
|
-
var dataSource = [{
|
|
176
|
-
property: 'type',
|
|
177
|
-
description: 'Content type',
|
|
178
|
-
operation: ''
|
|
179
|
-
}, {
|
|
180
|
-
property: 'Component',
|
|
181
|
-
description: 'DOM element to use',
|
|
182
|
-
operation: ''
|
|
183
|
-
}, {
|
|
184
|
-
property: /*#__PURE__*/React.createElement(Text, {
|
|
185
|
-
b: true
|
|
186
|
-
}, "bold"),
|
|
187
|
-
description: 'Bold style',
|
|
188
|
-
operation: ''
|
|
189
|
-
}];
|
|
190
|
-
|
|
191
|
-
var _React$useState = React.useState(dataSource),
|
|
192
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
193
|
-
data = _React$useState2[0],
|
|
194
|
-
setData = _React$useState2[1];
|
|
195
|
-
|
|
196
|
-
var renderAction = function renderAction(value, rowData, rowIndex) {
|
|
197
|
-
var updateHandler = function updateHandler() {
|
|
198
|
-
setData(function (last) {
|
|
199
|
-
return last.map(function (item, dataIndex) {
|
|
200
|
-
if (dataIndex !== rowIndex) return item;
|
|
201
|
-
return _extends({}, item, {
|
|
202
|
-
property: Math.random().toString(16).slice(-5)
|
|
203
|
-
});
|
|
204
|
-
});
|
|
205
|
-
});
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
return /*#__PURE__*/React.createElement(Button, {
|
|
209
|
-
type: "secondary",
|
|
210
|
-
auto: true,
|
|
211
|
-
scale: 1 / 3,
|
|
212
|
-
font: "12px",
|
|
213
|
-
onClick: updateHandler
|
|
214
|
-
}, "Update");
|
|
215
|
-
};
|
|
216
|
-
|
|
217
|
-
return /*#__PURE__*/React.createElement(Table, {
|
|
218
|
-
data: data,
|
|
219
|
-
onChange: function onChange(value) {
|
|
220
|
-
return setData(value);
|
|
221
|
-
}
|
|
222
|
-
}, /*#__PURE__*/React.createElement(Table.Column, {
|
|
223
|
-
prop: "property",
|
|
224
|
-
label: "property"
|
|
225
|
-
}), /*#__PURE__*/React.createElement(Table.Column, {
|
|
226
|
-
prop: "description",
|
|
227
|
-
label: "description"
|
|
228
|
-
}), /*#__PURE__*/React.createElement(Table.Column, {
|
|
229
|
-
prop: "operation",
|
|
230
|
-
label: "operation",
|
|
231
|
-
width: 150,
|
|
232
|
-
render: renderAction
|
|
233
|
-
}));
|
|
234
|
-
};
|
|
235
|
-
export var CustomHead = function CustomHead() {
|
|
236
|
-
var data = [{
|
|
237
|
-
property: 'type',
|
|
238
|
-
description: 'Content type',
|
|
239
|
-
type: 'secondary | warning',
|
|
240
|
-
"default": '-'
|
|
241
|
-
}, {
|
|
242
|
-
property: 'Component',
|
|
243
|
-
description: 'DOM element to use',
|
|
244
|
-
type: /*#__PURE__*/React.createElement(Code, null, "string"),
|
|
245
|
-
"default": '-'
|
|
246
|
-
}, {
|
|
247
|
-
property: /*#__PURE__*/React.createElement(Text, {
|
|
248
|
-
b: true
|
|
249
|
-
}, "bold"),
|
|
250
|
-
description: 'Bold style',
|
|
251
|
-
type: /*#__PURE__*/React.createElement(Code, null, "boolean"),
|
|
252
|
-
"default": /*#__PURE__*/React.createElement(Code, null, "true")
|
|
253
|
-
}];
|
|
254
|
-
return /*#__PURE__*/React.createElement(Table, {
|
|
255
|
-
data: data
|
|
256
|
-
}, /*#__PURE__*/React.createElement(Table.Column, {
|
|
257
|
-
prop: "property",
|
|
258
|
-
label: "property"
|
|
259
|
-
}), /*#__PURE__*/React.createElement(Table.Column, {
|
|
260
|
-
prop: "description",
|
|
261
|
-
label: "description"
|
|
262
|
-
}), /*#__PURE__*/React.createElement(Table.Column, {
|
|
263
|
-
prop: "type"
|
|
264
|
-
}, /*#__PURE__*/React.createElement(Code, null, "type")), /*#__PURE__*/React.createElement(Table.Column, {
|
|
265
|
-
prop: "default"
|
|
266
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
267
|
-
b: true
|
|
268
|
-
}, "default")));
|
|
269
|
-
};
|