@ornikar/kitt-universal 25.54.0 → 25.54.1-canary.111977bfdb623207808928fa770ffbe060b3b380.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 +10 -0
- package/dist/definitions/Actions/ActionsItem.d.ts.map +1 -1
- package/dist/definitions/Button/Button.d.ts +2 -0
- package/dist/definitions/Button/Button.d.ts.map +1 -1
- package/dist/definitions/Button/ButtonContent.d.ts +1 -1
- package/dist/definitions/Button/ButtonContent.d.ts.map +1 -1
- package/dist/definitions/ButtonBadge/ButtonBadge.d.ts +7 -0
- package/dist/definitions/ButtonBadge/ButtonBadge.d.ts.map +1 -0
- package/dist/definitions/IconButton/IconButton.d.ts +2 -2
- package/dist/definitions/IconButton/IconButton.d.ts.map +1 -1
- package/dist/definitions/index.d.ts +2 -0
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/native-base/KittNativeBaseProvider.d.ts +21 -0
- package/dist/definitions/native-base/KittNativeBaseProvider.d.ts.map +1 -1
- package/dist/definitions/themes/default.d.ts +1 -0
- package/dist/definitions/themes/default.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/buttonBadge.d.ts +21 -0
- package/dist/definitions/themes/late-ocean/buttonBadge.d.ts.map +1 -0
- package/dist/index-metro.es.android.js +95 -29
- package/dist/index-metro.es.android.js.map +1 -1
- package/dist/index-metro.es.ios.js +95 -29
- package/dist/index-metro.es.ios.js.map +1 -1
- package/dist/index-node-20.10.cjs.js +94 -27
- package/dist/index-node-20.10.cjs.js.map +1 -1
- package/dist/index-node-20.10.cjs.web.js +94 -27
- package/dist/index-node-20.10.cjs.web.js.map +1 -1
- package/dist/index-node-20.10.es.mjs +94 -28
- package/dist/index-node-20.10.es.mjs.map +1 -1
- package/dist/index-node-20.10.es.web.mjs +94 -28
- package/dist/index-node-20.10.es.web.mjs.map +1 -1
- package/dist/index.es.js +103 -38
- package/dist/index.es.js.map +1 -1
- package/dist/index.es.web.js +103 -38
- package/dist/index.es.web.js.map +1 -1
- package/dist/linaria-themes-metro.es.android.js +19 -0
- package/dist/linaria-themes-metro.es.android.js.map +1 -1
- package/dist/linaria-themes-metro.es.ios.js +19 -0
- package/dist/linaria-themes-metro.es.ios.js.map +1 -1
- package/dist/linaria-themes-node-20.10.cjs.js +19 -0
- package/dist/linaria-themes-node-20.10.cjs.js.map +1 -1
- package/dist/linaria-themes-node-20.10.cjs.web.js +19 -0
- package/dist/linaria-themes-node-20.10.cjs.web.js.map +1 -1
- package/dist/linaria-themes-node-20.10.es.mjs +19 -0
- package/dist/linaria-themes-node-20.10.es.mjs.map +1 -1
- package/dist/linaria-themes-node-20.10.es.web.mjs +19 -0
- package/dist/linaria-themes-node-20.10.es.web.mjs.map +1 -1
- package/dist/linaria-themes.es.js +19 -0
- package/dist/linaria-themes.es.js.map +1 -1
- package/dist/linaria-themes.es.web.js +19 -0
- package/dist/linaria-themes.es.web.js.map +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -807,6 +807,24 @@ const button = {
|
|
|
807
807
|
}
|
|
808
808
|
};
|
|
809
809
|
|
|
810
|
+
const buttonBadge = {
|
|
811
|
+
backgroundColor: lateOceanColorPalette['coral.10'],
|
|
812
|
+
dimensions: {
|
|
813
|
+
withBadge: {
|
|
814
|
+
width: 10,
|
|
815
|
+
height: 10
|
|
816
|
+
},
|
|
817
|
+
badgeCount: {
|
|
818
|
+
width: 20,
|
|
819
|
+
height: 20
|
|
820
|
+
}
|
|
821
|
+
},
|
|
822
|
+
borderRadius: {
|
|
823
|
+
withBadge: 5,
|
|
824
|
+
badgeCount: 10
|
|
825
|
+
}
|
|
826
|
+
};
|
|
827
|
+
|
|
810
828
|
const card = {
|
|
811
829
|
borderRadius: 20,
|
|
812
830
|
borderWidth: 2,
|
|
@@ -2522,6 +2540,7 @@ const theme = {
|
|
|
2522
2540
|
forms,
|
|
2523
2541
|
highlight,
|
|
2524
2542
|
icon,
|
|
2543
|
+
buttonBadge,
|
|
2525
2544
|
iconButton,
|
|
2526
2545
|
listItem,
|
|
2527
2546
|
pageLoader,
|
|
@@ -3086,6 +3105,37 @@ Typography.h4 = createHeading(4, 'header4');
|
|
|
3086
3105
|
/** @deprecated use Typography.Header6 */
|
|
3087
3106
|
Typography.h5 = createHeading(5, 'header5');
|
|
3088
3107
|
|
|
3108
|
+
function ButtonBadge({
|
|
3109
|
+
withBadge,
|
|
3110
|
+
badgeCount
|
|
3111
|
+
}) {
|
|
3112
|
+
if (withBadge) {
|
|
3113
|
+
return /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
3114
|
+
height: "kitt.buttonBadge.dimensions.withBadge.height",
|
|
3115
|
+
width: "kitt.buttonBadge.dimensions.withBadge.width",
|
|
3116
|
+
backgroundColor: "kitt.buttonBadge.backgroundColor",
|
|
3117
|
+
borderRadius: "kitt.buttonBadge.borderRadius.withBadge"
|
|
3118
|
+
});
|
|
3119
|
+
}
|
|
3120
|
+
if (badgeCount && badgeCount > 0) {
|
|
3121
|
+
return /*#__PURE__*/jsxRuntime.jsx(VStack, {
|
|
3122
|
+
alignItems: "center",
|
|
3123
|
+
justifyContent: "center",
|
|
3124
|
+
height: "kitt.buttonBadge.dimensions.badgeCount.height",
|
|
3125
|
+
width: "kitt.buttonBadge.dimensions.badgeCount.width",
|
|
3126
|
+
backgroundColor: "kitt.buttonBadge.backgroundColor",
|
|
3127
|
+
borderRadius: "kitt.buttonBadge.borderRadius.badgeCount",
|
|
3128
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
3129
|
+
base: "body-xs",
|
|
3130
|
+
variant: "bold",
|
|
3131
|
+
color: "white",
|
|
3132
|
+
children: (badgeCount || 0) > 5 ? '+5' : badgeCount
|
|
3133
|
+
})
|
|
3134
|
+
});
|
|
3135
|
+
}
|
|
3136
|
+
return null;
|
|
3137
|
+
}
|
|
3138
|
+
|
|
3089
3139
|
function Icon({
|
|
3090
3140
|
icon,
|
|
3091
3141
|
size = 'kitt.icon.defaultSize',
|
|
@@ -3211,6 +3261,8 @@ function ButtonContentChildren({
|
|
|
3211
3261
|
icon,
|
|
3212
3262
|
iconPosition,
|
|
3213
3263
|
innerSpacing,
|
|
3264
|
+
withBadge,
|
|
3265
|
+
badgeCount,
|
|
3214
3266
|
color,
|
|
3215
3267
|
children
|
|
3216
3268
|
}) {
|
|
@@ -3257,6 +3309,12 @@ function ButtonContentChildren({
|
|
|
3257
3309
|
}), icon && iconPosition === 'right' ? /*#__PURE__*/jsxRuntime.jsx(ButtonIcon, {
|
|
3258
3310
|
...buttonIconSharedProps,
|
|
3259
3311
|
icon: icon
|
|
3312
|
+
}) : null, withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
3313
|
+
marginLeft: "kitt.2",
|
|
3314
|
+
children: /*#__PURE__*/jsxRuntime.jsx(ButtonBadge, {
|
|
3315
|
+
withBadge: withBadge,
|
|
3316
|
+
badgeCount: badgeCount
|
|
3317
|
+
})
|
|
3260
3318
|
}) : null]
|
|
3261
3319
|
});
|
|
3262
3320
|
}
|
|
@@ -3440,6 +3498,8 @@ const Button = /*#__PURE__*/React.forwardRef(({
|
|
|
3440
3498
|
testID,
|
|
3441
3499
|
href,
|
|
3442
3500
|
hrefAttrs,
|
|
3501
|
+
withBadge,
|
|
3502
|
+
badgeCount,
|
|
3443
3503
|
accessibilityRole = 'button',
|
|
3444
3504
|
innerSpacing = 'center',
|
|
3445
3505
|
isHoveredInternal,
|
|
@@ -3511,6 +3571,8 @@ const Button = /*#__PURE__*/React.forwardRef(({
|
|
|
3511
3571
|
isDisabled: disabled,
|
|
3512
3572
|
icon: icon,
|
|
3513
3573
|
iconPosition: iconPosition,
|
|
3574
|
+
withBadge: withBadge,
|
|
3575
|
+
badgeCount: badgeCount,
|
|
3514
3576
|
isHovered: isHovered,
|
|
3515
3577
|
isPressed: isPressed,
|
|
3516
3578
|
isFocused: isFocused,
|
|
@@ -3590,6 +3652,8 @@ const ActionsItem = /*#__PURE__*/React.forwardRef(({
|
|
|
3590
3652
|
}, ref) => {
|
|
3591
3653
|
const [isLoading, setIsLoading] = React.useState(false);
|
|
3592
3654
|
const mountedRef = React.useRef(false);
|
|
3655
|
+
// securing the loading state with a ref to avoid user action between rerenders
|
|
3656
|
+
const loadingRef = React.useRef(false);
|
|
3593
3657
|
|
|
3594
3658
|
// effect just for tracking mounted state, as onPress can unmount the ActionButton
|
|
3595
3659
|
React.useEffect(() => {
|
|
@@ -3607,15 +3671,18 @@ const ActionsItem = /*#__PURE__*/React.forwardRef(({
|
|
|
3607
3671
|
icon: isLoading ? /*#__PURE__*/jsxRuntime.jsx(LoaderIcon, {}) : icon,
|
|
3608
3672
|
onPress: e => {
|
|
3609
3673
|
(async () => {
|
|
3610
|
-
if (!onPress) return;
|
|
3674
|
+
if (!onPress || loadingRef.current) return;
|
|
3611
3675
|
setIsLoading(true);
|
|
3676
|
+
loadingRef.current = true;
|
|
3612
3677
|
try {
|
|
3613
3678
|
await onPress(e);
|
|
3614
3679
|
if (mountedRef.current) {
|
|
3615
3680
|
setIsLoading(false);
|
|
3681
|
+
loadingRef.current = false;
|
|
3616
3682
|
}
|
|
3617
3683
|
} catch (error) {
|
|
3618
3684
|
if (mountedRef.current) {
|
|
3685
|
+
loadingRef.current = false;
|
|
3619
3686
|
setIsLoading(false);
|
|
3620
3687
|
}
|
|
3621
3688
|
throw error;
|
|
@@ -8494,7 +8561,7 @@ function IconButton({
|
|
|
8494
8561
|
ariaLabel,
|
|
8495
8562
|
accessibilityRole = 'button',
|
|
8496
8563
|
withBadge,
|
|
8497
|
-
|
|
8564
|
+
badgeCount,
|
|
8498
8565
|
isHoveredInternal,
|
|
8499
8566
|
isPressedInternal,
|
|
8500
8567
|
isFocusedInternal,
|
|
@@ -8557,32 +8624,13 @@ function IconButton({
|
|
|
8557
8624
|
icon: icon
|
|
8558
8625
|
})
|
|
8559
8626
|
})]
|
|
8560
|
-
}), withBadge ? /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
8561
|
-
height: "10px",
|
|
8562
|
-
width: "10px",
|
|
8563
|
-
backgroundColor: lateOceanColorPalette['coral.10'],
|
|
8564
|
-
borderRadius: "kitt.iconButton.borderRadius",
|
|
8627
|
+
}), withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
8565
8628
|
position: "absolute",
|
|
8566
|
-
top:
|
|
8567
|
-
right:
|
|
8568
|
-
|
|
8569
|
-
|
|
8570
|
-
|
|
8571
|
-
backgroundColor: lateOceanColorPalette['coral.10'],
|
|
8572
|
-
borderRadius: "kitt.iconButton.borderRadius",
|
|
8573
|
-
position: "absolute",
|
|
8574
|
-
top: "-6px",
|
|
8575
|
-
right: "-6px",
|
|
8576
|
-
children: /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
8577
|
-
alignItems: "center",
|
|
8578
|
-
justifyContent: "center",
|
|
8579
|
-
marginTop: "2px",
|
|
8580
|
-
children: /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
8581
|
-
base: "body-xs",
|
|
8582
|
-
variant: "bold",
|
|
8583
|
-
color: "white",
|
|
8584
|
-
children: bagdeCount > 5 ? '+5' : bagdeCount
|
|
8585
|
-
})
|
|
8629
|
+
top: withBadge ? '1px' : '-6px',
|
|
8630
|
+
right: withBadge ? '1px' : '-6px',
|
|
8631
|
+
children: /*#__PURE__*/jsxRuntime.jsx(ButtonBadge, {
|
|
8632
|
+
withBadge: withBadge,
|
|
8633
|
+
badgeCount: badgeCount
|
|
8586
8634
|
})
|
|
8587
8635
|
}) : null]
|
|
8588
8636
|
});
|
|
@@ -9574,6 +9622,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
9574
9622
|
backgroundColor: theme.skeleton.backgroundColor,
|
|
9575
9623
|
flareColor: theme.skeleton.flareColor
|
|
9576
9624
|
},
|
|
9625
|
+
buttonBadge: {
|
|
9626
|
+
backgroundColor: theme.buttonBadge.backgroundColor
|
|
9627
|
+
},
|
|
9577
9628
|
iconButton: {
|
|
9578
9629
|
borderColor: theme.iconButton.borderColor,
|
|
9579
9630
|
disabled: {
|
|
@@ -9762,6 +9813,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
9762
9813
|
button: {
|
|
9763
9814
|
borderRadius: theme.button.borderRadius
|
|
9764
9815
|
},
|
|
9816
|
+
buttonBadge: {
|
|
9817
|
+
borderRadius: theme.buttonBadge.borderRadius
|
|
9818
|
+
},
|
|
9765
9819
|
card: {
|
|
9766
9820
|
borderRadius: theme.card.borderRadius
|
|
9767
9821
|
},
|
|
@@ -10141,6 +10195,18 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
10141
10195
|
maxWidth: theme.button.maxWidth,
|
|
10142
10196
|
minHeight: theme.button.minHeight
|
|
10143
10197
|
},
|
|
10198
|
+
buttonBadge: {
|
|
10199
|
+
dimensions: {
|
|
10200
|
+
withBadge: {
|
|
10201
|
+
width: theme.buttonBadge.dimensions.withBadge.width,
|
|
10202
|
+
height: theme.buttonBadge.dimensions.withBadge.height
|
|
10203
|
+
},
|
|
10204
|
+
badgeCount: {
|
|
10205
|
+
width: theme.buttonBadge.dimensions.badgeCount.width,
|
|
10206
|
+
height: theme.buttonBadge.dimensions.badgeCount.height
|
|
10207
|
+
}
|
|
10208
|
+
}
|
|
10209
|
+
},
|
|
10144
10210
|
icon: theme.icon,
|
|
10145
10211
|
cardModal: {
|
|
10146
10212
|
header: {
|
|
@@ -13981,6 +14047,7 @@ exports.Autocomplete = Autocomplete;
|
|
|
13981
14047
|
exports.Avatar = Avatar;
|
|
13982
14048
|
exports.BottomSheet = BottomSheet;
|
|
13983
14049
|
exports.Button = Button;
|
|
14050
|
+
exports.ButtonBadge = ButtonBadge;
|
|
13984
14051
|
exports.CardModal = CardModal;
|
|
13985
14052
|
exports.Center = Center;
|
|
13986
14053
|
exports.Checkbox = Checkbox;
|