@ornikar/kitt-universal 27.7.0 → 27.9.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 (38) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/definitions/TopNavBar/TopNavBar.d.ts +21 -0
  3. package/dist/definitions/TopNavBar/TopNavBar.d.ts.map +1 -0
  4. package/dist/definitions/index.d.ts +2 -0
  5. package/dist/definitions/index.d.ts.map +1 -1
  6. package/dist/definitions/story-components/StoryDecorator.d.ts +1 -1
  7. package/dist/definitions/story-components/StoryDecorator.d.ts.map +1 -1
  8. package/dist/definitions/utils/storybook/KittThemeDecorator.d.ts +1 -1
  9. package/dist/definitions/utils/storybook/KittThemeDecorator.d.ts.map +1 -1
  10. package/dist/index-metro.es.android.js +81 -4
  11. package/dist/index-metro.es.android.js.map +1 -1
  12. package/dist/index-metro.es.ios.js +81 -4
  13. package/dist/index-metro.es.ios.js.map +1 -1
  14. package/dist/index-node-22.17.cjs.js +82 -2
  15. package/dist/index-node-22.17.cjs.js.map +1 -1
  16. package/dist/index-node-22.17.cjs.web.js +82 -2
  17. package/dist/index-node-22.17.cjs.web.js.map +1 -1
  18. package/dist/index-node-22.17.es.mjs +83 -4
  19. package/dist/index-node-22.17.es.mjs.map +1 -1
  20. package/dist/index-node-22.17.es.web.mjs +83 -4
  21. package/dist/index-node-22.17.es.web.mjs.map +1 -1
  22. package/dist/index.es.js +86 -4
  23. package/dist/index.es.js.map +1 -1
  24. package/dist/index.es.web.js +86 -4
  25. package/dist/index.es.web.js.map +1 -1
  26. package/dist/tsbuildinfo +1 -1
  27. package/package.json +3 -3
  28. package/scripts/codemods/__testfixtures__/csf1-csf2/decorator.input.tsx +11 -0
  29. package/scripts/codemods/__testfixtures__/csf1-csf2/decorator.output.tsx +17 -0
  30. package/scripts/codemods/__testfixtures__/csf1-csf2/default.input.tsx +88 -0
  31. package/scripts/codemods/__testfixtures__/csf1-csf2/default.output.tsx +94 -0
  32. package/scripts/codemods/__testfixtures__/csf1-csf2/multiple-add.input.tsx +77 -0
  33. package/scripts/codemods/__testfixtures__/csf1-csf2/multiple-add.output.tsx +92 -0
  34. package/scripts/codemods/__testfixtures__/csf1-csf2/parameters.input.tsx +21 -0
  35. package/scripts/codemods/__testfixtures__/csf1-csf2/parameters.output.tsx +28 -0
  36. package/scripts/codemods/__tests__/csf1-csf2.test.js +10 -0
  37. package/scripts/codemods/codemod-template.js +27 -0
  38. package/scripts/codemods/csf1-csf2.js +323 -0
package/dist/index.es.js CHANGED
@@ -13,7 +13,7 @@ export { useWindowDimensions as useWindowSize } from 'react-native';
13
13
  import _typeof from '@babel/runtime/helpers/typeof';
14
14
  import _regeneratorRuntime from '@babel/runtime/helpers/regeneratorRuntime';
15
15
  import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
16
- import { SpinnerGapRegularIcon, UserRegularIcon, CaretUpFillIcon, CaretDownFillIcon, MapPinRegularIcon, EyeClosedRegularIcon, EyeRegularIcon, CheckCircleFillIcon, CaretDownRegularIcon, XRegularIcon, CaretRightRegularIcon, InfoRegularIcon, WarningRegularIcon, CheckRegularIcon, WarningCircleRegularIcon, ArrowCounterClockwiseRegularIcon, InfoFillIcon, WarningCircleFillIcon, WarningFillIcon } from '@ornikar/kitt-icons/phosphor';
16
+ import { SpinnerGapRegularIcon, UserRegularIcon, CaretUpFillIcon, CaretDownFillIcon, MapPinRegularIcon, EyeClosedRegularIcon, EyeRegularIcon, CheckCircleFillIcon, CaretDownRegularIcon, XRegularIcon, CaretRightRegularIcon, InfoRegularIcon, WarningRegularIcon, CheckRegularIcon, WarningCircleRegularIcon, ArrowCounterClockwiseRegularIcon, InfoFillIcon, WarningCircleFillIcon, WarningFillIcon, ArrowLeftRegularIcon } from '@ornikar/kitt-icons/phosphor';
17
17
  import { BottomSheetView, BottomSheetScrollView, BottomSheetSectionList, BottomSheetFlatList, BottomSheetHandle, BottomSheetBackdrop, BottomSheetFooter, BottomSheetTextInput, BottomSheetModal, useBottomSheetModal } from '@gorhom/bottom-sheet';
18
18
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
19
19
  import { parse } from '@twemoji/parser';
