jfs-components 0.0.1 → 0.0.3
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.
- package/lib/commonjs/components/ActionFooter/ActionFooter.js +124 -0
- package/lib/commonjs/components/ActionFooter/ActionFooter.js.map +1 -0
- package/lib/commonjs/components/ActionFooter/ActionFooter.mdx +101 -0
- package/lib/commonjs/components/Button/Button.js +1 -1
- package/lib/commonjs/components/Button/Button.js.map +1 -1
- package/lib/commonjs/components/Button/Button.mdx +2 -2
- package/lib/commonjs/components/CardFeedback/CardFeedback.js +47 -11
- package/lib/commonjs/components/CardFeedback/CardFeedback.js.map +1 -1
- package/lib/commonjs/components/CardFeedback/CardFeedback.mdx +1 -0
- package/lib/commonjs/components/Divider/Divider.js +63 -0
- package/lib/commonjs/components/Divider/Divider.js.map +1 -0
- package/lib/commonjs/components/Divider/Divider.mdx +91 -0
- package/lib/commonjs/components/ListItem/ListItem.js +24 -13
- package/lib/commonjs/components/ListItem/ListItem.js.map +1 -1
- package/lib/commonjs/components/ListItem/ListItem.mdx +46 -5
- package/lib/commonjs/components/MerchantProfile/MerchantProfile.js +133 -0
- package/lib/commonjs/components/MerchantProfile/MerchantProfile.js.map +1 -0
- package/lib/commonjs/components/MerchantProfile/MerchantProfile.mdx +139 -0
- package/lib/commonjs/components/MoneyValue/MoneyValue.js +36 -4
- package/lib/commonjs/components/MoneyValue/MoneyValue.js.map +1 -1
- package/lib/commonjs/components/MoneyValue/MoneyValue.mdx +4 -0
- package/lib/commonjs/components/NavArrow/NavArrow.js +90 -0
- package/lib/commonjs/components/NavArrow/NavArrow.js.map +1 -0
- package/lib/commonjs/components/NavArrow/NavArrow.mdx +123 -0
- package/lib/commonjs/components/Section/Section.mdx +4 -4
- package/lib/commonjs/components/Stepper/Step.mdx +1 -1
- package/lib/commonjs/components/index.js +28 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/design-tokens/JFS Variables-variables-full.json +18633 -1
- package/lib/commonjs/design-tokens/figma-variables-resolver.js.map +1 -2
- package/lib/commonjs/icons/registry.js +1 -1
- package/lib/module/components/ActionFooter/ActionFooter.js +119 -0
- package/lib/module/components/ActionFooter/ActionFooter.js.map +1 -0
- package/lib/module/components/ActionFooter/ActionFooter.mdx +101 -0
- package/lib/module/components/Button/Button.js +1 -1
- package/lib/module/components/Button/Button.js.map +1 -1
- package/lib/module/components/Button/Button.mdx +2 -2
- package/lib/module/components/CardFeedback/CardFeedback.js +46 -11
- package/lib/module/components/CardFeedback/CardFeedback.js.map +1 -1
- package/lib/module/components/CardFeedback/CardFeedback.mdx +1 -0
- package/lib/module/components/Divider/Divider.js +58 -0
- package/lib/module/components/Divider/Divider.js.map +1 -0
- package/lib/module/components/Divider/Divider.mdx +91 -0
- package/lib/module/components/ListItem/ListItem.js +24 -13
- package/lib/module/components/ListItem/ListItem.js.map +1 -1
- package/lib/module/components/ListItem/ListItem.mdx +46 -5
- package/lib/module/components/MerchantProfile/MerchantProfile.js +128 -0
- package/lib/module/components/MerchantProfile/MerchantProfile.js.map +1 -0
- package/lib/module/components/MerchantProfile/MerchantProfile.mdx +139 -0
- package/lib/module/components/MoneyValue/MoneyValue.js +36 -4
- package/lib/module/components/MoneyValue/MoneyValue.js.map +1 -1
- package/lib/module/components/MoneyValue/MoneyValue.mdx +4 -0
- package/lib/module/components/NavArrow/NavArrow.js +84 -0
- package/lib/module/components/NavArrow/NavArrow.js.map +1 -0
- package/lib/module/components/NavArrow/NavArrow.mdx +123 -0
- package/lib/module/components/Section/Section.mdx +4 -4
- package/lib/module/components/Stepper/Step.mdx +1 -1
- package/lib/module/components/index.js +4 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/design-tokens/JFS Variables-variables-full.json +18633 -1
- package/lib/module/icons/registry.js +1 -1
- package/lib/typescript/components/ActionFooter/ActionFooter.d.ts +58 -0
- package/lib/typescript/components/ActionFooter/ActionFooter.d.ts.map +1 -0
- package/lib/typescript/components/CardFeedback/CardFeedback.d.ts +4 -3
- package/lib/typescript/components/CardFeedback/CardFeedback.d.ts.map +1 -1
- package/lib/typescript/components/Divider/Divider.d.ts +50 -0
- package/lib/typescript/components/Divider/Divider.d.ts.map +1 -0
- package/lib/typescript/components/ListItem/ListItem.d.ts +4 -3
- package/lib/typescript/components/ListItem/ListItem.d.ts.map +1 -1
- package/lib/typescript/components/MerchantProfile/MerchantProfile.d.ts +68 -0
- package/lib/typescript/components/MerchantProfile/MerchantProfile.d.ts.map +1 -0
- package/lib/typescript/components/MoneyValue/MoneyValue.d.ts +9 -2
- package/lib/typescript/components/MoneyValue/MoneyValue.d.ts.map +1 -1
- package/lib/typescript/components/NavArrow/NavArrow.d.ts +35 -0
- package/lib/typescript/components/NavArrow/NavArrow.d.ts.map +1 -0
- package/lib/typescript/components/index.d.ts +4 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/icons/registry.d.ts +1 -1
- package/package.json +2 -2
- package/src/components/.token-metadata.json +99 -11
- package/src/components/ActionFooter/ActionFooter.mdx +101 -0
- package/src/components/ActionFooter/ActionFooter.tsx +142 -0
- package/src/components/Button/Button.mdx +2 -2
- package/src/components/Button/Button.tsx +1 -1
- package/src/components/CardFeedback/CardFeedback.mdx +1 -0
- package/src/components/CardFeedback/CardFeedback.tsx +37 -12
- package/src/components/Divider/Divider.mdx +91 -0
- package/src/components/Divider/Divider.tsx +91 -0
- package/src/components/ListItem/ListItem.mdx +46 -5
- package/src/components/ListItem/ListItem.tsx +22 -11
- package/src/components/MerchantProfile/MerchantProfile.mdx +139 -0
- package/src/components/MerchantProfile/MerchantProfile.tsx +174 -0
- package/src/components/MoneyValue/MoneyValue.mdx +4 -0
- package/src/components/MoneyValue/MoneyValue.tsx +39 -3
- package/src/components/NavArrow/NavArrow.mdx +123 -0
- package/src/components/NavArrow/NavArrow.tsx +108 -0
- package/src/components/Section/Section.mdx +4 -4
- package/src/components/Stepper/Step.mdx +1 -1
- package/src/components/index.ts +4 -0
- package/src/design-tokens/JFS Variables-variables-full.json +18633 -1
- package/src/icons/registry.ts +1 -1
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { View, type ViewStyle } from 'react-native'
|
|
3
|
+
import Svg, { Path } from 'react-native-svg'
|
|
4
|
+
import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
|
|
5
|
+
|
|
6
|
+
type NavArrowDirection = 'Back' | 'Forward'
|
|
7
|
+
|
|
8
|
+
type NavArrowProps = {
|
|
9
|
+
/** Direction of the arrow: 'Back' (left chevron) or 'Forward' (right chevron) */
|
|
10
|
+
direction?: NavArrowDirection
|
|
11
|
+
/** Modes used to resolve design tokens */
|
|
12
|
+
modes?: Record<string, any>
|
|
13
|
+
/** Optional additional container style */
|
|
14
|
+
style?: ViewStyle
|
|
15
|
+
/** Accessibility label for the arrow */
|
|
16
|
+
accessibilityLabel?: string
|
|
17
|
+
} & Omit<React.ComponentProps<typeof View>, 'style' | 'accessibilityLabel'>
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* NavArrow component that displays a small chevron arrow for navigation.
|
|
21
|
+
*
|
|
22
|
+
* This component uses design tokens for all visual properties:
|
|
23
|
+
* - navArrow/icon/color - chevron stroke color
|
|
24
|
+
* - navArrow/icon/width - icon width
|
|
25
|
+
* - navArrow/icon/height - icon height
|
|
26
|
+
* - navArrow/icon/strokeWeight - stroke width
|
|
27
|
+
* - navArrow/width - container width
|
|
28
|
+
* - navArrow/height - container height
|
|
29
|
+
* - navArrow/radius - border radius
|
|
30
|
+
* - navArrow/background - background color
|
|
31
|
+
*
|
|
32
|
+
* @component
|
|
33
|
+
* @param {Object} props
|
|
34
|
+
* @param {'Back'|'Forward'} [props.direction='Back'] - Arrow direction
|
|
35
|
+
* @param {Object} [props.modes={}] - Modes for design token resolution
|
|
36
|
+
* @param {Object} [props.style] - Additional container styles
|
|
37
|
+
*/
|
|
38
|
+
function NavArrow({
|
|
39
|
+
direction = 'Back',
|
|
40
|
+
modes = {},
|
|
41
|
+
style,
|
|
42
|
+
accessibilityLabel,
|
|
43
|
+
...rest
|
|
44
|
+
}: NavArrowProps) {
|
|
45
|
+
// Resolve design tokens
|
|
46
|
+
const iconColor =
|
|
47
|
+
(getVariableByName('navArrow/icon/color', modes) as string) || '#24262b'
|
|
48
|
+
const iconWidth =
|
|
49
|
+
Number(getVariableByName('navArrow/icon/width', modes)) || 4
|
|
50
|
+
const iconHeight =
|
|
51
|
+
Number(getVariableByName('navArrow/icon/height', modes)) || 8
|
|
52
|
+
const strokeWeight =
|
|
53
|
+
Number(getVariableByName('navArrow/icon/strokeWeight', modes)) || 2
|
|
54
|
+
const containerWidth =
|
|
55
|
+
Number(getVariableByName('navArrow/width', modes)) || 6
|
|
56
|
+
const containerHeight =
|
|
57
|
+
Number(getVariableByName('navArrow/height', modes)) || 10
|
|
58
|
+
const borderRadius =
|
|
59
|
+
Number(getVariableByName('navArrow/radius', modes)) || 0
|
|
60
|
+
const backgroundColor =
|
|
61
|
+
(getVariableByName('navArrow/background', modes) as string) || 'transparent'
|
|
62
|
+
|
|
63
|
+
const containerStyle: ViewStyle = {
|
|
64
|
+
width: containerWidth,
|
|
65
|
+
height: containerHeight,
|
|
66
|
+
borderRadius,
|
|
67
|
+
backgroundColor,
|
|
68
|
+
alignItems: 'center',
|
|
69
|
+
justifyContent: 'center',
|
|
70
|
+
...(style || {}),
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const defaultAccessibilityLabel =
|
|
74
|
+
accessibilityLabel || (direction === 'Back' ? 'Go back' : 'Go forward')
|
|
75
|
+
|
|
76
|
+
// SVG path for chevron - draws a simple ">" shape
|
|
77
|
+
// For Back direction, we flip horizontally with scaleX(-1)
|
|
78
|
+
// The path creates a chevron pointing right by default
|
|
79
|
+
const chevronPath = `M1 1L${iconWidth - 1} ${iconHeight / 2}L1 ${iconHeight - 1}`
|
|
80
|
+
|
|
81
|
+
return (
|
|
82
|
+
<View
|
|
83
|
+
style={containerStyle}
|
|
84
|
+
accessibilityRole="image"
|
|
85
|
+
accessibilityLabel={defaultAccessibilityLabel}
|
|
86
|
+
{...rest}
|
|
87
|
+
>
|
|
88
|
+
<Svg
|
|
89
|
+
width={iconWidth}
|
|
90
|
+
height={iconHeight}
|
|
91
|
+
viewBox={`0 0 ${iconWidth} ${iconHeight}`}
|
|
92
|
+
style={direction === 'Back' ? { transform: [{ scaleX: -1 }] } : undefined}
|
|
93
|
+
>
|
|
94
|
+
<Path
|
|
95
|
+
d={chevronPath}
|
|
96
|
+
stroke={iconColor}
|
|
97
|
+
strokeWidth={strokeWeight}
|
|
98
|
+
strokeLinecap="round"
|
|
99
|
+
strokeLinejoin="round"
|
|
100
|
+
fill="none"
|
|
101
|
+
/>
|
|
102
|
+
</Svg>
|
|
103
|
+
</View>
|
|
104
|
+
)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export default NavArrow
|
|
108
|
+
|
|
@@ -13,6 +13,10 @@ Section component that mirrors the Figma "Section" component.
|
|
|
13
13
|
|
|
14
14
|
This component uses the following design token collections. Each collection supports multiple modes that can be configured via the `modes` prop.
|
|
15
15
|
|
|
16
|
+
### Color Mode
|
|
17
|
+
- **Modes:** Light | Dark
|
|
18
|
+
- **Default:** Light
|
|
19
|
+
|
|
16
20
|
### Padding
|
|
17
21
|
- **Modes:** Default | None
|
|
18
22
|
- **Default:** Default
|
|
@@ -20,10 +24,6 @@ This component uses the following design token collections. Each collection supp
|
|
|
20
24
|
### Appearance.Brand
|
|
21
25
|
- **Modes:** Primary | Secondary | Neutral
|
|
22
26
|
- **Default:** Primary
|
|
23
|
-
|
|
24
|
-
### Color Mode
|
|
25
|
-
- **Modes:** Light | Dark
|
|
26
|
-
- **Default:** Light
|
|
27
27
|
## Usage
|
|
28
28
|
|
|
29
29
|
<Canvas>
|
|
@@ -12,7 +12,7 @@ A component representing a single step within a Stepper process. It displays an
|
|
|
12
12
|
|
|
13
13
|
This component uses the following design token collections. Each collection supports multiple modes that can be configured via the `modes` prop.
|
|
14
14
|
|
|
15
|
-
### Status
|
|
15
|
+
### Step Status
|
|
16
16
|
- **Modes:** active | inactive | complete | error | warning
|
|
17
17
|
- **Default:** active
|
|
18
18
|
|
package/src/components/index.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { default as ActionFooter, type ActionFooterProps } from './ActionFooter/ActionFooter';
|
|
1
2
|
export { default as AppBar } from './AppBar/AppBar';
|
|
2
3
|
export { default as Avatar, type AvatarProps } from './Avatar/Avatar';
|
|
3
4
|
export { default as AvatarGroup } from './AvatarGroup/AvatarGroup';
|
|
@@ -8,6 +9,7 @@ export { default as Button, type ButtonProps } from './Button/Button';
|
|
|
8
9
|
export { default as Card } from './Card/Card';
|
|
9
10
|
export { default as CardFeedback } from './CardFeedback/CardFeedback';
|
|
10
11
|
export { default as Disclaimer } from './Disclaimer/Disclaimer';
|
|
12
|
+
export { default as Divider, type DividerProps, type DividerDirection } from './Divider/Divider';
|
|
11
13
|
export { default as Drawer } from './Drawer/Drawer';
|
|
12
14
|
export { default as FilterBar } from './FilterBar/FilterBar';
|
|
13
15
|
export { default as IconButton } from './IconButton/IconButton';
|
|
@@ -16,7 +18,9 @@ export { default as LazyList } from './LazyList/LazyList';
|
|
|
16
18
|
export { default as ListGroup } from './ListGroup/ListGroup';
|
|
17
19
|
export { default as ListItem } from './ListItem/ListItem';
|
|
18
20
|
export { default as MediaCard } from './MediaCard/MediaCard';
|
|
21
|
+
export { default as MerchantProfile, type MerchantProfileProps } from './MerchantProfile/MerchantProfile';
|
|
19
22
|
export { default as MoneyValue } from './MoneyValue/MoneyValue';
|
|
23
|
+
export { default as NavArrow } from './NavArrow/NavArrow';
|
|
20
24
|
export { default as PageTitle } from './PageTitle/PageTitle';
|
|
21
25
|
export { default as Section } from './Section/Section';
|
|
22
26
|
export { default as Stepper } from './Stepper/Stepper';
|