@ornikar/kitt-universal 4.2.0 → 4.4.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/dist/definitions/Button/AnimatedButtonPressable.web.d.ts +1 -1
- package/dist/definitions/ListItem/ListItem.d.ts.map +1 -1
- package/dist/definitions/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/definitions/forms/Checkbox/Checkbox.d.ts +13 -0
- package/dist/definitions/forms/Checkbox/Checkbox.d.ts.map +1 -0
- package/dist/definitions/forms/InputEmail/InputEmail.d.ts +7 -0
- package/dist/definitions/forms/InputEmail/InputEmail.d.ts.map +1 -0
- package/dist/definitions/forms/InputPhone/InputPhone.d.ts +7 -0
- package/dist/definitions/forms/InputPhone/InputPhone.d.ts.map +1 -0
- package/dist/definitions/forms/InputText/InputText.d.ts.map +1 -1
- package/dist/definitions/forms/InputText/InputTextContainer.d.ts +8 -0
- package/dist/definitions/forms/InputText/InputTextContainer.d.ts.map +1 -0
- package/dist/definitions/forms/InputText/InputTextContainer.web.d.ts +11 -0
- package/dist/definitions/forms/InputText/InputTextContainer.web.d.ts.map +1 -0
- package/dist/definitions/index.d.ts +6 -0
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/themes/default.d.ts +31 -93
- package/dist/definitions/themes/default.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/{avatarLateOceanTheme.d.ts → avatar.d.ts} +2 -2
- package/dist/definitions/themes/late-ocean/avatar.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/button.d.ts +6 -6
- package/dist/definitions/themes/late-ocean/card.d.ts +13 -0
- package/dist/definitions/themes/late-ocean/card.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/checkbox.d.ts +13 -0
- package/dist/definitions/themes/late-ocean/checkbox.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/{colorsLateOceanTheme.d.ts → colors.d.ts} +2 -2
- package/dist/definitions/themes/late-ocean/colors.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/{feedbackMessage.d.ts → feedback.d.ts} +1 -1
- package/dist/definitions/themes/late-ocean/feedback.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/forms.d.ts +13 -17
- package/dist/definitions/themes/late-ocean/forms.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/{fullScreenModalLateOceanTheme.d.ts → fullScreenModal.d.ts} +2 -2
- package/dist/definitions/themes/late-ocean/fullScreenModal.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/input.d.ts +9 -4
- package/dist/definitions/themes/late-ocean/input.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/inputField.d.ts +5 -0
- package/dist/definitions/themes/late-ocean/inputField.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/listItem.d.ts +8 -0
- package/dist/definitions/themes/late-ocean/listItem.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/{radioLateOceanTheme.d.ts → radio.d.ts} +6 -5
- package/dist/definitions/themes/late-ocean/radio.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/shadows.d.ts +4 -0
- package/dist/definitions/themes/late-ocean/shadows.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/{skeletonTheme.d.ts → skeleton.d.ts} +2 -2
- package/dist/definitions/themes/late-ocean/skeleton.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/tag.d.ts +18 -0
- package/dist/definitions/themes/late-ocean/tag.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/{typographyLateOceanTheme.d.ts → typography.d.ts} +5 -4
- package/dist/definitions/themes/late-ocean/typography.d.ts.map +1 -0
- package/dist/definitions/themes/palettes/lateOceanColorPalette.d.ts +1 -0
- package/dist/definitions/themes/palettes/lateOceanColorPalette.d.ts.map +1 -1
- package/dist/definitions/typography/Typography.d.ts +2 -2
- package/dist/definitions/typography/Typography.d.ts.map +1 -1
- package/dist/definitions/typography/TypographyEmoji.d.ts.map +1 -1
- package/dist/index-browser-all.es.android.js +1127 -1020
- package/dist/index-browser-all.es.android.js.map +1 -1
- package/dist/index-browser-all.es.ios.js +1127 -1020
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +1127 -1020
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +1159 -1024
- package/dist/index-browser-all.es.web.js.map +1 -1
- package/dist/index-node-14.17.cjs.js +983 -876
- package/dist/index-node-14.17.cjs.js.map +1 -1
- package/dist/index-node-14.17.cjs.web.css +1 -0
- package/dist/index-node-14.17.cjs.web.js +1125 -989
- package/dist/index-node-14.17.cjs.web.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.android.js +120 -100
- package/dist/linaria-themes-browser-all.es.android.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.ios.js +120 -100
- package/dist/linaria-themes-browser-all.es.ios.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.js +120 -100
- package/dist/linaria-themes-browser-all.es.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.web.js +120 -100
- package/dist/linaria-themes-browser-all.es.web.js.map +1 -1
- package/dist/linaria-themes-node-14.17.cjs.js +120 -100
- package/dist/linaria-themes-node-14.17.cjs.js.map +1 -1
- package/dist/linaria-themes-node-14.17.cjs.web.js +120 -100
- package/dist/linaria-themes-node-14.17.cjs.web.js.map +1 -1
- package/dist/styles.css +1 -0
- package/dist/tsbuildinfo +1 -1
- package/package.json +4 -4
- package/dist/definitions/themes/late-ocean/avatarLateOceanTheme.d.ts.map +0 -1
- package/dist/definitions/themes/late-ocean/cardLateOceanTheme.d.ts +0 -18
- package/dist/definitions/themes/late-ocean/cardLateOceanTheme.d.ts.map +0 -1
- package/dist/definitions/themes/late-ocean/colorsLateOceanTheme.d.ts.map +0 -1
- package/dist/definitions/themes/late-ocean/feedbackMessage.d.ts.map +0 -1
- package/dist/definitions/themes/late-ocean/fullScreenModalLateOceanTheme.d.ts.map +0 -1
- package/dist/definitions/themes/late-ocean/inputFieldLateOceanTheme.d.ts +0 -5
- package/dist/definitions/themes/late-ocean/inputFieldLateOceanTheme.d.ts.map +0 -1
- package/dist/definitions/themes/late-ocean/listItemLateOceanTheme.d.ts +0 -7
- package/dist/definitions/themes/late-ocean/listItemLateOceanTheme.d.ts.map +0 -1
- package/dist/definitions/themes/late-ocean/radioLateOceanTheme.d.ts.map +0 -1
- package/dist/definitions/themes/late-ocean/shadowsLateOceanTheme.d.ts +0 -4
- package/dist/definitions/themes/late-ocean/shadowsLateOceanTheme.d.ts.map +0 -1
- package/dist/definitions/themes/late-ocean/skeletonTheme.d.ts.map +0 -1
- package/dist/definitions/themes/late-ocean/tagLateOceanTheme.d.ts +0 -41
- package/dist/definitions/themes/late-ocean/tagLateOceanTheme.d.ts.map +0 -1
- package/dist/definitions/themes/late-ocean/typographyLateOceanTheme.d.ts.map +0 -1
|
@@ -181,8 +181,8 @@ const StyledTypography = /*#__PURE__*/styled__default.Text.withConfig({
|
|
|
181
181
|
/* type */
|
|
182
182
|
${!$typeForCurrentWindowSize ? '' : `
|
|
183
183
|
font-family: ${$isHeader ? headers.fontFamily[$variant] : bodies.fontFamily[$variant]};
|
|
184
|
-
font-size: ${$isHeader ? headers.configs[$typeForCurrentWindowSize][typeConfigKey].fontSize : bodies.configs[$typeForCurrentWindowSize][typeConfigKey].fontSize};
|
|
185
|
-
line-height: ${$isHeader ? headers.configs[$typeForCurrentWindowSize][typeConfigKey].lineHeight : bodies.configs[$typeForCurrentWindowSize][typeConfigKey].lineHeight};
|
|
184
|
+
font-size: ${$isHeader ? headers.configs[$typeForCurrentWindowSize][typeConfigKey].fontSize : bodies.configs[$typeForCurrentWindowSize][typeConfigKey].fontSize}px;
|
|
185
|
+
line-height: ${$isHeader ? headers.configs[$typeForCurrentWindowSize][typeConfigKey].lineHeight : bodies.configs[$typeForCurrentWindowSize][typeConfigKey].lineHeight}px;
|
|
186
186
|
`}
|
|
187
187
|
|
|
188
188
|
/* variant */
|
|
@@ -328,7 +328,7 @@ const StyledAvatarView = /*#__PURE__*/styled__default.View.withConfig({
|
|
|
328
328
|
$size
|
|
329
329
|
}) => {
|
|
330
330
|
if ($isRound) return `${$size / 2}px`;
|
|
331
|
-
return theme.kitt.avatar.borderRadius
|
|
331
|
+
return `${theme.kitt.avatar.borderRadius}px`;
|
|
332
332
|
}, ({
|
|
333
333
|
theme,
|
|
334
334
|
$isLight
|
|
@@ -408,7 +408,7 @@ const StyledPressable = /*#__PURE__*/styled__default.Pressable.withConfig({
|
|
|
408
408
|
const StyledAnimatedView = /*#__PURE__*/styled__default(Animated__default.View).withConfig({
|
|
409
409
|
displayName: "AnimatedButtonPressable__StyledAnimatedView",
|
|
410
410
|
componentId: "kitt-universal__sc-175vyve-1"
|
|
411
|
-
})(["border-radius:", ";"], ({
|
|
411
|
+
})(["border-radius:", "px;"], ({
|
|
412
412
|
theme
|
|
413
413
|
}) => theme.kitt.button.borderRadius);
|
|
414
414
|
const AnimatedButtonPressable = /*#__PURE__*/react.forwardRef(({
|
|
@@ -501,12 +501,12 @@ const AnimatedButtonPressable = /*#__PURE__*/react.forwardRef(({
|
|
|
501
501
|
const BaseStyledButtonPressable = /*#__PURE__*/styled__default.View.withConfig({
|
|
502
502
|
displayName: "BaseStyledButtonPressable",
|
|
503
503
|
componentId: "kitt-universal__sc-4k8lse-0"
|
|
504
|
-
})(["position:relative;min-width:", ";max-width:", ";width:", ";min-height:", ";border-radius:", ";flex-direction:row;align-items:center;justify-content:center;align-self:flex-start;background-color:", ";padding:", ";"], ({
|
|
504
|
+
})(["position:relative;min-width:", "px;max-width:", ";width:", ";min-height:", "px;border-radius:", "px;flex-direction:row;align-items:center;justify-content:center;align-self:flex-start;background-color:", ";padding:", ";"], ({
|
|
505
505
|
theme
|
|
506
506
|
}) => theme.kitt.button.minWidth, ({
|
|
507
507
|
theme,
|
|
508
508
|
$isStretch
|
|
509
|
-
}) => $isStretch ? '100%' : theme.kitt.button.maxWidth
|
|
509
|
+
}) => $isStretch ? '100%' : `${theme.kitt.button.maxWidth}px`, ({
|
|
510
510
|
$isStretch
|
|
511
511
|
}) => $isStretch ? '100%' : 'auto', ({
|
|
512
512
|
theme
|
|
@@ -746,14 +746,14 @@ function ButtonContent({
|
|
|
746
746
|
const StyledDisabled = /*#__PURE__*/styled__default.View.withConfig({
|
|
747
747
|
displayName: "StyledDisabled",
|
|
748
748
|
componentId: "kitt-universal__sc-16irf7q-0"
|
|
749
|
-
})(["position:absolute;top:0;left:0;right:0;bottom:0;border:", ";border-radius:", ";"], ({
|
|
749
|
+
})(["position:absolute;top:0;left:0;right:0;bottom:0;border:", ";border-radius:", "px;"], ({
|
|
750
750
|
theme
|
|
751
751
|
}) => {
|
|
752
752
|
const {
|
|
753
753
|
borderWidth,
|
|
754
754
|
disabled
|
|
755
755
|
} = theme.kitt.button;
|
|
756
|
-
return `${borderWidth.disabled} solid ${disabled.borderColor}`;
|
|
756
|
+
return `${borderWidth.disabled}px solid ${disabled.borderColor}`;
|
|
757
757
|
}, ({
|
|
758
758
|
theme
|
|
759
759
|
}) => theme.kitt.button.borderRadius);
|
|
@@ -804,12 +804,12 @@ const Button = /*#__PURE__*/react.forwardRef(({
|
|
|
804
804
|
const Container$5 = /*#__PURE__*/styled__default.View.withConfig({
|
|
805
805
|
displayName: "Card__Container",
|
|
806
806
|
componentId: "kitt-universal__sc-1n9psug-0"
|
|
807
|
-
})(["background-color:", ";padding:", ";border-radius:", ";border-width:", ";border-color:", ";"], ({
|
|
807
|
+
})(["background-color:", ";padding:", "px;border-radius:", "px;border-width:", "px;border-color:", ";"], ({
|
|
808
808
|
theme,
|
|
809
809
|
type
|
|
810
810
|
}) => theme.kitt.card[type].backgroundColor, ({
|
|
811
811
|
theme
|
|
812
|
-
}) => theme.kitt.
|
|
812
|
+
}) => theme.kitt.spacing * 4, ({
|
|
813
813
|
theme
|
|
814
814
|
}) => theme.kitt.card.borderRadius, ({
|
|
815
815
|
theme
|
|
@@ -896,168 +896,694 @@ function ExternalLink({
|
|
|
896
896
|
});
|
|
897
897
|
}
|
|
898
898
|
|
|
899
|
-
const
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
899
|
+
const lateOceanColorPalette = {
|
|
900
|
+
lateOcean: '#4C34E0',
|
|
901
|
+
lateOceanLight1: '#705DE6',
|
|
902
|
+
lateOceanLight2: '#9485EC',
|
|
903
|
+
lateOceanLight3: '#D6BAF9',
|
|
904
|
+
warmEmbrace: '#F4D3CE',
|
|
905
|
+
warmEmbraceLight1: '#FFEDE6',
|
|
906
|
+
black1000: '#000000',
|
|
907
|
+
black800: '#2C293D',
|
|
908
|
+
black555: '#737373',
|
|
909
|
+
black200: '#CCCCCC',
|
|
910
|
+
black100: '#E5E5E5',
|
|
911
|
+
black50: '#F2F2F2',
|
|
912
|
+
black25: '#F9F9F9',
|
|
913
|
+
white: '#FFFFFF',
|
|
914
|
+
viride: '#38836D',
|
|
915
|
+
englishVermillon: '#D44148',
|
|
916
|
+
goldCrayola: '#F8C583',
|
|
917
|
+
aero: '#89BDDD',
|
|
918
|
+
transparent: 'transparent',
|
|
919
|
+
moonPurple: '#DBD6F9',
|
|
920
|
+
moonPurpleLight1: '#EDEBFC'
|
|
921
|
+
};
|
|
903
922
|
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
923
|
+
const colors = {
|
|
924
|
+
primary: lateOceanColorPalette.lateOcean,
|
|
925
|
+
primaryLight: lateOceanColorPalette.lateOceanLight1,
|
|
926
|
+
accent: lateOceanColorPalette.warmEmbrace,
|
|
927
|
+
accentLight: lateOceanColorPalette.warmEmbraceLight1,
|
|
928
|
+
success: lateOceanColorPalette.viride,
|
|
929
|
+
correct: lateOceanColorPalette.viride,
|
|
930
|
+
danger: lateOceanColorPalette.englishVermillon,
|
|
931
|
+
info: lateOceanColorPalette.aero,
|
|
932
|
+
warning: lateOceanColorPalette.goldCrayola,
|
|
933
|
+
separator: lateOceanColorPalette.black100,
|
|
934
|
+
hover: lateOceanColorPalette.black100,
|
|
935
|
+
black: lateOceanColorPalette.black1000,
|
|
936
|
+
uiBackground: lateOceanColorPalette.black25,
|
|
937
|
+
uiBackgroundLight: lateOceanColorPalette.white,
|
|
938
|
+
transparent: lateOceanColorPalette.transparent,
|
|
939
|
+
disabled: lateOceanColorPalette.black50,
|
|
940
|
+
overlay: {
|
|
941
|
+
dark: 'rgba(41, 48, 51, 0.25)',
|
|
942
|
+
light: 'rgba(255, 255, 255, 0.90)',
|
|
943
|
+
fullscreenLoader: 'rgba(0, 0, 0, 0.25)'
|
|
907
944
|
}
|
|
908
945
|
};
|
|
909
946
|
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
}
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
color: getColorFromState(state),
|
|
918
|
-
testID: testID,
|
|
919
|
-
children: children
|
|
920
|
-
});
|
|
921
|
-
}
|
|
922
|
-
|
|
923
|
-
const FieldContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
924
|
-
displayName: "InputField__FieldContainer",
|
|
925
|
-
componentId: "kitt-universal__sc-13fkixs-0"
|
|
926
|
-
})(["padding:5px 0 10px;"]);
|
|
927
|
-
const FeedbackContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
928
|
-
displayName: "InputField__FeedbackContainer",
|
|
929
|
-
componentId: "kitt-universal__sc-13fkixs-1"
|
|
930
|
-
})(["", ";"], ({
|
|
931
|
-
theme
|
|
932
|
-
}) => theme.responsive.ifWindowSizeMatches({
|
|
933
|
-
minWidth: KittBreakpoints.SMALL
|
|
934
|
-
}, 'padding-top: 10px', 'padding-top: 5px'));
|
|
935
|
-
const FieldLabelContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
936
|
-
displayName: "InputField__FieldLabelContainer",
|
|
937
|
-
componentId: "kitt-universal__sc-13fkixs-2"
|
|
938
|
-
})(["flex-direction:row;align-items:center;padding-bottom:", "px;"], ({
|
|
939
|
-
theme
|
|
940
|
-
}) => theme.kitt.forms.inputField.labelContainerPaddingBottom);
|
|
941
|
-
const LabelContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
942
|
-
displayName: "InputField__LabelContainer",
|
|
943
|
-
componentId: "kitt-universal__sc-13fkixs-3"
|
|
944
|
-
})(["margin-right:", "px;"], ({
|
|
945
|
-
theme
|
|
946
|
-
}) => theme.kitt.forms.inputField.iconMarginLeft);
|
|
947
|
-
function InputField({
|
|
948
|
-
label,
|
|
949
|
-
labelFeedback,
|
|
950
|
-
input,
|
|
951
|
-
feedback
|
|
952
|
-
}) {
|
|
953
|
-
return /*#__PURE__*/jsxRuntime.jsxs(FieldContainer, {
|
|
954
|
-
children: [label ? /*#__PURE__*/jsxRuntime.jsxs(FieldLabelContainer, {
|
|
955
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(LabelContainer, {
|
|
956
|
-
children: label
|
|
957
|
-
}), labelFeedback]
|
|
958
|
-
}) : null, input, feedback ? /*#__PURE__*/jsxRuntime.jsx(FeedbackContainer, {
|
|
959
|
-
children: feedback
|
|
960
|
-
}) : null]
|
|
961
|
-
});
|
|
962
|
-
}
|
|
963
|
-
|
|
964
|
-
function getIconColor(state, disabled) {
|
|
965
|
-
if (disabled) return 'black-light';
|
|
966
|
-
|
|
967
|
-
switch (state) {
|
|
968
|
-
case 'invalid':
|
|
969
|
-
return 'danger';
|
|
970
|
-
|
|
971
|
-
case 'valid':
|
|
972
|
-
return 'success';
|
|
973
|
-
|
|
974
|
-
default:
|
|
975
|
-
return undefined;
|
|
947
|
+
const avatar = {
|
|
948
|
+
borderRadius: 10,
|
|
949
|
+
default: {
|
|
950
|
+
backgroundColor: colors.primary
|
|
951
|
+
},
|
|
952
|
+
light: {
|
|
953
|
+
backgroundColor: lateOceanColorPalette.black100
|
|
976
954
|
}
|
|
977
|
-
}
|
|
978
|
-
|
|
979
|
-
function InputIcon({
|
|
980
|
-
icon,
|
|
981
|
-
state,
|
|
982
|
-
disabled
|
|
983
|
-
}) {
|
|
984
|
-
const theme = /*#__PURE__*/styled.useTheme();
|
|
985
|
-
const color = getIconColor(state, disabled);
|
|
986
|
-
return /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
|
|
987
|
-
color: color,
|
|
988
|
-
icon: icon,
|
|
989
|
-
size: theme.kitt.forms.input.icon.size
|
|
990
|
-
});
|
|
991
|
-
}
|
|
992
|
-
|
|
993
|
-
function InputPressable({ ...props
|
|
994
|
-
}) {
|
|
995
|
-
return /*#__PURE__*/jsxRuntime.jsx(reactNative.Pressable, { ...props
|
|
996
|
-
});
|
|
997
|
-
}
|
|
955
|
+
};
|
|
998
956
|
|
|
999
|
-
const
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
}
|
|
1018
|
-
|
|
1019
|
-
|
|
957
|
+
const button = {
|
|
958
|
+
borderRadius: 30,
|
|
959
|
+
borderWidth: {
|
|
960
|
+
disabled: 2,
|
|
961
|
+
focus: 3
|
|
962
|
+
},
|
|
963
|
+
minHeight: 40,
|
|
964
|
+
minWidth: 40,
|
|
965
|
+
maxWidth: 335,
|
|
966
|
+
scale: {
|
|
967
|
+
base: {
|
|
968
|
+
default: 1,
|
|
969
|
+
hover: 0.95,
|
|
970
|
+
active: 0.95
|
|
971
|
+
},
|
|
972
|
+
medium: {
|
|
973
|
+
hover: 1.05
|
|
974
|
+
}
|
|
975
|
+
},
|
|
976
|
+
contentPadding: {
|
|
977
|
+
default: '8px 16px 7px',
|
|
978
|
+
large: '12px 24px 11px',
|
|
979
|
+
disabled: '6px 14px 5px'
|
|
980
|
+
},
|
|
981
|
+
transition: {
|
|
982
|
+
duration: '200ms',
|
|
983
|
+
timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
|
|
984
|
+
},
|
|
985
|
+
default: {
|
|
986
|
+
backgroundColor: 'rgba(0, 0, 0, 0.05)',
|
|
987
|
+
pressedBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
988
|
+
hoverBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
989
|
+
focusBorderColor: 'rgba(0, 0, 0, 0.1)'
|
|
990
|
+
},
|
|
991
|
+
primary: {
|
|
992
|
+
backgroundColor: colors.primary,
|
|
993
|
+
pressedBackgroundColor: colors.primaryLight,
|
|
994
|
+
hoverBackgroundColor: colors.primaryLight,
|
|
995
|
+
focusBorderColor: 'rgba(76, 52, 224, 0.2)'
|
|
996
|
+
},
|
|
997
|
+
white: {
|
|
998
|
+
backgroundColor: 'rgba(255, 255, 255, 0.05)',
|
|
999
|
+
pressedBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
1000
|
+
hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
1001
|
+
focusBorderColor: 'rgba(255, 255, 255, 0.1)'
|
|
1002
|
+
},
|
|
1003
|
+
subtle: {
|
|
1004
|
+
backgroundColor: colors.transparent,
|
|
1005
|
+
pressedBackgroundColor: colors.transparent,
|
|
1006
|
+
hoverBackgroundColor: colors.transparent,
|
|
1007
|
+
focusBorderColor: 'rgba(76, 52, 224, 0.2)',
|
|
1008
|
+
color: colors.primary,
|
|
1009
|
+
hoverColor: 'rgba(76, 52, 224, 0.8)',
|
|
1010
|
+
activeColor: 'rgba(76, 52, 224, 0.8)'
|
|
1011
|
+
},
|
|
1012
|
+
'subtle-dark': {
|
|
1013
|
+
backgroundColor: colors.transparent,
|
|
1014
|
+
pressedBackgroundColor: colors.transparent,
|
|
1015
|
+
hoverBackgroundColor: colors.transparent,
|
|
1016
|
+
focusBorderColor: 'rgba(0, 0, 0, 0.1)',
|
|
1017
|
+
color: colors.black,
|
|
1018
|
+
hoverColor: 'rgba(0, 0, 0, 0.8)',
|
|
1019
|
+
activeColor: 'rgba(0, 0, 0, 0.8)'
|
|
1020
|
+
},
|
|
1021
|
+
disabled: {
|
|
1022
|
+
backgroundColor: colors.disabled,
|
|
1023
|
+
pressedBackgroundColor: colors.disabled,
|
|
1024
|
+
hoverBackgroundColor: colors.disabled,
|
|
1025
|
+
focusBorderColor: lateOceanColorPalette.black100,
|
|
1026
|
+
borderColor: lateOceanColorPalette.black100
|
|
1027
|
+
}
|
|
1028
|
+
};
|
|
1020
1029
|
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1030
|
+
const card = {
|
|
1031
|
+
borderRadius: 20,
|
|
1032
|
+
borderWidth: 2,
|
|
1033
|
+
primary: {
|
|
1034
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1035
|
+
borderColor: colors.primary
|
|
1036
|
+
},
|
|
1037
|
+
secondary: {
|
|
1038
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1039
|
+
borderColor: colors.separator
|
|
1040
|
+
},
|
|
1041
|
+
subtle: {
|
|
1042
|
+
backgroundColor: lateOceanColorPalette.black50,
|
|
1043
|
+
borderColor: colors.separator
|
|
1044
|
+
}
|
|
1045
|
+
};
|
|
1031
1046
|
|
|
1032
|
-
const
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
}
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
}
|
|
1039
|
-
|
|
1040
|
-
|
|
1047
|
+
const feedbackMessage = {
|
|
1048
|
+
danger: {
|
|
1049
|
+
backgroundColor: colors.danger
|
|
1050
|
+
},
|
|
1051
|
+
success: {
|
|
1052
|
+
backgroundColor: colors.success
|
|
1053
|
+
},
|
|
1054
|
+
info: {
|
|
1055
|
+
backgroundColor: colors.info
|
|
1056
|
+
},
|
|
1057
|
+
warning: {
|
|
1058
|
+
backgroundColor: colors.warning
|
|
1041
1059
|
}
|
|
1060
|
+
};
|
|
1042
1061
|
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1062
|
+
const checkbox = {
|
|
1063
|
+
borderWidth: 2,
|
|
1064
|
+
borderRadius: 5,
|
|
1065
|
+
height: 20,
|
|
1066
|
+
width: 20,
|
|
1067
|
+
iconSize: 14,
|
|
1068
|
+
borderColor: colors.separator,
|
|
1069
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1070
|
+
checkedBorderColor: colors.primary,
|
|
1071
|
+
checkedBackgroundColor: colors.primary,
|
|
1072
|
+
markColor: colors.uiBackgroundLight
|
|
1073
|
+
};
|
|
1074
|
+
|
|
1075
|
+
const calcLineHeight = (fontSize, lineHeightMultiplier) => Math.round(fontSize * lineHeightMultiplier);
|
|
1076
|
+
const createTypographyTypeConfig = (lineHeightMultiplier, baseAndSmallFontSize, mediumAndWideFontSize) => ({
|
|
1077
|
+
baseAndSmall: {
|
|
1078
|
+
fontSize: baseAndSmallFontSize,
|
|
1079
|
+
lineHeight: calcLineHeight(baseAndSmallFontSize, lineHeightMultiplier)
|
|
1080
|
+
},
|
|
1081
|
+
mediumAndWide: {
|
|
1082
|
+
fontSize: mediumAndWideFontSize,
|
|
1083
|
+
lineHeight: calcLineHeight(mediumAndWideFontSize, lineHeightMultiplier)
|
|
1084
|
+
}
|
|
1085
|
+
});
|
|
1086
|
+
const typography = {
|
|
1087
|
+
colors: {
|
|
1088
|
+
black: lateOceanColorPalette.black1000,
|
|
1089
|
+
'black-anthracite': lateOceanColorPalette.black800,
|
|
1090
|
+
'black-light': lateOceanColorPalette.black555,
|
|
1091
|
+
white: lateOceanColorPalette.white,
|
|
1092
|
+
'white-light': lateOceanColorPalette.white,
|
|
1093
|
+
primary: lateOceanColorPalette.lateOcean,
|
|
1094
|
+
'primary-light': lateOceanColorPalette.lateOceanLight1,
|
|
1095
|
+
accent: lateOceanColorPalette.warmEmbrace,
|
|
1096
|
+
success: lateOceanColorPalette.viride,
|
|
1097
|
+
danger: lateOceanColorPalette.englishVermillon
|
|
1098
|
+
},
|
|
1099
|
+
types: {
|
|
1100
|
+
headers: {
|
|
1101
|
+
fontFamily: {
|
|
1102
|
+
regular: reactNative.Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold',
|
|
1103
|
+
bold: reactNative.Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold'
|
|
1104
|
+
},
|
|
1105
|
+
fontWeight: 400,
|
|
1106
|
+
fontStyle: 'normal',
|
|
1107
|
+
configs: {
|
|
1108
|
+
// also known as xxlarge
|
|
1109
|
+
header1: createTypographyTypeConfig(1.3, 38, 62),
|
|
1110
|
+
// also known as xlarge
|
|
1111
|
+
header2: createTypographyTypeConfig(1.3, 32, 48),
|
|
1112
|
+
// also known as medium
|
|
1113
|
+
header3: createTypographyTypeConfig(1.3, 24, 36),
|
|
1114
|
+
// also known as xsmall
|
|
1115
|
+
header4: createTypographyTypeConfig(1.3, 18, 24),
|
|
1116
|
+
// also known as xxsmall
|
|
1117
|
+
header5: createTypographyTypeConfig(1.3, 18, 18)
|
|
1118
|
+
}
|
|
1119
|
+
},
|
|
1120
|
+
bodies: {
|
|
1121
|
+
fontFamily: {
|
|
1122
|
+
regular: reactNative.Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans',
|
|
1123
|
+
bold: reactNative.Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans-Bold'
|
|
1124
|
+
},
|
|
1125
|
+
fontWeight: {
|
|
1126
|
+
regular: 400,
|
|
1127
|
+
bold: 700
|
|
1128
|
+
},
|
|
1129
|
+
fontStyle: {
|
|
1130
|
+
regular: 'normal',
|
|
1131
|
+
bold: 'normal'
|
|
1132
|
+
},
|
|
1133
|
+
configs: {
|
|
1134
|
+
'body-large': createTypographyTypeConfig(1.6, 18, 24),
|
|
1135
|
+
'body-medium': createTypographyTypeConfig(1.6, 18, 18),
|
|
1136
|
+
body: createTypographyTypeConfig(1.6, 16, 16),
|
|
1137
|
+
'body-small': createTypographyTypeConfig(1.6, 14, 14),
|
|
1138
|
+
'body-xsmall': createTypographyTypeConfig(1.6, 12, 12)
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
},
|
|
1142
|
+
link: {
|
|
1143
|
+
disabledColor: lateOceanColorPalette.black200
|
|
1144
|
+
}
|
|
1145
|
+
};
|
|
1146
|
+
|
|
1147
|
+
const inputStatesStyle = {
|
|
1148
|
+
default: {
|
|
1149
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1150
|
+
borderColor: colors.separator,
|
|
1151
|
+
color: 'black'
|
|
1152
|
+
},
|
|
1153
|
+
pending: {
|
|
1154
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1155
|
+
borderColor: colors.separator,
|
|
1156
|
+
color: 'black'
|
|
1157
|
+
},
|
|
1158
|
+
valid: {
|
|
1159
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1160
|
+
borderColor: lateOceanColorPalette.black100,
|
|
1161
|
+
color: 'black'
|
|
1162
|
+
},
|
|
1163
|
+
hover: {
|
|
1164
|
+
borderColor: lateOceanColorPalette.black200,
|
|
1165
|
+
color: 'black'
|
|
1166
|
+
},
|
|
1167
|
+
focus: {
|
|
1168
|
+
borderColor: colors.primary,
|
|
1169
|
+
color: 'black'
|
|
1170
|
+
},
|
|
1171
|
+
disabled: {
|
|
1172
|
+
backgroundColor: colors.disabled,
|
|
1173
|
+
borderColor: colors.separator,
|
|
1174
|
+
color: 'black-light'
|
|
1175
|
+
},
|
|
1176
|
+
invalid: {
|
|
1177
|
+
borderColor: colors.separator,
|
|
1178
|
+
color: 'black'
|
|
1179
|
+
}
|
|
1180
|
+
};
|
|
1181
|
+
const input = {
|
|
1182
|
+
color: {
|
|
1183
|
+
selection: colors.primary,
|
|
1184
|
+
placeholder: typography.colors['black-light']
|
|
1185
|
+
},
|
|
1186
|
+
borderWidth: 2,
|
|
1187
|
+
borderRadius: 10,
|
|
1188
|
+
icon: {
|
|
1189
|
+
size: 20
|
|
1190
|
+
},
|
|
1191
|
+
padding: {
|
|
1192
|
+
default: '5px 16px',
|
|
1193
|
+
iOSSingleLine: '7px 16px'
|
|
1194
|
+
},
|
|
1195
|
+
transition: {
|
|
1196
|
+
property: 'border-color',
|
|
1197
|
+
duration: '200ms',
|
|
1198
|
+
timingFunction: 'ease-in-out'
|
|
1199
|
+
},
|
|
1200
|
+
states: inputStatesStyle
|
|
1201
|
+
};
|
|
1202
|
+
|
|
1203
|
+
const inputField = {
|
|
1204
|
+
labelContainerPaddingBottom: 5,
|
|
1205
|
+
iconMarginLeft: 6
|
|
1206
|
+
};
|
|
1207
|
+
|
|
1208
|
+
const radio = {
|
|
1209
|
+
size: 18,
|
|
1210
|
+
unchecked: {
|
|
1211
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1212
|
+
borderWidth: 2,
|
|
1213
|
+
borderColor: lateOceanColorPalette.black200
|
|
1214
|
+
},
|
|
1215
|
+
checked: {
|
|
1216
|
+
backgroundColor: colors.primary,
|
|
1217
|
+
innerSize: 5,
|
|
1218
|
+
innerBackgroundColor: colors.uiBackgroundLight
|
|
1219
|
+
},
|
|
1220
|
+
disabled: {
|
|
1221
|
+
backgroundColor: colors.disabled,
|
|
1222
|
+
borderColor: colors.separator
|
|
1223
|
+
}
|
|
1224
|
+
};
|
|
1225
|
+
|
|
1226
|
+
const textArea = {
|
|
1227
|
+
minHeight: 120
|
|
1228
|
+
};
|
|
1229
|
+
|
|
1230
|
+
const forms = {
|
|
1231
|
+
input,
|
|
1232
|
+
radio,
|
|
1233
|
+
inputField,
|
|
1234
|
+
textArea,
|
|
1235
|
+
checkbox
|
|
1236
|
+
};
|
|
1237
|
+
|
|
1238
|
+
const fullScreenModal = {
|
|
1239
|
+
header: {
|
|
1240
|
+
paddingVertical: 12,
|
|
1241
|
+
paddingHorizontal: 16,
|
|
1242
|
+
borderColor: lateOceanColorPalette.black100
|
|
1243
|
+
}
|
|
1244
|
+
};
|
|
1245
|
+
|
|
1246
|
+
const iconButton = {
|
|
1247
|
+
backgroundColor: 'transparent',
|
|
1248
|
+
width: 40,
|
|
1249
|
+
height: 40,
|
|
1250
|
+
borderRadius: 20,
|
|
1251
|
+
borderWidth: 2,
|
|
1252
|
+
borderColor: 'transparent',
|
|
1253
|
+
transition: {
|
|
1254
|
+
property: 'all',
|
|
1255
|
+
duration: '200ms',
|
|
1256
|
+
timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1);'
|
|
1257
|
+
},
|
|
1258
|
+
scale: {
|
|
1259
|
+
base: {
|
|
1260
|
+
default: 1,
|
|
1261
|
+
hover: 0.95,
|
|
1262
|
+
active: 0.95
|
|
1263
|
+
},
|
|
1264
|
+
medium: {
|
|
1265
|
+
hover: 1.05
|
|
1266
|
+
}
|
|
1267
|
+
},
|
|
1268
|
+
disabled: {
|
|
1269
|
+
scale: 1,
|
|
1270
|
+
backgroundColor: button.disabled.backgroundColor,
|
|
1271
|
+
borderColor: button.disabled.borderColor
|
|
1272
|
+
},
|
|
1273
|
+
default: {
|
|
1274
|
+
pressedBackgroundColor: button.default.pressedBackgroundColor
|
|
1275
|
+
},
|
|
1276
|
+
white: {
|
|
1277
|
+
pressedBackgroundColor: button.white.hoverBackgroundColor
|
|
1278
|
+
}
|
|
1279
|
+
};
|
|
1280
|
+
|
|
1281
|
+
const listItem = {
|
|
1282
|
+
padding: '12px 16px',
|
|
1283
|
+
borderColor: colors.separator,
|
|
1284
|
+
borderWidth: 1,
|
|
1285
|
+
innerMargin: 8
|
|
1286
|
+
};
|
|
1287
|
+
|
|
1288
|
+
const shadows = {
|
|
1289
|
+
medium: '0px 10px 20px rgba(41, 48, 51, 0.25)'
|
|
1290
|
+
};
|
|
1291
|
+
|
|
1292
|
+
const skeleton = {
|
|
1293
|
+
backgroundColor: lateOceanColorPalette.black100,
|
|
1294
|
+
flareColor: lateOceanColorPalette.black200,
|
|
1295
|
+
animationDuration: 1000
|
|
1296
|
+
};
|
|
1297
|
+
|
|
1298
|
+
const tag = {
|
|
1299
|
+
borderRadius: 10,
|
|
1300
|
+
padding: '2px 12px',
|
|
1301
|
+
primary: {
|
|
1302
|
+
fill: {
|
|
1303
|
+
backgroundColor: lateOceanColorPalette.moonPurpleLight1,
|
|
1304
|
+
borderWidth: 0,
|
|
1305
|
+
borderColor: colors.transparent
|
|
1306
|
+
},
|
|
1307
|
+
outline: {
|
|
1308
|
+
backgroundColor: colors.transparent,
|
|
1309
|
+
borderWidth: 1,
|
|
1310
|
+
borderColor: colors.primary
|
|
1311
|
+
}
|
|
1312
|
+
},
|
|
1313
|
+
default: {
|
|
1314
|
+
fill: {
|
|
1315
|
+
backgroundColor: lateOceanColorPalette.black50,
|
|
1316
|
+
borderWidth: 0,
|
|
1317
|
+
borderColor: colors.transparent
|
|
1318
|
+
},
|
|
1319
|
+
outline: {
|
|
1320
|
+
backgroundColor: colors.transparent,
|
|
1321
|
+
borderWidth: 1,
|
|
1322
|
+
borderColor: colors.black
|
|
1323
|
+
}
|
|
1324
|
+
},
|
|
1325
|
+
danger: {
|
|
1326
|
+
fill: {
|
|
1327
|
+
backgroundColor: lateOceanColorPalette.warmEmbrace,
|
|
1328
|
+
borderWidth: 0,
|
|
1329
|
+
borderColor: colors.transparent
|
|
1330
|
+
},
|
|
1331
|
+
outline: {
|
|
1332
|
+
backgroundColor: colors.transparent,
|
|
1333
|
+
borderWidth: 1,
|
|
1334
|
+
borderColor: colors.danger
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
};
|
|
1338
|
+
|
|
1339
|
+
const tooltip = {
|
|
1340
|
+
backgroundColor: colors.black,
|
|
1341
|
+
borderRadius: 10,
|
|
1342
|
+
opacity: 0.95,
|
|
1343
|
+
horizontalPadding: 16,
|
|
1344
|
+
verticalPadding: 4,
|
|
1345
|
+
floatingPadding: 8
|
|
1346
|
+
};
|
|
1347
|
+
|
|
1348
|
+
const breakpoints = {
|
|
1349
|
+
values: {
|
|
1350
|
+
base: 0,
|
|
1351
|
+
small: 480,
|
|
1352
|
+
medium: 768,
|
|
1353
|
+
large: 1024,
|
|
1354
|
+
wide: 1280
|
|
1355
|
+
},
|
|
1356
|
+
min: {
|
|
1357
|
+
smallBreakpoint: 'min-width: 480px',
|
|
1358
|
+
mediumBreakpoint: 'min-width: 768px',
|
|
1359
|
+
largeBreakpoint: 'min-width: 1024px',
|
|
1360
|
+
wideBreakpoint: 'min-width: 1280px'
|
|
1361
|
+
},
|
|
1362
|
+
max: {
|
|
1363
|
+
smallBreakpoint: 'max-width: 479px',
|
|
1364
|
+
mediumBreakpoint: 'max-width: 767px',
|
|
1365
|
+
largeBreakpoint: 'max-width: 1023px',
|
|
1366
|
+
wideBreakpoint: 'max-width: 1279px'
|
|
1367
|
+
}
|
|
1368
|
+
}; // eslint-disable-next-line unicorn/expiring-todo-comments
|
|
1369
|
+
// TODO : seperate brand color usage definition from proper theme definition and add typings - https://ornikar.atlassian.net/browse/CME-156
|
|
1370
|
+
|
|
1371
|
+
const theme = {
|
|
1372
|
+
spacing: 4,
|
|
1373
|
+
colors,
|
|
1374
|
+
palettes: {
|
|
1375
|
+
lateOcean: lateOceanColorPalette
|
|
1376
|
+
},
|
|
1377
|
+
avatar,
|
|
1378
|
+
button,
|
|
1379
|
+
card,
|
|
1380
|
+
feedbackMessage,
|
|
1381
|
+
forms,
|
|
1382
|
+
typography,
|
|
1383
|
+
tag,
|
|
1384
|
+
shadows,
|
|
1385
|
+
fullScreenModal,
|
|
1386
|
+
iconButton,
|
|
1387
|
+
listItem,
|
|
1388
|
+
tooltip,
|
|
1389
|
+
skeleton,
|
|
1390
|
+
breakpoints
|
|
1391
|
+
};
|
|
1392
|
+
|
|
1393
|
+
function matchWindowSize({
|
|
1394
|
+
width,
|
|
1395
|
+
height
|
|
1396
|
+
}, {
|
|
1397
|
+
minWidth,
|
|
1398
|
+
maxWidth,
|
|
1399
|
+
minHeight,
|
|
1400
|
+
maxHeight
|
|
1401
|
+
}) {
|
|
1402
|
+
const hasWidthMatched = width ? (!minWidth || width >= minWidth) && (!maxWidth || width <= maxWidth) : true;
|
|
1403
|
+
const hasHeightMatched = height ? (!minHeight || height >= minHeight) && (!maxHeight || height <= maxHeight) : true;
|
|
1404
|
+
return hasWidthMatched && hasHeightMatched;
|
|
1405
|
+
}
|
|
1406
|
+
function useMatchWindowSize(options) {
|
|
1407
|
+
const {
|
|
1408
|
+
width,
|
|
1409
|
+
height
|
|
1410
|
+
} = reactNative.useWindowDimensions();
|
|
1411
|
+
return matchWindowSize({
|
|
1412
|
+
width,
|
|
1413
|
+
height
|
|
1414
|
+
}, options);
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
// eslint-disable-next-line no-restricted-imports
|
|
1418
|
+
function createWindowSizeHelper(dimensions) {
|
|
1419
|
+
return {
|
|
1420
|
+
matchWindowSize: options => matchWindowSize(dimensions, options),
|
|
1421
|
+
ifWindowSizeMatches: (options, valueIfTrue, valueIfFalse) => matchWindowSize(dimensions, options) ? valueIfTrue : valueIfFalse,
|
|
1422
|
+
mapWindowWidth: (...widthList) => {
|
|
1423
|
+
if ((process.env.NODE_ENV !== "production")) {
|
|
1424
|
+
widthList.slice(1).forEach(([minWidth], index) => {
|
|
1425
|
+
const previousMinWidth = widthList[index][0];
|
|
1426
|
+
|
|
1427
|
+
if (previousMinWidth > minWidth) {
|
|
1428
|
+
throw new Error(`mapWindowWidth: sort your values to be mobile first. ${minWidth} is < ${previousMinWidth}, so ${minWidth} should be before ${previousMinWidth}.`);
|
|
1429
|
+
}
|
|
1430
|
+
});
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
const found = widthList.find(([minWidth, value]) => matchWindowSize(dimensions, {
|
|
1434
|
+
minWidth: Number(minWidth)
|
|
1435
|
+
}));
|
|
1436
|
+
if (!found) return null;
|
|
1437
|
+
return found[1];
|
|
1438
|
+
}
|
|
1439
|
+
};
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
function useKittTheme() {
|
|
1443
|
+
const dimensions = reactNative.useWindowDimensions();
|
|
1444
|
+
return react.useMemo(() => {
|
|
1445
|
+
return {
|
|
1446
|
+
kitt: theme,
|
|
1447
|
+
responsive: createWindowSizeHelper(dimensions)
|
|
1448
|
+
};
|
|
1449
|
+
}, [dimensions]);
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
const CheckboxAndLabelPressableWrapper = /*#__PURE__*/styled__default.Pressable.withConfig({
|
|
1453
|
+
displayName: "Checkbox__CheckboxAndLabelPressableWrapper",
|
|
1454
|
+
componentId: "kitt-universal__sc-1sav1n6-0"
|
|
1455
|
+
})(["display:flex;flex-direction:row;align-items:center;"]);
|
|
1456
|
+
const CheckboxContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
1457
|
+
displayName: "Checkbox__CheckboxContainer",
|
|
1458
|
+
componentId: "kitt-universal__sc-1sav1n6-1"
|
|
1459
|
+
})(["display:flex;flex-direction:row;align-items:center;justify-content:center;height:", "px;width:", "px;position:relative;border-radius:", "px;", " margin-right:", ";"], ({
|
|
1460
|
+
theme
|
|
1461
|
+
}) => theme.kitt.forms.checkbox.height, ({
|
|
1462
|
+
theme
|
|
1463
|
+
}) => theme.kitt.forms.checkbox.width, ({
|
|
1464
|
+
theme
|
|
1465
|
+
}) => theme.kitt.forms.checkbox.borderRadius, ({
|
|
1466
|
+
$isChecked,
|
|
1467
|
+
theme
|
|
1468
|
+
}) => {
|
|
1469
|
+
const {
|
|
1470
|
+
checkedBackgroundColor,
|
|
1471
|
+
checkedBorderColor,
|
|
1472
|
+
borderColor,
|
|
1473
|
+
borderWidth,
|
|
1474
|
+
backgroundColor
|
|
1475
|
+
} = theme.kitt.forms.checkbox;
|
|
1476
|
+
|
|
1477
|
+
if ($isChecked) {
|
|
1478
|
+
return styled.css(["background-color:", ";border:", ";"], checkedBackgroundColor, `${borderWidth}px solid ${checkedBorderColor}`);
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
return styled.css(["background-color:", ";border:", ";"], backgroundColor, `${borderWidth}px solid ${borderColor}`);
|
|
1482
|
+
}, ({
|
|
1483
|
+
theme,
|
|
1484
|
+
$hasLabel
|
|
1485
|
+
}) => {
|
|
1486
|
+
if (!$hasLabel) return '0px';
|
|
1487
|
+
return `${theme.kitt.spacing * 2.5}px;`;
|
|
1488
|
+
});
|
|
1489
|
+
function Checkbox({
|
|
1490
|
+
onChange,
|
|
1491
|
+
onBlur,
|
|
1492
|
+
onFocus,
|
|
1493
|
+
value,
|
|
1494
|
+
hitSlop = 40,
|
|
1495
|
+
id,
|
|
1496
|
+
children
|
|
1497
|
+
}) {
|
|
1498
|
+
const theme = useKittTheme();
|
|
1499
|
+
return /*#__PURE__*/jsxRuntime.jsxs(CheckboxAndLabelPressableWrapper, {
|
|
1500
|
+
accessibilityRole: "checkbox",
|
|
1501
|
+
accessibilityState: {
|
|
1502
|
+
checked: value
|
|
1503
|
+
},
|
|
1504
|
+
hitSlop: hitSlop,
|
|
1505
|
+
onPress: e => {
|
|
1506
|
+
if (onFocus) onFocus(e);
|
|
1507
|
+
if (onChange) onChange(e);
|
|
1508
|
+
if (onBlur) onBlur(e);
|
|
1509
|
+
},
|
|
1510
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(CheckboxContainer, {
|
|
1511
|
+
$isChecked: value,
|
|
1512
|
+
$hasLabel: !!children,
|
|
1513
|
+
testID: id,
|
|
1514
|
+
children: value ? /*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
1515
|
+
align: "center",
|
|
1516
|
+
color: theme.kitt.forms.checkbox.markColor,
|
|
1517
|
+
size: theme.kitt.forms.checkbox.iconSize,
|
|
1518
|
+
icon: /*#__PURE__*/jsxRuntime.jsx(kittIcons.CheckboxMark, {})
|
|
1519
|
+
}) : null
|
|
1520
|
+
}), children]
|
|
1521
|
+
});
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1524
|
+
const styledTextInputMixin = /*#__PURE__*/styled.css(["background-color:", ";border-width:", "px;border-radius:", "px;border-color:", ";font-size:", ";color:", ";font-family:", ";"], ({
|
|
1525
|
+
theme,
|
|
1526
|
+
$state
|
|
1527
|
+
}) => $state === 'disabled' ? theme.kitt.forms.input.states.disabled.backgroundColor : theme.kitt.forms.input.states.default.backgroundColor, ({
|
|
1528
|
+
theme
|
|
1529
|
+
}) => theme.kitt.forms.input.borderWidth, ({
|
|
1530
|
+
theme
|
|
1531
|
+
}) => theme.kitt.forms.input.borderRadius, ({
|
|
1532
|
+
theme,
|
|
1533
|
+
$state
|
|
1534
|
+
}) => theme.kitt.forms.input.states[$state].borderColor, ({
|
|
1535
|
+
theme
|
|
1536
|
+
}) => {
|
|
1537
|
+
const typeConfigKey = getTypographyTypeConfigKey(theme);
|
|
1538
|
+
return `${theme.kitt.typography.types.bodies.configs.body[typeConfigKey].fontSize}px`;
|
|
1539
|
+
}, ({
|
|
1540
|
+
theme,
|
|
1541
|
+
$state
|
|
1542
|
+
}) => theme.kitt.typography.colors[theme.kitt.forms.input.states[$state].color], ({
|
|
1543
|
+
theme
|
|
1544
|
+
}) => theme.kitt.typography.types.bodies.fontFamily.regular);
|
|
1545
|
+
|
|
1546
|
+
function getInputUIState({
|
|
1547
|
+
isFocused,
|
|
1548
|
+
isDisabled,
|
|
1549
|
+
formState
|
|
1550
|
+
}) {
|
|
1551
|
+
if (isDisabled) return 'disabled';
|
|
1552
|
+
if (isFocused) return 'focus';
|
|
1553
|
+
if (formState === 'invalid') return 'invalid';
|
|
1554
|
+
return 'default';
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
const InputTextContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
1558
|
+
displayName: "InputTextContainer",
|
|
1559
|
+
componentId: "kitt-universal__sc-8j6fjq-0"
|
|
1560
|
+
})(["position:relative;"]);
|
|
1561
|
+
|
|
1562
|
+
const StyledTextInput = /*#__PURE__*/styled__default(reactNative.TextInput).withConfig({
|
|
1563
|
+
displayName: "InputText__StyledTextInput",
|
|
1564
|
+
componentId: "kitt-universal__sc-uke279-0"
|
|
1565
|
+
})(["", " padding:", ";line-height:", ";width:100%;min-height:", "px;"], styledTextInputMixin, ({
|
|
1566
|
+
theme,
|
|
1567
|
+
multiline
|
|
1568
|
+
}) => {
|
|
1569
|
+
if (!multiline && reactNative.Platform.OS === 'ios') {
|
|
1570
|
+
return theme.kitt.forms.input.padding.iOSSingleLine;
|
|
1571
|
+
}
|
|
1572
|
+
|
|
1573
|
+
return theme.kitt.forms.input.padding.default;
|
|
1574
|
+
}, ({
|
|
1575
|
+
theme,
|
|
1576
|
+
multiline
|
|
1047
1577
|
}) => {
|
|
1048
1578
|
if (!multiline && reactNative.Platform.OS === 'ios') return 0;
|
|
1049
1579
|
const typeConfigKey = getTypographyTypeConfigKey(theme);
|
|
1050
|
-
return theme.kitt.typography.types.bodies.configs.body[typeConfigKey].lineHeight
|
|
1580
|
+
return `${theme.kitt.typography.types.bodies.configs.body[typeConfigKey].lineHeight}px`;
|
|
1051
1581
|
}, ({
|
|
1052
1582
|
$minHeight
|
|
1053
1583
|
}) => $minHeight);
|
|
1054
|
-
const InputTextContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
1055
|
-
displayName: "InputText__InputTextContainer",
|
|
1056
|
-
componentId: "kitt-universal__sc-uke279-1"
|
|
1057
|
-
})(["position:relative;"]);
|
|
1058
1584
|
const RightInputContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
1059
1585
|
displayName: "InputText__RightInputContainer",
|
|
1060
|
-
componentId: "kitt-universal__sc-uke279-
|
|
1586
|
+
componentId: "kitt-universal__sc-uke279-1"
|
|
1061
1587
|
})(["position:absolute;right:0;top:0;bottom:0;justify-content:center;padding:10px;"]);
|
|
1062
1588
|
const InputText = /*#__PURE__*/react.forwardRef(({
|
|
1063
1589
|
id,
|
|
@@ -1075,39 +1601,149 @@ const InputText = /*#__PURE__*/react.forwardRef(({
|
|
|
1075
1601
|
...props
|
|
1076
1602
|
}, ref) => {
|
|
1077
1603
|
const theme = /*#__PURE__*/styled.useTheme();
|
|
1078
|
-
const [isFocused, setIsFocused] = react.useState(false);
|
|
1079
|
-
const state = internalForceState || getInputUIState({
|
|
1080
|
-
isFocused,
|
|
1081
|
-
isDisabled: disabled,
|
|
1082
|
-
formState
|
|
1604
|
+
const [isFocused, setIsFocused] = react.useState(false);
|
|
1605
|
+
const state = internalForceState || getInputUIState({
|
|
1606
|
+
isFocused,
|
|
1607
|
+
isDisabled: disabled,
|
|
1608
|
+
formState
|
|
1609
|
+
});
|
|
1610
|
+
return /*#__PURE__*/jsxRuntime.jsxs(InputTextContainer, {
|
|
1611
|
+
$isDisabled: disabled,
|
|
1612
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(StyledTextInput, {
|
|
1613
|
+
ref: ref,
|
|
1614
|
+
nativeID: id,
|
|
1615
|
+
editable: !disabled,
|
|
1616
|
+
keyboardType: keyboardType,
|
|
1617
|
+
autoCompleteType: autoCompleteType,
|
|
1618
|
+
autoCorrect: autoCorrect,
|
|
1619
|
+
$minHeight: minHeight,
|
|
1620
|
+
textContentType: textContentType,
|
|
1621
|
+
placeholderTextColor: theme.kitt.forms.input.color.placeholder,
|
|
1622
|
+
selectionColor: theme.kitt.forms.input.color.selection,
|
|
1623
|
+
...props,
|
|
1624
|
+
$state: state,
|
|
1625
|
+
onFocus: e => {
|
|
1626
|
+
setIsFocused(true);
|
|
1627
|
+
if (onFocus) onFocus(e);
|
|
1628
|
+
},
|
|
1629
|
+
onBlur: e => {
|
|
1630
|
+
setIsFocused(false);
|
|
1631
|
+
if (onBlur) onBlur(e);
|
|
1632
|
+
}
|
|
1633
|
+
}), right ? /*#__PURE__*/jsxRuntime.jsx(RightInputContainer, {
|
|
1634
|
+
children: right
|
|
1635
|
+
}) : null]
|
|
1636
|
+
});
|
|
1637
|
+
});
|
|
1638
|
+
|
|
1639
|
+
function InputEmail(props) {
|
|
1640
|
+
return /*#__PURE__*/jsxRuntime.jsx(InputText, {
|
|
1641
|
+
autoCompleteType: "email",
|
|
1642
|
+
keyboardType: "email-address",
|
|
1643
|
+
textContentType: "emailAddress",
|
|
1644
|
+
...props
|
|
1645
|
+
});
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
const getColorFromState = state => {
|
|
1649
|
+
switch (state) {
|
|
1650
|
+
case 'invalid':
|
|
1651
|
+
return 'danger';
|
|
1652
|
+
|
|
1653
|
+
case 'valid':
|
|
1654
|
+
default:
|
|
1655
|
+
return 'black-light';
|
|
1656
|
+
}
|
|
1657
|
+
};
|
|
1658
|
+
|
|
1659
|
+
function InputFeedback({
|
|
1660
|
+
state,
|
|
1661
|
+
testID,
|
|
1662
|
+
children
|
|
1663
|
+
}) {
|
|
1664
|
+
return /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
1665
|
+
base: "body-small",
|
|
1666
|
+
color: getColorFromState(state),
|
|
1667
|
+
testID: testID,
|
|
1668
|
+
children: children
|
|
1669
|
+
});
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1672
|
+
const FieldContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
1673
|
+
displayName: "InputField__FieldContainer",
|
|
1674
|
+
componentId: "kitt-universal__sc-13fkixs-0"
|
|
1675
|
+
})(["padding:5px 0 10px;"]);
|
|
1676
|
+
const FeedbackContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
1677
|
+
displayName: "InputField__FeedbackContainer",
|
|
1678
|
+
componentId: "kitt-universal__sc-13fkixs-1"
|
|
1679
|
+
})(["", ";"], ({
|
|
1680
|
+
theme
|
|
1681
|
+
}) => theme.responsive.ifWindowSizeMatches({
|
|
1682
|
+
minWidth: KittBreakpoints.SMALL
|
|
1683
|
+
}, 'padding-top: 10px', 'padding-top: 5px'));
|
|
1684
|
+
const FieldLabelContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
1685
|
+
displayName: "InputField__FieldLabelContainer",
|
|
1686
|
+
componentId: "kitt-universal__sc-13fkixs-2"
|
|
1687
|
+
})(["flex-direction:row;align-items:center;padding-bottom:", "px;"], ({
|
|
1688
|
+
theme
|
|
1689
|
+
}) => theme.kitt.forms.inputField.labelContainerPaddingBottom);
|
|
1690
|
+
const LabelContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
1691
|
+
displayName: "InputField__LabelContainer",
|
|
1692
|
+
componentId: "kitt-universal__sc-13fkixs-3"
|
|
1693
|
+
})(["margin-right:", "px;"], ({
|
|
1694
|
+
theme
|
|
1695
|
+
}) => theme.kitt.forms.inputField.iconMarginLeft);
|
|
1696
|
+
function InputField({
|
|
1697
|
+
label,
|
|
1698
|
+
labelFeedback,
|
|
1699
|
+
input,
|
|
1700
|
+
feedback
|
|
1701
|
+
}) {
|
|
1702
|
+
return /*#__PURE__*/jsxRuntime.jsxs(FieldContainer, {
|
|
1703
|
+
children: [label ? /*#__PURE__*/jsxRuntime.jsxs(FieldLabelContainer, {
|
|
1704
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(LabelContainer, {
|
|
1705
|
+
children: label
|
|
1706
|
+
}), labelFeedback]
|
|
1707
|
+
}) : null, input, feedback ? /*#__PURE__*/jsxRuntime.jsx(FeedbackContainer, {
|
|
1708
|
+
children: feedback
|
|
1709
|
+
}) : null]
|
|
1710
|
+
});
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
function getIconColor(state, disabled) {
|
|
1714
|
+
if (disabled) return 'black-light';
|
|
1715
|
+
|
|
1716
|
+
switch (state) {
|
|
1717
|
+
case 'invalid':
|
|
1718
|
+
return 'danger';
|
|
1719
|
+
|
|
1720
|
+
case 'valid':
|
|
1721
|
+
return 'success';
|
|
1722
|
+
|
|
1723
|
+
default:
|
|
1724
|
+
return undefined;
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1728
|
+
function InputIcon({
|
|
1729
|
+
icon,
|
|
1730
|
+
state,
|
|
1731
|
+
disabled
|
|
1732
|
+
}) {
|
|
1733
|
+
const theme = /*#__PURE__*/styled.useTheme();
|
|
1734
|
+
const color = getIconColor(state, disabled);
|
|
1735
|
+
return /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
|
|
1736
|
+
color: color,
|
|
1737
|
+
icon: icon,
|
|
1738
|
+
size: theme.kitt.forms.input.icon.size
|
|
1083
1739
|
});
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
keyboardType: keyboardType,
|
|
1090
|
-
autoCompleteType: autoCompleteType,
|
|
1091
|
-
autoCorrect: autoCorrect,
|
|
1092
|
-
$minHeight: minHeight,
|
|
1093
|
-
textContentType: textContentType,
|
|
1094
|
-
placeholderTextColor: theme.kitt.forms.input.color.placeholder,
|
|
1095
|
-
selectionColor: theme.kitt.forms.input.color.selection,
|
|
1096
|
-
...props,
|
|
1097
|
-
$state: state,
|
|
1098
|
-
onFocus: e => {
|
|
1099
|
-
setIsFocused(true);
|
|
1100
|
-
if (onFocus) onFocus(e);
|
|
1101
|
-
},
|
|
1102
|
-
onBlur: e => {
|
|
1103
|
-
setIsFocused(false);
|
|
1104
|
-
if (onBlur) onBlur(e);
|
|
1105
|
-
}
|
|
1106
|
-
}), right ? /*#__PURE__*/jsxRuntime.jsx(RightInputContainer, {
|
|
1107
|
-
children: right
|
|
1108
|
-
}) : null]
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
function InputPressable({ ...props
|
|
1743
|
+
}) {
|
|
1744
|
+
return /*#__PURE__*/jsxRuntime.jsx(reactNative.Pressable, { ...props
|
|
1109
1745
|
});
|
|
1110
|
-
}
|
|
1746
|
+
}
|
|
1111
1747
|
|
|
1112
1748
|
function InputPassword({
|
|
1113
1749
|
isPasswordDefaultVisible,
|
|
@@ -1130,6 +1766,14 @@ function InputPassword({
|
|
|
1130
1766
|
});
|
|
1131
1767
|
}
|
|
1132
1768
|
|
|
1769
|
+
function InputPhone(props) {
|
|
1770
|
+
return /*#__PURE__*/jsxRuntime.jsx(InputText, { ...props,
|
|
1771
|
+
autoCompleteType: "tel",
|
|
1772
|
+
keyboardType: "number-pad",
|
|
1773
|
+
textContentType: "telephoneNumber"
|
|
1774
|
+
});
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1133
1777
|
function Label({
|
|
1134
1778
|
htmlFor,
|
|
1135
1779
|
children
|
|
@@ -1146,7 +1790,7 @@ function Label({
|
|
|
1146
1790
|
const OuterRadio = /*#__PURE__*/styled__default.View.withConfig({
|
|
1147
1791
|
displayName: "Radio__OuterRadio",
|
|
1148
1792
|
componentId: "kitt-universal__sc-1mdgr2o-0"
|
|
1149
|
-
})(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;border-width:", ";border-color:", ";"], ({
|
|
1793
|
+
})(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;border-width:", "px;border-color:", ";"], ({
|
|
1150
1794
|
theme,
|
|
1151
1795
|
disabled
|
|
1152
1796
|
}) => theme.kitt.forms.radio[disabled ? 'disabled' : 'unchecked'].backgroundColor, ({
|
|
@@ -1694,10 +2338,10 @@ const SideContainerView = /*#__PURE__*/styled__default.View.withConfig({
|
|
|
1694
2338
|
})(["flex-direction:row;margin-left:", ";margin-right:", ";"], ({
|
|
1695
2339
|
theme,
|
|
1696
2340
|
side
|
|
1697
|
-
}) => side === 'right' ? theme.kitt.listItem.innerMargin : 0, ({
|
|
2341
|
+
}) => side === 'right' ? `${theme.kitt.listItem.innerMargin}px` : 0, ({
|
|
1698
2342
|
theme,
|
|
1699
2343
|
side
|
|
1700
|
-
}) => side === 'left' ? theme.kitt.listItem.innerMargin : 0); // Handles the vertical alignment of the side elements of the list item
|
|
2344
|
+
}) => side === 'left' ? `${theme.kitt.listItem.innerMargin}px` : 0); // Handles the vertical alignment of the side elements of the list item
|
|
1701
2345
|
|
|
1702
2346
|
function ListItemSideContainer({
|
|
1703
2347
|
children,
|
|
@@ -1743,15 +2387,15 @@ const ContainerView = /*#__PURE__*/styled__default.View.withConfig({
|
|
|
1743
2387
|
} = theme.kitt.listItem;
|
|
1744
2388
|
|
|
1745
2389
|
if (borders === 'top') {
|
|
1746
|
-
return `border-top-width: ${borderWidth}`;
|
|
2390
|
+
return `border-top-width: ${borderWidth}px`;
|
|
1747
2391
|
}
|
|
1748
2392
|
|
|
1749
2393
|
if (borders === 'bottom') {
|
|
1750
|
-
return `border-bottom-width: ${borderWidth}`;
|
|
2394
|
+
return `border-bottom-width: ${borderWidth}px`;
|
|
1751
2395
|
}
|
|
1752
2396
|
|
|
1753
2397
|
if (borders === 'both') {
|
|
1754
|
-
return
|
|
2398
|
+
return styled.css(["border-top-width:", "px;border-bottom-width:", "px;"], borderWidth, borderWidth);
|
|
1755
2399
|
}
|
|
1756
2400
|
|
|
1757
2401
|
return 'border: none';
|
|
@@ -2099,11 +2743,11 @@ const ModalView = /*#__PURE__*/styled__default.View.withConfig({
|
|
|
2099
2743
|
const ContentView = /*#__PURE__*/styled__default.View.withConfig({
|
|
2100
2744
|
displayName: "Modal__ContentView",
|
|
2101
2745
|
componentId: "kitt-universal__sc-1xy2w5u-1"
|
|
2102
|
-
})(["position:relative;display:flex;flex-direction:column;max-height:100%;max-width:540px;height:auto;width:100%;border-radius:", ";background-color:", ";"], ({
|
|
2746
|
+
})(["position:relative;display:flex;flex-direction:column;max-height:100%;max-width:540px;height:auto;width:100%;border-radius:", "px;background-color:", ";"], ({
|
|
2103
2747
|
theme
|
|
2104
2748
|
}) => theme.kitt.card.borderRadius, ({
|
|
2105
2749
|
theme
|
|
2106
|
-
}) => theme.kitt.
|
|
2750
|
+
}) => theme.kitt.colors.uiBackgroundLight);
|
|
2107
2751
|
function Modal({
|
|
2108
2752
|
visible,
|
|
2109
2753
|
children,
|
|
@@ -2510,644 +3154,170 @@ function DemoSection({
|
|
|
2510
3154
|
children: children
|
|
2511
3155
|
})
|
|
2512
3156
|
});
|
|
2513
|
-
}
|
|
2514
|
-
|
|
2515
|
-
StorySection.SubSection = SubSection;
|
|
2516
|
-
StorySection.BlockSection = BlockSection;
|
|
2517
|
-
/** @deprecated use StorySection.Demo instead */
|
|
2518
|
-
|
|
2519
|
-
StorySection.DemoSection = DemoSection;
|
|
2520
|
-
StorySection.Demo = DemoSection;
|
|
2521
|
-
/** @deprecated use StorySection instead */
|
|
2522
|
-
|
|
2523
|
-
const DeprecatedSection = StorySection;
|
|
2524
|
-
|
|
2525
|
-
function StoryContainer({
|
|
2526
|
-
children,
|
|
2527
|
-
title,
|
|
2528
|
-
state = 'none',
|
|
2529
|
-
platform = 'all'
|
|
2530
|
-
}) {
|
|
2531
|
-
if (platform === 'web') return null;
|
|
2532
|
-
return /*#__PURE__*/jsxRuntime.jsx(StorySection.BlockSection, {
|
|
2533
|
-
testID: state,
|
|
2534
|
-
title: title,
|
|
2535
|
-
children: children
|
|
2536
|
-
});
|
|
2537
|
-
}
|
|
2538
|
-
|
|
2539
|
-
function StoryDecorator(storyFn, context) {
|
|
2540
|
-
return /*#__PURE__*/jsxRuntime.jsx(Story, {
|
|
2541
|
-
title: context.name,
|
|
2542
|
-
children: storyFn()
|
|
2543
|
-
});
|
|
2544
|
-
}
|
|
2545
|
-
|
|
2546
|
-
const SmallScreenRow = /*#__PURE__*/styled__default.View.withConfig({
|
|
2547
|
-
displayName: "StoryGrid__SmallScreenRow",
|
|
2548
|
-
componentId: "kitt-universal__sc-4z5new-0"
|
|
2549
|
-
})(["flex-direction:column;margin:0;"]);
|
|
2550
|
-
const SmallScreenCol = /*#__PURE__*/styled__default.View.withConfig({
|
|
2551
|
-
displayName: "StoryGrid__SmallScreenCol",
|
|
2552
|
-
componentId: "kitt-universal__sc-4z5new-1"
|
|
2553
|
-
})(["padding:8px 0 16px;"]);
|
|
2554
|
-
const FlexRow = /*#__PURE__*/styled__default.View.withConfig({
|
|
2555
|
-
displayName: "StoryGrid__FlexRow",
|
|
2556
|
-
componentId: "kitt-universal__sc-4z5new-2"
|
|
2557
|
-
})(["flex-direction:row;margin:0 -4px 16px;"]);
|
|
2558
|
-
const FlexCol = /*#__PURE__*/styled__default.View.withConfig({
|
|
2559
|
-
displayName: "StoryGrid__FlexCol",
|
|
2560
|
-
componentId: "kitt-universal__sc-4z5new-3"
|
|
2561
|
-
})(["flex-grow:1;flex-basis:0;margin:0 8px;"]);
|
|
2562
|
-
|
|
2563
|
-
function StoryGridRow({
|
|
2564
|
-
children,
|
|
2565
|
-
breakpoint = 'small'
|
|
2566
|
-
}) {
|
|
2567
|
-
// eslint-disable-next-line unicorn/expiring-todo-comments
|
|
2568
|
-
// TODO use useBreakpoint instead
|
|
2569
|
-
const {
|
|
2570
|
-
width
|
|
2571
|
-
} = reactNative.useWindowDimensions();
|
|
2572
|
-
const breakpointValue = breakpoint === 'small' ? 480 : 768;
|
|
2573
|
-
|
|
2574
|
-
if (width < breakpointValue) {
|
|
2575
|
-
return /*#__PURE__*/jsxRuntime.jsx(SmallScreenRow, {
|
|
2576
|
-
children: react.Children.map(children, child => /*#__PURE__*/jsxRuntime.jsx(SmallScreenCol, {
|
|
2577
|
-
children: child
|
|
2578
|
-
}))
|
|
2579
|
-
});
|
|
2580
|
-
}
|
|
2581
|
-
|
|
2582
|
-
return /*#__PURE__*/jsxRuntime.jsx(FlexRow, {
|
|
2583
|
-
children: react.Children.map(children, child => /*#__PURE__*/jsxRuntime.jsx(FlexCol, {
|
|
2584
|
-
children: child
|
|
2585
|
-
}))
|
|
2586
|
-
});
|
|
2587
|
-
}
|
|
2588
|
-
|
|
2589
|
-
function StoryGridCol({
|
|
2590
|
-
title,
|
|
2591
|
-
titleColor,
|
|
2592
|
-
children,
|
|
2593
|
-
platform = 'all'
|
|
2594
|
-
}) {
|
|
2595
|
-
const isNative = reactNative.Platform.OS === 'ios' || reactNative.Platform.OS === 'android';
|
|
2596
|
-
|
|
2597
|
-
if (reactNative.Platform.OS === 'web' && platform === 'native') {
|
|
2598
|
-
return null;
|
|
2599
|
-
}
|
|
2600
|
-
|
|
2601
|
-
if (isNative && platform === 'web') {
|
|
2602
|
-
return null;
|
|
2603
|
-
}
|
|
2604
|
-
|
|
2605
|
-
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2606
|
-
children: [title ? /*#__PURE__*/jsxRuntime.jsx(StoryTitle.Level4, {
|
|
2607
|
-
numberOfLines: 1,
|
|
2608
|
-
color: titleColor,
|
|
2609
|
-
children: title
|
|
2610
|
-
}) : null, children]
|
|
2611
|
-
});
|
|
2612
|
-
}
|
|
2613
|
-
|
|
2614
|
-
const StoryGrid = {
|
|
2615
|
-
Row: StoryGridRow,
|
|
2616
|
-
Col: StoryGridCol
|
|
2617
|
-
};
|
|
2618
|
-
|
|
2619
|
-
const Container$1 = /*#__PURE__*/styled__default.View.withConfig({
|
|
2620
|
-
displayName: "Tag__Container",
|
|
2621
|
-
componentId: "kitt-universal__sc-19jmowi-0"
|
|
2622
|
-
})(["background-color:", ";border-width:", ";border-color:", ";padding:", ";border-radius:", ";align-self:flex-start;"], ({
|
|
2623
|
-
theme,
|
|
2624
|
-
type,
|
|
2625
|
-
variant
|
|
2626
|
-
}) => theme.kitt.tag[type][variant].backgroundColor, ({
|
|
2627
|
-
theme,
|
|
2628
|
-
type,
|
|
2629
|
-
variant
|
|
2630
|
-
}) => theme.kitt.tag[type][variant].borderWidth, ({
|
|
2631
|
-
theme,
|
|
2632
|
-
type,
|
|
2633
|
-
variant
|
|
2634
|
-
}) => theme.kitt.tag[type][variant].borderColor, ({
|
|
2635
|
-
theme
|
|
2636
|
-
}) => theme.kitt.tag.padding, ({
|
|
2637
|
-
theme
|
|
2638
|
-
}) => theme.kitt.tag.borderRadius);
|
|
2639
|
-
const getLabelColor = (type, variant) => {
|
|
2640
|
-
switch (type) {
|
|
2641
|
-
case 'danger':
|
|
2642
|
-
{
|
|
2643
|
-
return variant === 'outline' ? 'danger' : 'black';
|
|
2644
|
-
}
|
|
2645
|
-
|
|
2646
|
-
case 'primary':
|
|
2647
|
-
{
|
|
2648
|
-
return 'primary';
|
|
2649
|
-
}
|
|
2650
|
-
|
|
2651
|
-
case 'default':
|
|
2652
|
-
{
|
|
2653
|
-
return 'black';
|
|
2654
|
-
}
|
|
2655
|
-
|
|
2656
|
-
default:
|
|
2657
|
-
{
|
|
2658
|
-
return 'black';
|
|
2659
|
-
}
|
|
2660
|
-
}
|
|
2661
|
-
};
|
|
2662
|
-
function Tag({
|
|
2663
|
-
label,
|
|
2664
|
-
type = 'default',
|
|
2665
|
-
variant = 'fill'
|
|
2666
|
-
}) {
|
|
2667
|
-
return /*#__PURE__*/jsxRuntime.jsx(Container$1, {
|
|
2668
|
-
type: type,
|
|
2669
|
-
variant: variant,
|
|
2670
|
-
children: /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
2671
|
-
base: "body-xsmall",
|
|
2672
|
-
color: getLabelColor(type, variant),
|
|
2673
|
-
children: label
|
|
2674
|
-
})
|
|
2675
|
-
});
|
|
2676
|
-
}
|
|
2677
|
-
|
|
2678
|
-
const lateOceanColorPalette = {
|
|
2679
|
-
lateOcean: '#4C34E0',
|
|
2680
|
-
lateOceanLight1: '#705DE6',
|
|
2681
|
-
lateOceanLight2: '#9485EC',
|
|
2682
|
-
lateOceanLight3: '#D6BAF9',
|
|
2683
|
-
warmEmbrace: '#F4D3CE',
|
|
2684
|
-
warmEmbraceLight1: '#FFEDE6',
|
|
2685
|
-
black1000: '#000000',
|
|
2686
|
-
black555: '#737373',
|
|
2687
|
-
black200: '#CCCCCC',
|
|
2688
|
-
black100: '#E5E5E5',
|
|
2689
|
-
black50: '#F2F2F2',
|
|
2690
|
-
black25: '#F9F9F9',
|
|
2691
|
-
white: '#FFFFFF',
|
|
2692
|
-
viride: '#38836D',
|
|
2693
|
-
englishVermillon: '#D44148',
|
|
2694
|
-
goldCrayola: '#F8C583',
|
|
2695
|
-
aero: '#89BDDD',
|
|
2696
|
-
transparent: 'transparent',
|
|
2697
|
-
moonPurple: '#DBD6F9',
|
|
2698
|
-
moonPurpleLight1: '#EDEBFC'
|
|
2699
|
-
};
|
|
2700
|
-
|
|
2701
|
-
const colorsLateOceanTheme = {
|
|
2702
|
-
primary: lateOceanColorPalette.lateOcean,
|
|
2703
|
-
primaryLight: lateOceanColorPalette.lateOceanLight1,
|
|
2704
|
-
accent: lateOceanColorPalette.warmEmbrace,
|
|
2705
|
-
accentLight: lateOceanColorPalette.warmEmbraceLight1,
|
|
2706
|
-
success: lateOceanColorPalette.viride,
|
|
2707
|
-
correct: lateOceanColorPalette.viride,
|
|
2708
|
-
danger: lateOceanColorPalette.englishVermillon,
|
|
2709
|
-
info: lateOceanColorPalette.aero,
|
|
2710
|
-
warning: lateOceanColorPalette.goldCrayola,
|
|
2711
|
-
separator: lateOceanColorPalette.black100,
|
|
2712
|
-
hover: lateOceanColorPalette.black100,
|
|
2713
|
-
black: lateOceanColorPalette.black1000,
|
|
2714
|
-
uiBackground: lateOceanColorPalette.black25,
|
|
2715
|
-
uiBackgroundLight: lateOceanColorPalette.white,
|
|
2716
|
-
transparent: lateOceanColorPalette.transparent,
|
|
2717
|
-
disabled: lateOceanColorPalette.black50,
|
|
2718
|
-
overlay: {
|
|
2719
|
-
dark: 'rgba(41, 48, 51, 0.25)',
|
|
2720
|
-
light: 'rgba(255, 255, 255, 0.90)',
|
|
2721
|
-
fullscreenLoader: 'rgba(0, 0, 0, 0.25)'
|
|
2722
|
-
}
|
|
2723
|
-
};
|
|
3157
|
+
}
|
|
2724
3158
|
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
backgroundColor: colorsLateOceanTheme.primary
|
|
2729
|
-
},
|
|
2730
|
-
light: {
|
|
2731
|
-
backgroundColor: lateOceanColorPalette.black100
|
|
2732
|
-
}
|
|
2733
|
-
};
|
|
3159
|
+
StorySection.SubSection = SubSection;
|
|
3160
|
+
StorySection.BlockSection = BlockSection;
|
|
3161
|
+
/** @deprecated use StorySection.Demo instead */
|
|
2734
3162
|
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
disabled: '2px',
|
|
2739
|
-
focus: '3px'
|
|
2740
|
-
},
|
|
2741
|
-
minHeight: '40px',
|
|
2742
|
-
minWidth: '40px',
|
|
2743
|
-
maxWidth: '335px',
|
|
2744
|
-
scale: {
|
|
2745
|
-
base: {
|
|
2746
|
-
default: 1,
|
|
2747
|
-
hover: 0.95,
|
|
2748
|
-
active: 0.95
|
|
2749
|
-
},
|
|
2750
|
-
medium: {
|
|
2751
|
-
hover: 1.05
|
|
2752
|
-
}
|
|
2753
|
-
},
|
|
2754
|
-
contentPadding: {
|
|
2755
|
-
default: '8px 16px 7px',
|
|
2756
|
-
large: '12px 24px 11px',
|
|
2757
|
-
disabled: '6px 14px 5px'
|
|
2758
|
-
},
|
|
2759
|
-
transition: {
|
|
2760
|
-
duration: '200ms',
|
|
2761
|
-
timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
|
|
2762
|
-
},
|
|
2763
|
-
default: {
|
|
2764
|
-
backgroundColor: 'rgba(0, 0, 0, 0.05)',
|
|
2765
|
-
pressedBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
2766
|
-
hoverBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
2767
|
-
focusBorderColor: 'rgba(0, 0, 0, 0.1)'
|
|
2768
|
-
},
|
|
2769
|
-
primary: {
|
|
2770
|
-
backgroundColor: colorsLateOceanTheme.primary,
|
|
2771
|
-
pressedBackgroundColor: colorsLateOceanTheme.primaryLight,
|
|
2772
|
-
hoverBackgroundColor: colorsLateOceanTheme.primaryLight,
|
|
2773
|
-
focusBorderColor: 'rgba(76, 52, 224, 0.2)'
|
|
2774
|
-
},
|
|
2775
|
-
white: {
|
|
2776
|
-
backgroundColor: 'rgba(255, 255, 255, 0.05)',
|
|
2777
|
-
pressedBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2778
|
-
hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2779
|
-
focusBorderColor: 'rgba(255, 255, 255, 0.1)'
|
|
2780
|
-
},
|
|
2781
|
-
subtle: {
|
|
2782
|
-
backgroundColor: colorsLateOceanTheme.transparent,
|
|
2783
|
-
pressedBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2784
|
-
hoverBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2785
|
-
focusBorderColor: 'rgba(76, 52, 224, 0.2)',
|
|
2786
|
-
color: colorsLateOceanTheme.primary,
|
|
2787
|
-
hoverColor: 'rgba(76, 52, 224, 0.8)',
|
|
2788
|
-
activeColor: 'rgba(76, 52, 224, 0.8)'
|
|
2789
|
-
},
|
|
2790
|
-
'subtle-dark': {
|
|
2791
|
-
backgroundColor: colorsLateOceanTheme.transparent,
|
|
2792
|
-
pressedBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2793
|
-
hoverBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2794
|
-
focusBorderColor: 'rgba(0, 0, 0, 0.1)',
|
|
2795
|
-
color: colorsLateOceanTheme.black,
|
|
2796
|
-
hoverColor: 'rgba(0, 0, 0, 0.8)',
|
|
2797
|
-
activeColor: 'rgba(0, 0, 0, 0.8)'
|
|
2798
|
-
},
|
|
2799
|
-
disabled: {
|
|
2800
|
-
backgroundColor: colorsLateOceanTheme.disabled,
|
|
2801
|
-
pressedBackgroundColor: colorsLateOceanTheme.disabled,
|
|
2802
|
-
hoverBackgroundColor: colorsLateOceanTheme.disabled,
|
|
2803
|
-
focusBorderColor: lateOceanColorPalette.black100,
|
|
2804
|
-
borderColor: lateOceanColorPalette.black100
|
|
2805
|
-
}
|
|
2806
|
-
};
|
|
3163
|
+
StorySection.DemoSection = DemoSection;
|
|
3164
|
+
StorySection.Demo = DemoSection;
|
|
3165
|
+
/** @deprecated use StorySection instead */
|
|
2807
3166
|
|
|
2808
|
-
const
|
|
2809
|
-
borderRadius: '20px',
|
|
2810
|
-
borderWidth: '2px',
|
|
2811
|
-
padding: '16px',
|
|
2812
|
-
primary: {
|
|
2813
|
-
backgroundColor: lateOceanColorPalette.white,
|
|
2814
|
-
borderColor: lateOceanColorPalette.lateOcean
|
|
2815
|
-
},
|
|
2816
|
-
secondary: {
|
|
2817
|
-
backgroundColor: lateOceanColorPalette.white,
|
|
2818
|
-
borderColor: lateOceanColorPalette.black100
|
|
2819
|
-
},
|
|
2820
|
-
subtle: {
|
|
2821
|
-
backgroundColor: lateOceanColorPalette.black50,
|
|
2822
|
-
borderColor: lateOceanColorPalette.black100
|
|
2823
|
-
}
|
|
2824
|
-
};
|
|
3167
|
+
const DeprecatedSection = StorySection;
|
|
2825
3168
|
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
};
|
|
3169
|
+
function StoryContainer({
|
|
3170
|
+
children,
|
|
3171
|
+
title,
|
|
3172
|
+
state = 'none',
|
|
3173
|
+
platform = 'all'
|
|
3174
|
+
}) {
|
|
3175
|
+
if (platform === 'web') return null;
|
|
3176
|
+
return /*#__PURE__*/jsxRuntime.jsx(StorySection.BlockSection, {
|
|
3177
|
+
testID: state,
|
|
3178
|
+
title: title,
|
|
3179
|
+
children: children
|
|
3180
|
+
});
|
|
3181
|
+
}
|
|
2840
3182
|
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
mediumAndWide: {
|
|
2848
|
-
fontSize: `${mediumAndWideFontSize}px`,
|
|
2849
|
-
lineHeight: `${calcLineHeight(mediumAndWideFontSize, lineHeightMultiplier)}px`
|
|
2850
|
-
}
|
|
2851
|
-
});
|
|
2852
|
-
const typographyLateOceanTheme = {
|
|
2853
|
-
colors: {
|
|
2854
|
-
black: lateOceanColorPalette.black1000,
|
|
2855
|
-
'black-light': lateOceanColorPalette.black555,
|
|
2856
|
-
white: lateOceanColorPalette.white,
|
|
2857
|
-
'white-light': lateOceanColorPalette.white,
|
|
2858
|
-
primary: lateOceanColorPalette.lateOcean,
|
|
2859
|
-
'primary-light': lateOceanColorPalette.lateOceanLight1,
|
|
2860
|
-
accent: lateOceanColorPalette.warmEmbrace,
|
|
2861
|
-
success: lateOceanColorPalette.viride,
|
|
2862
|
-
danger: lateOceanColorPalette.englishVermillon
|
|
2863
|
-
},
|
|
2864
|
-
types: {
|
|
2865
|
-
headers: {
|
|
2866
|
-
fontFamily: {
|
|
2867
|
-
regular: reactNative.Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold',
|
|
2868
|
-
bold: reactNative.Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold'
|
|
2869
|
-
},
|
|
2870
|
-
fontWeight: 400,
|
|
2871
|
-
fontStyle: 'normal',
|
|
2872
|
-
configs: {
|
|
2873
|
-
// also known as xxlarge
|
|
2874
|
-
header1: createTypographyTypeConfig(1.3, 38, 62),
|
|
2875
|
-
// also known as xlarge
|
|
2876
|
-
header2: createTypographyTypeConfig(1.3, 32, 48),
|
|
2877
|
-
// also known as medium
|
|
2878
|
-
header3: createTypographyTypeConfig(1.3, 24, 36),
|
|
2879
|
-
// also known as xsmall
|
|
2880
|
-
header4: createTypographyTypeConfig(1.3, 18, 24),
|
|
2881
|
-
// also known as xxsmall
|
|
2882
|
-
header5: createTypographyTypeConfig(1.3, 18, 18)
|
|
2883
|
-
}
|
|
2884
|
-
},
|
|
2885
|
-
bodies: {
|
|
2886
|
-
fontFamily: {
|
|
2887
|
-
regular: reactNative.Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans',
|
|
2888
|
-
bold: reactNative.Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans-Bold'
|
|
2889
|
-
},
|
|
2890
|
-
fontWeight: {
|
|
2891
|
-
regular: 400,
|
|
2892
|
-
bold: 700
|
|
2893
|
-
},
|
|
2894
|
-
fontStyle: {
|
|
2895
|
-
regular: 'normal',
|
|
2896
|
-
bold: 'normal'
|
|
2897
|
-
},
|
|
2898
|
-
configs: {
|
|
2899
|
-
'body-large': createTypographyTypeConfig(1.6, 18, 24),
|
|
2900
|
-
'body-medium': createTypographyTypeConfig(1.6, 18, 18),
|
|
2901
|
-
body: createTypographyTypeConfig(1.6, 16, 16),
|
|
2902
|
-
'body-small': createTypographyTypeConfig(1.6, 14, 14),
|
|
2903
|
-
'body-xsmall': createTypographyTypeConfig(1.6, 12, 12)
|
|
2904
|
-
}
|
|
2905
|
-
}
|
|
2906
|
-
},
|
|
2907
|
-
link: {
|
|
2908
|
-
disabledColor: lateOceanColorPalette.black200
|
|
2909
|
-
}
|
|
2910
|
-
};
|
|
3183
|
+
function StoryDecorator(storyFn, context) {
|
|
3184
|
+
return /*#__PURE__*/jsxRuntime.jsx(Story, {
|
|
3185
|
+
title: context.name,
|
|
3186
|
+
children: storyFn()
|
|
3187
|
+
});
|
|
3188
|
+
}
|
|
2911
3189
|
|
|
2912
|
-
const
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
hover: {
|
|
2929
|
-
borderColor: lateOceanColorPalette.black200,
|
|
2930
|
-
color: 'black'
|
|
2931
|
-
},
|
|
2932
|
-
focus: {
|
|
2933
|
-
borderColor: colorsLateOceanTheme.primary,
|
|
2934
|
-
color: 'black'
|
|
2935
|
-
},
|
|
2936
|
-
disabled: {
|
|
2937
|
-
backgroundColor: colorsLateOceanTheme.disabled,
|
|
2938
|
-
borderColor: colorsLateOceanTheme.separator,
|
|
2939
|
-
color: 'black-light'
|
|
2940
|
-
},
|
|
2941
|
-
invalid: {
|
|
2942
|
-
borderColor: colorsLateOceanTheme.separator,
|
|
2943
|
-
color: 'black'
|
|
2944
|
-
}
|
|
2945
|
-
};
|
|
2946
|
-
const input = {
|
|
2947
|
-
color: {
|
|
2948
|
-
selection: colorsLateOceanTheme.primary,
|
|
2949
|
-
placeholder: typographyLateOceanTheme.colors['black-light']
|
|
2950
|
-
},
|
|
2951
|
-
borderWidth: '2px',
|
|
2952
|
-
borderRadius: '10px',
|
|
2953
|
-
icon: {
|
|
2954
|
-
size: 20
|
|
2955
|
-
},
|
|
2956
|
-
padding: {
|
|
2957
|
-
default: '7px 16px',
|
|
2958
|
-
iOSSingleLine: '12px 16px'
|
|
2959
|
-
},
|
|
2960
|
-
states: inputStatesStyle
|
|
2961
|
-
};
|
|
3190
|
+
const SmallScreenRow = /*#__PURE__*/styled__default.View.withConfig({
|
|
3191
|
+
displayName: "StoryGrid__SmallScreenRow",
|
|
3192
|
+
componentId: "kitt-universal__sc-4z5new-0"
|
|
3193
|
+
})(["flex-direction:column;margin:0;"]);
|
|
3194
|
+
const SmallScreenCol = /*#__PURE__*/styled__default.View.withConfig({
|
|
3195
|
+
displayName: "StoryGrid__SmallScreenCol",
|
|
3196
|
+
componentId: "kitt-universal__sc-4z5new-1"
|
|
3197
|
+
})(["padding:8px 0 16px;"]);
|
|
3198
|
+
const FlexRow = /*#__PURE__*/styled__default.View.withConfig({
|
|
3199
|
+
displayName: "StoryGrid__FlexRow",
|
|
3200
|
+
componentId: "kitt-universal__sc-4z5new-2"
|
|
3201
|
+
})(["flex-direction:row;margin:0 -4px 16px;"]);
|
|
3202
|
+
const FlexCol = /*#__PURE__*/styled__default.View.withConfig({
|
|
3203
|
+
displayName: "StoryGrid__FlexCol",
|
|
3204
|
+
componentId: "kitt-universal__sc-4z5new-3"
|
|
3205
|
+
})(["flex-grow:1;flex-basis:0;margin:0 8px;"]);
|
|
2962
3206
|
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
}
|
|
3207
|
+
function StoryGridRow({
|
|
3208
|
+
children,
|
|
3209
|
+
breakpoint = 'small'
|
|
3210
|
+
}) {
|
|
3211
|
+
// eslint-disable-next-line unicorn/expiring-todo-comments
|
|
3212
|
+
// TODO use useBreakpoint instead
|
|
3213
|
+
const {
|
|
3214
|
+
width
|
|
3215
|
+
} = reactNative.useWindowDimensions();
|
|
3216
|
+
const breakpointValue = breakpoint === 'small' ? 480 : 768;
|
|
2967
3217
|
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
},
|
|
2975
|
-
checked: {
|
|
2976
|
-
backgroundColor: lateOceanColorPalette.lateOcean,
|
|
2977
|
-
innerSize: 5,
|
|
2978
|
-
innerBackgroundColor: lateOceanColorPalette.white
|
|
2979
|
-
},
|
|
2980
|
-
disabled: {
|
|
2981
|
-
backgroundColor: lateOceanColorPalette.black50,
|
|
2982
|
-
borderColor: lateOceanColorPalette.black100
|
|
3218
|
+
if (width < breakpointValue) {
|
|
3219
|
+
return /*#__PURE__*/jsxRuntime.jsx(SmallScreenRow, {
|
|
3220
|
+
children: react.Children.map(children, child => /*#__PURE__*/jsxRuntime.jsx(SmallScreenCol, {
|
|
3221
|
+
children: child
|
|
3222
|
+
}))
|
|
3223
|
+
});
|
|
2983
3224
|
}
|
|
2984
|
-
};
|
|
2985
3225
|
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
3226
|
+
return /*#__PURE__*/jsxRuntime.jsx(FlexRow, {
|
|
3227
|
+
children: react.Children.map(children, child => /*#__PURE__*/jsxRuntime.jsx(FlexCol, {
|
|
3228
|
+
children: child
|
|
3229
|
+
}))
|
|
3230
|
+
});
|
|
3231
|
+
}
|
|
2989
3232
|
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
}
|
|
3233
|
+
function StoryGridCol({
|
|
3234
|
+
title,
|
|
3235
|
+
titleColor,
|
|
3236
|
+
children,
|
|
3237
|
+
platform = 'all'
|
|
3238
|
+
}) {
|
|
3239
|
+
const isNative = reactNative.Platform.OS === 'ios' || reactNative.Platform.OS === 'android';
|
|
2996
3240
|
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
paddingVertical: 12,
|
|
3000
|
-
paddingHorizontal: 16,
|
|
3001
|
-
borderColor: lateOceanColorPalette.black100
|
|
3241
|
+
if (reactNative.Platform.OS === 'web' && platform === 'native') {
|
|
3242
|
+
return null;
|
|
3002
3243
|
}
|
|
3003
|
-
};
|
|
3004
3244
|
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
width: 40,
|
|
3008
|
-
height: 40,
|
|
3009
|
-
borderRadius: 20,
|
|
3010
|
-
borderWidth: 2,
|
|
3011
|
-
borderColor: 'transparent',
|
|
3012
|
-
transition: {
|
|
3013
|
-
property: 'all',
|
|
3014
|
-
duration: '200ms',
|
|
3015
|
-
timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1);'
|
|
3016
|
-
},
|
|
3017
|
-
scale: {
|
|
3018
|
-
base: {
|
|
3019
|
-
default: 1,
|
|
3020
|
-
hover: 0.95,
|
|
3021
|
-
active: 0.95
|
|
3022
|
-
},
|
|
3023
|
-
medium: {
|
|
3024
|
-
hover: 1.05
|
|
3025
|
-
}
|
|
3026
|
-
},
|
|
3027
|
-
disabled: {
|
|
3028
|
-
scale: 1,
|
|
3029
|
-
backgroundColor: button.disabled.backgroundColor,
|
|
3030
|
-
borderColor: button.disabled.borderColor
|
|
3031
|
-
},
|
|
3032
|
-
default: {
|
|
3033
|
-
pressedBackgroundColor: button.default.pressedBackgroundColor
|
|
3034
|
-
},
|
|
3035
|
-
white: {
|
|
3036
|
-
pressedBackgroundColor: button.white.hoverBackgroundColor
|
|
3245
|
+
if (isNative && platform === 'web') {
|
|
3246
|
+
return null;
|
|
3037
3247
|
}
|
|
3038
|
-
};
|
|
3039
3248
|
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
}
|
|
3249
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
3250
|
+
children: [title ? /*#__PURE__*/jsxRuntime.jsx(StoryTitle.Level4, {
|
|
3251
|
+
numberOfLines: 1,
|
|
3252
|
+
color: titleColor,
|
|
3253
|
+
children: title
|
|
3254
|
+
}) : null, children]
|
|
3255
|
+
});
|
|
3256
|
+
}
|
|
3046
3257
|
|
|
3047
|
-
const
|
|
3048
|
-
|
|
3258
|
+
const StoryGrid = {
|
|
3259
|
+
Row: StoryGridRow,
|
|
3260
|
+
Col: StoryGridCol
|
|
3049
3261
|
};
|
|
3050
3262
|
|
|
3051
|
-
const
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3263
|
+
const Container$1 = /*#__PURE__*/styled__default.View.withConfig({
|
|
3264
|
+
displayName: "Tag__Container",
|
|
3265
|
+
componentId: "kitt-universal__sc-19jmowi-0"
|
|
3266
|
+
})(["background-color:", ";border-width:", "px;border-color:", ";padding:", ";border-radius:", "px;align-self:flex-start;"], ({
|
|
3267
|
+
theme,
|
|
3268
|
+
type,
|
|
3269
|
+
variant
|
|
3270
|
+
}) => theme.kitt.tag[type][variant].backgroundColor, ({
|
|
3271
|
+
theme,
|
|
3272
|
+
type,
|
|
3273
|
+
variant
|
|
3274
|
+
}) => theme.kitt.tag[type][variant].borderWidth, ({
|
|
3275
|
+
theme,
|
|
3276
|
+
type,
|
|
3277
|
+
variant
|
|
3278
|
+
}) => theme.kitt.tag[type][variant].borderColor, ({
|
|
3279
|
+
theme
|
|
3280
|
+
}) => theme.kitt.tag.padding, ({
|
|
3281
|
+
theme
|
|
3282
|
+
}) => theme.kitt.tag.borderRadius);
|
|
3283
|
+
const getLabelColor = (type, variant) => {
|
|
3284
|
+
switch (type) {
|
|
3285
|
+
case 'danger':
|
|
3286
|
+
{
|
|
3287
|
+
return variant === 'outline' ? 'danger' : 'black';
|
|
3288
|
+
}
|
|
3056
3289
|
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
fill: {
|
|
3062
|
-
backgroundColor: lateOceanColorPalette.moonPurpleLight1,
|
|
3063
|
-
borderWidth: '0',
|
|
3064
|
-
borderColor: lateOceanColorPalette.transparent
|
|
3065
|
-
},
|
|
3066
|
-
outline: {
|
|
3067
|
-
backgroundColor: lateOceanColorPalette.transparent,
|
|
3068
|
-
borderWidth: '1px',
|
|
3069
|
-
borderColor: lateOceanColorPalette.lateOcean
|
|
3070
|
-
}
|
|
3071
|
-
},
|
|
3072
|
-
default: {
|
|
3073
|
-
fill: {
|
|
3074
|
-
backgroundColor: lateOceanColorPalette.black50,
|
|
3075
|
-
borderWidth: '0',
|
|
3076
|
-
borderColor: lateOceanColorPalette.transparent
|
|
3077
|
-
},
|
|
3078
|
-
outline: {
|
|
3079
|
-
backgroundColor: lateOceanColorPalette.transparent,
|
|
3080
|
-
borderWidth: '1px',
|
|
3081
|
-
borderColor: lateOceanColorPalette.black1000
|
|
3082
|
-
}
|
|
3083
|
-
},
|
|
3084
|
-
danger: {
|
|
3085
|
-
fill: {
|
|
3086
|
-
backgroundColor: lateOceanColorPalette.warmEmbrace,
|
|
3087
|
-
borderWidth: '0',
|
|
3088
|
-
borderColor: lateOceanColorPalette.transparent
|
|
3089
|
-
},
|
|
3090
|
-
outline: {
|
|
3091
|
-
backgroundColor: lateOceanColorPalette.transparent,
|
|
3092
|
-
borderWidth: '1px',
|
|
3093
|
-
borderColor: colorsLateOceanTheme.danger
|
|
3094
|
-
}
|
|
3095
|
-
}
|
|
3096
|
-
};
|
|
3290
|
+
case 'primary':
|
|
3291
|
+
{
|
|
3292
|
+
return 'primary';
|
|
3293
|
+
}
|
|
3097
3294
|
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
horizontalPadding: 16,
|
|
3103
|
-
verticalPadding: 4,
|
|
3104
|
-
floatingPadding: 8
|
|
3105
|
-
};
|
|
3295
|
+
case 'default':
|
|
3296
|
+
{
|
|
3297
|
+
return 'black';
|
|
3298
|
+
}
|
|
3106
3299
|
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
medium: 768,
|
|
3112
|
-
large: 1024,
|
|
3113
|
-
wide: 1280
|
|
3114
|
-
},
|
|
3115
|
-
min: {
|
|
3116
|
-
smallBreakpoint: 'min-width: 480px',
|
|
3117
|
-
mediumBreakpoint: 'min-width: 768px',
|
|
3118
|
-
largeBreakpoint: 'min-width: 1024px',
|
|
3119
|
-
wideBreakpoint: 'min-width: 1280px'
|
|
3120
|
-
},
|
|
3121
|
-
max: {
|
|
3122
|
-
smallBreakpoint: 'max-width: 479px',
|
|
3123
|
-
mediumBreakpoint: 'max-width: 767px',
|
|
3124
|
-
largeBreakpoint: 'max-width: 1023px',
|
|
3125
|
-
wideBreakpoint: 'max-width: 1279px'
|
|
3300
|
+
default:
|
|
3301
|
+
{
|
|
3302
|
+
return 'black';
|
|
3303
|
+
}
|
|
3126
3304
|
}
|
|
3127
|
-
}; // eslint-disable-next-line unicorn/expiring-todo-comments
|
|
3128
|
-
// TODO : seperate brand color usage definition from proper theme definition and add typings - https://ornikar.atlassian.net/browse/CME-156
|
|
3129
|
-
|
|
3130
|
-
const theme = {
|
|
3131
|
-
spacing: 4,
|
|
3132
|
-
colors: colorsLateOceanTheme,
|
|
3133
|
-
palettes: {
|
|
3134
|
-
lateOcean: lateOceanColorPalette
|
|
3135
|
-
},
|
|
3136
|
-
avatar,
|
|
3137
|
-
button,
|
|
3138
|
-
card: cardLateOceanTheme,
|
|
3139
|
-
feedbackMessage,
|
|
3140
|
-
forms,
|
|
3141
|
-
typography: typographyLateOceanTheme,
|
|
3142
|
-
tag: tagLateOceanTheme,
|
|
3143
|
-
shadows: shadowsLateOceanTheme,
|
|
3144
|
-
fullScreenModal: fullScreenModalLateOceanTheme,
|
|
3145
|
-
iconButton,
|
|
3146
|
-
listItem: listItemLateOceanTheme,
|
|
3147
|
-
tooltip,
|
|
3148
|
-
skeleton: skeletonTheme,
|
|
3149
|
-
breakpoints
|
|
3150
3305
|
};
|
|
3306
|
+
function Tag({
|
|
3307
|
+
label,
|
|
3308
|
+
type = 'default',
|
|
3309
|
+
variant = 'fill'
|
|
3310
|
+
}) {
|
|
3311
|
+
return /*#__PURE__*/jsxRuntime.jsx(Container$1, {
|
|
3312
|
+
type: type,
|
|
3313
|
+
variant: variant,
|
|
3314
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
3315
|
+
base: "body-xsmall",
|
|
3316
|
+
color: getLabelColor(type, variant),
|
|
3317
|
+
children: label
|
|
3318
|
+
})
|
|
3319
|
+
});
|
|
3320
|
+
}
|
|
3151
3321
|
|
|
3152
3322
|
function Title({
|
|
3153
3323
|
children
|
|
@@ -3386,7 +3556,7 @@ function Tooltip({
|
|
|
3386
3556
|
};
|
|
3387
3557
|
_f.asString = "function _f(){const{withSpring,pressed,theme}=jsThis._closure;{return{opacity:withSpring(pressed.value?theme.kitt.tooltip.opacity:0)};}}";
|
|
3388
3558
|
_f.__workletHash = 15953928507970;
|
|
3389
|
-
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Tooltip/Tooltip.tsx (
|
|
3559
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Tooltip/Tooltip.tsx (59:41)";
|
|
3390
3560
|
_f.__optimalization = 2;
|
|
3391
3561
|
|
|
3392
3562
|
global.__reanimatedWorkletInit(_f);
|
|
@@ -3479,13 +3649,8 @@ function TypographyEmoji({
|
|
|
3479
3649
|
const {
|
|
3480
3650
|
fontSize
|
|
3481
3651
|
} = typeConfig[typeConfigKey];
|
|
3482
|
-
|
|
3483
|
-
if ((process.env.NODE_ENV !== "production")) {
|
|
3484
|
-
if (!fontSize.endsWith('px')) throw new Error(`Unexpected font-size value: ${fontSize}`);
|
|
3485
|
-
}
|
|
3486
|
-
|
|
3487
3652
|
return /*#__PURE__*/jsxRuntime.jsx(StyledTypographyEmoji, {
|
|
3488
|
-
size:
|
|
3653
|
+
size: fontSize,
|
|
3489
3654
|
emoji: emoji
|
|
3490
3655
|
});
|
|
3491
3656
|
}
|
|
@@ -3551,65 +3716,6 @@ function TypographyLink({
|
|
|
3551
3716
|
});
|
|
3552
3717
|
}
|
|
3553
3718
|
|
|
3554
|
-
function matchWindowSize({
|
|
3555
|
-
width,
|
|
3556
|
-
height
|
|
3557
|
-
}, {
|
|
3558
|
-
minWidth,
|
|
3559
|
-
maxWidth,
|
|
3560
|
-
minHeight,
|
|
3561
|
-
maxHeight
|
|
3562
|
-
}) {
|
|
3563
|
-
const hasWidthMatched = width ? (!minWidth || width >= minWidth) && (!maxWidth || width <= maxWidth) : true;
|
|
3564
|
-
const hasHeightMatched = height ? (!minHeight || height >= minHeight) && (!maxHeight || height <= maxHeight) : true;
|
|
3565
|
-
return hasWidthMatched && hasHeightMatched;
|
|
3566
|
-
}
|
|
3567
|
-
function useMatchWindowSize(options) {
|
|
3568
|
-
const {
|
|
3569
|
-
width,
|
|
3570
|
-
height
|
|
3571
|
-
} = reactNative.useWindowDimensions();
|
|
3572
|
-
return matchWindowSize({
|
|
3573
|
-
width,
|
|
3574
|
-
height
|
|
3575
|
-
}, options);
|
|
3576
|
-
}
|
|
3577
|
-
|
|
3578
|
-
// eslint-disable-next-line no-restricted-imports
|
|
3579
|
-
function createWindowSizeHelper(dimensions) {
|
|
3580
|
-
return {
|
|
3581
|
-
matchWindowSize: options => matchWindowSize(dimensions, options),
|
|
3582
|
-
ifWindowSizeMatches: (options, valueIfTrue, valueIfFalse) => matchWindowSize(dimensions, options) ? valueIfTrue : valueIfFalse,
|
|
3583
|
-
mapWindowWidth: (...widthList) => {
|
|
3584
|
-
if ((process.env.NODE_ENV !== "production")) {
|
|
3585
|
-
widthList.slice(1).forEach(([minWidth], index) => {
|
|
3586
|
-
const previousMinWidth = widthList[index][0];
|
|
3587
|
-
|
|
3588
|
-
if (previousMinWidth > minWidth) {
|
|
3589
|
-
throw new Error(`mapWindowWidth: sort your values to be mobile first. ${minWidth} is < ${previousMinWidth}, so ${minWidth} should be before ${previousMinWidth}.`);
|
|
3590
|
-
}
|
|
3591
|
-
});
|
|
3592
|
-
}
|
|
3593
|
-
|
|
3594
|
-
const found = widthList.find(([minWidth, value]) => matchWindowSize(dimensions, {
|
|
3595
|
-
minWidth: Number(minWidth)
|
|
3596
|
-
}));
|
|
3597
|
-
if (!found) return null;
|
|
3598
|
-
return found[1];
|
|
3599
|
-
}
|
|
3600
|
-
};
|
|
3601
|
-
}
|
|
3602
|
-
|
|
3603
|
-
function useKittTheme() {
|
|
3604
|
-
const dimensions = reactNative.useWindowDimensions();
|
|
3605
|
-
return react.useMemo(() => {
|
|
3606
|
-
return {
|
|
3607
|
-
kitt: theme,
|
|
3608
|
-
responsive: createWindowSizeHelper(dimensions)
|
|
3609
|
-
};
|
|
3610
|
-
}, [dimensions]);
|
|
3611
|
-
}
|
|
3612
|
-
|
|
3613
3719
|
const hex2rgba = (hex, alpha = 1) => {
|
|
3614
3720
|
const r = parseInt(hex.slice(1, 3), 16);
|
|
3615
3721
|
const g = parseInt(hex.slice(3, 5), 16);
|
|
@@ -3645,25 +3751,26 @@ function MatchWindowSize({
|
|
|
3645
3751
|
}) {
|
|
3646
3752
|
const match = useMatchWindowSize(matchWindowSizeOptions);
|
|
3647
3753
|
if (!match) return null;
|
|
3648
|
-
return
|
|
3649
|
-
children: children
|
|
3650
|
-
});
|
|
3754
|
+
return children;
|
|
3651
3755
|
}
|
|
3652
3756
|
|
|
3653
3757
|
exports.useWindowSize = reactNative.useWindowDimensions;
|
|
3654
3758
|
exports.Avatar = Avatar;
|
|
3655
3759
|
exports.Button = Button;
|
|
3656
3760
|
exports.Card = Card;
|
|
3761
|
+
exports.Checkbox = Checkbox;
|
|
3657
3762
|
exports.Emoji = Emoji;
|
|
3658
3763
|
exports.ExternalLink = ExternalLink;
|
|
3659
3764
|
exports.Flex = Flex;
|
|
3660
3765
|
exports.FullScreenModal = FullScreenModal;
|
|
3661
3766
|
exports.Icon = Icon;
|
|
3662
3767
|
exports.IconButton = IconButton;
|
|
3768
|
+
exports.InputEmail = InputEmail;
|
|
3663
3769
|
exports.InputFeedback = InputFeedback;
|
|
3664
3770
|
exports.InputField = InputField;
|
|
3665
3771
|
exports.InputIcon = InputIcon;
|
|
3666
3772
|
exports.InputPassword = InputPassword;
|
|
3773
|
+
exports.InputPhone = InputPhone;
|
|
3667
3774
|
exports.InputPressable = InputPressable;
|
|
3668
3775
|
exports.InputText = InputText;
|
|
3669
3776
|
exports.KittBreakpoints = KittBreakpoints;
|