@ornikar/kitt-universal 32.0.1 → 32.1.1-canary.28d1f9f68cb643b8c67559f72df59006a88da1e9.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 +19 -0
- package/dist/definitions/Choices/AnimatedChoiceItemView.d.ts +2 -1
- package/dist/definitions/Choices/AnimatedChoiceItemView.d.ts.map +1 -1
- package/dist/definitions/Choices/AnimatedChoiceItemView.web.d.ts +1 -1
- package/dist/definitions/Choices/AnimatedChoiceItemView.web.d.ts.map +1 -1
- package/dist/definitions/Choices/ChoiceItem.d.ts +2 -1
- package/dist/definitions/Choices/ChoiceItem.d.ts.map +1 -1
- package/dist/definitions/Choices/ChoiceItemContainer.d.ts +2 -1
- package/dist/definitions/Choices/ChoiceItemContainer.d.ts.map +1 -1
- package/dist/definitions/Choices/Choices.d.ts +5 -5
- package/dist/definitions/Choices/Choices.d.ts.map +1 -1
- package/dist/definitions/native-base/KittNativeBaseProvider.d.ts +15 -3
- package/dist/definitions/native-base/KittNativeBaseProvider.d.ts.map +1 -1
- package/dist/definitions/themes/default.d.ts +15 -3
- package/dist/definitions/themes/default.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/colors.d.ts +11 -3
- package/dist/definitions/themes/late-ocean/colors.d.ts.map +1 -1
- package/dist/definitions/themes/palettes/deepPurpleColorPalette.d.ts +5 -0
- package/dist/definitions/themes/palettes/deepPurpleColorPalette.d.ts.map +1 -1
- package/dist/index-metro.es.android.js +58 -16
- package/dist/index-metro.es.android.js.map +1 -1
- package/dist/index-metro.es.ios.js +58 -16
- package/dist/index-metro.es.ios.js.map +1 -1
- package/dist/index-node-22.17.cjs.js +59 -14
- package/dist/index-node-22.17.cjs.js.map +1 -1
- package/dist/index-node-22.17.cjs.web.js +59 -14
- package/dist/index-node-22.17.cjs.web.js.map +1 -1
- package/dist/index-node-22.17.es.mjs +60 -15
- package/dist/index-node-22.17.es.mjs.map +1 -1
- package/dist/index-node-22.17.es.web.mjs +60 -15
- package/dist/index-node-22.17.es.web.mjs.map +1 -1
- package/dist/index.es.js +61 -16
- package/dist/index.es.js.map +1 -1
- package/dist/index.es.web.js +61 -16
- package/dist/index.es.web.js.map +1 -1
- package/dist/linaria-themes-metro.es.android.js +23 -6
- package/dist/linaria-themes-metro.es.android.js.map +1 -1
- package/dist/linaria-themes-metro.es.ios.js +23 -6
- package/dist/linaria-themes-metro.es.ios.js.map +1 -1
- package/dist/linaria-themes-node-22.17.cjs.js +23 -6
- package/dist/linaria-themes-node-22.17.cjs.js.map +1 -1
- package/dist/linaria-themes-node-22.17.cjs.web.js +23 -6
- package/dist/linaria-themes-node-22.17.cjs.web.js.map +1 -1
- package/dist/linaria-themes-node-22.17.es.mjs +23 -6
- package/dist/linaria-themes-node-22.17.es.mjs.map +1 -1
- package/dist/linaria-themes-node-22.17.es.web.mjs +23 -6
- package/dist/linaria-themes-node-22.17.es.web.mjs.map +1 -1
- package/dist/linaria-themes.es.js +23 -6
- package/dist/linaria-themes.es.js.map +1 -1
- package/dist/linaria-themes.es.web.js +23 -6
- package/dist/linaria-themes.es.web.js.map +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -8,7 +8,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
8
8
|
import _objectDestructuringEmpty from '@babel/runtime/helpers/objectDestructuringEmpty';
|
|
9
9
|
import _extends from '@babel/runtime/helpers/extends';
|
|
10
10
|
import Animated, { useSharedValue, useAnimatedStyle, interpolateColor, withSpring, withTiming, Easing as Easing$1, runOnJS, useDerivedValue, useAnimatedProps, withDelay, withRepeat, interpolate, ReducedMotionConfig, ReduceMotion } from 'react-native-reanimated';
|
|
11
|
-
import { Platform, Animated as Animated$1, Easing, StyleSheet, Modal,
|
|
11
|
+
import { Platform, Animated as Animated$1, Easing, StyleSheet, Modal, Linking, Pressable as Pressable$2, Keyboard, Text as Text$1, useWindowDimensions, ScrollView as ScrollView$2, PixelRatio } from 'react-native';
|
|
12
12
|
export { useWindowDimensions as useWindowSize } from 'react-native';
|
|
13
13
|
import _typeof from '@babel/runtime/helpers/typeof';
|
|
14
14
|
import _regeneratorRuntime from '@babel/runtime/helpers/regeneratorRuntime';
|
|
@@ -54,6 +54,9 @@ var hex2rgba = function (hex) {
|
|
|
54
54
|
var createColorScale = function (colorScale) {
|
|
55
55
|
return colorScale;
|
|
56
56
|
};
|
|
57
|
+
|
|
58
|
+
// WARNING
|
|
59
|
+
// If you update this palette, don't forget to update the palette in @ornikar/bumper as well.
|
|
57
60
|
var colorScales = {
|
|
58
61
|
deepPurple: createColorScale({
|
|
59
62
|
5: '#936C93',
|
|
@@ -118,9 +121,15 @@ var colorScales = {
|
|
|
118
121
|
red: createColorScale({
|
|
119
122
|
1: '#FDE4E3',
|
|
120
123
|
2: '#FAB8B8',
|
|
121
|
-
6: '#
|
|
124
|
+
6: '#E2483D',
|
|
122
125
|
7: '#BD100F'
|
|
123
126
|
}),
|
|
127
|
+
mauve: createColorScale({
|
|
128
|
+
1: '#F8E7FF',
|
|
129
|
+
2: '#F1D0FB',
|
|
130
|
+
3: '#E4A4F9',
|
|
131
|
+
4: '#D283EC'
|
|
132
|
+
}),
|
|
124
133
|
'beige-alpha': createColorScale({
|
|
125
134
|
'25': '#C1B59F40',
|
|
126
135
|
'40': '#C1B59F66',
|
|
@@ -235,8 +244,14 @@ var colors = {
|
|
|
235
244
|
}
|
|
236
245
|
},
|
|
237
246
|
highlight: {
|
|
238
|
-
|
|
239
|
-
|
|
247
|
+
mid: {
|
|
248
|
+
"default": deepPurpleColorPalette['mauve.1'],
|
|
249
|
+
pressed: deepPurpleColorPalette['mauve.2']
|
|
250
|
+
},
|
|
251
|
+
hi: {
|
|
252
|
+
"default": deepPurpleColorPalette['mauve.3'],
|
|
253
|
+
pressed: deepPurpleColorPalette['mauve.4']
|
|
254
|
+
}
|
|
240
255
|
},
|
|
241
256
|
info: {
|
|
242
257
|
hi: deepPurpleColorPalette['blue.6'],
|
|
@@ -264,17 +279,19 @@ var colors = {
|
|
|
264
279
|
base: {
|
|
265
280
|
hi: deepPurpleColorPalette['grey.9'],
|
|
266
281
|
mid: deepPurpleColorPalette['beige.3'],
|
|
282
|
+
low: deepPurpleColorPalette['beige.2'],
|
|
267
283
|
onContrasted: {
|
|
268
284
|
hi: deepPurpleColorPalette['grey.0'],
|
|
269
285
|
mid: deepPurpleColorPalette['white-alpha.20']
|
|
270
|
-
}
|
|
286
|
+
},
|
|
287
|
+
accent: deepPurpleColorPalette['deepPurple.8']
|
|
271
288
|
},
|
|
272
|
-
accent: deepPurpleColorPalette['deepPurple.8'],
|
|
273
289
|
info: deepPurpleColorPalette['blue.6'],
|
|
274
290
|
success: deepPurpleColorPalette['green.6'],
|
|
275
291
|
warning: deepPurpleColorPalette['yellow.6'],
|
|
276
292
|
danger: deepPurpleColorPalette['red.6'],
|
|
277
|
-
disabled: deepPurpleColorPalette['grey.2']
|
|
293
|
+
disabled: deepPurpleColorPalette['grey.2'],
|
|
294
|
+
highlight: deepPurpleColorPalette['mauve.3']
|
|
278
295
|
}
|
|
279
296
|
}
|
|
280
297
|
};
|
|
@@ -4844,6 +4861,8 @@ function AnimatedChoiceItemView(_ref) {
|
|
|
4844
4861
|
isDisabled = _ref.isDisabled,
|
|
4845
4862
|
isSelected = _ref.isSelected,
|
|
4846
4863
|
hasError = _ref.hasError,
|
|
4864
|
+
_ref$shouldExpand = _ref.shouldExpand,
|
|
4865
|
+
shouldExpand = _ref$shouldExpand === void 0 ? false : _ref$shouldExpand,
|
|
4847
4866
|
animatedStyles = _ref.animatedStyles;
|
|
4848
4867
|
var sx = useSx();
|
|
4849
4868
|
var style = sx({
|
|
@@ -4861,7 +4880,9 @@ function AnimatedChoiceItemView(_ref) {
|
|
|
4861
4880
|
isHovered: isHovered,
|
|
4862
4881
|
isPressed: isPressed
|
|
4863
4882
|
}),
|
|
4864
|
-
padding: size === 'small' ? 'kitt.2' : 'kitt.4'
|
|
4883
|
+
padding: size === 'small' ? 'kitt.2' : 'kitt.4',
|
|
4884
|
+
flexGrow: shouldExpand ? 1 : undefined,
|
|
4885
|
+
flexShrink: shouldExpand ? 1 : undefined
|
|
4865
4886
|
});
|
|
4866
4887
|
return /*#__PURE__*/jsx(Animated.View, {
|
|
4867
4888
|
style: [style, animatedStyles],
|
|
@@ -4924,6 +4945,8 @@ function ChoiceItem(_ref) {
|
|
|
4924
4945
|
value = _ref.value,
|
|
4925
4946
|
selected = _ref.selected,
|
|
4926
4947
|
disabled = _ref.disabled,
|
|
4948
|
+
_ref$shouldExpand = _ref.shouldExpand,
|
|
4949
|
+
shouldExpand = _ref$shouldExpand === void 0 ? false : _ref$shouldExpand,
|
|
4927
4950
|
_children = _ref.children,
|
|
4928
4951
|
isPressedInternal = _ref.isPressedInternal,
|
|
4929
4952
|
isHoveredInternal = _ref.isHoveredInternal,
|
|
@@ -4961,6 +4984,8 @@ function ChoiceItem(_ref) {
|
|
|
4961
4984
|
checked: selected
|
|
4962
4985
|
},
|
|
4963
4986
|
style: style,
|
|
4987
|
+
flexGrow: shouldExpand ? 1 : undefined,
|
|
4988
|
+
flexShrink: shouldExpand ? 1 : undefined,
|
|
4964
4989
|
onBlur: onBlur,
|
|
4965
4990
|
onFocus: onFocus,
|
|
4966
4991
|
onPress: function (e) {
|
|
@@ -4979,6 +5004,8 @@ function ChoiceItem(_ref) {
|
|
|
4979
5004
|
});
|
|
4980
5005
|
return /*#__PURE__*/jsxs(VStack, {
|
|
4981
5006
|
space: "kitt.2",
|
|
5007
|
+
flexGrow: shouldExpand ? 1 : undefined,
|
|
5008
|
+
flexShrink: shouldExpand ? 1 : undefined,
|
|
4982
5009
|
children: [/*#__PURE__*/jsxs(AnimatedChoiceItemView, {
|
|
4983
5010
|
animatedStyles: backgroundStyles,
|
|
4984
5011
|
isHovered: isHovered || isHoveredInternal,
|
|
@@ -4986,10 +5013,13 @@ function ChoiceItem(_ref) {
|
|
|
4986
5013
|
isSelected: selected,
|
|
4987
5014
|
isPressed: isPressed || isPressedInternal,
|
|
4988
5015
|
hasError: hasError,
|
|
5016
|
+
shouldExpand: shouldExpand,
|
|
4989
5017
|
size: size,
|
|
4990
5018
|
children: [/*#__PURE__*/jsxs(Stack, {
|
|
4991
5019
|
alignItems: "center",
|
|
4992
5020
|
space: "kitt.2",
|
|
5021
|
+
flexGrow: shouldExpand ? 1 : undefined,
|
|
5022
|
+
flexShrink: shouldExpand ? 1 : undefined,
|
|
4993
5023
|
children: [icon ? /*#__PURE__*/jsx(TypographyIcon, {
|
|
4994
5024
|
color: textColor,
|
|
4995
5025
|
icon: icon
|
|
@@ -5018,33 +5048,43 @@ function ChoiceItem(_ref) {
|
|
|
5018
5048
|
function ChoiceItemContainer(_ref) {
|
|
5019
5049
|
var children = _ref.children,
|
|
5020
5050
|
direction = _ref.direction,
|
|
5051
|
+
shouldExpand = _ref.shouldExpand,
|
|
5021
5052
|
isLast = _ref.isLast;
|
|
5022
5053
|
var currentItemMarginValue = isLast ? undefined : 'kitt.3';
|
|
5023
|
-
var
|
|
5054
|
+
var directionFlexProps = direction === 'row' ? {
|
|
5024
5055
|
flexGrow: 1,
|
|
5025
5056
|
flexShrink: 1,
|
|
5026
5057
|
flexBasis: 0
|
|
5027
5058
|
} : {};
|
|
5028
|
-
|
|
5059
|
+
var shouldExpandFlexProps = shouldExpand ? {
|
|
5060
|
+
flexGrow: 1,
|
|
5061
|
+
flexShrink: 1
|
|
5062
|
+
} : {};
|
|
5063
|
+
return /*#__PURE__*/jsx(View, _objectSpread(_objectSpread(_objectSpread({
|
|
5029
5064
|
marginRight: direction === 'row' ? currentItemMarginValue : undefined,
|
|
5030
5065
|
marginBottom: direction === 'column' ? currentItemMarginValue : undefined
|
|
5031
|
-
},
|
|
5066
|
+
}, directionFlexProps), shouldExpandFlexProps), {}, {
|
|
5032
5067
|
children: children
|
|
5033
5068
|
}));
|
|
5034
5069
|
}
|
|
5035
5070
|
|
|
5036
|
-
var _excluded$G = ["direction", "contentContainerStyle"];
|
|
5071
|
+
var _excluded$G = ["direction", "shouldExpand", "contentContainerStyle"];
|
|
5037
5072
|
function ChoicesContainer(_ref) {
|
|
5038
5073
|
var direction = _ref.direction,
|
|
5074
|
+
shouldExpand = _ref.shouldExpand,
|
|
5039
5075
|
contentContainerStyle = _ref.contentContainerStyle,
|
|
5040
5076
|
props = _objectWithoutProperties(_ref, _excluded$G);
|
|
5077
|
+
var shouldExpandFlexProps = shouldExpand ? {
|
|
5078
|
+
flexGrow: 1,
|
|
5079
|
+
flexShrink: 1
|
|
5080
|
+
} : {};
|
|
5041
5081
|
if (direction === 'row') {
|
|
5042
|
-
return /*#__PURE__*/jsx(ScrollView
|
|
5082
|
+
return /*#__PURE__*/jsx(ScrollView, _objectSpread(_objectSpread({
|
|
5043
5083
|
horizontal: true,
|
|
5044
|
-
contentContainerStyle: contentContainerStyle
|
|
5045
|
-
}, props));
|
|
5084
|
+
contentContainerStyle: shouldExpand ? shouldExpandFlexProps : contentContainerStyle
|
|
5085
|
+
}, props), shouldExpandFlexProps));
|
|
5046
5086
|
}
|
|
5047
|
-
return /*#__PURE__*/jsx(View
|
|
5087
|
+
return /*#__PURE__*/jsx(View, _objectSpread(_objectSpread({}, props), shouldExpandFlexProps));
|
|
5048
5088
|
}
|
|
5049
5089
|
|
|
5050
5090
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -5056,6 +5096,8 @@ function Choices(_ref2) {
|
|
|
5056
5096
|
_ref2$direction = _ref2.direction,
|
|
5057
5097
|
direction = _ref2$direction === void 0 ? 'column' : _ref2$direction,
|
|
5058
5098
|
disabled = _ref2.disabled,
|
|
5099
|
+
_ref2$shouldExpand = _ref2.shouldExpand,
|
|
5100
|
+
shouldExpand = _ref2$shouldExpand === void 0 ? false : _ref2$shouldExpand,
|
|
5059
5101
|
children = _ref2.children,
|
|
5060
5102
|
value = _ref2.value,
|
|
5061
5103
|
onPress = _ref2.onPress,
|
|
@@ -5074,6 +5116,7 @@ function Choices(_ref2) {
|
|
|
5074
5116
|
var sharedProps = {
|
|
5075
5117
|
type: type,
|
|
5076
5118
|
disabled: disabled,
|
|
5119
|
+
shouldExpand: shouldExpand,
|
|
5077
5120
|
onPress: !isForm ? onPress : undefined,
|
|
5078
5121
|
onChange: isForm ? function (newValue) {
|
|
5079
5122
|
setCurrentValue(newValue);
|
|
@@ -5085,6 +5128,7 @@ function Choices(_ref2) {
|
|
|
5085
5128
|
};
|
|
5086
5129
|
return /*#__PURE__*/jsx(ChoicesContainer, {
|
|
5087
5130
|
direction: direction,
|
|
5131
|
+
shouldExpand: shouldExpand,
|
|
5088
5132
|
testID: testID,
|
|
5089
5133
|
id: id,
|
|
5090
5134
|
style: style,
|
|
@@ -5095,6 +5139,7 @@ function Choices(_ref2) {
|
|
|
5095
5139
|
}, sharedProps));
|
|
5096
5140
|
return /*#__PURE__*/jsx(ChoiceItemContainer, {
|
|
5097
5141
|
direction: direction,
|
|
5142
|
+
shouldExpand: shouldExpand,
|
|
5098
5143
|
isLast: index === childrenArray.length - 1,
|
|
5099
5144
|
children: element
|
|
5100
5145
|
}, child.key);
|