jfs-components 0.0.3 → 0.0.5

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 (128) hide show
  1. package/lib/commonjs/Containers.js +16 -7
  2. package/lib/commonjs/Containers.js.map +1 -1
  3. package/lib/commonjs/components/Accordion/Accordion.js +217 -0
  4. package/lib/commonjs/components/Accordion/Accordion.js.map +1 -0
  5. package/lib/commonjs/components/Accordion/Accordion.mdx +123 -0
  6. package/lib/commonjs/components/ActionFooter/ActionFooter.mdx +1 -0
  7. package/lib/commonjs/components/ActionTile/ActionTile.js +93 -0
  8. package/lib/commonjs/components/ActionTile/ActionTile.js.map +1 -0
  9. package/lib/commonjs/components/ActionTile/ActionTile.mdx +54 -0
  10. package/lib/commonjs/components/ActionTile/index.js +14 -0
  11. package/lib/commonjs/components/ActionTile/index.js.map +1 -0
  12. package/lib/commonjs/components/CtaCard/CtaCard.js +122 -0
  13. package/lib/commonjs/components/CtaCard/CtaCard.js.map +1 -0
  14. package/lib/commonjs/components/CtaCard/CtaCard.mdx +65 -0
  15. package/lib/commonjs/components/CtaCard/index.js +14 -0
  16. package/lib/commonjs/components/CtaCard/index.js.map +1 -0
  17. package/lib/commonjs/components/Introduction.mdx +0 -1
  18. package/lib/commonjs/components/ThreadHero/ThreadHero.js +114 -0
  19. package/lib/commonjs/components/ThreadHero/ThreadHero.js.map +1 -0
  20. package/lib/commonjs/components/ThreadHero/ThreadHero.mdx +69 -0
  21. package/lib/commonjs/components/TransactionBubble/TransactionBubble.js +101 -0
  22. package/lib/commonjs/components/TransactionBubble/TransactionBubble.js.map +1 -0
  23. package/lib/commonjs/components/TransactionBubble/TransactionBubble.mdx +40 -0
  24. package/lib/commonjs/components/TransactionDetails/TransactionDetails.js +177 -0
  25. package/lib/commonjs/components/TransactionDetails/TransactionDetails.js.map +1 -0
  26. package/lib/commonjs/components/TransactionDetails/TransactionDetails.mdx +98 -0
  27. package/lib/commonjs/components/TransactionStatus/TransactionStatus.js +82 -0
  28. package/lib/commonjs/components/TransactionStatus/TransactionStatus.js.map +1 -0
  29. package/lib/commonjs/components/TransactionStatus/TransactionStatus.mdx +41 -0
  30. package/lib/commonjs/components/index.js +35 -0
  31. package/lib/commonjs/components/index.js.map +1 -1
  32. package/lib/commonjs/design-tokens/JFSThemeProvider.js +64 -0
  33. package/lib/commonjs/design-tokens/JFSThemeProvider.js.map +1 -0
  34. package/lib/commonjs/design-tokens/figma-variables-resolver.js +3 -9
  35. package/lib/commonjs/design-tokens/index.js +11 -0
  36. package/lib/commonjs/design-tokens/index.js.map +1 -1
  37. package/lib/commonjs/icons/registry.js +1 -1
  38. package/lib/module/Containers.js +15 -7
  39. package/lib/module/Containers.js.map +1 -1
  40. package/lib/module/components/Accordion/Accordion.js +212 -0
  41. package/lib/module/components/Accordion/Accordion.js.map +1 -0
  42. package/lib/module/components/Accordion/Accordion.mdx +123 -0
  43. package/lib/module/components/ActionFooter/ActionFooter.mdx +1 -0
  44. package/lib/module/components/ActionTile/ActionTile.js +88 -0
  45. package/lib/module/components/ActionTile/ActionTile.js.map +1 -0
  46. package/lib/module/components/ActionTile/ActionTile.mdx +54 -0
  47. package/lib/module/components/ActionTile/index.js +4 -0
  48. package/lib/module/components/ActionTile/index.js.map +1 -0
  49. package/lib/module/components/CtaCard/CtaCard.js +117 -0
  50. package/lib/module/components/CtaCard/CtaCard.js.map +1 -0
  51. package/lib/module/components/CtaCard/CtaCard.mdx +65 -0
  52. package/lib/module/components/CtaCard/index.js +4 -0
  53. package/lib/module/components/CtaCard/index.js.map +1 -0
  54. package/lib/module/components/Introduction.mdx +0 -1
  55. package/lib/module/components/ThreadHero/ThreadHero.js +109 -0
  56. package/lib/module/components/ThreadHero/ThreadHero.js.map +1 -0
  57. package/lib/module/components/ThreadHero/ThreadHero.mdx +69 -0
  58. package/lib/module/components/TransactionBubble/TransactionBubble.js +96 -0
  59. package/lib/module/components/TransactionBubble/TransactionBubble.js.map +1 -0
  60. package/lib/module/components/TransactionBubble/TransactionBubble.mdx +40 -0
  61. package/lib/module/components/TransactionDetails/TransactionDetails.js +174 -0
  62. package/lib/module/components/TransactionDetails/TransactionDetails.js.map +1 -0
  63. package/lib/module/components/TransactionDetails/TransactionDetails.mdx +98 -0
  64. package/lib/module/components/TransactionStatus/TransactionStatus.js +77 -0
  65. package/lib/module/components/TransactionStatus/TransactionStatus.js.map +1 -0
  66. package/lib/module/components/TransactionStatus/TransactionStatus.mdx +41 -0
  67. package/lib/module/components/index.js +5 -0
  68. package/lib/module/components/index.js.map +1 -1
  69. package/lib/module/design-tokens/JFSThemeProvider.js +57 -0
  70. package/lib/module/design-tokens/JFSThemeProvider.js.map +1 -0
  71. package/lib/module/design-tokens/index.js +1 -0
  72. package/lib/module/design-tokens/index.js.map +1 -1
  73. package/lib/module/icons/registry.js +1 -1
  74. package/lib/typescript/Containers.d.ts +2 -1
  75. package/lib/typescript/Containers.d.ts.map +1 -1
  76. package/lib/typescript/components/Accordion/Accordion.d.ts +58 -0
  77. package/lib/typescript/components/Accordion/Accordion.d.ts.map +1 -0
  78. package/lib/typescript/components/ActionTile/ActionTile.d.ts +26 -0
  79. package/lib/typescript/components/ActionTile/ActionTile.d.ts.map +1 -0
  80. package/lib/typescript/components/ActionTile/index.d.ts +2 -0
  81. package/lib/typescript/components/ActionTile/index.d.ts.map +1 -0
  82. package/lib/typescript/components/CtaCard/CtaCard.d.ts +61 -0
  83. package/lib/typescript/components/CtaCard/CtaCard.d.ts.map +1 -0
  84. package/lib/typescript/components/CtaCard/index.d.ts +2 -0
  85. package/lib/typescript/components/CtaCard/index.d.ts.map +1 -0
  86. package/lib/typescript/components/ThreadHero/ThreadHero.d.ts +21 -0
  87. package/lib/typescript/components/ThreadHero/ThreadHero.d.ts.map +1 -0
  88. package/lib/typescript/components/TransactionBubble/TransactionBubble.d.ts +24 -0
  89. package/lib/typescript/components/TransactionBubble/TransactionBubble.d.ts.map +1 -0
  90. package/lib/typescript/components/TransactionDetails/TransactionDetails.d.ts +57 -0
  91. package/lib/typescript/components/TransactionDetails/TransactionDetails.d.ts.map +1 -0
  92. package/lib/typescript/components/TransactionStatus/TransactionStatus.d.ts +16 -0
  93. package/lib/typescript/components/TransactionStatus/TransactionStatus.d.ts.map +1 -0
  94. package/lib/typescript/components/index.d.ts +5 -0
  95. package/lib/typescript/components/index.d.ts.map +1 -1
  96. package/lib/typescript/design-tokens/JFSThemeProvider.d.ts +44 -0
  97. package/lib/typescript/design-tokens/JFSThemeProvider.d.ts.map +1 -0
  98. package/lib/typescript/design-tokens/index.d.ts +1 -0
  99. package/lib/typescript/design-tokens/index.d.ts.map +1 -1
  100. package/lib/typescript/icons/registry.d.ts +1 -1
  101. package/package.json +3 -4
  102. package/src/Containers.tsx +15 -0
  103. package/src/components/.token-metadata.json +161 -0
  104. package/src/components/Accordion/Accordion.mdx +123 -0
  105. package/src/components/Accordion/Accordion.tsx +279 -0
  106. package/src/components/ActionFooter/ActionFooter.mdx +1 -0
  107. package/src/components/ActionTile/ActionTile.mdx +54 -0
  108. package/src/components/ActionTile/ActionTile.tsx +100 -0
  109. package/src/components/ActionTile/index.ts +1 -0
  110. package/src/components/CtaCard/CtaCard.mdx +65 -0
  111. package/src/components/CtaCard/CtaCard.tsx +185 -0
  112. package/src/components/CtaCard/index.ts +1 -0
  113. package/src/components/Divider/Divider.tsx +1 -0
  114. package/src/components/Introduction.mdx +0 -1
  115. package/src/components/NavArrow/NavArrow.tsx +1 -0
  116. package/src/components/ThreadHero/ThreadHero.mdx +69 -0
  117. package/src/components/ThreadHero/ThreadHero.tsx +124 -0
  118. package/src/components/TransactionBubble/TransactionBubble.mdx +40 -0
  119. package/src/components/TransactionBubble/TransactionBubble.tsx +113 -0
  120. package/src/components/TransactionDetails/TransactionDetails.mdx +98 -0
  121. package/src/components/TransactionDetails/TransactionDetails.tsx +236 -0
  122. package/src/components/TransactionStatus/TransactionStatus.mdx +41 -0
  123. package/src/components/TransactionStatus/TransactionStatus.tsx +94 -0
  124. package/src/components/index.ts +5 -0
  125. package/src/design-tokens/JFSThemeProvider.tsx +79 -0
  126. package/src/design-tokens/index.ts +1 -0
  127. package/src/icons/registry.ts +1 -1
  128. package/src/Containers.ts +0 -8