@@ -4137,7 +4137,7 @@ function useOnCloseModalBehaviour() {
4137
4137
  return onClose;
4138
4138
  }
4139
4139
 
4140
- function CloseButton(_ref) {
4140
+ function CloseButton$1(_ref) {
4141
4141
  var children = _ref.children,
4142
4142
  onPress = _ref.onPress;
4143
4143
  var onCloseContextCallback = useOnCloseModalBehaviour();
@@ -4170,7 +4170,7 @@ function ModalBehaviour(_ref2) {
4170
4170
  })
4171
4171
  });
4172
4172
  }
4173
- ModalBehaviour.CloseButton = CloseButton;
4173
+ ModalBehaviour.CloseButton = CloseButton$1;
4174
4174
 
4175
4175
  function Overlay(_ref) {
4176
4176
  var onPress = _ref.onPress;
@@ -13902,6 +13902,88 @@ function Tooltip(_ref) {
13902
13902
  Tooltip.Arrow = Arrow;
13903
13903
  Tooltip.Content = TooltipContent;
13904
13904
 
13905
+ function TopNavBar(_ref) {
13906
+ var left = _ref.left,
13907
+ right = _ref.right,
13908
+ title = _ref.title,
13909
+ _ref$titleAlign = _ref.titleAlign,
13910
+ titleAlign = _ref$titleAlign === void 0 ? 'center' : _ref$titleAlign,
13911
+ stickers = _ref.stickers,
13912
+ _ref$mode = _ref.mode,
13913
+ mode = _ref$mode === void 0 ? 'default' : _ref$mode,
13914
+ _ref$hasSeparator = _ref.hasSeparator,
13915
+ hasSeparator = _ref$hasSeparator === void 0 ? true : _ref$hasSeparator;
13916
+ var isLargeTitleMode = mode === 'largeTitle';
13917
+ return /*#__PURE__*/jsxs(VStack, {
13918
+ space: isLargeTitleMode ? 'kitt.2' : undefined,
13919
+ width: "100%",
13920
+ height: mode === 'default' ? 56 : undefined,
13921
+ justifyContent: "center",
13922
+ paddingX: "kitt.2",
13923
+ paddingTop: isLargeTitleMode ? 'kitt.2' : 'kitt.3',
13924
+ paddingBottom: "kitt.3",
13925
+ borderBottomWidth: hasSeparator && mode === 'default' ? 1 : 0,
13926
+ borderColor: "kitt.separator",
13927
+ children: [/*#__PURE__*/jsxs(HStack, {
13928
+ alignItems: "center",
13929
+ justifyContent: !title && !left ? 'flex-end' : 'space-between',
13930
+ children: [left !== null && left !== void 0 ? left : /*#__PURE__*/jsx(View, {
13931
+ width: "kitt.button.minWidth"
13932
+ }), mode === 'default' ? /*#__PURE__*/jsx(View, {
13933
+ flexGrow: "1",
13934
+ flexShrink: 1,
13935
+ paddingRight: "kitt.2",
13936
+ paddingLeft: "kitt.2",
13937
+ children: title ? /*#__PURE__*/jsx(Typography.Text, {
13938
+ textAlign: titleAlign,
13939
+ variant: "bold",
13940
+ ellipsizeMode: "tail",
13941
+ numberOfLines: 1,
13942
+ children: title
13943
+ }) : null
13944
+ }) : null, right !== null && right !== void 0 ? right : /*#__PURE__*/jsx(View, {
13945
+ width: "kitt.button.minWidth"
13946
+ })]
13947
+ }), mode === 'largeTitle' ? /*#__PURE__*/jsxs(VStack, {
13948
+ space: "kitt.4",
13949
+ paddingX: "kitt.2",
13950
+ children: [stickers ? /*#__PURE__*/jsx(HStack, {
13951
+ width: "100%",
13952
+ space: "kitt.1",
13953
+ flexShrink: 1,
13954
+ flexWrap: "wrap",
13955
+ style: {
13956
+ rowGap: theme.getSpacing(1)
13957
+ },
13958
+ children: stickers.map(function (sticker, index) {
13959
+ return (
13960
+ /*#__PURE__*/
13961
+ // eslint-disable-next-line react/no-array-index-key
13962
+ jsx(View, {
13963
+ children: sticker
13964
+ }, index)
13965
+ );
13966
+ })
13967
+ }) : null, /*#__PURE__*/jsx(Typography.Text, {
13968
+ base: "heading-m",
13969
+ children: title
13970
+ })]
13971
+ }) : null]
13972
+ });
13973
+ }
13974
+ function CloseButton(props) {
13975
+ return /*#__PURE__*/jsx(IconButton, _objectSpread({
13976
+ icon: /*#__PURE__*/jsx(XRegularIcon, {})
13977
+ }, props));
13978
+ }
13979
+ function BackButton(props) {
13980
+ return /*#__PURE__*/jsx(IconButton, _objectSpread({
13981
+ icon: /*#__PURE__*/jsx(ArrowLeftRegularIcon, {})
13982
+ }, props));
13983
+ }
13984
+ TopNavBar.CloseButton = CloseButton;
13985
+ TopNavBar.BackButton = BackButton;
13986
+
13905
13987
  function getTypographyTypeConfig(type, theme) {
13906
13988
  var configs = theme.kitt.typography.types[getTypographyFamily(type)].configs;
13907
13989
  return configs[type];
@@ -14388,5 +14470,5 @@ function VerticalSteps(_ref) {
14388
14470
  VerticalSteps.Step = Step;
14389
14471
  VerticalSteps.BorderlessStep = BorderlessStep;
14390
14472
 
14391
- export { ActionCard, Actions, Autocomplete, Avatar, BottomSheet, Button, ButtonBadge, CardModal, Center, Checkbox, ChoicesElements, CloseIconButton, DatePicker, DialogModal, DocumentPicker, Emoji, ExternalAppLink, ExternalLink, FilePicker, FlatList, Flex, FullscreenModal, GoogleMapsApiKeyProvider, GoogleMapsAutocompleteProvider, GroupTags, HStack, Highlight, Icon, IconButton, Image, ImagePicker, InfoCard, InputAddress, InputEmail, InputFeedback, InputField, InputIban, InputIcon, InputNumber, InputPassword, InputPhone, InputPressable, InputTag, InputText, KittBreakpointNameEnum, KittBreakpoints, KittBreakpointsMax, KittMapConfigProvider, KittNativeBaseProvider, KittThemeDecorator, KittThemeProvider, Label, ListItem, LoaderIcon, MapMarker, MapMarkerVariantEnum, MatchWindowSize, Message, ModalBehaviour, FlatList as NativeOnlyFlatList, NavigationBottomSheet, NavigationModal, Notification, Overlay, PageLoader, Picker, Pressable, RadioWithRef as Radio, RadioButtonGroup, ScrollView, DeprecatedSection as Section, SectionList, SegmentedProgressBar, Skeleton, SpinningIcon, Stack, StaticMap, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, StyleWebWrapper, SwitchBreakpoints, TabBar, Tag, TextArea, TimePicker, ToastComponent, Toggle, Tooltip, Typography, TypographyEmoji, TypographyIcon, TypographyLink, VStack, VerticalSteps, View, createChoicesComponent, createResponsiveStyleFromProp, getStaticMapImageUrl, getValueForBreakpoint, hex2rgba, matchWindowSize, storyPadding, theme, useBottomSheet, useBreakpointValue, useCurrentBreakpointName, useGetStaticMapImageUrl, useKittMapConfig, useKittTheme, useMatchWindowSize, useOpenExternalLink, useStaticBottomSheet, useStoryBlockColor, useTheme };
14473
+ export { ActionCard, Actions, Autocomplete, Avatar, BottomSheet, Button, ButtonBadge, CardModal, Center, Checkbox, ChoicesElements, CloseIconButton, DatePicker, DialogModal, DocumentPicker, Emoji, ExternalAppLink, ExternalLink, FilePicker, FlatList, Flex, FullscreenModal, GoogleMapsApiKeyProvider, GoogleMapsAutocompleteProvider, GroupTags, HStack, Highlight, Icon, IconButton, Image, ImagePicker, InfoCard, InputAddress, InputEmail, InputFeedback, InputField, InputIban, InputIcon, InputNumber, InputPassword, InputPhone, InputPressable, InputTag, InputText, KittBreakpointNameEnum, KittBreakpoints, KittBreakpointsMax, KittMapConfigProvider, KittNativeBaseProvider, KittThemeDecorator, KittThemeProvider, Label, ListItem, LoaderIcon, MapMarker, MapMarkerVariantEnum, MatchWindowSize, Message, ModalBehaviour, FlatList as NativeOnlyFlatList, NavigationBottomSheet, NavigationModal, Notification, Overlay, PageLoader, Picker, Pressable, RadioWithRef as Radio, RadioButtonGroup, ScrollView, DeprecatedSection as Section, SectionList, SegmentedProgressBar, Skeleton, SpinningIcon, Stack, StaticMap, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, StyleWebWrapper, SwitchBreakpoints, TabBar, Tag, TextArea, TimePicker, ToastComponent, Toggle, Tooltip, TopNavBar, Typography, TypographyEmoji, TypographyIcon, TypographyLink, VStack, VerticalSteps, View, createChoicesComponent, createResponsiveStyleFromProp, getStaticMapImageUrl, getValueForBreakpoint, hex2rgba, matchWindowSize, storyPadding, theme, useBottomSheet, useBreakpointValue, useCurrentBreakpointName, useGetStaticMapImageUrl, useKittMapConfig, useKittTheme, useMatchWindowSize, useOpenExternalLink, useStaticBottomSheet, useStoryBlockColor, useTheme };
14392
14474
  //# sourceMappingURL=index.es.js.map