@ornikar/kitt-universal 32.0.0 → 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 +28 -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/DialogModal/DialogModalAnimation/DialogModalAnimation.d.ts +1 -1
- package/dist/definitions/DialogModal/DialogModalAnimation/DialogModalAnimation.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 +61 -17
- package/dist/index-metro.es.android.js.map +1 -1
- package/dist/index-metro.es.ios.js +61 -17
- package/dist/index-metro.es.ios.js.map +1 -1
- package/dist/index-node-22.17.cjs.js +62 -15
- package/dist/index-node-22.17.cjs.js.map +1 -1
- package/dist/index-node-22.17.cjs.web.js +62 -15
- package/dist/index-node-22.17.cjs.web.js.map +1 -1
- package/dist/index-node-22.17.es.mjs +63 -16
- package/dist/index-node-22.17.es.mjs.map +1 -1
- package/dist/index-node-22.17.es.web.mjs +63 -16
- package/dist/index-node-22.17.es.web.mjs.map +1 -1
- package/dist/index.es.js +64 -17
- package/dist/index.es.js.map +1 -1
- package/dist/index.es.web.js +64 -17
- 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.web.js
CHANGED
|
@@ -11,7 +11,7 @@ import _typeof from '@babel/runtime/helpers/typeof';
|
|
|
11
11
|
import _regeneratorRuntime from '@babel/runtime/helpers/regeneratorRuntime';
|
|
12
12
|
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
13
13
|
import { SpinnerGapRegularIcon, UserRegularIcon, XRegularIcon, ArrowLeftRegularIcon, CaretUpFillIcon, CaretDownFillIcon, MapPinRegularIcon, EyeClosedRegularIcon, EyeRegularIcon, CheckCircleFillIcon, CaretDownRegularIcon, CaretRightRegularIcon, InfoRegularIcon, WarningRegularIcon, CheckRegularIcon, WarningCircleRegularIcon, ArrowCounterClockwiseRegularIcon, InfoFillIcon, WarningCircleFillIcon, WarningFillIcon } from '@ornikar/kitt-icons/phosphor';
|
|
14
|
-
import { Animated, Easing,
|
|
14
|
+
import { Animated, Easing, StyleSheet, Modal, Linking, Pressable as Pressable$2, useWindowDimensions } from 'react-native';
|
|
15
15
|
export { useWindowDimensions as useWindowSize } from 'react-native';
|
|
16
16
|
import { createPortal } from 'react-dom';
|
|
17
17
|
import { CSSTransition } from 'react-transition-group';
|
|
@@ -52,6 +52,9 @@ var hex2rgba = function (hex) {
|
|
|
52
52
|
var createColorScale = function (colorScale) {
|
|
53
53
|
return colorScale;
|
|
54
54
|
};
|
|
55
|
+
|
|
56
|
+
// WARNING
|
|
57
|
+
// If you update this palette, don't forget to update the palette in @ornikar/bumper as well.
|
|
55
58
|
var colorScales = {
|
|
56
59
|
deepPurple: createColorScale({
|
|
57
60
|
5: '#936C93',
|
|
@@ -116,9 +119,15 @@ var colorScales = {
|
|
|
116
119
|
red: createColorScale({
|
|
117
120
|
1: '#FDE4E3',
|
|
118
121
|
2: '#FAB8B8',
|
|
119
|
-
6: '#
|
|
122
|
+
6: '#E2483D',
|
|
120
123
|
7: '#BD100F'
|
|
121
124
|
}),
|
|
125
|
+
mauve: createColorScale({
|
|
126
|
+
1: '#F8E7FF',
|
|
127
|
+
2: '#F1D0FB',
|
|
128
|
+
3: '#E4A4F9',
|
|
129
|
+
4: '#D283EC'
|
|
130
|
+
}),
|
|
122
131
|
'beige-alpha': createColorScale({
|
|
123
132
|
'25': '#C1B59F40',
|
|
124
133
|
'40': '#C1B59F66',
|
|
@@ -233,8 +242,14 @@ var colors = {
|
|
|
233
242
|
}
|
|
234
243
|
},
|
|
235
244
|
highlight: {
|
|
236
|
-
|
|
237
|
-
|
|
245
|
+
mid: {
|
|
246
|
+
"default": deepPurpleColorPalette['mauve.1'],
|
|
247
|
+
pressed: deepPurpleColorPalette['mauve.2']
|
|
248
|
+
},
|
|
249
|
+
hi: {
|
|
250
|
+
"default": deepPurpleColorPalette['mauve.3'],
|
|
251
|
+
pressed: deepPurpleColorPalette['mauve.4']
|
|
252
|
+
}
|
|
238
253
|
},
|
|
239
254
|
info: {
|
|
240
255
|
hi: deepPurpleColorPalette['blue.6'],
|
|
@@ -262,17 +277,19 @@ var colors = {
|
|
|
262
277
|
base: {
|
|
263
278
|
hi: deepPurpleColorPalette['grey.9'],
|
|
264
279
|
mid: deepPurpleColorPalette['beige.3'],
|
|
280
|
+
low: deepPurpleColorPalette['beige.2'],
|
|
265
281
|
onContrasted: {
|
|
266
282
|
hi: deepPurpleColorPalette['grey.0'],
|
|
267
283
|
mid: deepPurpleColorPalette['white-alpha.20']
|
|
268
|
-
}
|
|
284
|
+
},
|
|
285
|
+
accent: deepPurpleColorPalette['deepPurple.8']
|
|
269
286
|
},
|
|
270
|
-
accent: deepPurpleColorPalette['deepPurple.8'],
|
|
271
287
|
info: deepPurpleColorPalette['blue.6'],
|
|
272
288
|
success: deepPurpleColorPalette['green.6'],
|
|
273
289
|
warning: deepPurpleColorPalette['yellow.6'],
|
|
274
290
|
danger: deepPurpleColorPalette['red.6'],
|
|
275
|
-
disabled: deepPurpleColorPalette['grey.2']
|
|
291
|
+
disabled: deepPurpleColorPalette['grey.2'],
|
|
292
|
+
highlight: deepPurpleColorPalette['mauve.3']
|
|
276
293
|
}
|
|
277
294
|
}
|
|
278
295
|
};
|
|
@@ -4725,7 +4742,9 @@ function AnimatedChoiceItemView(_ref) {
|
|
|
4725
4742
|
isPressed = _ref.isPressed,
|
|
4726
4743
|
isDisabled = _ref.isDisabled,
|
|
4727
4744
|
isSelected = _ref.isSelected,
|
|
4728
|
-
hasError = _ref.hasError
|
|
4745
|
+
hasError = _ref.hasError,
|
|
4746
|
+
_ref$shouldExpand = _ref.shouldExpand,
|
|
4747
|
+
shouldExpand = _ref$shouldExpand === void 0 ? false : _ref$shouldExpand;
|
|
4729
4748
|
var theme = useTheme();
|
|
4730
4749
|
return /*#__PURE__*/jsx(View, {
|
|
4731
4750
|
position: "relative",
|
|
@@ -4743,6 +4762,8 @@ function AnimatedChoiceItemView(_ref) {
|
|
|
4743
4762
|
isPressed: isPressed
|
|
4744
4763
|
}),
|
|
4745
4764
|
padding: size === 'small' ? 'kitt.2' : 'kitt.4',
|
|
4765
|
+
flexGrow: shouldExpand ? 1 : undefined,
|
|
4766
|
+
flexShrink: shouldExpand ? 1 : undefined,
|
|
4746
4767
|
_web: {
|
|
4747
4768
|
style: {
|
|
4748
4769
|
transitionProperty: theme.kitt.choices.item.transition.property,
|
|
@@ -4779,6 +4800,8 @@ function ChoiceItem(_ref) {
|
|
|
4779
4800
|
value = _ref.value,
|
|
4780
4801
|
selected = _ref.selected,
|
|
4781
4802
|
disabled = _ref.disabled,
|
|
4803
|
+
_ref$shouldExpand = _ref.shouldExpand,
|
|
4804
|
+
shouldExpand = _ref$shouldExpand === void 0 ? false : _ref$shouldExpand,
|
|
4782
4805
|
_children = _ref.children,
|
|
4783
4806
|
isPressedInternal = _ref.isPressedInternal,
|
|
4784
4807
|
isHoveredInternal = _ref.isHoveredInternal,
|
|
@@ -4812,6 +4835,8 @@ function ChoiceItem(_ref) {
|
|
|
4812
4835
|
checked: selected
|
|
4813
4836
|
},
|
|
4814
4837
|
style: style,
|
|
4838
|
+
flexGrow: shouldExpand ? 1 : undefined,
|
|
4839
|
+
flexShrink: shouldExpand ? 1 : undefined,
|
|
4815
4840
|
onBlur: onBlur,
|
|
4816
4841
|
onFocus: onFocus,
|
|
4817
4842
|
onPress: function (e) {
|
|
@@ -4830,6 +4855,8 @@ function ChoiceItem(_ref) {
|
|
|
4830
4855
|
});
|
|
4831
4856
|
return /*#__PURE__*/jsxs(VStack, {
|
|
4832
4857
|
space: "kitt.2",
|
|
4858
|
+
flexGrow: shouldExpand ? 1 : undefined,
|
|
4859
|
+
flexShrink: shouldExpand ? 1 : undefined,
|
|
4833
4860
|
children: [/*#__PURE__*/jsxs(AnimatedChoiceItemView, {
|
|
4834
4861
|
animatedStyles: backgroundStyles,
|
|
4835
4862
|
isHovered: isHovered || isHoveredInternal,
|
|
@@ -4837,10 +4864,13 @@ function ChoiceItem(_ref) {
|
|
|
4837
4864
|
isSelected: selected,
|
|
4838
4865
|
isPressed: isPressed || isPressedInternal,
|
|
4839
4866
|
hasError: hasError,
|
|
4867
|
+
shouldExpand: shouldExpand,
|
|
4840
4868
|
size: size,
|
|
4841
4869
|
children: [/*#__PURE__*/jsxs(Stack, {
|
|
4842
4870
|
alignItems: "center",
|
|
4843
4871
|
space: "kitt.2",
|
|
4872
|
+
flexGrow: shouldExpand ? 1 : undefined,
|
|
4873
|
+
flexShrink: shouldExpand ? 1 : undefined,
|
|
4844
4874
|
children: [icon ? /*#__PURE__*/jsx(TypographyIcon, {
|
|
4845
4875
|
color: textColor,
|
|
4846
4876
|
icon: icon
|
|
@@ -4869,33 +4899,43 @@ function ChoiceItem(_ref) {
|
|
|
4869
4899
|
function ChoiceItemContainer(_ref) {
|
|
4870
4900
|
var children = _ref.children,
|
|
4871
4901
|
direction = _ref.direction,
|
|
4902
|
+
shouldExpand = _ref.shouldExpand,
|
|
4872
4903
|
isLast = _ref.isLast;
|
|
4873
4904
|
var currentItemMarginValue = isLast ? undefined : 'kitt.3';
|
|
4874
|
-
var
|
|
4905
|
+
var directionFlexProps = direction === 'row' ? {
|
|
4875
4906
|
flexGrow: 1,
|
|
4876
4907
|
flexShrink: 1,
|
|
4877
4908
|
flexBasis: 0
|
|
4878
4909
|
} : {};
|
|
4879
|
-
|
|
4910
|
+
var shouldExpandFlexProps = shouldExpand ? {
|
|
4911
|
+
flexGrow: 1,
|
|
4912
|
+
flexShrink: 1
|
|
4913
|
+
} : {};
|
|
4914
|
+
return /*#__PURE__*/jsx(View, _objectSpread(_objectSpread(_objectSpread({
|
|
4880
4915
|
marginRight: direction === 'row' ? currentItemMarginValue : undefined,
|
|
4881
4916
|
marginBottom: direction === 'column' ? currentItemMarginValue : undefined
|
|
4882
|
-
},
|
|
4917
|
+
}, directionFlexProps), shouldExpandFlexProps), {}, {
|
|
4883
4918
|
children: children
|
|
4884
4919
|
}));
|
|
4885
4920
|
}
|
|
4886
4921
|
|
|
4887
|
-
var _excluded$D = ["direction", "contentContainerStyle"];
|
|
4922
|
+
var _excluded$D = ["direction", "shouldExpand", "contentContainerStyle"];
|
|
4888
4923
|
function ChoicesContainer(_ref) {
|
|
4889
4924
|
var direction = _ref.direction,
|
|
4925
|
+
shouldExpand = _ref.shouldExpand,
|
|
4890
4926
|
contentContainerStyle = _ref.contentContainerStyle,
|
|
4891
4927
|
props = _objectWithoutProperties(_ref, _excluded$D);
|
|
4928
|
+
var shouldExpandFlexProps = shouldExpand ? {
|
|
4929
|
+
flexGrow: 1,
|
|
4930
|
+
flexShrink: 1
|
|
4931
|
+
} : {};
|
|
4892
4932
|
if (direction === 'row') {
|
|
4893
|
-
return /*#__PURE__*/jsx(ScrollView
|
|
4933
|
+
return /*#__PURE__*/jsx(ScrollView, _objectSpread(_objectSpread({
|
|
4894
4934
|
horizontal: true,
|
|
4895
|
-
contentContainerStyle: contentContainerStyle
|
|
4896
|
-
}, props));
|
|
4935
|
+
contentContainerStyle: shouldExpand ? shouldExpandFlexProps : contentContainerStyle
|
|
4936
|
+
}, props), shouldExpandFlexProps));
|
|
4897
4937
|
}
|
|
4898
|
-
return /*#__PURE__*/jsx(View
|
|
4938
|
+
return /*#__PURE__*/jsx(View, _objectSpread(_objectSpread({}, props), shouldExpandFlexProps));
|
|
4899
4939
|
}
|
|
4900
4940
|
|
|
4901
4941
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -4907,6 +4947,8 @@ function Choices(_ref2) {
|
|
|
4907
4947
|
_ref2$direction = _ref2.direction,
|
|
4908
4948
|
direction = _ref2$direction === void 0 ? 'column' : _ref2$direction,
|
|
4909
4949
|
disabled = _ref2.disabled,
|
|
4950
|
+
_ref2$shouldExpand = _ref2.shouldExpand,
|
|
4951
|
+
shouldExpand = _ref2$shouldExpand === void 0 ? false : _ref2$shouldExpand,
|
|
4910
4952
|
children = _ref2.children,
|
|
4911
4953
|
value = _ref2.value,
|
|
4912
4954
|
onPress = _ref2.onPress,
|
|
@@ -4925,6 +4967,7 @@ function Choices(_ref2) {
|
|
|
4925
4967
|
var sharedProps = {
|
|
4926
4968
|
type: type,
|
|
4927
4969
|
disabled: disabled,
|
|
4970
|
+
shouldExpand: shouldExpand,
|
|
4928
4971
|
onPress: !isForm ? onPress : undefined,
|
|
4929
4972
|
onChange: isForm ? function (newValue) {
|
|
4930
4973
|
setCurrentValue(newValue);
|
|
@@ -4936,6 +4979,7 @@ function Choices(_ref2) {
|
|
|
4936
4979
|
};
|
|
4937
4980
|
return /*#__PURE__*/jsx(ChoicesContainer, {
|
|
4938
4981
|
direction: direction,
|
|
4982
|
+
shouldExpand: shouldExpand,
|
|
4939
4983
|
testID: testID,
|
|
4940
4984
|
id: id,
|
|
4941
4985
|
style: style,
|
|
@@ -4946,6 +4990,7 @@ function Choices(_ref2) {
|
|
|
4946
4990
|
}, sharedProps));
|
|
4947
4991
|
return /*#__PURE__*/jsx(ChoiceItemContainer, {
|
|
4948
4992
|
direction: direction,
|
|
4993
|
+
shouldExpand: shouldExpand,
|
|
4949
4994
|
isLast: index === childrenArray.length - 1,
|
|
4950
4995
|
children: element
|
|
4951
4996
|
}, child.key);
|
|
@@ -5065,7 +5110,8 @@ function DialogModalAnimation(_ref) {
|
|
|
5065
5110
|
onEntered = _ref.onEntered,
|
|
5066
5111
|
onExit = _ref.onExit,
|
|
5067
5112
|
onExited = _ref.onExited,
|
|
5068
|
-
onClose = _ref.onClose
|
|
5113
|
+
onClose = _ref.onClose,
|
|
5114
|
+
testID = _ref.testID;
|
|
5069
5115
|
var _useState = useState(visible),
|
|
5070
5116
|
_useState2 = _slicedToArray(_useState, 2),
|
|
5071
5117
|
isModalVisible = _useState2[0],
|
|
@@ -5104,6 +5150,7 @@ function DialogModalAnimation(_ref) {
|
|
|
5104
5150
|
flexGrow: 1,
|
|
5105
5151
|
justifyContent: "center",
|
|
5106
5152
|
alignItems: "center",
|
|
5153
|
+
testID: testID,
|
|
5107
5154
|
children: [/*#__PURE__*/jsx(NativeOpacityAnimation, {
|
|
5108
5155
|
visible: isContentVisible,
|
|
5109
5156
|
onExited: handleAnimationExited,
|