jfs-components 0.0.2 → 0.0.4

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 (105) hide show
  1. package/lib/commonjs/components/Accordion/Accordion.js +217 -0
  2. package/lib/commonjs/components/Accordion/Accordion.js.map +1 -0
  3. package/lib/commonjs/components/Accordion/Accordion.mdx +122 -0
  4. package/lib/commonjs/components/ActionTile/ActionTile.js +93 -0
  5. package/lib/commonjs/components/ActionTile/ActionTile.js.map +1 -0
  6. package/lib/commonjs/components/ActionTile/ActionTile.mdx +54 -0
  7. package/lib/commonjs/components/ActionTile/index.js +14 -0
  8. package/lib/commonjs/components/ActionTile/index.js.map +1 -0
  9. package/lib/commonjs/components/CtaCard/CtaCard.js +122 -0
  10. package/lib/commonjs/components/CtaCard/CtaCard.js.map +1 -0
  11. package/lib/commonjs/components/CtaCard/CtaCard.mdx +66 -0
  12. package/lib/commonjs/components/CtaCard/index.js +14 -0
  13. package/lib/commonjs/components/CtaCard/index.js.map +1 -0
  14. package/lib/commonjs/components/MoneyValue/MoneyValue.js +36 -4
  15. package/lib/commonjs/components/MoneyValue/MoneyValue.js.map +1 -1
  16. package/lib/commonjs/components/ThreadHero/ThreadHero.js +114 -0
  17. package/lib/commonjs/components/ThreadHero/ThreadHero.js.map +1 -0
  18. package/lib/commonjs/components/ThreadHero/ThreadHero.mdx +69 -0
  19. package/lib/commonjs/components/TransactionBubble/TransactionBubble.js +101 -0
  20. package/lib/commonjs/components/TransactionBubble/TransactionBubble.js.map +1 -0
  21. package/lib/commonjs/components/TransactionBubble/TransactionBubble.mdx +40 -0
  22. package/lib/commonjs/components/TransactionDetails/TransactionDetails.js +177 -0
  23. package/lib/commonjs/components/TransactionDetails/TransactionDetails.js.map +1 -0
  24. package/lib/commonjs/components/TransactionDetails/TransactionDetails.mdx +98 -0
  25. package/lib/commonjs/components/TransactionStatus/TransactionStatus.js +82 -0
  26. package/lib/commonjs/components/TransactionStatus/TransactionStatus.js.map +1 -0
  27. package/lib/commonjs/components/TransactionStatus/TransactionStatus.mdx +41 -0
  28. package/lib/commonjs/components/index.js +35 -0
  29. package/lib/commonjs/components/index.js.map +1 -1
  30. package/lib/commonjs/design-tokens/figma-variables-resolver.js +3 -9
  31. package/lib/commonjs/icons/registry.js +1 -1
  32. package/lib/module/components/Accordion/Accordion.js +212 -0
  33. package/lib/module/components/Accordion/Accordion.js.map +1 -0
  34. package/lib/module/components/Accordion/Accordion.mdx +122 -0
  35. package/lib/module/components/ActionTile/ActionTile.js +88 -0
  36. package/lib/module/components/ActionTile/ActionTile.js.map +1 -0
  37. package/lib/module/components/ActionTile/ActionTile.mdx +54 -0
  38. package/lib/module/components/ActionTile/index.js +4 -0
  39. package/lib/module/components/ActionTile/index.js.map +1 -0
  40. package/lib/module/components/CtaCard/CtaCard.js +117 -0
  41. package/lib/module/components/CtaCard/CtaCard.js.map +1 -0
  42. package/lib/module/components/CtaCard/CtaCard.mdx +66 -0
  43. package/lib/module/components/CtaCard/index.js +4 -0
  44. package/lib/module/components/CtaCard/index.js.map +1 -0
  45. package/lib/module/components/MoneyValue/MoneyValue.js +36 -4
  46. package/lib/module/components/MoneyValue/MoneyValue.js.map +1 -1
  47. package/lib/module/components/ThreadHero/ThreadHero.js +109 -0
  48. package/lib/module/components/ThreadHero/ThreadHero.js.map +1 -0
  49. package/lib/module/components/ThreadHero/ThreadHero.mdx +69 -0
  50. package/lib/module/components/TransactionBubble/TransactionBubble.js +96 -0
  51. package/lib/module/components/TransactionBubble/TransactionBubble.js.map +1 -0
  52. package/lib/module/components/TransactionBubble/TransactionBubble.mdx +40 -0
  53. package/lib/module/components/TransactionDetails/TransactionDetails.js +174 -0
  54. package/lib/module/components/TransactionDetails/TransactionDetails.js.map +1 -0
  55. package/lib/module/components/TransactionDetails/TransactionDetails.mdx +98 -0
  56. package/lib/module/components/TransactionStatus/TransactionStatus.js +77 -0
  57. package/lib/module/components/TransactionStatus/TransactionStatus.js.map +1 -0
  58. package/lib/module/components/TransactionStatus/TransactionStatus.mdx +41 -0
  59. package/lib/module/components/index.js +5 -0
  60. package/lib/module/components/index.js.map +1 -1
  61. package/lib/module/icons/registry.js +1 -1
  62. package/lib/typescript/components/Accordion/Accordion.d.ts +58 -0
  63. package/lib/typescript/components/Accordion/Accordion.d.ts.map +1 -0
  64. package/lib/typescript/components/ActionTile/ActionTile.d.ts +26 -0
  65. package/lib/typescript/components/ActionTile/ActionTile.d.ts.map +1 -0
  66. package/lib/typescript/components/ActionTile/index.d.ts +2 -0
  67. package/lib/typescript/components/ActionTile/index.d.ts.map +1 -0
  68. package/lib/typescript/components/CtaCard/CtaCard.d.ts +61 -0
  69. package/lib/typescript/components/CtaCard/CtaCard.d.ts.map +1 -0
  70. package/lib/typescript/components/CtaCard/index.d.ts +2 -0
  71. package/lib/typescript/components/CtaCard/index.d.ts.map +1 -0
  72. package/lib/typescript/components/MoneyValue/MoneyValue.d.ts +9 -2
  73. package/lib/typescript/components/MoneyValue/MoneyValue.d.ts.map +1 -1
  74. package/lib/typescript/components/ThreadHero/ThreadHero.d.ts +21 -0
  75. package/lib/typescript/components/ThreadHero/ThreadHero.d.ts.map +1 -0
  76. package/lib/typescript/components/TransactionBubble/TransactionBubble.d.ts +24 -0
  77. package/lib/typescript/components/TransactionBubble/TransactionBubble.d.ts.map +1 -0
  78. package/lib/typescript/components/TransactionDetails/TransactionDetails.d.ts +57 -0
  79. package/lib/typescript/components/TransactionDetails/TransactionDetails.d.ts.map +1 -0
  80. package/lib/typescript/components/TransactionStatus/TransactionStatus.d.ts +16 -0
  81. package/lib/typescript/components/TransactionStatus/TransactionStatus.d.ts.map +1 -0
  82. package/lib/typescript/components/index.d.ts +5 -0
  83. package/lib/typescript/components/index.d.ts.map +1 -1
  84. package/lib/typescript/icons/registry.d.ts +1 -1
  85. package/package.json +5 -2
  86. package/src/components/.token-metadata.json +161 -0
  87. package/src/components/Accordion/Accordion.mdx +122 -0
  88. package/src/components/Accordion/Accordion.tsx +279 -0
  89. package/src/components/ActionTile/ActionTile.mdx +54 -0
  90. package/src/components/ActionTile/ActionTile.tsx +100 -0
  91. package/src/components/ActionTile/index.ts +1 -0
  92. package/src/components/CtaCard/CtaCard.mdx +66 -0
  93. package/src/components/CtaCard/CtaCard.tsx +185 -0
  94. package/src/components/CtaCard/index.ts +1 -0
  95. package/src/components/MoneyValue/MoneyValue.tsx +39 -3
  96. package/src/components/ThreadHero/ThreadHero.mdx +69 -0
  97. package/src/components/ThreadHero/ThreadHero.tsx +124 -0
  98. package/src/components/TransactionBubble/TransactionBubble.mdx +40 -0
  99. package/src/components/TransactionBubble/TransactionBubble.tsx +113 -0
  100. package/src/components/TransactionDetails/TransactionDetails.mdx +98 -0
  101. package/src/components/TransactionDetails/TransactionDetails.tsx +236 -0
  102. package/src/components/TransactionStatus/TransactionStatus.mdx +41 -0
  103. package/src/components/TransactionStatus/TransactionStatus.tsx +94 -0
  104. package/src/components/index.ts +5 -0
  105. package/src/icons/registry.ts +1 -1