@@ -4,12 +4,21 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.storyContainer = void 0;
7
- var _native = _interopRequireDefault(require("styled-components/native"));
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _jsxRuntime = require("react/jsx-runtime");
8
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- const storyContainer = exports.storyContainer = _native.default.View`
10
- height: 100%;
11
- width: 100%;
12
- align-items: center;
13
- justify-content: center;
14
- `;
11
+ const storyContainer = props => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
12
+ style: styles.container,
13
+ ...props
14
+ });
15
+ exports.storyContainer = storyContainer;
16
+ const styles = _reactNative.StyleSheet.create({
17
+ container: {
18
+ height: '100%',
19
+ width: '100%',
20
+ alignItems: 'center',
21
+ justifyContent: 'center'
22
+ }
23
+ });
15
24
  //# sourceMappingURL=Containers.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_native","_interopRequireDefault","require","e","__esModule","default","storyContainer","exports","styled","View"],"sourceRoot":"../../src","sources":["Containers.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA6C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEtC,MAAMG,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAGE,eAAM,CAACC,IAAI;AACzC;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_jsxRuntime","e","__esModule","default","storyContainer","props","jsx","View","style","styles","container","exports","StyleSheet","create","height","width","alignItems","justifyContent"],"sourceRoot":"../../src","sources":["Containers.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAAgE,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEzD,MAAMG,cAAc,GAAIC,KAAgB,iBAC7C,IAAAL,WAAA,CAAAM,GAAA,EAACP,YAAA,CAAAQ,IAAI;EAACC,KAAK,EAAIC,MAAM,CAACC,SAAW;EAAA,GAAML;AAAK,CAAI,CACjD;AAACM,OAAA,CAAAP,cAAA,GAAAA,cAAA;AAEF,MAAMK,MAAM,GAAGG,uBAAU,CAACC,MAAM,CAAC;EAC/BH,SAAS,EAAE;IACTI,MAAM,EAAE,MAAM;IACdC,KAAK,EAAE,MAAM;IACbC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,217 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _figmaVariablesResolver = require("../../design-tokens/figma-variables-resolver");
