@ornikar/kitt-universal 27.1.0 → 27.2.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 +16 -0
- package/dist/definitions/Button/AnimatedContainer.d.ts +3 -1
- package/dist/definitions/Button/AnimatedContainer.d.ts.map +1 -1
- package/dist/definitions/Button/AnimatedContainer.web.d.ts +1 -1
- package/dist/definitions/Button/AnimatedContainer.web.d.ts.map +1 -1
- package/dist/definitions/Button/Button.d.ts.map +1 -1
- package/dist/definitions/Button/ButtonContent.d.ts.map +1 -1
- package/dist/definitions/Button/ButtonPadding.d.ts +2 -2
- package/dist/definitions/Button/ButtonPadding.d.ts.map +1 -1
- package/dist/definitions/Button/hooks/useNativeAnimation.d.ts.map +1 -1
- package/dist/definitions/Choices/AnimatedChoiceItemView.d.ts +3 -3
- 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 +6 -4
- package/dist/definitions/Choices/ChoiceItem.d.ts.map +1 -1
- package/dist/definitions/Choices/Choices.d.ts +2 -2
- package/dist/definitions/Choices/Choices.d.ts.map +1 -1
- package/dist/definitions/Choices/utils/getBorderColor.d.ts +8 -0
- package/dist/definitions/Choices/utils/getBorderColor.d.ts.map +1 -0
- package/dist/definitions/Choices/utils/getCurrentTextColor.d.ts +1 -5
- package/dist/definitions/Choices/utils/getCurrentTextColor.d.ts.map +1 -1
- package/dist/definitions/IconButton/IconButton.d.ts +8 -16
- package/dist/definitions/IconButton/IconButton.d.ts.map +1 -1
- package/dist/definitions/IconButton/utils/getButtonTypeAndVariant.d.ts +9 -0
- package/dist/definitions/IconButton/utils/getButtonTypeAndVariant.d.ts.map +1 -0
- package/dist/definitions/native-base/KittNativeBaseProvider.d.ts +19 -43
- package/dist/definitions/native-base/KittNativeBaseProvider.d.ts.map +1 -1
- package/dist/definitions/themes/default.d.ts +5 -0
- package/dist/definitions/themes/default.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/button.d.ts +3 -11
- package/dist/definitions/themes/late-ocean/button.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/choices.d.ts +20 -2
- package/dist/definitions/themes/late-ocean/choices.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/iconButton.d.ts +0 -35
- package/dist/definitions/themes/late-ocean/iconButton.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/typography.d.ts +5 -0
- package/dist/definitions/themes/late-ocean/typography.d.ts.map +1 -1
- package/dist/definitions/typography/Typography.d.ts +1 -1
- package/dist/definitions/typography/Typography.d.ts.map +1 -1
- package/dist/index-metro.es.android.js +228 -405
- package/dist/index-metro.es.android.js.map +1 -1
- package/dist/index-metro.es.ios.js +228 -405
- package/dist/index-metro.es.ios.js.map +1 -1
- package/dist/index-node-22.17.cjs.js +223 -400
- package/dist/index-node-22.17.cjs.js.map +1 -1
- package/dist/index-node-22.17.cjs.web.js +225 -439
- package/dist/index-node-22.17.cjs.web.js.map +1 -1
- package/dist/index-node-22.17.es.mjs +223 -400
- package/dist/index-node-22.17.es.mjs.map +1 -1
- package/dist/index-node-22.17.es.web.mjs +225 -439
- package/dist/index-node-22.17.es.web.mjs.map +1 -1
- package/dist/index.es.js +228 -398
- package/dist/index.es.js.map +1 -1
- package/dist/index.es.web.js +231 -437
- package/dist/index.es.web.js.map +1 -1
- package/dist/linaria-themes-metro.es.android.js +38 -64
- package/dist/linaria-themes-metro.es.android.js.map +1 -1
- package/dist/linaria-themes-metro.es.ios.js +38 -64
- package/dist/linaria-themes-metro.es.ios.js.map +1 -1
- package/dist/linaria-themes-node-22.17.cjs.js +38 -64
- package/dist/linaria-themes-node-22.17.cjs.js.map +1 -1
- package/dist/linaria-themes-node-22.17.cjs.web.js +38 -64
- package/dist/linaria-themes-node-22.17.cjs.web.js.map +1 -1
- package/dist/linaria-themes-node-22.17.es.mjs +38 -64
- package/dist/linaria-themes-node-22.17.es.mjs.map +1 -1
- package/dist/linaria-themes-node-22.17.es.web.mjs +38 -64
- package/dist/linaria-themes-node-22.17.es.web.mjs.map +1 -1
- package/dist/linaria-themes.es.js +38 -64
- package/dist/linaria-themes.es.js.map +1 -1
- package/dist/linaria-themes.es.web.js +38 -64
- package/dist/linaria-themes.es.web.js.map +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/definitions/Button/utils/getCurrentScale.d.ts +0 -10
- package/dist/definitions/Button/utils/getCurrentScale.d.ts.map +0 -1
- package/dist/definitions/Choices/utils/getBorderRadius.d.ts +0 -3
- package/dist/definitions/Choices/utils/getBorderRadius.d.ts.map +0 -1
- package/dist/definitions/IconButton/AnimatedBackground.d.ts +0 -13
- package/dist/definitions/IconButton/AnimatedBackground.d.ts.map +0 -1
- package/dist/definitions/IconButton/AnimatedBackground.web.d.ts +0 -4
- package/dist/definitions/IconButton/AnimatedBackground.web.d.ts.map +0 -1
- package/dist/definitions/IconButton/AnimatedScale.d.ts +0 -12
- package/dist/definitions/IconButton/AnimatedScale.d.ts.map +0 -1
- package/dist/definitions/IconButton/AnimatedScale.web.d.ts +0 -4
- package/dist/definitions/IconButton/AnimatedScale.web.d.ts.map +0 -1
- package/dist/definitions/IconButton/Background.d.ts +0 -11
- package/dist/definitions/IconButton/Background.d.ts.map +0 -1
- package/dist/definitions/IconButton/hooks/useNativeAnimation.d.ts +0 -18
- package/dist/definitions/IconButton/hooks/useNativeAnimation.d.ts.map +0 -1
- package/dist/definitions/IconButton/hooks/useNativeAnimation.web.d.ts +0 -3
- package/dist/definitions/IconButton/hooks/useNativeAnimation.web.d.ts.map +0 -1
- package/dist/definitions/IconButton/utils/getIconButtonBackgroundColor.d.ts +0 -3
- package/dist/definitions/IconButton/utils/getIconButtonBackgroundColor.d.ts.map +0 -1
- package/dist/definitions/IconButton/utils/getIconButtonTextColorByColor.d.ts +0 -4
- package/dist/definitions/IconButton/utils/getIconButtonTextColorByColor.d.ts.map +0 -1
package/dist/index.es.js
CHANGED
|
@@ -564,20 +564,13 @@ var button = {
|
|
|
564
564
|
borderWidth: {
|
|
565
565
|
focus: 3
|
|
566
566
|
},
|
|
567
|
-
minHeight: 40,
|
|
568
567
|
minWidth: 40,
|
|
569
568
|
maxWidth: 335,
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
"default": 1,
|
|
574
|
-
hover: 0.95,
|
|
575
|
-
active: 0.95
|
|
576
|
-
},
|
|
577
|
-
medium: {
|
|
578
|
-
hover: 1.05
|
|
579
|
-
}
|
|
569
|
+
height: {
|
|
570
|
+
"default": 40,
|
|
571
|
+
medium: 48
|
|
580
572
|
},
|
|
573
|
+
maxHeight: 48,
|
|
581
574
|
icon: {
|
|
582
575
|
medium: {
|
|
583
576
|
size: 24
|
|
@@ -810,23 +803,35 @@ var choices = {
|
|
|
810
803
|
column: 12
|
|
811
804
|
},
|
|
812
805
|
item: {
|
|
813
|
-
borderRadius:
|
|
806
|
+
borderRadius: 4,
|
|
814
807
|
padding: {
|
|
815
808
|
base: 16,
|
|
816
809
|
small: 24
|
|
817
810
|
},
|
|
818
811
|
backgroundColor: {
|
|
819
812
|
"default": deepPurpleColorPalette['beige.1'],
|
|
820
|
-
disabled:
|
|
821
|
-
selected:
|
|
822
|
-
pressed: deepPurpleColorPalette['
|
|
813
|
+
disabled: deepPurpleColorPalette['grey.1'],
|
|
814
|
+
selected: deepPurpleColorPalette['beige.3'],
|
|
815
|
+
pressed: deepPurpleColorPalette['beige.2'],
|
|
823
816
|
hover: deepPurpleColorPalette['beige.2'],
|
|
824
|
-
hoverWhenSelected: deepPurpleColorPalette['
|
|
817
|
+
hoverWhenSelected: deepPurpleColorPalette['beige.3']
|
|
825
818
|
},
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
819
|
+
color: {
|
|
820
|
+
"default": deepPurpleColorPalette['grey.9'],
|
|
821
|
+
disabled: deepPurpleColorPalette['grey.3']
|
|
822
|
+
},
|
|
823
|
+
border: {
|
|
824
|
+
"default": {
|
|
825
|
+
width: 1,
|
|
826
|
+
color: deepPurpleColorPalette['deepPurple.7']
|
|
827
|
+
},
|
|
828
|
+
disabled: {
|
|
829
|
+
width: 1,
|
|
830
|
+
color: deepPurpleColorPalette['grey.2']
|
|
831
|
+
},
|
|
832
|
+
error: {
|
|
833
|
+
width: 1,
|
|
834
|
+
color: deepPurpleColorPalette['red.6']
|
|
830
835
|
}
|
|
831
836
|
},
|
|
832
837
|
transition: {
|
|
@@ -834,6 +839,12 @@ var choices = {
|
|
|
834
839
|
duration: 300,
|
|
835
840
|
timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
|
|
836
841
|
}
|
|
842
|
+
},
|
|
843
|
+
description: {
|
|
844
|
+
color: {
|
|
845
|
+
"default": deepPurpleColorPalette['grey.5'],
|
|
846
|
+
error: deepPurpleColorPalette['red.6']
|
|
847
|
+
}
|
|
837
848
|
}
|
|
838
849
|
};
|
|
839
850
|
|
|
@@ -1903,50 +1914,8 @@ var icon = {
|
|
|
1903
1914
|
};
|
|
1904
1915
|
|
|
1905
1916
|
var iconButton = {
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
height: 40,
|
|
1909
|
-
borderRadius: 20,
|
|
1910
|
-
borderWidth: 2,
|
|
1911
|
-
borderColor: 'transparent',
|
|
1912
|
-
transition: {
|
|
1913
|
-
property: 'all',
|
|
1914
|
-
duration: '200ms',
|
|
1915
|
-
timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
|
|
1916
|
-
},
|
|
1917
|
-
scale: {
|
|
1918
|
-
base: {
|
|
1919
|
-
"default": 1,
|
|
1920
|
-
hover: 0.95,
|
|
1921
|
-
active: 0.95
|
|
1922
|
-
},
|
|
1923
|
-
medium: {
|
|
1924
|
-
"default": 1,
|
|
1925
|
-
hover: 1.05,
|
|
1926
|
-
active: 0.95
|
|
1927
|
-
}
|
|
1928
|
-
},
|
|
1929
|
-
disabled: {
|
|
1930
|
-
scale: 1,
|
|
1931
|
-
backgroundColor: button.primary["default"].backgroundColor.disabled
|
|
1932
|
-
},
|
|
1933
|
-
"default": {
|
|
1934
|
-
pressedBackgroundColor: button.primary["default"].backgroundColor.disabled
|
|
1935
|
-
},
|
|
1936
|
-
ghost: {
|
|
1937
|
-
pressedBackgroundColor: button.primary["default"].backgroundColor.disabled
|
|
1938
|
-
},
|
|
1939
|
-
primary: {
|
|
1940
|
-
pressedBackgroundColor: deepPurpleColorPalette['beige.1']
|
|
1941
|
-
},
|
|
1942
|
-
'primary-plain': {
|
|
1943
|
-
pressedBackgroundColor: colors.primaryLight,
|
|
1944
|
-
backgroundColor: colors.primary
|
|
1945
|
-
},
|
|
1946
|
-
secondary: {
|
|
1947
|
-
pressedBackgroundColor: 'rgba(0, 0, 0, 0.05)',
|
|
1948
|
-
backgroundColor: 'rgba(0, 0, 0, 0.1)'
|
|
1949
|
-
}
|
|
1917
|
+
width: button.height.medium,
|
|
1918
|
+
height: button.height.medium
|
|
1950
1919
|
};
|
|
1951
1920
|
|
|
1952
1921
|
var listItem = {
|
|
@@ -2150,6 +2119,11 @@ var typography = {
|
|
|
2150
2119
|
fontSize: 14,
|
|
2151
2120
|
lineHeight: 20,
|
|
2152
2121
|
allowedFontWeights: ['semibold']
|
|
2122
|
+
},
|
|
2123
|
+
'label-small': {
|
|
2124
|
+
fontSize: 12,
|
|
2125
|
+
lineHeight: 16,
|
|
2126
|
+
allowedFontWeights: ['semibold']
|
|
2153
2127
|
}
|
|
2154
2128
|
}
|
|
2155
2129
|
},
|
|
@@ -2858,6 +2832,9 @@ function AnimatedContainer$2(_ref) {
|
|
|
2858
2832
|
isHovered = _ref.isHovered,
|
|
2859
2833
|
isPressed = _ref.isPressed,
|
|
2860
2834
|
variant = _ref.variant,
|
|
2835
|
+
_ref$size = _ref.size,
|
|
2836
|
+
size = _ref$size === void 0 ? 'default' : _ref$size,
|
|
2837
|
+
isIconOnly = _ref.isIconOnly,
|
|
2861
2838
|
type = _ref.type;
|
|
2862
2839
|
var currentBackgroundColor = getCurrentBackgroundColorForNativeBaseTheme({
|
|
2863
2840
|
type: type,
|
|
@@ -2866,10 +2843,14 @@ function AnimatedContainer$2(_ref) {
|
|
|
2866
2843
|
isHovered: isHovered,
|
|
2867
2844
|
isPressed: isPressed
|
|
2868
2845
|
});
|
|
2846
|
+
var width = isIconOnly ? "kitt.button.height.".concat(size) : undefined;
|
|
2847
|
+
var height = isIconOnly ? "kitt.button.height.".concat(size) : undefined;
|
|
2869
2848
|
var sx = useSx();
|
|
2870
2849
|
var styles = sx({
|
|
2871
2850
|
borderRadius: 'kitt.button.borderRadius',
|
|
2872
|
-
backgroundColor: currentBackgroundColor
|
|
2851
|
+
backgroundColor: currentBackgroundColor,
|
|
2852
|
+
width: width,
|
|
2853
|
+
height: height
|
|
2873
2854
|
});
|
|
2874
2855
|
return /*#__PURE__*/jsx(Animated.View, {
|
|
2875
2856
|
style: disabled ? [styles] : [styles, animatedStyles],
|
|
@@ -3159,7 +3140,7 @@ function ButtonBadge(_ref) {
|
|
|
3159
3140
|
backgroundColor: backgroundColor,
|
|
3160
3141
|
borderRadius: "kitt.buttonBadge.borderRadius.badgeCount",
|
|
3161
3142
|
children: /*#__PURE__*/jsx(Typography.Text, {
|
|
3162
|
-
base: "
|
|
3143
|
+
base: "content-caps-xs",
|
|
3163
3144
|
variant: "bold",
|
|
3164
3145
|
color: "white",
|
|
3165
3146
|
children: (badgeCount || 0) > 5 ? '+5' : badgeCount
|
|
@@ -3275,10 +3256,36 @@ function ButtonContentChildren(_ref) {
|
|
|
3275
3256
|
throw new Error('kitt(Button): You should provide at least a children or a icon');
|
|
3276
3257
|
}
|
|
3277
3258
|
}
|
|
3259
|
+
var isMedium = size === 'medium';
|
|
3278
3260
|
if (!children && icon) {
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3261
|
+
var getTopOffset = function () {
|
|
3262
|
+
if (withBadge) {
|
|
3263
|
+
return isMedium ? '-14px' : '-10px';
|
|
3264
|
+
}
|
|
3265
|
+
return isMedium ? '-20px' : '-16px';
|
|
3266
|
+
};
|
|
3267
|
+
var getRightOffset = function () {
|
|
3268
|
+
if (withBadge) {
|
|
3269
|
+
return isMedium ? '-28px' : '-20px';
|
|
3270
|
+
}
|
|
3271
|
+
return isMedium ? '-33px' : '-25px';
|
|
3272
|
+
};
|
|
3273
|
+
return /*#__PURE__*/jsxs(View, {
|
|
3274
|
+
alignItems: "center",
|
|
3275
|
+
justifyContent: "center",
|
|
3276
|
+
children: [/*#__PURE__*/jsx(TypographyIcon, {
|
|
3277
|
+
icon: icon,
|
|
3278
|
+
color: color,
|
|
3279
|
+
size: "kitt.button.icon.".concat(size, ".size")
|
|
3280
|
+
}), withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsx(View, {
|
|
3281
|
+
position: "absolute",
|
|
3282
|
+
top: getTopOffset(),
|
|
3283
|
+
right: getRightOffset(),
|
|
3284
|
+
children: /*#__PURE__*/jsx(ButtonBadge, {
|
|
3285
|
+
withBadge: withBadge,
|
|
3286
|
+
badgeCount: badgeCount
|
|
3287
|
+
})
|
|
3288
|
+
}) : null]
|
|
3282
3289
|
});
|
|
3283
3290
|
}
|
|
3284
3291
|
// Make the multilines case work properly on native - Breaks the web implem
|
|
@@ -3356,16 +3363,16 @@ function ButtonContent(_ref2) {
|
|
|
3356
3363
|
|
|
3357
3364
|
function ButtonPadding(_ref) {
|
|
3358
3365
|
var children = _ref.children,
|
|
3359
|
-
size = _ref.size
|
|
3360
|
-
_ref.
|
|
3366
|
+
size = _ref.size,
|
|
3367
|
+
isIconOnly = _ref.isIconOnly;
|
|
3361
3368
|
return /*#__PURE__*/jsx(View, {
|
|
3362
3369
|
position: "relative",
|
|
3363
3370
|
flexDirection: "row",
|
|
3364
3371
|
alignItems: "center",
|
|
3365
3372
|
justifyContent: "center",
|
|
3373
|
+
height: isIconOnly ? "kitt.button.height.".concat(size) : undefined,
|
|
3366
3374
|
paddingX: "kitt.button.padding.".concat(size, ".horizontal"),
|
|
3367
3375
|
paddingY: "kitt.button.padding.".concat(size, ".vertical"),
|
|
3368
|
-
minHeight: "kitt.button.minHeight",
|
|
3369
3376
|
children: children
|
|
3370
3377
|
});
|
|
3371
3378
|
}
|
|
@@ -3399,20 +3406,16 @@ function FocusBorder(_ref) {
|
|
|
3399
3406
|
});
|
|
3400
3407
|
}
|
|
3401
3408
|
|
|
3402
|
-
var useNativeAnimation$
|
|
3409
|
+
var useNativeAnimation$4 = function (_ref) {
|
|
3403
3410
|
var type = _ref.type,
|
|
3404
3411
|
variant = _ref.variant,
|
|
3405
3412
|
isPressedInternal = _ref.isPressedInternal;
|
|
3406
3413
|
var theme = useTheme();
|
|
3407
3414
|
var pressed = useSharedValue(isPressedInternal ? 1 : 0);
|
|
3408
3415
|
var color = useSharedValue(0);
|
|
3409
|
-
var scale = theme.kitt.button.scale;
|
|
3410
3416
|
var animatedStyles = useAnimatedStyle(function () {
|
|
3411
3417
|
return {
|
|
3412
|
-
backgroundColor: interpolateColor(color.value, [0, 1], [type === 'tertiary-danger' ? theme.kitt.button['tertiary-danger']["default"].backgroundColor["default"] : theme.kitt.button[type][variant].backgroundColor["default"], type === 'tertiary-danger' ? theme.kitt.button['tertiary-danger']["default"].backgroundColor.pressed : theme.kitt.button[type][variant].backgroundColor.pressed])
|
|
3413
|
-
transform: [{
|
|
3414
|
-
scale: withSpring(pressed.value ? scale.base.active : scale.base["default"])
|
|
3415
|
-
}]
|
|
3418
|
+
backgroundColor: interpolateColor(color.value, [0, 1], [type === 'tertiary-danger' ? theme.kitt.button['tertiary-danger']["default"].backgroundColor["default"] : theme.kitt.button[type][variant].backgroundColor["default"], type === 'tertiary-danger' ? theme.kitt.button['tertiary-danger']["default"].backgroundColor.pressed : theme.kitt.button[type][variant].backgroundColor.pressed])
|
|
3416
3419
|
};
|
|
3417
3420
|
});
|
|
3418
3421
|
return {
|
|
@@ -3458,7 +3461,7 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
3458
3461
|
onHoverOut = _ref.onHoverOut,
|
|
3459
3462
|
onFocus = _ref.onFocus,
|
|
3460
3463
|
onBlur = _ref.onBlur;
|
|
3461
|
-
var _useNativeAnimation = useNativeAnimation$
|
|
3464
|
+
var _useNativeAnimation = useNativeAnimation$4({
|
|
3462
3465
|
type: type,
|
|
3463
3466
|
variant: variant
|
|
3464
3467
|
}),
|
|
@@ -3468,6 +3471,7 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
3468
3471
|
if (process.env.NODE_ENV !== 'production' && variant === 'revert' && type === 'tertiary-danger') {
|
|
3469
3472
|
throw new Error('Invalid revert variant for tertiary-danger button type. Only default variant is allowed.');
|
|
3470
3473
|
}
|
|
3474
|
+
var isIconOnly = !_children && !!icon;
|
|
3471
3475
|
return /*#__PURE__*/jsx(Pressable, {
|
|
3472
3476
|
ref: ref,
|
|
3473
3477
|
disabled: disabled,
|
|
@@ -3499,10 +3503,12 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
3499
3503
|
isPressed: isPressed || isPressedInternal,
|
|
3500
3504
|
disabled: !!disabled,
|
|
3501
3505
|
variant: variant,
|
|
3506
|
+
size: size,
|
|
3507
|
+
isIconOnly: isIconOnly,
|
|
3502
3508
|
isStretch: stretch,
|
|
3503
3509
|
children: /*#__PURE__*/jsxs(ButtonPadding, {
|
|
3504
3510
|
size: size,
|
|
3505
|
-
|
|
3511
|
+
isIconOnly: isIconOnly,
|
|
3506
3512
|
children: [/*#__PURE__*/jsx(ButtonContent, {
|
|
3507
3513
|
type: type,
|
|
3508
3514
|
variant: variant,
|
|
@@ -4339,7 +4345,7 @@ CardModal.Header = CardModalHeader;
|
|
|
4339
4345
|
CardModal.Footer = CardModalFooter;
|
|
4340
4346
|
CardModal.ModalBehaviour = CardModalBehaviour;
|
|
4341
4347
|
|
|
4342
|
-
function getBackgroundColor$
|
|
4348
|
+
function getBackgroundColor$4(_ref) {
|
|
4343
4349
|
var isDisabled = _ref.isDisabled,
|
|
4344
4350
|
isSelected = _ref.isSelected,
|
|
4345
4351
|
isHovered = _ref.isHovered,
|
|
@@ -4352,39 +4358,48 @@ function getBackgroundColor$5(_ref) {
|
|
|
4352
4358
|
return 'kitt.choices.item.default.backgroundColor';
|
|
4353
4359
|
}
|
|
4354
4360
|
|
|
4355
|
-
function
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4361
|
+
function getBorderColor$2(_ref) {
|
|
4362
|
+
var isDisabled = _ref.isDisabled,
|
|
4363
|
+
hasError = _ref.hasError,
|
|
4364
|
+
isSelected = _ref.isSelected;
|
|
4365
|
+
if (isDisabled) {
|
|
4366
|
+
return 'kitt.choices.item.disabled.borderColor';
|
|
4367
|
+
}
|
|
4368
|
+
if (hasError) {
|
|
4369
|
+
return 'kitt.choices.item.error.borderColor';
|
|
4370
|
+
}
|
|
4371
|
+
if (isSelected) {
|
|
4372
|
+
return 'kitt.choices.item.default.borderColor';
|
|
4373
|
+
}
|
|
4374
|
+
return 'transparent';
|
|
4359
4375
|
}
|
|
4360
4376
|
|
|
4361
4377
|
function AnimatedChoiceItemView(_ref) {
|
|
4362
4378
|
var children = _ref.children,
|
|
4363
|
-
variant = _ref.variant,
|
|
4364
4379
|
size = _ref.size,
|
|
4365
4380
|
isHovered = _ref.isHovered,
|
|
4366
4381
|
isPressed = _ref.isPressed,
|
|
4367
4382
|
isDisabled = _ref.isDisabled,
|
|
4368
4383
|
isSelected = _ref.isSelected,
|
|
4384
|
+
hasError = _ref.hasError,
|
|
4369
4385
|
animatedStyles = _ref.animatedStyles;
|
|
4370
4386
|
var sx = useSx();
|
|
4371
4387
|
var style = sx({
|
|
4372
4388
|
position: 'relative',
|
|
4373
|
-
borderRadius:
|
|
4374
|
-
|
|
4389
|
+
borderRadius: 'kitt.choices.item.borderRadius',
|
|
4390
|
+
borderWidth: 'kitt.choices.item.default.borderWidth',
|
|
4391
|
+
borderColor: getBorderColor$2({
|
|
4392
|
+
isDisabled: isDisabled,
|
|
4393
|
+
hasError: hasError,
|
|
4394
|
+
isSelected: isSelected
|
|
4395
|
+
}),
|
|
4396
|
+
backgroundColor: getBackgroundColor$4({
|
|
4375
4397
|
isDisabled: isDisabled,
|
|
4376
4398
|
isSelected: isSelected,
|
|
4377
4399
|
isHovered: isHovered,
|
|
4378
4400
|
isPressed: isPressed
|
|
4379
4401
|
}),
|
|
4380
|
-
|
|
4381
|
-
base: 'kitt.4',
|
|
4382
|
-
small: 'kitt.6'
|
|
4383
|
-
},
|
|
4384
|
-
paddingY: size === 'small' ? 'kitt.2' : {
|
|
4385
|
-
base: 'kitt.4',
|
|
4386
|
-
small: 'kitt.6'
|
|
4387
|
-
}
|
|
4402
|
+
padding: size === 'small' ? 'kitt.2' : 'kitt.4'
|
|
4388
4403
|
});
|
|
4389
4404
|
return /*#__PURE__*/jsx(Animated.View, {
|
|
4390
4405
|
style: [style, animatedStyles],
|
|
@@ -4392,7 +4407,7 @@ function AnimatedChoiceItemView(_ref) {
|
|
|
4392
4407
|
});
|
|
4393
4408
|
}
|
|
4394
4409
|
|
|
4395
|
-
var useNativeAnimation$
|
|
4410
|
+
var useNativeAnimation$3 = function (_ref) {
|
|
4396
4411
|
var selected = _ref.selected,
|
|
4397
4412
|
disabled = _ref.disabled,
|
|
4398
4413
|
isPressedInternal = _ref.isPressedInternal;
|
|
@@ -4431,23 +4446,22 @@ var useNativeAnimation$4 = function (_ref) {
|
|
|
4431
4446
|
};
|
|
4432
4447
|
|
|
4433
4448
|
function getCurrentTextColor$1(_ref) {
|
|
4434
|
-
var isDisabled = _ref.isDisabled
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
isHovered = _ref.isHovered;
|
|
4438
|
-
if (isDisabled) return 'black-light';
|
|
4439
|
-
if (isSelected && isHovered) return 'white';
|
|
4440
|
-
if (isSelected || isPressed) return 'white';
|
|
4441
|
-
return 'black';
|
|
4449
|
+
var isDisabled = _ref.isDisabled;
|
|
4450
|
+
if (isDisabled) return 'kitt.choices.item.disabled.color';
|
|
4451
|
+
return 'kitt.choices.item.default.color';
|
|
4442
4452
|
}
|
|
4443
4453
|
|
|
4444
4454
|
function ChoiceItem(_ref) {
|
|
4445
4455
|
var _ref$type = _ref.type,
|
|
4446
4456
|
type = _ref$type === void 0 ? 'button' : _ref$type,
|
|
4457
|
+
_ref$orientation = _ref.orientation,
|
|
4458
|
+
orientation = _ref$orientation === void 0 ? 'horizontal' : _ref$orientation,
|
|
4459
|
+
icon = _ref.icon,
|
|
4460
|
+
hasError = _ref.hasError,
|
|
4461
|
+
description = _ref.description,
|
|
4447
4462
|
value = _ref.value,
|
|
4448
4463
|
selected = _ref.selected,
|
|
4449
4464
|
disabled = _ref.disabled,
|
|
4450
|
-
variant = _ref.variant,
|
|
4451
4465
|
_children = _ref.children,
|
|
4452
4466
|
isPressedInternal = _ref.isPressedInternal,
|
|
4453
4467
|
isHoveredInternal = _ref.isHoveredInternal,
|
|
@@ -4458,7 +4472,7 @@ function ChoiceItem(_ref) {
|
|
|
4458
4472
|
size = _ref.size,
|
|
4459
4473
|
style = _ref.style,
|
|
4460
4474
|
testID = _ref.testID;
|
|
4461
|
-
var _useNativeAnimation = useNativeAnimation$
|
|
4475
|
+
var _useNativeAnimation = useNativeAnimation$3({
|
|
4462
4476
|
selected: selected,
|
|
4463
4477
|
disabled: disabled,
|
|
4464
4478
|
isPressedInternal: isPressedInternal
|
|
@@ -4466,6 +4480,7 @@ function ChoiceItem(_ref) {
|
|
|
4466
4480
|
onPressIn = _useNativeAnimation.onPressIn,
|
|
4467
4481
|
onPressOut = _useNativeAnimation.onPressOut,
|
|
4468
4482
|
backgroundStyles = _useNativeAnimation.backgroundStyles;
|
|
4483
|
+
var Stack = orientation === 'horizontal' ? HStack : VStack;
|
|
4469
4484
|
var handleChange = function () {
|
|
4470
4485
|
if (!onChange) return;
|
|
4471
4486
|
|
|
@@ -4497,31 +4512,41 @@ function ChoiceItem(_ref) {
|
|
|
4497
4512
|
children: function children(_ref2) {
|
|
4498
4513
|
var isHovered = _ref2.isHovered,
|
|
4499
4514
|
isPressed = _ref2.isPressed;
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4515
|
+
var textColor = getCurrentTextColor$1({
|
|
4516
|
+
isDisabled: disabled
|
|
4517
|
+
});
|
|
4518
|
+
return /*#__PURE__*/jsxs(VStack, {
|
|
4519
|
+
space: "kitt.2",
|
|
4520
|
+
children: [/*#__PURE__*/jsxs(AnimatedChoiceItemView, {
|
|
4521
|
+
animatedStyles: backgroundStyles,
|
|
4522
|
+
isHovered: isHovered || isHoveredInternal,
|
|
4523
|
+
isDisabled: disabled,
|
|
4524
|
+
isSelected: selected,
|
|
4525
|
+
isPressed: isPressed || isPressedInternal,
|
|
4526
|
+
hasError: hasError,
|
|
4527
|
+
size: size,
|
|
4528
|
+
children: [/*#__PURE__*/jsxs(Stack, {
|
|
4529
|
+
alignItems: "center",
|
|
4530
|
+
space: "kitt.2",
|
|
4531
|
+
children: [icon ? /*#__PURE__*/jsx(TypographyIcon, {
|
|
4532
|
+
color: textColor,
|
|
4533
|
+
icon: icon
|
|
4534
|
+
}) : null, /*#__PURE__*/jsx(Typography.SetDefaultColor, {
|
|
4535
|
+
value: textColor,
|
|
4536
|
+
children: _children
|
|
4537
|
+
})]
|
|
4538
|
+
}), disabled ? /*#__PURE__*/jsx(View, {
|
|
4539
|
+
borderRadius: "kitt.choices.item.borderRadius",
|
|
4540
|
+
position: "absolute",
|
|
4541
|
+
top: "0",
|
|
4542
|
+
right: "0",
|
|
4543
|
+
left: "0",
|
|
4544
|
+
bottom: "0"
|
|
4545
|
+
}) : null]
|
|
4546
|
+
}), description ? /*#__PURE__*/jsx(Typography.Text, {
|
|
4547
|
+
base: "body-s",
|
|
4548
|
+
color: hasError ? 'kitt.choices.description.color.error' : 'kitt.choices.description.color.default',
|
|
4549
|
+
children: description
|
|
4525
4550
|
}) : null]
|
|
4526
4551
|
});
|
|
4527
4552
|
}
|
|
@@ -4571,7 +4596,6 @@ function Choices(_ref2) {
|
|
|
4571
4596
|
disabled = _ref2.disabled,
|
|
4572
4597
|
children = _ref2.children,
|
|
4573
4598
|
value = _ref2.value,
|
|
4574
|
-
variant = _ref2.variant,
|
|
4575
4599
|
onPress = _ref2.onPress,
|
|
4576
4600
|
onChange = _ref2.onChange,
|
|
4577
4601
|
onFocus = _ref2.onFocus,
|
|
@@ -4588,7 +4612,6 @@ function Choices(_ref2) {
|
|
|
4588
4612
|
var sharedProps = {
|
|
4589
4613
|
type: type,
|
|
4590
4614
|
disabled: disabled,
|
|
4591
|
-
variant: variant,
|
|
4592
4615
|
onPress: !isForm ? onPress : undefined,
|
|
4593
4616
|
onChange: isForm ? function handleChange(newValue) {
|
|
4594
4617
|
setCurrentValue(newValue);
|
|
@@ -5187,7 +5210,7 @@ var InputText = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
5187
5210
|
});
|
|
5188
5211
|
});
|
|
5189
5212
|
|
|
5190
|
-
function getBackgroundColor$
|
|
5213
|
+
function getBackgroundColor$3(_ref) {
|
|
5191
5214
|
var isSelected = _ref.isSelected,
|
|
5192
5215
|
isHighlighted = _ref.isHighlighted,
|
|
5193
5216
|
isPressed = _ref.isPressed,
|
|
@@ -5224,7 +5247,7 @@ function AutocompleteItem(_ref2) {
|
|
|
5224
5247
|
minHeight: "kitt.forms.autocomplete.option.minHeight",
|
|
5225
5248
|
borderRadius: "kitt.1",
|
|
5226
5249
|
padding: "kitt.1",
|
|
5227
|
-
backgroundColor: getBackgroundColor$
|
|
5250
|
+
backgroundColor: getBackgroundColor$3({
|
|
5228
5251
|
isSelected: isSelected,
|
|
5229
5252
|
isHighlighted: isHighlighted,
|
|
5230
5253
|
isPressed: isPressed,
|
|
@@ -5513,7 +5536,7 @@ var SvgCheckboxMarkinline = function SvgCheckboxMarkinline(props) {
|
|
|
5513
5536
|
}));
|
|
5514
5537
|
};
|
|
5515
5538
|
|
|
5516
|
-
function getBackgroundColor$
|
|
5539
|
+
function getBackgroundColor$2(_ref) {
|
|
5517
5540
|
var isDisabled = _ref.isDisabled,
|
|
5518
5541
|
isPressed = _ref.isPressed,
|
|
5519
5542
|
isHovered = _ref.isHovered,
|
|
@@ -5591,7 +5614,7 @@ var Checkbox = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
5591
5614
|
isPressed: isPressed,
|
|
5592
5615
|
isChecked: checked
|
|
5593
5616
|
}),
|
|
5594
|
-
backgroundColor: getBackgroundColor$
|
|
5617
|
+
backgroundColor: getBackgroundColor$2({
|
|
5595
5618
|
isDisabled: disabled,
|
|
5596
5619
|
isFocused: isFocused,
|
|
5597
5620
|
isHovered: isHovered,
|
|
@@ -7436,7 +7459,7 @@ function InnerCircle(_ref) {
|
|
|
7436
7459
|
});
|
|
7437
7460
|
}
|
|
7438
7461
|
|
|
7439
|
-
function getBackgroundColor$
|
|
7462
|
+
function getBackgroundColor$1(_ref) {
|
|
7440
7463
|
var isDisabled = _ref.isDisabled,
|
|
7441
7464
|
isPressed = _ref.isPressed,
|
|
7442
7465
|
isHovered = _ref.isHovered,
|
|
@@ -7479,7 +7502,7 @@ function OuterCircle(_ref) {
|
|
|
7479
7502
|
width: "kitt.forms.radio.size",
|
|
7480
7503
|
height: "kitt.forms.radio.size",
|
|
7481
7504
|
borderRadius: "kitt.forms.radio.borderRadius",
|
|
7482
|
-
backgroundColor: getBackgroundColor$
|
|
7505
|
+
backgroundColor: getBackgroundColor$1({
|
|
7483
7506
|
isChecked: isChecked,
|
|
7484
7507
|
isDisabled: isDisabled,
|
|
7485
7508
|
isFocused: isFocused,
|
|
@@ -7618,7 +7641,7 @@ function HoverBorder(_ref) {
|
|
|
7618
7641
|
});
|
|
7619
7642
|
}
|
|
7620
7643
|
|
|
7621
|
-
var useNativeAnimation$
|
|
7644
|
+
var useNativeAnimation$2 = function (_ref) {
|
|
7622
7645
|
var isDisabled = _ref.isDisabled,
|
|
7623
7646
|
isSelected = _ref.isSelected,
|
|
7624
7647
|
isPressedInternal = _ref.isPressedInternal;
|
|
@@ -7690,7 +7713,7 @@ function RadioButton(_ref) {
|
|
|
7690
7713
|
onChange = _ref.onChange,
|
|
7691
7714
|
onFocus = _ref.onFocus,
|
|
7692
7715
|
onBlur = _ref.onBlur;
|
|
7693
|
-
var _useNativeAnimation = useNativeAnimation$
|
|
7716
|
+
var _useNativeAnimation = useNativeAnimation$2({
|
|
7694
7717
|
isDisabled: disabled,
|
|
7695
7718
|
isSelected: selected,
|
|
7696
7719
|
isPressedInternal: isPressedInternal
|
|
@@ -8432,7 +8455,7 @@ var withTimingConfig = {
|
|
|
8432
8455
|
duration: 100,
|
|
8433
8456
|
easing: Easing$1.ease
|
|
8434
8457
|
};
|
|
8435
|
-
var useNativeAnimation$
|
|
8458
|
+
var useNativeAnimation$1 = function (_ref) {
|
|
8436
8459
|
var variant = _ref.variant,
|
|
8437
8460
|
isExpanded = _ref.isExpanded,
|
|
8438
8461
|
isInitialRender = _ref.isInitialRender,
|
|
@@ -8520,7 +8543,7 @@ function Highlight(_ref) {
|
|
|
8520
8543
|
contentMarginY: 16
|
|
8521
8544
|
}
|
|
8522
8545
|
};
|
|
8523
|
-
var _useNativeAnimation = useNativeAnimation$
|
|
8546
|
+
var _useNativeAnimation = useNativeAnimation$1({
|
|
8524
8547
|
variant: variant,
|
|
8525
8548
|
isExpanded: isExpanded,
|
|
8526
8549
|
isInitialRender: isInitialRender,
|
|
@@ -8624,222 +8647,53 @@ function Highlight(_ref) {
|
|
|
8624
8647
|
});
|
|
8625
8648
|
}
|
|
8626
8649
|
|
|
8627
|
-
var
|
|
8628
|
-
|
|
8629
|
-
if (isDisabled) {
|
|
8630
|
-
return 'kitt.iconButton.disabled.backgroundColor';
|
|
8631
|
-
}
|
|
8632
|
-
switch (color) {
|
|
8633
|
-
case 'primary':
|
|
8634
|
-
return 'kitt.iconButton.primary.pressed.backgroundColor';
|
|
8635
|
-
case 'primary-plain':
|
|
8636
|
-
return 'kitt.iconButton.primary-plain.pressed.backgroundColor';
|
|
8637
|
-
case 'ghost':
|
|
8638
|
-
return 'kitt.iconButton.ghost.pressed.backgroundColor';
|
|
8650
|
+
var getButtonTypeAndVariant = function (iconColor) {
|
|
8651
|
+
switch (iconColor) {
|
|
8639
8652
|
case 'black':
|
|
8640
|
-
|
|
8641
|
-
|
|
8642
|
-
|
|
8643
|
-
}
|
|
8644
|
-
function Background(_ref) {
|
|
8645
|
-
var color = _ref.color,
|
|
8646
|
-
isDisabled = _ref.isDisabled,
|
|
8647
|
-
props = _objectWithoutProperties(_ref, _excluded$c);
|
|
8648
|
-
return /*#__PURE__*/jsx(View, _objectSpread(_objectSpread({}, props), {}, {
|
|
8649
|
-
width: "100%",
|
|
8650
|
-
height: "100%",
|
|
8651
|
-
borderRadius: "kitt.iconButton.borderRadius",
|
|
8652
|
-
backgroundColor: getBackgroundColor$1(color, isDisabled)
|
|
8653
|
-
}));
|
|
8654
|
-
}
|
|
8655
|
-
|
|
8656
|
-
function AnimatedBackground(_ref) {
|
|
8657
|
-
var color = _ref.color,
|
|
8658
|
-
isDisabled = _ref.isDisabled,
|
|
8659
|
-
opacityStyles = _ref.opacityStyles;
|
|
8660
|
-
var sx = useSx();
|
|
8661
|
-
var currentOpacityStyles = isDisabled ? {
|
|
8662
|
-
opacity: 1
|
|
8663
|
-
} : opacityStyles;
|
|
8664
|
-
var styles = sx({
|
|
8665
|
-
position: 'absolute',
|
|
8666
|
-
top: 0,
|
|
8667
|
-
left: 0,
|
|
8668
|
-
width: '100%',
|
|
8669
|
-
height: '100%'
|
|
8670
|
-
});
|
|
8671
|
-
return /*#__PURE__*/jsx(Animated.View, {
|
|
8672
|
-
style: [styles, currentOpacityStyles],
|
|
8673
|
-
children: /*#__PURE__*/jsx(Background, {
|
|
8674
|
-
color: color,
|
|
8675
|
-
isDisabled: isDisabled
|
|
8676
|
-
})
|
|
8677
|
-
});
|
|
8678
|
-
}
|
|
8679
|
-
|
|
8680
|
-
function AnimatedScale(_ref) {
|
|
8681
|
-
var isDisabled = _ref.isDisabled,
|
|
8682
|
-
scaleStyles = _ref.scaleStyles,
|
|
8683
|
-
children = _ref.children;
|
|
8684
|
-
var sx = useSx();
|
|
8685
|
-
var currentOpacityStyles = isDisabled ? {
|
|
8686
|
-
transform: [{
|
|
8687
|
-
scale: 1
|
|
8688
|
-
}]
|
|
8689
|
-
} : scaleStyles;
|
|
8690
|
-
var styles = sx({
|
|
8691
|
-
position: 'relative',
|
|
8692
|
-
alignItems: 'center',
|
|
8693
|
-
justifyContent: 'center',
|
|
8694
|
-
width: '100%',
|
|
8695
|
-
height: '100%'
|
|
8696
|
-
});
|
|
8697
|
-
return /*#__PURE__*/jsx(Animated.View, {
|
|
8698
|
-
style: [styles, currentOpacityStyles],
|
|
8699
|
-
children: children
|
|
8700
|
-
});
|
|
8701
|
-
}
|
|
8702
|
-
|
|
8703
|
-
function useNativeAnimation$1(_ref) {
|
|
8704
|
-
var isPressed = _ref.isPressed;
|
|
8705
|
-
var theme = useTheme();
|
|
8706
|
-
var pressed = useSharedValue(!!isPressed);
|
|
8707
|
-
var opacityStyles = useAnimatedStyle(function () {
|
|
8708
|
-
return {
|
|
8709
|
-
opacity: withSpring(pressed.value ? 1 : 0)
|
|
8710
|
-
};
|
|
8711
|
-
});
|
|
8712
|
-
var scaleStyles = useAnimatedStyle(function () {
|
|
8713
|
-
return {
|
|
8714
|
-
transform: [{
|
|
8715
|
-
scale: withSpring(pressed.value ? theme.kitt.iconButton.scale.base.active : theme.kitt.iconButton.scale.base["default"])
|
|
8716
|
-
}]
|
|
8717
|
-
};
|
|
8718
|
-
});
|
|
8719
|
-
return {
|
|
8720
|
-
opacityStyles: opacityStyles,
|
|
8721
|
-
scaleStyles: scaleStyles,
|
|
8722
|
-
onPressIn: function handlePressIn() {
|
|
8723
|
-
pressed.value = true;
|
|
8724
|
-
},
|
|
8725
|
-
onPressOut: function handlePressOut() {
|
|
8726
|
-
pressed.value = false;
|
|
8727
|
-
}
|
|
8728
|
-
};
|
|
8729
|
-
}
|
|
8730
|
-
|
|
8731
|
-
var getIconButtonBackgroundColor = function (color, disabled) {
|
|
8732
|
-
if (disabled) {
|
|
8733
|
-
return undefined;
|
|
8734
|
-
}
|
|
8735
|
-
switch (color) {
|
|
8736
|
-
case 'primary-plain':
|
|
8737
|
-
return 'kitt.iconButton.primary-plain.backgroundColor';
|
|
8653
|
+
return {
|
|
8654
|
+
type: 'tertiary'
|
|
8655
|
+
};
|
|
8738
8656
|
case 'secondary':
|
|
8739
|
-
return
|
|
8740
|
-
|
|
8741
|
-
|
|
8742
|
-
|
|
8743
|
-
|
|
8744
|
-
|
|
8745
|
-
|
|
8746
|
-
if (disabled) {
|
|
8747
|
-
return 'black-light';
|
|
8748
|
-
}
|
|
8749
|
-
switch (color) {
|
|
8750
|
-
case 'ghost':
|
|
8751
|
-
return 'white';
|
|
8657
|
+
return {
|
|
8658
|
+
type: 'secondary'
|
|
8659
|
+
};
|
|
8660
|
+
case 'primary':
|
|
8661
|
+
return {
|
|
8662
|
+
type: 'primary'
|
|
8663
|
+
};
|
|
8752
8664
|
case 'primary-plain':
|
|
8753
|
-
return
|
|
8754
|
-
|
|
8755
|
-
|
|
8665
|
+
return {
|
|
8666
|
+
type: 'primary'
|
|
8667
|
+
};
|
|
8668
|
+
case 'ghost':
|
|
8669
|
+
return {
|
|
8670
|
+
type: 'tertiary',
|
|
8671
|
+
variant: 'revert'
|
|
8672
|
+
};
|
|
8756
8673
|
default:
|
|
8757
|
-
return
|
|
8674
|
+
return {
|
|
8675
|
+
type: 'secondary'
|
|
8676
|
+
};
|
|
8758
8677
|
}
|
|
8759
8678
|
};
|
|
8760
8679
|
|
|
8680
|
+
var _excluded$c = ["color", "ariaLabel"];
|
|
8681
|
+
/**
|
|
8682
|
+
* @deprecated IconButton should only be used as a navigation button
|
|
8683
|
+
* Other use cases should use a <Button> component with an icon
|
|
8684
|
+
*/
|
|
8761
8685
|
function IconButton(_ref) {
|
|
8762
|
-
var
|
|
8763
|
-
_ref$color
|
|
8764
|
-
|
|
8765
|
-
|
|
8766
|
-
|
|
8767
|
-
|
|
8768
|
-
|
|
8769
|
-
|
|
8770
|
-
|
|
8771
|
-
|
|
8772
|
-
|
|
8773
|
-
isPressedInternal = _ref.isPressedInternal,
|
|
8774
|
-
isFocusedInternal = _ref.isFocusedInternal,
|
|
8775
|
-
onPress = _ref.onPress;
|
|
8776
|
-
var _useNativeAnimation = useNativeAnimation$1({
|
|
8777
|
-
isDisabled: disabled,
|
|
8778
|
-
isPressed: isPressedInternal
|
|
8779
|
-
}),
|
|
8780
|
-
onPressIn = _useNativeAnimation.onPressIn,
|
|
8781
|
-
onPressOut = _useNativeAnimation.onPressOut,
|
|
8782
|
-
opacityStyles = _useNativeAnimation.opacityStyles,
|
|
8783
|
-
scaleStyles = _useNativeAnimation.scaleStyles;
|
|
8784
|
-
return /*#__PURE__*/jsx(Pressable, {
|
|
8785
|
-
testID: testID,
|
|
8786
|
-
disabled: disabled,
|
|
8787
|
-
width: "kitt.iconButton.width",
|
|
8788
|
-
height: "kitt.iconButton.height",
|
|
8789
|
-
"aria-label": ariaLabel,
|
|
8790
|
-
accessibilityRole: accessibilityRole,
|
|
8791
|
-
_web: {
|
|
8792
|
-
style: {
|
|
8793
|
-
backfaceVisibility: 'hidden',
|
|
8794
|
-
transform: 'translate3d(0px)'
|
|
8795
|
-
}
|
|
8796
|
-
},
|
|
8797
|
-
backgroundColor: getIconButtonBackgroundColor(color, disabled),
|
|
8798
|
-
borderRadius: "kitt.iconButton.borderRadius",
|
|
8799
|
-
borderColor: disabled ? 'kitt.iconButton.disabled.borderColor' : 'kitt.iconButton.borderColor',
|
|
8800
|
-
borderWidth: disabled ? 'kitt.iconButton.borderWidth' : 0,
|
|
8801
|
-
onPress: onPress,
|
|
8802
|
-
onPressIn: onPressIn,
|
|
8803
|
-
onPressOut: onPressOut,
|
|
8804
|
-
children: function children(_ref2) {
|
|
8805
|
-
var isHovered = _ref2.isHovered,
|
|
8806
|
-
isPressed = _ref2.isPressed,
|
|
8807
|
-
isFocused = _ref2.isFocused;
|
|
8808
|
-
var isCurrentHovered = isHovered || isHoveredInternal;
|
|
8809
|
-
var isCurrentPressed = isPressed || isPressedInternal;
|
|
8810
|
-
return /*#__PURE__*/jsxs(Fragment, {
|
|
8811
|
-
children: [/*#__PURE__*/jsxs(AnimatedScale, {
|
|
8812
|
-
isDisabled: disabled,
|
|
8813
|
-
isHovered: isCurrentHovered,
|
|
8814
|
-
isPressed: isCurrentPressed,
|
|
8815
|
-
scaleStyles: scaleStyles,
|
|
8816
|
-
children: [/*#__PURE__*/jsx(AnimatedBackground, {
|
|
8817
|
-
color: color,
|
|
8818
|
-
isDisabled: disabled,
|
|
8819
|
-
isHovered: isCurrentHovered,
|
|
8820
|
-
isPressed: isCurrentPressed,
|
|
8821
|
-
isFocused: isFocused || isFocusedInternal,
|
|
8822
|
-
opacityStyles: opacityStyles
|
|
8823
|
-
}), /*#__PURE__*/jsx(View, {
|
|
8824
|
-
alignItems: "center",
|
|
8825
|
-
justifyContent: "center",
|
|
8826
|
-
children: /*#__PURE__*/jsx(TypographyIcon, {
|
|
8827
|
-
color: getIconButtonTextColorByColor(color, disabled),
|
|
8828
|
-
icon: icon
|
|
8829
|
-
})
|
|
8830
|
-
})]
|
|
8831
|
-
}), withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsx(View, {
|
|
8832
|
-
position: "absolute",
|
|
8833
|
-
top: withBadge ? '1px' : '-6px',
|
|
8834
|
-
right: withBadge ? '1px' : '-6px',
|
|
8835
|
-
children: /*#__PURE__*/jsx(ButtonBadge, {
|
|
8836
|
-
withBadge: withBadge,
|
|
8837
|
-
badgeCount: badgeCount
|
|
8838
|
-
})
|
|
8839
|
-
}) : null]
|
|
8840
|
-
});
|
|
8841
|
-
}
|
|
8842
|
-
});
|
|
8686
|
+
var _ref$color = _ref.color,
|
|
8687
|
+
color = _ref$color === void 0 ? 'black' : _ref$color;
|
|
8688
|
+
_ref.ariaLabel;
|
|
8689
|
+
var props = _objectWithoutProperties(_ref, _excluded$c);
|
|
8690
|
+
var _getButtonTypeAndVari = getButtonTypeAndVariant(color),
|
|
8691
|
+
legacyColorToType = _getButtonTypeAndVari.type,
|
|
8692
|
+
legacyColorToVariant = _getButtonTypeAndVari.variant;
|
|
8693
|
+
return /*#__PURE__*/jsx(Button, _objectSpread({
|
|
8694
|
+
variant: legacyColorToVariant,
|
|
8695
|
+
type: legacyColorToType
|
|
8696
|
+
}, props));
|
|
8843
8697
|
}
|
|
8844
8698
|
function CloseIconButton(props) {
|
|
8845
8699
|
return /*#__PURE__*/jsx(IconButton, _objectSpread({
|
|
@@ -9416,11 +9270,17 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
9416
9270
|
choices: {
|
|
9417
9271
|
item: {
|
|
9418
9272
|
"default": {
|
|
9419
|
-
backgroundColor: theme.choices.item.backgroundColor["default"]
|
|
9273
|
+
backgroundColor: theme.choices.item.backgroundColor["default"],
|
|
9274
|
+
borderColor: theme.choices.item.border["default"].color,
|
|
9275
|
+
color: theme.choices.item.color["default"]
|
|
9420
9276
|
},
|
|
9421
9277
|
disabled: {
|
|
9422
9278
|
backgroundColor: theme.choices.item.backgroundColor.disabled,
|
|
9423
|
-
borderColor: theme.choices.item.disabled.
|
|
9279
|
+
borderColor: theme.choices.item.border.disabled.color,
|
|
9280
|
+
color: theme.choices.item.color.disabled
|
|
9281
|
+
},
|
|
9282
|
+
error: {
|
|
9283
|
+
borderColor: theme.choices.item.border.error.color
|
|
9424
9284
|
},
|
|
9425
9285
|
selected: {
|
|
9426
9286
|
backgroundColor: theme.choices.item.backgroundColor.selected
|
|
@@ -9434,6 +9294,12 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
9434
9294
|
hoverWhenSelected: {
|
|
9435
9295
|
backgroundColor: theme.choices.item.backgroundColor.hoverWhenSelected
|
|
9436
9296
|
}
|
|
9297
|
+
},
|
|
9298
|
+
description: {
|
|
9299
|
+
color: {
|
|
9300
|
+
"default": theme.choices.description.color["default"],
|
|
9301
|
+
error: theme.choices.description.color.error
|
|
9302
|
+
}
|
|
9437
9303
|
}
|
|
9438
9304
|
},
|
|
9439
9305
|
tooltip: {
|
|
@@ -9837,39 +9703,6 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
9837
9703
|
buttonBadge: {
|
|
9838
9704
|
backgroundColor: theme.buttonBadge.backgroundColor
|
|
9839
9705
|
},
|
|
9840
|
-
iconButton: {
|
|
9841
|
-
borderColor: theme.iconButton.borderColor,
|
|
9842
|
-
disabled: {
|
|
9843
|
-
backgroundColor: theme.iconButton.disabled.backgroundColor
|
|
9844
|
-
},
|
|
9845
|
-
black: {
|
|
9846
|
-
pressed: {
|
|
9847
|
-
backgroundColor: theme.iconButton["default"].pressedBackgroundColor
|
|
9848
|
-
}
|
|
9849
|
-
},
|
|
9850
|
-
ghost: {
|
|
9851
|
-
pressed: {
|
|
9852
|
-
backgroundColor: theme.iconButton.ghost.pressedBackgroundColor
|
|
9853
|
-
}
|
|
9854
|
-
},
|
|
9855
|
-
primary: {
|
|
9856
|
-
pressed: {
|
|
9857
|
-
backgroundColor: theme.iconButton.primary.pressedBackgroundColor
|
|
9858
|
-
}
|
|
9859
|
-
},
|
|
9860
|
-
'primary-plain': {
|
|
9861
|
-
pressed: {
|
|
9862
|
-
backgroundColor: theme.iconButton['primary-plain'].pressedBackgroundColor
|
|
9863
|
-
},
|
|
9864
|
-
backgroundColor: theme.iconButton['primary-plain'].backgroundColor
|
|
9865
|
-
},
|
|
9866
|
-
secondary: {
|
|
9867
|
-
pressed: {
|
|
9868
|
-
backgroundColor: theme.iconButton.secondary.pressedBackgroundColor
|
|
9869
|
-
},
|
|
9870
|
-
backgroundColor: theme.iconButton.secondary.backgroundColor
|
|
9871
|
-
}
|
|
9872
|
-
},
|
|
9873
9706
|
highlight: {
|
|
9874
9707
|
regular: {
|
|
9875
9708
|
"default": {
|
|
@@ -10070,9 +9903,6 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
10070
9903
|
highlight: {
|
|
10071
9904
|
borderRadius: theme.highlight.borderRadius
|
|
10072
9905
|
},
|
|
10073
|
-
iconButton: {
|
|
10074
|
-
borderRadius: theme.iconButton.borderRadius
|
|
10075
|
-
},
|
|
10076
9906
|
tag: {
|
|
10077
9907
|
borderRadius: theme.tag.borderRadius
|
|
10078
9908
|
},
|
|
@@ -10196,14 +10026,11 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
10196
10026
|
},
|
|
10197
10027
|
choices: {
|
|
10198
10028
|
item: {
|
|
10199
|
-
|
|
10200
|
-
borderWidth: theme.choices.item.
|
|
10029
|
+
"default": {
|
|
10030
|
+
borderWidth: theme.choices.item.border["default"].width
|
|
10201
10031
|
}
|
|
10202
10032
|
}
|
|
10203
10033
|
},
|
|
10204
|
-
iconButton: {
|
|
10205
|
-
borderWidth: theme.iconButton.borderWidth
|
|
10206
|
-
},
|
|
10207
10034
|
forms: {
|
|
10208
10035
|
input: {
|
|
10209
10036
|
borderWidth: theme.forms.input.borderWidth
|
|
@@ -10389,8 +10216,10 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
10389
10216
|
button: {
|
|
10390
10217
|
minWidth: theme.button.minWidth,
|
|
10391
10218
|
maxWidth: theme.button.maxWidth,
|
|
10392
|
-
|
|
10393
|
-
|
|
10219
|
+
height: {
|
|
10220
|
+
"default": theme.button.height["default"],
|
|
10221
|
+
medium: theme.button.height.medium
|
|
10222
|
+
},
|
|
10394
10223
|
icon: {
|
|
10395
10224
|
"default": {
|
|
10396
10225
|
size: theme.button.icon["default"].size
|
|
@@ -10718,7 +10547,6 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
10718
10547
|
}
|
|
10719
10548
|
},
|
|
10720
10549
|
iconButton: {
|
|
10721
|
-
size: theme.iconButton.width - theme.iconButton.borderWidth,
|
|
10722
10550
|
width: theme.iconButton.width,
|
|
10723
10551
|
height: theme.iconButton.height
|
|
10724
10552
|
},
|
|
@@ -11015,6 +10843,7 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
11015
10843
|
'body-xs': "".concat(theme.typography.types.bodies.configs['body-xs'].fontSize, "px"),
|
|
11016
10844
|
'label-large': "".concat(theme.typography.types.labels.configs['label-large'].fontSize, "px"),
|
|
11017
10845
|
'label-medium': "".concat(theme.typography.types.labels.configs['label-medium'].fontSize, "px"),
|
|
10846
|
+
'label-small': "".concat(theme.typography.types.labels.configs['label-small'].fontSize, "px"),
|
|
11018
10847
|
'content-caps-xxxl': "".concat(theme.typography.types.contentCaps.configs['content-caps-xxxl'].fontSize, "px"),
|
|
11019
10848
|
'content-caps-xxl': "".concat(theme.typography.types.contentCaps.configs['content-caps-xxl'].fontSize, "px"),
|
|
11020
10849
|
'content-caps-xl': "".concat(theme.typography.types.contentCaps.configs['content-caps-xl'].fontSize, "px"),
|
|
@@ -11037,6 +10866,7 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
11037
10866
|
'body-xs': "".concat(theme.typography.types.bodies.configs['body-xs'].lineHeight, "px"),
|
|
11038
10867
|
'label-large': "".concat(theme.typography.types.labels.configs['label-large'].lineHeight, "px"),
|
|
11039
10868
|
'label-medium': "".concat(theme.typography.types.labels.configs['label-medium'].lineHeight, "px"),
|
|
10869
|
+
'label-small': "".concat(theme.typography.types.labels.configs['label-small'].lineHeight, "px"),
|
|
11040
10870
|
'content-caps-xxxl': "".concat(theme.typography.types.contentCaps.configs['content-caps-xxxl'].lineHeight, "px"),
|
|
11041
10871
|
'content-caps-xxl': "".concat(theme.typography.types.contentCaps.configs['content-caps-xxl'].lineHeight, "px"),
|
|
11042
10872
|
'content-caps-xl': "".concat(theme.typography.types.contentCaps.configs['content-caps-xl'].lineHeight, "px"),
|