@ledgerhq/lumen-ui-rnative 0.1.4 → 0.1.6

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 (147) hide show
  1. package/dist/package.json +1 -1
  2. package/dist/src/lib/Components/AmountDisplay/AmountDisplay.d.ts.map +1 -1
  3. package/dist/src/lib/Components/AmountDisplay/AmountDisplay.js +5 -1
  4. package/dist/src/lib/Components/SegmentedControl/SegmentedControl.d.ts +1 -1
  5. package/dist/src/lib/Components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  6. package/dist/src/lib/Components/SegmentedControl/SegmentedControl.js +34 -61
  7. package/dist/src/lib/Components/SegmentedControl/SegmentedControlContext.d.ts +1 -0
  8. package/dist/src/lib/Components/SegmentedControl/SegmentedControlContext.d.ts.map +1 -1
  9. package/dist/src/lib/Components/SegmentedControl/types.d.ts +12 -2
  10. package/dist/src/lib/Components/SegmentedControl/types.d.ts.map +1 -1
  11. package/dist/src/lib/Components/SegmentedControl/usePillLayout.d.ts +19 -0
  12. package/dist/src/lib/Components/SegmentedControl/usePillLayout.d.ts.map +1 -0
  13. package/dist/src/lib/Components/SegmentedControl/usePillLayout.js +46 -0
  14. package/dist/src/lib/Components/TileButton/TileButton.js +2 -2
  15. package/jest.config.ts +0 -1
  16. package/package.json +1 -1
  17. package/src/lib/Components/AmountDisplay/AmountDisplay.tsx +8 -1
  18. package/src/lib/Components/SegmentedControl/SegmentedControl.mdx +1 -38
  19. package/src/lib/Components/SegmentedControl/SegmentedControl.stories.tsx +35 -19
  20. package/src/lib/Components/SegmentedControl/SegmentedControl.tsx +61 -77
  21. package/src/lib/Components/SegmentedControl/SegmentedControlContext.tsx +1 -0
  22. package/src/lib/Components/SegmentedControl/types.ts +12 -2
  23. package/src/lib/Components/SegmentedControl/usePillLayout.ts +76 -0
  24. package/src/lib/Components/TileButton/TileButton.tsx +2 -2
  25. package/src/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.stories.tsx +1 -1
  26. package/tsconfig.json +3 -16
  27. package/tsconfig.lib.json +5 -0
  28. package/dist/src/lib/Animations/Pulse/Pulse.stories.d.ts +0 -9
  29. package/dist/src/lib/Animations/Pulse/Pulse.stories.d.ts.map +0 -1
  30. package/dist/src/lib/Animations/Pulse/Pulse.stories.js +0 -38
  31. package/dist/src/lib/Animations/Spin/Spin.stories.d.ts +0 -9
  32. package/dist/src/lib/Animations/Spin/Spin.stories.d.ts.map +0 -1
  33. package/dist/src/lib/Animations/Spin/Spin.stories.js +0 -27
  34. package/dist/src/lib/Components/AddressInput/AddressInput.stories.d.ts +0 -13
  35. package/dist/src/lib/Components/AddressInput/AddressInput.stories.d.ts.map +0 -1
  36. package/dist/src/lib/Components/AddressInput/AddressInput.stories.js +0 -128
  37. package/dist/src/lib/Components/AmountDisplay/AmountDisplay.stories.d.ts +0 -10
  38. package/dist/src/lib/Components/AmountDisplay/AmountDisplay.stories.d.ts.map +0 -1
  39. package/dist/src/lib/Components/AmountDisplay/AmountDisplay.stories.js +0 -127
  40. package/dist/src/lib/Components/AmountInput/AmountInput.stories.d.ts +0 -16
  41. package/dist/src/lib/Components/AmountInput/AmountInput.stories.d.ts.map +0 -1
  42. package/dist/src/lib/Components/AmountInput/AmountInput.stories.js +0 -186
  43. package/dist/src/lib/Components/Avatar/Avatar.stories.d.ts +0 -22
  44. package/dist/src/lib/Components/Avatar/Avatar.stories.d.ts.map +0 -1
  45. package/dist/src/lib/Components/Avatar/Avatar.stories.js +0 -72
  46. package/dist/src/lib/Components/Banner/Banner.stories.d.ts +0 -16
  47. package/dist/src/lib/Components/Banner/Banner.stories.d.ts.map +0 -1
  48. package/dist/src/lib/Components/Banner/Banner.stories.js +0 -268
  49. package/dist/src/lib/Components/BottomSheet/BottomSheet.stories.d.ts +0 -87
  50. package/dist/src/lib/Components/BottomSheet/BottomSheet.stories.d.ts.map +0 -1
  51. package/dist/src/lib/Components/BottomSheet/BottomSheet.stories.js +0 -266
  52. package/dist/src/lib/Components/Button/Button.stories.d.ts +0 -16
  53. package/dist/src/lib/Components/Button/Button.stories.d.ts.map +0 -1
  54. package/dist/src/lib/Components/Button/Button.stories.js +0 -143
  55. package/dist/src/lib/Components/CardButton/CardButton.stories.d.ts +0 -16
  56. package/dist/src/lib/Components/CardButton/CardButton.stories.d.ts.map +0 -1
  57. package/dist/src/lib/Components/CardButton/CardButton.stories.js +0 -208
  58. package/dist/src/lib/Components/Checkbox/Checkbox.stories.d.ts +0 -14
  59. package/dist/src/lib/Components/Checkbox/Checkbox.stories.d.ts.map +0 -1
  60. package/dist/src/lib/Components/Checkbox/Checkbox.stories.js +0 -72
  61. package/dist/src/lib/Components/ContentBanner/ContentBanner.stories.d.ts +0 -11
  62. package/dist/src/lib/Components/ContentBanner/ContentBanner.stories.d.ts.map +0 -1
  63. package/dist/src/lib/Components/ContentBanner/ContentBanner.stories.js +0 -91
  64. package/dist/src/lib/Components/Divider/Divider.stories.d.ts +0 -9
  65. package/dist/src/lib/Components/Divider/Divider.stories.d.ts.map +0 -1
  66. package/dist/src/lib/Components/Divider/Divider.stories.js +0 -51
  67. package/dist/src/lib/Components/Icon/Icon.stories.d.ts +0 -15
  68. package/dist/src/lib/Components/Icon/Icon.stories.d.ts.map +0 -1
  69. package/dist/src/lib/Components/Icon/Icon.stories.js +0 -137
  70. package/dist/src/lib/Components/IconButton/IconButton.stories.d.ts +0 -10
  71. package/dist/src/lib/Components/IconButton/IconButton.stories.d.ts.map +0 -1
  72. package/dist/src/lib/Components/IconButton/IconButton.stories.js +0 -74
  73. package/dist/src/lib/Components/InteractiveIcon/InteractiveIcon.stories.d.ts +0 -11
  74. package/dist/src/lib/Components/InteractiveIcon/InteractiveIcon.stories.d.ts.map +0 -1
  75. package/dist/src/lib/Components/InteractiveIcon/InteractiveIcon.stories.js +0 -90
  76. package/dist/src/lib/Components/Link/Link.stories.d.ts +0 -17
  77. package/dist/src/lib/Components/Link/Link.stories.d.ts.map +0 -1
  78. package/dist/src/lib/Components/Link/Link.stories.js +0 -275
  79. package/dist/src/lib/Components/ListItem/ListItem.stories.d.ts +0 -10
  80. package/dist/src/lib/Components/ListItem/ListItem.stories.d.ts.map +0 -1
  81. package/dist/src/lib/Components/ListItem/ListItem.stories.js +0 -106
  82. package/dist/src/lib/Components/NavBar/NavBar.stories.d.ts +0 -10
  83. package/dist/src/lib/Components/NavBar/NavBar.stories.d.ts.map +0 -1
  84. package/dist/src/lib/Components/NavBar/NavBar.stories.js +0 -72
  85. package/dist/src/lib/Components/PageIndicator/PageIndicator.stories.d.ts +0 -27
  86. package/dist/src/lib/Components/PageIndicator/PageIndicator.stories.d.ts.map +0 -1
  87. package/dist/src/lib/Components/PageIndicator/PageIndicator.stories.js +0 -42
  88. package/dist/src/lib/Components/SearchInput/SearchInput.stories.d.ts +0 -12
  89. package/dist/src/lib/Components/SearchInput/SearchInput.stories.d.ts.map +0 -1
  90. package/dist/src/lib/Components/SearchInput/SearchInput.stories.js +0 -98
  91. package/dist/src/lib/Components/SegmentedControl/SegmentedControl.stories.d.ts +0 -58
  92. package/dist/src/lib/Components/SegmentedControl/SegmentedControl.stories.d.ts.map +0 -1
  93. package/dist/src/lib/Components/SegmentedControl/SegmentedControl.stories.js +0 -61
  94. package/dist/src/lib/Components/Select/Select.stories.d.ts +0 -11
  95. package/dist/src/lib/Components/Select/Select.stories.d.ts.map +0 -1
  96. package/dist/src/lib/Components/Select/Select.stories.js +0 -83
  97. package/dist/src/lib/Components/Skeleton/Skeleton.stories.d.ts +0 -11
  98. package/dist/src/lib/Components/Skeleton/Skeleton.stories.d.ts.map +0 -1
  99. package/dist/src/lib/Components/Skeleton/Skeleton.stories.js +0 -49
  100. package/dist/src/lib/Components/Spinner/Spinner.stories.d.ts +0 -9
  101. package/dist/src/lib/Components/Spinner/Spinner.stories.d.ts.map +0 -1
  102. package/dist/src/lib/Components/Spinner/Spinner.stories.js +0 -50
  103. package/dist/src/lib/Components/Spot/Spot.stories.d.ts +0 -12
  104. package/dist/src/lib/Components/Spot/Spot.stories.d.ts.map +0 -1
  105. package/dist/src/lib/Components/Spot/Spot.stories.js +0 -156
  106. package/dist/src/lib/Components/Stepper/Stepper.stories.d.ts +0 -9
  107. package/dist/src/lib/Components/Stepper/Stepper.stories.d.ts.map +0 -1
  108. package/dist/src/lib/Components/Stepper/Stepper.stories.js +0 -35
  109. package/dist/src/lib/Components/Subheader/Subheader.stories.d.ts +0 -10
  110. package/dist/src/lib/Components/Subheader/Subheader.stories.d.ts.map +0 -1
  111. package/dist/src/lib/Components/Subheader/Subheader.stories.js +0 -34
  112. package/dist/src/lib/Components/Switch/Switch.stories.d.ts +0 -14
  113. package/dist/src/lib/Components/Switch/Switch.stories.d.ts.map +0 -1
  114. package/dist/src/lib/Components/Switch/Switch.stories.js +0 -65
  115. package/dist/src/lib/Components/TabBar/TabBar.stories.d.ts +0 -50
  116. package/dist/src/lib/Components/TabBar/TabBar.stories.d.ts.map +0 -1
  117. package/dist/src/lib/Components/TabBar/TabBar.stories.js +0 -60
  118. package/dist/src/lib/Components/Tag/Tag.stories.d.ts +0 -10
  119. package/dist/src/lib/Components/Tag/Tag.stories.d.ts.map +0 -1
  120. package/dist/src/lib/Components/Tag/Tag.stories.js +0 -45
  121. package/dist/src/lib/Components/TextInput/TextInput.stories.d.ts +0 -14
  122. package/dist/src/lib/Components/TextInput/TextInput.stories.d.ts.map +0 -1
  123. package/dist/src/lib/Components/TextInput/TextInput.stories.js +0 -128
  124. package/dist/src/lib/Components/Tile/Tile.stories.d.ts +0 -14
  125. package/dist/src/lib/Components/Tile/Tile.stories.d.ts.map +0 -1
  126. package/dist/src/lib/Components/Tile/Tile.stories.js +0 -117
  127. package/dist/src/lib/Components/TileButton/TileButton.stories.d.ts +0 -12
  128. package/dist/src/lib/Components/TileButton/TileButton.stories.d.ts.map +0 -1
  129. package/dist/src/lib/Components/TileButton/TileButton.stories.js +0 -63
  130. package/dist/src/lib/Components/Tooltip/Tooltip.stories.d.ts +0 -10
  131. package/dist/src/lib/Components/Tooltip/Tooltip.stories.d.ts.map +0 -1
  132. package/dist/src/lib/Components/Tooltip/Tooltip.stories.js +0 -50
  133. package/dist/src/lib/Components/Utility/Box/Box.stories.d.ts +0 -7
  134. package/dist/src/lib/Components/Utility/Box/Box.stories.d.ts.map +0 -1
  135. package/dist/src/lib/Components/Utility/Box/Box.stories.js +0 -42
  136. package/dist/src/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.stories.d.ts +0 -11
  137. package/dist/src/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.stories.d.ts.map +0 -1
  138. package/dist/src/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.stories.js +0 -105
  139. package/dist/src/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.stories.d.ts +0 -10
  140. package/dist/src/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.stories.d.ts.map +0 -1
  141. package/dist/src/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.stories.js +0 -101
  142. package/dist/src/lib/Components/Utility/Pressable/Pressable.stories.d.ts +0 -7
  143. package/dist/src/lib/Components/Utility/Pressable/Pressable.stories.d.ts.map +0 -1
  144. package/dist/src/lib/Components/Utility/Pressable/Pressable.stories.js +0 -47
  145. package/dist/src/lib/Components/Utility/Text/Text.stories.d.ts +0 -7
  146. package/dist/src/lib/Components/Utility/Text/Text.stories.d.ts.map +0 -1
  147. package/dist/src/lib/Components/Utility/Text/Text.stories.js +0 -33
