@ornikar/kitt-universal 4.4.0 → 4.5.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.
Files changed (52) hide show
  1. package/dist/definitions/Button/AnimatedButtonPressable.web.d.ts +1 -1
  2. package/dist/definitions/forms/DatePicker/DatePicker.d.ts +30 -0
  3. package/dist/definitions/forms/DatePicker/DatePicker.d.ts.map +1 -0
  4. package/dist/definitions/forms/DatePicker/DatePickerInputPart.d.ts +11 -0
  5. package/dist/definitions/forms/DatePicker/DatePickerInputPart.d.ts.map +1 -0
  6. package/dist/definitions/forms/DatePicker/ModalPlatformDateTimePicker.d.ts +11 -0
  7. package/dist/definitions/forms/DatePicker/ModalPlatformDateTimePicker.d.ts.map +1 -0
  8. package/dist/definitions/forms/DatePicker/PlatformDateTimePicker.d.ts +14 -0
  9. package/dist/definitions/forms/DatePicker/PlatformDateTimePicker.d.ts.map +1 -0
  10. package/dist/definitions/forms/InputTag/InputTag.d.ts +10 -0
  11. package/dist/definitions/forms/InputTag/InputTag.d.ts.map +1 -0
  12. package/dist/definitions/forms/InputText/InputTextContainer.web.d.ts +1 -1
  13. package/dist/definitions/index.d.ts +4 -0
  14. package/dist/definitions/index.d.ts.map +1 -1
  15. package/dist/definitions/themes/default.d.ts +2 -0
  16. package/dist/definitions/themes/default.d.ts.map +1 -1
  17. package/dist/definitions/themes/late-ocean/datePicker.d.ts +11 -0
  18. package/dist/definitions/themes/late-ocean/datePicker.d.ts.map +1 -0
  19. package/dist/definitions/themes/late-ocean/forms.d.ts +2 -0
  20. package/dist/definitions/themes/late-ocean/forms.d.ts.map +1 -1
  21. package/dist/definitions/themes/late-ocean/input.d.ts +1 -0
  22. package/dist/definitions/themes/late-ocean/input.d.ts.map +1 -1
  23. package/dist/definitions/themes/late-ocean/inputTag.d.ts +14 -0
  24. package/dist/definitions/themes/late-ocean/inputTag.d.ts.map +1 -0
  25. package/dist/index-browser-all.es.android.js +1135 -773
  26. package/dist/index-browser-all.es.android.js.map +1 -1
  27. package/dist/index-browser-all.es.ios.js +1135 -773
  28. package/dist/index-browser-all.es.ios.js.map +1 -1
  29. package/dist/index-browser-all.es.js +1275 -913
  30. package/dist/index-browser-all.es.js.map +1 -1
  31. package/dist/index-browser-all.es.web.js +855 -490
  32. package/dist/index-browser-all.es.web.js.map +1 -1
  33. package/dist/index-node-14.17.cjs.js +1097 -763
  34. package/dist/index-node-14.17.cjs.js.map +1 -1
  35. package/dist/index-node-14.17.cjs.web.css +1 -1
  36. package/dist/index-node-14.17.cjs.web.js +874 -543
  37. package/dist/index-node-14.17.cjs.web.js.map +1 -1
  38. package/dist/linaria-themes-browser-all.es.android.js +33 -1
  39. package/dist/linaria-themes-browser-all.es.android.js.map +1 -1
  40. package/dist/linaria-themes-browser-all.es.ios.js +33 -1
  41. package/dist/linaria-themes-browser-all.es.ios.js.map +1 -1
  42. package/dist/linaria-themes-browser-all.es.js +33 -1
  43. package/dist/linaria-themes-browser-all.es.js.map +1 -1
  44. package/dist/linaria-themes-browser-all.es.web.js +33 -1
  45. package/dist/linaria-themes-browser-all.es.web.js.map +1 -1
  46. package/dist/linaria-themes-node-14.17.cjs.js +33 -1
  47. package/dist/linaria-themes-node-14.17.cjs.js.map +1 -1
  48. package/dist/linaria-themes-node-14.17.cjs.web.js +33 -1
  49. package/dist/linaria-themes-node-14.17.cjs.web.js.map +1 -1
  50. package/dist/styles.css +1 -1
  51. package/dist/tsbuildinfo +1 -1
  52. package/package.json +2 -2
@@ -10,11 +10,11 @@ const jsxRuntime = require('react/jsx-runtime');
10
10
  const Animated = require('react-native-reanimated');
11
11
  const twemojiParser = require('twemoji-parser');
12
12
  const WebBrowser = require('expo-web-browser');
13
- const reactNativeSafeAreaContext = require('react-native-safe-area-context');
13
+ const reactIntl = require('react-intl');
14
14
  const react$1 = require('@linaria/react');
15
- const expoLinearGradient = require('expo-linear-gradient');
16
15
  const DateTimePicker = require('@react-native-community/datetimepicker');
17
- const reactIntl = require('react-intl');
16
+ const reactNativeSafeAreaContext = require('react-native-safe-area-context');
17
+ const expoLinearGradient = require('expo-linear-gradient');
18
18
  const reactNative$1 = require('@floating-ui/react-native');
19
19
  const addons = require('@storybook/addons');
20
20
 
@@ -57,7 +57,7 @@ function SpinningIcon({
57
57
  });
58
58
  }
59
59
 
