@telefonica/mistica 10.14.2 → 10.18.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 +34 -0
- package/dist/button.js +16 -26
- package/dist/card.d.ts +10 -1
- package/dist/card.js +4 -1
- package/dist/card.js.flow +16 -1
- package/dist/checkbox.js +11 -7
- 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 +12 -6
- 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/image.d.ts +25 -4
- package/dist/image.js +64 -7
- package/dist/image.js.flow +30 -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/list.d.ts +1 -0
- package/dist/list.js +63 -26
- package/dist/list.js.flow +1 -0
- 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/radio-button.js +13 -9
- package/dist/search-field.js +2 -2
- package/dist/select.js +7 -18
- package/dist/skins/blau.js +0 -24
- package/dist/skins/movistar.js +0 -23
- package/dist/skins/o2-classic.js +0 -24
- package/dist/skins/o2.js +0 -23
- package/dist/skins/types.d.ts +0 -12
- package/dist/skins/types.js.flow +0 -12
- package/dist/skins/vivo.js +0 -23
- package/dist/switch-component.js +12 -9
- package/dist/text-field-base.d.ts +3 -2
- package/dist/text-field-base.js +15 -33
- package/dist/text-field-base.js.flow +6 -2
- package/dist/text-field-components.d.ts +0 -1
- package/dist/text-field-components.js +8 -15
- package/dist/text-field-components.js.flow +0 -1
- 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/text-link.d.ts +1 -0
- package/dist/text-link.js +16 -9
- package/dist/text-link.js.flow +1 -0
- package/dist/touchable.js +2 -3
- package/dist/video.d.ts +32 -0
- package/dist/video.js +161 -0
- package/dist/video.js.flow +50 -0
- package/dist-es/button.js +16 -26
- package/dist-es/card.js +4 -1
- package/dist-es/checkbox.js +11 -7
- 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 +12 -6
- 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/image.js +38 -6
- package/dist-es/index.js +3 -1
- package/dist-es/integer-field.js +2 -2
- package/dist-es/list.js +63 -26
- 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/radio-button.js +13 -9
- package/dist-es/search-field.js +2 -2
- package/dist-es/select.js +7 -18
- package/dist-es/skins/blau.js +0 -24
- package/dist-es/skins/movistar.js +0 -23
- package/dist-es/skins/o2-classic.js +0 -24
- package/dist-es/skins/o2.js +0 -23
- package/dist-es/skins/vivo.js +0 -23
- package/dist-es/switch-component.js +12 -9
- package/dist-es/text-field-base.js +15 -32
- package/dist-es/text-field-components.js +8 -15
- package/dist-es/text-field.js +9 -12
- package/dist-es/text-link.js +14 -8
- package/dist-es/touchable.js +2 -3
- package/dist-es/video.js +123 -0
- package/package.json +2 -2
package/dist-es/iban-field.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useRifm } from 'rifm';
|
|
4
4
|
import { useFieldProps } from './form-context';
|
|
5
|
-
import
|
|
5
|
+
import { TextFieldBaseAutosuggest } from './text-field-base';
|
|
6
6
|
import { createChangeEvent } from './utils/dom';
|
|
7
7
|
import { combineRefs } from './utils/common';
|
|
8
8
|
import { useTheme } from './hooks';
|
|
@@ -246,7 +246,7 @@ var IbanField = function(_param) {
|
|
|
246
246
|
onChange: onChange,
|
|
247
247
|
onChangeValue: onChangeValue
|
|
248
248
|
});
|
|
249
|
-
return(/*#__PURE__*/ _jsx(
|
|
249
|
+
return(/*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
|
|
250
250
|
}, rest, fieldProps, {
|
|
251
251
|
inputComponent: IbanInput
|
|
252
252
|
})));
|
package/dist-es/image.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
2
3
|
import { createUseStyles } from './jss';
|
|
3
4
|
function _objectWithoutProperties(source, excluded) {
|
|
4
5
|
if (source == null) return {
|
|
@@ -30,31 +31,62 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
30
31
|
}
|
|
31
32
|
return target;
|
|
32
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* This context is used internally to disable the border radius. This is useful for example
|
|
36
|
+
* when using the Image component inside a Card
|
|
37
|
+
*/ var DisableBorderRadiusContext = /*#__PURE__*/ React.createContext(false);
|
|
38
|
+
export var useDisableBorderRadius = function() {
|
|
39
|
+
return React.useContext(DisableBorderRadiusContext);
|
|
40
|
+
};
|
|
41
|
+
export var DisableBorderRadiusProvider = function(param) {
|
|
42
|
+
var children = param.children;
|
|
43
|
+
/*#__PURE__*/ return _jsx(DisableBorderRadiusContext.Provider, {
|
|
44
|
+
value: true,
|
|
45
|
+
children: children
|
|
46
|
+
});
|
|
47
|
+
};
|
|
33
48
|
var useStyles = createUseStyles(function() {
|
|
34
49
|
return {
|
|
35
50
|
image: {
|
|
36
|
-
borderRadius:
|
|
51
|
+
borderRadius: function(param) {
|
|
52
|
+
var noBorderRadius = param.noBorderRadius;
|
|
53
|
+
return noBorderRadius ? 0 : 4;
|
|
54
|
+
},
|
|
37
55
|
display: 'block',
|
|
38
56
|
objectFit: 'cover',
|
|
39
57
|
maxWidth: '100%',
|
|
40
|
-
maxHeight: '100%'
|
|
58
|
+
maxHeight: '100%',
|
|
59
|
+
aspectRatio: function(param) {
|
|
60
|
+
var aspectRatio = param.aspectRatio;
|
|
61
|
+
return aspectRatio !== null && aspectRatio !== void 0 ? aspectRatio : 'unset';
|
|
62
|
+
}
|
|
41
63
|
}
|
|
42
64
|
};
|
|
43
65
|
});
|
|
44
|
-
var RATIO = {
|
|
66
|
+
export var RATIO = {
|
|
45
67
|
'1:1': 1,
|
|
46
68
|
'16:9': 16 / 9,
|
|
47
69
|
'7:10': 7 / 10
|
|
48
70
|
};
|
|
49
71
|
var Image = function(_param) {
|
|
50
|
-
var
|
|
51
|
-
var
|
|
72
|
+
var _aspectRatio = _param.aspectRatio, aspectRatio = _aspectRatio === void 0 ? '1:1' : _aspectRatio, _alt = _param.alt, alt = _alt === void 0 ? '' : _alt, props = _objectWithoutProperties(_param, ["aspectRatio", "alt"]);
|
|
73
|
+
var noBorderRadius = useDisableBorderRadius();
|
|
74
|
+
var classes = useStyles({
|
|
75
|
+
noBorderRadius: noBorderRadius,
|
|
76
|
+
aspectRatio: !props.width && !props.height ? RATIO[aspectRatio] : undefined
|
|
77
|
+
});
|
|
78
|
+
var url = props.src || props.url;
|
|
52
79
|
var width = props.width;
|
|
53
80
|
var height = props.height;
|
|
54
|
-
if (props.width !== undefined) {
|
|
81
|
+
if (props.width !== undefined && props.height !== undefined) {
|
|
82
|
+
width = props.width;
|
|
83
|
+
height = props.height;
|
|
84
|
+
} else if (props.width !== undefined) {
|
|
55
85
|
height = props.width / RATIO[aspectRatio];
|
|
56
86
|
} else if (props.height !== undefined) {
|
|
57
87
|
width = props.height * RATIO[aspectRatio];
|
|
88
|
+
} else {
|
|
89
|
+
width = '100%';
|
|
58
90
|
}
|
|
59
91
|
return(/*#__PURE__*/ _jsx("img", {
|
|
60
92
|
src: url,
|
package/dist-es/index.js
CHANGED
|
@@ -56,10 +56,12 @@ export { default as Callout } from './callout';
|
|
|
56
56
|
export { useModalState } from './modal-context-provider';
|
|
57
57
|
export { NavigationBar, MainNavigationBar, FunnelNavigationBar, NavigationBarActionGroup, NavigationBarAction, NavigationBarLogo } from './navigation-bar';
|
|
58
58
|
export { default as Image } from './image';
|
|
59
|
+
export { default as Video } from './video';
|
|
59
60
|
// Forms
|
|
60
61
|
export { default as Form } from './form';
|
|
61
62
|
export { default as Select } from './select';
|
|
62
63
|
export { default as TextField } from './text-field';
|
|
64
|
+
export { TextFieldBase } from './text-field-base';
|
|
63
65
|
export { default as SearchField } from './search-field';
|
|
64
66
|
export { default as EmailField } from './email-field';
|
|
65
67
|
export { default as PhoneNumberField } from './phone-number-field';
|
|
@@ -75,7 +77,7 @@ export { default as DecimalField } from './decimal-field';
|
|
|
75
77
|
export { default as PasswordField } from './password-field';
|
|
76
78
|
export { default as DoubleField } from './double-field';
|
|
77
79
|
export { default as IbanField } from './iban-field';
|
|
78
|
-
export { useForm } from './form-context';
|
|
80
|
+
export { useForm, useFieldProps } from './form-context';
|
|
79
81
|
// Icons
|
|
80
82
|
// @deprecated use IconCloseRegular instead
|
|
81
83
|
export { default as IconClose } from './icons/icon-close';
|
package/dist-es/integer-field.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useFieldProps } from './form-context';
|
|
3
3
|
import { useTheme } from './hooks';
|
|
4
|
-
import
|
|
4
|
+
import { TextFieldBaseAutosuggest } from './text-field-base';
|
|
5
5
|
function _defineProperty(obj, key, value) {
|
|
6
6
|
if (key in obj) {
|
|
7
7
|
Object.defineProperty(obj, key, {
|
|
@@ -110,7 +110,7 @@ var IntegerField = function(_param) {
|
|
|
110
110
|
onChange: onChange,
|
|
111
111
|
onChangeValue: onChangeValue
|
|
112
112
|
});
|
|
113
|
-
return(/*#__PURE__*/ _jsx(
|
|
113
|
+
return(/*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
|
|
114
114
|
}, rest, fieldProps, {
|
|
115
115
|
inputComponent: IntegerInput
|
|
116
116
|
})));
|
package/dist-es/list.js
CHANGED
|
@@ -16,7 +16,7 @@ import { useAriaId, useTheme } from './hooks';
|
|
|
16
16
|
import { useIsInverseVariant } from './theme-variant-context';
|
|
17
17
|
import IconChevron from './icons/icon-chevron';
|
|
18
18
|
import Switch from './switch-component';
|
|
19
|
-
import RadioButton from './radio-button';
|
|
19
|
+
import RadioButton, { useRadioContext } from './radio-button';
|
|
20
20
|
import Checkbox from './checkbox';
|
|
21
21
|
import { Boxed } from './boxed';
|
|
22
22
|
import Divider from './divider';
|
|
@@ -84,18 +84,24 @@ function _slicedToArray(arr, i) {
|
|
|
84
84
|
var useStyles = createUseStyles(function(param) {
|
|
85
85
|
var colors = param.colors, mq = param.mq;
|
|
86
86
|
return {
|
|
87
|
+
disabled: {
|
|
88
|
+
opacity: 0.5
|
|
89
|
+
},
|
|
87
90
|
hover: _defineProperty({
|
|
88
91
|
}, mq.supportsHover, {
|
|
89
92
|
'&:hover': {
|
|
90
93
|
background: function(param) {
|
|
91
|
-
var isInverse = param.isInverse;
|
|
92
|
-
return isInverse ? 'initial' : colors.backgroundAlternative;
|
|
94
|
+
var isInverse = param.isInverse, disabled = param.disabled;
|
|
95
|
+
return isInverse || disabled ? 'initial' : colors.backgroundAlternative;
|
|
93
96
|
}
|
|
94
97
|
}
|
|
95
98
|
}),
|
|
96
99
|
rowContent: {
|
|
97
100
|
width: '100%',
|
|
98
|
-
cursor:
|
|
101
|
+
cursor: function(param) {
|
|
102
|
+
var disabled = param.disabled;
|
|
103
|
+
return disabled ? 'default' : 'pointer';
|
|
104
|
+
}
|
|
99
105
|
},
|
|
100
106
|
hoverDisabled: {
|
|
101
107
|
cursor: 'initial',
|
|
@@ -166,8 +172,9 @@ var useStyles = createUseStyles(function(param) {
|
|
|
166
172
|
}
|
|
167
173
|
};
|
|
168
174
|
});
|
|
175
|
+
var _obj;
|
|
169
176
|
var Content = function(param) {
|
|
170
|
-
var headline = param.headline, title = param.title, titleLinesMax = param.titleLinesMax, subtitle = param.subtitle, subtitleLinesMax = param.subtitleLinesMax, description = param.description, descriptionLinesMax = param.descriptionLinesMax, asset = param.asset, _type = param.type, type = _type === void 0 ? 'basic' : _type, badge = param.badge, right = param.right, extra = param.extra, labelId = param.labelId;
|
|
177
|
+
var headline = param.headline, title = param.title, titleLinesMax = param.titleLinesMax, subtitle = param.subtitle, subtitleLinesMax = param.subtitleLinesMax, description = param.description, descriptionLinesMax = param.descriptionLinesMax, asset = param.asset, _type = param.type, type = _type === void 0 ? 'basic' : _type, badge = param.badge, right = param.right, extra = param.extra, labelId = param.labelId, disabled = param.disabled;
|
|
171
178
|
var isInverse = useIsInverseVariant();
|
|
172
179
|
var classes = useStyles({
|
|
173
180
|
isInverse: isInverse
|
|
@@ -188,7 +195,8 @@ var Content = function(param) {
|
|
|
188
195
|
return(/*#__PURE__*/ _jsx(Box, {
|
|
189
196
|
paddingLeft: 16,
|
|
190
197
|
children: /*#__PURE__*/ _jsx("div", {
|
|
191
|
-
className: classNames(classes.center, classes.badge
|
|
198
|
+
className: classNames(classes.center, classes.badge, _defineProperty({
|
|
199
|
+
}, classes.disabled, disabled)),
|
|
192
200
|
children: badge === true ? /*#__PURE__*/ _jsx(Badge, {
|
|
193
201
|
}) : /*#__PURE__*/ _jsx(Badge, {
|
|
194
202
|
value: badge
|
|
@@ -196,21 +204,49 @@ var Content = function(param) {
|
|
|
196
204
|
})
|
|
197
205
|
}));
|
|
198
206
|
};
|
|
207
|
+
var renderRight = function() {
|
|
208
|
+
switch(type){
|
|
209
|
+
case 'chevron':
|
|
210
|
+
return(/*#__PURE__*/ _jsx(Box, {
|
|
211
|
+
paddingLeft: 16,
|
|
212
|
+
className: classNames(classes.center, _defineProperty({
|
|
213
|
+
}, classes.disabled, disabled)),
|
|
214
|
+
children: /*#__PURE__*/ _jsx(IconChevron, {
|
|
215
|
+
color: isInverse ? colors.inverse : colors.neutralMedium,
|
|
216
|
+
direction: "right"
|
|
217
|
+
})
|
|
218
|
+
}));
|
|
219
|
+
case 'control':
|
|
220
|
+
return(/*#__PURE__*/ _jsx("div", {
|
|
221
|
+
className: classes.right,
|
|
222
|
+
children: right
|
|
223
|
+
}));
|
|
224
|
+
case 'custom':
|
|
225
|
+
return(/*#__PURE__*/ _jsx("div", {
|
|
226
|
+
className: classNames(classes.right, _defineProperty({
|
|
227
|
+
}, classes.disabled, disabled)),
|
|
228
|
+
children: right
|
|
229
|
+
}));
|
|
230
|
+
default:
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
};
|
|
199
234
|
return(/*#__PURE__*/ _jsxs(Box, {
|
|
200
235
|
paddingY: 16,
|
|
201
236
|
className: classes.content,
|
|
202
237
|
children: [
|
|
203
238
|
asset && /*#__PURE__*/ _jsx(Box, {
|
|
204
239
|
paddingRight: 16,
|
|
205
|
-
className: classNames(
|
|
206
|
-
}, classes.center, shouldCenter)),
|
|
240
|
+
className: classNames((_obj = {
|
|
241
|
+
}, _defineProperty(_obj, classes.center, shouldCenter), _defineProperty(_obj, classes.disabled, disabled), _obj)),
|
|
207
242
|
children: /*#__PURE__*/ _jsx("div", {
|
|
208
243
|
className: classes.asset,
|
|
209
244
|
children: asset
|
|
210
245
|
})
|
|
211
246
|
}),
|
|
212
247
|
/*#__PURE__*/ _jsx("div", {
|
|
213
|
-
className: classes.rowBody,
|
|
248
|
+
className: classNames(classes.rowBody, _defineProperty({
|
|
249
|
+
}, classes.disabled, disabled)),
|
|
214
250
|
style: {
|
|
215
251
|
justifyContent: shouldCenter ? 'center' : 'flex-start'
|
|
216
252
|
},
|
|
@@ -255,17 +291,7 @@ var Content = function(param) {
|
|
|
255
291
|
})
|
|
256
292
|
}),
|
|
257
293
|
renderBadge(),
|
|
258
|
-
|
|
259
|
-
paddingLeft: 16,
|
|
260
|
-
className: classes.center,
|
|
261
|
-
children: /*#__PURE__*/ _jsx(IconChevron, {
|
|
262
|
-
color: isInverse ? colors.inverse : colors.neutralMedium,
|
|
263
|
-
direction: "right"
|
|
264
|
-
})
|
|
265
|
-
}) : right ? /*#__PURE__*/ _jsx("div", {
|
|
266
|
-
className: classes.right,
|
|
267
|
-
children: right
|
|
268
|
-
}) : null
|
|
294
|
+
renderRight()
|
|
269
295
|
]
|
|
270
296
|
}));
|
|
271
297
|
};
|
|
@@ -295,10 +321,13 @@ var useControlState = function(param) {
|
|
|
295
321
|
var RowContent = /*#__PURE__*/ React.forwardRef(function(props, ref5) {
|
|
296
322
|
var titleId = useAriaId();
|
|
297
323
|
var isInverse = useIsInverseVariant();
|
|
324
|
+
var asset = props.asset, headline = props.headline, title = props.title, titleLinesMax = props.titleLinesMax, subtitle = props.subtitle, subtitleLinesMax = props.subtitleLinesMax, description = props.description, descriptionLinesMax = props.descriptionLinesMax, badge = props.badge, role = props.role, extra = props.extra, dataAttributes = props.dataAttributes;
|
|
325
|
+
var radioContext = useRadioContext();
|
|
326
|
+
var disabled = props.disabled || props.radioValue !== undefined && radioContext.disabled;
|
|
298
327
|
var classes = useStyles({
|
|
299
|
-
isInverse: isInverse
|
|
328
|
+
isInverse: isInverse,
|
|
329
|
+
disabled: disabled
|
|
300
330
|
});
|
|
301
|
-
var asset = props.asset, headline = props.headline, title = props.title, titleLinesMax = props.titleLinesMax, subtitle = props.subtitle, subtitleLinesMax = props.subtitleLinesMax, description = props.description, descriptionLinesMax = props.descriptionLinesMax, badge = props.badge, role = props.role, extra = props.extra, dataAttributes = props.dataAttributes;
|
|
302
331
|
var ref1 = _slicedToArray(useControlState(props.switch || props.checkbox || {
|
|
303
332
|
}), 2), isChecked = ref1[0], toggle = ref1[1];
|
|
304
333
|
var renderContent = function(param) {
|
|
@@ -316,7 +345,8 @@ var RowContent = /*#__PURE__*/ React.forwardRef(function(props, ref5) {
|
|
|
316
345
|
type: type,
|
|
317
346
|
right: right,
|
|
318
347
|
extra: extra,
|
|
319
|
-
labelId: labelId
|
|
348
|
+
labelId: labelId,
|
|
349
|
+
disabled: disabled
|
|
320
350
|
});
|
|
321
351
|
};
|
|
322
352
|
var renderTouchableContent = function(props) {
|
|
@@ -344,6 +374,7 @@ var RowContent = /*#__PURE__*/ React.forwardRef(function(props, ref5) {
|
|
|
344
374
|
onPress: props.onPress,
|
|
345
375
|
role: role,
|
|
346
376
|
dataAttributes: dataAttributes,
|
|
377
|
+
disabled: disabled,
|
|
347
378
|
children: renderTouchableContent(props)
|
|
348
379
|
}));
|
|
349
380
|
}
|
|
@@ -355,6 +386,7 @@ var RowContent = /*#__PURE__*/ React.forwardRef(function(props, ref5) {
|
|
|
355
386
|
fullPageOnWebView: props.fullPageOnWebView,
|
|
356
387
|
role: role,
|
|
357
388
|
dataAttributes: dataAttributes,
|
|
389
|
+
disabled: disabled,
|
|
358
390
|
children: renderTouchableContent(props)
|
|
359
391
|
}));
|
|
360
392
|
}
|
|
@@ -366,6 +398,7 @@ var RowContent = /*#__PURE__*/ React.forwardRef(function(props, ref5) {
|
|
|
366
398
|
newTab: props.newTab,
|
|
367
399
|
role: role,
|
|
368
400
|
dataAttributes: dataAttributes,
|
|
401
|
+
disabled: disabled,
|
|
369
402
|
children: renderTouchableContent(props)
|
|
370
403
|
}));
|
|
371
404
|
}
|
|
@@ -377,19 +410,22 @@ var RowContent = /*#__PURE__*/ React.forwardRef(function(props, ref5) {
|
|
|
377
410
|
className: classes.dualActionContainer,
|
|
378
411
|
children: [
|
|
379
412
|
/*#__PURE__*/ _jsx(Touchable, {
|
|
413
|
+
disabled: disabled,
|
|
380
414
|
onPress: props.onPress,
|
|
381
415
|
role: role,
|
|
382
416
|
className: classNames(classes.dualActionLeft, classes.hover),
|
|
383
417
|
children: renderContent({
|
|
384
|
-
type: '
|
|
418
|
+
type: 'basic',
|
|
385
419
|
labelId: titleId
|
|
386
420
|
})
|
|
387
421
|
}),
|
|
388
422
|
/*#__PURE__*/ _jsx(Touchable, {
|
|
423
|
+
disabled: disabled,
|
|
389
424
|
className: classes.dualActionRight,
|
|
390
425
|
onPress: toggle,
|
|
391
426
|
dataAttributes: dataAttributes,
|
|
392
427
|
children: /*#__PURE__*/ _jsx(Control, {
|
|
428
|
+
disabled: disabled,
|
|
393
429
|
name: name,
|
|
394
430
|
checked: isChecked,
|
|
395
431
|
"aria-labelledby": titleId,
|
|
@@ -402,6 +438,7 @@ var RowContent = /*#__PURE__*/ React.forwardRef(function(props, ref5) {
|
|
|
402
438
|
}) : /*#__PURE__*/ _jsx("div", {
|
|
403
439
|
className: classNames(classes.rowContent, classes.hover),
|
|
404
440
|
children: /*#__PURE__*/ _jsx(Control, {
|
|
441
|
+
disabled: disabled,
|
|
405
442
|
dataAttributes: dataAttributes,
|
|
406
443
|
name: name,
|
|
407
444
|
checked: isChecked,
|
|
@@ -412,7 +449,7 @@ var RowContent = /*#__PURE__*/ React.forwardRef(function(props, ref5) {
|
|
|
412
449
|
role: role,
|
|
413
450
|
children: renderContent({
|
|
414
451
|
labelId: labelId,
|
|
415
|
-
type: '
|
|
452
|
+
type: 'control',
|
|
416
453
|
right: /*#__PURE__*/ _jsx(Stack, {
|
|
417
454
|
space: "around",
|
|
418
455
|
children: control
|
|
@@ -442,7 +479,7 @@ var RowContent = /*#__PURE__*/ React.forwardRef(function(props, ref5) {
|
|
|
442
479
|
/*#__PURE__*/ return _jsx(Box, {
|
|
443
480
|
paddingX: 16,
|
|
444
481
|
children: renderContent({
|
|
445
|
-
type: '
|
|
482
|
+
type: 'control',
|
|
446
483
|
right: /*#__PURE__*/ _jsx(Stack, {
|
|
447
484
|
space: "around",
|
|
448
485
|
children: radio
|
package/dist-es/menu.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { ESC, TAB } from './utils/key-codes';
|
|
4
|
-
import Overlay from './overlay';
|
|
5
4
|
import { createUseStyles } from './jss';
|
|
6
5
|
import { cancelEvent } from './utils/dom';
|
|
6
|
+
import Overlay from './overlay';
|
|
7
7
|
function _arrayWithHoles(arr) {
|
|
8
8
|
if (Array.isArray(arr)) return arr;
|
|
9
9
|
}
|
|
@@ -69,6 +69,7 @@ var useStyles = createUseStyles(function(param) {
|
|
|
69
69
|
var colors = param.colors;
|
|
70
70
|
return {
|
|
71
71
|
menuContainer: {
|
|
72
|
+
zIndex: 12,
|
|
72
73
|
margin: 0,
|
|
73
74
|
padding: 0,
|
|
74
75
|
listStyleType: 'none',
|
|
@@ -77,13 +78,17 @@ var useStyles = createUseStyles(function(param) {
|
|
|
77
78
|
var itemsComputedProps = param.itemsComputedProps;
|
|
78
79
|
return itemsComputedProps.top;
|
|
79
80
|
},
|
|
80
|
-
|
|
81
|
+
bottom: function(param) {
|
|
82
|
+
var itemsComputedProps = param.itemsComputedProps;
|
|
83
|
+
return itemsComputedProps.bottom;
|
|
84
|
+
},
|
|
85
|
+
right: function(param) {
|
|
81
86
|
var itemsComputedProps = param.itemsComputedProps;
|
|
82
|
-
return itemsComputedProps.
|
|
87
|
+
return itemsComputedProps.right;
|
|
83
88
|
},
|
|
84
89
|
width: function(param) {
|
|
85
|
-
var
|
|
86
|
-
return width !== null && width !== void 0 ? width :
|
|
90
|
+
var width = param.width;
|
|
91
|
+
return width !== null && width !== void 0 ? width : '100%';
|
|
87
92
|
},
|
|
88
93
|
borderRadius: 4,
|
|
89
94
|
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)',
|
|
@@ -124,28 +129,27 @@ var Menu = function(param) {
|
|
|
124
129
|
return;
|
|
125
130
|
}
|
|
126
131
|
var MARGIN_THRESHOLD = 12;
|
|
127
|
-
var topTarget = targetRect.top, widthTarget = targetRect.width,
|
|
132
|
+
var topTarget = targetRect.top, widthTarget = targetRect.width, height = targetRect.height;
|
|
128
133
|
var top = topTarget + height;
|
|
129
134
|
var ref;
|
|
130
135
|
var spaceTaken = (ref = parseInt(window.getComputedStyle(menu).getPropertyValue('height'))) !== null && ref !== void 0 ? ref : 0;
|
|
131
|
-
var
|
|
136
|
+
var rightDirection = position === 'left' ? 'auto' : "calc(100% - ".concat(widthTarget, "px)");
|
|
132
137
|
// if it doesn't fit on bottom
|
|
133
138
|
if (top + spaceTaken + MARGIN_THRESHOLD > window.innerHeight) {
|
|
134
139
|
var availableSpaceBottom = window.innerHeight - top;
|
|
135
140
|
if (topTarget /* this is the available space on top */ > availableSpaceBottom) {
|
|
136
|
-
var newTop = topTarget - spaceTaken;
|
|
137
141
|
setItemsComputedProps({
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
top:
|
|
141
|
-
maxHeight: topTarget
|
|
142
|
+
right: rightDirection,
|
|
143
|
+
bottom: '100%',
|
|
144
|
+
top: 'auto',
|
|
145
|
+
maxHeight: Math.min(topTarget, MAX_HEIGHT_DEFAULT),
|
|
142
146
|
transformOrigin: 'center bottom'
|
|
143
147
|
});
|
|
144
148
|
} else {
|
|
145
149
|
setItemsComputedProps({
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
150
|
+
top: '100%',
|
|
151
|
+
bottom: 'auto',
|
|
152
|
+
right: rightDirection,
|
|
149
153
|
maxHeight: Math.min(window.innerHeight - top - MARGIN_THRESHOLD, MAX_HEIGHT_DEFAULT),
|
|
150
154
|
transformOrigin: 'center top'
|
|
151
155
|
});
|
|
@@ -153,9 +157,9 @@ var Menu = function(param) {
|
|
|
153
157
|
} else {
|
|
154
158
|
// if it fits on bottom
|
|
155
159
|
setItemsComputedProps({
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
160
|
+
top: '100%',
|
|
161
|
+
bottom: 'auto',
|
|
162
|
+
right: rightDirection,
|
|
159
163
|
maxHeight: Math.min(window.innerHeight - top - MARGIN_THRESHOLD, MAX_HEIGHT_DEFAULT),
|
|
160
164
|
transformOrigin: 'center top'
|
|
161
165
|
});
|
|
@@ -223,20 +227,23 @@ var Menu = function(param) {
|
|
|
223
227
|
document.removeEventListener('keydown', handleKeyDown, false);
|
|
224
228
|
};
|
|
225
229
|
});
|
|
226
|
-
return(/*#__PURE__*/ _jsxs(
|
|
230
|
+
return(/*#__PURE__*/ _jsxs("div", {
|
|
231
|
+
style: {
|
|
232
|
+
position: 'relative'
|
|
233
|
+
},
|
|
227
234
|
children: [
|
|
228
|
-
renderTarget(_objectSpread({
|
|
229
|
-
}, targetProps, {
|
|
230
|
-
isMenuOpen: isMenuOpen
|
|
231
|
-
})),
|
|
232
235
|
isMenuOpen ? /*#__PURE__*/ _jsx(Overlay, {
|
|
233
236
|
onPress: function(e) {
|
|
234
|
-
setIsMenuOpen(false);
|
|
235
237
|
cancelEvent(e);
|
|
238
|
+
setIsMenuOpen(false);
|
|
236
239
|
},
|
|
237
|
-
disableScroll: true
|
|
238
|
-
|
|
239
|
-
|
|
240
|
+
disableScroll: true
|
|
241
|
+
}) : null,
|
|
242
|
+
renderTarget(_objectSpread({
|
|
243
|
+
}, targetProps, {
|
|
244
|
+
isMenuOpen: isMenuOpen
|
|
245
|
+
})),
|
|
246
|
+
isMenuOpen ? renderMenu(menuProps) : null
|
|
240
247
|
]
|
|
241
248
|
}));
|
|
242
249
|
};
|
package/dist-es/month-field.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useFieldProps } from './form-context';
|
|
4
|
-
import
|
|
4
|
+
import { TextFieldBaseAutosuggest } from './text-field-base';
|
|
5
5
|
import { isInputTypeSupported } from './utils/dom';
|
|
6
6
|
import { isServerSide } from './utils/environment';
|
|
7
7
|
import IconCalendarRegular from './generated/mistica-icons/icon-calendar-regular';
|
|
@@ -113,7 +113,7 @@ var DateField = function(_param) {
|
|
|
113
113
|
onChange: onChange,
|
|
114
114
|
onChangeValue: onChangeValue
|
|
115
115
|
});
|
|
116
|
-
var nativePicker = /*#__PURE__*/ _jsx(
|
|
116
|
+
var nativePicker = /*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
|
|
117
117
|
}, rest, fieldProps, {
|
|
118
118
|
min: min ? getLocalYearMonthString(min) : undefined,
|
|
119
119
|
max: max ? getLocalYearMonthString(max) : undefined,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// DO NOT EDIT THIS FILE. It's autogenerated by set-version.js
|
|
2
|
-
export var PACKAGE_VERSION = '10.
|
|
2
|
+
export var PACKAGE_VERSION = '10.18.0';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useFieldProps } from './form-context';
|
|
4
|
-
import
|
|
4
|
+
import { TextFieldBaseAutosuggest } from './text-field-base';
|
|
5
5
|
import { useTheme } from './hooks';
|
|
6
6
|
import IconButton from './icon-button';
|
|
7
7
|
import Visibility from './icons/icon-visibility';
|
|
@@ -174,7 +174,7 @@ var PasswordField = function(_param) {
|
|
|
174
174
|
onChange: onChange,
|
|
175
175
|
onChangeValue: onChangeValue
|
|
176
176
|
});
|
|
177
|
-
return(/*#__PURE__*/ _jsx(
|
|
177
|
+
return(/*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
|
|
178
178
|
}, rest, fieldProps, {
|
|
179
179
|
type: isVisible ? 'text' : 'password',
|
|
180
180
|
inputRef: function(field) {
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { useRifm } from 'rifm';
|
|
4
4
|
import { formatAsYouType, formatToE164, parse, getRegionCodeForCountryCode } from '@telefonica/libphonenumber';
|
|
5
5
|
import { useFieldProps } from './form-context';
|
|
6
|
-
import
|
|
6
|
+
import { TextFieldBaseAutosuggest } from './text-field-base';
|
|
7
7
|
import { useTheme } from './hooks';
|
|
8
8
|
import { createChangeEvent } from './utils/dom';
|
|
9
9
|
import { combineRefs } from './utils/common';
|
|
@@ -199,7 +199,7 @@ var PhoneNumberField = function(_param) {
|
|
|
199
199
|
onChange: onChange,
|
|
200
200
|
onChangeValue: onChangeValue
|
|
201
201
|
});
|
|
202
|
-
return(/*#__PURE__*/ _jsx(
|
|
202
|
+
return(/*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
|
|
203
203
|
}, rest, fieldProps, {
|
|
204
204
|
type: "phone",
|
|
205
205
|
inputProps: {
|
package/dist-es/radio-button.js
CHANGED
|
@@ -103,6 +103,7 @@ var useRadioButtonStyles = createUseStyles(function(param) {
|
|
|
103
103
|
var colors = param.colors, isIos = param.isIos;
|
|
104
104
|
return {
|
|
105
105
|
outerCircle: {
|
|
106
|
+
cursor: 'pointer',
|
|
106
107
|
flexShrink: 0,
|
|
107
108
|
width: 20,
|
|
108
109
|
height: 20,
|
|
@@ -135,11 +136,11 @@ var useRadioButtonStyles = createUseStyles(function(param) {
|
|
|
135
136
|
transform: 'scale(1)'
|
|
136
137
|
},
|
|
137
138
|
radioButton: {
|
|
138
|
-
cursor: 'default'
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
139
|
+
cursor: 'default'
|
|
140
|
+
},
|
|
141
|
+
disabled: {
|
|
142
|
+
opacity: 0.5,
|
|
143
|
+
cursor: 'default'
|
|
143
144
|
}
|
|
144
145
|
};
|
|
145
146
|
});
|
|
@@ -157,6 +158,7 @@ var RadioContext = /*#__PURE__*/ React.createContext({
|
|
|
157
158
|
export var useRadioContext = function() {
|
|
158
159
|
return React.useContext(RadioContext);
|
|
159
160
|
};
|
|
161
|
+
var _obj;
|
|
160
162
|
var RadioButton = function(_param) {
|
|
161
163
|
var value = _param.value, id = _param.id, dataAttributes = _param.dataAttributes, rest = _objectWithoutProperties(_param, ["value", "id", "dataAttributes"]);
|
|
162
164
|
var ref = useRadioContext(), disabled = ref.disabled, selectedValue = ref.selectedValue, focusableValue = ref.focusableValue, select = ref.select, selectNext = ref.selectNext, selectPrev = ref.selectPrev;
|
|
@@ -164,7 +166,6 @@ var RadioButton = function(_param) {
|
|
|
164
166
|
var checked = value === selectedValue;
|
|
165
167
|
var tabIndex = focusableValue === value ? 0 : -1;
|
|
166
168
|
var classes = useRadioButtonStyles({
|
|
167
|
-
disabled: disabled,
|
|
168
169
|
checked: checked
|
|
169
170
|
});
|
|
170
171
|
var ref2 = useTheme(), isIos = ref2.isIos;
|
|
@@ -191,8 +192,8 @@ var RadioButton = function(_param) {
|
|
|
191
192
|
}
|
|
192
193
|
};
|
|
193
194
|
var radio = /*#__PURE__*/ _jsx("div", {
|
|
194
|
-
className: classnames(classes.outerCircle,
|
|
195
|
-
}, classes.outerCircleChecked, checked)),
|
|
195
|
+
className: classnames(classes.outerCircle, (_obj = {
|
|
196
|
+
}, _defineProperty(_obj, classes.outerCircleChecked, checked), _defineProperty(_obj, classes.disabled, disabled), _obj)),
|
|
196
197
|
children: !isIos && /*#__PURE__*/ _jsx("div", {
|
|
197
198
|
className: classnames(classes.innerCircle, _defineProperty({
|
|
198
199
|
}, classes.innerCircleChecked, checked))
|
|
@@ -230,7 +231,10 @@ var RadioButton = function(_param) {
|
|
|
230
231
|
/*#__PURE__*/ _jsx(Text3, {
|
|
231
232
|
regular: true,
|
|
232
233
|
as: "div",
|
|
233
|
-
children:
|
|
234
|
+
children: /*#__PURE__*/ _jsx("span", {
|
|
235
|
+
className: disabled ? classes.disabled : '',
|
|
236
|
+
children: rest.children
|
|
237
|
+
})
|
|
234
238
|
})
|
|
235
239
|
]
|
|
236
240
|
})
|
package/dist-es/search-field.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useFieldProps } from './form-context';
|
|
4
|
-
import
|
|
4
|
+
import { TextFieldBaseAutosuggest } from './text-field-base';
|
|
5
5
|
import IconSearch from './icons/icon-search';
|
|
6
6
|
import IconCloseRegular from './generated/mistica-icons/icon-close-regular';
|
|
7
7
|
import IconButton from './icon-button';
|
|
@@ -139,7 +139,7 @@ var SearchField = function(_param) {
|
|
|
139
139
|
onChange: onChange,
|
|
140
140
|
onChangeValue: handleChangeValue
|
|
141
141
|
});
|
|
142
|
-
return(/*#__PURE__*/ _jsx(
|
|
142
|
+
return(/*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
|
|
143
143
|
ref: inputRef,
|
|
144
144
|
startIcon: /*#__PURE__*/ _jsx(IconSearch, {
|
|
145
145
|
}),
|