@telefonica/mistica 10.15.0 → 10.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/dist/card.d.ts +10 -1
- package/dist/card.js +4 -1
- package/dist/card.js.flow +16 -1
- package/dist/credit-card-expiration-field.js +2 -7
- package/dist/credit-card-number-field.js +2 -2
- package/dist/cvv-field.js +2 -2
- package/dist/date-field.js +2 -2
- package/dist/date-time-field.js +2 -2
- package/dist/date-time-picker.js +2 -2
- package/dist/decimal-field.js +2 -7
- package/dist/email-field.js +2 -7
- package/dist/feedback.js +5 -8
- package/dist/iban-field.js +2 -7
- package/dist/icons/icon-success.js +14 -6
- package/dist/image.d.ts +25 -4
- package/dist/image.js +67 -9
- package/dist/image.js.flow +33 -4
- package/dist/index.d.ts +3 -1
- package/dist/index.js +20 -0
- package/dist/index.js.flow +3 -1
- package/dist/integer-field.js +2 -7
- package/dist/menu.d.ts +1 -1
- package/dist/menu.js +34 -27
- package/dist/menu.js.flow +1 -1
- package/dist/month-field.js +2 -2
- package/dist/package-version.js +1 -1
- package/dist/password-field.js +2 -2
- package/dist/phone-number-field.js +2 -7
- package/dist/search-field.js +2 -2
- package/dist/section-title.d.ts +1 -3
- package/dist/section-title.js.flow +1 -2
- package/dist/select.js +2 -2
- package/dist/text-field-base.d.ts +3 -2
- package/dist/text-field-base.js +12 -16
- package/dist/text-field-base.js.flow +6 -2
- package/dist/text-field.d.ts +2 -1
- package/dist/text-field.js +10 -16
- package/dist/text-field.js.flow +5 -1
- package/dist/video.d.ts +32 -0
- package/dist/video.js +161 -0
- package/dist/video.js.flow +50 -0
- package/dist-es/card.js +4 -1
- package/dist-es/credit-card-expiration-field.js +2 -2
- package/dist-es/credit-card-number-field.js +2 -2
- package/dist-es/cvv-field.js +2 -2
- package/dist-es/date-field.js +2 -2
- package/dist-es/date-time-field.js +2 -2
- package/dist-es/date-time-picker.js +2 -2
- package/dist-es/decimal-field.js +2 -2
- package/dist-es/email-field.js +2 -2
- package/dist-es/feedback.js +5 -8
- package/dist-es/iban-field.js +2 -2
- package/dist-es/icons/icon-success.js +14 -6
- package/dist-es/image.js +41 -8
- package/dist-es/index.js +3 -1
- package/dist-es/integer-field.js +2 -2
- package/dist-es/menu.js +35 -28
- package/dist-es/month-field.js +2 -2
- package/dist-es/package-version.js +1 -1
- package/dist-es/password-field.js +2 -2
- package/dist-es/phone-number-field.js +2 -2
- package/dist-es/search-field.js +2 -2
- package/dist-es/select.js +2 -2
- package/dist-es/text-field-base.js +12 -15
- package/dist-es/text-field.js +9 -12
- package/dist-es/video.js +123 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -566,6 +566,12 @@ Object.defineProperty(exports, "Image", {
|
|
|
566
566
|
return _image.default;
|
|
567
567
|
}
|
|
568
568
|
});
|
|
569
|
+
Object.defineProperty(exports, "Video", {
|
|
570
|
+
enumerable: true,
|
|
571
|
+
get: function() {
|
|
572
|
+
return _video.default;
|
|
573
|
+
}
|
|
574
|
+
});
|
|
569
575
|
Object.defineProperty(exports, "Form", {
|
|
570
576
|
enumerable: true,
|
|
571
577
|
get: function() {
|
|
@@ -584,6 +590,12 @@ Object.defineProperty(exports, "TextField", {
|
|
|
584
590
|
return _textField.default;
|
|
585
591
|
}
|
|
586
592
|
});
|
|
593
|
+
Object.defineProperty(exports, "TextFieldBase", {
|
|
594
|
+
enumerable: true,
|
|
595
|
+
get: function() {
|
|
596
|
+
return _textFieldBase.TextFieldBase;
|
|
597
|
+
}
|
|
598
|
+
});
|
|
587
599
|
Object.defineProperty(exports, "SearchField", {
|
|
588
600
|
enumerable: true,
|
|
589
601
|
get: function() {
|
|
@@ -680,6 +692,12 @@ Object.defineProperty(exports, "useForm", {
|
|
|
680
692
|
return _formContext.useForm;
|
|
681
693
|
}
|
|
682
694
|
});
|
|
695
|
+
Object.defineProperty(exports, "useFieldProps", {
|
|
696
|
+
enumerable: true,
|
|
697
|
+
get: function() {
|
|
698
|
+
return _formContext.useFieldProps;
|
|
699
|
+
}
|
|
700
|
+
});
|
|
683
701
|
Object.defineProperty(exports, "IconClose", {
|
|
684
702
|
enumerable: true,
|
|
685
703
|
get: function() {
|
|
@@ -8286,9 +8304,11 @@ var _callout = _interopRequireDefault(require("./callout"));
|
|
|
8286
8304
|
var _modalContextProvider = require("./modal-context-provider");
|
|
8287
8305
|
var _navigationBar = require("./navigation-bar");
|
|
8288
8306
|
var _image = _interopRequireDefault(require("./image"));
|
|
8307
|
+
var _video = _interopRequireDefault(require("./video"));
|
|
8289
8308
|
var _form = _interopRequireDefault(require("./form"));
|
|
8290
8309
|
var _select = _interopRequireDefault(require("./select"));
|
|
8291
8310
|
var _textField = _interopRequireDefault(require("./text-field"));
|
|
8311
|
+
var _textFieldBase = require("./text-field-base");
|
|
8292
8312
|
var _searchField = _interopRequireDefault(require("./search-field"));
|
|
8293
8313
|
var _emailField = _interopRequireDefault(require("./email-field"));
|
|
8294
8314
|
var _phoneNumberField = _interopRequireDefault(require("./phone-number-field"));
|
package/dist/index.js.flow
CHANGED
|
@@ -98,9 +98,11 @@ declare export {
|
|
|
98
98
|
NavigationBarLogo,
|
|
99
99
|
} from "./navigation-bar";
|
|
100
100
|
declare export { default as Image } from "./image";
|
|
101
|
+
declare export { default as Video } from "./video";
|
|
101
102
|
declare export { default as Form } from "./form";
|
|
102
103
|
declare export { default as Select } from "./select";
|
|
103
104
|
declare export { default as TextField } from "./text-field";
|
|
105
|
+
declare export { TextFieldBase } from "./text-field-base";
|
|
104
106
|
declare export { default as SearchField } from "./search-field";
|
|
105
107
|
declare export { default as EmailField } from "./email-field";
|
|
106
108
|
declare export { default as PhoneNumberField } from "./phone-number-field";
|
|
@@ -116,7 +118,7 @@ declare export { default as DecimalField } from "./decimal-field";
|
|
|
116
118
|
declare export { default as PasswordField } from "./password-field";
|
|
117
119
|
declare export { default as DoubleField } from "./double-field";
|
|
118
120
|
declare export { default as IbanField } from "./iban-field";
|
|
119
|
-
declare export { useForm } from "./form-context";
|
|
121
|
+
declare export { useForm, useFieldProps } from "./form-context";
|
|
120
122
|
declare export { default as IconClose } from "./icons/icon-close";
|
|
121
123
|
declare export { default as IconInfo } from "./icons/icon-info";
|
|
122
124
|
declare export { default as IconArrowDown } from "./icons/icon-arrow-down";
|
package/dist/integer-field.js
CHANGED
|
@@ -6,12 +6,7 @@ exports.default = exports.IntegerInput = void 0;
|
|
|
6
6
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
7
|
var _formContext = require("./form-context");
|
|
8
8
|
var _hooks = require("./hooks");
|
|
9
|
-
var _textFieldBase =
|
|
10
|
-
function _interopRequireDefault(obj) {
|
|
11
|
-
return obj && obj.__esModule ? obj : {
|
|
12
|
-
default: obj
|
|
13
|
-
};
|
|
14
|
-
}
|
|
9
|
+
var _textFieldBase = require("./text-field-base");
|
|
15
10
|
function _defineProperty(obj, key, value) {
|
|
16
11
|
if (key in obj) {
|
|
17
12
|
Object.defineProperty(obj, key, {
|
|
@@ -137,7 +132,7 @@ var IntegerField = function IntegerField(_param) {
|
|
|
137
132
|
onChange: onChange,
|
|
138
133
|
onChangeValue: onChangeValue
|
|
139
134
|
});
|
|
140
|
-
return(/*#__PURE__*/ (0, _jsxRuntime).jsx(_textFieldBase.
|
|
135
|
+
return(/*#__PURE__*/ (0, _jsxRuntime).jsx(_textFieldBase.TextFieldBaseAutosuggest, _objectSpread({
|
|
141
136
|
}, rest, fieldProps, {
|
|
142
137
|
inputComponent: IntegerInput
|
|
143
138
|
})));
|
package/dist/menu.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ declare type MenuRenderProps = {
|
|
|
6
6
|
};
|
|
7
7
|
declare type TargetRenderProps = {
|
|
8
8
|
ref: (element: HTMLElement | null) => void;
|
|
9
|
-
onPress: (
|
|
9
|
+
onPress: () => void;
|
|
10
10
|
isMenuOpen: boolean;
|
|
11
11
|
};
|
|
12
12
|
export declare type MenuProps = {
|
package/dist/menu.js
CHANGED
|
@@ -6,9 +6,9 @@ exports.default = void 0;
|
|
|
6
6
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _keyCodes = require("./utils/key-codes");
|
|
9
|
-
var _overlay = _interopRequireDefault(require("./overlay"));
|
|
10
9
|
var _jss = require("./jss");
|
|
11
10
|
var _dom = require("./utils/dom");
|
|
11
|
+
var _overlay = _interopRequireDefault(require("./overlay"));
|
|
12
12
|
function _interopRequireDefault(obj) {
|
|
13
13
|
return obj && obj.__esModule ? obj : {
|
|
14
14
|
default: obj
|
|
@@ -103,6 +103,7 @@ var useStyles = (0, _jss).createUseStyles(function(param) {
|
|
|
103
103
|
var colors = param.colors;
|
|
104
104
|
return {
|
|
105
105
|
menuContainer: {
|
|
106
|
+
zIndex: 12,
|
|
106
107
|
margin: 0,
|
|
107
108
|
padding: 0,
|
|
108
109
|
listStyleType: 'none',
|
|
@@ -111,13 +112,17 @@ var useStyles = (0, _jss).createUseStyles(function(param) {
|
|
|
111
112
|
var itemsComputedProps = param.itemsComputedProps;
|
|
112
113
|
return itemsComputedProps.top;
|
|
113
114
|
},
|
|
114
|
-
|
|
115
|
+
bottom: function bottom(param) {
|
|
116
|
+
var itemsComputedProps = param.itemsComputedProps;
|
|
117
|
+
return itemsComputedProps.bottom;
|
|
118
|
+
},
|
|
119
|
+
right: function right(param) {
|
|
115
120
|
var itemsComputedProps = param.itemsComputedProps;
|
|
116
|
-
return itemsComputedProps.
|
|
121
|
+
return itemsComputedProps.right;
|
|
117
122
|
},
|
|
118
123
|
width: function width(param) {
|
|
119
|
-
var
|
|
120
|
-
return width1 !== null && width1 !== void 0 ? width1 :
|
|
124
|
+
var width1 = param.width;
|
|
125
|
+
return width1 !== null && width1 !== void 0 ? width1 : '100%';
|
|
121
126
|
},
|
|
122
127
|
borderRadius: 4,
|
|
123
128
|
boxShadow: '0px 5px 5px -3px rgba(0,0,0,0.2), 0px 8px 10px 1px rgba(0,0,0,0.14), 0px 3px 14px 2px rgba(0,0,0,0.12)',
|
|
@@ -158,28 +163,27 @@ var Menu = function Menu(param) {
|
|
|
158
163
|
return;
|
|
159
164
|
}
|
|
160
165
|
var MARGIN_THRESHOLD = 12;
|
|
161
|
-
var topTarget = targetRect.top, widthTarget = targetRect.width,
|
|
166
|
+
var topTarget = targetRect.top, widthTarget = targetRect.width, height = targetRect.height;
|
|
162
167
|
var top = topTarget + height;
|
|
163
168
|
var ref;
|
|
164
169
|
var spaceTaken = (ref = parseInt(window.getComputedStyle(menu).getPropertyValue('height'))) !== null && ref !== void 0 ? ref : 0;
|
|
165
|
-
var
|
|
170
|
+
var rightDirection = position === 'left' ? 'auto' : "calc(100% - ".concat(widthTarget, "px)");
|
|
166
171
|
// if it doesn't fit on bottom
|
|
167
172
|
if (top + spaceTaken + MARGIN_THRESHOLD > window.innerHeight) {
|
|
168
173
|
var availableSpaceBottom = window.innerHeight - top;
|
|
169
174
|
if (topTarget /* this is the available space on top */ > availableSpaceBottom) {
|
|
170
|
-
var newTop = topTarget - spaceTaken;
|
|
171
175
|
setItemsComputedProps({
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
top:
|
|
175
|
-
maxHeight: topTarget
|
|
176
|
+
right: rightDirection,
|
|
177
|
+
bottom: '100%',
|
|
178
|
+
top: 'auto',
|
|
179
|
+
maxHeight: Math.min(topTarget, MAX_HEIGHT_DEFAULT),
|
|
176
180
|
transformOrigin: 'center bottom'
|
|
177
181
|
});
|
|
178
182
|
} else {
|
|
179
183
|
setItemsComputedProps({
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
184
|
+
top: '100%',
|
|
185
|
+
bottom: 'auto',
|
|
186
|
+
right: rightDirection,
|
|
183
187
|
maxHeight: Math.min(window.innerHeight - top - MARGIN_THRESHOLD, MAX_HEIGHT_DEFAULT),
|
|
184
188
|
transformOrigin: 'center top'
|
|
185
189
|
});
|
|
@@ -187,9 +191,9 @@ var Menu = function Menu(param) {
|
|
|
187
191
|
} else {
|
|
188
192
|
// if it fits on bottom
|
|
189
193
|
setItemsComputedProps({
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
194
|
+
top: '100%',
|
|
195
|
+
bottom: 'auto',
|
|
196
|
+
right: rightDirection,
|
|
193
197
|
maxHeight: Math.min(window.innerHeight - top - MARGIN_THRESHOLD, MAX_HEIGHT_DEFAULT),
|
|
194
198
|
transformOrigin: 'center top'
|
|
195
199
|
});
|
|
@@ -257,20 +261,23 @@ var Menu = function Menu(param) {
|
|
|
257
261
|
document.removeEventListener('keydown', handleKeyDown, false);
|
|
258
262
|
};
|
|
259
263
|
});
|
|
260
|
-
return(/*#__PURE__*/ (0, _jsxRuntime).jsxs(
|
|
264
|
+
return(/*#__PURE__*/ (0, _jsxRuntime).jsxs("div", {
|
|
265
|
+
style: {
|
|
266
|
+
position: 'relative'
|
|
267
|
+
},
|
|
261
268
|
children: [
|
|
262
|
-
renderTarget(_objectSpread({
|
|
263
|
-
}, targetProps, {
|
|
264
|
-
isMenuOpen: isMenuOpen
|
|
265
|
-
})),
|
|
266
269
|
isMenuOpen ? /*#__PURE__*/ (0, _jsxRuntime).jsx(_overlay.default, {
|
|
267
270
|
onPress: function onPress(e) {
|
|
268
|
-
setIsMenuOpen(false);
|
|
269
271
|
(0, _dom).cancelEvent(e);
|
|
272
|
+
setIsMenuOpen(false);
|
|
270
273
|
},
|
|
271
|
-
disableScroll: true
|
|
272
|
-
|
|
273
|
-
|
|
274
|
+
disableScroll: true
|
|
275
|
+
}) : null,
|
|
276
|
+
renderTarget(_objectSpread({
|
|
277
|
+
}, targetProps, {
|
|
278
|
+
isMenuOpen: isMenuOpen
|
|
279
|
+
})),
|
|
280
|
+
isMenuOpen ? renderMenu(menuProps) : null
|
|
274
281
|
]
|
|
275
282
|
}));
|
|
276
283
|
};
|
package/dist/menu.js.flow
CHANGED
|
@@ -8,7 +8,7 @@ declare type MenuRenderProps = {
|
|
|
8
8
|
};
|
|
9
9
|
declare type TargetRenderProps = {
|
|
10
10
|
ref: (element: HTMLElement | null) => void,
|
|
11
|
-
onPress: (
|
|
11
|
+
onPress: () => void,
|
|
12
12
|
isMenuOpen: boolean,
|
|
13
13
|
};
|
|
14
14
|
export type MenuProps = {
|
package/dist/month-field.js
CHANGED
|
@@ -6,7 +6,7 @@ exports.default = void 0;
|
|
|
6
6
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _formContext = require("./form-context");
|
|
9
|
-
var _textFieldBase =
|
|
9
|
+
var _textFieldBase = require("./text-field-base");
|
|
10
10
|
var _dom = require("./utils/dom");
|
|
11
11
|
var _environment = require("./utils/environment");
|
|
12
12
|
var _iconCalendarRegular = _interopRequireDefault(require("./generated/mistica-icons/icon-calendar-regular"));
|
|
@@ -163,7 +163,7 @@ var DateField = function DateField(_param) {
|
|
|
163
163
|
onChange: onChange,
|
|
164
164
|
onChangeValue: onChangeValue
|
|
165
165
|
});
|
|
166
|
-
var nativePicker = /*#__PURE__*/ (0, _jsxRuntime).jsx(_textFieldBase.
|
|
166
|
+
var nativePicker = /*#__PURE__*/ (0, _jsxRuntime).jsx(_textFieldBase.TextFieldBaseAutosuggest, _objectSpread({
|
|
167
167
|
}, rest, fieldProps, {
|
|
168
168
|
min: min ? (0, _time).getLocalYearMonthString(min) : undefined,
|
|
169
169
|
max: max ? (0, _time).getLocalYearMonthString(max) : undefined,
|
package/dist/package-version.js
CHANGED
package/dist/password-field.js
CHANGED
|
@@ -6,7 +6,7 @@ exports.default = void 0;
|
|
|
6
6
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _formContext = require("./form-context");
|
|
9
|
-
var _textFieldBase =
|
|
9
|
+
var _textFieldBase = require("./text-field-base");
|
|
10
10
|
var _hooks = require("./hooks");
|
|
11
11
|
var _iconButton = _interopRequireDefault(require("./icon-button"));
|
|
12
12
|
var _iconVisibility = _interopRequireDefault(require("./icons/icon-visibility"));
|
|
@@ -221,7 +221,7 @@ var PasswordField = function PasswordField(_param) {
|
|
|
221
221
|
onChange: onChange,
|
|
222
222
|
onChangeValue: onChangeValue
|
|
223
223
|
});
|
|
224
|
-
return(/*#__PURE__*/ (0, _jsxRuntime).jsx(_textFieldBase.
|
|
224
|
+
return(/*#__PURE__*/ (0, _jsxRuntime).jsx(_textFieldBase.TextFieldBaseAutosuggest, _objectSpread({
|
|
225
225
|
}, rest, fieldProps, {
|
|
226
226
|
type: isVisible ? 'text' : 'password',
|
|
227
227
|
inputRef: function inputRef1(field) {
|
|
@@ -8,15 +8,10 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _rifm = require("rifm");
|
|
9
9
|
var _libphonenumber = require("@telefonica/libphonenumber");
|
|
10
10
|
var _formContext = require("./form-context");
|
|
11
|
-
var _textFieldBase =
|
|
11
|
+
var _textFieldBase = require("./text-field-base");
|
|
12
12
|
var _hooks = require("./hooks");
|
|
13
13
|
var _dom = require("./utils/dom");
|
|
14
14
|
var _common = require("./utils/common");
|
|
15
|
-
function _interopRequireDefault(obj) {
|
|
16
|
-
return obj && obj.__esModule ? obj : {
|
|
17
|
-
default: obj
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
15
|
function _interopRequireWildcard(obj) {
|
|
21
16
|
if (obj && obj.__esModule) {
|
|
22
17
|
return obj;
|
|
@@ -252,7 +247,7 @@ var PhoneNumberField = function PhoneNumberField(_param) {
|
|
|
252
247
|
onChange: onChange,
|
|
253
248
|
onChangeValue: onChangeValue
|
|
254
249
|
});
|
|
255
|
-
return(/*#__PURE__*/ (0, _jsxRuntime).jsx(_textFieldBase.
|
|
250
|
+
return(/*#__PURE__*/ (0, _jsxRuntime).jsx(_textFieldBase.TextFieldBaseAutosuggest, _objectSpread({
|
|
256
251
|
}, rest, fieldProps, {
|
|
257
252
|
type: "phone",
|
|
258
253
|
inputProps: {
|
package/dist/search-field.js
CHANGED
|
@@ -6,7 +6,7 @@ exports.default = void 0;
|
|
|
6
6
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _formContext = require("./form-context");
|
|
9
|
-
var _textFieldBase =
|
|
9
|
+
var _textFieldBase = require("./text-field-base");
|
|
10
10
|
var _iconSearch = _interopRequireDefault(require("./icons/icon-search"));
|
|
11
11
|
var _iconCloseRegular = _interopRequireDefault(require("./generated/mistica-icons/icon-close-regular"));
|
|
12
12
|
var _iconButton = _interopRequireDefault(require("./icon-button"));
|
|
@@ -185,7 +185,7 @@ var SearchField = function SearchField(_param) {
|
|
|
185
185
|
onChange: onChange,
|
|
186
186
|
onChangeValue: handleChangeValue
|
|
187
187
|
});
|
|
188
|
-
return(/*#__PURE__*/ (0, _jsxRuntime).jsx(_textFieldBase.
|
|
188
|
+
return(/*#__PURE__*/ (0, _jsxRuntime).jsx(_textFieldBase.TextFieldBaseAutosuggest, _objectSpread({
|
|
189
189
|
ref: inputRef,
|
|
190
190
|
startIcon: /*#__PURE__*/ (0, _jsxRuntime).jsx(_iconSearch.default, {
|
|
191
191
|
}),
|
package/dist/section-title.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import TextLink from './text-link';
|
|
3
|
-
import type { TextLinkProps } from './text-link';
|
|
4
2
|
declare type Props = {
|
|
5
3
|
children: React.ReactNode;
|
|
6
4
|
id?: string;
|
|
7
|
-
right?: React.
|
|
5
|
+
right?: React.ReactNode;
|
|
8
6
|
as?: 'h1' | 'h2' | 'h3' | 'h4';
|
|
9
7
|
};
|
|
10
8
|
declare const SectionTitle: React.FC<Props>;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import TextLink from "./text-link";
|
|
5
4
|
declare type Props = {
|
|
6
5
|
children: React.Node,
|
|
7
6
|
id?: string,
|
|
8
|
-
right?: React.
|
|
7
|
+
right?: React.Node,
|
|
9
8
|
as?: "h1" | "h2" | "h3" | "h4",
|
|
10
9
|
};
|
|
11
10
|
declare var SectionTitle: React.ComponentType<Props>;
|
package/dist/select.js
CHANGED
|
@@ -10,7 +10,7 @@ var _hooks = require("./hooks");
|
|
|
10
10
|
var _keyCodes = require("./utils/key-codes");
|
|
11
11
|
var _textFieldComponents = require("./text-field-components");
|
|
12
12
|
var _iconChevronDownRegular = _interopRequireDefault(require("./generated/mistica-icons/icon-chevron-down-regular"));
|
|
13
|
-
var _textFieldBase =
|
|
13
|
+
var _textFieldBase = require("./text-field-base");
|
|
14
14
|
var _overlay = _interopRequireDefault(require("./overlay"));
|
|
15
15
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
16
16
|
var _platform = require("./utils/platform");
|
|
@@ -548,7 +548,7 @@ var Select = function Select(param) {
|
|
|
548
548
|
ref: focusableRef
|
|
549
549
|
}, !disabled && containerActiveProps, {
|
|
550
550
|
children: [
|
|
551
|
-
/*#__PURE__*/ (0, _jsxRuntime).jsx(_textFieldBase.
|
|
551
|
+
/*#__PURE__*/ (0, _jsxRuntime).jsx(_textFieldBase.TextFieldBaseAutosuggest, {
|
|
552
552
|
style: {
|
|
553
553
|
visibility: 'hidden'
|
|
554
554
|
},
|
|
@@ -71,5 +71,6 @@ interface TextFieldBaseProps {
|
|
|
71
71
|
min?: string;
|
|
72
72
|
max?: string;
|
|
73
73
|
}
|
|
74
|
-
declare const TextFieldBase: React.ForwardRefExoticComponent<TextFieldBaseProps & React.RefAttributes<any>>;
|
|
75
|
-
export
|
|
74
|
+
export declare const TextFieldBase: React.ForwardRefExoticComponent<TextFieldBaseProps & React.RefAttributes<any>>;
|
|
75
|
+
export declare const TextFieldBaseAutosuggest: React.ForwardRefExoticComponent<TextFieldBaseProps & React.RefAttributes<any>>;
|
|
76
|
+
export {};
|
package/dist/text-field-base.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
exports.
|
|
5
|
+
exports.TextFieldBase = exports.TextFieldBaseAutosuggest = void 0;
|
|
6
6
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _jss = require("./jss");
|
|
@@ -315,11 +315,7 @@ var useStyles = (0, _jss).createUseStyles(function(theme) {
|
|
|
315
315
|
}), _defineProperty(_obj2, "transition", 'opacity 150ms cubic-bezier(0.0, 0, 0.2, 1) 0ms'), _obj2)
|
|
316
316
|
};
|
|
317
317
|
});
|
|
318
|
-
|
|
319
|
-
var fixAutoComplete = function fixAutoComplete(platformOverrides, autoComplete) {
|
|
320
|
-
return autoComplete === 'off' && (0, _platform).isChrome(platformOverrides) ? 'nope' : autoComplete;
|
|
321
|
-
};
|
|
322
|
-
var TextFieldBaseComponent = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
318
|
+
var TextFieldBase = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
323
319
|
var error = _param.error, helperText = _param.helperText, label = _param.label, inputProps = _param.inputProps, inputRef = _param.inputRef, defaultValue = _param.defaultValue, value = _param.value, onFocus = _param.onFocus, onBlur = _param.onBlur, inputComponent = _param.inputComponent, prefix = _param.prefix, startIcon = _param.startIcon, endIcon = _param.endIcon, endIconOverlay = _param.endIconOverlay, shrinkLabelProp = _param.shrinkLabel, _multiline = _param.multiline, multiline = _multiline === void 0 ? false : _multiline, focus = _param.focus, fieldRef = _param.fieldRef, maxLength = _param.maxLength, idProp = _param.id, autoCompleteProp = _param.autoComplete, fullWidth = _param.fullWidth, rest = _objectWithoutProperties(_param, [
|
|
324
320
|
"error",
|
|
325
321
|
"helperText",
|
|
@@ -346,7 +342,7 @@ var TextFieldBaseComponent = /*#__PURE__*/ React.forwardRef(function(_param, ref
|
|
|
346
342
|
]);
|
|
347
343
|
var id = (0, _hooks).useAriaId(idProp);
|
|
348
344
|
var ref1 = _slicedToArray(React.useState((defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.length) || (value === null || value === void 0 ? void 0 : value.length) ? 'filled' : 'default'), 2), inputState = ref1[0], setInputState = ref1[1];
|
|
349
|
-
var ref2 = (0, _hooks).useTheme(),
|
|
345
|
+
var ref2 = (0, _hooks).useTheme(), colors = ref2.colors;
|
|
350
346
|
var ref3 = (0, _hooks).useScreenSize(), isTabletOrSmaller = ref3.isTabletOrSmaller;
|
|
351
347
|
var ref4;
|
|
352
348
|
var ref5 = _slicedToArray(React.useState((ref4 = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.length) !== null && ref4 !== void 0 ? ref4 : 0), 2), characterCount = ref5[0], setCharacterCount = ref5[1];
|
|
@@ -403,7 +399,7 @@ var TextFieldBaseComponent = /*#__PURE__*/ React.forwardRef(function(_param, ref
|
|
|
403
399
|
var props = _objectSpread({
|
|
404
400
|
}, rest, {
|
|
405
401
|
maxLength: maxLength,
|
|
406
|
-
autoComplete:
|
|
402
|
+
autoComplete: autoCompleteProp
|
|
407
403
|
}, inputProps);
|
|
408
404
|
var isShrinked = shrinkLabel || inputState === 'focused' || inputState === 'filled';
|
|
409
405
|
var scale = isShrinked ? isTabletOrSmaller ? _textFieldComponents.LABEL_SCALE_MOBILE : _textFieldComponents.LABEL_SCALE_DESKTOP : 1;
|
|
@@ -493,6 +489,7 @@ var TextFieldBaseComponent = /*#__PURE__*/ React.forwardRef(function(_param, ref
|
|
|
493
489
|
]
|
|
494
490
|
}));
|
|
495
491
|
});
|
|
492
|
+
exports.TextFieldBase = TextFieldBase;
|
|
496
493
|
var useSuggestionsStyles = (0, _jss).createUseStyles(function() {
|
|
497
494
|
return {
|
|
498
495
|
menuItem: {
|
|
@@ -527,7 +524,7 @@ var Autosuggest = /*#__PURE__*/ React.lazy(function() {
|
|
|
527
524
|
return _interopRequireWildcard(require(/* webpackChunkName: "react-autosuggest" */ 'react-autosuggest'));
|
|
528
525
|
});
|
|
529
526
|
});
|
|
530
|
-
var
|
|
527
|
+
var TextFieldBaseAutosuggest = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
531
528
|
var getSuggestions = _param.getSuggestions, idProp = _param.id, props = _objectWithoutProperties(_param, [
|
|
532
529
|
"getSuggestions",
|
|
533
530
|
"id"
|
|
@@ -542,13 +539,13 @@ var TextFieldBase = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
542
539
|
throw Error('Fields with suggestions must be used in controlled mode');
|
|
543
540
|
}
|
|
544
541
|
return getSuggestions ? /*#__PURE__*/ (0, _jsxRuntime).jsx(React.Suspense, {
|
|
545
|
-
fallback: /*#__PURE__*/ (0, _jsxRuntime).jsx(
|
|
542
|
+
fallback: /*#__PURE__*/ (0, _jsxRuntime).jsx(TextFieldBase, _objectSpread({
|
|
546
543
|
}, props, {
|
|
547
544
|
// This label override while loading is needed in acceptance tests because
|
|
548
545
|
// while the test is typing, the component could be remounted.
|
|
549
546
|
// By hiding the label, we ensure that the test selects the loaded component
|
|
550
547
|
label: (0, _platform).isRunningAcceptanceTest(platformOverrides) ? '' : props.label,
|
|
551
|
-
autoComplete:
|
|
548
|
+
autoComplete: "off",
|
|
552
549
|
ref: ref,
|
|
553
550
|
id: id
|
|
554
551
|
})),
|
|
@@ -557,7 +554,7 @@ var TextFieldBase = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
557
554
|
inputProps: _objectSpread({
|
|
558
555
|
}, props, {
|
|
559
556
|
id: id,
|
|
560
|
-
autoComplete:
|
|
557
|
+
autoComplete: 'off',
|
|
561
558
|
// @ts-expect-error Autosuggest expects slightly different types
|
|
562
559
|
onChange: function onChange(e, param) {
|
|
563
560
|
var newValue = param.newValue;
|
|
@@ -575,7 +572,7 @@ var TextFieldBase = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
575
572
|
}
|
|
576
573
|
}),
|
|
577
574
|
renderInputComponent: function renderInputComponent(inputProps) {
|
|
578
|
-
/*#__PURE__*/ return (0, _jsxRuntime).jsx(
|
|
575
|
+
/*#__PURE__*/ return (0, _jsxRuntime).jsx(TextFieldBase, _objectSpread({
|
|
579
576
|
}, inputProps, {
|
|
580
577
|
inputRef: (0, _common).combineRefs(inputRef, props.inputRef, ref)
|
|
581
578
|
}));
|
|
@@ -615,11 +612,10 @@ var TextFieldBase = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
615
612
|
}));
|
|
616
613
|
}
|
|
617
614
|
})
|
|
618
|
-
}) : /*#__PURE__*/ (0, _jsxRuntime).jsx(
|
|
615
|
+
}) : /*#__PURE__*/ (0, _jsxRuntime).jsx(TextFieldBase, _objectSpread({
|
|
619
616
|
}, props, {
|
|
620
617
|
id: id,
|
|
621
618
|
ref: ref
|
|
622
619
|
}));
|
|
623
620
|
});
|
|
624
|
-
|
|
625
|
-
exports.default = _default;
|
|
621
|
+
exports.TextFieldBaseAutosuggest = TextFieldBaseAutosuggest;
|
|
@@ -97,10 +97,14 @@ declare type TextFieldBaseProps = {
|
|
|
97
97
|
min?: string,
|
|
98
98
|
max?: string,
|
|
99
99
|
};
|
|
100
|
-
declare var TextFieldBase: React.ComponentType<{
|
|
100
|
+
declare export var TextFieldBase: React.ComponentType<{
|
|
101
101
|
...TextFieldBaseProps,
|
|
102
102
|
...{},
|
|
103
103
|
}>;
|
|
104
|
-
declare export
|
|
104
|
+
declare export var TextFieldBaseAutosuggest: React.ComponentType<{
|
|
105
|
+
...TextFieldBaseProps,
|
|
106
|
+
...{},
|
|
107
|
+
}>;
|
|
108
|
+
declare export {};
|
|
105
109
|
|
|
106
110
|
import { type CssStyle } from "./__types__.js.flow";
|
package/dist/text-field.d.ts
CHANGED
|
@@ -2,10 +2,11 @@ import * as React from 'react';
|
|
|
2
2
|
import type { CommonFormFieldProps } from './text-field-base';
|
|
3
3
|
export interface TextFieldProps extends CommonFormFieldProps {
|
|
4
4
|
onChangeValue?: (value: string, rawValue: string) => void;
|
|
5
|
+
onPress?: (event: React.MouseEvent) => void;
|
|
5
6
|
multiline?: boolean;
|
|
6
7
|
prefix?: React.ReactNode;
|
|
7
8
|
endIcon?: React.ReactNode;
|
|
8
9
|
getSuggestions?: (value: string) => Array<string>;
|
|
9
10
|
}
|
|
10
|
-
declare const TextField: React.
|
|
11
|
+
declare const TextField: React.ForwardRefExoticComponent<TextFieldProps & React.RefAttributes<HTMLInputElement>>;
|
|
11
12
|
export default TextField;
|
package/dist/text-field.js
CHANGED
|
@@ -6,12 +6,8 @@ exports.default = void 0;
|
|
|
6
6
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _formContext = require("./form-context");
|
|
9
|
-
var _textFieldBase =
|
|
10
|
-
|
|
11
|
-
return obj && obj.__esModule ? obj : {
|
|
12
|
-
default: obj
|
|
13
|
-
};
|
|
14
|
-
}
|
|
9
|
+
var _textFieldBase = require("./text-field-base");
|
|
10
|
+
var _common = require("./utils/common");
|
|
15
11
|
function _interopRequireWildcard(obj) {
|
|
16
12
|
if (obj && obj.__esModule) {
|
|
17
13
|
return obj;
|
|
@@ -95,8 +91,8 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
95
91
|
}
|
|
96
92
|
return target;
|
|
97
93
|
}
|
|
98
|
-
var TextField =
|
|
99
|
-
var disabled = _param.disabled, error = _param.error, helperText = _param.helperText, name = _param.name, optional = _param.optional, validate = _param.validate, onChangeValue = _param.onChangeValue, onChange = _param.onChange, value = _param.value, defaultValue = _param.defaultValue, onBlurProp = _param.onBlur, onFocusProp = _param.onFocus, rest = _objectWithoutProperties(_param, [
|
|
94
|
+
var TextField = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
95
|
+
var disabled = _param.disabled, error = _param.error, helperText = _param.helperText, name = _param.name, optional = _param.optional, validate = _param.validate, onChangeValue = _param.onChangeValue, onChange = _param.onChange, value = _param.value, defaultValue = _param.defaultValue, onBlurProp = _param.onBlur, onFocusProp = _param.onFocus, onPress = _param.onPress, rest = _objectWithoutProperties(_param, [
|
|
100
96
|
"disabled",
|
|
101
97
|
"error",
|
|
102
98
|
"helperText",
|
|
@@ -108,7 +104,8 @@ var TextField = function TextField(_param) {
|
|
|
108
104
|
"value",
|
|
109
105
|
"defaultValue",
|
|
110
106
|
"onBlur",
|
|
111
|
-
"onFocus"
|
|
107
|
+
"onFocus",
|
|
108
|
+
"onPress"
|
|
112
109
|
]);
|
|
113
110
|
var inputRef = React.useRef(null);
|
|
114
111
|
var processValue = function processValue(v) {
|
|
@@ -150,16 +147,13 @@ var TextField = function TextField(_param) {
|
|
|
150
147
|
onChange: onChange,
|
|
151
148
|
onChangeValue: onChangeValue
|
|
152
149
|
});
|
|
153
|
-
|
|
154
|
-
inputRef.current = field;
|
|
155
|
-
fieldProps.inputRef(field);
|
|
156
|
-
};
|
|
157
|
-
return(/*#__PURE__*/ (0, _jsxRuntime).jsx(_textFieldBase.default, _objectSpread({
|
|
150
|
+
return(/*#__PURE__*/ (0, _jsxRuntime).jsx(_textFieldBase.TextFieldBaseAutosuggest, _objectSpread({
|
|
158
151
|
}, rest, fieldProps, {
|
|
159
|
-
|
|
152
|
+
onClick: onPress,
|
|
153
|
+
inputRef: (0, _common).combineRefs(inputRef, fieldProps.inputRef, ref),
|
|
160
154
|
onFocus: onFocus,
|
|
161
155
|
type: "text"
|
|
162
156
|
})));
|
|
163
|
-
};
|
|
157
|
+
});
|
|
164
158
|
var _default = TextField;
|
|
165
159
|
exports.default = _default;
|
package/dist/text-field.js.flow
CHANGED
|
@@ -6,10 +6,14 @@ export type TextFieldProps = {
|
|
|
6
6
|
...$Exact<CommonFormFieldProps>,
|
|
7
7
|
|
|
8
8
|
onChangeValue?: (value: string, rawValue: string) => void,
|
|
9
|
+
onPress?: (event: SyntheticMouseEvent<>) => void,
|
|
9
10
|
multiline?: boolean,
|
|
10
11
|
prefix?: React.Node,
|
|
11
12
|
endIcon?: React.Node,
|
|
12
13
|
getSuggestions?: (value: string) => Array<string>,
|
|
13
14
|
};
|
|
14
|
-
declare var TextField: React.ComponentType<
|
|
15
|
+
declare var TextField: React.ComponentType<{
|
|
16
|
+
...TextFieldProps,
|
|
17
|
+
ref?: React.Ref<HTMLInputElement>,
|
|
18
|
+
}>;
|
|
15
19
|
declare export default typeof TextField;
|
package/dist/video.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare type AspectRatio = '1:1' | '16:9' | '12:5';
|
|
3
|
+
export declare const RATIO: {
|
|
4
|
+
'1:1': number;
|
|
5
|
+
'16:9': number;
|
|
6
|
+
'12:5': number;
|
|
7
|
+
};
|
|
8
|
+
declare type VideoSource = {
|
|
9
|
+
src: string;
|
|
10
|
+
type?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare type VideoProps = {
|
|
13
|
+
/** defaults to 100% when no width and no height are given */
|
|
14
|
+
width?: number;
|
|
15
|
+
height?: number;
|
|
16
|
+
/** defaults to 1:1, if both width and height are given, aspectRatio is ignored */
|
|
17
|
+
aspectRatio?: AspectRatio;
|
|
18
|
+
/** accepts multiple sources */
|
|
19
|
+
src: string | Array<string> | VideoSource | Array<VideoSource>;
|
|
20
|
+
/** defaults to true */
|
|
21
|
+
loop?: boolean;
|
|
22
|
+
/** defaults to true */
|
|
23
|
+
muted?: boolean;
|
|
24
|
+
/** defaults to true */
|
|
25
|
+
autoPlay?: boolean;
|
|
26
|
+
poster?: string;
|
|
27
|
+
children?: void;
|
|
28
|
+
/** defaults to none */
|
|
29
|
+
preload?: 'none' | 'metadata' | 'auto';
|
|
30
|
+
};
|
|
31
|
+
declare const Video: React.ForwardRefExoticComponent<VideoProps & React.RefAttributes<HTMLVideoElement>>;
|
|
32
|
+
export default Video;
|