oolib 2.157.2 → 2.158.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/Dropdowns/comps/SelectDropdown/index.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +8 -3
- package/dist/stories/v2/components/BlockLabel.stories.d.ts +7 -0
- package/dist/stories/v2/components/BlockLabel.stories.js +28 -2
- package/dist/stories/{Oolib → v2}/components/TabBar.stories.d.ts +13 -15
- package/dist/stories/{Oolib → v2}/components/TabBar.stories.js +13 -16
- package/dist/stories/v2/components/TextInputs.stories.d.ts +10 -5
- package/dist/stories/v2/components/TextInputs.stories.js +12 -11
- package/dist/utils/getBlockLabelProps.js +2 -1
- package/dist/v2/components/BlockLabel/index.js +2 -2
- package/dist/v2/components/BlockLabel/index.styled.js +6 -1
- package/dist/v2/components/TabBar/index.d.ts +2 -0
- package/dist/v2/components/TabBar/index.js +72 -0
- package/dist/v2/components/TabBar/index.styled.d.ts +16 -0
- package/dist/v2/components/TabBar/index.styled.js +112 -0
- package/dist/v2/components/TextInputs/index.d.ts +1 -2
- package/dist/v2/components/TextInputs/index.js +6 -6
- package/dist/v2/components/TextInputs/index.styled.d.ts +3 -1
- package/dist/v2/components/TextInputs/index.styled.js +1 -2
- package/dist/v2/themes/colors.d.ts +1 -0
- package/dist/v2/themes/colors.js +13 -11
- package/dist/v2/themes/globalStyles.d.ts +3 -1
- package/dist/v2/themes/globalStyles.js +4 -1
- package/package.json +1 -1
|
@@ -49,6 +49,6 @@ var SelectDropdown = function (_a) {
|
|
|
49
49
|
// }
|
|
50
50
|
className: "".concat(selectClassName || "", " ").concat(!value && placeholder) }, dropdownSelectText.display)))),
|
|
51
51
|
react_1.default.createElement(Caret_1.Caret, { showOptions: showOptions, invert: invert, disabled: disabled }))); };
|
|
52
|
-
return genCustomSelectComp ? genCustomSelectComp() : genSelectComp();
|
|
52
|
+
return genCustomSelectComp ? genCustomSelectComp({ value: value }) : genSelectComp();
|
|
53
53
|
};
|
|
54
54
|
exports.SelectDropdown = SelectDropdown;
|
package/dist/index.d.ts
CHANGED
|
@@ -15,14 +15,13 @@ export * from "./components/RadioAndCheckbox";
|
|
|
15
15
|
export * from "./components/Margins";
|
|
16
16
|
export * from "./components/Paddings";
|
|
17
17
|
export * from "./utils/_EXPORTS";
|
|
18
|
-
export * from "./v2/components/Buttons";
|
|
19
18
|
export * from "./v2/components/Typo2";
|
|
20
19
|
export * from "./v2/components/BlockLabel";
|
|
21
20
|
export * from "./v2/components/cards/CardContent";
|
|
22
21
|
export * from "./v2/components/cards/ListContent";
|
|
23
22
|
export * from "./v2/components/Tags";
|
|
24
23
|
export * from "./v2/components/ImagePlaceholder";
|
|
25
|
-
export * from "./v2/components/
|
|
24
|
+
export * from "./v2/components/Buttons";
|
|
26
25
|
export { colors } from "./themes";
|
|
27
26
|
export { icons } from "./icons";
|
|
28
27
|
export { Section } from "./components/Section";
|
|
@@ -72,6 +71,7 @@ export { ModalConfirmAction } from "./components/Modals/derivedComps/ModalConfir
|
|
|
72
71
|
export { SimpleTable } from "./components/SimpleTable";
|
|
73
72
|
export { styledOKELinkCSS } from "./components/OKELink/styled";
|
|
74
73
|
export { default as TableCellResizerPlugin } from "./components/Lexical/Plugins/TableCellResizer";
|
|
74
|
+
export { TabBarStyle1 as TabBarV2 } from "./v2/components/TabBar";
|
|
75
75
|
export { colors as colors2 } from "./v2/themes";
|
|
76
76
|
export { HintsProvider } from "./v2/components/Hints/contextApi";
|
|
77
77
|
export { LoaderCircle, ProgressBar, LoaderCircle as Loader, LoaderOverlay } from "./components/LoadersAndProgress";
|
package/dist/index.js
CHANGED
|
@@ -18,7 +18,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
exports.GroupQuestionsInputSingle = exports.ResourceInput = exports.IFrameInput = exports.PDFInput = exports.AudioInput = exports.VideoInput = exports.ProfileImageInput = exports.ImageInput = exports.MetaBlock = exports.genTagComp = exports.generateOptions = exports.OptionsSingle = exports.DropdownMulti = exports.DropdownSingle = exports.parseCardConfig = exports.ListProfile = exports.CardProfile = exports.CardEmbed = exports.DataVizAccordion = exports.BarChart = exports.DateTimeRangePicker = exports.DateTimePicker = exports.TimeRangePicker = exports.TimePicker = exports.DateRangePicker = exports.DatePicker = exports.TextLoader = exports.PageScrollIndicator = exports.HomeCover = exports.EmptyStates = exports.ModalSmall = exports.Modal = exports.ModalForms = exports.ModalConfirm = exports.SkeletonLoader = exports.Divider = exports.PercentCompletedPie = exports.Accordion = exports.ActionMenu = exports.Tooltip = exports.OKELink = exports.UserRoleBadge = exports.Section = exports.LoaderOverlay = exports.Loader = exports.ProgressBar = exports.LoaderCircle = exports.icons = exports.colors = exports.GlobalStyles = void 0;
|
|
21
|
-
exports.HintsProvider = exports.colors2 = exports.TableCellResizerPlugin = exports.styledOKELinkCSS = exports.SimpleTable = exports.ModalConfirmAction = exports.BannerProvider = exports.useBannerContext = exports.BannerContext = exports.BannerInfo = exports.BannerAlert = void 0;
|
|
21
|
+
exports.HintsProvider = exports.colors2 = exports.TabBarV2 = exports.TableCellResizerPlugin = exports.styledOKELinkCSS = exports.SimpleTable = exports.ModalConfirmAction = exports.BannerProvider = exports.useBannerContext = exports.BannerContext = exports.BannerInfo = exports.BannerAlert = void 0;
|
|
22
|
+
var TabBar_1 = require("./v2/components/TabBar");
|
|
22
23
|
//css and styling related ( styled-components )
|
|
23
24
|
var globalStyles_1 = require("./globalStyles");
|
|
24
25
|
Object.defineProperty(exports, "GlobalStyles", { enumerable: true, get: function () { return globalStyles_1.GlobalStyles; } });
|
|
@@ -172,16 +173,20 @@ Object.defineProperty(exports, "styledOKELinkCSS", { enumerable: true, get: func
|
|
|
172
173
|
var TableCellResizer_1 = require("./components/Lexical/Plugins/TableCellResizer");
|
|
173
174
|
Object.defineProperty(exports, "TableCellResizerPlugin", { enumerable: true, get: function () { return __importDefault(TableCellResizer_1).default; } });
|
|
174
175
|
/////// V2 components /themes
|
|
175
|
-
__exportStar(require("./v2/components/Buttons"), exports);
|
|
176
176
|
__exportStar(require("./v2/components/Typo2"), exports);
|
|
177
177
|
__exportStar(require("./v2/components/BlockLabel"), exports);
|
|
178
178
|
__exportStar(require("./v2/components/cards/CardContent"), exports);
|
|
179
179
|
__exportStar(require("./v2/components/cards/ListContent"), exports);
|
|
180
180
|
__exportStar(require("./v2/components/Tags"), exports);
|
|
181
181
|
__exportStar(require("./v2/components/ImagePlaceholder"), exports);
|
|
182
|
-
|
|
182
|
+
// 2 imports available
|
|
183
|
+
__exportStar(require("./v2/components/Buttons"), exports);
|
|
184
|
+
var TabBar_2 = require("./v2/components/TabBar");
|
|
185
|
+
Object.defineProperty(exports, "TabBarV2", { enumerable: true, get: function () { return TabBar_2.TabBarStyle1; } });
|
|
183
186
|
var themes_2 = require("./v2/themes");
|
|
184
187
|
Object.defineProperty(exports, "colors2", { enumerable: true, get: function () { return themes_2.colors; } });
|
|
185
188
|
// v2 contexts
|
|
186
189
|
var contextApi_1 = require("./v2/components/Hints/contextApi");
|
|
187
190
|
Object.defineProperty(exports, "HintsProvider", { enumerable: true, get: function () { return contextApi_1.HintsProvider; } });
|
|
191
|
+
// V2 new ready components
|
|
192
|
+
// export * from './v2/components/TextInputs';
|
|
@@ -40,6 +40,10 @@ declare namespace _default {
|
|
|
40
40
|
let name_9: string;
|
|
41
41
|
export { name_9 as name };
|
|
42
42
|
}
|
|
43
|
+
namespace S {
|
|
44
|
+
let name_10: string;
|
|
45
|
+
export { name_10 as name };
|
|
46
|
+
}
|
|
43
47
|
let inputOnlyLabel: {};
|
|
44
48
|
}
|
|
45
49
|
namespace args {
|
|
@@ -65,7 +69,10 @@ declare namespace _default {
|
|
|
65
69
|
export { readOnly_1 as readOnly };
|
|
66
70
|
let inputOnlyLabel_1: string;
|
|
67
71
|
export { inputOnlyLabel_1 as inputOnlyLabel };
|
|
72
|
+
let S_1: boolean;
|
|
73
|
+
export { S_1 as S };
|
|
68
74
|
}
|
|
69
75
|
}
|
|
70
76
|
export default _default;
|
|
71
77
|
export function Block_Label(args: any): import("react").JSX.Element;
|
|
78
|
+
export function Playground(args: any): import("react").JSX.Element;
|
|
@@ -18,10 +18,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
18
18
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.Block_Label = void 0;
|
|
21
|
+
exports.Playground = exports.Block_Label = void 0;
|
|
22
22
|
var BlockLabel_1 = require("../../../v2/components/BlockLabel");
|
|
23
23
|
var themes_1 = require("../../../themes");
|
|
24
24
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
25
|
+
var __1 = require("../../..");
|
|
25
26
|
var Wrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\n /* #tempBlocklabelOverride p{\n color: red;\n } */\n"], ["\n\n /* #tempBlocklabelOverride p{\n color: red;\n } */\n"])));
|
|
26
27
|
exports.default = {
|
|
27
28
|
title: "Oolib V 2.0/Components/BlockLabel",
|
|
@@ -59,10 +60,13 @@ exports.default = {
|
|
|
59
60
|
disabled: {
|
|
60
61
|
name: "Disabled",
|
|
61
62
|
},
|
|
63
|
+
S: {
|
|
64
|
+
name: "Small"
|
|
65
|
+
},
|
|
62
66
|
inputOnlyLabel: {},
|
|
63
67
|
},
|
|
64
68
|
args: {
|
|
65
|
-
label: "
|
|
69
|
+
label: "Default label",
|
|
66
70
|
sublabel: "",
|
|
67
71
|
showHints: true,
|
|
68
72
|
hintsTitle: "Hints",
|
|
@@ -75,6 +79,7 @@ exports.default = {
|
|
|
75
79
|
// invert: false,
|
|
76
80
|
readOnly: false,
|
|
77
81
|
inputOnlyLabel: "Shows only if label is not defined. AND readOnly = true",
|
|
82
|
+
S: false,
|
|
78
83
|
},
|
|
79
84
|
};
|
|
80
85
|
var dummyData1 = [
|
|
@@ -114,4 +119,25 @@ var Block_Label = function (args) {
|
|
|
114
119
|
} }, (React.createElement(BlockLabel_1.BlockLabel, __assign({ id: "hints_1", hints: args.showHints ? dummyData2 : "" }, args, { errorMsgs: errorMsgs }))) || "no label provided"))));
|
|
115
120
|
};
|
|
116
121
|
exports.Block_Label = Block_Label;
|
|
122
|
+
var Playground = function (args) {
|
|
123
|
+
// return () => {
|
|
124
|
+
// document.getElementsByTagName("body")[0].removeChild(hintsRootElem);
|
|
125
|
+
// };
|
|
126
|
+
var errorMsgs = args.errorMessage ? args.errorMessage.split(",") : undefined;
|
|
127
|
+
return (React.createElement(Wrapper, null,
|
|
128
|
+
React.createElement("div", { style: {
|
|
129
|
+
display: "flex",
|
|
130
|
+
justifyContent: "space-between",
|
|
131
|
+
position: "relative",
|
|
132
|
+
padding: "2rem",
|
|
133
|
+
backgroundColor: args.invert ? themes_1.colors.greyColor100 : "",
|
|
134
|
+
} },
|
|
135
|
+
React.createElement("div", { style: {
|
|
136
|
+
backgroundColor: args.invert ? themes_1.colors.greyColor100 : "",
|
|
137
|
+
padding: "10px",
|
|
138
|
+
} },
|
|
139
|
+
(React.createElement(BlockLabel_1.BlockLabel, __assign({ id: "hints_1", hints: args.showHints ? dummyData2 : "" }, args, { errorMsgs: errorMsgs }))) || "no label provided",
|
|
140
|
+
React.createElement("div", { style: { background: __1.colors2.grey5, width: '100svw', height: '20rem' } })))));
|
|
141
|
+
};
|
|
142
|
+
exports.Playground = Playground;
|
|
117
143
|
var templateObject_1;
|
|
@@ -1,45 +1,40 @@
|
|
|
1
1
|
declare namespace _default {
|
|
2
2
|
let title: string;
|
|
3
3
|
namespace argTypes {
|
|
4
|
-
namespace
|
|
4
|
+
namespace color {
|
|
5
5
|
let name: string;
|
|
6
6
|
let options: string[];
|
|
7
|
-
namespace mapping {
|
|
8
|
-
let Primary: string;
|
|
9
|
-
let Secondary: string;
|
|
10
|
-
}
|
|
11
7
|
namespace control {
|
|
12
8
|
let type: string;
|
|
13
9
|
}
|
|
14
10
|
}
|
|
15
|
-
namespace
|
|
11
|
+
namespace size {
|
|
16
12
|
let name_1: string;
|
|
17
13
|
export { name_1 as name };
|
|
18
14
|
let options_1: string[];
|
|
19
15
|
export { options_1 as options };
|
|
16
|
+
export namespace mapping {
|
|
17
|
+
let Small: string;
|
|
18
|
+
let Medium: string;
|
|
19
|
+
}
|
|
20
20
|
export namespace control_1 {
|
|
21
21
|
let type_1: string;
|
|
22
22
|
export { type_1 as type };
|
|
23
23
|
}
|
|
24
24
|
export { control_1 as control };
|
|
25
25
|
}
|
|
26
|
-
namespace
|
|
26
|
+
namespace errorTabs {
|
|
27
27
|
let name_2: string;
|
|
28
28
|
export { name_2 as name };
|
|
29
29
|
let options_2: string[];
|
|
30
30
|
export { options_2 as options };
|
|
31
|
-
export namespace mapping_1 {
|
|
32
|
-
let Small: string;
|
|
33
|
-
let Medium: string;
|
|
34
|
-
}
|
|
35
|
-
export { mapping_1 as mapping };
|
|
36
31
|
export namespace control_2 {
|
|
37
32
|
let type_2: string;
|
|
38
33
|
export { type_2 as type };
|
|
39
34
|
}
|
|
40
35
|
export { control_2 as control };
|
|
41
36
|
}
|
|
42
|
-
namespace
|
|
37
|
+
namespace disabledTabs {
|
|
43
38
|
let name_3: string;
|
|
44
39
|
export { name_3 as name };
|
|
45
40
|
let options_3: string[];
|
|
@@ -56,8 +51,6 @@ declare namespace _default {
|
|
|
56
51
|
}
|
|
57
52
|
}
|
|
58
53
|
namespace args {
|
|
59
|
-
let tabBarStyle_1: string;
|
|
60
|
-
export { tabBarStyle_1 as tabBarStyle };
|
|
61
54
|
let size_1: string;
|
|
62
55
|
export { size_1 as size };
|
|
63
56
|
let color_1: string;
|
|
@@ -66,6 +59,11 @@ declare namespace _default {
|
|
|
66
59
|
export { changeWidth_1 as changeWidth };
|
|
67
60
|
let errorTabs_1: string;
|
|
68
61
|
export { errorTabs_1 as errorTabs };
|
|
62
|
+
let disabledTabs_1: string;
|
|
63
|
+
export { disabledTabs_1 as disabledTabs };
|
|
64
|
+
export let responsive: boolean;
|
|
65
|
+
let title_1: string;
|
|
66
|
+
export { title_1 as title };
|
|
69
67
|
}
|
|
70
68
|
}
|
|
71
69
|
export default _default;
|
|
@@ -36,24 +36,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
37
|
exports.TabBar_ = void 0;
|
|
38
38
|
var react_1 = __importStar(require("react"));
|
|
39
|
-
var TabBars = __importStar(require("../../../components/TabBar"));
|
|
39
|
+
var TabBars = __importStar(require("../../../v2/components/TabBar"));
|
|
40
40
|
exports.default = {
|
|
41
|
-
title: "
|
|
41
|
+
title: "Oolib V 2.0/components/TabBar",
|
|
42
42
|
argTypes: {
|
|
43
|
-
tabBarStyle: {
|
|
44
|
-
name: "Tab Bar Style",
|
|
45
|
-
options: ["Primary", "Secondary"],
|
|
46
|
-
mapping: {
|
|
47
|
-
Primary: '1',
|
|
48
|
-
Secondary: '2',
|
|
49
|
-
},
|
|
50
|
-
control: { type: "select" },
|
|
51
|
-
},
|
|
52
43
|
color: {
|
|
53
44
|
name: "Color",
|
|
54
45
|
options: ['blue', "black"],
|
|
55
46
|
control: { type: 'inline-radio' },
|
|
56
|
-
// if: { arg: 'tabBarStyle', eq: 'Primary' },
|
|
57
47
|
},
|
|
58
48
|
size: {
|
|
59
49
|
name: "Size",
|
|
@@ -69,16 +59,23 @@ exports.default = {
|
|
|
69
59
|
options: ['value1', 'value2', 'value3'],
|
|
70
60
|
control: { type: 'inline-check' },
|
|
71
61
|
},
|
|
62
|
+
disabledTabs: {
|
|
63
|
+
name: "Disabled Tabs",
|
|
64
|
+
options: ['value1', 'value2', 'value3'],
|
|
65
|
+
control: { type: 'inline-check' },
|
|
66
|
+
},
|
|
72
67
|
changeWidth: {
|
|
73
68
|
name: "Change Width"
|
|
74
69
|
}
|
|
75
70
|
},
|
|
76
71
|
args: {
|
|
77
|
-
tabBarStyle: "Primary",
|
|
78
72
|
size: "Medium",
|
|
79
73
|
color: "blue",
|
|
80
74
|
changeWidth: false,
|
|
81
75
|
errorTabs: "",
|
|
76
|
+
disabledTabs: "",
|
|
77
|
+
responsive: false,
|
|
78
|
+
title: "Page"
|
|
82
79
|
}
|
|
83
80
|
};
|
|
84
81
|
var TabBar_ = function (args) {
|
|
@@ -92,12 +89,12 @@ var TabBar_ = function (args) {
|
|
|
92
89
|
{ display: "display 6", value: "value7" },
|
|
93
90
|
];
|
|
94
91
|
var errorTabs = args.errorTabs && options.filter(function (op) { return args.errorTabs.includes(op.value); });
|
|
92
|
+
var disabledTabs = args.disabledTabs && options.filter(function (op) { return args.disabledTabs.includes(op.value); });
|
|
95
93
|
var _a = (0, react_1.useState)(options[0]), active = _a[0], setActive = _a[1];
|
|
96
94
|
args.options = options;
|
|
97
95
|
args.value = active;
|
|
98
96
|
args.onChange = function (id, value) { return setActive(value); };
|
|
99
|
-
return (react_1.default.createElement("div", { style: { width: !args.changeWidth ? '' : '400px' } },
|
|
100
|
-
|
|
101
|
-
: react_1.default.createElement(TabBars.TabBarStyle1, __assign({}, args, { errorTabs: errorTabs, black: args.color === "black" ? true : false }))));
|
|
97
|
+
return (react_1.default.createElement("div", { style: { width: !args.changeWidth ? '' : '400px' } },
|
|
98
|
+
react_1.default.createElement(TabBars.TabBarStyle1, __assign({}, args, { errorTabs: errorTabs, disabledTabs: disabledTabs, black: args.color === "black" ? true : false }))));
|
|
102
99
|
};
|
|
103
100
|
exports.TabBar_ = TabBar_;
|
|
@@ -61,6 +61,10 @@ declare namespace _default {
|
|
|
61
61
|
let name_13: string;
|
|
62
62
|
export { name_13 as name };
|
|
63
63
|
}
|
|
64
|
+
namespace sublabel {
|
|
65
|
+
let name_14: string;
|
|
66
|
+
export { name_14 as name };
|
|
67
|
+
}
|
|
64
68
|
}
|
|
65
69
|
namespace args {
|
|
66
70
|
let icon_1: any;
|
|
@@ -85,13 +89,14 @@ declare namespace _default {
|
|
|
85
89
|
export { isRequired_1 as isRequired };
|
|
86
90
|
let disabled_1: boolean;
|
|
87
91
|
export { disabled_1 as disabled };
|
|
88
|
-
export let invert: boolean;
|
|
89
92
|
let customErrorMsg_1: string;
|
|
90
93
|
export { customErrorMsg_1 as customErrorMsg };
|
|
91
94
|
let errorLinkText_1: string;
|
|
92
95
|
export { errorLinkText_1 as errorLinkText };
|
|
93
96
|
let S_1: boolean;
|
|
94
97
|
export { S_1 as S };
|
|
98
|
+
let sublabel_1: string;
|
|
99
|
+
export { sublabel_1 as sublabel };
|
|
95
100
|
}
|
|
96
101
|
}
|
|
97
102
|
export default _default;
|
|
@@ -109,13 +114,13 @@ export namespace Number_ {
|
|
|
109
114
|
export { args_1 as args };
|
|
110
115
|
export namespace argTypes_1 {
|
|
111
116
|
export namespace min_1 {
|
|
112
|
-
let
|
|
113
|
-
export {
|
|
117
|
+
let name_15: string;
|
|
118
|
+
export { name_15 as name };
|
|
114
119
|
}
|
|
115
120
|
export { min_1 as min };
|
|
116
121
|
export namespace max_1 {
|
|
117
|
-
let
|
|
118
|
-
export {
|
|
122
|
+
let name_16: string;
|
|
123
|
+
export { name_16 as name };
|
|
119
124
|
}
|
|
120
125
|
export { max_1 as max };
|
|
121
126
|
}
|
|
@@ -38,7 +38,6 @@ exports.Number_ = exports.URL_ = exports.Phone_ = exports.Password_ = exports.Em
|
|
|
38
38
|
var react_1 = __importStar(require("react"));
|
|
39
39
|
var TextInputs_1 = require("../../../v2/components/TextInputs");
|
|
40
40
|
var icons_1 = require("../../../icons");
|
|
41
|
-
var themes_1 = require("../../../themes");
|
|
42
41
|
var availableIcons = Object.keys(icons_1.icons).sort();
|
|
43
42
|
exports.default = {
|
|
44
43
|
title: 'Oolib V 2.0/components/TextInputs',
|
|
@@ -87,6 +86,9 @@ exports.default = {
|
|
|
87
86
|
},
|
|
88
87
|
S: {
|
|
89
88
|
name: "Small"
|
|
89
|
+
},
|
|
90
|
+
sublabel: {
|
|
91
|
+
name: "Sub Label"
|
|
90
92
|
}
|
|
91
93
|
},
|
|
92
94
|
args: {
|
|
@@ -101,10 +103,10 @@ exports.default = {
|
|
|
101
103
|
readOnly: false,
|
|
102
104
|
isRequired: false,
|
|
103
105
|
disabled: false,
|
|
104
|
-
invert: false,
|
|
105
106
|
customErrorMsg: 'This is custom error message',
|
|
106
107
|
errorLinkText: "Error Link",
|
|
107
108
|
S: false,
|
|
109
|
+
sublabel: 'Some sub label',
|
|
108
110
|
},
|
|
109
111
|
};
|
|
110
112
|
var GenInputStories = function (_a) {
|
|
@@ -132,14 +134,13 @@ var GenInputStories = function (_a) {
|
|
|
132
134
|
};
|
|
133
135
|
var actionBtn;
|
|
134
136
|
if (args.actionButton) {
|
|
135
|
-
actionBtn = { text: args.actionButtonText,
|
|
137
|
+
actionBtn = { text: args.actionButtonText, onClick: function () { return console.log('clicked'); }, icon: args.actionButtonIcon };
|
|
136
138
|
}
|
|
137
139
|
var clearBtn;
|
|
138
140
|
if (args.clearButton) {
|
|
139
|
-
clearBtn = { text: args.clearButtonText,
|
|
141
|
+
clearBtn = { text: args.clearButtonText, onClick: function () { return console.log('clicked'); }, icon: args.clearButtonIcon };
|
|
140
142
|
}
|
|
141
143
|
return (react_1.default.createElement("div", { style: {
|
|
142
|
-
backgroundColor: args.invert ? themes_1.colors.greyColor100 : '',
|
|
143
144
|
padding: '10px',
|
|
144
145
|
} },
|
|
145
146
|
react_1.default.createElement(Comp, __assign({}, newProps, { onChange: handleOnChange, value: value, actionBtn: actionBtn, clearBtn: clearBtn, passValidationErrorToFormValidation: function (status) {
|
|
@@ -153,26 +154,26 @@ var GenInputStories = function (_a) {
|
|
|
153
154
|
}, validationStatus: formValidation }))));
|
|
154
155
|
};
|
|
155
156
|
var Text = function (args) { return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
156
|
-
react_1.default.createElement(GenInputStories, { args: __assign(__assign({}, args), { label: '
|
|
157
|
+
react_1.default.createElement(GenInputStories, { args: __assign(__assign({}, args), { label: 'Text input' }), Comp: TextInputs_1.TextInput }))); };
|
|
157
158
|
exports.Text = Text;
|
|
158
159
|
var Email_ = function (args) {
|
|
159
|
-
return (react_1.default.createElement(GenInputStories, { args: __assign(__assign({}, args), { label: '
|
|
160
|
+
return (react_1.default.createElement(GenInputStories, { args: __assign(__assign({}, args), { label: 'Email input' }), Comp: TextInputs_1.EmailInput }));
|
|
160
161
|
};
|
|
161
162
|
exports.Email_ = Email_;
|
|
162
163
|
var Password_ = function (args) {
|
|
163
|
-
return (react_1.default.createElement(GenInputStories, { args: __assign(__assign({}, args), { label: '
|
|
164
|
+
return (react_1.default.createElement(GenInputStories, { args: __assign(__assign({}, args), { label: 'Password input' }), Comp: TextInputs_1.PasswordInput }));
|
|
164
165
|
};
|
|
165
166
|
exports.Password_ = Password_;
|
|
166
167
|
var Phone_ = function (args) {
|
|
167
|
-
return (react_1.default.createElement(GenInputStories, { args: __assign(__assign({}, args), { label: '
|
|
168
|
+
return (react_1.default.createElement(GenInputStories, { args: __assign(__assign({}, args), { label: 'Phone input' }), Comp: TextInputs_1.PhoneInput }));
|
|
168
169
|
};
|
|
169
170
|
exports.Phone_ = Phone_;
|
|
170
171
|
var URL_ = function (args) {
|
|
171
|
-
return (react_1.default.createElement(GenInputStories, { args: __assign(__assign({}, args), { label: '
|
|
172
|
+
return (react_1.default.createElement(GenInputStories, { args: __assign(__assign({}, args), { label: 'Url input' }), Comp: TextInputs_1.URLInput }));
|
|
172
173
|
};
|
|
173
174
|
exports.URL_ = URL_;
|
|
174
175
|
var Number_ = function (args) {
|
|
175
|
-
return (react_1.default.createElement(GenInputStories, { args: __assign(__assign({}, args), { label: '
|
|
176
|
+
return (react_1.default.createElement(GenInputStories, { args: __assign(__assign({}, args), { label: 'Number input' }), Comp: TextInputs_1.NumberInput }));
|
|
176
177
|
};
|
|
177
178
|
exports.Number_ = Number_;
|
|
178
179
|
exports.Number_.args = {
|
|
@@ -37,7 +37,7 @@ var Typo2_1 = require("../Typo2");
|
|
|
37
37
|
var colors_1 = require("../../themes/colors");
|
|
38
38
|
var grey40 = colors_1.colors.grey40, grey60 = colors_1.colors.grey60;
|
|
39
39
|
var BlockLabel = function (props) {
|
|
40
|
-
var label = props.label, sublabel = props.sublabel, inputOnlyLabel = props.inputOnlyLabel, invert = props.invert, isRequired = props.isRequired, readOnly = props.readOnly, className = props.className, style = props.style, errorMsgs = props.errorMsgs, hints = props.hints, id = props.id, hintsTitle = props.hintsTitle, hintsBtnLabel = props.hintsBtnLabel, hintsSubtitle = props.hintsSubtitle, hideOptionalLabel = props.hideOptionalLabel, infoTooltip = props.infoTooltip, disabled = props.disabled;
|
|
40
|
+
var label = props.label, sublabel = props.sublabel, inputOnlyLabel = props.inputOnlyLabel, invert = props.invert, isRequired = props.isRequired, readOnly = props.readOnly, className = props.className, style = props.style, errorMsgs = props.errorMsgs, hints = props.hints, id = props.id, hintsTitle = props.hintsTitle, hintsBtnLabel = props.hintsBtnLabel, hintsSubtitle = props.hintsSubtitle, hideOptionalLabel = props.hideOptionalLabel, infoTooltip = props.infoTooltip, disabled = props.disabled, S = props.S;
|
|
41
41
|
var shouldCompRender = label ||
|
|
42
42
|
(!readOnly &&
|
|
43
43
|
(sublabel ||
|
|
@@ -51,7 +51,7 @@ var BlockLabel = function (props) {
|
|
|
51
51
|
var errType = (errorMsgs === null || errorMsgs === void 0 ? void 0 : errorMsgs.length) !== 1 //this first condition seems like a proper hack..
|
|
52
52
|
? "danger"
|
|
53
53
|
: errorMsgs[0].type || "danger";
|
|
54
|
-
return (shouldCompRender && (react_1.default.createElement(index_styled_1.StyledBlockLabel, { style: style, className: className, id: "tempBlocklabelOverride" },
|
|
54
|
+
return (shouldCompRender && (react_1.default.createElement(index_styled_1.StyledBlockLabel, { style: style, className: className, id: "tempBlocklabelOverride", sublabel: sublabel, S: S },
|
|
55
55
|
react_1.default.createElement("div", { style: { display: "flex", gap: "0.4rem" } },
|
|
56
56
|
(label || inputOnlyLabel) && (react_1.default.createElement(Typo2_1.UI_BODY_SM, { color: disabled ? colors_1.colors.grey40 : colors_1.colors.grey80, semibold: true }, label || inputOnlyLabel)),
|
|
57
57
|
!readOnly && (errorMsgs === null || errorMsgs === void 0 ? void 0 : errorMsgs.length) > 0 ? (react_1.default.createElement(InlineAlert_1.InlineAlert, { text: errText, type: errType, link: errLink, invert: invert })) : null,
|
|
@@ -9,6 +9,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.StyledInfoTooltipbutton = exports.StyledBlockLabel = void 0;
|
|
11
11
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
|
-
exports.StyledBlockLabel = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: 0.2rem;\n margin-bottom:
|
|
12
|
+
exports.StyledBlockLabel = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: 0.2rem;\n margin-bottom: ", ";\n\n position: relative;\n"], ["\n display: flex;\n flex-direction: column;\n gap: 0.2rem;\n margin-bottom: ", ";\n\n position: relative;\n"])), function (_a) {
|
|
13
|
+
var sublabel = _a.sublabel, S = _a.S;
|
|
14
|
+
return S
|
|
15
|
+
? (sublabel ? '0.4rem' : '0.2rem')
|
|
16
|
+
: (sublabel ? '0.6rem' : '0.4rem');
|
|
17
|
+
});
|
|
13
18
|
exports.StyledInfoTooltipbutton = styled_components_1.default.button(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border: none;\n background: none;\n outline: none;\n"], ["\n border: none;\n background: none;\n outline: none;\n"])));
|
|
14
19
|
var templateObject_1, templateObject_2;
|
|
@@ -0,0 +1,72 @@
|
|
|
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.TabBarStyle1 = void 0;
|
|
18
|
+
var react_1 = __importDefault(require("react"));
|
|
19
|
+
var useScrollBar_1 = require("../../../utils/customHooks/useScrollBar");
|
|
20
|
+
var Buttons_1 = require("../../../components/Buttons");
|
|
21
|
+
var index_styled_1 = require("./index.styled");
|
|
22
|
+
var _EXPORTS_1 = require("../../../utils/_EXPORTS");
|
|
23
|
+
var DropdownSingle_1 = require("../../../components/Dropdowns/DropdownSingle");
|
|
24
|
+
var mixins_1 = require("../../../themes/mixins");
|
|
25
|
+
var Typo2_1 = require("../Typo2");
|
|
26
|
+
var phosphor_react_1 = require("phosphor-react");
|
|
27
|
+
var colors_1 = require("../../themes/colors");
|
|
28
|
+
var Base = function (_a) {
|
|
29
|
+
var id = _a.id, options = _a.options, valueProp = _a.value, onChange = _a.onChange, style = _a.style, errorTabs = _a.errorTabs, disabledTabs = _a.disabledTabs, _b = _a.tabBarStyle, tabBarStyle = _b === void 0 ? '1' : _b, saveValueAsString = _a.saveValueAsString, _c = _a.black, black = _c === void 0 ? false : _c, M = _a.M, S = _a.S, _size = _a.size //use any one of these 3
|
|
30
|
+
;
|
|
31
|
+
var size = _size || (S ? 'S' : 'M'); //defaults to M
|
|
32
|
+
var value = saveValueAsString ? options.find(function (d) { return d.value === valueProp; }) : valueProp;
|
|
33
|
+
var _d = (0, useScrollBar_1.useScrollBar)(), scrollContainerRef = _d.scrollContainerRef, scrollX = _d.scrollX, scrollIsAtEnd = _d.scrollIsAtEnd, scrollIsAtStart = _d.scrollIsAtStart, slide = _d.slide;
|
|
34
|
+
var handleClick = function (v) {
|
|
35
|
+
onChange && onChange(id, saveValueAsString ? v.value : v);
|
|
36
|
+
};
|
|
37
|
+
return (react_1.default.createElement(index_styled_1.TabBarStyled, { size: size, style: style },
|
|
38
|
+
react_1.default.createElement(index_styled_1.TabBarContainerStyled, { id: id },
|
|
39
|
+
!scrollIsAtStart && (react_1.default.createElement(index_styled_1.StyledDirectionButtons, { left: true },
|
|
40
|
+
react_1.default.createElement(Buttons_1.ButtonGhost, { S: true, icon: 'CaretLeft', style: { height: '100%' }, onClick: function () { return slide("left"); } }))),
|
|
41
|
+
react_1.default.createElement("div", { ref: scrollContainerRef, style: { maxWidth: '100%', height: '100%', overflow: 'hidden' } },
|
|
42
|
+
react_1.default.createElement(index_styled_1.TabBarRowStyled, { id: id, translateX: scrollX }, options.map(function (op) {
|
|
43
|
+
var tabHasError = errorTabs && errorTabs.some(function (tab) { return tab.value === op.value; });
|
|
44
|
+
var tabIsDisabled = disabledTabs && disabledTabs.some(function (tab) { return tab.value === op.value; });
|
|
45
|
+
var tabIsActive = value && op.value === value.value;
|
|
46
|
+
return (react_1.default.createElement(index_styled_1.TabBarTabWrapper, { tabBarStyle: tabBarStyle, key: op.value, active: tabIsActive, error: tabHasError, disabled: tabIsDisabled, black: black },
|
|
47
|
+
react_1.default.createElement(index_styled_1.TabBarTabStyled, { size: size, active: tabIsActive, error: tabHasError, disabled: tabIsDisabled, tabBarStyle: tabBarStyle, onClick: function () { return handleClick(op); }, black: black },
|
|
48
|
+
react_1.default.createElement(index_styled_1.STYLED_TYPO, { capitalize: true }, op.display),
|
|
49
|
+
tabHasError && react_1.default.createElement(index_styled_1.StyledDot, { active: tabIsActive, error: tabHasError, tabBarStyle: tabBarStyle }))));
|
|
50
|
+
}))),
|
|
51
|
+
!scrollIsAtEnd && (react_1.default.createElement(index_styled_1.StyledDirectionButtons, { right: true },
|
|
52
|
+
react_1.default.createElement(Buttons_1.ButtonGhost, { S: true, icon: 'CaretRight', style: { height: '100%' }, onClick: function () { return slide("right"); } }))))));
|
|
53
|
+
};
|
|
54
|
+
var TabBarStyle1 = function (props) {
|
|
55
|
+
var screenWidth = (0, _EXPORTS_1.useScreenWidth)();
|
|
56
|
+
var isDesktop = screenWidth >= (0, mixins_1.getBreakPoint)("sm");
|
|
57
|
+
return (props.responsive && !isDesktop
|
|
58
|
+
? (react_1.default.createElement(DropdownSingle_1.DropdownSingle, __assign({}, props, { genCustomSelectComp: function (_a) {
|
|
59
|
+
var value = _a.value;
|
|
60
|
+
return react_1.default.createElement(CustomSelectComp, { value: value, title: props.title });
|
|
61
|
+
} })))
|
|
62
|
+
: (react_1.default.createElement(Base, __assign({}, props, { tabBarStyle: "1" }))));
|
|
63
|
+
};
|
|
64
|
+
exports.TabBarStyle1 = TabBarStyle1;
|
|
65
|
+
var CustomSelectComp = function (_a) {
|
|
66
|
+
var value = _a.value, title = _a.title;
|
|
67
|
+
return (react_1.default.createElement(index_styled_1.StyledWrapper, null,
|
|
68
|
+
react_1.default.createElement("div", null,
|
|
69
|
+
react_1.default.createElement(Typo2_1.UI_TAG, { style: { color: colors_1.colors.grey40 } }, title),
|
|
70
|
+
react_1.default.createElement(Typo2_1.UI_BODY_SEMIBOLD_SM, { capitalize: true, style: { color: colors_1.colors.black } }, value.display)),
|
|
71
|
+
react_1.default.createElement(phosphor_react_1.List, { size: 18, weight: "bold" })));
|
|
72
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export namespace wrapperStyles {
|
|
2
|
+
let style1: import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<any>>;
|
|
3
|
+
}
|
|
4
|
+
export namespace tabStyles {
|
|
5
|
+
let style1_1: import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<any>>;
|
|
6
|
+
export { style1_1 as style1 };
|
|
7
|
+
}
|
|
8
|
+
export const TabBarStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
9
|
+
export const TabBarContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
10
|
+
export const TabBarRowStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
11
|
+
export const TabBarTabWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
12
|
+
export const TabBarTabStyled: import("styled-components").StyledComponent<"button", any, {}, never>;
|
|
13
|
+
export const STYLED_TYPO: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../Typo2").TypoCompProps>, any, {}, never>;
|
|
14
|
+
export const StyledDirectionButtons: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
15
|
+
export const StyledDot: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
16
|
+
export const StyledWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
+
if (mod && mod.__esModule) return mod;
|
|
24
|
+
var result = {};
|
|
25
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
+
__setModuleDefault(result, mod);
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.StyledWrapper = exports.StyledDot = exports.StyledDirectionButtons = exports.STYLED_TYPO = exports.TabBarTabStyled = exports.TabBarTabWrapper = exports.TabBarRowStyled = exports.TabBarContainerStyled = exports.TabBarStyled = exports.tabStyles = exports.wrapperStyles = void 0;
|
|
31
|
+
var styled_components_1 = __importStar(require("styled-components"));
|
|
32
|
+
var mixins_1 = require("../../../themes/mixins");
|
|
33
|
+
var themes_1 = require("../../themes");
|
|
34
|
+
var utils_1 = require("../../themes/utils");
|
|
35
|
+
var Typo2_1 = require("../Typo2");
|
|
36
|
+
var secondaryContainer = themes_1.colors.secondaryContainer, onSecondary = themes_1.colors.onSecondary, white = themes_1.colors.white, black = themes_1.colors.black, grey80 = themes_1.colors.grey80, grey40 = themes_1.colors.grey40, grey10 = themes_1.colors.grey10, errorColor = themes_1.colors.error;
|
|
37
|
+
exports.wrapperStyles = {
|
|
38
|
+
style1: (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n :first-of-type {\n border-radius: 1px 0 0 2px;\n }\n :last-of-type {\n border-radius: 0 2px 2px 0;\n }\n\n background-color: white;\n color: ", ";\n \n ", " \n\n ", "\n\n ", "\n\n \n "], ["\n :first-of-type {\n border-radius: 1px 0 0 2px;\n }\n :last-of-type {\n border-radius: 0 2px 2px 0;\n }\n\n background-color: white;\n color: ", ";\n \n ", " \n\n ", "\n\n ", "\n\n \n "])), function (_a) {
|
|
39
|
+
var error = _a.error, active = _a.active, disabled = _a.disabled;
|
|
40
|
+
return active && error ? errorColor : disabled ? grey40 : black;
|
|
41
|
+
}, function (_a) {
|
|
42
|
+
var disabled = _a.disabled;
|
|
43
|
+
return disabled && (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n cursor: not-allowed;\n color: ", ";\n "], ["\n cursor: not-allowed;\n color: ", ";\n "])), grey40);
|
|
44
|
+
}, function (_a) {
|
|
45
|
+
var error = _a.error;
|
|
46
|
+
return error && (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative;\n "], ["\n position: relative;\n "])));
|
|
47
|
+
}, function (_a) {
|
|
48
|
+
var active = _a.active;
|
|
49
|
+
return active && (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n /* border-radius: 0.2rem; */\n position: relative;\n "], ["\n /* border-radius: 0.2rem; */\n position: relative;\n "])));
|
|
50
|
+
})
|
|
51
|
+
};
|
|
52
|
+
exports.tabStyles = {
|
|
53
|
+
style1: (0, styled_components_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n border-radius: 6px;\n background-color: ", ";\n color: ", ";\n \n ", " \n \n &:active {\n background-color: ", " ;\n color: ", " ;\n }\n \n &:hover {\n background-color: ", ";\n color: ", ";\n border-radius: 6px;\n } \n \n ", "\n "], ["\n border-radius: 6px;\n background-color: ", ";\n color: ", ";\n \n ", " \n \n &:active {\n background-color: ", " ;\n color: ", " ;\n }\n \n &:hover {\n background-color: ", ";\n color: ", ";\n border-radius: 6px;\n } \n \n ", "\n "])), function (_a) {
|
|
54
|
+
var active = _a.active, disabled = _a.disabled, colors = _a.theme.colors;
|
|
55
|
+
return active ? (0, utils_1.getSecondaryContainer)(colors) || secondaryContainer : white;
|
|
56
|
+
}, function (_a) {
|
|
57
|
+
var active = _a.active, disabled = _a.disabled, colors = _a.theme.colors;
|
|
58
|
+
return disabled ? grey40 : active ? (0, utils_1.getOnSecondary)(colors) || onSecondary : grey80;
|
|
59
|
+
}, function (_a) {
|
|
60
|
+
var disabled = _a.disabled;
|
|
61
|
+
return disabled && (0, styled_components_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n cursor: not-allowed;\n color: ", ";\n "], ["\n cursor: not-allowed;\n color: ", ";\n "])), grey40);
|
|
62
|
+
}, function (_a) {
|
|
63
|
+
var disabled = _a.disabled, colors = _a.theme.colors;
|
|
64
|
+
return disabled ? grey40 : (0, utils_1.getSecondaryContainer)(colors) || secondaryContainer;
|
|
65
|
+
}, function (_a) {
|
|
66
|
+
var colors = _a.theme.colors;
|
|
67
|
+
return (0, utils_1.getOnSecondary)(colors) || onSecondary;
|
|
68
|
+
}, function (_a) {
|
|
69
|
+
var disabled = _a.disabled;
|
|
70
|
+
return disabled ? white : grey10;
|
|
71
|
+
}, function (_a) {
|
|
72
|
+
var disabled = _a.disabled, colors = _a.theme.colors;
|
|
73
|
+
return disabled ? grey40 : (0, utils_1.getOnSecondary)(colors) || onSecondary;
|
|
74
|
+
}, (0, mixins_1.transition)("color"))
|
|
75
|
+
};
|
|
76
|
+
exports.TabBarStyled = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n background-color: ", ";\n z-index: 1000;\n height: ", ";\n"], ["\n background-color: ", ";\n z-index: 1000;\n height: ", ";\n"])), white, function (_a) {
|
|
77
|
+
var size = _a.size;
|
|
78
|
+
return size === 'S' ? '2.5rem' : '3rem';
|
|
79
|
+
});
|
|
80
|
+
exports.TabBarContainerStyled = styled_components_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n height: 100%;\n display: flex;\n align-items: center;\n position: relative;\n"], ["\n height: 100%;\n display: flex;\n align-items: center;\n position: relative;\n"])));
|
|
81
|
+
exports.TabBarRowStyled = styled_components_1.default.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n display: flex;\n height: 100%;\n white-space: nowrap;\n width: fit-content;\n gap: 2px;\n ", ";\n transform: ", ";\n"], ["\n display: flex;\n height: 100%;\n white-space: nowrap;\n width: fit-content;\n gap: 2px;\n ", ";\n transform: ", ";\n"])), (0, mixins_1.transition)('transform'), function (_a) {
|
|
82
|
+
var translateX = _a.translateX;
|
|
83
|
+
return "translateX(".concat(translateX, "px)");
|
|
84
|
+
});
|
|
85
|
+
exports.TabBarTabWrapper = styled_components_1.default.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n ", " \n\n display: flex;\n align-items: center;\n"], ["\n ", " \n\n display: flex;\n align-items: center;\n"])), function (_a) {
|
|
86
|
+
var tabBarStyle = _a.tabBarStyle;
|
|
87
|
+
switch (tabBarStyle) {
|
|
88
|
+
case "1":
|
|
89
|
+
return exports.wrapperStyles.style1;
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
exports.TabBarTabStyled = styled_components_1.default.button(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n padding: 0.45rem 0.8rem;\n height: 100%;\n cursor: pointer;\n border: none;\n display: flex;\n justify-content: center;\n align-items: center;\n\n\n ", " \n"], ["\n padding: 0.45rem 0.8rem;\n height: 100%;\n cursor: pointer;\n border: none;\n display: flex;\n justify-content: center;\n align-items: center;\n\n\n ", " \n"])), function (_a) {
|
|
93
|
+
var tabBarStyle = _a.tabBarStyle;
|
|
94
|
+
switch (tabBarStyle) {
|
|
95
|
+
case "1":
|
|
96
|
+
return exports.tabStyles.style1;
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
exports.STYLED_TYPO = (0, styled_components_1.default)(Typo2_1.UI_BODY_SEMIBOLD)(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n \n"], ["\n \n"])));
|
|
100
|
+
exports.StyledDirectionButtons = styled_components_1.default.div(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n position: absolute;\n ", "\n background-color: ", ";\n height: 100%;\n border-right: 1px solid ", ";\n border-left: 1px solid ", ";\n z-index: 10;\n"], ["\n position: absolute;\n ", "\n background-color: ", ";\n height: 100%;\n border-right: 1px solid ", ";\n border-left: 1px solid ", ";\n z-index: 10;\n"])), function (_a) {
|
|
101
|
+
var left = _a.left, right = _a.right;
|
|
102
|
+
if (left)
|
|
103
|
+
return (0, styled_components_1.css)(templateObject_13 || (templateObject_13 = __makeTemplateObject([" left: 0;"], [" left: 0;"])));
|
|
104
|
+
else if (right)
|
|
105
|
+
return (0, styled_components_1.css)(templateObject_14 || (templateObject_14 = __makeTemplateObject([" right: 0;"], [" right: 0;"])));
|
|
106
|
+
}, white, grey10, grey10);
|
|
107
|
+
exports.StyledDot = styled_components_1.default.div(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n background: ", ";\n height: 5px;\n width: 5px;\n border-radius: 50%;\n margin-left: 10px;\n"], ["\n background: ", ";\n height: 5px;\n width: 5px;\n border-radius: 50%;\n margin-left: 10px;\n"])), function (_a) {
|
|
108
|
+
var active = _a.active, error = _a.error, tabBarStyle = _a.tabBarStyle;
|
|
109
|
+
return tabBarStyle === "2" && active ? errorColor : !active && error ? errorColor : errorColor;
|
|
110
|
+
});
|
|
111
|
+
exports.StyledWrapper = styled_components_1.default.div(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n display: flex;\n /* min-height: 5.6rem; */\n padding: 0.8rem 1.6rem;\n justify-content: space-between;\n align-items: center;\n align-self: stretch;\n border-radius: 1.2rem;\n background: #FFF;\n gap: 0.5rem;\n box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.10);\n"], ["\n display: flex;\n /* min-height: 5.6rem; */\n padding: 0.8rem 1.6rem;\n justify-content: space-between;\n align-items: center;\n align-self: stretch;\n border-radius: 1.2rem;\n background: #FFF;\n gap: 0.5rem;\n box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.10);\n"])));
|
|
112
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export function TextInput({ S, id,
|
|
1
|
+
export function TextInput({ S, id, disabled, icon, type, placeholder, value, onChange, onFocus, onBlur, readOnly, iconOnClick, iconAfter, handleValidation, validateOnMount, actionBtn, clearBtn, className, maxLength, maxNumLimiter: DEPRECATED_maxNumLimiter, forceFocus, validateOnlyOnBlur, validationStatus: _validationStatus, displayValidationMsg, content, passValidationErrorToFormValidation, plugin, }: {
|
|
2
2
|
S: any;
|
|
3
3
|
id: any;
|
|
4
|
-
invert: any;
|
|
5
4
|
disabled: any;
|
|
6
5
|
icon: any;
|
|
7
6
|
type: any;
|
|
@@ -98,7 +98,7 @@ var icons_1 = require("../../../icons");
|
|
|
98
98
|
var BadgeVetted = icons_1.icons.BadgeVetted;
|
|
99
99
|
function TextInput(_a) {
|
|
100
100
|
var _this = this;
|
|
101
|
-
var S = _a.S, id = _a.id,
|
|
101
|
+
var S = _a.S, id = _a.id, disabled = _a.disabled, icon = _a.icon, type = _a.type, _b = _a.placeholder, placeholder = _b === void 0 ? "Enter Text..." : _b, _c = _a.value, value = _c === void 0 ? "" : _c, onChange = _a.onChange, onFocus = _a.onFocus, onBlur = _a.onBlur, readOnly = _a.readOnly, iconOnClick = _a.iconOnClick, iconAfter = _a.iconAfter, handleValidation = _a.handleValidation, _d = _a.validateOnMount, validateOnMount = _d === void 0 ? true : _d, // i think it makes sense to always run validation the minute the comp mounts, but we will see if this has sideeffects
|
|
102
102
|
actionBtn = _a.actionBtn, clearBtn = _a.clearBtn, className = _a.className, maxLength = _a.maxLength, DEPRECATED_maxNumLimiter = _a.maxNumLimiter, forceFocus = _a.forceFocus, //sometimes, when some other elem is clicked, we wanna trigger focus on the textinput. eg. when on mobile, the search icon is clicked on the listingpage
|
|
103
103
|
_e = _a.validateOnlyOnBlur, //sometimes, when some other elem is clicked, we wanna trigger focus on the textinput. eg. when on mobile, the search icon is clicked on the listingpage
|
|
104
104
|
validateOnlyOnBlur = _e === void 0 ? false : _e, //for example, in the login form we want validation to only run, once the text input is blurred. else it can be irritating
|
|
@@ -182,15 +182,15 @@ function TextInput(_a) {
|
|
|
182
182
|
return (react_1.default.createElement("div", { className: className },
|
|
183
183
|
react_1.default.createElement(BlockLabel_1.BlockLabel, __assign({}, (0, _EXPORTS_1.getBlockLabelProps)(props))),
|
|
184
184
|
readOnly ? (react_1.default.createElement(Typo2_1.UI_BODY_SM, null, type === "password" ? "********" : value)) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
185
|
-
react_1.default.createElement(index_styled_1.InputContainerStyled, { type: type, disabled: disabled, iconAfter: iconAfter, onClick: function () { return inputRef.current.focus(); } },
|
|
185
|
+
react_1.default.createElement(index_styled_1.InputContainerStyled, { type: type, disabled: disabled, iconAfter: iconAfter, onClick: function () { return inputRef.current.focus(); }, size: size },
|
|
186
186
|
icon && (react_1.default.createElement(DisplayIcon_1.DisplayIcon, { icon: icon, color: disabled ? themes_1.colors.grey40 : themes_1.colors.grey80, size: S ? 12 : 16, onClick: !disabled ? iconOnClick || null : undefined })),
|
|
187
|
-
react_1.default.createElement(index_styled_1.InputStyled, { ref: inputRef, className:
|
|
187
|
+
react_1.default.createElement(index_styled_1.InputStyled, { ref: inputRef, className: "UI_BODY_SM", id: id, type: type, name: type, disabled: disabled, placeholder: localize(placeholder), value: value, onChange: handleOnChange, maxLength: maxLength || DEPRECATED_maxNumLimiter, onBlur: validateOnlyOnBlur ? function (e) { return handleValidate(e, onBlur); } : onBlur, size: size, onFocus: onFocus, autoComplete: "off" }),
|
|
188
188
|
validationStatus === "loading" && (react_1.default.createElement("div", null,
|
|
189
|
-
react_1.default.createElement(LoadersAndProgress_1.LoaderCircle, { S: true
|
|
189
|
+
react_1.default.createElement(LoadersAndProgress_1.LoaderCircle, { S: true }))),
|
|
190
190
|
(validationStatus === null || validationStatus === void 0 ? void 0 : validationStatus.type) === "success" && (react_1.default.createElement("div", null,
|
|
191
191
|
react_1.default.createElement(BadgeVetted, { size: 26 }))),
|
|
192
|
-
clearBtn && clearBtnEnabled && (react_1.default.createElement(ClearButton_1.ClearButton, { onClick: function () { return onChange(id, ""); }, value: (clearBtn === null || clearBtn === void 0 ? void 0 : clearBtn.text) || "Clear", disabled: !clearBtnEnabled })),
|
|
193
|
-
actionBtn && (react_1.default.createElement(ActionButton_1.ActionButton, { value: actionBtn.text || "Action", onClick: actionBtnEnabaled && actionBtn.onClick, disabled: !actionBtnEnabaled }))),
|
|
192
|
+
clearBtn && clearBtnEnabled && (react_1.default.createElement(ClearButton_1.ClearButton, { onClick: function () { return onChange(id, ""); }, value: (clearBtn === null || clearBtn === void 0 ? void 0 : clearBtn.text) || "Clear", disabled: !clearBtnEnabled, style: { marginRight: size === "S" ? '-0.4rem' : '-0.2rem' } })),
|
|
193
|
+
actionBtn && (react_1.default.createElement(ActionButton_1.ActionButton, { value: actionBtn.text || "Action", onClick: actionBtnEnabaled && actionBtn.onClick, disabled: !actionBtnEnabaled, style: { marginRight: size === "S" ? '-0.4rem' : '-0.2rem' } }))),
|
|
194
194
|
displayValidationMsg && (validationStatus === null || validationStatus === void 0 ? void 0 : validationStatus.msg) && (react_1.default.createElement(index_styled_1.MsgContainerStyled, { status: validationStatus === null || validationStatus === void 0 ? void 0 : validationStatus.type },
|
|
195
195
|
(validationStatus === null || validationStatus === void 0 ? void 0 : validationStatus.type) === "error" && (react_1.default.createElement(DisplayIcon_1.DisplayIcon, { size: 12, icon: "WarningDiamond", weight: "fill", color: themes_1.colors.error })),
|
|
196
196
|
react_1.default.createElement(Typo2_1.UI_HELPTEXT, null,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export const MsgContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
-
export const InputContainerStyled: import("styled-components").StyledComponent<"div", any, {
|
|
2
|
+
export const InputContainerStyled: import("styled-components").StyledComponent<"div", any, {
|
|
3
|
+
size: "S" | "M";
|
|
4
|
+
}, never>;
|
|
3
5
|
export const InputStyled: import("styled-components").StyledComponent<"input", any, {}, never>;
|
|
4
6
|
export const ClearButtonStyled: import("styled-components").StyledComponent<"button", any, {}, never>;
|
|
5
7
|
export const ButtonPrimaryStyled: import("styled-components").StyledComponent<"button", any, {}, never>;
|
|
@@ -29,7 +29,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
30
|
exports.ButtonPrimaryStyled = exports.ClearButtonStyled = exports.InputStyled = exports.InputContainerStyled = exports.MsgContainerStyled = void 0;
|
|
31
31
|
var styled_components_1 = __importStar(require("styled-components"));
|
|
32
|
-
var mixins_1 = require("../../../themes/mixins");
|
|
33
32
|
var themes_1 = require("../../themes");
|
|
34
33
|
var globalStyles_1 = require("../../themes/globalStyles");
|
|
35
34
|
var getColorValue = function (status) {
|
|
@@ -57,7 +56,7 @@ exports.InputContainerStyled = styled_components_1.default.div(templateObject_6
|
|
|
57
56
|
});
|
|
58
57
|
exports.InputStyled = styled_components_1.default.input(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n height: ", ";\n border: none;\n outline: none;\n flex-grow: 1;\n background: transparent;\n color: inherit;\n\n &:-webkit-autofill {\n transition-delay: 9999s;\n }\n\n ::placeholder {\n color: ", ";\n opacity: 1;\n }\n"], ["\n height: ", ";\n border: none;\n outline: none;\n flex-grow: 1;\n background: transparent;\n color: inherit;\n\n &:-webkit-autofill {\n transition-delay: 9999s;\n }\n\n ::placeholder {\n color: ", ";\n opacity: 1;\n }\n"])), function (_a) {
|
|
59
58
|
var size = _a.size;
|
|
60
|
-
return size === "S" ? "
|
|
59
|
+
return size === "S" ? "36px" : "46px";
|
|
61
60
|
}, function (_a) {
|
|
62
61
|
var disabled = _a.disabled;
|
|
63
62
|
return (disabled ? themes_1.colors.grey40 : themes_1.colors.grey60);
|
package/dist/v2/themes/colors.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.colors = exports.dataVizColorsText = exports.dataVizColors = void 0;
|
|
4
|
-
var primary = "#
|
|
5
|
-
var secondary = "#
|
|
6
|
-
var tertiary = "#
|
|
7
|
-
var primaryContainer = "#
|
|
8
|
-
var onPrimary = "#
|
|
9
|
-
var secondaryContainer = "#
|
|
10
|
-
var onSecondary = "#
|
|
11
|
-
var tertiaryContainer = "#
|
|
12
|
-
var onTertiary = "#
|
|
13
|
-
var surfaceContainer = "#
|
|
14
|
-
var surfaceContainerLow = "#
|
|
4
|
+
var primary = "#00223D";
|
|
5
|
+
var secondary = "#526070";
|
|
6
|
+
var tertiary = "#30133E";
|
|
7
|
+
var primaryContainer = "#184469";
|
|
8
|
+
var onPrimary = "#BBDAFF";
|
|
9
|
+
var secondaryContainer = "#D9E8FC";
|
|
10
|
+
var onSecondary = "#3E4C5B";
|
|
11
|
+
var tertiaryContainer = "#533461";
|
|
12
|
+
var onTertiary = "#F0C8FF";
|
|
13
|
+
var surfaceContainer = "#EEEDF1";
|
|
14
|
+
var surfaceContainerLow = "#F3F3F7";
|
|
15
15
|
// const grey80 = '#333333'
|
|
16
16
|
// const grey40 = "#999999"
|
|
17
17
|
// const grey10 = "#E7E7E7"
|
|
18
|
+
var grey5 = '#0000000D';
|
|
18
19
|
var grey10 = '#0000001A';
|
|
19
20
|
var grey20 = '#00000033';
|
|
20
21
|
var grey30 = '#0000004D';
|
|
@@ -83,6 +84,7 @@ exports.colors = {
|
|
|
83
84
|
onTertiary: onTertiary,
|
|
84
85
|
surfaceContainer: surfaceContainer,
|
|
85
86
|
surfaceContainerLow: surfaceContainerLow,
|
|
87
|
+
grey5: grey5,
|
|
86
88
|
grey10: grey10,
|
|
87
89
|
grey20: grey20,
|
|
88
90
|
grey30: grey30,
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export declare const globalInputElemPadding_v2: import("styled-components").
|
|
1
|
+
export declare const globalInputElemPadding_v2: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<{
|
|
2
|
+
size: 'S' | 'M';
|
|
3
|
+
}, any>>;
|
|
2
4
|
export declare const globalInputElemHover_v2: import("styled-components").FlattenSimpleInterpolation;
|
|
3
5
|
export declare const globalInputElemFocused_v2: import("styled-components").FlattenSimpleInterpolation;
|
|
@@ -7,7 +7,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.globalInputElemFocused_v2 = exports.globalInputElemHover_v2 = exports.globalInputElemPadding_v2 = void 0;
|
|
8
8
|
var styled_components_1 = require("styled-components");
|
|
9
9
|
var colors_1 = require("./colors");
|
|
10
|
-
exports.globalInputElemPadding_v2 = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding:
|
|
10
|
+
exports.globalInputElemPadding_v2 = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: ", ";\n"], ["\n padding: ", ";\n"])), function (_a) {
|
|
11
|
+
var size = _a.size;
|
|
12
|
+
return size === "S" ? '0 10px' : '0 12px';
|
|
13
|
+
});
|
|
11
14
|
exports.globalInputElemHover_v2 = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n &:hover {\n &::before{\n border: 1.5px solid ", ";\n /* box-shadow: 0 4px 10px #00000012; */\n }\n }\n"], ["\n &:hover {\n &::before{\n border: 1.5px solid ", ";\n /* box-shadow: 0 4px 10px #00000012; */\n }\n }\n"])), colors_1.colors.grey30);
|
|
12
15
|
exports.globalInputElemFocused_v2 = (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n&:focus-within {\n &::before{\n border: 1.5px solid ", ";\n box-shadow: 0 4px 10px #00000012;\n }\n }\n"], ["\n&:focus-within {\n &::before{\n border: 1.5px solid ", ";\n box-shadow: 0 4px 10px #00000012;\n }\n }\n"])), colors_1.colors.grey80);
|
|
13
16
|
var templateObject_1, templateObject_2, templateObject_3;
|