@ledgerhq/lumen-ui-rnative 0.0.46 → 0.0.47

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 (99) hide show
  1. package/dist/package.json +5 -1
  2. package/dist/src/lib/Components/Icon/Icon.d.ts.map +1 -1
  3. package/dist/src/lib/Components/Icon/Icon.js +3 -4
  4. package/dist/src/lib/Components/Icon/createIcon.d.ts.map +1 -1
  5. package/dist/src/lib/Components/Icon/createIcon.js +1 -1
  6. package/dist/src/lib/Components/ListItem/ListItem.d.ts +88 -34
  7. package/dist/src/lib/Components/ListItem/ListItem.d.ts.map +1 -1
  8. package/dist/src/lib/Components/ListItem/ListItem.js +242 -97
  9. package/dist/src/lib/Components/ListItem/ListItem.stories.d.ts +2 -3
  10. package/dist/src/lib/Components/ListItem/ListItem.stories.d.ts.map +1 -1
  11. package/dist/src/lib/Components/ListItem/ListItem.stories.js +63 -73
  12. package/dist/src/lib/Components/ListItem/index.d.ts +1 -1
  13. package/dist/src/lib/Components/ListItem/index.d.ts.map +1 -1
  14. package/dist/src/lib/Components/ListItem/index.js +1 -1
  15. package/dist/src/lib/Components/ListItem/types.d.ts +106 -0
  16. package/dist/src/lib/Components/ListItem/types.d.ts.map +1 -0
  17. package/dist/src/lib/Components/Spot/types.d.ts +1 -1
  18. package/dist/src/lib/Components/Spot/types.d.ts.map +1 -1
  19. package/dist/src/lib/utils/index.d.ts +3 -4
  20. package/dist/src/lib/utils/index.d.ts.map +1 -1
  21. package/dist/src/lib/utils/index.js +3 -4
  22. package/dist/src/lib/utils/react/{extract-text-from-children.d.ts → extractTextFromChildren.d.ts} +1 -1
  23. package/dist/src/lib/utils/react/extractTextFromChildren.d.ts.map +1 -0
  24. package/dist/src/lib/utils/react/index.d.ts +1 -1
  25. package/dist/src/lib/utils/react/index.d.ts.map +1 -1
  26. package/dist/src/lib/utils/react/index.js +1 -1
  27. package/dist/src/lib/utils/startTransition/index.d.ts +2 -0
  28. package/dist/src/lib/utils/startTransition/index.d.ts.map +1 -0
  29. package/dist/src/lib/utils/startTransition/index.js +1 -0
  30. package/dist/src/lib/utils/{start-transition/start-transition.d.ts → startTransition/startTransition.d.ts} +1 -1
  31. package/dist/src/lib/utils/startTransition/startTransition.d.ts.map +1 -0
  32. package/dist/src/lib/utils/useControllableState/index.d.ts +2 -0
  33. package/dist/src/lib/utils/useControllableState/index.d.ts.map +1 -0
  34. package/dist/src/lib/utils/useControllableState/index.js +1 -0
  35. package/dist/src/lib/utils/{use-controllable-state/use-controllable-state.d.ts → useControllableState/useControllableState.d.ts} +1 -1
  36. package/dist/src/lib/utils/useControllableState/useControllableState.d.ts.map +1 -0
  37. package/dist/src/lib/utils/{use-controllable-state/use-controllable-state.js → useControllableState/useControllableState.js} +2 -2
  38. package/dist/src/lib/utils/useEvent/index.d.ts +3 -0
  39. package/dist/src/lib/utils/useEvent/index.d.ts.map +1 -0
  40. package/dist/src/lib/utils/useEvent/index.js +2 -0
  41. package/dist/src/lib/utils/{use-event/use-event.d.ts → useEvent/useEvent.d.ts} +1 -1
  42. package/dist/src/lib/utils/useEvent/useEvent.d.ts.map +1 -0
  43. package/dist/src/lib/utils/{use-event/use-event.js → useEvent/useEvent.js} +1 -1
  44. package/dist/src/lib/utils/{use-event/use-get.d.ts → useEvent/useGet.d.ts} +1 -1
  45. package/dist/src/lib/utils/useEvent/useGet.d.ts.map +1 -0
  46. package/dist/src/styles/provider/LumenStyleSheetProvider.d.ts +1 -1
  47. package/dist/src/styles/provider/LumenStyleSheetProvider.d.ts.map +1 -1
  48. package/dist/src/styles/provider/LumenStyleSheetProvider.js +1 -2
  49. package/package.json +6 -2
  50. package/src/lib/Components/Checkbox/Checkbox.mdx +1 -0
  51. package/src/lib/Components/Icon/Icon.tsx +3 -5
  52. package/src/lib/Components/Icon/createIcon.ts +1 -1
  53. package/src/lib/Components/ListItem/ListItem.mdx +402 -124
  54. package/src/lib/Components/ListItem/ListItem.stories.tsx +357 -228
  55. package/src/lib/Components/ListItem/ListItem.tsx +437 -181
  56. package/src/lib/Components/ListItem/index.ts +1 -1
  57. package/src/lib/Components/ListItem/types.ts +121 -0
  58. package/src/lib/Components/Spot/types.ts +5 -1
  59. package/src/lib/Components/Switch/Switch.mdx +1 -0
  60. package/src/lib/utils/index.ts +3 -4
  61. package/src/lib/utils/react/index.ts +1 -1
  62. package/src/lib/utils/startTransition/index.ts +1 -0
  63. package/src/lib/utils/useControllableState/index.ts +1 -0
  64. package/src/lib/utils/{use-controllable-state/use-controllable-state.ts → useControllableState/useControllableState.ts} +2 -2
  65. package/src/lib/utils/useEvent/index.ts +2 -0
  66. package/src/lib/utils/{use-event/use-event.ts → useEvent/useEvent.ts} +1 -1
  67. package/src/styles/provider/LumenStyleSheetProvider.tsx +2 -3
  68. package/dist/src/lib/Components/ListItem/ListItem.types.d.ts +0 -31
  69. package/dist/src/lib/Components/ListItem/ListItem.types.d.ts.map +0 -1
  70. package/dist/src/lib/utils/react/extract-text-from-children.d.ts.map +0 -1
  71. package/dist/src/lib/utils/start-transition/index.d.ts +0 -2
  72. package/dist/src/lib/utils/start-transition/index.d.ts.map +0 -1
  73. package/dist/src/lib/utils/start-transition/index.js +0 -1
  74. package/dist/src/lib/utils/start-transition/start-transition.d.ts.map +0 -1
  75. package/dist/src/lib/utils/string-utils.d.ts +0 -6
  76. package/dist/src/lib/utils/string-utils.d.ts.map +0 -1
  77. package/dist/src/lib/utils/string-utils.js +0 -12
  78. package/dist/src/lib/utils/use-controllable-state/index.d.ts +0 -2
  79. package/dist/src/lib/utils/use-controllable-state/index.d.ts.map +0 -1
  80. package/dist/src/lib/utils/use-controllable-state/index.js +0 -1
  81. package/dist/src/lib/utils/use-controllable-state/use-controllable-state.d.ts.map +0 -1
  82. package/dist/src/lib/utils/use-event/index.d.ts +0 -3
  83. package/dist/src/lib/utils/use-event/index.d.ts.map +0 -1
  84. package/dist/src/lib/utils/use-event/index.js +0 -2
  85. package/dist/src/lib/utils/use-event/use-event.d.ts.map +0 -1
  86. package/dist/src/lib/utils/use-event/use-get.d.ts.map +0 -1
  87. package/src/lib/Components/ListItem/ListItem.types.ts +0 -31
  88. package/src/lib/utils/start-transition/index.ts +0 -1
  89. package/src/lib/utils/string-utils.test.ts +0 -73
  90. package/src/lib/utils/string-utils.ts +0 -11
  91. package/src/lib/utils/use-controllable-state/index.ts +0 -1
  92. package/src/lib/utils/use-event/index.ts +0 -2
  93. /package/dist/src/lib/Components/ListItem/{ListItem.types.js → types.js} +0 -0
  94. /package/dist/src/lib/utils/react/{extract-text-from-children.js → extractTextFromChildren.js} +0 -0
  95. /package/dist/src/lib/utils/{start-transition/start-transition.js → startTransition/startTransition.js} +0 -0
  96. /package/dist/src/lib/utils/{use-event/use-get.js → useEvent/useGet.js} +0 -0
  97. /package/src/lib/utils/react/{extract-text-from-children.ts → extractTextFromChildren.ts} +0 -0
  98. /package/src/lib/utils/{start-transition/start-transition.ts → startTransition/startTransition.ts} +0 -0
  99. /package/src/lib/utils/{use-event/use-get.ts → useEvent/useGet.ts} +0 -0
