@ornikar/kitt-universal 32.7.0 → 32.8.1-canary.9789a78a274b9d336c93fc42d4a6561d0d61ff73.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 (30) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/definitions/ReadMore/ReadMore.d.ts +10 -0
  3. package/dist/definitions/ReadMore/ReadMore.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/ChromaticReducedMotionDecorator.d.ts +1 -1
  9. package/dist/definitions/utils/storybook/ChromaticReducedMotionDecorator.d.ts.map +1 -1
  10. package/dist/definitions/utils/storybook/KittThemeDecorator.d.ts +1 -1
  11. package/dist/definitions/utils/storybook/KittThemeDecorator.d.ts.map +1 -1
  12. package/dist/index-metro.es.android.js +106 -66
  13. package/dist/index-metro.es.android.js.map +1 -1
  14. package/dist/index-metro.es.ios.js +106 -66
  15. package/dist/index-metro.es.ios.js.map +1 -1
  16. package/dist/index-node-22.17.cjs.js +98 -55
  17. package/dist/index-node-22.17.cjs.js.map +1 -1
  18. package/dist/index-node-22.17.cjs.web.js +105 -61
  19. package/dist/index-node-22.17.cjs.web.js.map +1 -1
  20. package/dist/index-node-22.17.es.mjs +96 -54
  21. package/dist/index-node-22.17.es.mjs.map +1 -1
  22. package/dist/index-node-22.17.es.web.mjs +102 -59
  23. package/dist/index-node-22.17.es.web.mjs.map +1 -1
  24. package/dist/index.es.js +108 -62
  25. package/dist/index.es.js.map +1 -1
  26. package/dist/index.es.web.js +115 -68
  27. package/dist/index.es.web.js.map +1 -1
  28. package/dist/tsbuildinfo +1 -1
  29. package/package.json +4 -4
  30. package/translations/fr-FR.json +3 -1
@@ -20,8 +20,9 @@ const libphonenumberJs = require('libphonenumber-js');
20
20
  const reactNativeSafeAreaContext = require('react-native-safe-area-context');
21
21
  const Svg = require('react-native-svg');
22
22
  const reactDom$1 = require('@floating-ui/react-dom');
23
+ const reactIntl = require('react-intl');
23
24
  const expoLinearGradient = require('expo-linear-gradient');
24
- const addons = require('@storybook/addons');
25
+ const previewApi = require('@storybook/preview-api');
25
26
  const isChromatic = require('chromatic/isChromatic');
26
27
 
27
28
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e["default"] : e; }
@@ -11906,6 +11907,105 @@ Picker.Option = PickerOption;
11906
11907
  */
11907
11908
  Picker.UnsafeInternalItem = PickerItem;
11908
11909
 