10
+ var _Icon = _interopRequireDefault(require("../../icons/Icon"));
11
+ var _webPlatformUtils = require("../../utils/web-platform-utils");
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
15
+ // Enable LayoutAnimation on Android
16
+ if (_reactNative.Platform.OS === 'android' && _reactNative.UIManager.setLayoutAnimationEnabledExperimental) {
17
+ _reactNative.UIManager.setLayoutAnimationEnabledExperimental(true);
18
+ }
19
+
20
+ /**
21
+ * Helper function to recursively clone children and pass modes prop to components that accept it.
22
+ * This ensures that all child components in slots receive the modes prop from the parent.
23
+ */
24
+ function cloneChildrenWithModes(children, modes) {
25
+ const result = _react.default.Children.map(children, child => {
26
+ if (! /*#__PURE__*/_react.default.isValidElement(child)) {
27
+ return child;
28
+ }
29
+
30
+ // Get existing children
31
+ const childChildren = child.props?.children;
32
+ const hasChildren = childChildren !== undefined && childChildren !== null;
33
+
34
+ // Merge modes: parent modes first, then child's explicit modes override them
35
+ const existingModes = child.props?.modes;
36
+ const mergedModes = existingModes ? {
37
+ ...modes,
38
+ ...existingModes
39
+ } : modes;
40
+
41
+ // Recursively process children if they exist
42
+ const processedChildren = hasChildren ? cloneChildrenWithModes(_react.default.Children.toArray(childChildren), modes) : undefined;
43
+
44
+ // Clone element with modes and processed children
45
+ return /*#__PURE__*/_react.default.cloneElement(child, {
46
+ ...child.props,
47
+ modes: mergedModes
48
+ }, processedChildren);
49
+ });
50
+ return result || [];
51
+ }
52
+ /**
53
+ * Accordion component that mirrors the Figma "Accordion" component.
54
+ *
55
+ * This component supports:
56
+ * - **Expandable/collapsible content** with smooth animation
57
+ * - **States**: Idle, Hover, Open, Disabled
58
+ * - **Slot** for custom content
59
+ * - **Design-token driven styling** via `getVariableByName` and `modes`
60
+ *
61
+ * Wherever the Figma layer name contains "Slot", this component exposes a
62
+ * dedicated React "slot" prop:
63
+ * - Slot "content" → `children`
64
+ *
65
+ * @component
66
+ * @param {Object} props
67
+ * @param {string} [props.title='Accordion title'] - The accordion header title
68
+ * @param {boolean} [props.defaultExpanded=false] - Initial expanded state
69
+ * @param {boolean} [props.expanded] - Controlled expanded state
70
+ * @param {Function} [props.onExpandedChange] - Callback fired when expanded state changes
71
+ * @param {boolean} [props.disabled=false] - Whether the accordion is disabled
72
+ * @param {React.ReactNode} [props.children] - Content to display when expanded
73
+ * @param {Object} [props.modes={}] - Modes object passed to `getVariableByName` for all design tokens
74
+ * @param {Object} [props.style] - Optional container style overrides
75
+ * @param {string} [props.accessibilityLabel] - Accessibility label for the accordion. If not provided, uses title
76
+ * @param {string} [props.accessibilityHint] - Additional accessibility hint for screen readers
77
+ */
78
+ function Accordion({
79
+ title = 'Accordion title',
80
+ defaultExpanded = false,
81
+ expanded: controlledExpanded,
82
+ onExpandedChange,
83
+ disabled = false,
84
+ children,
85
+ modes = {},
86
+ style,
87
+ accessibilityLabel,
88
+ accessibilityHint,
89
+ accessibilityState,
90
+ webAccessibilityProps,
91
+ ...rest
92
+ }) {
93
+ // Internal state for uncontrolled mode
94
+ const [internalExpanded, setInternalExpanded] = (0, _react.useState)(defaultExpanded);
95
+
96
+ // Determine if controlled or uncontrolled
97
+ const isControlled = controlledExpanded !== undefined;
98
+ const isExpanded = isControlled ? controlledExpanded : internalExpanded;
99
+
100
+ // Hover state for web
101
+ const [isHovered, setIsHovered] = (0, _react.useState)(false);
102
+
103
+ // Handle toggle
104
+ const handleToggle = () => {
105
+ if (disabled) return;
106
+
107
+ // Animate the layout change
108
+ _reactNative.LayoutAnimation.configureNext(_reactNative.LayoutAnimation.Presets.easeInEaseOut);
109
+ if (isControlled) {
110
+ onExpandedChange?.(!isExpanded);
111
+ } else {
112
+ setInternalExpanded(!isExpanded);
113
+ onExpandedChange?.(!isExpanded);
114
+ }
115
+ };
116
+
117
+ // Resolve design tokens
118
+ const titleColor = disabled ? '#999999' : (0, _figmaVariablesResolver.getVariableByName)('accordion/title/color', modes) || '#0d0d0d';
119
+ const titleFontSize = (0, _figmaVariablesResolver.getVariableByName)('accordion/title/fontSize', modes) || 18;
120
+ const titleLineHeight = (0, _figmaVariablesResolver.getVariableByName)('accordion/title/lineHeight', modes) || 20;
121
+ const titleFontFamily = (0, _figmaVariablesResolver.getVariableByName)('accordion/title/fontFamily', modes) || 'System';
122
+ const iconColor = (0, _figmaVariablesResolver.getVariableByName)('accordion/icon/color', modes) || '#141414';
123
+ const iconSize = (0, _figmaVariablesResolver.getVariableByName)('accordion/icon/size', modes) || 24;
124
+ const headerGap = (0, _figmaVariablesResolver.getVariableByName)('accordion/header/gap', modes) || 12;
125
+ const headerPaddingVertical = (0, _figmaVariablesResolver.getVariableByName)('accordion/header/padding/vertical', modes) || 24;
126
+ const headerBackground = isHovered && !disabled ? '#f2f2f2' : (0, _figmaVariablesResolver.getVariableByName)('accordion/header/background', modes) || 'transparent';
127
+ const contentGap = (0, _figmaVariablesResolver.getVariableByName)('accordion/content/gap', modes) || 12;
128
+ const contentPaddingTop = (0, _figmaVariablesResolver.getVariableByName)('accordion/content/padding/top', modes) || 8;
129
+ const contentPaddingBottom = isExpanded ? (0, _figmaVariablesResolver.getVariableByName)('accordion/content/padding/bottom', modes) ?? 24 : 8;
130
+ const borderColor = (0, _figmaVariablesResolver.getVariableByName)('accordion/border/color', modes) || '#e6e6e6';
131
+
132
+ // Styles
133
+ const containerStyle = {
134
+ borderBottomWidth: 1,
135
+ borderBottomColor: borderColor
136
+ };
137
+ const headerStyle = {
138
+ flexDirection: 'row',
139
+ alignItems: 'center',
140
+ gap: headerGap,
141
+ paddingVertical: headerPaddingVertical,
142
+ paddingHorizontal: 0,
143
+ backgroundColor: headerBackground,
144
+ overflow: 'hidden'
145
+ };
146
+ const titleStyle = {
147
+ flex: 1,
148
+ color: titleColor,
149
+ fontSize: titleFontSize,
150
+ lineHeight: titleLineHeight,
151
+ fontFamily: titleFontFamily,
152
+ fontWeight: '700'
153
+ };
154
+ const contentStyle = {
155
+ backgroundColor: 'transparent',
156
+ gap: contentGap,
157
+ paddingTop: contentPaddingTop,
158
+ paddingBottom: contentPaddingBottom,
159
+ paddingHorizontal: 0,
160
+ overflow: 'hidden'
161
+ };
162
+
163
+ // Generate default accessibility label
164
+ const defaultAccessibilityLabel = accessibilityLabel || title;
165
+
166
+ // Web platform support
167
+ const webProps = (0, _webPlatformUtils.usePressableWebSupport)({
168
+ restProps: {},
169
+ onPress: handleToggle,
170
+ disabled,
171
+ accessibilityLabel: defaultAccessibilityLabel,
172
+ webAccessibilityProps
173
+ });
174
+
175
+ // Process children to pass modes
176
+ const processedChildren = children ? cloneChildrenWithModes(_react.default.Children.toArray(children), modes) : null;
177
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
178
+ style: [containerStyle, style],
179
+ ...rest,
180
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
181
+ accessibilityRole: "button",
182
+ accessibilityLabel: defaultAccessibilityLabel,
183
+ accessibilityHint: accessibilityHint || (isExpanded ? 'Collapse accordion' : 'Expand accordion'),
184
+ accessibilityState: {
185
+ expanded: isExpanded,
186
+ disabled,
187
+ ...accessibilityState
188
+ },
189
+ onPress: handleToggle,
190
+ disabled: disabled,
191
+ onHoverIn: () => setIsHovered(true),
192
+ onHoverOut: () => setIsHovered(false),
193
+ style: ({
194
+ pressed
195
+ }) => [headerStyle, pressed && !disabled ? {
196
+ opacity: 0.9
197
+ } : null],
198
+ ...webProps,
199
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
200
+ style: titleStyle,
201
+ numberOfLines: 1,
202
+ children: title
203
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
204
+ name: isExpanded ? 'ic_minus' : 'ic_add',
205
+ size: iconSize,
206
+ color: disabled ? '#999999' : iconColor,
207
+ accessibilityElementsHidden: true,
208
+ importantForAccessibility: "no"
209
+ })]
210
+ }), isExpanded && processedChildren && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
211
+ style: contentStyle,
212
+ children: processedChildren
213
+ })]
214
+ });
215
+ }
216
+ var _default = exports.default = Accordion;
217
+ //# sourceMappingURL=Accordion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_figmaVariablesResolver","_Icon","_interopRequireDefault","_webPlatformUtils","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","Platform","OS","UIManager","setLayoutAnimationEnabledExperimental","cloneChildrenWithModes","children","modes","result","React","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","useState","isControlled","isExpanded","isHovered","setIsHovered","handleToggle","LayoutAnimation","configureNext","Presets","easeInEaseOut","titleColor","getVariableByName","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","usePressableWebSupport","restProps","onPress","jsxs","View","Pressable","accessibilityRole","onHoverIn","onHoverOut","pressed","opacity","jsx","Text","numberOfLines","name","size","accessibilityElementsHidden","importantForAccessibility","_default","exports"],"sourceRoot":"../../../../src","sources":["components/Accordion/Accordion.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAYA,IAAAE,uBAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAC,sBAAA,CAAAJ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AY,CAAC,IAAI,CAAE;MACpCmD,UAAU,EAAEA,CAAA,KAAMnD,YAAY,CAAC,KAAK,CAAE;MACtCZ,KAAK,EAAEA,CAAC;QAAEgE;MAAQ,CAAC,KAAK,CACtB7B,WAAW,EACX6B,OAAO,IAAI,CAACjE,QAAQ,GAAG;QAAEkE,OAAO,EAAE;MAAI,CAAC,GAAG,IAAI,CAC9C;MAAA,GACEX,QAAQ;MAAA9E,QAAA,gBAEZ,IAAAzB,WAAA,CAAAmH,GAAA,EAACxH,YAAA,CAAAyH,IAAI;QAACnE,KAAK,EAAE2C,UAAW;QAACyB,aAAa,EAAE,CAAE;QAAA5F,QAAA,EACvCkB;MAAK,CACF,CAAC,eACP,IAAA3C,WAAA,CAAAmH,GAAA,EAACtH,KAAA,CAAAM,OAAI;QACHmH,IAAI,EAAE3D,UAAU,GAAG,UAAU,GAAG,QAAS;QACzC4D,IAAI,EAAE9C,QAAS;QACfqB,KAAK,EAAE9C,QAAQ,GAAG,SAAS,GAAGwB,SAAU;QACxCgD,2BAA2B,EAAE,IAAK;QAClCC,yBAAyB,EAAC;MAAI,CAC/B,CAAC;IAAA,CACO,CAAC,EAEX9D,UAAU,IAAIpB,iBAAiB,iBAC9B,IAAAvC,WAAA,CAAAmH,GAAA,EAACxH,YAAA,CAAAiH,IAAI;MAAC3D,KAAK,EAAEkD,YAAa;MAAA1E,QAAA,EACvBc;IAAiB,CACd,CACP;EAAA,CACG,CAAC;AAEX;AAAC,IAAAmF,QAAA,GAAAC,OAAA,CAAAxH,OAAA,GAEcuC,SAAS","ignoreList":[]}
@@ -0,0 +1,123 @@
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
+
123
+
@@ -99,3 +99,4 @@ All tokens support mode-based theming through the `modes` prop.
99
99
 
