@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
|
@@ -787,6 +787,24 @@ const button = {
|
|
|
787
787
|
}
|
|
788
788
|
};
|
|
789
789
|
|
|
790
|
+
const buttonBadge = {
|
|
791
|
+
backgroundColor: lateOceanColorPalette['coral.10'],
|
|
792
|
+
dimensions: {
|
|
793
|
+
withBadge: {
|
|
794
|
+
width: 10,
|
|
795
|
+
height: 10
|
|
796
|
+
},
|
|
797
|
+
badgeCount: {
|
|
798
|
+
width: 20,
|
|
799
|
+
height: 20
|
|
800
|
+
}
|
|
801
|
+
},
|
|
802
|
+
borderRadius: {
|
|
803
|
+
withBadge: 5,
|
|
804
|
+
badgeCount: 10
|
|
805
|
+
}
|
|
806
|
+
};
|
|
807
|
+
|
|
790
808
|
const card = {
|
|
791
809
|
borderRadius: 20,
|
|
792
810
|
borderWidth: 2,
|
|
@@ -2502,6 +2520,7 @@ const theme = {
|
|
|
2502
2520
|
forms,
|
|
2503
2521
|
highlight,
|
|
2504
2522
|
icon,
|
|
2523
|
+
buttonBadge,
|
|
2505
2524
|
iconButton,
|
|
2506
2525
|
listItem,
|
|
2507
2526
|
pageLoader,
|
|
@@ -3110,6 +3129,37 @@ Typography.h4 = createHeading(4, 'header4');
|
|
|
3110
3129
|
/** @deprecated use Typography.Header6 */
|
|
3111
3130
|
Typography.h5 = createHeading(5, 'header5');
|
|
3112
3131
|
|
|
3132
|
+
function ButtonBadge({
|
|
3133
|
+
withBadge,
|
|
3134
|
+
badgeCount
|
|
3135
|
+
}) {
|
|
3136
|
+
if (withBadge) {
|
|
3137
|
+
return /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
3138
|
+
height: "kitt.buttonBadge.dimensions.withBadge.height",
|
|
3139
|
+
width: "kitt.buttonBadge.dimensions.withBadge.width",
|
|
3140
|
+
backgroundColor: "kitt.buttonBadge.backgroundColor",
|
|
3141
|
+
borderRadius: "kitt.buttonBadge.borderRadius.withBadge"
|
|
3142
|
+
});
|
|
3143
|
+
}
|
|
3144
|
+
if (badgeCount && badgeCount > 0) {
|
|
3145
|
+
return /*#__PURE__*/jsxRuntime.jsx(VStack, {
|
|
3146
|
+
alignItems: "center",
|
|
3147
|
+
justifyContent: "center",
|
|
3148
|
+
height: "kitt.buttonBadge.dimensions.badgeCount.height",
|
|
3149
|
+
width: "kitt.buttonBadge.dimensions.badgeCount.width",
|
|
3150
|
+
backgroundColor: "kitt.buttonBadge.backgroundColor",
|
|
3151
|
+
borderRadius: "kitt.buttonBadge.borderRadius.badgeCount",
|
|
3152
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
3153
|
+
base: "body-xs",
|
|
3154
|
+
variant: "bold",
|
|
3155
|
+
color: "white",
|
|
3156
|
+
children: (badgeCount || 0) > 5 ? '+5' : badgeCount
|
|
3157
|
+
})
|
|
3158
|
+
});
|
|
3159
|
+
}
|
|
3160
|
+
return null;
|
|
3161
|
+
}
|
|
3162
|
+
|
|
3113
3163
|
function Icon({
|
|
3114
3164
|
icon,
|
|
3115
3165
|
size = 'kitt.icon.defaultSize',
|
|
@@ -3235,6 +3285,8 @@ function ButtonContentChildren({
|
|
|
3235
3285
|
icon,
|
|
3236
3286
|
iconPosition,
|
|
3237
3287
|
innerSpacing,
|
|
3288
|
+
withBadge,
|
|
3289
|
+
badgeCount,
|
|
3238
3290
|
color,
|
|
3239
3291
|
children
|
|
3240
3292
|
}) {
|
|
@@ -3281,6 +3333,12 @@ function ButtonContentChildren({
|
|
|
3281
3333
|
}), icon && iconPosition === 'right' ? /*#__PURE__*/jsxRuntime.jsx(ButtonIcon, {
|
|
3282
3334
|
...buttonIconSharedProps,
|
|
3283
3335
|
icon: icon
|
|
3336
|
+
}) : null, withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
3337
|
+
marginLeft: "kitt.2",
|
|
3338
|
+
children: /*#__PURE__*/jsxRuntime.jsx(ButtonBadge, {
|
|
3339
|
+
withBadge: withBadge,
|
|
3340
|
+
badgeCount: badgeCount
|
|
3341
|
+
})
|
|
3284
3342
|
}) : null]
|
|
3285
3343
|
});
|
|
3286
3344
|
}
|
|
@@ -3425,6 +3483,8 @@ const Button = /*#__PURE__*/react.forwardRef(({
|
|
|
3425
3483
|
testID,
|
|
3426
3484
|
href,
|
|
3427
3485
|
hrefAttrs,
|
|
3486
|
+
withBadge,
|
|
3487
|
+
badgeCount,
|
|
3428
3488
|
accessibilityRole = 'button',
|
|
3429
3489
|
innerSpacing = 'center',
|
|
3430
3490
|
isHoveredInternal,
|
|
@@ -3493,6 +3553,8 @@ const Button = /*#__PURE__*/react.forwardRef(({
|
|
|
3493
3553
|
isDisabled: disabled,
|
|
3494
3554
|
icon: icon,
|
|
3495
3555
|
iconPosition: iconPosition,
|
|
3556
|
+
withBadge: withBadge,
|
|
3557
|
+
badgeCount: badgeCount,
|
|
3496
3558
|
isHovered: isHovered,
|
|
3497
3559
|
isPressed: isPressed,
|
|
3498
3560
|
isFocused: isFocused,
|
|
@@ -3546,6 +3608,8 @@ const ActionsItem = /*#__PURE__*/react.forwardRef(({
|
|
|
3546
3608
|
}, ref) => {
|
|
3547
3609
|
const [isLoading, setIsLoading] = react.useState(false);
|
|
3548
3610
|
const mountedRef = react.useRef(false);
|
|
3611
|
+
// securing the loading state with a ref to avoid user action between rerenders
|
|
3612
|
+
const loadingRef = react.useRef(false);
|
|
3549
3613
|
|
|
3550
3614
|
// effect just for tracking mounted state, as onPress can unmount the ActionButton
|
|
3551
3615
|
react.useEffect(() => {
|
|
@@ -3563,15 +3627,18 @@ const ActionsItem = /*#__PURE__*/react.forwardRef(({
|
|
|
3563
3627
|
icon: isLoading ? /*#__PURE__*/jsxRuntime.jsx(LoaderIcon, {}) : icon,
|
|
3564
3628
|
onPress: e => {
|
|
3565
3629
|
(async () => {
|
|
3566
|
-
if (!onPress) return;
|
|
3630
|
+
if (!onPress || loadingRef.current) return;
|
|
3567
3631
|
setIsLoading(true);
|
|
3632
|
+
loadingRef.current = true;
|
|
3568
3633
|
try {
|
|
3569
3634
|
await onPress(e);
|
|
3570
3635
|
if (mountedRef.current) {
|
|
3571
3636
|
setIsLoading(false);
|
|
3637
|
+
loadingRef.current = false;
|
|
3572
3638
|
}
|
|
3573
3639
|
} catch (error) {
|
|
3574
3640
|
if (mountedRef.current) {
|
|
3641
|
+
loadingRef.current = false;
|
|
3575
3642
|
setIsLoading(false);
|
|
3576
3643
|
}
|
|
3577
3644
|
throw error;
|
|
@@ -7636,7 +7703,7 @@ function IconButton({
|
|
|
7636
7703
|
ariaLabel,
|
|
7637
7704
|
accessibilityRole = 'button',
|
|
7638
7705
|
withBadge,
|
|
7639
|
-
|
|
7706
|
+
badgeCount,
|
|
7640
7707
|
isHoveredInternal,
|
|
7641
7708
|
isPressedInternal,
|
|
7642
7709
|
isFocusedInternal,
|
|
@@ -7696,32 +7763,13 @@ function IconButton({
|
|
|
7696
7763
|
icon: icon
|
|
7697
7764
|
})
|
|
7698
7765
|
})]
|
|
7699
|
-
}), withBadge ? /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
7700
|
-
height: "10px",
|
|
7701
|
-
width: "10px",
|
|
7702
|
-
backgroundColor: lateOceanColorPalette['coral.10'],
|
|
7703
|
-
borderRadius: "kitt.iconButton.borderRadius",
|
|
7704
|
-
position: "absolute",
|
|
7705
|
-
top: "1px",
|
|
7706
|
-
right: "1px"
|
|
7707
|
-
}) : null, !withBadge && bagdeCount && bagdeCount > 0 ? /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
7708
|
-
height: "20px",
|
|
7709
|
-
width: "20px",
|
|
7710
|
-
backgroundColor: lateOceanColorPalette['coral.10'],
|
|
7711
|
-
borderRadius: "kitt.iconButton.borderRadius",
|
|
7766
|
+
}), withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
7712
7767
|
position: "absolute",
|
|
7713
|
-
top:
|
|
7714
|
-
right:
|
|
7715
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
7716
|
-
|
|
7717
|
-
|
|
7718
|
-
marginTop: "2px",
|
|
7719
|
-
children: /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
7720
|
-
base: "body-xs",
|
|
7721
|
-
variant: "bold",
|
|
7722
|
-
color: "white",
|
|
7723
|
-
children: bagdeCount > 5 ? '+5' : bagdeCount
|
|
7724
|
-
})
|
|
7768
|
+
top: withBadge ? '1px' : '-6px',
|
|
7769
|
+
right: withBadge ? '1px' : '-6px',
|
|
7770
|
+
children: /*#__PURE__*/jsxRuntime.jsx(ButtonBadge, {
|
|
7771
|
+
withBadge: withBadge,
|
|
7772
|
+
badgeCount: badgeCount
|
|
7725
7773
|
})
|
|
7726
7774
|
}) : null]
|
|
7727
7775
|
});
|
|
@@ -8796,6 +8844,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
8796
8844
|
backgroundColor: theme.skeleton.backgroundColor,
|
|
8797
8845
|
flareColor: theme.skeleton.flareColor
|
|
8798
8846
|
},
|
|
8847
|
+
buttonBadge: {
|
|
8848
|
+
backgroundColor: theme.buttonBadge.backgroundColor
|
|
8849
|
+
},
|
|
8799
8850
|
iconButton: {
|
|
8800
8851
|
borderColor: theme.iconButton.borderColor,
|
|
8801
8852
|
disabled: {
|
|
@@ -8984,6 +9035,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
8984
9035
|
button: {
|
|
8985
9036
|
borderRadius: theme.button.borderRadius
|
|
8986
9037
|
},
|
|
9038
|
+
buttonBadge: {
|
|
9039
|
+
borderRadius: theme.buttonBadge.borderRadius
|
|
9040
|
+
},
|
|
8987
9041
|
card: {
|
|
8988
9042
|
borderRadius: theme.card.borderRadius
|
|
8989
9043
|
},
|
|
@@ -9363,6 +9417,18 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
9363
9417
|
maxWidth: theme.button.maxWidth,
|
|
9364
9418
|
minHeight: theme.button.minHeight
|
|
9365
9419
|
},
|
|
9420
|
+
buttonBadge: {
|
|
9421
|
+
dimensions: {
|
|
9422
|
+
withBadge: {
|
|
9423
|
+
width: theme.buttonBadge.dimensions.withBadge.width,
|
|
9424
|
+
height: theme.buttonBadge.dimensions.withBadge.height
|
|
9425
|
+
},
|
|
9426
|
+
badgeCount: {
|
|
9427
|
+
width: theme.buttonBadge.dimensions.badgeCount.width,
|
|
9428
|
+
height: theme.buttonBadge.dimensions.badgeCount.height
|
|
9429
|
+
}
|
|
9430
|
+
}
|
|
9431
|
+
},
|
|
9366
9432
|
icon: theme.icon,
|
|
9367
9433
|
cardModal: {
|
|
9368
9434
|
header: {
|
|
@@ -13088,6 +13154,7 @@ exports.Autocomplete = Autocomplete;
|
|
|
13088
13154
|
exports.Avatar = Avatar;
|
|
13089
13155
|
exports.BottomSheet = BottomSheet;
|
|
13090
13156
|
exports.Button = Button;
|
|
13157
|
+
exports.ButtonBadge = ButtonBadge;
|
|
13091
13158
|
exports.CardModal = CardModal;
|
|
13092
13159
|
exports.Center = Center;
|
|
13093
13160
|
exports.Checkbox = Checkbox;
|