11910
+ const styles = {"displayUnderline":"TypographyLinkWebWrapper-module_displayUnderline__KxwMp","displayUnderlineWhenHovered":"TypographyLinkWebWrapper-module_displayUnderlineWhenHovered__5V5Cl"};
11911
+
11912
+ function TypographyLinkWebWrapper({
11913
+ children,
11914
+ hasNoUnderline
11915
+ }) {
11916
+ const className = hasNoUnderline ? `${styles.displayUnderline} ${styles.displayUnderlineWhenHovered}` : styles.displayUnderline;
11917
+ return /*#__PURE__*/jsxRuntime.jsx("span", {
11918
+ className: className,
11919
+ children: children
11920
+ });
11921
+ }
11922
+
11923
+ const TypographyLink = /*#__PURE__*/react.forwardRef(({
11924
+ children,
11925
+ disabled,
11926
+ noUnderline,
11927
+ href,
11928
+ hrefAttrs,
11929
+ onPress,
11930
+ ...otherProps
11931
+ }, ref) => {
11932
+ return /*#__PURE__*/jsxRuntime.jsx(TypographyLinkWebWrapper, {
11933
+ hasNoUnderline: noUnderline,
11934
+ children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
11935
+ ref: ref,
11936
+ underline: !noUnderline,
11937
+ color: disabled ? 'black-disabled' : undefined,
11938
+ href: href,
11939
+ hrefAttrs: hrefAttrs,
11940
+ accessibilityRole: "link",
11941
+ dataSet: {
11942
+ // remove data-kitt-universal when we delete kitt web. See :global(a) in Link styles.module.css
11943
+ 'kitt-universal': 'true'
11944
+ },
11945
+ _web: {
11946
+ // @ts-expect-error: This is only used on web where 'not-allowed' and 'pointer' are valid cursor values
11947
+ cursor: disabled ? 'not-allowed' : 'pointer',
11948
+ transitionProperty: 'color',
11949
+ transitionDuration: '0.2s',
11950
+ transitionTimingFunction: 'ease-in-out'
11951
+ }
11952
+ // TODO[native-base@>=3.4.19] this currently does not work. Retest when updating native-base.
11953
+ // _active={{
11954
+ // underline: !!noUnderline,
11955
+ // }}
11956
+ // _hover={{
11957
+ // underline: !!noUnderline,
11958
+ // }}
11959
+ ,
11960
+ onPress: disabled ? undefined : onPress,
11961
+ ...otherProps,
11962
+ children: children
11963
+ })
11964
+ });
11965
+ });
11966
+
11967
+ const messages = reactIntl.defineMessages({
11968
+ seeMore: {
11969
+ id: "shared.components.ReadMore.seeMore"
11970
+ },
11971
+ seeLess: {
11972
+ id: "shared.components.ReadMore.seeLess"
11973
+ }
11974
+ });
11975
+ function ReadMore({
11976
+ lines,
11977
+ children,
11978
+ textColor = 'bumper.content.base.hi',
11979
+ noUnderline = false
11980
+ }) {
11981
+ const [isExpanded, setIsExpanded] = react.useState(false);
11982
+ const nbOfLines = isExpanded ? undefined : lines;
11983
+ const messageProps = isExpanded ? messages.seeLess : messages.seeMore;
11984
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
11985
+ children: [/*#__PURE__*/jsxRuntime.jsx(View, {
11986
+ flexShrink: 1,
11987
+ children: /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
11988
+ textAlign: "left",
11989
+ numberOfLines: nbOfLines,
11990
+ ellipsizeMode: "tail",
11991
+ children: children
11992
+ })
11993
+ }), lines ? /*#__PURE__*/jsxRuntime.jsx(View, {
11994
+ children: /*#__PURE__*/jsxRuntime.jsx(TypographyLink, {
11995
+ noUnderline: noUnderline,
11996
+ color: textColor,
11997
+ variant: "bold",
11998
+ onPress: () => {
11999
+ setIsExpanded(prev => !prev);
12000
+ },
12001
+ children: /*#__PURE__*/jsxRuntime.jsx(reactIntl.FormattedMessage, {
12002
+ ...messageProps
12003
+ })
12004
+ })
12005
+ }) : null]
12006
+ });
12007
+ }
12008
+
11909
12009
  const SvgStripesinline = props => /*#__PURE__*/jsxRuntime.jsx("svg", {
11910
12010
  viewBox: "0 0 453 71",
11911
12011
  fill: "none",
@@ -12609,7 +12709,7 @@ function StoryContainer({
12609
12709
  });
12610
12710
  }
12611
12711
 
12612
- const StoryDecorator = addons.makeDecorator({
12712
+ const StoryDecorator = previewApi.makeDecorator({
12613
12713
  name: 'StoryDecorator',
12614
12714
  parameterName: 'storyDecorator',
12615
12715
  wrapper: (storyFn, context) => {
@@ -13510,64 +13610,7 @@ function TypographyEmoji({
13510
13610
  });
13511
13611
  }
13512
13612
 
13513
- const styles = {"displayUnderline":"TypographyLinkWebWrapper-module_displayUnderline__KxwMp","displayUnderlineWhenHovered":"TypographyLinkWebWrapper-module_displayUnderlineWhenHovered__5V5Cl"};
13514
-
13515
- function TypographyLinkWebWrapper({
13516
- children,
13517
- hasNoUnderline
13518
- }) {
13519
- const className = hasNoUnderline ? `${styles.displayUnderline} ${styles.displayUnderlineWhenHovered}` : styles.displayUnderline;
13520
- return /*#__PURE__*/jsxRuntime.jsx("span", {
13521
- className: className,
13522
- children: children
13523
- });
13524
- }
13525
-
13526
- const TypographyLink = /*#__PURE__*/react.forwardRef(({
13527
- children,
13528
- disabled,
13529
- noUnderline,
13530
- href,
13531
- hrefAttrs,
13532
- onPress,
13533
- ...otherProps
13534
- }, ref) => {
13535
- return /*#__PURE__*/jsxRuntime.jsx(TypographyLinkWebWrapper, {
13536
- hasNoUnderline: noUnderline,
13537
- children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
13538
- ref: ref,
13539
- underline: !noUnderline,
13540
- color: disabled ? 'black-disabled' : undefined,
13541
- href: href,
13542
- hrefAttrs: hrefAttrs,
13543
- accessibilityRole: "link",
13544
- dataSet: {
13545
- // remove data-kitt-universal when we delete kitt web. See :global(a) in Link styles.module.css
13546
- 'kitt-universal': 'true'
13547
- },
13548
- _web: {
13549
- // @ts-expect-error: This is only used on web where 'not-allowed' and 'pointer' are valid cursor values
13550
- cursor: disabled ? 'not-allowed' : 'pointer',
13551
- transitionProperty: 'color',
13552
- transitionDuration: '0.2s',
13553
- transitionTimingFunction: 'ease-in-out'
13554
- }
13555
- // TODO[native-base@>=3.4.19] this currently does not work. Retest when updating native-base.
13556
- // _active={{
13557
- // underline: !!noUnderline,
13558
- // }}
13559
- // _hover={{
13560
- // underline: !!noUnderline,
13561
- // }}
13562
- ,
13563
- onPress: disabled ? undefined : onPress,
13564
- ...otherProps,
13565
- children: children
13566
- })
13567
- });
13568
- });
13569
-
13570
- const ChromaticReducedMotionDecorator = addons.makeDecorator({
13613
+ const ChromaticReducedMotionDecorator = previewApi.makeDecorator({
13571
13614
  name: 'ChromaticReducedMotionDecorator',
13572
13615
  parameterName: 'chromaticReducedMotion',
13573
13616
  wrapper: (storyFn, context) => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
@@ -13590,7 +13633,7 @@ function KittThemeProvider({
13590
13633
  children: children
13591
13634
  });
13592
13635
  }
13593
- const KittThemeDecorator = addons.makeDecorator({
13636
+ const KittThemeDecorator = previewApi.makeDecorator({
13594
13637
  name: 'ThemeDecorator',
13595
13638
  parameterName: 'theme',
13596
13639
  wrapper: (storyFn, context, {
@@ -14010,6 +14053,7 @@ exports.Picker = Picker;
14010
14053
  exports.Pressable = Pressable;
14011
14054
  exports.Radio = RadioWithRef;
14012
14055
  exports.RadioButtonGroup = RadioButtonGroup;
14056
+ exports.ReadMore = ReadMore;
14013
14057
  exports.ScrollView = ScrollView;
14014
14058
  exports.Section = DeprecatedSection;
14015
14059
  exports.SectionList = SectionList;