@@ -1,127 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useState } from 'react';
3
- import { View } from 'react-native';
4
- import { Eye, EyeCross } from '../../Symbols';
5
- import { IconButton } from '../IconButton';
6
- import { AmountDisplay } from './AmountDisplay';
7
- const usdFormatter = (value) => {
8
- const [integerPart, decimalPart] = value.toFixed(2).split(/\.|,/);
9
- return {
10
- integerPart,
11
- decimalPart,
12
- currencyText: '$',
13
- decimalSeparator: '.',
14
- currencyPosition: 'start',
15
- };
16
- };
17
- const eurFormatter = (value) => {
18
- const [integerPart, decimalPart] = value.toFixed(2).split(/\.|,/);
19
- return {
20
- integerPart,
21
- decimalPart,
22
- currencyText: '€',
23
- decimalSeparator: ',',
24
- currencyPosition: 'end',
25
- };
26
- };
27
- const btcFormatter = (value) => {
28
- const [integerPart, decimalPart] = value.toFixed(8).split(/\.|,/);
29
- return {
30
- integerPart,
31
- decimalPart,
32
- currencyText: 'BTC',
33
- decimalSeparator: '.',
34
- currencyPosition: 'end',
35
- };
36
- };
37
- const meta = {
38
- component: AmountDisplay,
39
- title: 'Communication/AmountDisplay',
40
- args: {
41
- formatter: eurFormatter,
42
- hidden: false,
43
- animate: true,
44
- },
45
- argTypes: {
46
- formatter: {
47
- options: ['EUR', 'USD', 'BTC'],
48
- mapping: {
49
- USD: usdFormatter,
50
- EUR: eurFormatter,
51
- BTC: btcFormatter,
52
- },
53
- control: {
54
- type: 'select',
55
- },
56
- description: 'Function that formats a number. Returns an object with:\n' +
57
- '- `integerPart`: string\n' +
58
- '- `decimalPart?`: string\n' +
59
- '- `currencyText`: string\n' +
60
- '- `decimalSeparator`: "." | ","\n' +
61
- '- `currencyPosition?`: "start" | "end"',
62
- },
63
- hidden: {
64
- control: {
65
- type: 'boolean',
66
- },
67
- },
68
- animate: {
69
- control: {
70
- type: 'boolean',
71
- },
72
- },
73
- },
74
- parameters: {
75
- layout: 'centered',
76
- backgrounds: { default: 'light' },
77
- docs: {
78
- source: {
79
- language: 'tsx',
80
- format: true,
81
- type: 'code',
82
- },
83
- },
84
- },
85
- };
86
- export default meta;
87
- export const Base = {
88
- args: {
89
- value: 1234.56,
90
- },
91
- parameters: {
92
- docs: {
93
- source: {
94
- code: `<AmountDisplay value={1234.56} />`,
95
- },
96
- },
97
- },
98
- };
99
- export const WithHideButton = {
100
- render: (props) => {
101
- const [hidden, setHidden] = useState(false);
102
- return (_jsxs(View, { style: { flexDirection: 'row', alignItems: 'center', gap: 12 }, children: [_jsx(AmountDisplay, { formatter: props.formatter, value: 1234.56, hidden: hidden }), _jsx(IconButton, { appearance: 'transparent', size: 'sm', icon: hidden ? EyeCross : Eye, accessibilityLabel: hidden ? 'Show amount' : 'Hide amount', onPress: () => setHidden((v) => !v) })] }));
103
- },
104
- };
105
- export const AnimationShowcase = {
106
- args: {
107
- value: 1234.56,
108
- },
109
- render: (props) => {
110
- const [currentValue, setCurrentValue] = useState(props.value);
111
- useEffect(() => {
112
- const interval = setInterval(() => {
113
- setCurrentValue((prev) => {
114
- const delta = prev * (Math.random() * 0.02 - 0.01);
115
- return Math.round((prev + delta) * 100) / 100;
116
- });
117
- }, 2000);
118
- return () => clearInterval(interval);
119
- }, []);
120
- return _jsx(AmountDisplay, { ...props, value: currentValue });
121
- },
122
- };
123
- export const Loading = {
124
- render: (props) => {
125
- return (_jsx(AmountDisplay, { formatter: props.formatter, value: 1234.56, loading: true }));
126
- },
127
- };
@@ -1,16 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react-native-web-vite';
2
- import { AmountInput } from './AmountInput';
3
- declare const meta: Meta<typeof AmountInput>;
4
- export default meta;
5
- type Story = StoryObj<typeof AmountInput>;
6
- export declare const Base: Story;
7
- export declare const WithValue: Story;
8
- export declare const CurrencyPositionLeft: Story;
9
- export declare const CurrencyPositionRight: Story;
10
- export declare const IntegerOnly: Story;
11
- export declare const WithThousandsSeparator: Story;
12
- export declare const WithoutThousandsSeparator: Story;
13
- export declare const ErrorState: Story;
14
- export declare const DisabledAmountInput: Story;
15
- export declare const CustomLengthLimits: Story;
16
- //# sourceMappingURL=AmountInput.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AmountInput.stories.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/AmountInput/AmountInput.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAGvE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,WAAW,CA+ClC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,WAAW,CAAC,CAAC;AAsB1C,eAAO,MAAM,IAAI,EAAE,KAYlB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAWvB,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KAWlC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,KAWnC,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAWzB,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KAWpC,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,KAWvC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAWxB,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KAWjC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAahC,CAAC"}
@@ -1,186 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useState } from 'react';
3
- import { View } from 'react-native';
4
- import { AmountInput } from './AmountInput';
5
- const meta = {
6
- component: AmountInput,
7
- title: 'Input/AmountInput',
8
- parameters: {
9
- docs: {
10
- source: {
11
- language: 'tsx',
12
- format: true,
13
- type: 'code',
14
- },
15
- },
16
- },
17
- argTypes: {
18
- currencyText: {
19
- control: 'text',
20
- description: 'Currency text to display (e.g. USD, EUR, $)',
21
- },
22
- currencyPosition: {
23
- control: 'radio',
24
- options: ['left', 'right'],
25
- description: 'Position of the currency text',
26
- },
27
- allowDecimals: {
28
- control: 'boolean',
29
- description: 'Whether to allow decimal values',
30
- },
31
- thousandsSeparator: {
32
- control: 'boolean',
33
- description: 'Whether to display thousands separator',
34
- },
35
- maxIntegerLength: {
36
- control: 'number',
37
- description: 'Maximum digits for integer part',
38
- },
39
- maxDecimalLength: {
40
- control: 'number',
41
- description: 'Maximum digits for decimal part',
42
- },
43
- isInvalid: {
44
- control: 'boolean',
45
- description: 'Whether the input is in error state',
46
- },
47
- editable: {
48
- control: 'boolean',
49
- description: 'Whether the input is editable',
50
- },
51
- },
52
- };
53
- export default meta;
54
- const AmountInputStory = (args) => {
55
- const [value, setValue] = useState(args.value?.toString() ?? '');
56
- return (_jsx(View, { style: {
57
- flex: 1,
58
- minHeight: 96,
59
- alignItems: 'center',
60
- justifyContent: 'center',
61
- padding: 24,
62
- }, children: _jsx(View, { style: { width: '100%', maxWidth: 320 }, children: _jsx(AmountInput, { ...args, value: value, onChangeText: setValue }) }) }));
63
- };
64
- export const Base = {
65
- render: (args) => _jsx(AmountInputStory, { ...args }),
66
- args: {
67
- currencyText: 'USD',
68
- currencyPosition: 'left',
69
- allowDecimals: true,
70
- thousandsSeparator: true,
71
- maxIntegerLength: 9,
72
- maxDecimalLength: 9,
73
- isInvalid: false,
74
- editable: true,
75
- },
76
- };
77
- export const WithValue = {
78
- render: (args) => _jsx(AmountInputStory, { ...args }),
79
- args: {
80
- value: '1234.56',
81
- currencyText: 'USD',
82
- currencyPosition: 'left',
83
- allowDecimals: true,
84
- thousandsSeparator: true,
85
- isInvalid: false,
86
- editable: true,
87
- },
88
- };
89
- export const CurrencyPositionLeft = {
90
- render: (args) => _jsx(AmountInputStory, { ...args }),
91
- args: {
92
- value: '1000',
93
- currencyText: '$',
94
- currencyPosition: 'left',
95
- allowDecimals: true,
96
- thousandsSeparator: true,
97
- isInvalid: false,
98
- editable: true,
99
- },
100
- };
101
- export const CurrencyPositionRight = {
102
- render: (args) => _jsx(AmountInputStory, { ...args }),
103
- args: {
104
- value: '1000',
105
- currencyText: 'ETH',
106
- currencyPosition: 'right',
107
- allowDecimals: true,
108
- thousandsSeparator: true,
109
- isInvalid: false,
110
- editable: true,
111
- },
112
- };
113
- export const IntegerOnly = {
114
- render: (args) => _jsx(AmountInputStory, { ...args }),
115
- args: {
116
- value: '1234',
117
- currencyText: 'items',
118
- currencyPosition: 'right',
119
- allowDecimals: false,
120
- thousandsSeparator: true,
121
- isInvalid: false,
122
- editable: true,
123
- },
124
- };
125
- export const WithThousandsSeparator = {
126
- render: (args) => _jsx(AmountInputStory, { ...args }),
127
- args: {
128
- value: '1000000',
129
- currencyText: 'USD',
130
- currencyPosition: 'left',
131
- allowDecimals: true,
132
- thousandsSeparator: true,
133
- isInvalid: false,
134
- editable: true,
135
- },
136
- };
137
- export const WithoutThousandsSeparator = {
138
- render: (args) => _jsx(AmountInputStory, { ...args }),
139
- args: {
140
- value: '1000000',
141
- currencyText: 'USD',
142
- currencyPosition: 'left',
143
- allowDecimals: true,
144
- thousandsSeparator: false,
145
- isInvalid: false,
146
- editable: true,
147
- },
148
- };
149
- export const ErrorState = {
150
- render: (args) => _jsx(AmountInputStory, { ...args }),
151
- args: {
152
- value: '1234.56',
153
- currencyText: 'USD',
154
- currencyPosition: 'left',
155
- allowDecimals: true,
156
- thousandsSeparator: true,
157
- isInvalid: true,
158
- editable: true,
159
- },
160
- };
161
- export const DisabledAmountInput = {
162
- render: (args) => _jsx(AmountInputStory, { ...args }),
163
- args: {
164
- value: '1234.56',
165
- currencyText: 'USD',
166
- currencyPosition: 'left',
167
- allowDecimals: true,
168
- thousandsSeparator: true,
169
- isInvalid: false,
170
- editable: false,
171
- },
172
- };
173
- export const CustomLengthLimits = {
174
- render: (args) => _jsx(AmountInputStory, { ...args }),
175
- args: {
176
- value: '123',
177
- currencyText: '$',
178
- currencyPosition: 'left',
179
- allowDecimals: true,
180
- thousandsSeparator: true,
181
- maxIntegerLength: 6,
182
- maxDecimalLength: 2,
183
- isInvalid: false,
184
- editable: true,
185
- },
186
- };
@@ -1,22 +0,0 @@
1
- import { StoryObj } from '@storybook/react-native-web-vite';
2
- declare const meta: {
3
- component: ({ lx, style, src, alt, size, showNotification, ref, ...props }: import("./types").AvatarProps) => import("react/jsx-runtime").JSX.Element;
4
- title: string;
5
- parameters: {
6
- docs: {
7
- source: {
8
- language: string;
9
- format: boolean;
10
- type: string;
11
- };
12
- };
13
- };
14
- };
15
- export default meta;
16
- type Story = StoryObj<typeof meta>;
17
- export declare const Base: Story;
18
- export declare const SizeShowcase: Story;
19
- export declare const FallbackShowcase: Story;
20
- export declare const NotificationShowcase: Story;
21
- export declare const InteractiveShowcase: Story;
22
- //# sourceMappingURL=Avatar.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Avatar.stories.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Avatar/Avatar.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAMlE,QAAA,MAAM,IAAI;;;;;;;;;;;;CAYqB,CAAC;AAEhC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAKnC,eAAO,MAAM,IAAI,EAAE,KAelB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KA6B1B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAe9B,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KAiBlC,CAAC;AAKF,eAAO,MAAM,mBAAmB,EAAE,KAajC,CAAC"}
@@ -1,72 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { View, Text, Pressable, Linking } from 'react-native';
3
- import { Box } from '../Utility';
4
- import { Avatar } from './Avatar';
5
- const meta = {
6
- component: Avatar,
7
- title: 'Communication/Avatar',
8
- parameters: {
9
- docs: {
10
- source: {
11
- language: 'tsx',
12
- format: true,
13
- type: 'code',
14
- },
15
- },
16
- },
17
- };
18
- export default meta;
19
- const exampleSrc = 'https://plus.unsplash.com/premium_photo-1689551670902-19b441a6afde?q=80&w=774&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D';
20
- export const Base = {
21
- args: {
22
- src: exampleSrc,
23
- alt: 'avatar',
24
- size: 'md',
25
- showNotification: false,
26
- },
27
- render: (args) => _jsx(Avatar, { ...args }),
28
- parameters: {
29
- docs: {
30
- source: {
31
- code: `<Avatar src="https://example.com" size="md" alt="avatar" showNotification={false} />`,
32
- },
33
- },
34
- },
35
- };
36
- export const SizeShowcase = {
37
- render: () => (_jsxs(Box, { lx: {
38
- alignItems: 'stretch',
39
- flexDirection: 'row',
40
- gap: 's16',
41
- }, children: [_jsxs(View, { style: { alignItems: 'center', justifyContent: 'flex-end' }, children: [_jsx(Avatar, { src: exampleSrc, alt: 'avatar', size: 'sm', showNotification: false }), _jsx(Text, { style: { marginTop: 4 }, children: "sm" })] }), _jsxs(View, { style: { alignItems: 'center', justifyContent: 'flex-end' }, children: [_jsx(Avatar, { src: exampleSrc, alt: 'avatar', size: 'md', showNotification: false }), _jsx(Text, { style: { marginTop: 4 }, children: "md" })] })] })),
42
- };
43
- export const FallbackShowcase = {
44
- args: {
45
- src: 'https://brokenLink.random',
46
- size: 'md',
47
- alt: 'Fallback example',
48
- showNotification: false,
49
- },
50
- render: (args) => _jsx(Avatar, { ...args }),
51
- parameters: {
52
- docs: {
53
- source: {
54
- code: `<Avatar src="https://brokenLink.random" size="md" alt="Fallback example" showNotification={false} />`,
55
- },
56
- },
57
- },
58
- };
59
- export const NotificationShowcase = {
60
- render: () => (_jsxs(Box, { lx: {
61
- flexDirection: 'row',
62
- gap: 's16',
63
- }, children: [_jsx(Avatar, { src: exampleSrc, alt: 'avatar', size: 'md', showNotification: false }), _jsx(Avatar, { src: exampleSrc, alt: 'avatar', size: 'md', showNotification: true })] })),
64
- };
65
- const onPressRedirect = () => Linking.openURL('https://shop.ledger.com/pages/ledger-nano-gen5');
66
- export const InteractiveShowcase = {
67
- render: () => (_jsx(Pressable, { onPress: onPressRedirect, style: ({ pressed }) => ({
68
- borderRadius: 9999,
69
- opacity: pressed ? 0.7 : 1,
70
- backgroundColor: pressed ? 'rgba(0, 0, 0, 0.05)' : 'transparent',
71
- }), children: _jsx(Avatar, { src: exampleSrc, size: 'md', showNotification: true }) })),
72
- };
@@ -1,16 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react-native-web-vite';
2
- import { Banner } from './Banner';
3
- declare const meta: Meta<typeof Banner>;
4
- export default meta;
5
- type Story = StoryObj<typeof Banner>;
6
- export declare const Base: Story;
7
- export declare const WithDescription: Story;
8
- export declare const WithActions: Story;
9
- export declare const WithFullFeatures: Story;
10
- export declare const AppearanceShowcase: Story;
11
- export declare const ContentVariations: Story;
12
- export declare const NaturalWidth: Story;
13
- export declare const ResponsiveLayout: Story;
14
- export declare const InteractiveDismiss: Story;
15
- export declare const InteractiveActions: Story;
16
- //# sourceMappingURL=Banner.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Banner.stories.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Banner/Banner.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAIvE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CA4E7B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAC;AAErC,eAAO,MAAM,IAAI,EAAE,KA8BlB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KA0B7B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KA6CzB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAgE9B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAgChC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAgF/B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAuB1B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAkC9B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAiBhC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAsDhC,CAAC"}