100
100
  The ActionFooter uses `accessibilityRole="toolbar"` to indicate it contains a group of action controls. Provide a meaningful `accessibilityLabel` to describe the footer's purpose to screen reader users.
101
101
 
102
+
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = ActionTile;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _figmaVariablesResolver = require("../../design-tokens/figma-variables-resolver");
10
+ var _IconCapsule = _interopRequireDefault(require("../IconCapsule/IconCapsule"));
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
+ /**
14
+ * ActionTile component from Figma design.
15
+ * Displays an icon (defaulting to IconCapsule) and a label.
16
+ *
17
+ * @component
18
+ */
19
+ function ActionTile({
20
+ label = 'Cards',
21
+ icon,
22
+ modes = {},
23
+ style,
24
+ onPress
25
+ }) {
26
+ // Resolve tokens
27
+ const backgroundColor = (0, _figmaVariablesResolver.getVariableByName)('actionTile/background', modes) || '#ffffff';
28
+ const gap = Number((0, _figmaVariablesResolver.getVariableByName)('actionTile/gap', modes)) || 8;
29
+ const paddingHorizontal = Number((0, _figmaVariablesResolver.getVariableByName)('actionTile/padding/horizontal', modes)) || 12;
30
+ const paddingVertical = Number((0, _figmaVariablesResolver.getVariableByName)('actionTile/padding/vertical', modes)) || 16;
31
+ const radius = Number((0, _figmaVariablesResolver.getVariableByName)('actionTile/radius', modes)) || 16;
32
+
33
+ // Text tokens
34
+ const textColor = (0, _figmaVariablesResolver.getVariableByName)('actionTile/foreground', modes) || '#0d0d0f';
35
+ const fontSize = Number((0, _figmaVariablesResolver.getVariableByName)('actionTile/fontSize', modes)) || 14;
36
+ const fontFamily = (0, _figmaVariablesResolver.getVariableByName)('actionTile/fontFamily', modes) || 'JioType Var';
37
+ const fontWeightStr = (0, _figmaVariablesResolver.getVariableByName)('actionTile/fontWeight', modes) || '500';
38
+ const lineHeight = Number((0, _figmaVariablesResolver.getVariableByName)('actionTile/lineHeight', modes)) || 17;
39
+ const containerStyle = {
40
+ backgroundColor,
41
+ borderRadius: radius,
42
+ paddingHorizontal,
43
+ paddingVertical,
44
+ gap,
45
+ width: 168,
46
+ // Fixed width from design
47
+ height: 90,
48
+ // Fixed height from design
49
+ alignItems: 'flex-start',
50
+ // ensure content stretches if needed, though design implies fixed size block
51
+ ...style
52
+ };
53
+ const textStyle = {
54
+ color: textColor,
55
+ fontSize,
56
+ fontFamily,
57
+ fontWeight: fontWeightStr,
58
+ // Cast to any or TextStyle fontWeight enum if needed
59
+ lineHeight
60
+ };
61
+
62
+ // Handle Icon Slot: Pass modes safely
63
+ const renderIcon = () => {
64
+ if (/*#__PURE__*/_react.default.isValidElement(icon)) {
65
+ // Pass modes down to the slot child
66
+ return /*#__PURE__*/_react.default.cloneElement(icon, {
67
+ modes
68
+ });
69
+ }
70
+ // Default fallback if no icon prop is provided, matching design default
71
+ if (!icon) {
72
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconCapsule.default, {
73
+ modes: modes
74
+ });
75
+ }
76
+ return icon;
77
+ };
78
+ const Content = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
79
+ style: containerStyle,
80
+ children: [renderIcon(), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
81
+ style: textStyle,
82
+ children: label
83
+ })]
84
+ });
85
+ if (onPress) {
86
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
87
+ onPress: onPress,
88
+ children: Content
89
+ });
90
+ }
91
+ return Content;
92
+ }
93
+ //# sourceMappingURL=ActionTile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_figmaVariablesResolver","_IconCapsule","_jsxRuntime","e","__esModule","default","ActionTile","label","icon","modes","style","onPress","backgroundColor","getVariableByName","gap","Number","paddingHorizontal","paddingVertical","radius","textColor","fontSize","fontFamily","fontWeightStr","lineHeight","containerStyle","borderRadius","width","height","alignItems","textStyle","color","fontWeight","renderIcon","React","isValidElement","cloneElement","jsx","Content","jsxs","View","children","Text","TouchableOpacity"],"sourceRoot":"../../../../src","sources":["components/ActionTile/ActionTile.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,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AAAkC,GAAA,EAACrC,YAAA,CAAA2C,gBAAgB;MAAC/B,OAAO,EAAEA,OAAQ;MAAA6B,QAAA,EAC9BH;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,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "default", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _ActionTile.default;
10
+ }
11
+ });
12
+ var _ActionTile = _interopRequireDefault(require("./ActionTile"));
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_ActionTile","_interopRequireDefault","require","e","__esModule","default"],"sourceRoot":"../../../../src","sources":["components/ActionTile/index.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAsC,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA","ignoreList":[]}