@@ -0,0 +1,121 @@
1
+ import React from 'react';
2
+ import {
3
+ LumenTextStyle,
4
+ StyledPressableProps,
5
+ StyledTextProps,
6
+ StyledViewProps,
7
+ } from '../../../styles';
8
+ import { DiscriminatedSpotProps } from '../Spot';
9
+
10
+ /**
11
+ * Context value for passing state to sub-components
12
+ */
13
+ export type ListItemContextValue = {
14
+ disabled?: boolean;
15
+ };
16
+
17
+ /**
18
+ * Props for the ListItem root component
19
+ */
20
+ export type ListItemProps = {
21
+ /**
22
+ * The content of the list item (ListItemLeading, ListItemTrailing)
23
+ */
24
+ children: React.ReactNode;
25
+ /**
26
+ * Whether the list item is disabled.
27
+ */
28
+ disabled?: boolean;
29
+ /**
30
+ * Callback function when the list item is pressed.
31
+ */
32
+ onPress?: StyledPressableProps['onPress'];
33
+ } & Omit<StyledPressableProps, 'disabled' | 'children'>;
34
+
35
+ /**
36
+ * Props for the ListItemLeading component
37
+ */
38
+ export type ListItemLeadingProps = {
39
+ /**
40
+ * The content of the leading area (visual element + ListItemContent)
41
+ */
42
+ children: React.ReactNode;
43
+ } & Omit<StyledViewProps, 'children'>;
44
+
45
+ /**
46
+ * Props for the ListItemContent component
47
+ */
48
+ export type ListItemContentProps = {
49
+ /**
50
+ * The content (ListItemTitle, ListItemDescription)
51
+ */
52
+ children: React.ReactNode;
53
+ } & Omit<StyledViewProps, 'children'>;
54
+
55
+ /**
56
+ * Props for the ListItemTitle component
57
+ */
58
+ export type ListItemTitleProps = {
59
+ /**
60
+ * The title text or custom content
61
+ */
62
+ children: React.ReactNode;
63
+ } & Omit<StyledTextProps, 'children'>;
64
+
65
+ /**
66
+ * Props for the ListItemDescription component
67
+ */
68
+ export type ListItemDescriptionProps = {
69
+ /**
70
+ * The description text or custom content
71
+ */
72
+ children: React.ReactNode;
73
+ } & Omit<StyledTextProps, 'children'>;
74
+
75
+ /**
76
+ * Props for the ListItemTrailing component
77
+ */
78
+ export type ListItemTrailingProps = {
79
+ /**
80
+ * The trailing content (icons, switches, values, etc.)
81
+ */
82
+ children: React.ReactNode;
83
+ } & Omit<StyledViewProps, 'children'>;
84
+
85
+ /**
86
+ * Props for the ListItemTruncate component
87
+ * Used to truncate text that should when ListItemDescription or ListItemTitle contain custom content
88
+ */
89
+ export type ListItemTruncateProps = {
90
+ /**
91
+ * The text content to truncate
92
+ */
93
+ children: string;
94
+ /**
95
+ * The variant determines typography and color styling.
96
+ * Use 'title' inside ListItemTitle and 'description' inside ListItemDescription.
97
+ * @default 'description'
98
+ */
99
+ variant?: 'title' | 'description';
100
+ } & Omit<StyledTextProps, 'children'>;
101
+
102
+ /**
103
+ * Props for the ListItemSpot component
104
+ * Spot adapter that inherits disabled state from parent ListItem
105
+ */
106
+ export type ListItemSpotProps = DiscriminatedSpotProps &
107
+ Omit<StyledViewProps, 'children'>;
108
+
109
+ /**
110
+ * Props for the ListItemIcon component
111
+ */
112
+ export type ListItemIconProps = {
113
+ /**
114
+ * The icon component to render
115
+ */
116
+ icon: React.ComponentType<any>;
117
+ /**
118
+ * Optional color override. If not provided, uses theme color with disabled state handling.
119
+ */
120
+ color?: LumenTextStyle['color'];
121
+ } & Omit<StyledViewProps, 'children'>;
@@ -41,7 +41,11 @@ type StatusSpotProps = {
41
41
  appearance: Exclude<SpotAppearance, 'icon' | 'number'>;
42
42
  };
