@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
|
@@ -48,6 +48,9 @@ const hex2rgba = (hex, alpha = 1) => {
|
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
const createColorScale = colorScale => colorScale;
|
|
51
|
+
|
|
52
|
+
// WARNING
|
|
53
|
+
// If you update this palette, don't forget to update the palette in @ornikar/bumper as well.
|
|
51
54
|
const colorScales = {
|
|
52
55
|
deepPurple: createColorScale({
|
|
53
56
|
5: '#936C93',
|
|
@@ -112,9 +115,15 @@ const colorScales = {
|
|
|
112
115
|
red: createColorScale({
|
|
113
116
|
1: '#FDE4E3',
|
|
114
117
|
2: '#FAB8B8',
|
|
115
|
-
6: '#
|
|
118
|
+
6: '#E2483D',
|
|
116
119
|
7: '#BD100F'
|
|
117
120
|
}),
|
|
121
|
+
mauve: createColorScale({
|
|
122
|
+
1: '#F8E7FF',
|
|
123
|
+
2: '#F1D0FB',
|
|
124
|
+
3: '#E4A4F9',
|
|
125
|
+
4: '#D283EC'
|
|
126
|
+
}),
|
|
118
127
|
'beige-alpha': createColorScale({
|
|
119
128
|
'25': '#C1B59F40',
|
|
120
129
|
'40': '#C1B59F66',
|
|
@@ -224,8 +233,14 @@ const colors = {
|
|
|
224
233
|
}
|
|
225
234
|
},
|
|
226
235
|
highlight: {
|
|
227
|
-
|
|
228
|
-
|
|
236
|
+
mid: {
|
|
237
|
+
default: deepPurpleColorPalette['mauve.1'],
|
|
238
|
+
pressed: deepPurpleColorPalette['mauve.2']
|
|
239
|
+
},
|
|
240
|
+
hi: {
|
|
241
|
+
default: deepPurpleColorPalette['mauve.3'],
|
|
242
|
+
pressed: deepPurpleColorPalette['mauve.4']
|
|
243
|
+
}
|
|
229
244
|
},
|
|
230
245
|
info: {
|
|
231
246
|
hi: deepPurpleColorPalette['blue.6'],
|
|
@@ -253,17 +268,19 @@ const colors = {
|
|
|
253
268
|
base: {
|
|
254
269
|
hi: deepPurpleColorPalette['grey.9'],
|
|
255
270
|
mid: deepPurpleColorPalette['beige.3'],
|
|
271
|
+
low: deepPurpleColorPalette['beige.2'],
|
|
256
272
|
onContrasted: {
|
|
257
273
|
hi: deepPurpleColorPalette['grey.0'],
|
|
258
274
|
mid: deepPurpleColorPalette['white-alpha.20']
|
|
259
|
-
}
|
|
275
|
+
},
|
|
276
|
+
accent: deepPurpleColorPalette['deepPurple.8']
|
|
260
277
|
},
|
|
261
|
-
accent: deepPurpleColorPalette['deepPurple.8'],
|
|
262
278
|
info: deepPurpleColorPalette['blue.6'],
|
|
263
279
|
success: deepPurpleColorPalette['green.6'],
|
|
264
280
|
warning: deepPurpleColorPalette['yellow.6'],
|
|
265
281
|
danger: deepPurpleColorPalette['red.6'],
|
|
266
|
-
disabled: deepPurpleColorPalette['grey.2']
|
|
282
|
+
disabled: deepPurpleColorPalette['grey.2'],
|
|
283
|
+
highlight: deepPurpleColorPalette['mauve.3']
|
|
267
284
|
}
|
|
268
285
|
}
|
|
269
286
|
};
|
|
@@ -4693,7 +4710,8 @@ function AnimatedChoiceItemView({
|
|
|
4693
4710
|
isPressed,
|
|
4694
4711
|
isDisabled,
|
|
4695
4712
|
isSelected,
|
|
4696
|
-
hasError
|
|
4713
|
+
hasError,
|
|
4714
|
+
shouldExpand = false
|
|
4697
4715
|
}) {
|
|
4698
4716
|
const theme = useTheme();
|
|
4699
4717
|
return /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
@@ -4712,6 +4730,8 @@ function AnimatedChoiceItemView({
|
|
|
4712
4730
|
isPressed
|
|
4713
4731
|
}),
|
|
4714
4732
|
padding: size === 'small' ? 'kitt.2' : 'kitt.4',
|
|
4733
|
+
flexGrow: shouldExpand ? 1 : undefined,
|
|
4734
|
+
flexShrink: shouldExpand ? 1 : undefined,
|
|
4715
4735
|
_web: {
|
|
4716
4736
|
style: {
|
|
4717
4737
|
transitionProperty: theme.kitt.choices.item.transition.property,
|
|
@@ -4747,6 +4767,7 @@ function ChoiceItem({
|
|
|
4747
4767
|
value,
|
|
4748
4768
|
selected,
|
|
4749
4769
|
disabled,
|
|
4770
|
+
shouldExpand = false,
|
|
4750
4771
|
children,
|
|
4751
4772
|
isPressedInternal,
|
|
4752
4773
|
isHoveredInternal,
|
|
@@ -4782,6 +4803,8 @@ function ChoiceItem({
|
|
|
4782
4803
|
checked: selected
|
|
4783
4804
|
},
|
|
4784
4805
|
style: style,
|
|
4806
|
+
flexGrow: shouldExpand ? 1 : undefined,
|
|
4807
|
+
flexShrink: shouldExpand ? 1 : undefined,
|
|
4785
4808
|
onBlur: onBlur,
|
|
4786
4809
|
onFocus: onFocus,
|
|
4787
4810
|
onPress: e => {
|
|
@@ -4801,6 +4824,8 @@ function ChoiceItem({
|
|
|
4801
4824
|
});
|
|
4802
4825
|
return /*#__PURE__*/jsxRuntime.jsxs(VStack, {
|
|
4803
4826
|
space: "kitt.2",
|
|
4827
|
+
flexGrow: shouldExpand ? 1 : undefined,
|
|
4828
|
+
flexShrink: shouldExpand ? 1 : undefined,
|
|
4804
4829
|
children: [/*#__PURE__*/jsxRuntime.jsxs(AnimatedChoiceItemView, {
|
|
4805
4830
|
animatedStyles: backgroundStyles,
|
|
4806
4831
|
isHovered: isHovered || isHoveredInternal,
|
|
@@ -4808,10 +4833,13 @@ function ChoiceItem({
|
|
|
4808
4833
|
isSelected: selected,
|
|
4809
4834
|
isPressed: isPressed || isPressedInternal,
|
|
4810
4835
|
hasError: hasError,
|
|
4836
|
+
shouldExpand: shouldExpand,
|
|
4811
4837
|
size: size,
|
|
4812
4838
|
children: [/*#__PURE__*/jsxRuntime.jsxs(Stack, {
|
|
4813
4839
|
alignItems: "center",
|
|
4814
4840
|
space: "kitt.2",
|
|
4841
|
+
flexGrow: shouldExpand ? 1 : undefined,
|
|
4842
|
+
flexShrink: shouldExpand ? 1 : undefined,
|
|
4815
4843
|
children: [icon ? /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
|
|
4816
4844
|
color: textColor,
|
|
4817
4845
|
icon: icon
|
|
@@ -4840,36 +4868,49 @@ function ChoiceItem({
|
|
|
4840
4868
|
function ChoiceItemContainer({
|
|
4841
4869
|
children,
|
|
4842
4870
|
direction,
|
|
4871
|
+
shouldExpand,
|
|
4843
4872
|
isLast
|
|
4844
4873
|
}) {
|
|
4845
4874
|
const currentItemMarginValue = isLast ? undefined : 'kitt.3';
|
|
4846
|
-
const
|
|
4875
|
+
const directionFlexProps = direction === 'row' ? {
|
|
4847
4876
|
flexGrow: 1,
|
|
4848
4877
|
flexShrink: 1,
|
|
4849
4878
|
flexBasis: 0
|
|
4850
4879
|
} : {};
|
|
4880
|
+
const shouldExpandFlexProps = shouldExpand ? {
|
|
4881
|
+
flexGrow: 1,
|
|
4882
|
+
flexShrink: 1
|
|
4883
|
+
} : {};
|
|
4851
4884
|
return /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
4852
4885
|
marginRight: direction === 'row' ? currentItemMarginValue : undefined,
|
|
4853
4886
|
marginBottom: direction === 'column' ? currentItemMarginValue : undefined,
|
|
4854
|
-
...
|
|
4887
|
+
...directionFlexProps,
|
|
4888
|
+
...shouldExpandFlexProps,
|
|
4855
4889
|
children: children
|
|
4856
4890
|
});
|
|
4857
4891
|
}
|
|
4858
4892
|
|
|
4859
4893
|
function ChoicesContainer({
|
|
4860
4894
|
direction,
|
|
4895
|
+
shouldExpand,
|
|
4861
4896
|
contentContainerStyle,
|
|
4862
4897
|
...props
|
|
4863
4898
|
}) {
|
|
4899
|
+
const shouldExpandFlexProps = shouldExpand ? {
|
|
4900
|
+
flexGrow: 1,
|
|
4901
|
+
flexShrink: 1
|
|
4902
|
+
} : {};
|
|
4864
4903
|
if (direction === 'row') {
|
|
4865
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
4904
|
+
return /*#__PURE__*/jsxRuntime.jsx(ScrollView, {
|
|
4866
4905
|
horizontal: true,
|
|
4867
|
-
contentContainerStyle: contentContainerStyle,
|
|
4868
|
-
...props
|
|
4906
|
+
contentContainerStyle: shouldExpand ? shouldExpandFlexProps : contentContainerStyle,
|
|
4907
|
+
...props,
|
|
4908
|
+
...shouldExpandFlexProps
|
|
4869
4909
|
});
|
|
4870
4910
|
}
|
|
4871
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
4872
|
-
...props
|
|
4911
|
+
return /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
4912
|
+
...props,
|
|
4913
|
+
...shouldExpandFlexProps
|
|
4873
4914
|
});
|
|
4874
4915
|
}
|
|
4875
4916
|
|
|
@@ -4881,6 +4922,7 @@ function Choices({
|
|
|
4881
4922
|
type,
|
|
4882
4923
|
direction = 'column',
|
|
4883
4924
|
disabled,
|
|
4925
|
+
shouldExpand = false,
|
|
4884
4926
|
children,
|
|
4885
4927
|
value,
|
|
4886
4928
|
onPress,
|
|
@@ -4897,6 +4939,7 @@ function Choices({
|
|
|
4897
4939
|
const sharedProps = {
|
|
4898
4940
|
type,
|
|
4899
4941
|
disabled,
|
|
4942
|
+
shouldExpand,
|
|
4900
4943
|
onPress: !isForm ? onPress : undefined,
|
|
4901
4944
|
onChange: isForm ? newValue => {
|
|
4902
4945
|
setCurrentValue(newValue);
|
|
@@ -4908,6 +4951,7 @@ function Choices({
|
|
|
4908
4951
|
};
|
|
4909
4952
|
return /*#__PURE__*/jsxRuntime.jsx(ChoicesContainer, {
|
|
4910
4953
|
direction: direction,
|
|
4954
|
+
shouldExpand: shouldExpand,
|
|
4911
4955
|
testID: testID,
|
|
4912
4956
|
id: id,
|
|
4913
4957
|
style: style,
|
|
@@ -4919,6 +4963,7 @@ function Choices({
|
|
|
4919
4963
|
});
|
|
4920
4964
|
return /*#__PURE__*/jsxRuntime.jsx(ChoiceItemContainer, {
|
|
4921
4965
|
direction: direction,
|
|
4966
|
+
shouldExpand: shouldExpand,
|
|
4922
4967
|
isLast: index === childrenArray.length - 1,
|
|
4923
4968
|
children: element
|
|
4924
4969
|
}, child.key);
|