oolib 2.21.1 → 2.21.3
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.
|
@@ -48,7 +48,7 @@ var DisplayIcon = function (_a) {
|
|
|
48
48
|
};
|
|
49
49
|
var ButtonStyledWrapper = function (_a) {
|
|
50
50
|
var props = _a.props, variant = _a.variant;
|
|
51
|
-
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, invert = props.invert, 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, stopPropagation = props.stopPropagation;
|
|
51
|
+
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, invert = props.invert, 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, stopPropagation = props.stopPropagation;
|
|
52
52
|
/**
|
|
53
53
|
* WHY WE ARE HAVING TO DO STOP PROPAGATION IN THIS TWISTED WAY:
|
|
54
54
|
*
|
|
@@ -96,9 +96,9 @@ var ButtonStyledWrapper = function (_a) {
|
|
|
96
96
|
stopPropagation && e.stopPropagation();
|
|
97
97
|
debouncedMouseDown && debouncedMouseDown(e);
|
|
98
98
|
}, composition: composition, width: width, color: color },
|
|
99
|
-
icon && react_1.default.createElement(DisplayIcon, { icon: icon, size: calcIconSize() }),
|
|
99
|
+
icon && react_1.default.createElement(DisplayIcon, { icon: icon, color: iconColor, size: calcIconSize() }),
|
|
100
100
|
displayText && react_1.default.createElement(Typo_1.SANS_3, { semibold: true }, displayText),
|
|
101
|
-
iconAfter && react_1.default.createElement(DisplayIcon, { icon: iconAfter, size: calcIconSize() })));
|
|
101
|
+
iconAfter && react_1.default.createElement(DisplayIcon, { icon: iconAfter, color: iconColor, size: calcIconSize() })));
|
|
102
102
|
};
|
|
103
103
|
var Button = function (_a) {
|
|
104
104
|
var props = _a.props, variant = _a.variant;
|
|
@@ -2,5 +2,8 @@ export function TextInput(props: any): JSX.Element;
|
|
|
2
2
|
export function PasswordInput(props: any): JSX.Element;
|
|
3
3
|
export function EmailInput(props: any): JSX.Element;
|
|
4
4
|
export function PhoneInput(props: any): JSX.Element;
|
|
5
|
-
export function URLInput(props
|
|
5
|
+
export function URLInput({ routesAreValidInputs, ...props }: {
|
|
6
|
+
[x: string]: any;
|
|
7
|
+
routesAreValidInputs?: boolean;
|
|
8
|
+
}): JSX.Element;
|
|
6
9
|
export function NumberInput(props: any): JSX.Element;
|
|
@@ -69,16 +69,27 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
69
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
73
|
+
var t = {};
|
|
74
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
75
|
+
t[p] = s[p];
|
|
76
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
77
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
78
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
79
|
+
t[p[i]] = s[p[i]];
|
|
80
|
+
}
|
|
81
|
+
return t;
|
|
82
|
+
};
|
|
72
83
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
73
84
|
exports.NumberInput = exports.URLInput = exports.PhoneInput = exports.EmailInput = exports.PasswordInput = exports.TextInput = void 0;
|
|
74
85
|
var react_1 = __importStar(require("react"));
|
|
75
86
|
var index_styled_1 = require("./index.styled");
|
|
76
87
|
var icons_1 = require("../../icons");
|
|
77
|
-
var LoadersAndProgress_1 = require("../LoadersAndProgress");
|
|
78
88
|
var BlockLabel_1 = require("../BlockLabel");
|
|
79
89
|
var Typo_1 = require("../Typo");
|
|
80
90
|
var Buttons_1 = require("../Buttons");
|
|
81
91
|
var _EXPORTS_1 = require("../../utils/_EXPORTS");
|
|
92
|
+
var LoadersAndProgress_1 = require("../LoadersAndProgress");
|
|
82
93
|
var DisplayIcon = function (_a) {
|
|
83
94
|
var icon = _a.icon, onClick = _a.onClick, size = _a.size;
|
|
84
95
|
var IconComp = icons_1.icons[icon];
|
|
@@ -125,8 +136,8 @@ var TextInput = function (props) {
|
|
|
125
136
|
react_1.default.createElement(index_styled_1.InputContainerStyled, { invert: invert, type: type, disabled: disabled, status: inputStatus === null || inputStatus === void 0 ? void 0 : inputStatus.type, eyeIcon: eyeIcon, composition: composition },
|
|
126
137
|
icon && (react_1.default.createElement(DisplayIcon, { icon: icon, size: S ? 15 : 20, onClick: iconOnClick || null })),
|
|
127
138
|
react_1.default.createElement(index_styled_1.InputStyled, { className: size === 'S' ? 'SANS_2' : 'SANS_3', id: id, type: type, name: type, placeholder: placeholder, value: value, onChange: handleOnChange, maxLength: maxNumLimiter, onBlur: handleValidateOnBlur, onFocus: onFocus, size: size, autoComplete: 'off' }),
|
|
128
|
-
inputStatus === 'loading' && (react_1.default.createElement("div",
|
|
129
|
-
react_1.default.createElement(LoadersAndProgress_1.
|
|
139
|
+
inputStatus === 'loading' && (react_1.default.createElement("div", null,
|
|
140
|
+
react_1.default.createElement(LoadersAndProgress_1.CircleLoader, { S: true, invert: invert }))),
|
|
130
141
|
actionBtn && (react_1.default.createElement(Buttons_1.ButtonPrimary, { value: actionBtn.text, invert: actionBtn.invert, onClick: actionBtnEnabaled && actionBtn.onClick, disabled: !actionBtnEnabaled, style: { marginRight: '-2rem' } }))),
|
|
131
142
|
(inputStatus === null || inputStatus === void 0 ? void 0 : inputStatus.msg) && (react_1.default.createElement(index_styled_1.MsgContainer, { invert: invert, status: inputStatus === null || inputStatus === void 0 ? void 0 : inputStatus.type },
|
|
132
143
|
react_1.default.createElement(Typo_1.SANS_3, null, inputStatus.msg))))))));
|
|
@@ -190,12 +201,19 @@ var PhoneInput = function (props) {
|
|
|
190
201
|
return (react_1.default.createElement(exports.TextInput, __assign({ type: "tel", placeholder: 'Enter Phone...', validateOnBlur: handleValidation, maxNumLimiter: 10 }, props)));
|
|
191
202
|
};
|
|
192
203
|
exports.PhoneInput = PhoneInput;
|
|
193
|
-
var URLInput = function (
|
|
204
|
+
var URLInput = function (_a) {
|
|
205
|
+
var _b = _a.routesAreValidInputs, routesAreValidInputs = _b === void 0 ? false : _b, //if we want react route declarations to be considered as 'valid' then set this to true
|
|
206
|
+
props = __rest(_a, ["routesAreValidInputs"]);
|
|
194
207
|
var handleValidation = function (value) { return __awaiter(void 0, void 0, void 0, function () {
|
|
195
208
|
var response, err_1;
|
|
196
209
|
return __generator(this, function (_a) {
|
|
197
210
|
switch (_a.label) {
|
|
198
211
|
case 0:
|
|
212
|
+
//if routesAreValidInputs, then first validate for a route
|
|
213
|
+
if (routesAreValidInputs && value.substring(0, 1) === '/') {
|
|
214
|
+
return [2 /*return*/, { type: 'success', msg: 'valid route' }];
|
|
215
|
+
}
|
|
216
|
+
//else validate for a url
|
|
199
217
|
if (!/^https?:\/\//i.test(value)) {
|
|
200
218
|
value = 'https://' + value;
|
|
201
219
|
}
|
package/dist/icons/index.d.ts
CHANGED
|
@@ -80,6 +80,7 @@ export namespace icons {
|
|
|
80
80
|
export { File };
|
|
81
81
|
export { FolderSimple };
|
|
82
82
|
export { FolderSimpleStar };
|
|
83
|
+
export { LinkSimple };
|
|
83
84
|
export { OkeGoogleIcon };
|
|
84
85
|
export { LetterH };
|
|
85
86
|
export { IndexIcon };
|
|
@@ -172,6 +173,7 @@ import { MicrophoneStage } from "phosphor-react";
|
|
|
172
173
|
import { File } from "phosphor-react";
|
|
173
174
|
import { FolderSimple } from "phosphor-react";
|
|
174
175
|
import { FolderSimpleStar } from "phosphor-react";
|
|
176
|
+
import { LinkSimple } from "phosphor-react";
|
|
175
177
|
import { OkeGoogleIcon } from "./custom";
|
|
176
178
|
import { LetterH } from "./custom";
|
|
177
179
|
import { IndexIcon } from "./custom";
|
package/dist/icons/index.js
CHANGED
|
@@ -85,6 +85,7 @@ exports.icons = {
|
|
|
85
85
|
File: phosphor_react_1.File,
|
|
86
86
|
FolderSimple: phosphor_react_1.FolderSimple,
|
|
87
87
|
FolderSimpleStar: phosphor_react_1.FolderSimpleStar,
|
|
88
|
+
LinkSimple: phosphor_react_1.LinkSimple,
|
|
88
89
|
OkeGoogleIcon: custom_1.OkeGoogleIcon,
|
|
89
90
|
LetterH: custom_1.LetterH,
|
|
90
91
|
IndexIcon: custom_1.IndexIcon,
|