oolib 2.160.0 → 2.162.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/stories/v2/components/Button.stories.d.ts +20 -2
- package/dist/stories/v2/components/Button.stories.js +37 -15
- package/dist/stories/v2/components/TextInputs.stories.js +1 -1
- package/dist/stories/v2/components/cards/CardContent.stories.d.ts +10 -10
- package/dist/stories/v2/components/cards/ListContent.stories.d.ts +10 -4
- package/dist/stories/v2/components/cards/ListContent.stories.js +1 -5
- package/dist/stories/v2/components/cards/utils/cardArgTypes.d.ts +17 -24
- package/dist/stories/v2/components/cards/utils/cardArgTypes.js +11 -15
- package/dist/stories/v2/themes/Typo.stories.js +2 -0
- package/dist/themes/mixins/index.d.ts +1 -0
- package/dist/themes/mixins/index.js +10 -1
- package/dist/v2/components/Buttons/derivedComps/ButtonPrimaryCompact.d.ts +8 -0
- package/dist/v2/components/Buttons/derivedComps/ButtonPrimaryCompact.js +46 -0
- package/dist/v2/components/Buttons/derivedComps/ButtonSecondaryCompact.d.ts +2 -0
- package/dist/v2/components/Buttons/derivedComps/ButtonSecondaryCompact.js +26 -0
- package/dist/v2/components/Buttons/derivedComps/ButtonTertiaryCompact.d.ts +2 -0
- package/dist/v2/components/Buttons/derivedComps/ButtonTertiaryCompact.js +26 -0
- package/dist/v2/components/Buttons/index.d.ts +6 -2
- package/dist/v2/components/Buttons/index.js +21 -10
- package/dist/v2/components/Buttons/styled.d.ts +3 -19
- package/dist/v2/components/Buttons/styled.js +79 -61
- package/dist/v2/components/TextInputs/index.js +3 -4
- package/dist/v2/components/Typo2/index.d.ts +2 -0
- package/dist/v2/components/Typo2/index.js +5 -1
- package/dist/v2/components/Typo2/index.styled.d.ts +2 -0
- package/dist/v2/components/Typo2/index.styled.js +19 -17
- package/dist/v2/components/cards/ListContent/index.d.ts +2 -1
- package/dist/v2/components/cards/ListContent/index.js +18 -23
- package/dist/v2/components/cards/ListContent/styled.d.ts +1 -3
- package/dist/v2/components/cards/ListContent/styled.js +23 -32
- package/dist/v2/themes/typo.d.ts +2 -0
- package/dist/v2/themes/typo.js +21 -17
- package/package.json +1 -1
- package/dist/v2/components/Buttons/derivedComps/ActionButton.d.ts +0 -7
- package/dist/v2/components/Buttons/derivedComps/ActionButton.js +0 -43
- package/dist/v2/components/Buttons/derivedComps/ClearButton.d.ts +0 -6
- package/dist/v2/components/Buttons/derivedComps/ClearButton.js +0 -36
|
@@ -131,6 +131,7 @@ declare namespace _default {
|
|
|
131
131
|
export { disabled_1 as disabled };
|
|
132
132
|
let invert_1: boolean;
|
|
133
133
|
export { invert_1 as invert };
|
|
134
|
+
export let responsive: boolean;
|
|
134
135
|
}
|
|
135
136
|
namespace parameters {
|
|
136
137
|
namespace docs {
|
|
@@ -163,8 +164,8 @@ export namespace Button_Secondary {
|
|
|
163
164
|
}
|
|
164
165
|
export { args_1 as args };
|
|
165
166
|
}
|
|
166
|
-
export function
|
|
167
|
-
export namespace
|
|
167
|
+
export function Button_Tertiary(args: any): React.JSX.Element;
|
|
168
|
+
export namespace Button_Tertiary {
|
|
168
169
|
export namespace args_2 {
|
|
169
170
|
let active_1: boolean;
|
|
170
171
|
export { active_1 as active };
|
|
@@ -179,6 +180,23 @@ export namespace Button_Ghost {
|
|
|
179
180
|
}
|
|
180
181
|
export { parameters_3 as parameters };
|
|
181
182
|
}
|
|
183
|
+
export function Button_Ghost(args: any): React.JSX.Element;
|
|
184
|
+
export namespace Button_Ghost {
|
|
185
|
+
export namespace args_3 {
|
|
186
|
+
let active_2: boolean;
|
|
187
|
+
export { active_2 as active };
|
|
188
|
+
}
|
|
189
|
+
export { args_3 as args };
|
|
190
|
+
export namespace parameters_4 {
|
|
191
|
+
export namespace controls_3 {
|
|
192
|
+
let exclude_3: string[];
|
|
193
|
+
export { exclude_3 as exclude };
|
|
194
|
+
}
|
|
195
|
+
export { controls_3 as controls };
|
|
196
|
+
}
|
|
197
|
+
export { parameters_4 as parameters };
|
|
198
|
+
}
|
|
199
|
+
export function Buttons(args: any): React.JSX.Element;
|
|
182
200
|
declare const availableIcons: string[];
|
|
183
201
|
declare const availableColors: string[];
|
|
184
202
|
import ButtonDocs from "../../Oolib/components/Buttons.mdx";
|
|
@@ -23,12 +23,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
23
23
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.Button_Ghost = exports.Button_Secondary = exports.Button_Primary = void 0;
|
|
26
|
+
exports.Buttons = exports.Button_Ghost = exports.Button_Tertiary = exports.Button_Secondary = exports.Button_Primary = void 0;
|
|
27
27
|
var react_1 = __importDefault(require("react"));
|
|
28
28
|
var Buttons_1 = require("../../../v2/components/Buttons");
|
|
29
29
|
var Buttons_mdx_1 = __importDefault(require("../../Oolib/components/Buttons.mdx"));
|
|
30
30
|
var icons_1 = require("../../../icons");
|
|
31
31
|
var themes_1 = require("../../../themes");
|
|
32
|
+
var Typo2_1 = require("../../../v2/components/Typo2");
|
|
33
|
+
var styled_components_1 = require("styled-components");
|
|
32
34
|
var availableIcons = __spreadArray([undefined], Object.keys(icons_1.icons).sort(), true);
|
|
33
35
|
var availableColors = __spreadArray([undefined], Object.keys(themes_1.colors).sort(), true);
|
|
34
36
|
exports.default = {
|
|
@@ -105,6 +107,7 @@ exports.default = {
|
|
|
105
107
|
iconColor: undefined,
|
|
106
108
|
disabled: false,
|
|
107
109
|
invert: false,
|
|
110
|
+
responsive: false
|
|
108
111
|
},
|
|
109
112
|
parameters: {
|
|
110
113
|
docs: {
|
|
@@ -149,23 +152,42 @@ exports.Button_Secondary.parameters = { controls: { exclude: ["variant", "color"
|
|
|
149
152
|
exports.Button_Secondary.args = {
|
|
150
153
|
active: false,
|
|
151
154
|
};
|
|
155
|
+
var Button_Tertiary = function (args) { return (react_1.default.createElement(GenButtonStory, { args: args, Comp: Buttons_1.ButtonTertiary })); };
|
|
156
|
+
exports.Button_Tertiary = Button_Tertiary;
|
|
157
|
+
exports.Button_Tertiary.args = {
|
|
158
|
+
active: false,
|
|
159
|
+
};
|
|
160
|
+
exports.Button_Tertiary.parameters = { controls: { exclude: ["variant"] } };
|
|
152
161
|
var Button_Ghost = function (args) { return (react_1.default.createElement(GenButtonStory, { args: args, Comp: Buttons_1.ButtonGhost })); };
|
|
153
162
|
exports.Button_Ghost = Button_Ghost;
|
|
154
163
|
exports.Button_Ghost.args = {
|
|
155
164
|
active: false,
|
|
156
165
|
};
|
|
157
166
|
exports.Button_Ghost.parameters = { controls: { exclude: ["variant"] } };
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
167
|
+
var Buttons = function (args) {
|
|
168
|
+
var theme = (0, styled_components_1.useTheme)();
|
|
169
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
170
|
+
react_1.default.createElement("div", { style: { display: "flex", gap: '5rem' } },
|
|
171
|
+
react_1.default.createElement("div", null,
|
|
172
|
+
react_1.default.createElement(GenButtonStory, { args: args, Comp: Buttons_1.ButtonPrimary }),
|
|
173
|
+
react_1.default.createElement(GenButtonStory, { args: args, Comp: Buttons_1.ButtonSecondary }),
|
|
174
|
+
react_1.default.createElement(GenButtonStory, { args: args, Comp: Buttons_1.ButtonTertiary }),
|
|
175
|
+
react_1.default.createElement(GenButtonStory, { args: args, Comp: Buttons_1.ButtonGhost })),
|
|
176
|
+
react_1.default.createElement("div", null,
|
|
177
|
+
react_1.default.createElement(GenButtonStory, { args: __assign(__assign({}, args), { responsive: true }), Comp: Buttons_1.ButtonPrimary }),
|
|
178
|
+
react_1.default.createElement(GenButtonStory, { args: __assign(__assign({}, args), { responsive: true }), Comp: Buttons_1.ButtonSecondary }),
|
|
179
|
+
react_1.default.createElement(GenButtonStory, { args: __assign(__assign({}, args), { responsive: true }), Comp: Buttons_1.ButtonTertiary }),
|
|
180
|
+
react_1.default.createElement(GenButtonStory, { args: __assign(__assign({}, args), { responsive: true }), Comp: Buttons_1.ButtonGhost }))),
|
|
181
|
+
react_1.default.createElement("div", { style: { marginTop: '10rem' } },
|
|
182
|
+
react_1.default.createElement(Typo2_1.UI_TITLE, { style: { paddingLeft: '20px' } }, "Derived Buttons"),
|
|
183
|
+
react_1.default.createElement("div", { style: { display: "flex", gap: '5rem' } },
|
|
184
|
+
react_1.default.createElement("div", null,
|
|
185
|
+
react_1.default.createElement(GenButtonStory, { args: args, Comp: Buttons_1.ButtonPrimaryCompact }),
|
|
186
|
+
react_1.default.createElement(GenButtonStory, { args: args, Comp: Buttons_1.ButtonSecondaryCompact }),
|
|
187
|
+
react_1.default.createElement(GenButtonStory, { args: args, Comp: Buttons_1.ButtonTertiaryCompact })),
|
|
188
|
+
react_1.default.createElement("div", null,
|
|
189
|
+
react_1.default.createElement(GenButtonStory, { args: __assign(__assign({}, args), { responsive: true }), Comp: Buttons_1.ButtonPrimaryCompact }),
|
|
190
|
+
react_1.default.createElement(GenButtonStory, { args: __assign(__assign({}, args), { responsive: true }), Comp: Buttons_1.ButtonSecondaryCompact }),
|
|
191
|
+
react_1.default.createElement(GenButtonStory, { args: __assign(__assign({}, args), { responsive: true }), Comp: Buttons_1.ButtonTertiaryCompact }))))));
|
|
192
|
+
};
|
|
193
|
+
exports.Buttons = Buttons;
|
|
@@ -7,22 +7,12 @@ declare namespace _default {
|
|
|
7
7
|
type: string;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
|
-
highlight: {
|
|
11
|
-
name: string;
|
|
12
|
-
control: string;
|
|
13
|
-
options: string[];
|
|
14
|
-
};
|
|
15
10
|
desc: {
|
|
16
11
|
name: string;
|
|
17
12
|
control: {
|
|
18
13
|
type: string;
|
|
19
14
|
};
|
|
20
15
|
};
|
|
21
|
-
statusTagVariant: {
|
|
22
|
-
name: string;
|
|
23
|
-
control: string;
|
|
24
|
-
options: string[];
|
|
25
|
-
};
|
|
26
16
|
cardLabel: {
|
|
27
17
|
name: string;
|
|
28
18
|
control: string;
|
|
@@ -60,6 +50,16 @@ declare namespace _default {
|
|
|
60
50
|
name: string;
|
|
61
51
|
control: string;
|
|
62
52
|
};
|
|
53
|
+
highlight: {
|
|
54
|
+
name: string;
|
|
55
|
+
control: string;
|
|
56
|
+
options: string[];
|
|
57
|
+
};
|
|
58
|
+
statusTagVariant: {
|
|
59
|
+
name: string;
|
|
60
|
+
control: string;
|
|
61
|
+
options: string[];
|
|
62
|
+
};
|
|
63
63
|
};
|
|
64
64
|
let args: {
|
|
65
65
|
cardLabel: string;
|
|
@@ -8,10 +8,6 @@ declare namespace _default {
|
|
|
8
8
|
type: string;
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
|
-
highlight: {
|
|
12
|
-
name: string;
|
|
13
|
-
control: string;
|
|
14
|
-
};
|
|
15
11
|
cardLabel: {
|
|
16
12
|
name: string;
|
|
17
13
|
control: string;
|
|
@@ -49,6 +45,16 @@ declare namespace _default {
|
|
|
49
45
|
name: string;
|
|
50
46
|
control: string;
|
|
51
47
|
};
|
|
48
|
+
highlight: {
|
|
49
|
+
name: string;
|
|
50
|
+
control: string;
|
|
51
|
+
options: string[];
|
|
52
|
+
};
|
|
53
|
+
statusTagVariant: {
|
|
54
|
+
name: string;
|
|
55
|
+
control: string;
|
|
56
|
+
options: string[];
|
|
57
|
+
};
|
|
52
58
|
};
|
|
53
59
|
let args: {
|
|
54
60
|
cardLabel: string;
|
|
@@ -24,7 +24,6 @@ var cardArgTypes_1 = require("./utils/cardArgTypes");
|
|
|
24
24
|
var parseCardArgs_1 = require("./utils/parseCardArgs");
|
|
25
25
|
var Wrappers_1 = require("../../../../components/Wrappers");
|
|
26
26
|
var makeArrayFromLength_1 = require("../../../../utils/makeArrayFromLength");
|
|
27
|
-
var Divider_1 = require("../../../../v2/components/Divider");
|
|
28
27
|
exports.default = {
|
|
29
28
|
title: "Oolib V 2.0/Components/ListContent",
|
|
30
29
|
argTypes: __assign(__assign({}, cardArgTypes_1.commonCardArgTypes), cardArgTypes_1.listContentArgTypes),
|
|
@@ -46,9 +45,6 @@ var Playground = function (args) {
|
|
|
46
45
|
var props = (0, parseCardArgs_1.parseCardArgs)(args);
|
|
47
46
|
return (react_1.default.createElement(Container_1.Container, null,
|
|
48
47
|
react_1.default.createElement(Paddings_1.PaddingTopBottom30, null,
|
|
49
|
-
react_1.default.createElement(Wrappers_1.Wrapper700, { left: true }, (0, makeArrayFromLength_1.makeArrayFromLength)(50).map(function (d) { return (react_1.default.createElement(
|
|
50
|
-
react_1.default.createElement("div", { style: { padding: "1px 0" } },
|
|
51
|
-
react_1.default.createElement(Divider_1.Divider, null)),
|
|
52
|
-
react_1.default.createElement(ListContent_1.ListContent, __assign({}, props, { config: props.config })))); })))));
|
|
48
|
+
react_1.default.createElement(Wrappers_1.Wrapper700, { left: true }, (0, makeArrayFromLength_1.makeArrayFromLength)(50).map(function (d) { return (react_1.default.createElement(ListContent_1.ListContent, __assign({}, props, { config: props.config }))); })))));
|
|
53
49
|
};
|
|
54
50
|
exports.Playground = Playground;
|
|
@@ -68,44 +68,44 @@ export namespace commonCardArgTypes {
|
|
|
68
68
|
export { control_6 as control };
|
|
69
69
|
}
|
|
70
70
|
export { metaDate_1 as metaDate };
|
|
71
|
-
|
|
72
|
-
export namespace cardContentArgTypes {
|
|
73
|
-
namespace tagDisplay {
|
|
71
|
+
export namespace highlight {
|
|
74
72
|
let name_7: string;
|
|
75
73
|
export { name_7 as name };
|
|
76
|
-
|
|
77
|
-
let type: string;
|
|
78
|
-
}
|
|
74
|
+
let control_7: string;
|
|
79
75
|
export { control_7 as control };
|
|
76
|
+
let options_1: string[];
|
|
77
|
+
export { options_1 as options };
|
|
80
78
|
}
|
|
81
|
-
namespace
|
|
79
|
+
export namespace statusTagVariant {
|
|
82
80
|
let name_8: string;
|
|
83
81
|
export { name_8 as name };
|
|
84
82
|
let control_8: string;
|
|
85
83
|
export { control_8 as control };
|
|
86
|
-
let
|
|
87
|
-
export {
|
|
84
|
+
let options_2: string[];
|
|
85
|
+
export { options_2 as options };
|
|
88
86
|
}
|
|
89
|
-
|
|
87
|
+
}
|
|
88
|
+
export namespace cardContentArgTypes {
|
|
89
|
+
namespace tagDisplay {
|
|
90
90
|
let name_9: string;
|
|
91
91
|
export { name_9 as name };
|
|
92
92
|
export namespace control_9 {
|
|
93
|
-
let
|
|
94
|
-
export { type_1 as type };
|
|
93
|
+
let type: string;
|
|
95
94
|
}
|
|
96
95
|
export { control_9 as control };
|
|
97
96
|
}
|
|
98
|
-
namespace
|
|
97
|
+
namespace desc {
|
|
99
98
|
let name_10: string;
|
|
100
99
|
export { name_10 as name };
|
|
101
|
-
|
|
100
|
+
export namespace control_10 {
|
|
101
|
+
let type_1: string;
|
|
102
|
+
export { type_1 as type };
|
|
103
|
+
}
|
|
102
104
|
export { control_10 as control };
|
|
103
|
-
let options_2: string[];
|
|
104
|
-
export { options_2 as options };
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
export namespace listContentArgTypes {
|
|
108
|
-
|
|
108
|
+
namespace statusTag {
|
|
109
109
|
let name_11: string;
|
|
110
110
|
export { name_11 as name };
|
|
111
111
|
export namespace control_11 {
|
|
@@ -114,11 +114,4 @@ export namespace listContentArgTypes {
|
|
|
114
114
|
}
|
|
115
115
|
export { control_11 as control };
|
|
116
116
|
}
|
|
117
|
-
export namespace highlight_1 {
|
|
118
|
-
let name_12: string;
|
|
119
|
-
export { name_12 as name };
|
|
120
|
-
let control_12: string;
|
|
121
|
-
export { control_12 as control };
|
|
122
|
-
}
|
|
123
|
-
export { highlight_1 as highlight };
|
|
124
117
|
}
|
|
@@ -42,35 +42,31 @@ exports.commonCardArgTypes = {
|
|
|
42
42
|
metaDate: {
|
|
43
43
|
name: "Meta (Date)",
|
|
44
44
|
control: "date",
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
exports.cardContentArgTypes = {
|
|
48
|
-
tagDisplay: {
|
|
49
|
-
name: "Status Tag",
|
|
50
|
-
control: { type: "text" },
|
|
51
45
|
},
|
|
52
46
|
highlight: {
|
|
53
47
|
name: "Highlight",
|
|
54
48
|
control: 'select',
|
|
55
49
|
options: [undefined, 'primary', 'secondary'],
|
|
56
50
|
},
|
|
51
|
+
statusTagVariant: {
|
|
52
|
+
name: "Status Tag Variant",
|
|
53
|
+
control: 'select',
|
|
54
|
+
options: [undefined, 'primary', 'secondary', 'positive', 'inProgress', 'warning', 'negative', 'special', 'grey'],
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
exports.cardContentArgTypes = {
|
|
58
|
+
tagDisplay: {
|
|
59
|
+
name: "Status Tag",
|
|
60
|
+
control: { type: "text" },
|
|
61
|
+
},
|
|
57
62
|
desc: {
|
|
58
63
|
name: "Description",
|
|
59
64
|
control: { type: "text" },
|
|
60
65
|
},
|
|
61
|
-
statusTagVariant: {
|
|
62
|
-
name: "Status Tag Variant",
|
|
63
|
-
control: 'select',
|
|
64
|
-
options: ['primary', 'secondary', 'positive', 'inProgress', 'warning', 'negative', 'special', 'grey'],
|
|
65
|
-
}
|
|
66
66
|
};
|
|
67
67
|
exports.listContentArgTypes = {
|
|
68
68
|
statusTag: {
|
|
69
69
|
name: "Status Tag",
|
|
70
70
|
control: { type: "text" },
|
|
71
71
|
},
|
|
72
|
-
highlight: {
|
|
73
|
-
name: "Highlight",
|
|
74
|
-
control: 'boolean',
|
|
75
|
-
},
|
|
76
72
|
};
|
|
@@ -105,6 +105,8 @@ var UIFont = function (args) { return (react_1.default.createElement("div", { st
|
|
|
105
105
|
react_1.default.createElement(GenComp, { args: args, Comp: Typo2_1.UI_CAPTION_BOLD, compName: "UI_CAPTION_BOLD" }),
|
|
106
106
|
react_1.default.createElement(GenComp, { args: args, Comp: Typo2_1.UI_CAPTION_DF, compName: "UI_CAPTION_DF" }),
|
|
107
107
|
react_1.default.createElement(GenComp, { args: args, Comp: Typo2_1.UI_CAPTION_BOLD_DF, compName: "UI_CAPTION_DF" }),
|
|
108
|
+
react_1.default.createElement(GenComp, { args: args, Comp: Typo2_1.UI_CAPTION_SEMIBOLD, compName: "UI_CAPTION_SEMIBOLD" }),
|
|
109
|
+
react_1.default.createElement(GenComp, { args: args, Comp: Typo2_1.UI_CAPTION_SEMIBOLD_DF, compName: "UI_CAPTION_SEMIBOLD_DF" }),
|
|
108
110
|
react_1.default.createElement(GenComp, { args: args, Comp: Typo2_1.UI_TAG, compName: "UI_TAG" }),
|
|
109
111
|
react_1.default.createElement(GenComp, { args: args, Comp: Typo2_1.UI_HELPTEXT, compName: "UI_HELPTEXT" }),
|
|
110
112
|
react_1.default.createElement(GenComp, { args: args, Comp: Typo2_1.UI_STAT_LG, compName: "UI_STAT_LG" }),
|
|
@@ -4,8 +4,9 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
4
4
|
return cooked;
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.multilineUnderline = exports.clampText = exports.ellipsis = exports.isElementInViewport = exports.mediaQuery = exports.getBreakPoint = exports.innerShadow0 = exports.boxShadow1 = exports.boxShadow0 = exports.transition = void 0;
|
|
7
|
+
exports.useResponsiveMobileStyles = exports.multilineUnderline = exports.clampText = exports.ellipsis = exports.isElementInViewport = exports.mediaQuery = exports.getBreakPoint = exports.innerShadow0 = exports.boxShadow1 = exports.boxShadow0 = exports.transition = void 0;
|
|
8
8
|
var styled_components_1 = require("styled-components");
|
|
9
|
+
var _EXPORTS_1 = require("../../utils/_EXPORTS");
|
|
9
10
|
var transitions_1 = require("./transitions");
|
|
10
11
|
Object.defineProperty(exports, "transition", { enumerable: true, get: function () { return transitions_1.transition; } });
|
|
11
12
|
var boxShadows_1 = require("./boxShadows");
|
|
@@ -72,4 +73,12 @@ var multilineUnderline = function (_a) {
|
|
|
72
73
|
});
|
|
73
74
|
};
|
|
74
75
|
exports.multilineUnderline = multilineUnderline;
|
|
76
|
+
var useResponsiveMobileStyles = function (reponsive) {
|
|
77
|
+
if (reponsive === void 0) { reponsive = false; }
|
|
78
|
+
if (!reponsive)
|
|
79
|
+
return false;
|
|
80
|
+
var screenWidth = (0, _EXPORTS_1.useScreenWidth)();
|
|
81
|
+
return reponsive && screenWidth < (0, exports.getBreakPoint)("sm");
|
|
82
|
+
};
|
|
83
|
+
exports.useResponsiveMobileStyles = useResponsiveMobileStyles;
|
|
75
84
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const generateCompactButtonStyles: (responsive: any, icon: any) => {
|
|
3
|
+
borderRadius: string;
|
|
4
|
+
cursor: string;
|
|
5
|
+
padding: string;
|
|
6
|
+
gap: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const ButtonPrimaryCompact: (props: any) => React.JSX.Element;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.ButtonPrimaryCompact = exports.generateCompactButtonStyles = void 0;
|
|
18
|
+
var react_1 = __importDefault(require("react"));
|
|
19
|
+
var __1 = require("..");
|
|
20
|
+
var mixins_1 = require("../../../../themes/mixins");
|
|
21
|
+
var generateCompactButtonStyles = function (responsive, icon) {
|
|
22
|
+
var paddingGenerator = function () {
|
|
23
|
+
if (responsive) {
|
|
24
|
+
if (icon) {
|
|
25
|
+
return "8px 14px 8px 12px";
|
|
26
|
+
}
|
|
27
|
+
return "8px 14px";
|
|
28
|
+
}
|
|
29
|
+
if (icon) {
|
|
30
|
+
return "4px 10px 4px 8px";
|
|
31
|
+
}
|
|
32
|
+
return "4px 10px";
|
|
33
|
+
};
|
|
34
|
+
return {
|
|
35
|
+
borderRadius: responsive ? "18px" : "14px",
|
|
36
|
+
cursor: "pointer",
|
|
37
|
+
padding: paddingGenerator(),
|
|
38
|
+
gap: '0.2rem'
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
exports.generateCompactButtonStyles = generateCompactButtonStyles;
|
|
42
|
+
var ButtonPrimaryCompact = function (props) {
|
|
43
|
+
var responsive = (0, mixins_1.useResponsiveMobileStyles)(props.responsive);
|
|
44
|
+
return (react_1.default.createElement(__1.ButtonPrimary, __assign({}, props, { typo: "UI_CAPTION_BOLD_DF", iconSize: responsive ? 16 : 14, style: (0, exports.generateCompactButtonStyles)(responsive, props.icon) })));
|
|
45
|
+
};
|
|
46
|
+
exports.ButtonPrimaryCompact = ButtonPrimaryCompact;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.ButtonSecondaryCompact = void 0;
|
|
18
|
+
var react_1 = __importDefault(require("react"));
|
|
19
|
+
var __1 = require("..");
|
|
20
|
+
var ButtonPrimaryCompact_1 = require("./ButtonPrimaryCompact");
|
|
21
|
+
var mixins_1 = require("../../../../themes/mixins");
|
|
22
|
+
var ButtonSecondaryCompact = function (props) {
|
|
23
|
+
var responsive = (0, mixins_1.useResponsiveMobileStyles)(props.responsive);
|
|
24
|
+
return (react_1.default.createElement(__1.ButtonSecondary, __assign({}, props, { typo: "UI_CAPTION_BOLD_DF", iconSize: responsive ? 16 : 14, style: (0, ButtonPrimaryCompact_1.generateCompactButtonStyles)(responsive, props.icon) })));
|
|
25
|
+
};
|
|
26
|
+
exports.ButtonSecondaryCompact = ButtonSecondaryCompact;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.ButtonTertiaryCompact = void 0;
|
|
18
|
+
var react_1 = __importDefault(require("react"));
|
|
19
|
+
var __1 = require("..");
|
|
20
|
+
var ButtonPrimaryCompact_1 = require("./ButtonPrimaryCompact");
|
|
21
|
+
var mixins_1 = require("../../../../themes/mixins");
|
|
22
|
+
var ButtonTertiaryCompact = function (props) {
|
|
23
|
+
var responsive = (0, mixins_1.useResponsiveMobileStyles)(props.responsive);
|
|
24
|
+
return (react_1.default.createElement(__1.ButtonTertiary, __assign({}, props, { typo: "UI_CAPTION_BOLD_DF", iconSize: responsive ? 16 : 14, style: (0, ButtonPrimaryCompact_1.generateCompactButtonStyles)(responsive, props.icon) })));
|
|
25
|
+
};
|
|
26
|
+
exports.ButtonTertiaryCompact = ButtonTertiaryCompact;
|
|
@@ -36,6 +36,8 @@ export interface ButtonProps {
|
|
|
36
36
|
stopPropagation?: boolean;
|
|
37
37
|
preventDefault?: boolean;
|
|
38
38
|
forceHover?: boolean;
|
|
39
|
+
responsive?: boolean;
|
|
40
|
+
typo?: string;
|
|
39
41
|
}
|
|
40
42
|
export interface ButtonStyledWrapperProps {
|
|
41
43
|
props: ButtonProps;
|
|
@@ -43,6 +45,8 @@ export interface ButtonStyledWrapperProps {
|
|
|
43
45
|
}
|
|
44
46
|
export declare const ButtonPrimary: React.FunctionComponent<ButtonProps>;
|
|
45
47
|
export declare const ButtonSecondary: React.FunctionComponent<ButtonProps>;
|
|
48
|
+
export declare const ButtonTertiary: React.FunctionComponent<ButtonProps>;
|
|
46
49
|
export declare const ButtonGhost: React.FunctionComponent<ButtonProps>;
|
|
47
|
-
export {
|
|
48
|
-
export {
|
|
50
|
+
export { ButtonSecondaryCompact } from "./derivedComps/ButtonSecondaryCompact";
|
|
51
|
+
export { ButtonPrimaryCompact } from "./derivedComps/ButtonPrimaryCompact";
|
|
52
|
+
export { ButtonTertiaryCompact } from "./derivedComps/ButtonTertiaryCompact";
|
|
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
17
|
+
exports.ButtonTertiaryCompact = exports.ButtonPrimaryCompact = exports.ButtonSecondaryCompact = exports.ButtonGhost = exports.ButtonTertiary = exports.ButtonSecondary = exports.ButtonPrimary = void 0;
|
|
18
18
|
var react_1 = __importDefault(require("react"));
|
|
19
19
|
var styled_1 = require("./styled");
|
|
20
20
|
var react_router_dom_1 = require("react-router-dom");
|
|
@@ -22,14 +22,20 @@ var lodash_1 = require("lodash");
|
|
|
22
22
|
var icons_1 = require("../../../icons");
|
|
23
23
|
var themes_1 = require("../../../themes");
|
|
24
24
|
var Typo2_1 = require("../Typo2");
|
|
25
|
+
var mixins_1 = require("../../../themes/mixins");
|
|
25
26
|
var DisplayIcon = function (_a) {
|
|
26
27
|
var icon = _a.icon, size = _a.size, color = _a.color, iconWeight = _a.iconWeight;
|
|
27
28
|
var IconComp = icons_1.icons[icon];
|
|
28
29
|
return react_1.default.createElement("div", { style: { minWidth: 'max-content', display: "flex", justifyContent: "center", alignItems: "center" } }, IconComp && react_1.default.createElement(IconComp, { size: size, color: color, weight: iconWeight || 'bold' }));
|
|
29
30
|
};
|
|
31
|
+
var Typos = {
|
|
32
|
+
UI_BODY_SEMIBOLD_SM_DF: Typo2_1.UI_BODY_SEMIBOLD_SM_DF,
|
|
33
|
+
UI_CAPTION_BOLD_DF: Typo2_1.UI_CAPTION_BOLD_DF
|
|
34
|
+
};
|
|
30
35
|
var ButtonStyledWrapper = function (_a) {
|
|
31
36
|
var props = _a.props, variant = _a.variant;
|
|
32
|
-
var
|
|
37
|
+
var responsive_ = (0, mixins_1.useResponsiveMobileStyles)(props.responsive);
|
|
38
|
+
var id = props.id, link = props.link, children = props.children, value = props.value, submit = props.submit, icon = props.icon, iconAfter = props.iconAfter, onClick = props.onClick, onMouseDown = props.onMouseDown, active = props.active, disabled = props.disabled, theme = props.theme, width = props.width, onMouseEnter = props.onMouseEnter, onMouseLeave = props.onMouseLeave, color = props.color, style = props.style, className = props.className, S = props.S, M = props.M, iconSize = props.iconSize, _iconColor = props.iconColor, iconWeight = props.iconWeight, stopPropagation = props.stopPropagation, preventDefault = props.preventDefault, forceHover = props.forceHover, typo = props.typo;
|
|
33
39
|
var displayText = (link === null || link === void 0 ? void 0 : link.displayText) || children || value;
|
|
34
40
|
var debouncedOnClick = onClick && (0, lodash_1.debounce)(onClick, 200);
|
|
35
41
|
var debouncedMouseDown = onMouseDown && (0, lodash_1.debounce)(onMouseDown, 150);
|
|
@@ -40,12 +46,13 @@ var ButtonStyledWrapper = function (_a) {
|
|
|
40
46
|
: "textOnly";
|
|
41
47
|
var size = ['icon+text', 'textOnly'].indexOf(composition) !== -1
|
|
42
48
|
? (S && 'S') || 'M'
|
|
43
|
-
: (M && 'M') || 'S';
|
|
49
|
+
: (M && 'M') || 'S'; // this size logic dont have design defination yet, default size is "S"
|
|
44
50
|
var calcIconSize = function () {
|
|
45
51
|
var thisSize = iconSize || size;
|
|
46
|
-
return thisSize === 'S' ? 16 : 20;
|
|
52
|
+
return typeof thisSize === 'number' ? thisSize : (thisSize === 'S' && responsive_) ? 18 : (thisSize === 'S' && !responsive_) ? 16 : 20;
|
|
47
53
|
};
|
|
48
54
|
var iconColor = !disabled ? _iconColor : themes_1.colors.greyColor40;
|
|
55
|
+
var DisplayTextTypo = Typos[typo] || Typo2_1.UI_BODY_SEMIBOLD_SM_DF;
|
|
49
56
|
return (react_1.default.createElement(styled_1.ButtonStyled, { id: id, style: style, className: className, variant: variant, size: size, active: active, disabled: disabled, theme: theme, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, type: submit ? "submit" : "button", onClick: function (e) {
|
|
50
57
|
stopPropagation && e.stopPropagation();
|
|
51
58
|
preventDefault && e.preventDefault();
|
|
@@ -54,9 +61,9 @@ var ButtonStyledWrapper = function (_a) {
|
|
|
54
61
|
stopPropagation && e.stopPropagation();
|
|
55
62
|
preventDefault && e.preventDefault();
|
|
56
63
|
debouncedMouseDown && debouncedMouseDown(e);
|
|
57
|
-
}, composition: composition, width: width, color: color, forceHover: forceHover },
|
|
64
|
+
}, composition: composition, width: width, color: color, forceHover: forceHover, responsive: responsive_ },
|
|
58
65
|
icon && react_1.default.createElement(DisplayIcon, { icon: icon, color: iconColor, size: calcIconSize(), iconWeight: iconWeight || '' }),
|
|
59
|
-
displayText && react_1.default.createElement(
|
|
66
|
+
displayText && react_1.default.createElement(DisplayTextTypo, null, displayText),
|
|
60
67
|
iconAfter && react_1.default.createElement(DisplayIcon, { icon: iconAfter, color: iconColor, size: calcIconSize(), iconWeight: iconWeight || '' })));
|
|
61
68
|
};
|
|
62
69
|
/**
|
|
@@ -77,9 +84,13 @@ var ButtonPrimary = function (props) { return (react_1.default.createElement(But
|
|
|
77
84
|
exports.ButtonPrimary = ButtonPrimary;
|
|
78
85
|
var ButtonSecondary = function (props) { return (react_1.default.createElement(Button, { props: props, variant: "secondary" })); };
|
|
79
86
|
exports.ButtonSecondary = ButtonSecondary;
|
|
87
|
+
var ButtonTertiary = function (props) { return (react_1.default.createElement(Button, { props: props, variant: "tertiary" })); };
|
|
88
|
+
exports.ButtonTertiary = ButtonTertiary;
|
|
80
89
|
var ButtonGhost = function (props) { return (react_1.default.createElement(Button, { props: props, variant: "ghost" })); };
|
|
81
90
|
exports.ButtonGhost = ButtonGhost;
|
|
82
|
-
var
|
|
83
|
-
Object.defineProperty(exports, "
|
|
84
|
-
var
|
|
85
|
-
Object.defineProperty(exports, "
|
|
91
|
+
var ButtonSecondaryCompact_1 = require("./derivedComps/ButtonSecondaryCompact");
|
|
92
|
+
Object.defineProperty(exports, "ButtonSecondaryCompact", { enumerable: true, get: function () { return ButtonSecondaryCompact_1.ButtonSecondaryCompact; } });
|
|
93
|
+
var ButtonPrimaryCompact_1 = require("./derivedComps/ButtonPrimaryCompact");
|
|
94
|
+
Object.defineProperty(exports, "ButtonPrimaryCompact", { enumerable: true, get: function () { return ButtonPrimaryCompact_1.ButtonPrimaryCompact; } });
|
|
95
|
+
var ButtonTertiaryCompact_1 = require("./derivedComps/ButtonTertiaryCompact");
|
|
96
|
+
Object.defineProperty(exports, "ButtonTertiaryCompact", { enumerable: true, get: function () { return ButtonTertiaryCompact_1.ButtonTertiaryCompact; } });
|
|
@@ -1,22 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export
|
|
3
|
-
active?: boolean;
|
|
4
|
-
theme: {
|
|
5
|
-
colors: any;
|
|
6
|
-
};
|
|
7
|
-
}
|
|
8
|
-
export interface ButtonVariantProps {
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
color?: string;
|
|
11
|
-
forceHover?: boolean;
|
|
12
|
-
theme: {
|
|
13
|
-
colors: string[];
|
|
14
|
-
};
|
|
15
|
-
active?: boolean;
|
|
16
|
-
}
|
|
17
|
-
export interface ButtonGhostProps extends ButtonVariantProps {
|
|
18
|
-
composition?: string;
|
|
19
|
-
}
|
|
2
|
+
export type ButtonComposition = 'iconOnly' | 'icon+text' | 'textOnly';
|
|
20
3
|
export interface ButtonStyledProps {
|
|
21
4
|
size: string;
|
|
22
5
|
width?: string;
|
|
@@ -24,6 +7,7 @@ export interface ButtonStyledProps {
|
|
|
24
7
|
active?: boolean;
|
|
25
8
|
composition?: string;
|
|
26
9
|
forceHover?: boolean;
|
|
10
|
+
responsive?: boolean;
|
|
27
11
|
}
|
|
28
12
|
export declare const ButtonStyled: import("styled-components").StyledComponent<"button", any, ButtonStyledProps, never>;
|
|
29
|
-
export declare const
|
|
13
|
+
export declare const StyledBodyText: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../Typo2").TypoCompProps>, any, {}, never>;
|