@ornikar/kitt-universal 9.4.0 → 9.7.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/definitions/Actions/Actions.d.ts +13 -0
- package/dist/definitions/Actions/Actions.d.ts.map +1 -0
- package/dist/definitions/Actions/ActionsButton.d.ts +9 -0
- package/dist/definitions/Actions/ActionsButton.d.ts.map +1 -0
- package/dist/definitions/Actions/ActionsItem.d.ts +12 -0
- package/dist/definitions/Actions/ActionsItem.d.ts.map +1 -0
- package/dist/definitions/Choices/ChoiceItem.d.ts.map +1 -1
- package/dist/definitions/Choices/hooks/useNativeAnimation.d.ts +14 -0
- package/dist/definitions/Choices/hooks/useNativeAnimation.d.ts.map +1 -0
- package/dist/definitions/Choices/hooks/useNativeAnimation.web.d.ts +7 -0
- package/dist/definitions/Choices/hooks/useNativeAnimation.web.d.ts.map +1 -0
- package/dist/definitions/IconButton/IconButton.d.ts +1 -1
- package/dist/definitions/IconButton/IconButton.d.ts.map +1 -1
- package/dist/definitions/IconButton/PressableAnimatedContainer.d.ts +1 -1
- package/dist/definitions/IconButton/PressableAnimatedContainer.d.ts.map +1 -1
- package/dist/definitions/forms/InputField/InputField.d.ts.map +1 -1
- package/dist/definitions/forms/InputText/InputTextContainer.web.d.ts +1 -1
- package/dist/definitions/index.d.ts +4 -0
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/native-base/KittNativeBaseProvider.d.ts +15 -15
- package/dist/definitions/native-base/acceptable-native-base-props.d.ts +5 -0
- package/dist/definitions/native-base/acceptable-native-base-props.d.ts.map +1 -1
- package/dist/definitions/native-base/layout.d.ts +4 -5
- package/dist/definitions/native-base/layout.d.ts.map +1 -1
- package/dist/definitions/native-base/primitives.d.ts +4 -5
- package/dist/definitions/native-base/primitives.d.ts.map +1 -1
- package/dist/definitions/story-components/StoryBlock.d.ts +1 -1
- package/dist/definitions/themes/default.d.ts +7 -1
- package/dist/definitions/themes/default.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/forms.d.ts +7 -1
- package/dist/definitions/themes/late-ocean/forms.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/inputField.d.ts +7 -1
- package/dist/definitions/themes/late-ocean/inputField.d.ts.map +1 -1
- package/dist/definitions/typography/TypographyLink.d.ts +1 -1
- package/dist/definitions/typography/TypographyLink.d.ts.map +1 -1
- package/dist/index-browser-all.es.android.js +629 -500
- package/dist/index-browser-all.es.android.js.map +1 -1
- package/dist/index-browser-all.es.ios.js +629 -500
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +629 -500
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +647 -602
- package/dist/index-browser-all.es.web.js.map +1 -1
- package/dist/index-node-14.17.cjs.js +564 -474
- package/dist/index-node-14.17.cjs.js.map +1 -1
- package/dist/index-node-14.17.cjs.web.css +1 -1
- package/dist/index-node-14.17.cjs.web.js +573 -565
- package/dist/index-node-14.17.cjs.web.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.android.js +7 -1
- package/dist/linaria-themes-browser-all.es.android.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.ios.js +7 -1
- package/dist/linaria-themes-browser-all.es.ios.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.js +7 -1
- package/dist/linaria-themes-browser-all.es.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.web.js +7 -1
- package/dist/linaria-themes-browser-all.es.web.js.map +1 -1
- package/dist/linaria-themes-node-14.17.cjs.js +7 -1
- package/dist/linaria-themes-node-14.17.cjs.js.map +1 -1
- package/dist/linaria-themes-node-14.17.cjs.web.js +7 -1
- package/dist/linaria-themes-node-14.17.cjs.web.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +27 -2
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const nativeBase = require('native-base');
|
|
6
|
+
const React = require('react');
|
|
6
7
|
const reactNative = require('react-native');
|
|
8
|
+
const Animated = require('react-native-reanimated');
|
|
7
9
|
const styled = require('styled-components/native');
|
|
8
|
-
const React = require('react');
|
|
9
10
|
const jsxRuntime = require('react/jsx-runtime');
|
|
10
|
-
const
|
|
11
|
-
const Animated = require('react-native-reanimated');
|
|
11
|
+
const kittIcons = require('@ornikar/kitt-icons');
|
|
12
12
|
const twemojiParser = require('twemoji-parser');
|
|
13
13
|
const WebBrowser = require('expo-web-browser');
|
|
14
14
|
const DateTimePicker = require('@react-native-community/datetimepicker');
|
|
@@ -23,42 +23,183 @@ const addons = require('@storybook/addons');
|
|
|
23
23
|
|
|
24
24
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e['default'] : e; }
|
|
25
25
|
|
|
26
|
-
const styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
27
26
|
const React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
28
27
|
const Animated__default = /*#__PURE__*/_interopDefaultLegacy(Animated);
|
|
28
|
+
const styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
29
29
|
const DateTimePicker__default = /*#__PURE__*/_interopDefaultLegacy(DateTimePicker);
|
|
30
30
|
const Svg__default = /*#__PURE__*/_interopDefaultLegacy(Svg);
|
|
31
31
|
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
$
|
|
44
|
-
}
|
|
45
|
-
function
|
|
46
|
-
|
|
47
|
-
size = defaultIconSize,
|
|
48
|
-
align,
|
|
49
|
-
color
|
|
50
|
-
}) {
|
|
51
|
-
const clonedIcon = /*#__PURE__*/React.cloneElement(icon, {
|
|
52
|
-
color
|
|
53
|
-
});
|
|
54
|
-
return /*#__PURE__*/jsxRuntime.jsx(IconContainer$1, {
|
|
55
|
-
$align: align,
|
|
56
|
-
$size: size,
|
|
57
|
-
$color: color,
|
|
58
|
-
children: clonedIcon
|
|
59
|
-
});
|
|
32
|
+
const Stack = nativeBase.Stack;
|
|
33
|
+
const VStack = nativeBase.VStack;
|
|
34
|
+
const HStack = nativeBase.HStack;
|
|
35
|
+
|
|
36
|
+
function warn(message) {
|
|
37
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
38
|
+
console.warn(message);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function deprecatedMessage(symbol, deprecation, replaceBy) {
|
|
42
|
+
const replaceMessage = replaceBy === undefined ? '' : `, please use ${replaceBy} instead`;
|
|
43
|
+
warn(`[Deprecation] in ${symbol}: ${deprecation} is deprecated${replaceMessage}.`);
|
|
44
|
+
}
|
|
45
|
+
function deprecatedInComponent(component, deprecation, replaceBy) {
|
|
46
|
+
deprecatedMessage(`<${component} />`, deprecation, replaceBy);
|
|
60
47
|
}
|
|
61
48
|
|
|
49
|
+
const hasVariant = (button, variant) => {
|
|
50
|
+
return variant in button;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
function getVariantValuesIfExist(theme, type, variant) {
|
|
54
|
+
const button = theme.kitt.button[type];
|
|
55
|
+
|
|
56
|
+
if (hasVariant(button, variant)) {
|
|
57
|
+
return button[variant];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return theme.kitt.button[type].default;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const StyledPressable = /*#__PURE__*/styled__default.Pressable.withConfig({
|
|
64
|
+
displayName: "AnimatedButtonPressable__StyledPressable",
|
|
65
|
+
componentId: "kitt-universal__sc-175vyve-0"
|
|
66
|
+
})(["", ""], ({
|
|
67
|
+
$isStretch
|
|
68
|
+
}) => {
|
|
69
|
+
if ($isStretch) return undefined;
|
|
70
|
+
return 'align-self: flex-start;';
|
|
71
|
+
});
|
|
72
|
+
const StyledAnimatedView = /*#__PURE__*/styled__default(Animated__default.View).withConfig({
|
|
73
|
+
displayName: "AnimatedButtonPressable__StyledAnimatedView",
|
|
74
|
+
componentId: "kitt-universal__sc-175vyve-1"
|
|
75
|
+
})(["border-radius:", "px;"], ({
|
|
76
|
+
theme
|
|
77
|
+
}) => theme.kitt.button.borderRadius);
|
|
78
|
+
const AnimatedButtonPressable = /*#__PURE__*/React.forwardRef(({
|
|
79
|
+
children,
|
|
80
|
+
disabled,
|
|
81
|
+
accessibilityRole,
|
|
82
|
+
$type,
|
|
83
|
+
$variant,
|
|
84
|
+
$isStretch,
|
|
85
|
+
href,
|
|
86
|
+
hrefAttrs,
|
|
87
|
+
testID,
|
|
88
|
+
onPress
|
|
89
|
+
}, ref) => {
|
|
90
|
+
const theme = /*#__PURE__*/styled.useTheme();
|
|
91
|
+
const pressed = Animated.useSharedValue(0);
|
|
92
|
+
const color = Animated.useSharedValue(0);
|
|
93
|
+
const {
|
|
94
|
+
backgroundColor,
|
|
95
|
+
pressedBackgroundColor
|
|
96
|
+
} = getVariantValuesIfExist(theme, $type, $variant);
|
|
97
|
+
const {
|
|
98
|
+
scale
|
|
99
|
+
} = theme.kitt.button;
|
|
100
|
+
const scaleStyles = Animated.useAnimatedStyle(function () {
|
|
101
|
+
const _f = function () {
|
|
102
|
+
return {
|
|
103
|
+
backgroundColor: Animated.interpolateColor(color.value, [0, 1], [backgroundColor, pressedBackgroundColor]),
|
|
104
|
+
transform: [{
|
|
105
|
+
scale: Animated.withSpring(pressed.value ? scale.base.active : scale.base.default)
|
|
106
|
+
}]
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
_f._closure = {
|
|
111
|
+
interpolateColor: Animated.interpolateColor,
|
|
112
|
+
color,
|
|
113
|
+
backgroundColor,
|
|
114
|
+
pressedBackgroundColor,
|
|
115
|
+
withSpring: Animated.withSpring,
|
|
116
|
+
pressed,
|
|
117
|
+
scale: {
|
|
118
|
+
base: {
|
|
119
|
+
active: scale.base.active,
|
|
120
|
+
default: scale.base.default
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
_f.asString = "function _f(){const{interpolateColor,color,backgroundColor,pressedBackgroundColor,withSpring,pressed,scale}=jsThis._closure;{return{backgroundColor:interpolateColor(color.value,[0,1],[backgroundColor,pressedBackgroundColor]),transform:[{scale:withSpring(pressed.value?scale.base.active:scale.base.default)}]};}}";
|
|
125
|
+
_f.__workletHash = 5368461229978;
|
|
126
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Button/AnimatedButtonPressable.tsx (56:41)";
|
|
127
|
+
_f.__optimalization = 2;
|
|
128
|
+
return _f;
|
|
129
|
+
}());
|
|
130
|
+
|
|
131
|
+
const handlePressInOut = pressIn => {
|
|
132
|
+
color.value = Animated.withSpring(pressIn ? 1 : 0);
|
|
133
|
+
pressed.value = pressIn ? 1 : 0;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
return /*#__PURE__*/jsxRuntime.jsx(StyledPressable, {
|
|
137
|
+
ref: ref,
|
|
138
|
+
disabled: disabled,
|
|
139
|
+
accessibilityRole: accessibilityRole,
|
|
140
|
+
testID: testID,
|
|
141
|
+
href: href,
|
|
142
|
+
hrefAttrs: hrefAttrs,
|
|
143
|
+
$isStretch: $isStretch,
|
|
144
|
+
$type: $type,
|
|
145
|
+
onPress: onPress,
|
|
146
|
+
onPressIn: () => {
|
|
147
|
+
handlePressInOut(true);
|
|
148
|
+
},
|
|
149
|
+
onPressOut: () => {
|
|
150
|
+
handlePressInOut(false);
|
|
151
|
+
},
|
|
152
|
+
children: /*#__PURE__*/jsxRuntime.jsx(StyledAnimatedView, {
|
|
153
|
+
style: disabled ? [{
|
|
154
|
+
transform: [{
|
|
155
|
+
scale: 1
|
|
156
|
+
}]
|
|
157
|
+
}] : [scaleStyles],
|
|
158
|
+
children: children
|
|
159
|
+
})
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
const BaseStyledButtonPressable = /*#__PURE__*/styled__default.View.withConfig({
|
|
164
|
+
displayName: "BaseStyledButtonPressable",
|
|
165
|
+
componentId: "kitt-universal__sc-4k8lse-0"
|
|
166
|
+
})(["position:relative;min-width:", "px;max-width:", ";width:", ";min-height:", "px;border-radius:", "px;flex-direction:row;align-items:center;justify-content:center;align-self:flex-start;background-color:", ";padding:", ";"], ({
|
|
167
|
+
theme
|
|
168
|
+
}) => theme.kitt.button.minWidth, ({
|
|
169
|
+
theme,
|
|
170
|
+
$isStretch
|
|
171
|
+
}) => $isStretch ? '100%' : `${theme.kitt.button.maxWidth}px`, ({
|
|
172
|
+
$isStretch
|
|
173
|
+
}) => $isStretch ? '100%' : 'auto', ({
|
|
174
|
+
theme
|
|
175
|
+
}) => theme.kitt.button.minHeight, ({
|
|
176
|
+
theme
|
|
177
|
+
}) => theme.kitt.button.borderRadius, ({
|
|
178
|
+
theme,
|
|
179
|
+
$isDisabled,
|
|
180
|
+
$type,
|
|
181
|
+
$variant
|
|
182
|
+
}) => {
|
|
183
|
+
if ($isDisabled) return theme.kitt.button.disabled.default.backgroundColor;
|
|
184
|
+
if (reactNative.Platform.OS !== 'web') return 'transparent';
|
|
185
|
+
return getVariantValuesIfExist(theme, $type, $variant).backgroundColor;
|
|
186
|
+
}, ({
|
|
187
|
+
theme,
|
|
188
|
+
$size,
|
|
189
|
+
$isDisabled
|
|
190
|
+
}) => {
|
|
191
|
+
const {
|
|
192
|
+
large,
|
|
193
|
+
default: defaultPadding,
|
|
194
|
+
disabled: disabledPadding,
|
|
195
|
+
xLarge
|
|
196
|
+
} = theme.kitt.button.contentPadding;
|
|
197
|
+
if ($size === 'large') return large;
|
|
198
|
+
if ($size === 'xlarge') return xLarge;
|
|
199
|
+
if ($isDisabled) return disabledPadding;
|
|
200
|
+
return defaultPadding;
|
|
201
|
+
});
|
|
202
|
+
|
|
62
203
|
const KittBreakpoints = {
|
|
63
204
|
/**
|
|
64
205
|
* min-width: 0
|
|
@@ -275,257 +416,39 @@ Typography.h3 = createHeading(3, 'header3');
|
|
|
275
416
|
/** @deprecated use Typography.Header4 */
|
|
276
417
|
|
|
277
418
|
Typography.h4 = createHeading(4, 'header4');
|
|
278
|
-
/** @deprecated use Typography.Header6 */
|
|
279
|
-
|
|
280
|
-
Typography.h5 = createHeading(5, 'header5');
|
|
281
|
-
|
|
282
|
-
const getInitials = (firstname, lastname) => `${firstname[0]}${lastname[0]}`.toUpperCase();
|
|
283
|
-
|
|
284
|
-
const StyledAvatarView = /*#__PURE__*/styled__default.View.withConfig({
|
|
285
|
-
displayName: "Avatar__StyledAvatarView",
|
|
286
|
-
componentId: "kitt-universal__sc-9miubv-0"
|
|
287
|
-
})(["border-radius:", ";background-color:", ";height:", "px;width:", "px;overflow:hidden;align-items:center;justify-content:center;"], ({
|
|
288
|
-
theme,
|
|
289
|
-
$isRound,
|
|
290
|
-
$size,
|
|
291
|
-
$sizeVariant
|
|
292
|
-
}) => {
|
|
293
|
-
if ($isRound) return `${$size / 2}px`;
|
|
294
|
-
return `${$sizeVariant === 'large' ? theme.kitt.avatar.large.borderRadius : theme.kitt.avatar.borderRadius}px`;
|
|
295
|
-
}, ({
|
|
296
|
-
theme,
|
|
297
|
-
$isLight
|
|
298
|
-
}) => $isLight ? theme.kitt.avatar.light.backgroundColor : theme.kitt.avatar.default.backgroundColor, ({
|
|
299
|
-
$size
|
|
300
|
-
}) => $size, ({
|
|
301
|
-
$size
|
|
302
|
-
}) => $size);
|
|
303
|
-
|
|
304
|
-
function AvatarContent({
|
|
305
|
-
size,
|
|
306
|
-
src,
|
|
307
|
-
firstname,
|
|
308
|
-
lastname,
|
|
309
|
-
alt,
|
|
310
|
-
isLight,
|
|
311
|
-
sizeVariant
|
|
312
|
-
}) {
|
|
313
|
-
if (src) {
|
|
314
|
-
return /*#__PURE__*/jsxRuntime.jsx(reactNative.Image, {
|
|
315
|
-
source: {
|
|
316
|
-
uri: src
|
|
317
|
-
},
|
|
318
|
-
style: {
|
|
319
|
-
width: size,
|
|
320
|
-
height: size
|
|
321
|
-
},
|
|
322
|
-
accessibilityLabel: alt
|
|
323
|
-
});
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
if (firstname && lastname) {
|
|
327
|
-
return /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
328
|
-
base: sizeVariant === 'large' ? 'body-large' : 'body-small',
|
|
329
|
-
variant: sizeVariant === 'large' ? 'bold' : 'regular',
|
|
330
|
-
color: isLight ? 'black' : 'white',
|
|
331
|
-
children: getInitials(firstname, lastname)
|
|
332
|
-
});
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
return /*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
336
|
-
icon: /*#__PURE__*/jsxRuntime.jsx(kittIcons.UserIcon, {}),
|
|
337
|
-
color: isLight ? 'black' : 'white',
|
|
338
|
-
size: size / 2
|
|
339
|
-
});
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
function Avatar({
|
|
343
|
-
size = 40,
|
|
344
|
-
round,
|
|
345
|
-
light,
|
|
346
|
-
sizeVariant,
|
|
347
|
-
...props
|
|
348
|
-
}) {
|
|
349
|
-
return /*#__PURE__*/jsxRuntime.jsx(StyledAvatarView, {
|
|
350
|
-
$size: size,
|
|
351
|
-
$isRound: round,
|
|
352
|
-
$isLight: light,
|
|
353
|
-
$sizeVariant: sizeVariant,
|
|
354
|
-
children: /*#__PURE__*/jsxRuntime.jsx(AvatarContent, {
|
|
355
|
-
size: size,
|
|
356
|
-
isLight: light,
|
|
357
|
-
sizeVariant: sizeVariant,
|
|
358
|
-
...props
|
|
359
|
-
})
|
|
360
|
-
});
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
function warn(message) {
|
|
364
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
365
|
-
console.warn(message);
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
function deprecatedMessage(symbol, deprecation, replaceBy) {
|
|
369
|
-
const replaceMessage = replaceBy === undefined ? '' : `, please use ${replaceBy} instead`;
|
|
370
|
-
warn(`[Deprecation] in ${symbol}: ${deprecation} is deprecated${replaceMessage}.`);
|
|
371
|
-
}
|
|
372
|
-
function deprecatedInComponent(component, deprecation, replaceBy) {
|
|
373
|
-
deprecatedMessage(`<${component} />`, deprecation, replaceBy);
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
const hasVariant = (button, variant) => {
|
|
377
|
-
return variant in button;
|
|
378
|
-
};
|
|
379
|
-
|
|
380
|
-
function getVariantValuesIfExist(theme, type, variant) {
|
|
381
|
-
const button = theme.kitt.button[type];
|
|
382
|
-
|
|
383
|
-
if (hasVariant(button, variant)) {
|
|
384
|
-
return button[variant];
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
return theme.kitt.button[type].default;
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
const StyledPressable = /*#__PURE__*/styled__default.Pressable.withConfig({
|
|
391
|
-
displayName: "AnimatedButtonPressable__StyledPressable",
|
|
392
|
-
componentId: "kitt-universal__sc-175vyve-0"
|
|
393
|
-
})(["", ""], ({
|
|
394
|
-
$isStretch
|
|
395
|
-
}) => {
|
|
396
|
-
if ($isStretch) return undefined;
|
|
397
|
-
return 'align-self: flex-start;';
|
|
398
|
-
});
|
|
399
|
-
const StyledAnimatedView = /*#__PURE__*/styled__default(Animated__default.View).withConfig({
|
|
400
|
-
displayName: "AnimatedButtonPressable__StyledAnimatedView",
|
|
401
|
-
componentId: "kitt-universal__sc-175vyve-1"
|
|
402
|
-
})(["border-radius:", "px;"], ({
|
|
403
|
-
theme
|
|
404
|
-
}) => theme.kitt.button.borderRadius);
|
|
405
|
-
const AnimatedButtonPressable = /*#__PURE__*/React.forwardRef(({
|
|
406
|
-
children,
|
|
407
|
-
disabled,
|
|
408
|
-
accessibilityRole,
|
|
409
|
-
$type,
|
|
410
|
-
$variant,
|
|
411
|
-
$isStretch,
|
|
412
|
-
href,
|
|
413
|
-
hrefAttrs,
|
|
414
|
-
testID,
|
|
415
|
-
onPress
|
|
416
|
-
}, ref) => {
|
|
417
|
-
const theme = /*#__PURE__*/styled.useTheme();
|
|
418
|
-
const pressed = Animated.useSharedValue(0);
|
|
419
|
-
const color = Animated.useSharedValue(0);
|
|
420
|
-
const {
|
|
421
|
-
backgroundColor,
|
|
422
|
-
pressedBackgroundColor
|
|
423
|
-
} = getVariantValuesIfExist(theme, $type, $variant);
|
|
424
|
-
const {
|
|
425
|
-
scale
|
|
426
|
-
} = theme.kitt.button;
|
|
427
|
-
const scaleStyles = Animated.useAnimatedStyle(function () {
|
|
428
|
-
const _f = function () {
|
|
429
|
-
return {
|
|
430
|
-
backgroundColor: Animated.interpolateColor(color.value, [0, 1], [backgroundColor, pressedBackgroundColor]),
|
|
431
|
-
transform: [{
|
|
432
|
-
scale: Animated.withSpring(pressed.value ? scale.base.active : scale.base.default)
|
|
433
|
-
}]
|
|
434
|
-
};
|
|
435
|
-
};
|
|
436
|
-
|
|
437
|
-
_f._closure = {
|
|
438
|
-
interpolateColor: Animated.interpolateColor,
|
|
439
|
-
color,
|
|
440
|
-
backgroundColor,
|
|
441
|
-
pressedBackgroundColor,
|
|
442
|
-
withSpring: Animated.withSpring,
|
|
443
|
-
pressed,
|
|
444
|
-
scale: {
|
|
445
|
-
base: {
|
|
446
|
-
active: scale.base.active,
|
|
447
|
-
default: scale.base.default
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
};
|
|
451
|
-
_f.asString = "function _f(){const{interpolateColor,color,backgroundColor,pressedBackgroundColor,withSpring,pressed,scale}=jsThis._closure;{return{backgroundColor:interpolateColor(color.value,[0,1],[backgroundColor,pressedBackgroundColor]),transform:[{scale:withSpring(pressed.value?scale.base.active:scale.base.default)}]};}}";
|
|
452
|
-
_f.__workletHash = 5368461229978;
|
|
453
|
-
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Button/AnimatedButtonPressable.tsx (56:41)";
|
|
454
|
-
_f.__optimalization = 2;
|
|
455
|
-
return _f;
|
|
456
|
-
}());
|
|
457
|
-
|
|
458
|
-
const handlePressInOut = pressIn => {
|
|
459
|
-
color.value = Animated.withSpring(pressIn ? 1 : 0);
|
|
460
|
-
pressed.value = pressIn ? 1 : 0;
|
|
461
|
-
};
|
|
462
|
-
|
|
463
|
-
return /*#__PURE__*/jsxRuntime.jsx(StyledPressable, {
|
|
464
|
-
ref: ref,
|
|
465
|
-
disabled: disabled,
|
|
466
|
-
accessibilityRole: accessibilityRole,
|
|
467
|
-
testID: testID,
|
|
468
|
-
href: href,
|
|
469
|
-
hrefAttrs: hrefAttrs,
|
|
470
|
-
$isStretch: $isStretch,
|
|
471
|
-
$type: $type,
|
|
472
|
-
onPress: onPress,
|
|
473
|
-
onPressIn: () => {
|
|
474
|
-
handlePressInOut(true);
|
|
475
|
-
},
|
|
476
|
-
onPressOut: () => {
|
|
477
|
-
handlePressInOut(false);
|
|
478
|
-
},
|
|
479
|
-
children: /*#__PURE__*/jsxRuntime.jsx(StyledAnimatedView, {
|
|
480
|
-
style: disabled ? [{
|
|
481
|
-
transform: [{
|
|
482
|
-
scale: 1
|
|
483
|
-
}]
|
|
484
|
-
}] : [scaleStyles],
|
|
485
|
-
children: children
|
|
486
|
-
})
|
|
487
|
-
});
|
|
488
|
-
});
|
|
419
|
+
/** @deprecated use Typography.Header6 */
|
|
489
420
|
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
$
|
|
498
|
-
}) => $
|
|
499
|
-
$
|
|
500
|
-
}) => $
|
|
501
|
-
|
|
502
|
-
}) =>
|
|
503
|
-
|
|
504
|
-
}) =>
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
disabled: disabledPadding,
|
|
522
|
-
xLarge
|
|
523
|
-
} = theme.kitt.button.contentPadding;
|
|
524
|
-
if ($size === 'large') return large;
|
|
525
|
-
if ($size === 'xlarge') return xLarge;
|
|
526
|
-
if ($isDisabled) return disabledPadding;
|
|
527
|
-
return defaultPadding;
|
|
528
|
-
});
|
|
421
|
+
Typography.h5 = createHeading(5, 'header5');
|
|
422
|
+
|
|
423
|
+
const defaultIconSize = 20;
|
|
424
|
+
const IconContainer$1 = /*#__PURE__*/styled__default.View.withConfig({
|
|
425
|
+
displayName: "Icon__IconContainer",
|
|
426
|
+
componentId: "kitt-universal__sc-usm0ol-0"
|
|
427
|
+
})(["color:", ";width:", "px;height:", "px;align-self:", ";"], ({
|
|
428
|
+
$color
|
|
429
|
+
}) => $color, ({
|
|
430
|
+
$size
|
|
431
|
+
}) => $size, ({
|
|
432
|
+
$size
|
|
433
|
+
}) => $size, ({
|
|
434
|
+
$align = 'auto'
|
|
435
|
+
}) => $align);
|
|
436
|
+
function Icon({
|
|
437
|
+
icon,
|
|
438
|
+
size = defaultIconSize,
|
|
439
|
+
align,
|
|
440
|
+
color
|
|
441
|
+
}) {
|
|
442
|
+
const clonedIcon = /*#__PURE__*/React.cloneElement(icon, {
|
|
443
|
+
color
|
|
444
|
+
});
|
|
445
|
+
return /*#__PURE__*/jsxRuntime.jsx(IconContainer$1, {
|
|
446
|
+
$align: align,
|
|
447
|
+
$size: size,
|
|
448
|
+
$color: color,
|
|
449
|
+
children: clonedIcon
|
|
450
|
+
});
|
|
451
|
+
}
|
|
529
452
|
|
|
530
453
|
function TypographyIconSpecifiedColor({
|
|
531
454
|
color,
|
|
@@ -674,7 +597,7 @@ function ButtonContentChildren({
|
|
|
674
597
|
};
|
|
675
598
|
return /*#__PURE__*/jsxRuntime.jsxs(StyledChildrenWithIcon, {
|
|
676
599
|
children: [icon && iconPosition === 'left' ? /*#__PURE__*/jsxRuntime.jsx(ButtonIcon, { ...buttonIconSharedProps,
|
|
677
|
-
testID: "button
|
|
600
|
+
testID: "button.ButtonContent.leftButtonIcon",
|
|
678
601
|
icon: icon
|
|
679
602
|
}) : null, /*#__PURE__*/jsxRuntime.jsx(StyledButtonText, {
|
|
680
603
|
base: "body",
|
|
@@ -820,7 +743,244 @@ const Button = /*#__PURE__*/React.forwardRef(({
|
|
|
820
743
|
}), reactNative.Platform.OS !== 'web' && disabled ? /*#__PURE__*/jsxRuntime.jsx(StyledDisabled, {}) : null]
|
|
821
744
|
})
|
|
822
745
|
});
|
|
823
|
-
});
|
|
746
|
+
});
|
|
747
|
+
|
|
748
|
+
function SpinningIcon({
|
|
749
|
+
icon,
|
|
750
|
+
color
|
|
751
|
+
}) {
|
|
752
|
+
if (process.env.NODE_ENV !== 'production' && !color) {
|
|
753
|
+
throw new Error(`Invalid color passed to SpinningIcon: ${String(color)}`);
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
const clonedIcon = /*#__PURE__*/React.cloneElement(icon, {
|
|
757
|
+
color
|
|
758
|
+
});
|
|
759
|
+
const animationRef = React.useRef(new reactNative.Animated.Value(0));
|
|
760
|
+
const rotation = animationRef.current.interpolate({
|
|
761
|
+
inputRange: [0, 1],
|
|
762
|
+
outputRange: ['0deg', '360deg']
|
|
763
|
+
});
|
|
764
|
+
React.useEffect(() => {
|
|
765
|
+
if (process.env.NODE_ENV === 'test') return undefined;
|
|
766
|
+
const animation = reactNative.Animated.loop(reactNative.Animated.timing(animationRef.current, {
|
|
767
|
+
toValue: 1,
|
|
768
|
+
duration: 1100,
|
|
769
|
+
easing: reactNative.Easing.linear,
|
|
770
|
+
useNativeDriver: true
|
|
771
|
+
}));
|
|
772
|
+
animation.start();
|
|
773
|
+
return () => {
|
|
774
|
+
if (process.env.NODE_ENV === 'test') return undefined;
|
|
775
|
+
animation.stop();
|
|
776
|
+
return undefined;
|
|
777
|
+
};
|
|
778
|
+
}, []);
|
|
779
|
+
return /*#__PURE__*/jsxRuntime.jsx(reactNative.Animated.View, {
|
|
780
|
+
style: {
|
|
781
|
+
transform: [{
|
|
782
|
+
rotate: rotation
|
|
783
|
+
}]
|
|
784
|
+
},
|
|
785
|
+
children: clonedIcon
|
|
786
|
+
});
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
function LoaderIcon({
|
|
790
|
+
color
|
|
791
|
+
}) {
|
|
792
|
+
return /*#__PURE__*/jsxRuntime.jsx(SpinningIcon, {
|
|
793
|
+
color: color,
|
|
794
|
+
icon: /*#__PURE__*/jsxRuntime.jsx(kittIcons.ArcIcon, {})
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
const View = nativeBase.View;
|
|
799
|
+
const ScrollView = nativeBase.ScrollView;
|
|
800
|
+
const Pressable = nativeBase.Pressable;
|
|
801
|
+
|
|
802
|
+
function matchWindowSize({
|
|
803
|
+
width,
|
|
804
|
+
height
|
|
805
|
+
}, {
|
|
806
|
+
minWidth,
|
|
807
|
+
maxWidth,
|
|
808
|
+
minHeight,
|
|
809
|
+
maxHeight
|
|
810
|
+
}) {
|
|
811
|
+
const hasWidthMatched = width ? (!minWidth || width >= minWidth) && (!maxWidth || width <= maxWidth) : true;
|
|
812
|
+
const hasHeightMatched = height ? (!minHeight || height >= minHeight) && (!maxHeight || height <= maxHeight) : true;
|
|
813
|
+
return hasWidthMatched && hasHeightMatched;
|
|
814
|
+
}
|
|
815
|
+
function useMatchWindowSize(options) {
|
|
816
|
+
const {
|
|
817
|
+
width,
|
|
818
|
+
height
|
|
819
|
+
} = reactNative.useWindowDimensions();
|
|
820
|
+
return matchWindowSize({
|
|
821
|
+
width,
|
|
822
|
+
height
|
|
823
|
+
}, options);
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
function ActionsItem({
|
|
827
|
+
as,
|
|
828
|
+
onPress,
|
|
829
|
+
disabled,
|
|
830
|
+
icon,
|
|
831
|
+
...props
|
|
832
|
+
}) {
|
|
833
|
+
const isMedium = useMatchWindowSize({
|
|
834
|
+
minWidth: KittBreakpoints.MEDIUM
|
|
835
|
+
});
|
|
836
|
+
const [isLoading, setIsLoading] = React.useState(false);
|
|
837
|
+
const mountedRef = React.useRef(false); // effect just for tracking mounted state, as onPress can unmount the ActionButton
|
|
838
|
+
|
|
839
|
+
React.useEffect(() => {
|
|
840
|
+
mountedRef.current = true;
|
|
841
|
+
return () => {
|
|
842
|
+
mountedRef.current = false;
|
|
843
|
+
};
|
|
844
|
+
}, []);
|
|
845
|
+
return /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
846
|
+
children: /*#__PURE__*/jsxRuntime.jsx(as, { ...props,
|
|
847
|
+
stretch: !isMedium ? true : undefined,
|
|
848
|
+
disabled: isLoading ? true : disabled,
|
|
849
|
+
icon: isLoading ? /*#__PURE__*/jsxRuntime.jsx(LoaderIcon, {}) : icon,
|
|
850
|
+
onPress: e => {
|
|
851
|
+
(async () => {
|
|
852
|
+
if (!onPress) return;
|
|
853
|
+
setIsLoading(true);
|
|
854
|
+
|
|
855
|
+
try {
|
|
856
|
+
await onPress(e);
|
|
857
|
+
|
|
858
|
+
if (mountedRef.current) {
|
|
859
|
+
setIsLoading(false);
|
|
860
|
+
}
|
|
861
|
+
} catch (err) {
|
|
862
|
+
if (mountedRef.current) {
|
|
863
|
+
setIsLoading(false);
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
throw err;
|
|
867
|
+
}
|
|
868
|
+
})();
|
|
869
|
+
}
|
|
870
|
+
})
|
|
871
|
+
});
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
function ActionsButton({ ...props
|
|
875
|
+
}) {
|
|
876
|
+
return /*#__PURE__*/jsxRuntime.jsx(ActionsItem, {
|
|
877
|
+
as: Button,
|
|
878
|
+
...props
|
|
879
|
+
});
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
function Actions({
|
|
883
|
+
children,
|
|
884
|
+
...props
|
|
885
|
+
}) {
|
|
886
|
+
return /*#__PURE__*/jsxRuntime.jsx(Stack, {
|
|
887
|
+
alignItems: {
|
|
888
|
+
base: 'stretch',
|
|
889
|
+
medium: 'center'
|
|
890
|
+
},
|
|
891
|
+
direction: {
|
|
892
|
+
base: 'column',
|
|
893
|
+
medium: 'row'
|
|
894
|
+
},
|
|
895
|
+
flex: 1,
|
|
896
|
+
...props,
|
|
897
|
+
space: "kitt.3",
|
|
898
|
+
children: children
|
|
899
|
+
});
|
|
900
|
+
}
|
|
901
|
+
Actions.Button = ActionsButton;
|
|
902
|
+
Actions.Item = ActionsItem;
|
|
903
|
+
|
|
904
|
+
const getInitials = (firstname, lastname) => `${firstname[0]}${lastname[0]}`.toUpperCase();
|
|
905
|
+
|
|
906
|
+
const StyledAvatarView = /*#__PURE__*/styled__default.View.withConfig({
|
|
907
|
+
displayName: "Avatar__StyledAvatarView",
|
|
908
|
+
componentId: "kitt-universal__sc-9miubv-0"
|
|
909
|
+
})(["border-radius:", ";background-color:", ";height:", "px;width:", "px;overflow:hidden;align-items:center;justify-content:center;"], ({
|
|
910
|
+
theme,
|
|
911
|
+
$isRound,
|
|
912
|
+
$size,
|
|
913
|
+
$sizeVariant
|
|
914
|
+
}) => {
|
|
915
|
+
if ($isRound) return `${$size / 2}px`;
|
|
916
|
+
return `${$sizeVariant === 'large' ? theme.kitt.avatar.large.borderRadius : theme.kitt.avatar.borderRadius}px`;
|
|
917
|
+
}, ({
|
|
918
|
+
theme,
|
|
919
|
+
$isLight
|
|
920
|
+
}) => $isLight ? theme.kitt.avatar.light.backgroundColor : theme.kitt.avatar.default.backgroundColor, ({
|
|
921
|
+
$size
|
|
922
|
+
}) => $size, ({
|
|
923
|
+
$size
|
|
924
|
+
}) => $size);
|
|
925
|
+
|
|
926
|
+
function AvatarContent({
|
|
927
|
+
size,
|
|
928
|
+
src,
|
|
929
|
+
firstname,
|
|
930
|
+
lastname,
|
|
931
|
+
alt,
|
|
932
|
+
isLight,
|
|
933
|
+
sizeVariant
|
|
934
|
+
}) {
|
|
935
|
+
if (src) {
|
|
936
|
+
return /*#__PURE__*/jsxRuntime.jsx(reactNative.Image, {
|
|
937
|
+
source: {
|
|
938
|
+
uri: src
|
|
939
|
+
},
|
|
940
|
+
style: {
|
|
941
|
+
width: size,
|
|
942
|
+
height: size
|
|
943
|
+
},
|
|
944
|
+
accessibilityLabel: alt
|
|
945
|
+
});
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
if (firstname && lastname) {
|
|
949
|
+
return /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
950
|
+
base: sizeVariant === 'large' ? 'body-large' : 'body-small',
|
|
951
|
+
variant: sizeVariant === 'large' ? 'bold' : 'regular',
|
|
952
|
+
color: isLight ? 'black' : 'white',
|
|
953
|
+
children: getInitials(firstname, lastname)
|
|
954
|
+
});
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
return /*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
958
|
+
icon: /*#__PURE__*/jsxRuntime.jsx(kittIcons.UserIcon, {}),
|
|
959
|
+
color: isLight ? 'black' : 'white',
|
|
960
|
+
size: size / 2
|
|
961
|
+
});
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
function Avatar({
|
|
965
|
+
size = 40,
|
|
966
|
+
round,
|
|
967
|
+
light,
|
|
968
|
+
sizeVariant,
|
|
969
|
+
...props
|
|
970
|
+
}) {
|
|
971
|
+
return /*#__PURE__*/jsxRuntime.jsx(StyledAvatarView, {
|
|
972
|
+
$size: size,
|
|
973
|
+
$isRound: round,
|
|
974
|
+
$isLight: light,
|
|
975
|
+
$sizeVariant: sizeVariant,
|
|
976
|
+
children: /*#__PURE__*/jsxRuntime.jsx(AvatarContent, {
|
|
977
|
+
size: size,
|
|
978
|
+
isLight: light,
|
|
979
|
+
sizeVariant: sizeVariant,
|
|
980
|
+
...props
|
|
981
|
+
})
|
|
982
|
+
});
|
|
983
|
+
}
|
|
824
984
|
|
|
825
985
|
const Container$5 = /*#__PURE__*/styled__default.View.withConfig({
|
|
826
986
|
displayName: "Card__Container",
|
|
@@ -848,6 +1008,90 @@ function Card({
|
|
|
848
1008
|
});
|
|
849
1009
|
}
|
|
850
1010
|
|
|
1011
|
+
const useNativeAnimation = ({
|
|
1012
|
+
selected,
|
|
1013
|
+
disabled,
|
|
1014
|
+
isPressedInternal
|
|
1015
|
+
}) => {
|
|
1016
|
+
const theme = /*#__PURE__*/styled.useTheme();
|
|
1017
|
+
const pressed = Animated.useSharedValue(Boolean(isPressedInternal));
|
|
1018
|
+
const progress = Animated.useDerivedValue(function () {
|
|
1019
|
+
const _f = function () {
|
|
1020
|
+
return Animated.withTiming(pressed.value ? 1 : 0, {
|
|
1021
|
+
duration: theme.kitt.choices.item.transition.duration
|
|
1022
|
+
});
|
|
1023
|
+
};
|
|
1024
|
+
|
|
1025
|
+
_f._closure = {
|
|
1026
|
+
withTiming: Animated.withTiming,
|
|
1027
|
+
pressed,
|
|
1028
|
+
theme: {
|
|
1029
|
+
kitt: {
|
|
1030
|
+
choices: {
|
|
1031
|
+
item: {
|
|
1032
|
+
transition: {
|
|
1033
|
+
duration: theme.kitt.choices.item.transition.duration
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
};
|
|
1040
|
+
_f.asString = "function _f(){const{withTiming,pressed,theme}=jsThis._closure;{return withTiming(pressed.value?1:0,{duration:theme.kitt.choices.item.transition.duration});}}";
|
|
1041
|
+
_f.__workletHash = 1120030177160;
|
|
1042
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Choices/hooks/useNativeAnimation.tsx (31:35)";
|
|
1043
|
+
return _f;
|
|
1044
|
+
}());
|
|
1045
|
+
const backgroundStyles = Animated.useAnimatedStyle(function () {
|
|
1046
|
+
const _f = function () {
|
|
1047
|
+
const {
|
|
1048
|
+
default: defaultBg,
|
|
1049
|
+
pressed: pressedBg,
|
|
1050
|
+
selected: selectedBg,
|
|
1051
|
+
disabled: disabledBg
|
|
1052
|
+
} = theme.kitt.choices.item.backgroundColor;
|
|
1053
|
+
if (disabled) return {
|
|
1054
|
+
backgroundColor: disabledBg
|
|
1055
|
+
};
|
|
1056
|
+
if (selected) return {
|
|
1057
|
+
backgroundColor: selectedBg
|
|
1058
|
+
};
|
|
1059
|
+
return {
|
|
1060
|
+
backgroundColor: Animated.interpolateColor(progress.value, [0, 1], [defaultBg, pressedBg])
|
|
1061
|
+
};
|
|
1062
|
+
};
|
|
1063
|
+
|
|
1064
|
+
_f._closure = {
|
|
1065
|
+
theme: {
|
|
1066
|
+
kitt: {
|
|
1067
|
+
choices: {
|
|
1068
|
+
item: {
|
|
1069
|
+
backgroundColor: theme.kitt.choices.item.backgroundColor
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
},
|
|
1074
|
+
disabled,
|
|
1075
|
+
selected,
|
|
1076
|
+
interpolateColor: Animated.interpolateColor,
|
|
1077
|
+
progress
|
|
1078
|
+
};
|
|
1079
|
+
_f.asString = "function _f(){const{theme,disabled,selected,interpolateColor,progress}=jsThis._closure;{const{default:defaultBg,pressed:pressedBg,selected:selectedBg,disabled:disabledBg}=theme.kitt.choices.item.backgroundColor;if(disabled)return{backgroundColor:disabledBg};if(selected)return{backgroundColor:selectedBg};return{backgroundColor:interpolateColor(progress.value,[0,1],[defaultBg,pressedBg])};}}";
|
|
1080
|
+
_f.__workletHash = 15506726129309;
|
|
1081
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Choices/hooks/useNativeAnimation.tsx (35:44)";
|
|
1082
|
+
return _f;
|
|
1083
|
+
}());
|
|
1084
|
+
return {
|
|
1085
|
+
onPressIn: () => {
|
|
1086
|
+
pressed.value = true;
|
|
1087
|
+
},
|
|
1088
|
+
onPressOut: () => {
|
|
1089
|
+
pressed.value = false;
|
|
1090
|
+
},
|
|
1091
|
+
backgroundStyles
|
|
1092
|
+
};
|
|
1093
|
+
};
|
|
1094
|
+
|
|
851
1095
|
function getCurrentTextColor({
|
|
852
1096
|
isDisabled,
|
|
853
1097
|
isSelected,
|
|
@@ -882,7 +1126,7 @@ const DisabledBorder = /*#__PURE__*/styled__default(reactNative.View).withConfig
|
|
|
882
1126
|
} = theme.kitt.choices.item.disabled.border;
|
|
883
1127
|
return styled.css(["border:", "px solid ", ";"], width, color);
|
|
884
1128
|
});
|
|
885
|
-
const ChoiceItemView = /*#__PURE__*/styled__default(Animated__default.View).withConfig({
|
|
1129
|
+
const ChoiceItemView = /*#__PURE__*/styled__default(reactNative.Platform.OS === 'web' ? reactNative.View : Animated__default.View).withConfig({
|
|
886
1130
|
displayName: "ChoiceItem__ChoiceItemView",
|
|
887
1131
|
componentId: "kitt-universal__sc-wuv3y6-1"
|
|
888
1132
|
})(["position:relative;border-radius:", "px;background-color:", ";", ";", ""], ({
|
|
@@ -944,74 +1188,15 @@ function ChoiceItem({
|
|
|
944
1188
|
onBlur,
|
|
945
1189
|
onFocus
|
|
946
1190
|
}) {
|
|
947
|
-
const
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
_f._closure = {
|
|
957
|
-
withTiming: Animated.withTiming,
|
|
958
|
-
pressed,
|
|
959
|
-
theme: {
|
|
960
|
-
kitt: {
|
|
961
|
-
choices: {
|
|
962
|
-
item: {
|
|
963
|
-
transition: {
|
|
964
|
-
duration: theme.kitt.choices.item.transition.duration
|
|
965
|
-
}
|
|
966
|
-
}
|
|
967
|
-
}
|
|
968
|
-
}
|
|
969
|
-
}
|
|
970
|
-
};
|
|
971
|
-
_f.asString = "function _f(){const{withTiming,pressed,theme}=jsThis._closure;{return withTiming(pressed.value?1:0,{duration:theme.kitt.choices.item.transition.duration});}}";
|
|
972
|
-
_f.__workletHash = 1120030177160;
|
|
973
|
-
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Choices/ChoiceItem.tsx (180:35)";
|
|
974
|
-
return _f;
|
|
975
|
-
}());
|
|
976
|
-
const backgroundStyles = Animated.useAnimatedStyle(function () {
|
|
977
|
-
const _f = function () {
|
|
978
|
-
const {
|
|
979
|
-
default: defaultBg,
|
|
980
|
-
pressed: pressedBg,
|
|
981
|
-
selected: selectedBg,
|
|
982
|
-
disabled: disabledBg
|
|
983
|
-
} = theme.kitt.choices.item.backgroundColor;
|
|
984
|
-
if (disabled) return {
|
|
985
|
-
backgroundColor: disabledBg
|
|
986
|
-
};
|
|
987
|
-
if (selected) return {
|
|
988
|
-
backgroundColor: selectedBg
|
|
989
|
-
};
|
|
990
|
-
return {
|
|
991
|
-
backgroundColor: Animated.interpolateColor(progress.value, [0, 1], [defaultBg, pressedBg])
|
|
992
|
-
};
|
|
993
|
-
};
|
|
994
|
-
|
|
995
|
-
_f._closure = {
|
|
996
|
-
theme: {
|
|
997
|
-
kitt: {
|
|
998
|
-
choices: {
|
|
999
|
-
item: {
|
|
1000
|
-
backgroundColor: theme.kitt.choices.item.backgroundColor
|
|
1001
|
-
}
|
|
1002
|
-
}
|
|
1003
|
-
}
|
|
1004
|
-
},
|
|
1005
|
-
disabled,
|
|
1006
|
-
selected,
|
|
1007
|
-
interpolateColor: Animated.interpolateColor,
|
|
1008
|
-
progress
|
|
1009
|
-
};
|
|
1010
|
-
_f.asString = "function _f(){const{theme,disabled,selected,interpolateColor,progress}=jsThis._closure;{const{default:defaultBg,pressed:pressedBg,selected:selectedBg,disabled:disabledBg}=theme.kitt.choices.item.backgroundColor;if(disabled)return{backgroundColor:disabledBg};if(selected)return{backgroundColor:selectedBg};return{backgroundColor:interpolateColor(progress.value,[0,1],[defaultBg,pressedBg])};}}";
|
|
1011
|
-
_f.__workletHash = 15506726129309;
|
|
1012
|
-
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Choices/ChoiceItem.tsx (184:44)";
|
|
1013
|
-
return _f;
|
|
1014
|
-
}());
|
|
1191
|
+
const {
|
|
1192
|
+
onPressIn,
|
|
1193
|
+
onPressOut,
|
|
1194
|
+
backgroundStyles
|
|
1195
|
+
} = useNativeAnimation({
|
|
1196
|
+
selected,
|
|
1197
|
+
disabled,
|
|
1198
|
+
isPressedInternal
|
|
1199
|
+
});
|
|
1015
1200
|
|
|
1016
1201
|
const handleChange = () => {
|
|
1017
1202
|
if (!onChange) return; // Checkbox can be toggled
|
|
@@ -1024,7 +1209,7 @@ function ChoiceItem({
|
|
|
1024
1209
|
onChange(value);
|
|
1025
1210
|
};
|
|
1026
1211
|
|
|
1027
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
1212
|
+
return /*#__PURE__*/jsxRuntime.jsx(Pressable, {
|
|
1028
1213
|
disabled: disabled,
|
|
1029
1214
|
accessibilityRole: type,
|
|
1030
1215
|
accessibilityState: {
|
|
@@ -1038,12 +1223,8 @@ function ChoiceItem({
|
|
|
1038
1223
|
handleChange();
|
|
1039
1224
|
if (onBlur) onBlur(e);
|
|
1040
1225
|
},
|
|
1041
|
-
onPressIn:
|
|
1042
|
-
|
|
1043
|
-
},
|
|
1044
|
-
onPressOut: () => {
|
|
1045
|
-
pressed.value = false;
|
|
1046
|
-
},
|
|
1226
|
+
onPressIn: onPressIn,
|
|
1227
|
+
onPressOut: onPressOut,
|
|
1047
1228
|
children: ({
|
|
1048
1229
|
isHovered,
|
|
1049
1230
|
isPressed
|
|
@@ -1693,8 +1874,14 @@ const input = {
|
|
|
1693
1874
|
};
|
|
1694
1875
|
|
|
1695
1876
|
const inputField = {
|
|
1877
|
+
containerPaddingTop: 5,
|
|
1878
|
+
containerPaddingBottom: 10,
|
|
1879
|
+
feedbackPaddingTop: {
|
|
1880
|
+
base: 5,
|
|
1881
|
+
small: 10
|
|
1882
|
+
},
|
|
1696
1883
|
labelContainerPaddingBottom: 5,
|
|
1697
|
-
|
|
1884
|
+
labelFeedbackMarginLeft: 6
|
|
1698
1885
|
};
|
|
1699
1886
|
|
|
1700
1887
|
const inputTag = {
|
|
@@ -1951,30 +2138,6 @@ const theme = {
|
|
|
1951
2138
|
navigationModal
|
|
1952
2139
|
};
|
|
1953
2140
|
|
|
1954
|
-
function matchWindowSize({
|
|
1955
|
-
width,
|
|
1956
|
-
height
|
|
1957
|
-
}, {
|
|
1958
|
-
minWidth,
|
|
1959
|
-
maxWidth,
|
|
1960
|
-
minHeight,
|
|
1961
|
-
maxHeight
|
|
1962
|
-
}) {
|
|
1963
|
-
const hasWidthMatched = width ? (!minWidth || width >= minWidth) && (!maxWidth || width <= maxWidth) : true;
|
|
1964
|
-
const hasHeightMatched = height ? (!minHeight || height >= minHeight) && (!maxHeight || height <= maxHeight) : true;
|
|
1965
|
-
return hasWidthMatched && hasHeightMatched;
|
|
1966
|
-
}
|
|
1967
|
-
function useMatchWindowSize(options) {
|
|
1968
|
-
const {
|
|
1969
|
-
width,
|
|
1970
|
-
height
|
|
1971
|
-
} = reactNative.useWindowDimensions();
|
|
1972
|
-
return matchWindowSize({
|
|
1973
|
-
width,
|
|
1974
|
-
height
|
|
1975
|
-
}, options);
|
|
1976
|
-
}
|
|
1977
|
-
|
|
1978
2141
|
// eslint-disable-next-line no-restricted-imports
|
|
1979
2142
|
function createWindowSizeHelper(dimensions) {
|
|
1980
2143
|
return {
|
|
@@ -2993,42 +3156,26 @@ function InputFeedback({
|
|
|
2993
3156
|
});
|
|
2994
3157
|
}
|
|
2995
3158
|
|
|
2996
|
-
const FieldContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
2997
|
-
displayName: "InputField__FieldContainer",
|
|
2998
|
-
componentId: "kitt-universal__sc-13fkixs-0"
|
|
2999
|
-
})(["padding:5px 0 10px;"]);
|
|
3000
|
-
const FeedbackContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
3001
|
-
displayName: "InputField__FeedbackContainer",
|
|
3002
|
-
componentId: "kitt-universal__sc-13fkixs-1"
|
|
3003
|
-
})(["", ";"], ({
|
|
3004
|
-
theme
|
|
3005
|
-
}) => theme.responsive.ifWindowSizeMatches({
|
|
3006
|
-
minWidth: KittBreakpoints.SMALL
|
|
3007
|
-
}, 'padding-top: 10px', 'padding-top: 5px'));
|
|
3008
|
-
const FieldLabelContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
3009
|
-
displayName: "InputField__FieldLabelContainer",
|
|
3010
|
-
componentId: "kitt-universal__sc-13fkixs-2"
|
|
3011
|
-
})(["flex-direction:row;align-items:center;padding-bottom:", "px;"], ({
|
|
3012
|
-
theme
|
|
3013
|
-
}) => theme.kitt.forms.inputField.labelContainerPaddingBottom);
|
|
3014
|
-
const LabelContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
3015
|
-
displayName: "InputField__LabelContainer",
|
|
3016
|
-
componentId: "kitt-universal__sc-13fkixs-3"
|
|
3017
|
-
})(["margin-right:", "px;"], ({
|
|
3018
|
-
theme
|
|
3019
|
-
}) => theme.kitt.forms.inputField.iconMarginLeft);
|
|
3020
3159
|
function InputField({
|
|
3021
3160
|
label,
|
|
3022
3161
|
labelFeedback,
|
|
3023
3162
|
input,
|
|
3024
3163
|
feedback
|
|
3025
3164
|
}) {
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3165
|
+
const theme = /*#__PURE__*/styled.useTheme();
|
|
3166
|
+
return /*#__PURE__*/jsxRuntime.jsxs(View, {
|
|
3167
|
+
paddingTop: theme.kitt.forms.inputField.containerPaddingTop,
|
|
3168
|
+
paddingBottom: theme.kitt.forms.inputField.containerPaddingBottom,
|
|
3169
|
+
children: [label ? /*#__PURE__*/jsxRuntime.jsxs(View, {
|
|
3170
|
+
flexDirection: "row",
|
|
3171
|
+
alignItems: "center",
|
|
3172
|
+
paddingBottom: theme.kitt.forms.inputField.labelContainerPaddingBottom,
|
|
3173
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(View, {
|
|
3174
|
+
marginRight: theme.kitt.forms.inputField.labelFeedbackMarginLeft,
|
|
3029
3175
|
children: label
|
|
3030
3176
|
}), labelFeedback]
|
|
3031
|
-
}) : null, input, feedback ? /*#__PURE__*/jsxRuntime.jsx(
|
|
3177
|
+
}) : null, input, feedback ? /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
3178
|
+
paddingTop: theme.kitt.forms.inputField.feedbackPaddingTop,
|
|
3032
3179
|
children: feedback
|
|
3033
3180
|
}) : null]
|
|
3034
3181
|
});
|
|
@@ -3407,47 +3554,6 @@ function FullScreenModal({
|
|
|
3407
3554
|
FullScreenModal.Header = FullScreenModalHeader;
|
|
3408
3555
|
FullScreenModal.Body = FullScreenModalBody;
|
|
3409
3556
|
|
|
3410
|
-
function SpinningIcon({
|
|
3411
|
-
icon,
|
|
3412
|
-
color
|
|
3413
|
-
}) {
|
|
3414
|
-
if (process.env.NODE_ENV !== 'production' && !color) {
|
|
3415
|
-
throw new Error(`Invalid color passed to SpinningIcon: ${String(color)}`);
|
|
3416
|
-
}
|
|
3417
|
-
|
|
3418
|
-
const clonedIcon = /*#__PURE__*/React.cloneElement(icon, {
|
|
3419
|
-
color
|
|
3420
|
-
});
|
|
3421
|
-
const animationRef = React.useRef(new reactNative.Animated.Value(0));
|
|
3422
|
-
const rotation = animationRef.current.interpolate({
|
|
3423
|
-
inputRange: [0, 1],
|
|
3424
|
-
outputRange: ['0deg', '360deg']
|
|
3425
|
-
});
|
|
3426
|
-
React.useEffect(() => {
|
|
3427
|
-
if (process.env.NODE_ENV === 'test') return undefined;
|
|
3428
|
-
const animation = reactNative.Animated.loop(reactNative.Animated.timing(animationRef.current, {
|
|
3429
|
-
toValue: 1,
|
|
3430
|
-
duration: 1100,
|
|
3431
|
-
easing: reactNative.Easing.linear,
|
|
3432
|
-
useNativeDriver: true
|
|
3433
|
-
}));
|
|
3434
|
-
animation.start();
|
|
3435
|
-
return () => {
|
|
3436
|
-
if (process.env.NODE_ENV === 'test') return undefined;
|
|
3437
|
-
animation.stop();
|
|
3438
|
-
return undefined;
|
|
3439
|
-
};
|
|
3440
|
-
}, []);
|
|
3441
|
-
return /*#__PURE__*/jsxRuntime.jsx(reactNative.Animated.View, {
|
|
3442
|
-
style: {
|
|
3443
|
-
transform: [{
|
|
3444
|
-
rotate: rotation
|
|
3445
|
-
}]
|
|
3446
|
-
},
|
|
3447
|
-
children: clonedIcon
|
|
3448
|
-
});
|
|
3449
|
-
}
|
|
3450
|
-
|
|
3451
3557
|
const ContentView = /*#__PURE__*/styled__default.View.withConfig({
|
|
3452
3558
|
displayName: "ListItemContent__ContentView",
|
|
3453
3559
|
componentId: "kitt-universal__sc-57q0u9-0"
|
|
@@ -3570,15 +3676,6 @@ ListItem.Content = ListItemContent;
|
|
|
3570
3676
|
ListItem.SideContent = ListItemSideContent;
|
|
3571
3677
|
ListItem.SideContainer = ListItemSideContainer;
|
|
3572
3678
|
|
|
3573
|
-
function LoaderIcon({
|
|
3574
|
-
color
|
|
3575
|
-
}) {
|
|
3576
|
-
return /*#__PURE__*/jsxRuntime.jsx(SpinningIcon, {
|
|
3577
|
-
color: color,
|
|
3578
|
-
icon: /*#__PURE__*/jsxRuntime.jsx(kittIcons.ArcIcon, {})
|
|
3579
|
-
});
|
|
3580
|
-
}
|
|
3581
|
-
|
|
3582
3679
|
function IconContent({
|
|
3583
3680
|
type,
|
|
3584
3681
|
color
|
|
@@ -3945,14 +4042,6 @@ function KittNativeBaseProvider({
|
|
|
3945
4042
|
});
|
|
3946
4043
|
}
|
|
3947
4044
|
|
|
3948
|
-
const Stack = nativeBase.Stack;
|
|
3949
|
-
const VStack = nativeBase.VStack;
|
|
3950
|
-
const HStack = nativeBase.HStack;
|
|
3951
|
-
|
|
3952
|
-
const View = nativeBase.View;
|
|
3953
|
-
const ScrollView = nativeBase.ScrollView;
|
|
3954
|
-
const Pressable = nativeBase.Pressable;
|
|
3955
|
-
|
|
3956
4045
|
const ViewWithPadding = /*#__PURE__*/styled__default(reactNative.View).withConfig({
|
|
3957
4046
|
displayName: "ContentPadding__ViewWithPadding",
|
|
3958
4047
|
componentId: "kitt-universal__sc-1rprqcv-0"
|
|
@@ -5002,7 +5091,7 @@ function ModalDateTimePicker({
|
|
|
5002
5091
|
}) : null, /*#__PURE__*/jsxRuntime.jsx(Modal.Body, {
|
|
5003
5092
|
children: /*#__PURE__*/jsxRuntime.jsx(DateTimePicker__default, {
|
|
5004
5093
|
is24Hour: true,
|
|
5005
|
-
testID: "
|
|
5094
|
+
testID: "timePicker.ModalDateTimePicker.dateTimeNativePicker",
|
|
5006
5095
|
value: currentValue,
|
|
5007
5096
|
mode: "time",
|
|
5008
5097
|
display: reactNative.Platform.OS === 'ios' ? 'spinner' : 'default',
|
|
@@ -5096,7 +5185,7 @@ function TimePicker({
|
|
|
5096
5185
|
children: displayedValue
|
|
5097
5186
|
}), reactNative.Platform.OS === 'android' && isTimePickerModalVisible ? /*#__PURE__*/jsxRuntime.jsx(DateTimePicker__default, {
|
|
5098
5187
|
is24Hour: true,
|
|
5099
|
-
testID: "
|
|
5188
|
+
testID: "timePicker.TimePicker.dateTimeNativePicker",
|
|
5100
5189
|
value: dateTimePickerValue,
|
|
5101
5190
|
mode: "time",
|
|
5102
5191
|
display: "default",
|
|
@@ -5463,6 +5552,7 @@ function MatchWindowSize({
|
|
|
5463
5552
|
}
|
|
5464
5553
|
|
|
5465
5554
|
exports.useWindowSize = reactNative.useWindowDimensions;
|
|
5555
|
+
exports.Actions = Actions;
|
|
5466
5556
|
exports.Avatar = Avatar;
|
|
5467
5557
|
exports.Button = Button;
|
|
5468
5558
|
exports.Card = Card;
|