60
- const IconContainer = /*#__PURE__*/styled__default.View.withConfig({
60
+ const IconContainer$1 = /*#__PURE__*/styled__default.View.withConfig({
61
61
  displayName: "Icon__IconContainer",
62
62
  componentId: "kitt-universal__sc-usm0ol-0"
63
63
  })(["color:", ";width:", "px;height:", "px;align-self:", ";"], ({
@@ -79,7 +79,7 @@ function Icon({
79
79
  const clonedIcon = /*#__PURE__*/react.cloneElement(icon, {
80
80
  color
81
81
  });
82
- return /*#__PURE__*/jsxRuntime.jsx(IconContainer, {
82
+ return /*#__PURE__*/jsxRuntime.jsx(IconContainer$1, {
83
83
  align: align,
84
84
  size: size,
85
85
  color: color,
@@ -1072,6 +1072,18 @@ const checkbox = {
1072
1072
  markColor: colors.uiBackgroundLight
1073
1073
  };
1074
1074
 
1075
+ const datePicker = {
1076
+ day: {
1077
+ minWidth: 64
1078
+ },
1079
+ month: {
1080
+ minWidth: 64
1081
+ },
1082
+ year: {
1083
+ minWidth: 82
1084
+ }
1085
+ };
1086
+
1075
1087
  const calcLineHeight = (fontSize, lineHeightMultiplier) => Math.round(fontSize * lineHeightMultiplier);
1076
1088
  const createTypographyTypeConfig = (lineHeightMultiplier, baseAndSmallFontSize, mediumAndWideFontSize) => ({
1077
1089
  baseAndSmall: {
@@ -1179,6 +1191,7 @@ const inputStatesStyle = {
1179
1191
  }
1180
1192
  };
1181
1193
  const input = {
1194
+ minHeight: 40,
1182
1195
  color: {
1183
1196
  selection: colors.primary,
1184
1197
  placeholder: typography.colors['black-light']
@@ -1205,6 +1218,23 @@ const inputField = {
1205
1218
  iconMarginLeft: 6
1206
1219
  };
1207
1220
 
1221
+ const inputTag = {
1222
+ success: {
1223
+ backgroundColor: colors.success,
1224
+ labelColor: colors.uiBackgroundLight
1225
+ },
1226
+ danger: {
1227
+ backgroundColor: colors.danger,
1228
+ labelColor: colors.uiBackgroundLight
1229
+ },
1230
+ default: {
1231
+ backgroundColor: lateOceanColorPalette.black50,
1232
+ labelColor: colors.black
1233
+ },
1234
+ borderRadius: 10,
1235
+ iconSize: 13.5
1236
+ };
1237
+
1208
1238
  const radio = {
1209
1239
  size: 18,
1210
1240
  unchecked: {
@@ -1228,11 +1258,13 @@ const textArea = {
1228
1258
  };
1229
1259
 
1230
1260
  const forms = {
1261
+ datePicker,
1231
1262
  input,
1232
1263
  radio,
1233
1264
  inputField,
1234
1265
  textArea,
1235
- checkbox
1266
+ checkbox,
1267
+ inputTag
1236
1268
  };
1237
1269
 
1238
1270
  const fullScreenModal = {
@@ -1521,6 +1553,17 @@ function Checkbox({
1521
1553
  });
1522
1554
  }
1523
1555
 
1556
+ function getInputUIState({
1557
+ isFocused,
1558
+ isDisabled,
1559
+ formState
1560
+ }) {
1561
+ if (isDisabled) return 'disabled';
1562
+ if (isFocused) return 'focus';
1563
+ if (formState === 'invalid') return 'invalid';
1564
+ return 'default';
1565
+ }
1566
+
1524
1567
  const styledTextInputMixin = /*#__PURE__*/styled.css(["background-color:", ";border-width:", "px;border-radius:", "px;border-color:", ";font-size:", ";color:", ";font-family:", ";"], ({
1525
1568
  theme,
1526
1569
  $state
@@ -1543,606 +1586,210 @@ const styledTextInputMixin = /*#__PURE__*/styled.css(["background-color:", ";bor
1543
1586
  theme
1544
1587
  }) => theme.kitt.typography.types.bodies.fontFamily.regular);
1545
1588
 
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, ({
1589
+ const StyledTypographyText = /*#__PURE__*/styled__default(Typography.Text).withConfig({
1590
+ displayName: "DatePickerInputPart__StyledTypographyText",
1591
+ componentId: "kitt-universal__sc-11fmlmi-0"
1592
+ })(["text-align:center;"]);
1593
+ const ViewInput = /*#__PURE__*/styled__default.View.withConfig({
1594
+ displayName: "DatePickerInputPart__ViewInput",
1595
+ componentId: "kitt-universal__sc-11fmlmi-1"
1596
+ })(["", " padding:", ";min-height:", "px;min-width:", ";"], styledTextInputMixin, ({
1597
+ theme
1598
+ }) => theme.kitt.forms.input.padding.default, ({
1599
+ theme
1600
+ }) => theme.kitt.forms.input.minHeight, ({
1566
1601
  theme,
1567
- multiline
1602
+ $partName
1568
1603
  }) => {
1569
- if (!multiline && reactNative.Platform.OS === 'ios') {
1570
- return theme.kitt.forms.input.padding.iOSSingleLine;
1604
+ if (!$partName) {
1605
+ return undefined;
1571
1606
  }
1572
1607
 
1573
- return theme.kitt.forms.input.padding.default;
1574
- }, ({
1575
- theme,
1576
- multiline
1577
- }) => {
1578
- if (!multiline && reactNative.Platform.OS === 'ios') return 0;
1579
- const typeConfigKey = getTypographyTypeConfigKey(theme);
1580
- return `${theme.kitt.typography.types.bodies.configs.body[typeConfigKey].lineHeight}px`;
1581
- }, ({
1582
- $minHeight
1583
- }) => $minHeight);
1584
- const RightInputContainer = /*#__PURE__*/styled__default.View.withConfig({
1585
- displayName: "InputText__RightInputContainer",
1586
- componentId: "kitt-universal__sc-uke279-1"
1587
- })(["position:absolute;right:0;top:0;bottom:0;justify-content:center;padding:10px;"]);
1588
- const InputText = /*#__PURE__*/react.forwardRef(({
1589
- id,
1590
- right,
1591
- minHeight = 0,
1592
- state: formState,
1593
- internalForceState,
1594
- disabled = false,
1595
- autoCorrect = true,
1596
- textContentType = 'none',
1597
- autoCompleteType = 'off',
1598
- keyboardType = 'default',
1599
- onFocus,
1600
- onBlur,
1601
- ...props
1602
- }, ref) => {
1603
- const theme = /*#__PURE__*/styled.useTheme();
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
- });
1608
+ return `${theme.kitt.forms.datePicker[$partName].minWidth}px`;
1637
1609
  });
1638
-
1639
- function InputEmail(props) {
1640
- return /*#__PURE__*/jsxRuntime.jsx(InputText, {
1641
- autoCompleteType: "email",
1642
- keyboardType: "email-address",
1643
- textContentType: "emailAddress",
1644
- ...props
1610
+ function DatePickerInputPart({
1611
+ $state,
1612
+ placeholder,
1613
+ value,
1614
+ partName,
1615
+ disabled
1616
+ }) {
1617
+ return /*#__PURE__*/jsxRuntime.jsx(ViewInput, {
1618
+ $state: $state,
1619
+ $partName: partName,
1620
+ children: placeholder || value ? /*#__PURE__*/jsxRuntime.jsx(StyledTypographyText, {
1621
+ color: !value || disabled ? 'black-light' : undefined,
1622
+ children: value || placeholder
1623
+ }) : null
1645
1624
  });
1646
1625
  }
1647
1626
 
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
1627
+ // Don't use styled.Pressable here - babel-plugin-styled-components-react-native-web only supports tagged templates
1628
+ const OverlayPressable = /*#__PURE__*/styled__default(reactNative.Pressable).withConfig({
1629
+ displayName: "Overlay__OverlayPressable",
1630
+ componentId: "kitt-universal__sc-1cz1gbr-0"
1631
+ })(({
1632
+ theme
1633
+ }) => ({ ...reactNative.StyleSheet.absoluteFillObject,
1634
+ backgroundColor: theme.kitt.colors.overlay.dark
1635
+ }));
1636
+ function Overlay({
1637
+ onPress
1663
1638
  }) {
1664
- return /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
1665
- base: "body-small",
1666
- color: getColorFromState(state),
1667
- testID: testID,
1668
- children: children
1639
+ return /*#__PURE__*/jsxRuntime.jsx(OverlayPressable, {
1640
+ accessibilityRole: "none",
1641
+ onPress: onPress,
1642
+ children: /*#__PURE__*/jsxRuntime.jsx(reactNative.View, {})
1669
1643
  });
1670
1644
  }
1671
1645
 
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;"], ({
1646
+ const BodyView = /*#__PURE__*/styled__default.View.withConfig({
1647
+ displayName: "Body__BodyView",
1648
+ componentId: "kitt-universal__sc-17fwpo4-0"
1649
+ })(["padding:", "px ", "px;"], ({
1688
1650
  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;"], ({
1651
+ }) => theme.kitt.spacing * 6, ({
1694
1652
  theme
1695
- }) => theme.kitt.forms.inputField.iconMarginLeft);
1696
- function InputField({
1697
- label,
1698
- labelFeedback,
1699
- input,
1700
- feedback
1653
+ }) => theme.kitt.spacing * 4);
1654
+ function ModalBody({
1655
+ children
1701
1656
  }) {
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]
1657
+ return /*#__PURE__*/jsxRuntime.jsx(reactNative.ScrollView, {
1658
+ children: /*#__PURE__*/jsxRuntime.jsx(BodyView, {
1659
+ children: children
1660
+ })
1710
1661
  });
1711
1662
  }
1712
1663
 
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
1664
+ const FooterView = /*#__PURE__*/styled__default.View.withConfig({
1665
+ displayName: "Footer__FooterView",
1666
+ componentId: "kitt-universal__sc-1ujq2dc-0"
1667
+ })(["flex:0 0 auto;padding:", "px;border-top-width:1px;border-top-color:", ";"], ({
1668
+ theme
1669
+ }) => theme.kitt.spacing * 4, ({
1670
+ theme
1671
+ }) => theme.kitt.colors.separator);
1672
+ function ModalFooter({
1673
+ children
1732
1674
  }) {
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
1675
+ return /*#__PURE__*/jsxRuntime.jsx(FooterView, {
1676
+ children: children
1739
1677
  });
1740
1678
  }
1741
1679
 
1742
- function InputPressable({ ...props
1743
- }) {
1744
- return /*#__PURE__*/jsxRuntime.jsx(reactNative.Pressable, { ...props
1745
- });
1746
- }
1747
-
1748
- function InputPassword({
1749
- isPasswordDefaultVisible,
1750
- right,
1680
+ function StyleWebWrapper({
1681
+ as,
1682
+ children,
1751
1683
  ...props
1752
1684
  }) {
1753
- const [isVisible, setIsVisible] = react.useState(Boolean(isPasswordDefaultVisible));
1754
- return /*#__PURE__*/jsxRuntime.jsx(InputText, { ...props,
1755
- textContentType: "password",
1756
- autoCompleteType: "password",
1757
- autoCorrect: false,
1758
- secureTextEntry: !isVisible,
1759
- right: right || /*#__PURE__*/jsxRuntime.jsx(InputPressable, {
1760
- accessibilityRole: "button",
1761
- onPress: () => setIsVisible(prev => !prev),
1762
- children: /*#__PURE__*/jsxRuntime.jsx(InputIcon, {
1763
- icon: isVisible ? /*#__PURE__*/jsxRuntime.jsx(kittIcons.EyeOffIcon, {}) : /*#__PURE__*/jsxRuntime.jsx(kittIcons.EyeIcon, {})
1764
- })
1765
- })
1766
- });
1767
- }
1768
-
1769
- function InputPhone(props) {
1770
- return /*#__PURE__*/jsxRuntime.jsx(InputText, { ...props,
1771
- autoCompleteType: "tel",
1772
- keyboardType: "number-pad",
1773
- textContentType: "telephoneNumber"
1685
+ if (reactNative.Platform.OS !== 'web') return children;
1686
+ // as or default to div. If as is undefined, T is div but typescript is not sure
1687
+ return /*#__PURE__*/jsxRuntime.jsx(as || 'div', { ...props,
1688
+ children: children
1774
1689
  });
1775
1690
  }
1776
1691
 
1777
- function Label({
1778
- htmlFor,
1779
- children
1780
- }) {
1781
- return /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
1782
- base: "body",
1783
- children: reactNative.Platform.OS === 'web' ? /*#__PURE__*/jsxRuntime.jsx("label", {
1784
- htmlFor: htmlFor,
1785
- children: children
1786
- }) : children
1692
+ // type $Without<T, K extends keyof any> = T extends any ? Pick<T, Exclude<keyof T, K>> : never;
1693
+ // type $DeepPartial<T> = { [P in keyof T]?: $DeepPartial<T[P]> };
1694
+ // export function withTheme<Props extends { theme: DefaultTheme }, C>(
1695
+ // WrappedComponent: ComponentType<Props> & C,
1696
+ // ): ComponentType<SetOptional<Props, 'theme'>> & hoistNonReactStatics.NonReactStatics<typeof WrappedComponent> {
1697
+ // return function ThemedComponent(props) {
1698
+ // const theme = useTheme();
1699
+ // return (<WrappedComponent theme={theme} {...(props as any)} />) as any;
1700
+ // };
1701
+ // }
1702
+ function withTheme(WrappedComponent) {
1703
+ // eslint-disable-next-line prefer-arrow-callback
1704
+ return /*#__PURE__*/react.forwardRef(function (props, ref) {
1705
+ const theme = /*#__PURE__*/styled.useTheme();
1706
+ return /*#__PURE__*/jsxRuntime.jsx(WrappedComponent, {
1707
+ ref: ref,
1708
+ theme: theme,
1709
+ ...props
1710
+ });
1787
1711
  });
1788
1712
  }
1789
1713
 
1790
- const OuterRadio = /*#__PURE__*/styled__default.View.withConfig({
1791
- displayName: "Radio__OuterRadio",
1792
- componentId: "kitt-universal__sc-1mdgr2o-0"
1793
- })(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;border-width:", "px;border-color:", ";"], ({
1794
- theme,
1795
- disabled
1796
- }) => theme.kitt.forms.radio[disabled ? 'disabled' : 'unchecked'].backgroundColor, ({
1797
- theme
1798
- }) => theme.kitt.forms.radio.size, ({
1714
+ const PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/react$1.styled("div")({
1715
+ name: "PressableIconButtonWebWrapper",
1716
+ class: "p1nlccvg",
1717
+ vars: {
1718
+ "p1nlccvg-0": [({
1719
+ theme,
1720
+ $isDisabled
1721
+ }) => $isDisabled ? 1 : theme.kitt.iconButton.scale.base.hover],
1722
+ "p1nlccvg-2": [({
1723
+ theme,
1724
+ $isDisabled
1725
+ }) => $isDisabled ? 1 : theme.kitt.iconButton.scale.medium.hover],
1726
+ "p1nlccvg-3": [({
1727
+ theme,
1728
+ $isDisabled
1729
+ }) => $isDisabled ? 1 : theme.kitt.iconButton.scale.base.active],
1730
+ "p1nlccvg-4": [({
1731
+ theme,
1732
+ $isWhite,
1733
+ $isDisabled
1734
+ }) => {
1735
+ if ($isDisabled) return theme.kitt.iconButton.disabled.backgroundColor;
1736
+ const {
1737
+ white,
1738
+ default: defaultIconButton
1739
+ } = theme.kitt.iconButton;
1740
+ if ($isWhite) return white.pressedBackgroundColor;
1741
+ return defaultIconButton.pressedBackgroundColor;
1742
+ }]
1743
+ }
1744
+ }));
1745
+ const StyledPressableIconButton = /*#__PURE__*/styled__default.Pressable.withConfig({
1746
+ displayName: "PressableIconButton__StyledPressableIconButton",
1747
+ componentId: "kitt-universal__sc-1m6jo3s-0"
1748
+ })(["border-radius:", "px;width:", "px;height:", "px;align-items:center;justify-content:center;position:relative;background-color:transparent;", ";"], ({
1799
1749
  theme
1800
- }) => theme.kitt.forms.radio.size, ({
1750
+ }) => theme.kitt.iconButton.borderRadius, ({
1801
1751
  theme
1802
- }) => theme.kitt.forms.radio.size / 2, ({
1752
+ }) => theme.kitt.iconButton.width, ({
1803
1753
  theme
1804
- }) => theme.kitt.forms.radio.unchecked.borderWidth, ({
1754
+ }) => theme.kitt.iconButton.height, ({
1805
1755
  theme,
1806
1756
  disabled
1807
- }) => theme.kitt.forms.radio[disabled ? 'disabled' : 'unchecked'].borderColor);
1808
- const SelectedOuterRadio = /*#__PURE__*/styled__default.View.withConfig({
1809
- displayName: "Radio__SelectedOuterRadio",
1810
- componentId: "kitt-universal__sc-1mdgr2o-1"
1811
- })(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;justify-content:center;align-items:center;"], ({
1812
- theme
1813
- }) => theme.kitt.forms.radio.checked.backgroundColor, ({
1814
- theme
1815
- }) => theme.kitt.forms.radio.size, ({
1816
- theme
1817
- }) => theme.kitt.forms.radio.size, ({
1818
- theme
1819
- }) => theme.kitt.forms.radio.size / 2);
1820
- const SelectedInnerRadio = /*#__PURE__*/styled__default.View.withConfig({
1821
- displayName: "Radio__SelectedInnerRadio",
1822
- componentId: "kitt-universal__sc-1mdgr2o-2"
1823
- })(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;"], ({
1824
- theme
1825
- }) => theme.kitt.forms.radio.checked.innerBackgroundColor, ({
1826
- theme
1827
- }) => theme.kitt.forms.radio.checked.innerSize, ({
1828
- theme
1829
- }) => theme.kitt.forms.radio.checked.innerSize, ({
1830
- theme
1831
- }) => theme.kitt.forms.radio.checked.innerSize / 2);
1832
- const Container$4 = /*#__PURE__*/styled__default.Pressable.withConfig({
1833
- displayName: "Radio__Container",
1834
- componentId: "kitt-universal__sc-1mdgr2o-3"
1835
- })(["flex-direction:row;align-items:center;"]);
1836
- const Text = /*#__PURE__*/styled__default(Typography.Text).withConfig({
1837
- displayName: "Radio__Text",
1838
- componentId: "kitt-universal__sc-1mdgr2o-4"
1839
- })(["margin-left:", "px;"], ({
1840
- theme
1841
- }) => theme.kitt.spacing * 2);
1842
- function Radio({
1843
- id,
1844
- checked,
1845
- onChange,
1846
- value,
1847
- disabled = false,
1848
- children
1849
- }) {
1850
- return /*#__PURE__*/jsxRuntime.jsxs(Container$4, {
1851
- nativeID: id,
1852
- disabled: disabled,
1853
- accessibilityRole: "radio",
1854
- "aria-checked": checked,
1855
- focusable: checked && !disabled,
1856
- onPress: () => {
1857
- onChange(value);
1858
- },
1859
- children: [checked && !disabled ? /*#__PURE__*/jsxRuntime.jsx(SelectedOuterRadio, {
1860
- children: /*#__PURE__*/jsxRuntime.jsx(SelectedInnerRadio, {})
1861
- }) : /*#__PURE__*/jsxRuntime.jsx(OuterRadio, {
1862
- disabled: disabled
1863
- }), /*#__PURE__*/jsxRuntime.jsx(Text, {
1864
- base: "body",
1865
- color: disabled ? 'black-light' : 'black',
1866
- children: children
1867
- })]
1868
- });
1869
- }
1870
-
1871
- function TextArea({ ...props
1872
- }) {
1873
- const theme = /*#__PURE__*/styled.useTheme();
1874
- return /*#__PURE__*/jsxRuntime.jsx(InputText, {
1875
- multiline: true,
1876
- textAlignVertical: "top",
1877
- minHeight: theme.kitt.forms.textArea.minHeight,
1878
- ...props
1879
- });
1880
- }
1757
+ }) => {
1758
+ const {
1759
+ iconButton
1760
+ } = theme.kitt;
1881
1761
 
1882
- const Body = /*#__PURE__*/styled__default.View.withConfig({
1883
- displayName: "Body",
1884
- componentId: "kitt-universal__sc-1ofncfn-0"
1885
- })(["", " background-color:", ";flex:1;"], ({
1886
- theme
1887
- }) => theme.responsive.ifWindowSizeMatches({
1888
- minWidth: KittBreakpoints.MEDIUM
1889
- }, `padding-right: ${theme.kitt.spacing * 12}px;
1890
- padding-left: ${theme.kitt.spacing * 12}px;`, `padding-right: ${theme.kitt.spacing * 6}px;
1891
- padding-left: ${theme.kitt.spacing * 6}px;`), ({
1892
- theme
1893
- }) => theme.kitt.colors.uiBackgroundLight);
1894
- function FullScreenModalBody({
1895
- children
1896
- }) {
1897
- return /*#__PURE__*/jsxRuntime.jsx(Body, {
1898
- children: children
1899
- });
1900
- }
1762
+ if (reactNative.Platform.OS !== 'web') {
1763
+ return undefined;
1764
+ }
1901
1765
 
1902
- const SideContainer = /*#__PURE__*/styled__default.View.withConfig({
1903
- displayName: "Header__SideContainer",
1904
- componentId: "kitt-universal__sc-dfmxi1-0"
1905
- })(["", ""], ({
1906
- theme,
1907
- side = 'left'
1908
- }) => {
1909
- const padding = theme.kitt.spacing * 2;
1766
+ const {
1767
+ transition
1768
+ } = iconButton;
1910
1769
 
1911
- if (side === 'left') {
1912
- return `padding-right: ${padding}px;`;
1770
+ if (disabled) {
1771
+ return `
1772
+ background-color: ${iconButton.disabled.backgroundColor};
1773
+ `;
1913
1774
  }
1914
1775
 
1915
- return `padding-left: ${padding}px;`;
1776
+ return `
1777
+ transition: ${transition.property} ${transition.duration} ${transition.timingFunction};
1778
+ `;
1916
1779
  });
1917
-
1918
- function getHeaderHorizontalMediumPadding(spacing) {
1919
- return spacing * 6;
1920
- }
1921
-
1922
- const Header = /*#__PURE__*/styled__default.View.withConfig({
1923
- displayName: "Header",
1924
- componentId: "kitt-universal__sc-dfmxi1-1"
1925
- })(["", ";border-bottom-color:", ";border-bottom-width:1px;flex-direction:row;align-items:center;"], ({
1926
- theme,
1927
- insetTop = 0
1928
- }) => {
1929
- const paddingTop = insetTop + theme.kitt.fullScreenModal.header.paddingVertical;
1930
- const {
1931
- paddingVertical,
1932
- paddingHorizontal
1933
- } = theme.kitt.fullScreenModal.header;
1934
- return theme.responsive.ifWindowSizeMatches({
1935
- minWidth: KittBreakpoints.MEDIUM
1936
- }, `padding: ${paddingTop}px ${getHeaderHorizontalMediumPadding(theme.kitt.spacing)}px ${paddingVertical}px;`, `padding: ${paddingTop}px ${paddingHorizontal}px ${paddingVertical}px;`);
1937
- }, ({
1938
- theme
1939
- }) => theme.kitt.fullScreenModal.header.borderColor);
1940
- const HeaderContent = /*#__PURE__*/styled__default.View.withConfig({
1941
- displayName: "Header__HeaderContent",
1942
- componentId: "kitt-universal__sc-dfmxi1-2"
1943
- })(["", ";", ";justify-content:center;align-items:center;"], ({
1944
- theme,
1945
- leftWidth,
1946
- rightWidth,
1947
- windowWidth
1948
- }) => {
1949
- /*
1950
- * Since we don't have controll over the rendered left and right elements,
1951
- * we must apply some logic to give the title all the available space
1952
- */
1953
- const sideElementMaxWidth = Math.max(leftWidth, rightWidth);
1954
- const parentHorizontalPadding = theme.kitt.fullScreenModal.header.paddingHorizontal * 2;
1955
- const parentHorizontalPaddingMedium = getHeaderHorizontalMediumPadding(theme.kitt.spacing) * 2;
1956
-
1957
- const computeWidth = breakpointPadding => windowWidth - breakpointPadding - sideElementMaxWidth * 2;
1958
-
1959
- return theme.responsive.ifWindowSizeMatches({
1960
- minWidth: KittBreakpoints.MEDIUM
1961
- }, `width: ${computeWidth(parentHorizontalPaddingMedium)}px;`, `width: ${computeWidth(parentHorizontalPadding)}px;`);
1962
- }, ({
1963
- leftWidth,
1964
- rightWidth
1965
- }) => {
1966
- // Depending of the wider element, we must add a margin to fill the diff in space between elements
1967
- const deltaMargin = Math.abs(leftWidth - rightWidth);
1968
-
1969
- if (leftWidth > rightWidth) {
1970
- return `margin-right: ${deltaMargin}px;`;
1971
- }
1972
-
1973
- return `margin-left: ${deltaMargin}px;`;
1974
- });
1975
- function FullScreenModalHeader({
1976
- children,
1977
- right,
1978
- left
1979
- }) {
1980
- const {
1981
- top
1982
- } = reactNativeSafeAreaContext.useSafeAreaInsets();
1983
- const dimensions = reactNative.useWindowDimensions();
1984
- const [leftWidth, setLeftWidth] = react.useState(0);
1985
- const [rightWidth, setRightWidth] = react.useState(0);
1986
-
1987
- const handleLayoutChange = (event, side) => {
1988
- // Prevents react to nullify event on rerenders
1989
- event.persist();
1990
-
1991
- if (side === 'left') {
1992
- setLeftWidth(event.nativeEvent.layout.width);
1993
- return;
1994
- }
1995
-
1996
- setRightWidth(event.nativeEvent.layout.width);
1997
- };
1998
-
1999
- return /*#__PURE__*/jsxRuntime.jsxs(Header, {
2000
- insetTop: reactNative.Platform.OS === 'ios' ? undefined : top,
2001
- children: [left ? /*#__PURE__*/jsxRuntime.jsx(SideContainer, {
2002
- onLayout: e => handleLayoutChange(e, 'left'),
2003
- children: left
2004
- }) : null, /*#__PURE__*/jsxRuntime.jsx(HeaderContent, {
2005
- windowWidth: dimensions.width,
2006
- leftWidth: leftWidth,
2007
- rightWidth: rightWidth,
2008
- children: children
2009
- }), right ? /*#__PURE__*/jsxRuntime.jsx(SideContainer, {
2010
- side: "right",
2011
- onLayout: e => handleLayoutChange(e, 'right'),
2012
- children: right
2013
- }) : null]
2014
- });
2015
- }
2016
-
2017
- const Container$3 = /*#__PURE__*/styled__default.View.withConfig({
2018
- displayName: "FullScreenModal__Container",
2019
- componentId: "kitt-universal__sc-11qpbe3-0"
2020
- })(["flex:1;background-color:", ";"], ({
2021
- theme
2022
- }) => theme.kitt.colors.uiBackground);
2023
- function FullScreenModal({
2024
- children
2025
- }) {
2026
- return /*#__PURE__*/jsxRuntime.jsx(Container$3, {
2027
- children: children
2028
- });
2029
- }
2030
- FullScreenModal.Header = FullScreenModalHeader;
2031
- FullScreenModal.Body = FullScreenModalBody;
2032
-
2033
- function StyleWebWrapper({
2034
- as,
2035
- children,
2036
- ...props
2037
- }) {
2038
- if (reactNative.Platform.OS !== 'web') return children;
2039
- // as or default to div. If as is undefined, T is div but typescript is not sure
2040
- return /*#__PURE__*/jsxRuntime.jsx(as || 'div', { ...props,
2041
- children: children
2042
- });
2043
- }
2044
-
2045
- // type $Without<T, K extends keyof any> = T extends any ? Pick<T, Exclude<keyof T, K>> : never;
2046
- // type $DeepPartial<T> = { [P in keyof T]?: $DeepPartial<T[P]> };
2047
- // export function withTheme<Props extends { theme: DefaultTheme }, C>(
2048
- // WrappedComponent: ComponentType<Props> & C,
2049
- // ): ComponentType<SetOptional<Props, 'theme'>> & hoistNonReactStatics.NonReactStatics<typeof WrappedComponent> {
2050
- // return function ThemedComponent(props) {
2051
- // const theme = useTheme();
2052
- // return (<WrappedComponent theme={theme} {...(props as any)} />) as any;
2053
- // };
2054
- // }
2055
- function withTheme(WrappedComponent) {
2056
- // eslint-disable-next-line prefer-arrow-callback
2057
- return /*#__PURE__*/react.forwardRef(function (props, ref) {
2058
- const theme = /*#__PURE__*/styled.useTheme();
2059
- return /*#__PURE__*/jsxRuntime.jsx(WrappedComponent, {
2060
- ref: ref,
2061
- theme: theme,
2062
- ...props
2063
- });
2064
- });
2065
- }
2066
-
2067
- const PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/react$1.styled("div")({
2068
- name: "PressableIconButtonWebWrapper",
2069
- class: "p1nlccvg",
2070
- vars: {
2071
- "p1nlccvg-0": [({
2072
- theme,
2073
- $isDisabled
2074
- }) => $isDisabled ? 1 : theme.kitt.iconButton.scale.base.hover],
2075
- "p1nlccvg-2": [({
2076
- theme,
2077
- $isDisabled
2078
- }) => $isDisabled ? 1 : theme.kitt.iconButton.scale.medium.hover],
2079
- "p1nlccvg-3": [({
2080
- theme,
2081
- $isDisabled
2082
- }) => $isDisabled ? 1 : theme.kitt.iconButton.scale.base.active],
2083
- "p1nlccvg-4": [({
2084
- theme,
2085
- $isWhite,
2086
- $isDisabled
2087
- }) => {
2088
- if ($isDisabled) return theme.kitt.iconButton.disabled.backgroundColor;
2089
- const {
2090
- white,
2091
- default: defaultIconButton
2092
- } = theme.kitt.iconButton;
2093
- if ($isWhite) return white.pressedBackgroundColor;
2094
- return defaultIconButton.pressedBackgroundColor;
2095
- }]
2096
- }
2097
- }));
2098
- const StyledPressableIconButton = /*#__PURE__*/styled__default.Pressable.withConfig({
2099
- displayName: "PressableIconButton__StyledPressableIconButton",
2100
- componentId: "kitt-universal__sc-1m6jo3s-0"
2101
- })(["border-radius:", "px;width:", "px;height:", "px;align-items:center;justify-content:center;position:relative;background-color:transparent;", ";"], ({
2102
- theme
2103
- }) => theme.kitt.iconButton.borderRadius, ({
2104
- theme
2105
- }) => theme.kitt.iconButton.width, ({
2106
- theme
2107
- }) => theme.kitt.iconButton.height, ({
2108
- theme,
2109
- disabled
2110
- }) => {
2111
- const {
2112
- iconButton
2113
- } = theme.kitt;
2114
-
2115
- if (reactNative.Platform.OS !== 'web') {
2116
- return undefined;
2117
- }
2118
-
2119
- const {
2120
- transition
2121
- } = iconButton;
2122
-
2123
- if (disabled) {
2124
- return `
2125
- background-color: ${iconButton.disabled.backgroundColor};
2126
- `;
2127
- }
2128
-
2129
- return `
2130
- transition: ${transition.property} ${transition.duration} ${transition.timingFunction};
2131
- `;
2132
- });
2133
- function PressableIconButton({
2134
- color,
2135
- disabled,
2136
- ...props
2137
- }) {
2138
- return /*#__PURE__*/jsxRuntime.jsx(StyleWebWrapper, {
2139
- as: PressableIconButtonWebWrapper,
2140
- $isWhite: color === 'white',
2141
- $isDisabled: Boolean(disabled),
2142
- children: /*#__PURE__*/jsxRuntime.jsx(StyledPressableIconButton, { ...props,
2143
- disabled: disabled
2144
- })
2145
- });
1780
+ function PressableIconButton({
1781
+ color,
1782
+ disabled,
1783
+ ...props
1784
+ }) {
1785
+ return /*#__PURE__*/jsxRuntime.jsx(StyleWebWrapper, {
1786
+ as: PressableIconButtonWebWrapper,
1787
+ $isWhite: color === 'white',
1788
+ $isDisabled: Boolean(disabled),
1789
+ children: /*#__PURE__*/jsxRuntime.jsx(StyledPressableIconButton, { ...props,
1790
+ disabled: disabled
1791
+ })
1792
+ });
2146
1793
  }
2147
1794
 
2148
1795
  const AnimatedIconButtonBackground = /*#__PURE__*/styled__default(Animated__default.View).withConfig({
@@ -2265,61 +1912,897 @@ function PressableAnimatedContainer({
2265
1912
  });
2266
1913
  }
2267
1914
 
2268
- const IconButtonContentBorder = /*#__PURE__*/styled__default.View.withConfig({
2269
- displayName: "IconButton__IconButtonContentBorder",
2270
- componentId: "kitt-universal__sc-swelbf-0"
2271
- })(["border:", ";border-color:", ";width:", "px;height:", "px;align-items:center;justify-content:center;border-radius:", "px;"], ({
2272
- theme
2273
- }) => `${theme.kitt.iconButton.borderWidth}px solid`, ({
2274
- theme,
2275
- disabled
2276
- }) => disabled ? theme.kitt.iconButton.disabled.borderColor : theme.kitt.iconButton.borderColor, ({
2277
- theme
2278
- }) => theme.kitt.iconButton.width - theme.kitt.iconButton.borderWidth, ({
2279
- theme
2280
- }) => theme.kitt.iconButton.height - theme.kitt.iconButton.borderWidth, ({
2281
- theme
2282
- }) => theme.kitt.iconButton.borderRadius);
1915
+ const IconButtonContentBorder = /*#__PURE__*/styled__default.View.withConfig({
1916
+ displayName: "IconButton__IconButtonContentBorder",
1917
+ componentId: "kitt-universal__sc-swelbf-0"
1918
+ })(["border:", ";border-color:", ";width:", "px;height:", "px;align-items:center;justify-content:center;border-radius:", "px;"], ({
1919
+ theme
1920
+ }) => `${theme.kitt.iconButton.borderWidth}px solid`, ({
1921
+ theme,
1922
+ disabled
1923
+ }) => disabled ? theme.kitt.iconButton.disabled.borderColor : theme.kitt.iconButton.borderColor, ({
1924
+ theme
1925
+ }) => theme.kitt.iconButton.width - theme.kitt.iconButton.borderWidth, ({
1926
+ theme
1927
+ }) => theme.kitt.iconButton.height - theme.kitt.iconButton.borderWidth, ({
1928
+ theme
1929
+ }) => theme.kitt.iconButton.borderRadius);
1930
+
1931
+ function IconButtonContent({
1932
+ disabled,
1933
+ color,
1934
+ icon
1935
+ }) {
1936
+ return /*#__PURE__*/jsxRuntime.jsx(IconButtonContentBorder, {
1937
+ disabled: disabled,
1938
+ children: /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
1939
+ color: disabled ? 'black-light' : color,
1940
+ icon: icon
1941
+ })
1942
+ });
1943
+ }
1944
+
1945
+ function IconButton({
1946
+ icon,
1947
+ color,
1948
+ disabled,
1949
+ testID,
1950
+ accessibilityLabel,
1951
+ accessibilityRole,
1952
+ onPress
1953
+ }) {
1954
+ return /*#__PURE__*/jsxRuntime.jsx(PressableAnimatedContainer, {
1955
+ color: color,
1956
+ disabled: disabled,
1957
+ testID: testID,
1958
+ accessibilityLabel: accessibilityLabel,
1959
+ accessibilityRole: accessibilityRole,
1960
+ onPress: onPress,
1961
+ children: /*#__PURE__*/jsxRuntime.jsx(IconButtonContent, {
1962
+ disabled: disabled,
1963
+ color: color,
1964
+ icon: icon
1965
+ })
1966
+ });
1967
+ }
1968
+
1969
+ const OnCloseContext = /*#__PURE__*/react.createContext(() => {});
1970
+
1971
+ const HeaderView = /*#__PURE__*/styled__default.View.withConfig({
1972
+ displayName: "Header__HeaderView",
1973
+ componentId: "kitt-universal__sc-1iwabch-0"
1974
+ })(["position:relative;padding:", "px;display:flex;flex:0 0 auto;flex-direction:row;justify-content:space-between;align-items:center;border-bottom-width:1px;border-bottom-color:", ";min-height:57px;"], ({
1975
+ theme
1976
+ }) => theme.kitt.spacing * 2, ({
1977
+ theme
1978
+ }) => theme.kitt.colors.separator);
1979
+ const LeftIconView = /*#__PURE__*/styled__default.View.withConfig({
1980
+ displayName: "Header__LeftIconView",
1981
+ componentId: "kitt-universal__sc-1iwabch-1"
1982
+ })(["align-self:flex-start;margin-right:", "px;"], ({
1983
+ theme
1984
+ }) => theme.kitt.spacing * 2);
1985
+ const RightIconView = /*#__PURE__*/styled__default.View.withConfig({
1986
+ displayName: "Header__RightIconView",
1987
+ componentId: "kitt-universal__sc-1iwabch-2"
1988
+ })(["align-self:flex-start;margin-left:", "px;"], ({
1989
+ theme
1990
+ }) => theme.kitt.spacing * 2);
1991
+ const TitleView = /*#__PURE__*/styled__default.View.withConfig({
1992
+ displayName: "Header__TitleView",
1993
+ componentId: "kitt-universal__sc-1iwabch-3"
1994
+ })(["padding-left:", "px;flex-shrink:1;"], ({
1995
+ theme,
1996
+ isIconLeft
1997
+ }) => isIconLeft ? 0 : theme.kitt.spacing * 2);
1998
+ function ModalHeader({
1999
+ left,
2000
+ right,
2001
+ children
2002
+ }) {
2003
+ const onClose = react.useContext(OnCloseContext);
2004
+ const isIconLeft = !!left;
2005
+ return /*#__PURE__*/jsxRuntime.jsxs(HeaderView, {
2006
+ children: [isIconLeft && /*#__PURE__*/jsxRuntime.jsx(LeftIconView, {
2007
+ children: left
2008
+ }), /*#__PURE__*/jsxRuntime.jsx(TitleView, {
2009
+ isIconLeft: isIconLeft,
2010
+ children: children
2011
+ }), right !== undefined ? right : /*#__PURE__*/jsxRuntime.jsx(RightIconView, {
2012
+ children: /*#__PURE__*/jsxRuntime.jsx(IconButton, {
2013
+ icon: /*#__PURE__*/jsxRuntime.jsx(kittIcons.XIcon, {}),
2014
+ onPress: onClose
2015
+ })
2016
+ })]
2017
+ });
2018
+ }
2019
+
2020
+ const ModalView = /*#__PURE__*/styled__default.View.withConfig({
2021
+ displayName: "Modal__ModalView",
2022
+ componentId: "kitt-universal__sc-1xy2w5u-0"
2023
+ })(["top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:", "px ", "px;"], ({
2024
+ theme
2025
+ }) => theme.kitt.spacing * 20, ({
2026
+ theme
2027
+ }) => theme.kitt.spacing * 4);
2028
+ const ContentView$1 = /*#__PURE__*/styled__default.View.withConfig({
2029
+ displayName: "Modal__ContentView",
2030
+ componentId: "kitt-universal__sc-1xy2w5u-1"
2031
+ })(["position:relative;display:flex;flex-direction:column;max-height:100%;max-width:540px;height:auto;width:100%;border-radius:", "px;background-color:", ";"], ({
2032
+ theme
2033
+ }) => theme.kitt.card.borderRadius, ({
2034
+ theme
2035
+ }) => theme.kitt.colors.uiBackgroundLight);
2036
+ function Modal({
2037
+ visible,
2038
+ children,
2039
+ onClose,
2040
+ onEntered,
2041
+ onExited
2042
+ }) {
2043
+ return /*#__PURE__*/jsxRuntime.jsx(OnCloseContext.Provider, {
2044
+ value: onClose,
2045
+ children: /*#__PURE__*/jsxRuntime.jsx(reactNative.Modal, {
2046
+ transparent: true,
2047
+ animationType: "fade",
2048
+ visible: visible,
2049
+ onShow: onEntered,
2050
+ onDismiss: onExited,
2051
+ onRequestClose: onClose,
2052
+ children: /*#__PURE__*/jsxRuntime.jsxs(ModalView, {
2053
+ children: [/*#__PURE__*/jsxRuntime.jsx(Overlay, {
2054
+ onPress: onClose
2055
+ }), /*#__PURE__*/jsxRuntime.jsx(ContentView$1, {
2056
+ children: children
2057
+ })]
2058
+ })
2059
+ })
2060
+ });
2061
+ }
2062
+ Modal.Header = ModalHeader;
2063
+ Modal.Body = ModalBody;
2064
+ Modal.Footer = ModalFooter;
2065
+
2066
+ function getDatePickerDisplayMode() {
2067
+ if (reactNative.Platform.OS === 'android') return 'calendar';
2068
+ if (reactNative.Platform.OS === 'ios') return 'spinner';
2069
+ return 'default';
2070
+ }
2071
+
2072
+ function PlatformDateTimePicker({
2073
+ value,
2074
+ defaultDate = new Date(),
2075
+ maximumDate,
2076
+ minimuDate,
2077
+ testID,
2078
+ onChange
2079
+ }) {
2080
+ const theme = /*#__PURE__*/styled.useTheme();
2081
+ const displayMode = getDatePickerDisplayMode();
2082
+ const iosProps = reactNative.Platform.OS === 'ios' ? {
2083
+ textColor: theme.kitt.colors.primary
2084
+ } : {};
2085
+ return /*#__PURE__*/jsxRuntime.jsx(DateTimePicker__default, {
2086
+ is24Hour: true,
2087
+ testID: testID,
2088
+ value: value || defaultDate,
2089
+ mode: "date",
2090
+ maximumDate: maximumDate,
2091
+ minimumDate: minimuDate,
2092
+ display: displayMode,
2093
+ ...iosProps,
2094
+ onChange: (_event, date) => onChange(date)
2095
+ });
2096
+ }
2097
+
2098
+ function ModalTitle({
2099
+ children
2100
+ }) {
2101
+ return /*#__PURE__*/jsxRuntime.jsx(Modal.Header, {
2102
+ children: /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
2103
+ base: "body",
2104
+ variant: "bold",
2105
+ children: children
2106
+ })
2107
+ });
2108
+ }
2109
+
2110
+ function ModalPlatformDateTimePicker({
2111
+ title,
2112
+ isVisible,
2113
+ value,
2114
+ validateButtonLabel,
2115
+ onClose,
2116
+ onChange,
2117
+ ...props
2118
+ }) {
2119
+ const [currentValue, setCurrentValue] = react.useState(value); // Prevent unsynced value between the modal and its parent state
2120
+
2121
+ return /*#__PURE__*/jsxRuntime.jsx(Modal, {
2122
+ visible: Boolean(isVisible),
2123
+ onClose: () => {
2124
+ setCurrentValue(value);
2125
+ onClose();
2126
+ },
2127
+ children: isVisible ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
2128
+ children: [title ? /*#__PURE__*/jsxRuntime.jsx(ModalTitle, {
2129
+ children: title
2130
+ }) : null, /*#__PURE__*/jsxRuntime.jsx(Modal.Body, {
2131
+ children: /*#__PURE__*/jsxRuntime.jsx(PlatformDateTimePicker, { ...props,
2132
+ value: currentValue,
2133
+ onChange: newDate => {
2134
+ setCurrentValue(prev => {
2135
+ return newDate || prev;
2136
+ });
2137
+ }
2138
+ })
2139
+ }), /*#__PURE__*/jsxRuntime.jsx(Modal.Footer, {
2140
+ children: /*#__PURE__*/jsxRuntime.jsx(Button, {
2141
+ stretch: true,
2142
+ type: "primary",
2143
+ onPress: () => {
2144
+ onChange(currentValue);
2145
+ },
2146
+ children: validateButtonLabel ? /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
2147
+ children: validateButtonLabel
2148
+ }) : /*#__PURE__*/jsxRuntime.jsx(reactIntl.FormattedMessage, {
2149
+ id: "kitt-universal.ModalDateTimePicker.confirm"
2150
+ })
2151
+ })
2152
+ })]
2153
+ }) : null
2154
+ });
2155
+ }
2156
+
2157
+ function prefixWithZero(value) {
2158
+ return `${value}`.padStart(2, '0');
2159
+ }
2160
+
2161
+ const PartContainer = /*#__PURE__*/styled__default.View.withConfig({
2162
+ displayName: "DatePicker__PartContainer",
2163
+ componentId: "kitt-universal__sc-ebllsn-0"
2164
+ })(["margin-right:", ";", ";"], ({
2165
+ theme,
2166
+ $isLast
2167
+ }) => !$isLast ? `${theme.kitt.spacing * 2}px` : 0, ({
2168
+ $isStretch
2169
+ }) => $isStretch ? styled.css(["flex:0.33;flex-grow:1;"]) : undefined);
2170
+ const DatePickerPressable = /*#__PURE__*/styled__default.Pressable.withConfig({
2171
+ displayName: "DatePicker__DatePickerPressable",
2172
+ componentId: "kitt-universal__sc-ebllsn-1"
2173
+ })(["display:flex;flex-direction:row;", ";"], ({
2174
+ $isStretch
2175
+ }) => {
2176
+ if ($isStretch) {
2177
+ return styled.css(["width:100%;"]);
2178
+ }
2179
+
2180
+ return styled.css(["align-self:baseline;"]);
2181
+ });
2182
+ function DatePicker({
2183
+ value,
2184
+ id,
2185
+ disabled,
2186
+ placeholder,
2187
+ state,
2188
+ internalForceState,
2189
+ testID,
2190
+ stretch,
2191
+ pickerDefaultDate,
2192
+ pickerUITestID,
2193
+ pickerUITitle,
2194
+ pickerUIValidateButtonLabel,
2195
+ onChange,
2196
+ onFocus,
2197
+ onBlur
2198
+ }) {
2199
+ const [isPickerUIVisible, setIsPickerUIVisible] = react.useState(false);
2200
+ const [isFocused, setIsFocused] = react.useState(false);
2201
+ const [currentValue, setCurrentValue] = react.useState(value);
2202
+
2203
+ const handleModalClose = () => {
2204
+ if (onBlur) onBlur();
2205
+ setIsPickerUIVisible(false);
2206
+ setIsFocused(false);
2207
+ };
2208
+
2209
+ const handleChange = newDate => {
2210
+ setCurrentValue(newDate);
2211
+ onChange(newDate);
2212
+ handleModalClose();
2213
+ };
2214
+
2215
+ const currentState = internalForceState || getInputUIState({
2216
+ isFocused,
2217
+ isDisabled: Boolean(disabled),
2218
+ formState: state
2219
+ });
2220
+ const sharedPickerProps = {
2221
+ testID: pickerUITestID,
2222
+ value: currentValue,
2223
+ onChange: handleChange
2224
+ };
2225
+ const sharedPartProps = {
2226
+ disabled,
2227
+ $state: currentState,
2228
+ defaultDate: pickerDefaultDate
2229
+ };
2230
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
2231
+ children: [/*#__PURE__*/jsxRuntime.jsxs(DatePickerPressable, {
2232
+ $isStretch: stretch,
2233
+ nativeID: id,
2234
+ disabled: disabled,
2235
+ testID: testID,
2236
+ onPress: () => {
2237
+ if (onFocus) onFocus();
2238
+ setIsPickerUIVisible(true);
2239
+ setIsFocused(true);
2240
+ },
2241
+ children: [/*#__PURE__*/jsxRuntime.jsx(PartContainer, {
2242
+ $isStretch: stretch,
2243
+ children: /*#__PURE__*/jsxRuntime.jsx(DatePickerInputPart, { ...sharedPartProps,
2244
+ partName: "day",
2245
+ value: currentValue ? prefixWithZero(currentValue.getDate()) : undefined,
2246
+ placeholder: placeholder?.day
2247
+ })
2248
+ }), /*#__PURE__*/jsxRuntime.jsx(PartContainer, {
2249
+ $isStretch: stretch,
2250
+ children: /*#__PURE__*/jsxRuntime.jsx(DatePickerInputPart, { ...sharedPartProps,
2251
+ partName: "month",
2252
+ value: currentValue ? prefixWithZero(currentValue.getMonth() + 1) : undefined,
2253
+ placeholder: placeholder?.month
2254
+ })
2255
+ }), /*#__PURE__*/jsxRuntime.jsx(PartContainer, {
2256
+ $isLast: true,
2257
+ $isStretch: stretch,
2258
+ children: /*#__PURE__*/jsxRuntime.jsx(DatePickerInputPart, { ...sharedPartProps,
2259
+ partName: "year",
2260
+ value: currentValue?.getFullYear(),
2261
+ placeholder: placeholder?.year
2262
+ })
2263
+ })]
2264
+ }), /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
2265
+ children: [reactNative.Platform.OS === 'android' && isPickerUIVisible ? /*#__PURE__*/jsxRuntime.jsx(PlatformDateTimePicker, { ...sharedPickerProps
2266
+ }) : null, reactNative.Platform.OS !== 'android' ? /*#__PURE__*/jsxRuntime.jsx(ModalPlatformDateTimePicker, { ...sharedPickerProps,
2267
+ isVisible: isPickerUIVisible,
2268
+ title: pickerUITitle,
2269
+ validateButtonLabel: pickerUIValidateButtonLabel,
2270
+ onClose: handleModalClose,
2271
+ onChange: handleChange
2272
+ }) : null]
2273
+ })]
2274
+ });
2275
+ }
2276
+
2277
+ const InputTextContainer = /*#__PURE__*/styled__default.View.withConfig({
2278
+ displayName: "InputTextContainer",
2279
+ componentId: "kitt-universal__sc-8j6fjq-0"
2280
+ })(["position:relative;"]);
2281
+
2282
+ const StyledTextInput = /*#__PURE__*/styled__default(reactNative.TextInput).withConfig({
2283
+ displayName: "InputText__StyledTextInput",
2284
+ componentId: "kitt-universal__sc-uke279-0"
2285
+ })(["", " padding:", ";line-height:", ";width:100%;min-height:", "px;"], styledTextInputMixin, ({
2286
+ theme,
2287
+ multiline
2288
+ }) => {
2289
+ if (!multiline && reactNative.Platform.OS === 'ios') {
2290
+ return theme.kitt.forms.input.padding.iOSSingleLine;
2291
+ }
2292
+
2293
+ return theme.kitt.forms.input.padding.default;
2294
+ }, ({
2295
+ theme,
2296
+ multiline
2297
+ }) => {
2298
+ if (!multiline && reactNative.Platform.OS === 'ios') return 0;
2299
+ const typeConfigKey = getTypographyTypeConfigKey(theme);
2300
+ return `${theme.kitt.typography.types.bodies.configs.body[typeConfigKey].lineHeight}px`;
2301
+ }, ({
2302
+ $minHeight
2303
+ }) => $minHeight);
2304
+ const RightInputContainer = /*#__PURE__*/styled__default.View.withConfig({
2305
+ displayName: "InputText__RightInputContainer",
2306
+ componentId: "kitt-universal__sc-uke279-1"
2307
+ })(["position:absolute;right:0;top:0;bottom:0;justify-content:center;padding:10px;"]);
2308
+ const InputText = /*#__PURE__*/react.forwardRef(({
2309
+ id,
2310
+ right,
2311
+ minHeight = 0,
2312
+ state: formState,
2313
+ internalForceState,
2314
+ disabled = false,
2315
+ autoCorrect = true,
2316
+ textContentType = 'none',
2317
+ autoCompleteType = 'off',
2318
+ keyboardType = 'default',
2319
+ onFocus,
2320
+ onBlur,
2321
+ ...props
2322
+ }, ref) => {
2323
+ const theme = /*#__PURE__*/styled.useTheme();
2324
+ const [isFocused, setIsFocused] = react.useState(false);
2325
+ const state = internalForceState || getInputUIState({
2326
+ isFocused,
2327
+ isDisabled: disabled,
2328
+ formState
2329
+ });
2330
+ return /*#__PURE__*/jsxRuntime.jsxs(InputTextContainer, {
2331
+ $isDisabled: disabled,
2332
+ children: [/*#__PURE__*/jsxRuntime.jsx(StyledTextInput, {
2333
+ ref: ref,
2334
+ nativeID: id,
2335
+ editable: !disabled,
2336
+ keyboardType: keyboardType,
2337
+ autoCompleteType: autoCompleteType,
2338
+ autoCorrect: autoCorrect,
2339
+ $minHeight: minHeight,
2340
+ textContentType: textContentType,
2341
+ placeholderTextColor: theme.kitt.forms.input.color.placeholder,
2342
+ selectionColor: theme.kitt.forms.input.color.selection,
2343
+ ...props,
2344
+ $state: state,
2345
+ onFocus: e => {
2346
+ setIsFocused(true);
2347
+ if (onFocus) onFocus(e);
2348
+ },
2349
+ onBlur: e => {
2350
+ setIsFocused(false);
2351
+ if (onBlur) onBlur(e);
2352
+ }
2353
+ }), right ? /*#__PURE__*/jsxRuntime.jsx(RightInputContainer, {
2354
+ children: right
2355
+ }) : null]
2356
+ });
2357
+ });
2358
+
2359
+ function InputEmail(props) {
2360
+ return /*#__PURE__*/jsxRuntime.jsx(InputText, {
2361
+ autoCompleteType: "email",
2362
+ keyboardType: "email-address",
2363
+ textContentType: "emailAddress",
2364
+ ...props
2365
+ });
2366
+ }
2367
+
2368
+ const getColorFromState = state => {
2369
+ switch (state) {
2370
+ case 'invalid':
2371
+ return 'danger';
2372
+
2373
+ case 'valid':
2374
+ default:
2375
+ return 'black-light';
2376
+ }
2377
+ };
2378
+
2379
+ function InputFeedback({
2380
+ state,
2381
+ testID,
2382
+ children
2383
+ }) {
2384
+ return /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
2385
+ base: "body-small",
2386
+ color: getColorFromState(state),
2387
+ testID: testID,
2388
+ children: children
2389
+ });
2390
+ }
2391
+
2392
+ const FieldContainer = /*#__PURE__*/styled__default.View.withConfig({
2393
+ displayName: "InputField__FieldContainer",
2394
+ componentId: "kitt-universal__sc-13fkixs-0"
2395
+ })(["padding:5px 0 10px;"]);
2396
+ const FeedbackContainer = /*#__PURE__*/styled__default.View.withConfig({
2397
+ displayName: "InputField__FeedbackContainer",
2398
+ componentId: "kitt-universal__sc-13fkixs-1"
2399
+ })(["", ";"], ({
2400
+ theme
2401
+ }) => theme.responsive.ifWindowSizeMatches({
2402
+ minWidth: KittBreakpoints.SMALL
2403
+ }, 'padding-top: 10px', 'padding-top: 5px'));
2404
+ const FieldLabelContainer = /*#__PURE__*/styled__default.View.withConfig({
2405
+ displayName: "InputField__FieldLabelContainer",
2406
+ componentId: "kitt-universal__sc-13fkixs-2"
2407
+ })(["flex-direction:row;align-items:center;padding-bottom:", "px;"], ({
2408
+ theme
2409
+ }) => theme.kitt.forms.inputField.labelContainerPaddingBottom);
2410
+ const LabelContainer = /*#__PURE__*/styled__default.View.withConfig({
2411
+ displayName: "InputField__LabelContainer",
2412
+ componentId: "kitt-universal__sc-13fkixs-3"
2413
+ })(["margin-right:", "px;"], ({
2414
+ theme
2415
+ }) => theme.kitt.forms.inputField.iconMarginLeft);
2416
+ function InputField({
2417
+ label,
2418
+ labelFeedback,
2419
+ input,
2420
+ feedback
2421
+ }) {
2422
+ return /*#__PURE__*/jsxRuntime.jsxs(FieldContainer, {
2423
+ children: [label ? /*#__PURE__*/jsxRuntime.jsxs(FieldLabelContainer, {
2424
+ children: [/*#__PURE__*/jsxRuntime.jsx(LabelContainer, {
2425
+ children: label
2426
+ }), labelFeedback]
2427
+ }) : null, input, feedback ? /*#__PURE__*/jsxRuntime.jsx(FeedbackContainer, {
2428
+ children: feedback
2429
+ }) : null]
2430
+ });
2431
+ }
2432
+
2433
+ function getIconColor(state, disabled) {
2434
+ if (disabled) return 'black-light';
2435
+
2436
+ switch (state) {
2437
+ case 'invalid':
2438
+ return 'danger';
2439
+
2440
+ case 'valid':
2441
+ return 'success';
2442
+
2443
+ default:
2444
+ return undefined;
2445
+ }
2446
+ }
2447
+
2448
+ function InputIcon({
2449
+ icon,
2450
+ state,
2451
+ disabled
2452
+ }) {
2453
+ const theme = /*#__PURE__*/styled.useTheme();
2454
+ const color = getIconColor(state, disabled);
2455
+ return /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
2456
+ color: color,
2457
+ icon: icon,
2458
+ size: theme.kitt.forms.input.icon.size
2459
+ });
2460
+ }
2461
+
2462
+ function InputPressable({ ...props
2463
+ }) {
2464
+ return /*#__PURE__*/jsxRuntime.jsx(reactNative.Pressable, { ...props
2465
+ });
2466
+ }
2467
+
2468
+ function InputPassword({
2469
+ isPasswordDefaultVisible,
2470
+ right,
2471
+ ...props
2472
+ }) {
2473
+ const [isVisible, setIsVisible] = react.useState(Boolean(isPasswordDefaultVisible));
2474
+ return /*#__PURE__*/jsxRuntime.jsx(InputText, { ...props,
2475
+ textContentType: "password",
2476
+ autoCompleteType: "password",
2477
+ autoCorrect: false,
2478
+ secureTextEntry: !isVisible,
2479
+ right: right || /*#__PURE__*/jsxRuntime.jsx(InputPressable, {
2480
+ accessibilityRole: "button",
2481
+ onPress: () => setIsVisible(prev => !prev),
2482
+ children: /*#__PURE__*/jsxRuntime.jsx(InputIcon, {
2483
+ icon: isVisible ? /*#__PURE__*/jsxRuntime.jsx(kittIcons.EyeOffIcon, {}) : /*#__PURE__*/jsxRuntime.jsx(kittIcons.EyeIcon, {})
2484
+ })
2485
+ })
2486
+ });
2487
+ }
2488
+
2489
+ function InputPhone(props) {
2490
+ return /*#__PURE__*/jsxRuntime.jsx(InputText, { ...props,
2491
+ autoCompleteType: "tel",
2492
+ keyboardType: "number-pad",
2493
+ textContentType: "telephoneNumber"
2494
+ });
2495
+ }
2496
+
2497
+ const getTypographyColor = type => type ? 'white' : 'black';
2498
+
2499
+ const InputTagContainer = /*#__PURE__*/styled__default(reactNative.View).withConfig({
2500
+ displayName: "InputTag__InputTagContainer",
2501
+ componentId: "kitt-universal__sc-1511dsf-0"
2502
+ })(["align-items:center;justify-content:center;flex-direction:row;align-self:flex-start;overflow:hidden;padding-horizontal:", "px;background-color:", ";border-radius:", "px;"], ({
2503
+ theme
2504
+ }) => theme.kitt.spacing * 2, ({
2505
+ theme,
2506
+ type
2507
+ }) => {
2508
+ if (type === 'success') {
2509
+ return theme.kitt.forms.inputTag.success.backgroundColor;
2510
+ }
2511
+
2512
+ if (type === 'danger') {
2513
+ return theme.kitt.forms.inputTag.danger.backgroundColor;
2514
+ }
2515
+
2516
+ return theme.kitt.forms.inputTag.default.backgroundColor;
2517
+ }, ({
2518
+ theme
2519
+ }) => theme.kitt.forms.inputTag.borderRadius);
2520
+ const IconContainer = /*#__PURE__*/styled__default(reactNative.View).withConfig({
2521
+ displayName: "InputTag__IconContainer",
2522
+ componentId: "kitt-universal__sc-1511dsf-1"
2523
+ })(["margin-right:", "px;"], ({
2524
+ theme
2525
+ }) => theme.kitt.spacing);
2526
+ function InputTag({
2527
+ children,
2528
+ type,
2529
+ icon
2530
+ }) {
2531
+ const typographyColor = getTypographyColor(type);
2532
+ const theme = useKittTheme();
2533
+ return /*#__PURE__*/jsxRuntime.jsxs(InputTagContainer, {
2534
+ type: type,
2535
+ children: [icon && /*#__PURE__*/jsxRuntime.jsx(IconContainer, {
2536
+ children: /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
2537
+ icon: icon,
2538
+ size: theme.kitt.forms.inputTag.iconSize,
2539
+ color: typographyColor
2540
+ })
2541
+ }), /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
2542
+ base: "body-small",
2543
+ color: typographyColor,
2544
+ children: children
2545
+ })]
2546
+ });
2547
+ }
2548
+
2549
+ function Label({
2550
+ htmlFor,
2551
+ children
2552
+ }) {
2553
+ return /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
2554
+ base: "body",
2555
+ children: reactNative.Platform.OS === 'web' ? /*#__PURE__*/jsxRuntime.jsx("label", {
2556
+ htmlFor: htmlFor,
2557
+ children: children
2558
+ }) : children
2559
+ });
2560
+ }
2561
+
2562
+ const OuterRadio = /*#__PURE__*/styled__default.View.withConfig({
2563
+ displayName: "Radio__OuterRadio",
2564
+ componentId: "kitt-universal__sc-1mdgr2o-0"
2565
+ })(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;border-width:", "px;border-color:", ";"], ({
2566
+ theme,
2567
+ disabled
2568
+ }) => theme.kitt.forms.radio[disabled ? 'disabled' : 'unchecked'].backgroundColor, ({
2569
+ theme
2570
+ }) => theme.kitt.forms.radio.size, ({
2571
+ theme
2572
+ }) => theme.kitt.forms.radio.size, ({
2573
+ theme
2574
+ }) => theme.kitt.forms.radio.size / 2, ({
2575
+ theme
2576
+ }) => theme.kitt.forms.radio.unchecked.borderWidth, ({
2577
+ theme,
2578
+ disabled
2579
+ }) => theme.kitt.forms.radio[disabled ? 'disabled' : 'unchecked'].borderColor);
2580
+ const SelectedOuterRadio = /*#__PURE__*/styled__default.View.withConfig({
2581
+ displayName: "Radio__SelectedOuterRadio",
2582
+ componentId: "kitt-universal__sc-1mdgr2o-1"
2583
+ })(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;justify-content:center;align-items:center;"], ({
2584
+ theme
2585
+ }) => theme.kitt.forms.radio.checked.backgroundColor, ({
2586
+ theme
2587
+ }) => theme.kitt.forms.radio.size, ({
2588
+ theme
2589
+ }) => theme.kitt.forms.radio.size, ({
2590
+ theme
2591
+ }) => theme.kitt.forms.radio.size / 2);
2592
+ const SelectedInnerRadio = /*#__PURE__*/styled__default.View.withConfig({
2593
+ displayName: "Radio__SelectedInnerRadio",
2594
+ componentId: "kitt-universal__sc-1mdgr2o-2"
2595
+ })(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;"], ({
2596
+ theme
2597
+ }) => theme.kitt.forms.radio.checked.innerBackgroundColor, ({
2598
+ theme
2599
+ }) => theme.kitt.forms.radio.checked.innerSize, ({
2600
+ theme
2601
+ }) => theme.kitt.forms.radio.checked.innerSize, ({
2602
+ theme
2603
+ }) => theme.kitt.forms.radio.checked.innerSize / 2);
2604
+ const Container$4 = /*#__PURE__*/styled__default.Pressable.withConfig({
2605
+ displayName: "Radio__Container",
2606
+ componentId: "kitt-universal__sc-1mdgr2o-3"
2607
+ })(["flex-direction:row;align-items:center;"]);
2608
+ const Text = /*#__PURE__*/styled__default(Typography.Text).withConfig({
2609
+ displayName: "Radio__Text",
2610
+ componentId: "kitt-universal__sc-1mdgr2o-4"
2611
+ })(["margin-left:", "px;"], ({
2612
+ theme
2613
+ }) => theme.kitt.spacing * 2);
2614
+ function Radio({
2615
+ id,
2616
+ checked,
2617
+ onChange,
2618
+ value,
2619
+ disabled = false,
2620
+ children
2621
+ }) {
2622
+ return /*#__PURE__*/jsxRuntime.jsxs(Container$4, {
2623
+ nativeID: id,
2624
+ disabled: disabled,
2625
+ accessibilityRole: "radio",
2626
+ "aria-checked": checked,
2627
+ focusable: checked && !disabled,
2628
+ onPress: () => {
2629
+ onChange(value);
2630
+ },
2631
+ children: [checked && !disabled ? /*#__PURE__*/jsxRuntime.jsx(SelectedOuterRadio, {
2632
+ children: /*#__PURE__*/jsxRuntime.jsx(SelectedInnerRadio, {})
2633
+ }) : /*#__PURE__*/jsxRuntime.jsx(OuterRadio, {
2634
+ disabled: disabled
2635
+ }), /*#__PURE__*/jsxRuntime.jsx(Text, {
2636
+ base: "body",
2637
+ color: disabled ? 'black-light' : 'black',
2638
+ children: children
2639
+ })]
2640
+ });
2641
+ }
2642
+
2643
+ function TextArea({ ...props
2644
+ }) {
2645
+ const theme = /*#__PURE__*/styled.useTheme();
2646
+ return /*#__PURE__*/jsxRuntime.jsx(InputText, {
2647
+ multiline: true,
2648
+ textAlignVertical: "top",
2649
+ minHeight: theme.kitt.forms.textArea.minHeight,
2650
+ ...props
2651
+ });
2652
+ }
2653
+
2654
+ const Body = /*#__PURE__*/styled__default.View.withConfig({
2655
+ displayName: "Body",
2656
+ componentId: "kitt-universal__sc-1ofncfn-0"
2657
+ })(["", " background-color:", ";flex:1;"], ({
2658
+ theme
2659
+ }) => theme.responsive.ifWindowSizeMatches({
2660
+ minWidth: KittBreakpoints.MEDIUM
2661
+ }, `padding-right: ${theme.kitt.spacing * 12}px;
2662
+ padding-left: ${theme.kitt.spacing * 12}px;`, `padding-right: ${theme.kitt.spacing * 6}px;
2663
+ padding-left: ${theme.kitt.spacing * 6}px;`), ({
2664
+ theme
2665
+ }) => theme.kitt.colors.uiBackgroundLight);
2666
+ function FullScreenModalBody({
2667
+ children
2668
+ }) {
2669
+ return /*#__PURE__*/jsxRuntime.jsx(Body, {
2670
+ children: children
2671
+ });
2672
+ }
2673
+
2674
+ const SideContainer = /*#__PURE__*/styled__default.View.withConfig({
2675
+ displayName: "Header__SideContainer",
2676
+ componentId: "kitt-universal__sc-dfmxi1-0"
2677
+ })(["", ""], ({
2678
+ theme,
2679
+ side = 'left'
2680
+ }) => {
2681
+ const padding = theme.kitt.spacing * 2;
2682
+
2683
+ if (side === 'left') {
2684
+ return `padding-right: ${padding}px;`;
2685
+ }
2686
+
2687
+ return `padding-left: ${padding}px;`;
2688
+ });
2689
+
2690
+ function getHeaderHorizontalMediumPadding(spacing) {
2691
+ return spacing * 6;
2692
+ }
2693
+
2694
+ const Header = /*#__PURE__*/styled__default.View.withConfig({
2695
+ displayName: "Header",
2696
+ componentId: "kitt-universal__sc-dfmxi1-1"
2697
+ })(["", ";border-bottom-color:", ";border-bottom-width:1px;flex-direction:row;align-items:center;"], ({
2698
+ theme,
2699
+ insetTop = 0
2700
+ }) => {
2701
+ const paddingTop = insetTop + theme.kitt.fullScreenModal.header.paddingVertical;
2702
+ const {
2703
+ paddingVertical,
2704
+ paddingHorizontal
2705
+ } = theme.kitt.fullScreenModal.header;
2706
+ return theme.responsive.ifWindowSizeMatches({
2707
+ minWidth: KittBreakpoints.MEDIUM
2708
+ }, `padding: ${paddingTop}px ${getHeaderHorizontalMediumPadding(theme.kitt.spacing)}px ${paddingVertical}px;`, `padding: ${paddingTop}px ${paddingHorizontal}px ${paddingVertical}px;`);
2709
+ }, ({
2710
+ theme
2711
+ }) => theme.kitt.fullScreenModal.header.borderColor);
2712
+ const HeaderContent = /*#__PURE__*/styled__default.View.withConfig({
2713
+ displayName: "Header__HeaderContent",
2714
+ componentId: "kitt-universal__sc-dfmxi1-2"
2715
+ })(["", ";", ";justify-content:center;align-items:center;"], ({
2716
+ theme,
2717
+ leftWidth,
2718
+ rightWidth,
2719
+ windowWidth
2720
+ }) => {
2721
+ /*
2722
+ * Since we don't have controll over the rendered left and right elements,
2723
+ * we must apply some logic to give the title all the available space
2724
+ */
2725
+ const sideElementMaxWidth = Math.max(leftWidth, rightWidth);
2726
+ const parentHorizontalPadding = theme.kitt.fullScreenModal.header.paddingHorizontal * 2;
2727
+ const parentHorizontalPaddingMedium = getHeaderHorizontalMediumPadding(theme.kitt.spacing) * 2;
2728
+
2729
+ const computeWidth = breakpointPadding => windowWidth - breakpointPadding - sideElementMaxWidth * 2;
2730
+
2731
+ return theme.responsive.ifWindowSizeMatches({
2732
+ minWidth: KittBreakpoints.MEDIUM
2733
+ }, `width: ${computeWidth(parentHorizontalPaddingMedium)}px;`, `width: ${computeWidth(parentHorizontalPadding)}px;`);
2734
+ }, ({
2735
+ leftWidth,
2736
+ rightWidth
2737
+ }) => {
2738
+ // Depending of the wider element, we must add a margin to fill the diff in space between elements
2739
+ const deltaMargin = Math.abs(leftWidth - rightWidth);
2740
+
2741
+ if (leftWidth > rightWidth) {
2742
+ return `margin-right: ${deltaMargin}px;`;
2743
+ }
2283
2744
 
2284
- function IconButtonContent({
2285
- disabled,
2286
- color,
2287
- icon
2745
+ return `margin-left: ${deltaMargin}px;`;
2746
+ });
2747
+ function FullScreenModalHeader({
2748
+ children,
2749
+ right,
2750
+ left
2288
2751
  }) {
2289
- return /*#__PURE__*/jsxRuntime.jsx(IconButtonContentBorder, {
2290
- disabled: disabled,
2291
- children: /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
2292
- color: disabled ? 'black-light' : color,
2293
- icon: icon
2294
- })
2752
+ const {
2753
+ top
2754
+ } = reactNativeSafeAreaContext.useSafeAreaInsets();
2755
+ const dimensions = reactNative.useWindowDimensions();
2756
+ const [leftWidth, setLeftWidth] = react.useState(0);
2757
+ const [rightWidth, setRightWidth] = react.useState(0);
2758
+
2759
+ const handleLayoutChange = (event, side) => {
2760
+ // Prevents react to nullify event on rerenders
2761
+ event.persist();
2762
+
2763
+ if (side === 'left') {
2764
+ setLeftWidth(event.nativeEvent.layout.width);
2765
+ return;
2766
+ }
2767
+
2768
+ setRightWidth(event.nativeEvent.layout.width);
2769
+ };
2770
+
2771
+ return /*#__PURE__*/jsxRuntime.jsxs(Header, {
2772
+ insetTop: reactNative.Platform.OS === 'ios' ? undefined : top,
2773
+ children: [left ? /*#__PURE__*/jsxRuntime.jsx(SideContainer, {
2774
+ onLayout: e => handleLayoutChange(e, 'left'),
2775
+ children: left
2776
+ }) : null, /*#__PURE__*/jsxRuntime.jsx(HeaderContent, {
2777
+ windowWidth: dimensions.width,
2778
+ leftWidth: leftWidth,
2779
+ rightWidth: rightWidth,
2780
+ children: children
2781
+ }), right ? /*#__PURE__*/jsxRuntime.jsx(SideContainer, {
2782
+ side: "right",
2783
+ onLayout: e => handleLayoutChange(e, 'right'),
2784
+ children: right
2785
+ }) : null]
2295
2786
  });
2296
2787
  }
2297
2788
 
2298
- function IconButton({
2299
- icon,
2300
- color,
2301
- disabled,
2302
- testID,
2303
- accessibilityLabel,
2304
- accessibilityRole,
2305
- onPress
2789
+ const Container$3 = /*#__PURE__*/styled__default.View.withConfig({
2790
+ displayName: "FullScreenModal__Container",
2791
+ componentId: "kitt-universal__sc-11qpbe3-0"
2792
+ })(["flex:1;background-color:", ";"], ({
2793
+ theme
2794
+ }) => theme.kitt.colors.uiBackground);
2795
+ function FullScreenModal({
2796
+ children
2306
2797
  }) {
2307
- return /*#__PURE__*/jsxRuntime.jsx(PressableAnimatedContainer, {
2308
- color: color,
2309
- disabled: disabled,
2310
- testID: testID,
2311
- accessibilityLabel: accessibilityLabel,
2312
- accessibilityRole: accessibilityRole,
2313
- onPress: onPress,
2314
- children: /*#__PURE__*/jsxRuntime.jsx(IconButtonContent, {
2315
- disabled: disabled,
2316
- color: color,
2317
- icon: icon
2318
- })
2798
+ return /*#__PURE__*/jsxRuntime.jsx(Container$3, {
2799
+ children: children
2319
2800
  });
2320
2801
  }
2802
+ FullScreenModal.Header = FullScreenModalHeader;
2803
+ FullScreenModal.Body = FullScreenModalBody;
2321
2804
 
2322
- const ContentView$1 = /*#__PURE__*/styled__default.View.withConfig({
2805
+ const ContentView = /*#__PURE__*/styled__default.View.withConfig({
2323
2806
  displayName: "ListItemContent__ContentView",
2324
2807
  componentId: "kitt-universal__sc-57q0u9-0"
2325
2808
  })(["flex:1 0 0%;align-self:center;"]);
@@ -2327,7 +2810,7 @@ function ListItemContent({
2327
2810
  children,
2328
2811
  ...rest
2329
2812
  }) {
2330
- return /*#__PURE__*/jsxRuntime.jsx(ContentView$1, { ...rest,
2813
+ return /*#__PURE__*/jsxRuntime.jsx(ContentView, { ...rest,
2331
2814
  children: children
2332
2815
  });
2333
2816
  }
@@ -2627,157 +3110,6 @@ function Message({
2627
3110
  });
2628
3111
  }
2629
3112
 
2630
- // Don't use styled.Pressable here - babel-plugin-styled-components-react-native-web only supports tagged templates
2631
- const OverlayPressable = /*#__PURE__*/styled__default(reactNative.Pressable).withConfig({
2632
- displayName: "Overlay__OverlayPressable",
2633
- componentId: "kitt-universal__sc-1cz1gbr-0"
2634
- })(({
2635
- theme
2636
- }) => ({ ...reactNative.StyleSheet.absoluteFillObject,
2637
- backgroundColor: theme.kitt.colors.overlay.dark
2638
- }));
2639
- function Overlay({
2640
- onPress
2641
- }) {
2642
- return /*#__PURE__*/jsxRuntime.jsx(OverlayPressable, {
2643
- accessibilityRole: "none",
2644
- onPress: onPress,
2645
- children: /*#__PURE__*/jsxRuntime.jsx(reactNative.View, {})
2646
- });
2647
- }
2648
-
2649
- const BodyView = /*#__PURE__*/styled__default.View.withConfig({
2650
- displayName: "Body__BodyView",
2651
- componentId: "kitt-universal__sc-17fwpo4-0"
2652
- })(["padding:", "px ", "px;"], ({
2653
- theme
2654
- }) => theme.kitt.spacing * 6, ({
2655
- theme
2656
- }) => theme.kitt.spacing * 4);
2657
- function ModalBody({
2658
- children
2659
- }) {
2660
- return /*#__PURE__*/jsxRuntime.jsx(reactNative.ScrollView, {
2661
- children: /*#__PURE__*/jsxRuntime.jsx(BodyView, {
2662
- children: children
2663
- })
2664
- });
2665
- }
2666
-
2667
- const FooterView = /*#__PURE__*/styled__default.View.withConfig({
2668
- displayName: "Footer__FooterView",
2669
- componentId: "kitt-universal__sc-1ujq2dc-0"
2670
- })(["flex:0 0 auto;padding:", "px;border-top-width:1px;border-top-color:", ";"], ({
2671
- theme
2672
- }) => theme.kitt.spacing * 4, ({
2673
- theme
2674
- }) => theme.kitt.colors.separator);
2675
- function ModalFooter({
2676
- children
2677
- }) {
2678
- return /*#__PURE__*/jsxRuntime.jsx(FooterView, {
2679
- children: children
2680
- });
2681
- }
2682
-
2683
- const OnCloseContext = /*#__PURE__*/react.createContext(() => {});
2684
-
2685
- const HeaderView = /*#__PURE__*/styled__default.View.withConfig({
2686
- displayName: "Header__HeaderView",
2687
- componentId: "kitt-universal__sc-1iwabch-0"
2688
- })(["position:relative;padding:", "px;display:flex;flex:0 0 auto;flex-direction:row;justify-content:space-between;align-items:center;border-bottom-width:1px;border-bottom-color:", ";min-height:57px;"], ({
2689
- theme
2690
- }) => theme.kitt.spacing * 2, ({
2691
- theme
2692
- }) => theme.kitt.colors.separator);
2693
- const LeftIconView = /*#__PURE__*/styled__default.View.withConfig({
2694
- displayName: "Header__LeftIconView",
2695
- componentId: "kitt-universal__sc-1iwabch-1"
2696
- })(["align-self:flex-start;margin-right:", "px;"], ({
2697
- theme
2698
- }) => theme.kitt.spacing * 2);
2699
- const RightIconView = /*#__PURE__*/styled__default.View.withConfig({
2700
- displayName: "Header__RightIconView",
2701
- componentId: "kitt-universal__sc-1iwabch-2"
2702
- })(["align-self:flex-start;margin-left:", "px;"], ({
2703
- theme
2704
- }) => theme.kitt.spacing * 2);
2705
- const TitleView = /*#__PURE__*/styled__default.View.withConfig({
2706
- displayName: "Header__TitleView",
2707
- componentId: "kitt-universal__sc-1iwabch-3"
2708
- })(["padding-left:", "px;flex-shrink:1;"], ({
2709
- theme,
2710
- isIconLeft
2711
- }) => isIconLeft ? 0 : theme.kitt.spacing * 2);
2712
- function ModalHeader({
2713
- left,
2714
- right,
2715
- children
2716
- }) {
2717
- const onClose = react.useContext(OnCloseContext);
2718
- const isIconLeft = !!left;
2719
- return /*#__PURE__*/jsxRuntime.jsxs(HeaderView, {
2720
- children: [isIconLeft && /*#__PURE__*/jsxRuntime.jsx(LeftIconView, {
2721
- children: left
2722
- }), /*#__PURE__*/jsxRuntime.jsx(TitleView, {
2723
- isIconLeft: isIconLeft,
2724
- children: children
2725
- }), right !== undefined ? right : /*#__PURE__*/jsxRuntime.jsx(RightIconView, {
2726
- children: /*#__PURE__*/jsxRuntime.jsx(Button, {
2727
- type: "subtle-dark",
2728
- icon: /*#__PURE__*/jsxRuntime.jsx(kittIcons.XIcon, {}),
2729
- onPress: onClose
2730
- })
2731
- })]
2732
- });
2733
- }
2734
-
2735
- const ModalView = /*#__PURE__*/styled__default.View.withConfig({
2736
- displayName: "Modal__ModalView",
2737
- componentId: "kitt-universal__sc-1xy2w5u-0"
2738
- })(["top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:", "px ", "px;"], ({
2739
- theme
2740
- }) => theme.kitt.spacing * 20, ({
2741
- theme
2742
- }) => theme.kitt.spacing * 4);
2743
- const ContentView = /*#__PURE__*/styled__default.View.withConfig({
2744
- displayName: "Modal__ContentView",
2745
- componentId: "kitt-universal__sc-1xy2w5u-1"
2746
- })(["position:relative;display:flex;flex-direction:column;max-height:100%;max-width:540px;height:auto;width:100%;border-radius:", "px;background-color:", ";"], ({
2747
- theme
2748
- }) => theme.kitt.card.borderRadius, ({
2749
- theme
2750
- }) => theme.kitt.colors.uiBackgroundLight);
2751
- function Modal({
2752
- visible,
2753
- children,
2754
- onClose,
2755
- onEntered,
2756
- onExited
2757
- }) {
2758
- return /*#__PURE__*/jsxRuntime.jsx(OnCloseContext.Provider, {
2759
- value: onClose,
2760
- children: /*#__PURE__*/jsxRuntime.jsx(reactNative.Modal, {
2761
- transparent: true,
2762
- animationType: "fade",
2763
- visible: visible,
2764
- onShow: onEntered,
2765
- onDismiss: onExited,
2766
- onRequestClose: onClose,
2767
- children: /*#__PURE__*/jsxRuntime.jsxs(ModalView, {
2768
- children: [/*#__PURE__*/jsxRuntime.jsx(Overlay, {
2769
- onPress: onClose
2770
- }), /*#__PURE__*/jsxRuntime.jsx(ContentView, {
2771
- children: children
2772
- })]
2773
- })
2774
- })
2775
- });
2776
- }
2777
- Modal.Header = ModalHeader;
2778
- Modal.Body = ModalBody;
2779
- Modal.Footer = ModalFooter;
2780
-
2781
3113
  function Notification({
2782
3114
  type,
2783
3115
  children,
@@ -3759,6 +4091,7 @@ exports.Avatar = Avatar;
3759
4091
  exports.Button = Button;
3760
4092
  exports.Card = Card;
3761
4093
  exports.Checkbox = Checkbox;
4094
+ exports.DatePicker = DatePicker;
3762
4095
  exports.Emoji = Emoji;
3763
4096
  exports.ExternalLink = ExternalLink;
3764
4097
  exports.Flex = Flex;
@@ -3772,6 +4105,7 @@ exports.InputIcon = InputIcon;
3772
4105
  exports.InputPassword = InputPassword;
3773
4106
  exports.InputPhone = InputPhone;
3774
4107
  exports.InputPressable = InputPressable;
4108
+ exports.InputTag = InputTag;
3775
4109
  exports.InputText = InputText;
3776
4110
  exports.KittBreakpoints = KittBreakpoints;
3777
4111
  exports.KittBreakpointsMax = KittBreakpointsMax;