43
43
 
44
- type DiscriminatedSpotProps = IconSpotProps | NumberSpotProps | StatusSpotProps;
44
+ export type DiscriminatedSpotProps =
45
+ | IconSpotProps
46
+ | NumberSpotProps
47
+ | StatusSpotProps;
48
+
45
49
  export type SpotSize = 48 | 56 | 72;
46
50
 
47
51
  export type SpotProps = {
@@ -1,6 +1,7 @@
1
1
  import { Meta, Story, Canvas, Controls } from '@storybook/addon-docs/blocks';
2
2
  import * as SwitchStories from './Switch.stories';
3
3
  import { Switch } from './Switch';
4
+ import { Box } from '../Utility';
4
5
  import { CustomTabs, Tab } from '../../../../.storybook/components';
5
6
  import { DoVsDontRow, DoBlockItem, DontBlockItem } from '../../../../.storybook/components/DoVsDont';
6
7
  import CommonRulesDoAndDont from '../../../../.storybook/components/DoVsDont/CommonRulesDoAndDont.mdx';
@@ -1,7 +1,6 @@
1
1
  export * from './constants';
2
2
  export * from './components';
3
3
  export * from './react';
4
- export * from './use-controllable-state';
5
- export * from './string-utils';
6
- export * from './use-event';
7
- export * from './start-transition';
4
+ export * from './useControllableState';
5
+ export * from './useEvent';
6
+ export * from './startTransition';
@@ -1 +1 @@
1
- export * from './extract-text-from-children';
1
+ export * from './extractTextFromChildren';
@@ -0,0 +1 @@
1
+ export * from './startTransition';
@@ -0,0 +1 @@
1
+ export * from './useControllableState';
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import { startTransition } from '../start-transition';
3
- import { useEvent } from '../use-event';
2
+ import { startTransition } from '../startTransition';
3
+ import { useEvent } from '../useEvent';
4
4
 
5
5
  // can configure to allow most-recent-wins or prop-wins
6
6
  // defaults to prop-wins
@@ -0,0 +1,2 @@
1
+ export * from './useEvent';
2
+ export * from './useGet';
@@ -1,4 +1,4 @@
1
- import { useGet } from './use-get';
1
+ import { useGet } from './useGet';
2
2
 
3
3
  type AnyFunction = (...args: any[]) => any;
4
4
 
@@ -5,11 +5,10 @@ import {
5
5
  ColorSchemeName,
6
6
  useColorScheme as useReactNativeColorScheme,
7
7
  } from 'react-native';
8
- import { RuntimeConstants } from '../../lib/utils';
9
- import { useControllableState } from '../../lib/utils/use-controllable-state/use-controllable-state';
8
+ import { RuntimeConstants, useControllableState } from '../../lib/utils';
10
9
  import { createStylesheetTheme } from '../theme/createStylesheetTheme';
11
10
  import { type LumenStyleSheetTheme } from '../types';
12
- import { LumenStyleSheetProviderProps } from './types';
11
+ import { type LumenStyleSheetProviderProps } from './types';
13
12
 
14
13
  const DARK_MODE = 'dark';
15
14
  const LIGHT_MODE = 'light';
@@ -1,31 +0,0 @@
1
- import { StyledPressableProps } from '../../../styles';
2
- export type ListItemProps = {
3
- /**
4
- * The main title of the list item.
5
- */
6
- title: string;
7
- /**
8
- * Optional descriptive text below the title.
9
- */
10
- description?: string;
11
- /**
12
- * Optional content to display on the left, usually a Spot component.
13
- * @example leadingContent={<Spot appearance="icon" icon={Settings} />}
14
- */
15
- leadingContent?: React.ReactNode;
16
- /**
17
- * Optional Tag component displayed next to the description.
18
- * @example descriptionTag={<Tag label="New" appearance="accent" size="sm" />}
19
- */
20
- descriptionTag?: React.ReactNode;
21
- /**
22
- * Custom content to render on the right side of the list item.
23
- * @example trailingContent={<Icon />}
24
- */
25
- trailingContent?: React.ReactNode;
26
- /**
27
- * Whether the list item is disabled.
28
- */
29
- disabled?: boolean;
30
- } & Omit<StyledPressableProps, 'disabled'>;
31
- //# sourceMappingURL=ListItem.types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ListItem.types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/ListItem/ListItem.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC;;;OAGG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC;;;OAGG;IACH,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAClC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"extract-text-from-children.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/react/extract-text-from-children.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,KAAK,CAAC,SAAS,EACzB,iBAAiB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,GAC3C,MAAM,CAoBR"}
@@ -1,2 +0,0 @@
1
- export * from './start-transition';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/start-transition/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
@@ -1 +0,0 @@
1
- export * from './start-transition';
@@ -1 +0,0 @@
1
- {"version":3,"file":"start-transition.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/start-transition/start-transition.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,GAAI,UAAU,KAAK,CAAC,kBAAkB,KAAG,IAQpE,CAAC"}
@@ -1,6 +0,0 @@
1
- /**
2
- * Transforms a kebab-case or snake_case string into a PascalCase string.
3
- * e.g., 'arrow-up' -> 'ArrowUp'
4
- */
5
- export declare function toPascalCase(str: string): string;
6
- //# sourceMappingURL=string-utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"string-utils.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/string-utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAMhD"}
@@ -1,12 +0,0 @@
1
- /**
2
- * Transforms a kebab-case or snake_case string into a PascalCase string.
3
- * e.g., 'arrow-up' -> 'ArrowUp'
4
- */
5
- export function toPascalCase(str) {
6
- if (!str)
7
- return '';
8
- return str
9
- .split(/[-_ ]+/)
10
- .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
11
- .join('');
12
- }
@@ -1,2 +0,0 @@
1
- export * from './use-controllable-state';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/use-controllable-state/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
@@ -1 +0,0 @@
1
- export * from './use-controllable-state';
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-controllable-state.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/use-controllable-state/use-controllable-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,KAAK,QAAQ,CAAC,CAAC,IACX,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC,GACnB,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;AAI5C;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,EACtC,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,QAAsB,EACtB,UAAU,GACX,EAAE;IACD,IAAI,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC;IACrB,WAAW,EAAE,CAAC,CAAC;IACf,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IACvB,QAAQ,CAAC,EAAE,WAAW,GAAG,kBAAkB,CAAC;IAC5C,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAsC/C"}
@@ -1,3 +0,0 @@
1
- export * from './use-event';
2
- export * from './use-get';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/use-event/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './use-event';
2
- export * from './use-get';
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-event.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/use-event/use-event.ts"],"names":[],"mappings":"AAEA,KAAK,WAAW,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AAE3C,wBAAgB,QAAQ,CAAC,CAAC,SAAS,WAAW,EAAE,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,CAE/D"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-get.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/use-event/use-get.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,MAAM,CAAC,CAAC,EACtB,YAAY,EAAE,CAAC,EACf,YAAY,CAAC,EAAE,GAAG,EAClB,iBAAiB,CAAC,EAAE,OAAO,GAC1B,MAAM,CAAC,CAYT"}
@@ -1,31 +0,0 @@
1
- import { StyledPressableProps } from '../../../styles';
2
-
3
- export type ListItemProps = {
4
- /**
5
- * The main title of the list item.
6
- */
7
- title: string;
8
- /**
9
- * Optional descriptive text below the title.
10
- */
11
- description?: string;
12
- /**
13
- * Optional content to display on the left, usually a Spot component.
14
- * @example leadingContent={<Spot appearance="icon" icon={Settings} />}
15
- */
16
- leadingContent?: React.ReactNode;
17
- /**
18
- * Optional Tag component displayed next to the description.
19
- * @example descriptionTag={<Tag label="New" appearance="accent" size="sm" />}
20
- */
21
- descriptionTag?: React.ReactNode;
22
- /**
23
- * Custom content to render on the right side of the list item.
24
- * @example trailingContent={<Icon />}
25
- */
26
- trailingContent?: React.ReactNode;
27
- /**
28
- * Whether the list item is disabled.
29
- */
30
- disabled?: boolean;
31
- } & Omit<StyledPressableProps, 'disabled'>;
@@ -1 +0,0 @@
1
- export * from './start-transition';
@@ -1,73 +0,0 @@
1
- import { describe, it, expect } from '@jest/globals';
2
- import { toPascalCase } from './string-utils';
3
-
4
- describe('toPascalCase', () => {
5
- it('should convert kebab-case to PascalCase', () => {
6
- expect(toPascalCase('arrow-up')).toBe('ArrowUp');
7
- expect(toPascalCase('chevron-down')).toBe('ChevronDown');
8
- expect(toPascalCase('external-link')).toBe('ExternalLink');
9
- expect(toPascalCase('settings-alt-2')).toBe('SettingsAlt2');
10
- });
11
-
12
- it('should convert snake_case to PascalCase', () => {
13
- expect(toPascalCase('arrow_up')).toBe('ArrowUp');
14
- expect(toPascalCase('chevron_down')).toBe('ChevronDown');
15
- expect(toPascalCase('external_link')).toBe('ExternalLink');
16
- expect(toPascalCase('settings_alt_2')).toBe('SettingsAlt2');
17
- });
18
-
19
- it('should convert space-separated words to PascalCase', () => {
20
- expect(toPascalCase('arrow up')).toBe('ArrowUp');
21
- expect(toPascalCase('chevron down')).toBe('ChevronDown');
22
- expect(toPascalCase('external link')).toBe('ExternalLink');
23
- });
24
-
25
- it('should handle mixed separators', () => {
26
- expect(toPascalCase('arrow-up_down')).toBe('ArrowUpDown');
27
- expect(toPascalCase('external_link-icon')).toBe('ExternalLinkIcon');
28
- expect(toPascalCase('settings alt-2_variant')).toBe('SettingsAlt2Variant');
29
- });
30
-
31
- it('should handle single words', () => {
32
- expect(toPascalCase('arrow')).toBe('Arrow');
33
- expect(toPascalCase('icon')).toBe('Icon');
34
- expect(toPascalCase('button')).toBe('Button');
35
- });
36
-
37
- it('should handle empty string', () => {
38
- expect(toPascalCase('')).toBe('');
39
- });
40
-
41
- it('should handle strings with numbers', () => {
42
- expect(toPascalCase('icon-24')).toBe('Icon24');
43
- expect(toPascalCase('chart_1')).toBe('Chart1');
44
- expect(toPascalCase('version 2')).toBe('Version2');
45
- expect(toPascalCase('api-v1-endpoint')).toBe('ApiV1Endpoint');
46
- });
47
-
48
- it('should handle multiple consecutive separators', () => {
49
- expect(toPascalCase('arrow--up')).toBe('ArrowUp');
50
- expect(toPascalCase('external__link')).toBe('ExternalLink');
51
- expect(toPascalCase('icon button')).toBe('IconButton');
52
- expect(toPascalCase('mixed-_-separators')).toBe('MixedSeparators');
53
- });
54
-
55
- it('should handle separators at the beginning and end', () => {
56
- expect(toPascalCase('-arrow-up')).toBe('ArrowUp');
57
- expect(toPascalCase('_external-link_')).toBe('ExternalLink');
58
- expect(toPascalCase(' icon button ')).toBe('IconButton');
59
- expect(toPascalCase('--start-end--')).toBe('StartEnd');
60
- });
61
-
62
- it('should handle case variations in input', () => {
63
- expect(toPascalCase('ARROW-UP')).toBe('ArrowUp');
64
- expect(toPascalCase('ExTerNaL-LiNk')).toBe('ExternalLink');
65
- expect(toPascalCase('mixed_CASE_string')).toBe('MixedCaseString');
66
- });
67
-
68
- it('should handle single character segments', () => {
69
- expect(toPascalCase('a-b-c')).toBe('ABC');
70
- expect(toPascalCase('x_y_z')).toBe('XYZ');
71
- expect(toPascalCase('i o s')).toBe('IOS');
72
- });
73
- });
@@ -1,11 +0,0 @@
1
- /**
2
- * Transforms a kebab-case or snake_case string into a PascalCase string.
3
- * e.g., 'arrow-up' -> 'ArrowUp'
4
- */
5
- export function toPascalCase(str: string): string {
6
- if (!str) return '';
7
- return str
8
- .split(/[-_ ]+/)
9
- .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
10
- .join('');
11
- }
@@ -1 +0,0 @@
1
- export * from './use-controllable-state';
@@ -1,2 +0,0 @@
1
- export * from './use-event';
2
- export * from './use-get';