@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
|
@@ -3,7 +3,7 @@ import { View as View$1, ScrollView as ScrollView$1, Pressable as Pressable$1, I
|
|
|
3
3
|
export { useClipboard, useContrastText, useMediaQuery, useSx, useToken } from 'native-base';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
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';
|
|
6
|
-
import { Animated, Easing,
|
|
6
|
+
import { Animated, Easing, StyleSheet, Modal, Linking, Pressable as Pressable$2, useWindowDimensions } from 'react-native';
|
|
7
7
|
export { useWindowDimensions as useWindowSize } from 'react-native';
|
|
8
8
|
import { createPortal } from 'react-dom';
|
|
9
9
|
import { CSSTransition } from 'react-transition-group';
|
|
@@ -39,6 +39,9 @@ const hex2rgba = (hex, alpha = 1) => {
|
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
const createColorScale = colorScale => colorScale;
|
|
42
|
+
|
|
43
|
+
// WARNING
|
|
44
|
+
// If you update this palette, don't forget to update the palette in @ornikar/bumper as well.
|
|
42
45
|
const colorScales = {
|
|
43
46
|
deepPurple: createColorScale({
|
|
44
47
|
5: '#936C93',
|
|
@@ -103,9 +106,15 @@ const colorScales = {
|
|
|
103
106
|
red: createColorScale({
|
|
104
107
|
1: '#FDE4E3',
|
|
105
108
|
2: '#FAB8B8',
|
|
106
|
-
6: '#
|
|
109
|
+
6: '#E2483D',
|
|
107
110
|
7: '#BD100F'
|
|
108
111
|
}),
|
|
112
|
+
mauve: createColorScale({
|
|
113
|
+
1: '#F8E7FF',
|
|
114
|
+
2: '#F1D0FB',
|
|
115
|
+
3: '#E4A4F9',
|
|
116
|
+
4: '#D283EC'
|
|
117
|
+
}),
|
|
109
118
|
'beige-alpha': createColorScale({
|
|
110
119
|
'25': '#C1B59F40',
|
|
111
120
|
'40': '#C1B59F66',
|
|
@@ -215,8 +224,14 @@ const colors = {
|
|
|
215
224
|
}
|
|
216
225
|
},
|
|
217
226
|
highlight: {
|
|
218
|
-
|
|
219
|
-
|
|
227
|
+
mid: {
|
|
228
|
+
default: deepPurpleColorPalette['mauve.1'],
|
|
229
|
+
pressed: deepPurpleColorPalette['mauve.2']
|
|
230
|
+
},
|
|
231
|
+
hi: {
|
|
232
|
+
default: deepPurpleColorPalette['mauve.3'],
|
|
233
|
+
pressed: deepPurpleColorPalette['mauve.4']
|
|
234
|
+
}
|
|
220
235
|
},
|
|
221
236
|
info: {
|
|
222
237
|
hi: deepPurpleColorPalette['blue.6'],
|
|
@@ -244,17 +259,19 @@ const colors = {
|
|
|
244
259
|
base: {
|
|
245
260
|
hi: deepPurpleColorPalette['grey.9'],
|
|
246
261
|
mid: deepPurpleColorPalette['beige.3'],
|
|
262
|
+
low: deepPurpleColorPalette['beige.2'],
|
|
247
263
|
onContrasted: {
|
|
248
264
|
hi: deepPurpleColorPalette['grey.0'],
|
|
249
265
|
mid: deepPurpleColorPalette['white-alpha.20']
|
|
250
|
-
}
|
|
266
|
+
},
|
|
267
|
+
accent: deepPurpleColorPalette['deepPurple.8']
|
|
251
268
|
},
|
|
252
|
-
accent: deepPurpleColorPalette['deepPurple.8'],
|
|
253
269
|
info: deepPurpleColorPalette['blue.6'],
|
|
254
270
|
success: deepPurpleColorPalette['green.6'],
|
|
255
271
|
warning: deepPurpleColorPalette['yellow.6'],
|
|
256
272
|
danger: deepPurpleColorPalette['red.6'],
|
|
257
|
-
disabled: deepPurpleColorPalette['grey.2']
|
|
273
|
+
disabled: deepPurpleColorPalette['grey.2'],
|
|
274
|
+
highlight: deepPurpleColorPalette['mauve.3']
|
|
258
275
|
}
|
|
259
276
|
}
|
|
260
277
|
};
|
|
@@ -4684,7 +4701,8 @@ function AnimatedChoiceItemView({
|
|
|
4684
4701
|
isPressed,
|
|
4685
4702
|
isDisabled,
|
|
4686
4703
|
isSelected,
|
|
4687
|
-
hasError
|
|
4704
|
+
hasError,
|
|
4705
|
+
shouldExpand = false
|
|
4688
4706
|
}) {
|
|
4689
4707
|
const theme = useTheme();
|
|
4690
4708
|
return /*#__PURE__*/jsx(View, {
|
|
@@ -4703,6 +4721,8 @@ function AnimatedChoiceItemView({
|
|
|
4703
4721
|
isPressed
|
|
4704
4722
|
}),
|
|
4705
4723
|
padding: size === 'small' ? 'kitt.2' : 'kitt.4',
|
|
4724
|
+
flexGrow: shouldExpand ? 1 : undefined,
|
|
4725
|
+
flexShrink: shouldExpand ? 1 : undefined,
|
|
4706
4726
|
_web: {
|
|
4707
4727
|
style: {
|
|
4708
4728
|
transitionProperty: theme.kitt.choices.item.transition.property,
|
|
@@ -4738,6 +4758,7 @@ function ChoiceItem({
|
|
|
4738
4758
|
value,
|
|
4739
4759
|
selected,
|
|
4740
4760
|
disabled,
|
|
4761
|
+
shouldExpand = false,
|
|
4741
4762
|
children,
|
|
4742
4763
|
isPressedInternal,
|
|
4743
4764
|
isHoveredInternal,
|
|
@@ -4773,6 +4794,8 @@ function ChoiceItem({
|
|
|
4773
4794
|
checked: selected
|
|
4774
4795
|
},
|
|
4775
4796
|
style: style,
|
|
4797
|
+
flexGrow: shouldExpand ? 1 : undefined,
|
|
4798
|
+
flexShrink: shouldExpand ? 1 : undefined,
|
|
4776
4799
|
onBlur: onBlur,
|
|
4777
4800
|
onFocus: onFocus,
|
|
4778
4801
|
onPress: e => {
|
|
@@ -4792,6 +4815,8 @@ function ChoiceItem({
|
|
|
4792
4815
|
});
|
|
4793
4816
|
return /*#__PURE__*/jsxs(VStack, {
|
|
4794
4817
|
space: "kitt.2",
|
|
4818
|
+
flexGrow: shouldExpand ? 1 : undefined,
|
|
4819
|
+
flexShrink: shouldExpand ? 1 : undefined,
|
|
4795
4820
|
children: [/*#__PURE__*/jsxs(AnimatedChoiceItemView, {
|
|
4796
4821
|
animatedStyles: backgroundStyles,
|
|
4797
4822
|
isHovered: isHovered || isHoveredInternal,
|
|
@@ -4799,10 +4824,13 @@ function ChoiceItem({
|
|
|
4799
4824
|
isSelected: selected,
|
|
4800
4825
|
isPressed: isPressed || isPressedInternal,
|
|
4801
4826
|
hasError: hasError,
|
|
4827
|
+
shouldExpand: shouldExpand,
|
|
4802
4828
|
size: size,
|
|
4803
4829
|
children: [/*#__PURE__*/jsxs(Stack, {
|
|
4804
4830
|
alignItems: "center",
|
|
4805
4831
|
space: "kitt.2",
|
|
4832
|
+
flexGrow: shouldExpand ? 1 : undefined,
|
|
4833
|
+
flexShrink: shouldExpand ? 1 : undefined,
|
|
4806
4834
|
children: [icon ? /*#__PURE__*/jsx(TypographyIcon, {
|
|
4807
4835
|
color: textColor,
|
|
4808
4836
|
icon: icon
|
|
@@ -4831,36 +4859,49 @@ function ChoiceItem({
|
|
|
4831
4859
|
function ChoiceItemContainer({
|
|
4832
4860
|
children,
|
|
4833
4861
|
direction,
|
|
4862
|
+
shouldExpand,
|
|
4834
4863
|
isLast
|
|
4835
4864
|
}) {
|
|
4836
4865
|
const currentItemMarginValue = isLast ? undefined : 'kitt.3';
|
|
4837
|
-
const
|
|
4866
|
+
const directionFlexProps = direction === 'row' ? {
|
|
4838
4867
|
flexGrow: 1,
|
|
4839
4868
|
flexShrink: 1,
|
|
4840
4869
|
flexBasis: 0
|
|
4841
4870
|
} : {};
|
|
4871
|
+
const shouldExpandFlexProps = shouldExpand ? {
|
|
4872
|
+
flexGrow: 1,
|
|
4873
|
+
flexShrink: 1
|
|
4874
|
+
} : {};
|
|
4842
4875
|
return /*#__PURE__*/jsx(View, {
|
|
4843
4876
|
marginRight: direction === 'row' ? currentItemMarginValue : undefined,
|
|
4844
4877
|
marginBottom: direction === 'column' ? currentItemMarginValue : undefined,
|
|
4845
|
-
...
|
|
4878
|
+
...directionFlexProps,
|
|
4879
|
+
...shouldExpandFlexProps,
|
|
4846
4880
|
children: children
|
|
4847
4881
|
});
|
|
4848
4882
|
}
|
|
4849
4883
|
|
|
4850
4884
|
function ChoicesContainer({
|
|
4851
4885
|
direction,
|
|
4886
|
+
shouldExpand,
|
|
4852
4887
|
contentContainerStyle,
|
|
4853
4888
|
...props
|
|
4854
4889
|
}) {
|
|
4890
|
+
const shouldExpandFlexProps = shouldExpand ? {
|
|
4891
|
+
flexGrow: 1,
|
|
4892
|
+
flexShrink: 1
|
|
4893
|
+
} : {};
|
|
4855
4894
|
if (direction === 'row') {
|
|
4856
|
-
return /*#__PURE__*/jsx(ScrollView
|
|
4895
|
+
return /*#__PURE__*/jsx(ScrollView, {
|
|
4857
4896
|
horizontal: true,
|
|
4858
|
-
contentContainerStyle: contentContainerStyle,
|
|
4859
|
-
...props
|
|
4897
|
+
contentContainerStyle: shouldExpand ? shouldExpandFlexProps : contentContainerStyle,
|
|
4898
|
+
...props,
|
|
4899
|
+
...shouldExpandFlexProps
|
|
4860
4900
|
});
|
|
4861
4901
|
}
|
|
4862
|
-
return /*#__PURE__*/jsx(View
|
|
4863
|
-
...props
|
|
4902
|
+
return /*#__PURE__*/jsx(View, {
|
|
4903
|
+
...props,
|
|
4904
|
+
...shouldExpandFlexProps
|
|
4864
4905
|
});
|
|
4865
4906
|
}
|
|
4866
4907
|
|
|
@@ -4872,6 +4913,7 @@ function Choices({
|
|
|
4872
4913
|
type,
|
|
4873
4914
|
direction = 'column',
|
|
4874
4915
|
disabled,
|
|
4916
|
+
shouldExpand = false,
|
|
4875
4917
|
children,
|
|
4876
4918
|
value,
|
|
4877
4919
|
onPress,
|
|
@@ -4888,6 +4930,7 @@ function Choices({
|
|
|
4888
4930
|
const sharedProps = {
|
|
4889
4931
|
type,
|
|
4890
4932
|
disabled,
|
|
4933
|
+
shouldExpand,
|
|
4891
4934
|
onPress: !isForm ? onPress : undefined,
|
|
4892
4935
|
onChange: isForm ? newValue => {
|
|
4893
4936
|
setCurrentValue(newValue);
|
|
@@ -4899,6 +4942,7 @@ function Choices({
|
|
|
4899
4942
|
};
|
|
4900
4943
|
return /*#__PURE__*/jsx(ChoicesContainer, {
|
|
4901
4944
|
direction: direction,
|
|
4945
|
+
shouldExpand: shouldExpand,
|
|
4902
4946
|
testID: testID,
|
|
4903
4947
|
id: id,
|
|
4904
4948
|
style: style,
|
|
@@ -4910,6 +4954,7 @@ function Choices({
|
|
|
4910
4954
|
});
|
|
4911
4955
|
return /*#__PURE__*/jsx(ChoiceItemContainer, {
|
|
4912
4956
|
direction: direction,
|
|
4957
|
+
shouldExpand: shouldExpand,
|
|
4913
4958
|
isLast: index === childrenArray.length - 1,
|
|
4914
4959
|
children: element
|
|
4915
4960
|
}, child.key);
|
|
@@ -5037,7 +5082,8 @@ function DialogModalAnimation({
|
|
|
5037
5082
|
onEntered,
|
|
5038
5083
|
onExit,
|
|
5039
5084
|
onExited,
|
|
5040
|
-
onClose
|
|
5085
|
+
onClose,
|
|
5086
|
+
testID
|
|
5041
5087
|
}) {
|
|
5042
5088
|
const [isModalVisible, setIsModalVisible] = useState(visible);
|
|
5043
5089
|
const [isContentVisible, setIsContentVisible] = useState(false);
|
|
@@ -5071,6 +5117,7 @@ function DialogModalAnimation({
|
|
|
5071
5117
|
flexGrow: 1,
|
|
5072
5118
|
justifyContent: "center",
|
|
5073
5119
|
alignItems: "center",
|
|
5120
|
+
testID: testID,
|
|
5074
5121
|
children: [/*#__PURE__*/jsx(NativeOpacityAnimation, {
|
|
5075
5122
|
visible: isContentVisible,
|
|
5076
5123
|
onExited: handleAnimationExited,
|