@@ -0,0 +1,212 @@
1
+ "use strict";
2
+
3
+ import React, { useState } from 'react';
4
+ import { View, Text, Pressable, LayoutAnimation, Platform, UIManager } from 'react-native';
5
+ import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
6
+ import Icon from '../../icons/Icon';
7
+ import { usePressableWebSupport } from '../../utils/web-platform-utils';
8
+
9
+ // Enable LayoutAnimation on Android
10
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
+ if (Platform.OS === 'android' && UIManager.setLayoutAnimationEnabledExperimental) {
12
+ UIManager.setLayoutAnimationEnabledExperimental(true);
13
+ }
14
+
15
+ /**
16
+ * Helper function to recursively clone children and pass modes prop to components that accept it.
17
+ * This ensures that all child components in slots receive the modes prop from the parent.
18
+ */
19
+ function cloneChildrenWithModes(children, modes) {
20
+ const result = React.Children.map(children, child => {
21
+ if (! /*#__PURE__*/React.isValidElement(child)) {
22
+ return child;
23
+ }
24
+
25
+ // Get existing children
26
+ const childChildren = child.props?.children;
27
+ const hasChildren = childChildren !== undefined && childChildren !== null;
28
+
29
+ // Merge modes: parent modes first, then child's explicit modes override them
30
+ const existingModes = child.props?.modes;
31
+ const mergedModes = existingModes ? {
32
+ ...modes,
33
+ ...existingModes
34
+ } : modes;
35
+
36
+ // Recursively process children if they exist
37
+ const processedChildren = hasChildren ? cloneChildrenWithModes(React.Children.toArray(childChildren), modes) : undefined;
38
+
39
+ // Clone element with modes and processed children
40
+ return /*#__PURE__*/React.cloneElement(child, {
41
+ ...child.props,
42
+ modes: mergedModes
43
+ }, processedChildren);
44
+ });
45
+ return result || [];
46
+ }
47
+ /**
48
+ * Accordion component that mirrors the Figma "Accordion" component.
49
+ *
50
+ * This component supports:
51
+ * - **Expandable/collapsible content** with smooth animation
52
+ * - **States**: Idle, Hover, Open, Disabled
53
+ * - **Slot** for custom content
54
+ * - **Design-token driven styling** via `getVariableByName` and `modes`
55
+ *
56
+ * Wherever the Figma layer name contains "Slot", this component exposes a
57
+ * dedicated React "slot" prop:
58
+ * - Slot "content" → `children`
59
+ *
60
+ * @component
61
+ * @param {Object} props
62
+ * @param {string} [props.title='Accordion title'] - The accordion header title
63
+ * @param {boolean} [props.defaultExpanded=false] - Initial expanded state
64
+ * @param {boolean} [props.expanded] - Controlled expanded state
65
+ * @param {Function} [props.onExpandedChange] - Callback fired when expanded state changes
66
+ * @param {boolean} [props.disabled=false] - Whether the accordion is disabled
67
+ * @param {React.ReactNode} [props.children] - Content to display when expanded
68
+ * @param {Object} [props.modes={}] - Modes object passed to `getVariableByName` for all design tokens
69
+ * @param {Object} [props.style] - Optional container style overrides
70
+ * @param {string} [props.accessibilityLabel] - Accessibility label for the accordion. If not provided, uses title
71
+ * @param {string} [props.accessibilityHint] - Additional accessibility hint for screen readers
72
+ */
73
+ function Accordion({
74
+ title = 'Accordion title',
75
+ defaultExpanded = false,
76
+ expanded: controlledExpanded,
77
+ onExpandedChange,
78
+ disabled = false,
79
+ children,
80
+ modes = {},
81
+ style,
82
+ accessibilityLabel,
83
+ accessibilityHint,
84
+ accessibilityState,
85
+ webAccessibilityProps,
86
+ ...rest
87
+ }) {
88
+ // Internal state for uncontrolled mode
89
+ const [internalExpanded, setInternalExpanded] = useState(defaultExpanded);
90
+
91
+ // Determine if controlled or uncontrolled
92
+ const isControlled = controlledExpanded !== undefined;
93
+ const isExpanded = isControlled ? controlledExpanded : internalExpanded;
94
+
95
+ // Hover state for web
96
+ const [isHovered, setIsHovered] = useState(false);
97
+
98
+ // Handle toggle
99
+ const handleToggle = () => {
100
+ if (disabled) return;
101
+
102
+ // Animate the layout change
103
+ LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
104
+ if (isControlled) {
105
+ onExpandedChange?.(!isExpanded);
106
+ } else {
107
+ setInternalExpanded(!isExpanded);
108
+ onExpandedChange?.(!isExpanded);
109
+ }
110
+ };
111
+
112
+ // Resolve design tokens
113
+ const titleColor = disabled ? '#999999' : getVariableByName('accordion/title/color', modes) || '#0d0d0d';
114
+ const titleFontSize = getVariableByName('accordion/title/fontSize', modes) || 18;
115
+ const titleLineHeight = getVariableByName('accordion/title/lineHeight', modes) || 20;
116
+ const titleFontFamily = getVariableByName('accordion/title/fontFamily', modes) || 'System';
117
+ const iconColor = getVariableByName('accordion/icon/color', modes) || '#141414';
118
+ const iconSize = getVariableByName('accordion/icon/size', modes) || 24;
119
+ const headerGap = getVariableByName('accordion/header/gap', modes) || 12;
120
+ const headerPaddingVertical = getVariableByName('accordion/header/padding/vertical', modes) || 24;
121
+ const headerBackground = isHovered && !disabled ? '#f2f2f2' : getVariableByName('accordion/header/background', modes) || 'transparent';
122
+ const contentGap = getVariableByName('accordion/content/gap', modes) || 12;
123
+ const contentPaddingTop = getVariableByName('accordion/content/padding/top', modes) || 8;
124
+ const contentPaddingBottom = isExpanded ? getVariableByName('accordion/content/padding/bottom', modes) ?? 24 : 8;
125
+ const borderColor = getVariableByName('accordion/border/color', modes) || '#e6e6e6';
126
+
127
+ // Styles
128
+ const containerStyle = {
129
+ borderBottomWidth: 1,
130
+ borderBottomColor: borderColor
131
+ };
132
+ const headerStyle = {
133
+ flexDirection: 'row',
134
+ alignItems: 'center',
135
+ gap: headerGap,
136
+ paddingVertical: headerPaddingVertical,
137
+ paddingHorizontal: 0,
138
+ backgroundColor: headerBackground,
139
+ overflow: 'hidden'
140
+ };
141
+ const titleStyle = {
142
+ flex: 1,
143
+ color: titleColor,
144
+ fontSize: titleFontSize,
145
+ lineHeight: titleLineHeight,
146
+ fontFamily: titleFontFamily,
147
+ fontWeight: '700'
148
+ };
149
+ const contentStyle = {
150
+ backgroundColor: 'transparent',
151
+ gap: contentGap,
152
+ paddingTop: contentPaddingTop,
153
+ paddingBottom: contentPaddingBottom,
154
+ paddingHorizontal: 0,
155
+ overflow: 'hidden'
156
+ };
157
+
158
+ // Generate default accessibility label
159
+ const defaultAccessibilityLabel = accessibilityLabel || title;
160
+
161
+ // Web platform support
162
+ const webProps = usePressableWebSupport({
163
+ restProps: {},
164
+ onPress: handleToggle,
165
+ disabled,
166
+ accessibilityLabel: defaultAccessibilityLabel,
167
+ webAccessibilityProps
168
+ });
169
+
170
+ // Process children to pass modes
171
+ const processedChildren = children ? cloneChildrenWithModes(React.Children.toArray(children), modes) : null;
172
+ return /*#__PURE__*/_jsxs(View, {
173
+ style: [containerStyle, style],
174
+ ...rest,
175
+ children: [/*#__PURE__*/_jsxs(Pressable, {
176
+ accessibilityRole: "button",
177
+ accessibilityLabel: defaultAccessibilityLabel,
178
+ accessibilityHint: accessibilityHint || (isExpanded ? 'Collapse accordion' : 'Expand accordion'),
179
+ accessibilityState: {
180
+ expanded: isExpanded,
181
+ disabled,
182
+ ...accessibilityState
183
+ },
184
+ onPress: handleToggle,
185
+ disabled: disabled,
186
+ onHoverIn: () => setIsHovered(true),
187
+ onHoverOut: () => setIsHovered(false),
188
+ style: ({
189
+ pressed
190
+ }) => [headerStyle, pressed && !disabled ? {
191
+ opacity: 0.9
192
+ } : null],
193
+ ...webProps,
194
+ children: [/*#__PURE__*/_jsx(Text, {
195
+ style: titleStyle,
196
+ numberOfLines: 1,
197
+ children: title
198
+ }), /*#__PURE__*/_jsx(Icon, {
199
+ name: isExpanded ? 'ic_minus' : 'ic_add',
200
+ size: iconSize,
201
+ color: disabled ? '#999999' : iconColor,
202
+ accessibilityElementsHidden: true,
203
+ importantForAccessibility: "no"
204
+ })]
205
+ }), isExpanded && processedChildren && /*#__PURE__*/_jsx(View, {
206
+ style: contentStyle,
207
+ children: processedChildren
208
+ })]
209
+ });
210
+ }
211
+ export default Accordion;
212
+ //# sourceMappingURL=Accordion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useState","View","Text","Pressable","LayoutAnimation","Platform","UIManager","getVariableByName","Icon","usePressableWebSupport","jsx","_jsx","jsxs","_jsxs","OS","setLayoutAnimationEnabledExperimental","cloneChildrenWithModes","children","modes","result","Children","map","child","isValidElement","childChildren","props","hasChildren","undefined","existingModes","mergedModes","processedChildren","toArray","cloneElement","Accordion","title","defaultExpanded","expanded","controlledExpanded","onExpandedChange","disabled","style","accessibilityLabel","accessibilityHint","accessibilityState","webAccessibilityProps","rest","internalExpanded","setInternalExpanded","isControlled","isExpanded","isHovered","setIsHovered","handleToggle","configureNext","Presets","easeInEaseOut","titleColor","titleFontSize","titleLineHeight","titleFontFamily","iconColor","iconSize","headerGap","headerPaddingVertical","headerBackground","contentGap","contentPaddingTop","contentPaddingBottom","borderColor","containerStyle","borderBottomWidth","borderBottomColor","headerStyle","flexDirection","alignItems","gap","paddingVertical","paddingHorizontal","backgroundColor","overflow","titleStyle","flex","color","fontSize","lineHeight","fontFamily","fontWeight","contentStyle","paddingTop","paddingBottom","defaultAccessibilityLabel","webProps","restProps","onPress","accessibilityRole","onHoverIn","onHoverOut","pressed","opacity","numberOfLines","name","size","accessibilityElementsHidden","importantForAccessibility"],"sourceRoot":"../../../../src","sources":["components/Accordion/Accordion.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,QAAQ,Q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B,GAAG,kBAAkB,CAAE;MACjGN,kBAAkB,EAAE;QAClBP,QAAQ,EAAEa,UAAU;QACpBV,QAAQ;QACR,GAAGI;MACL,CAAE;MACFkD,OAAO,EAAEzC,YAAa;MACtBb,QAAQ,EAAEA,QAAS;MACnBwD,SAAS,EAAEA,CAAA,KAAM5C,YAAY,CAAC,IAAI,CAAE;MACpC6C,UAAU,EAAEA,CAAA,KAAM7C,YAAY,CAAC,KAAK,CAAE;MACtCX,KAAK,EAAEA,CAAC;QAAEyD;MAAQ,CAAC,KAAK,CACtBzB,WAAW,EACXyB,OAAO,IAAI,CAAC1D,QAAQ,GAAG;QAAE2D,OAAO,EAAE;MAAI,CAAC,GAAG,IAAI,CAC9C;MAAA,GACEP,QAAQ;MAAA1E,QAAA,gBAEZN,IAAA,CAACT,IAAI;QAACsC,KAAK,EAAEwC,UAAW;QAACmB,aAAa,EAAE,CAAE;QAAAlF,QAAA,EACvCiB;MAAK,CACF,CAAC,eACPvB,IAAA,CAACH,IAAI;QACH4F,IAAI,EAAEnD,UAAU,GAAG,UAAU,GAAG,QAAS;QACzCoD,IAAI,EAAExC,QAAS;QACfqB,KAAK,EAAE3C,QAAQ,GAAG,SAAS,GAAGqB,SAAU;QACxC0C,2BAA2B,EAAE,IAAK;QAClCC,yBAAyB,EAAC;MAAI,CAC/B,CAAC;IAAA,CACO,CAAC,EAEXtD,UAAU,IAAInB,iBAAiB,iBAC9BnB,IAAA,CAACV,IAAI;MAACuC,KAAK,EAAE+C,YAAa;MAAAtE,QAAA,EACvBa;IAAiB,CACd,CACP;EAAA,CACG,CAAC;AAEX;AAEA,eAAeG,SAAS","ignoreList":[]}
@@ -0,0 +1,122 @@
1
+ import { Meta, Story, Canvas, PureArgsTable as ArgsTable } from '@storybook/addon-docs/blocks';
2
+ import * as AccordionStories from './Accordion.stories';
3
+ import Accordion from './Accordion';
4
+ import { AccessibilitySection, AnatomySection, UsageConstraintsSection } from '../docs/DocSections';
5
+
6
+ <Meta of={AccordionStories} />
7
+
8
+ # Accordion
9
+
10
+ Accordion component that mirrors the Figma "Accordion" component. It provides an expandable/collapsible container for content with smooth animation.
11
+
12
+ ## Available Collections and Modes
13
+
14
+ This component uses the following design token collections. Each collection supports multiple modes that can be configured via the `modes` prop.
15
+
16
+ ### Accordion States
17
+ - **Modes:** Idle | Hover | Open | Open Hover | Disabled
18
+ - **Default:** Idle
19
+ ## Usage
20
+
21
+ <Canvas>
22
+ <Story of={AccordionStories.Default} />
23
+ </Canvas>
24
+
25
+ ## With ListItem Content
26
+
27
+ <Canvas>
28
+ <Story of={AccordionStories.WithListItems} />
29
+ </Canvas>
30
+
31
+ ## Accordion Group
32
+
33
+ <Canvas>
34
+ <Story of={AccordionStories.AccordionGroup} />
35
+ </Canvas>
36
+
37
+ <AccessibilitySection
38
+ items={[
39
+ 'The accordion header has `accessibilityRole="button"` for proper screen reader announcement.',
40
+ 'The `accessibilityState.expanded` property indicates the current state to assistive technology.',
41
+ 'When disabled, `accessibilityState.disabled` is set to true.',
42
+ 'Custom `accessibilityLabel` and `accessibilityHint` can be provided for better context.',
43
+ 'Content within the accordion should maintain its own accessibility attributes.',
44
+ ]}
45
+ />
46
+
47
+ <AnatomySection>
48
+ <ul>
49
+ <li><strong>Header</strong> — Pressable area containing the title and expand/collapse icon (plus/minus).</li>
50
+ <li><strong>Content Slot</strong> — Expandable area that shows/hides with animation. Pass any React children.</li>
51
+ <li><strong>Border</strong> — Bottom border separating accordions when stacked.</li>
52
+ </ul>
53
+ </AnatomySection>
54
+
55
+ <UsageConstraintsSection
56
+ items={[
57
+ 'Use the `modes` prop to ensure consistent theming with surrounding components.',
58
+ 'When nesting components in the content slot, they automatically receive the parent modes via cloning.',
59
+ 'Avoid deeply nested interactive elements that may confuse keyboard navigation.',
60
+ 'For controlled behavior, provide both `expanded` and `onExpandedChange` props.',
61
+ 'Keep accordion titles concise; they are truncated to a single line.',
62
+ ]}
63
+ />
64
+
65
+ ## Props
66
+
67
+ <ArgsTable of={Accordion} />
68
+
69
+ ## Design Tokens
70
+
71
+ This component uses the following design tokens, resolved through `getVariableByName`:
72
+
73
+ - **`accordion/border/color`**
74
+ - **`accordion/content/gap`**
75
+ - **`accordion/content/padding/bottom`**
76
+ - **`accordion/content/padding/top`**
77
+ - **`accordion/header/background`**
78
+ - **`accordion/header/gap`**
79
+ - **`accordion/header/padding/vertical`**
80
+ - **`accordion/icon/color`**
81
+ - **`accordion/icon/size`**
82
+ - **`accordion/title/color`**
83
+ - **`accordion/title/fontFamily`**
84
+ - **`accordion/title/fontSize`**
85
+ - **`accordion/title/lineHeight`**
86
+
87
+ All tokens support mode-based theming through the `modes` prop.
88
+ ## Example Usage
89
+
90
+ ```tsx
91
+ import { Accordion, ListItem, IconCapsule, MoneyValue } from '@jsf/components';
92
+
93
+ function PaymentSection() {
94
+ return (
95
+ <Accordion
96
+ title="Payment Methods"
97
+ defaultExpanded={true}
98
+ modes={{ 'Color Mode': 'Light' }}
99
+ >
100
+ <ListItem
101
+ layout="Horizontal"
102
+ title="Credit Card"
103
+ supportText="Ending in 4242"
104
+ leading={<IconCapsule iconName="ic_card" />}
105
+ endSlot={<MoneyValue value="500" currency="₹" />}
106
+ navArrow={true}
107
+ />
108
+ <ListItem
109
+ layout="Horizontal"
110
+ title="Savings Account"
111
+ supportText="HDFC Bank"
112
+ leading={<IconCapsule iconName="ic_bank_account" />}
113
+ endSlot={<MoneyValue value="25,000" currency="₹" />}
114
+ navArrow={true}
115
+ />
116
+ </Accordion>
117
+ );
118
+ }
119
+ ```
120
+
121
+
122
+
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+
3
+ import React from 'react';
4
+ import { View, Text, TouchableOpacity } from 'react-native';
5
+ import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
6
+ import IconCapsule from '../IconCapsule/IconCapsule';
7
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
+ /**
9
+ * ActionTile component from Figma design.
10
+ * Displays an icon (defaulting to IconCapsule) and a label.
11
+ *
12
+ * @component
13
+ */
14
+ export default function ActionTile({
15
+ label = 'Cards',
16
+ icon,
17
+ modes = {},
18
+ style,
19
+ onPress
20
+ }) {
21
+ // Resolve tokens
22
+ const backgroundColor = getVariableByName('actionTile/background', modes) || '#ffffff';
23
+ const gap = Number(getVariableByName('actionTile/gap', modes)) || 8;
24
+ const paddingHorizontal = Number(getVariableByName('actionTile/padding/horizontal', modes)) || 12;
25
+ const paddingVertical = Number(getVariableByName('actionTile/padding/vertical', modes)) || 16;
26
+ const radius = Number(getVariableByName('actionTile/radius', modes)) || 16;
27
+
28
+ // Text tokens
29
+ const textColor = getVariableByName('actionTile/foreground', modes) || '#0d0d0f';
30
+ const fontSize = Number(getVariableByName('actionTile/fontSize', modes)) || 14;
31
+ const fontFamily = getVariableByName('actionTile/fontFamily', modes) || 'JioType Var';
32
+ const fontWeightStr = getVariableByName('actionTile/fontWeight', modes) || '500';
33
+ const lineHeight = Number(getVariableByName('actionTile/lineHeight', modes)) || 17;
34
+ const containerStyle = {
35
+ backgroundColor,
36
+ borderRadius: radius,
37
+ paddingHorizontal,
38
+ paddingVertical,
39
+ gap,
40
+ width: 168,
41
+ // Fixed width from design
42
+ height: 90,
43
+ // Fixed height from design
44
+ alignItems: 'flex-start',
45
+ // ensure content stretches if needed, though design implies fixed size block
46
+ ...style
47
+ };
48
+ const textStyle = {
49
+ color: textColor,
50
+ fontSize,
51
+ fontFamily,
52
+ fontWeight: fontWeightStr,
53
+ // Cast to any or TextStyle fontWeight enum if needed
54
+ lineHeight
55
+ };
56
+
57
+ // Handle Icon Slot: Pass modes safely
58
+ const renderIcon = () => {
59
+ if (/*#__PURE__*/React.isValidElement(icon)) {
60
+ // Pass modes down to the slot child
61
+ return /*#__PURE__*/React.cloneElement(icon, {
62
+ modes
63
+ });
64
+ }
65
+ // Default fallback if no icon prop is provided, matching design default
66
+ if (!icon) {
67
+ return /*#__PURE__*/_jsx(IconCapsule, {
68
+ modes: modes
69
+ });
70
+ }
71
+ return icon;
72
+ };
73
+ const Content = /*#__PURE__*/_jsxs(View, {
74
+ style: containerStyle,
75
+ children: [renderIcon(), /*#__PURE__*/_jsx(Text, {
76
+ style: textStyle,
77
+ children: label
78
+ })]
79
+ });
80
+ if (onPress) {
81
+ return /*#__PURE__*/_jsx(TouchableOpacity, {
82
+ onPress: onPress,
83
+ children: Content
84
+ });
85
+ }
86
+ return Content;
87
+ }
88
+ //# sourceMappingURL=ActionTile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","View","Text","TouchableOpacity","getVariableByName","IconCapsule","jsx","_jsx","jsxs","_jsxs","ActionTile","label","icon","modes","style","onPress","backgroundColor","gap","Number","paddingHorizontal","paddingVertical","radius","textColor","fontSize","fontFamily","fontWeightStr","lineHeight","containerStyle","borderRadius","width","height","alignItems","textStyle","color","fontWeight","renderIcon","isValidElement","cloneElement","Content","children"],"sourceRoot":"../../../../src","sources":["components/ActionTile/ActionTile.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAkCC,gBAAgB,QAAQ,cAAc;AAC3F,SAASC,iBAAiB,QAAQ,8CAA8C;AAChF,OAAOC,WAAW,MAAM,4BAA4B;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAmBpD;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,UAAUA,CAAC;EAC/BC,KAAK,GAAG,OAAO;EACfC,IAAI;EACJC,KAAK,GAAG,CAAC,CAAC;EACVC,KAAK;EACLC;AACa,CAAC,EAAE;EAChB;EACA,MAAMC,eAAe,GAAGZ,iBAAiB,CAAC,uBAAuB,EAAES,KAAK,CAAC,IAAI,SAAS;EACtF,MAAMI,GAAG,GAAGC,MAAM,CAACd,iBAAiB,CAAC,gBAAgB,EAAES,KAAK,CAAC,CAAC,IAAI,CAAC;EACnE,MAAMM,iBAAiB,GAAGD,MAAM,CAACd,iBAAiB,CAAC,+BAA+B,E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A,IAAI,CAACD,IAAI,EAAE;MACP,oBAAOL,IAAA,CAACF,WAAW;QAACQ,KAAK,EAAEA;MAAM,CAAE,CAAC;IACxC;IACA,OAAOD,IAAI;EACf,CAAC;EAED,MAAM0B,OAAO,gBACT7B,KAAA,CAACR,IAAI;IAACa,KAAK,EAAEa,cAAe;IAAAY,QAAA,GACvBJ,UAAU,CAAC,CAAC,eACb5B,IAAA,CAACL,IAAI;MAACY,KAAK,EAAEkB,SAAU;MAAAO,QAAA,EAAE5B;IAAK,CAAO,CAAC;EAAA,CACpC,CACT;EAED,IAAII,OAAO,EAAE;IACT,oBACIR,IAAA,CAACJ,gBAAgB;MAACY,OAAO,EAAEA,OAAQ;MAAAwB,QAAA,EAC9BD;IAAO,CACM,CAAC;EAE3B;EAEA,OAAOA,OAAO;AAClB","ignoreList":[]}
@@ -0,0 +1,54 @@
1
+ import { Meta, Story, Canvas, PureArgsTable as Controls } from '@storybook/addon-docs/blocks';
2
+ import * as ActionTileStories from './ActionTile.stories';
3
+
4
+ <Meta of={ActionTileStories} />
5
+
6
+ # ActionTile
7
+
8
+ A tile component used for dashboard actions, displaying an icon and a label.
9
+
10
+
11
+ ## Available Collections and Modes
12
+
13
+ This component uses the following design token collections. Each collection supports multiple modes that can be configured via the `modes` prop.
14
+
15
+ ### Color Mode
16
+ - **Modes:** Light | Dark
17
+ - **Default:** Light
18
+ ## Usage
19
+
20
+ ```tsx
21
+ import ActionTile from './ActionTile';
22
+ import IconCapsule from '../IconCapsule/IconCapsule';
23
+
24
+ // Default usage
25
+ <ActionTile label="Cards" />
26
+
27
+ // With custom icon
28
+ <ActionTile
29
+ label="Offers"
30
+ icon={<IconCapsule iconName="ic_offers" />}
31
+ />
32
+ ```
33
+
34
+ <Canvas of={ActionTileStories.Default} />
35
+
36
+ <Controls />
37
+
38
+
39
+ ## Design Tokens
40
+
41
+ This component uses the following design tokens, resolved through `getVariableByName`:
42
+
43
+ - **`actionTile/background`**
44
+ - **`actionTile/fontFamily`**
45
+ - **`actionTile/fontSize`**
46
+ - **`actionTile/fontWeight`**
47
+ - **`actionTile/foreground`**
48
+ - **`actionTile/gap`**
49
+ - **`actionTile/lineHeight`**
50
+ - **`actionTile/padding/horizontal`**
51
+ - **`actionTile/padding/vertical`**
52
+ - **`actionTile/radius`**
53
+
54
+ All tokens support mode-based theming through the `modes` prop.
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export { default } from './ActionTile';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["default"],"sourceRoot":"../../../../src","sources":["components/ActionTile/index.ts"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,cAAc","ignoreList":[]}
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+
3
+ import React from 'react';
4
+ import { View, Text } from 'react-native';
5
+ import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
6
+ import IconCapsule from '../IconCapsule/IconCapsule';
7
+ import Button from '../Button/Button';
8
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
+ /**
10
+ * CtaCard component that maps directly to the Figma design using design tokens.
11
+ *
12
+ * @component
13
+ */
14
+ function CtaCard({
15
+ title = "Lets create your UPI ID",
16
+ body = "Send and receive money securely.",
17
+ iconName = "ic_upi_number",
18
+ buttonLabel = "Get started",
19
+ onPressButton,
20
+ modes = {},
21
+ iconSlot,
22
+ titleSlot,
23
+ bodySlot,
24
+ buttonSlot,
25
+ style
26
+ }) {
27
+ // --- Token Resolution ---
28
+ // Container
29
+ const backgroundColor = getVariableByName('ctaCard/background', modes) || '#0078ad';
30
+ const radius = getVariableByName('ctaCard/radius', modes) || 16;
31
+ const paddingHorizontal = getVariableByName('ctaCard/padding/horizontal', modes) || 20;
32
+ const paddingVertical = getVariableByName('ctaCard/padding/vertical', modes) || 23;
33
+ const gap = getVariableByName('ctaCard/gap', modes) || 16;
34
+
35
+ // Content Wrap
36
+ const contentGap = getVariableByName('ctaCard/content/gap', modes) || 8;
37
+
38
+ // Title Text
39
+ const titleColor = getVariableByName('ctaCard/title/color', modes) || '#ffffff';
40
+ const titleFontFamily = getVariableByName('ctaCard/title/fontFamily', modes) || 'JioType Var';
41
+ const titleFontSize = getVariableByName('ctaCard/title/fontSize', modes) || 23;
42
+ const titleLineHeight = getVariableByName('ctaCard/title/lineHeight', modes) || 23;
43
+
44
+ // Body Text
45
+ const bodyColor = getVariableByName('ctaCard/body/color', modes) || '#ffffff';
46
+ const bodyFontFamily = getVariableByName('ctaCard/body/fontFamily', modes) || 'JioType Var';
47
+ const bodyFontSize = getVariableByName('ctaCard/body/fontSize', modes) || 14;
48
+ const bodyLineHeight = getVariableByName('ctaCard/body/lineHeight', modes) || 17;
49
+
50
+ // --- Styles ---
51
+ const containerStyle = {
52
+ backgroundColor,
53
+ borderRadius: radius,
54
+ paddingHorizontal,
55
+ paddingVertical,
56
+ gap,
57
+ alignItems: 'flex-start',
58
+ width: '100%',
59
+ // Adjust based on layout needs, usually cards take full width available
60
+ overflow: 'hidden'
61
+ };
62
+ const contentWrapStyle = {
63
+ gap: contentGap,
64
+ alignItems: 'flex-start',
65
+ width: '100%'
66
+ };
67
+ const titleStyle = {
68
+ color: titleColor,
69
+ fontFamily: titleFontFamily,
70
+ fontSize: titleFontSize,
71
+ lineHeight: titleLineHeight,
72
+ fontWeight: '900' // "Black" in Figma often maps to 900
73
+ };
74
+ const bodyStyle = {
75
+ color: bodyColor,
76
+ fontFamily: bodyFontFamily,
77
+ fontSize: bodyFontSize,
78
+ lineHeight: bodyLineHeight,
79
+ fontWeight: '400' // Regular
80
+ };
81
+
82
+ // --- Slot Helper ---
83
+ // Helper to clone element with modes if no modes are already present on it (standard in this library)
84
+ const renderSlot = slot => {
85
+ if (/*#__PURE__*/React.isValidElement(slot)) {
86
+ return /*#__PURE__*/React.cloneElement(slot, {
87
+ modes: {
88
+ ...modes,
89
+ ...slot.props.modes
90
+ }
91
+ });
92
+ }
93
+ return slot;
94
+ };
95
+ return /*#__PURE__*/_jsxs(View, {
96
+ style: [containerStyle, style],
97
+ children: [/*#__PURE__*/_jsxs(View, {
98
+ style: contentWrapStyle,
99
+ children: [iconSlot ? renderSlot(iconSlot) : /*#__PURE__*/_jsx(IconCapsule, {
100
+ iconName: iconName,
101
+ modes: modes
102
+ }), titleSlot ? renderSlot(titleSlot) : /*#__PURE__*/_jsx(Text, {
103
+ style: titleStyle,
104
+ children: title
105
+ }), bodySlot ? renderSlot(bodySlot) : /*#__PURE__*/_jsx(Text, {
106
+ style: bodyStyle,
107
+ children: body
108
+ })]
109
+ }), buttonSlot ? renderSlot(buttonSlot) : /*#__PURE__*/_jsx(Button, {
110
+ label: buttonLabel,
111
+ onPress: onPressButton,
112
+ modes: modes
113
+ })]
114
+ });
115
+ }
116
+ export default CtaCard;
117
+ //# sourceMappingURL=CtaCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","View","Text","getVariableByName","IconCapsule","Button","jsx","_jsx","jsxs","_jsxs","CtaCard","title","body","iconName","buttonLabel","onPressButton","modes","iconSlot","titleSlot","bodySlot","buttonSlot","style","backgroundColor","radius","paddingHorizontal","paddingVertical","gap","contentGap","titleColor","titleFontFamily","titleFontSize","titleLineHeight","bodyColor","bodyFontFamily","bodyFontSize","bodyLineHeight","containerStyle","borderRadius","alignItems","width","overflow","contentWrapStyle","titleStyle","color","fontFamily","fontSize","lineHeight","fontWeight","bodyStyle","renderSlot","slot","isValidElement","cloneElement","props","children","label","onPress"],"sourceRoot":"../../../../src","sources":["components/CtaCard/CtaCard.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,QAAwD,cAAc;AACzF,SAASC,iBAAiB,QAAQ,8CAA8C;AAChF,OAAOC,WAAW,MAAM,4BAA4B;AACpD,OAAOC,MAAM,MAAM,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAuDtC;AACA;AACA;AACA;AACA;AACA,SA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