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.
- package/lib/commonjs/components/Accordion/Accordion.js +217 -0
- package/lib/commonjs/components/Accordion/Accordion.js.map +1 -0
- package/lib/commonjs/components/Accordion/Accordion.mdx +122 -0
- package/lib/commonjs/components/ActionTile/ActionTile.js +93 -0
- package/lib/commonjs/components/ActionTile/ActionTile.js.map +1 -0
- package/lib/commonjs/components/ActionTile/ActionTile.mdx +54 -0
- package/lib/commonjs/components/ActionTile/index.js +14 -0
- package/lib/commonjs/components/ActionTile/index.js.map +1 -0
- package/lib/commonjs/components/CtaCard/CtaCard.js +122 -0
- package/lib/commonjs/components/CtaCard/CtaCard.js.map +1 -0
- package/lib/commonjs/components/CtaCard/CtaCard.mdx +66 -0
- package/lib/commonjs/components/CtaCard/index.js +14 -0
- package/lib/commonjs/components/CtaCard/index.js.map +1 -0
- package/lib/commonjs/components/MoneyValue/MoneyValue.js +36 -4
- package/lib/commonjs/components/MoneyValue/MoneyValue.js.map +1 -1
- package/lib/commonjs/components/ThreadHero/ThreadHero.js +114 -0
- package/lib/commonjs/components/ThreadHero/ThreadHero.js.map +1 -0
- package/lib/commonjs/components/ThreadHero/ThreadHero.mdx +69 -0
- package/lib/commonjs/components/TransactionBubble/TransactionBubble.js +101 -0
- package/lib/commonjs/components/TransactionBubble/TransactionBubble.js.map +1 -0
- package/lib/commonjs/components/TransactionBubble/TransactionBubble.mdx +40 -0
- package/lib/commonjs/components/TransactionDetails/TransactionDetails.js +177 -0
- package/lib/commonjs/components/TransactionDetails/TransactionDetails.js.map +1 -0
- package/lib/commonjs/components/TransactionDetails/TransactionDetails.mdx +98 -0
- package/lib/commonjs/components/TransactionStatus/TransactionStatus.js +82 -0
- package/lib/commonjs/components/TransactionStatus/TransactionStatus.js.map +1 -0
- package/lib/commonjs/components/TransactionStatus/TransactionStatus.mdx +41 -0
- package/lib/commonjs/components/index.js +35 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/design-tokens/figma-variables-resolver.js +3 -9
- package/lib/commonjs/icons/registry.js +1 -1
- package/lib/module/components/Accordion/Accordion.js +212 -0
- package/lib/module/components/Accordion/Accordion.js.map +1 -0
- package/lib/module/components/Accordion/Accordion.mdx +122 -0
- package/lib/module/components/ActionTile/ActionTile.js +88 -0
- package/lib/module/components/ActionTile/ActionTile.js.map +1 -0
- package/lib/module/components/ActionTile/ActionTile.mdx +54 -0
- package/lib/module/components/ActionTile/index.js +4 -0
- package/lib/module/components/ActionTile/index.js.map +1 -0
- package/lib/module/components/CtaCard/CtaCard.js +117 -0
- package/lib/module/components/CtaCard/CtaCard.js.map +1 -0
- package/lib/module/components/CtaCard/CtaCard.mdx +66 -0
- package/lib/module/components/CtaCard/index.js +4 -0
- package/lib/module/components/CtaCard/index.js.map +1 -0
- package/lib/module/components/MoneyValue/MoneyValue.js +36 -4
- package/lib/module/components/MoneyValue/MoneyValue.js.map +1 -1
- package/lib/module/components/ThreadHero/ThreadHero.js +109 -0
- package/lib/module/components/ThreadHero/ThreadHero.js.map +1 -0
- package/lib/module/components/ThreadHero/ThreadHero.mdx +69 -0
- package/lib/module/components/TransactionBubble/TransactionBubble.js +96 -0
- package/lib/module/components/TransactionBubble/TransactionBubble.js.map +1 -0
- package/lib/module/components/TransactionBubble/TransactionBubble.mdx +40 -0
- package/lib/module/components/TransactionDetails/TransactionDetails.js +174 -0
- package/lib/module/components/TransactionDetails/TransactionDetails.js.map +1 -0
- package/lib/module/components/TransactionDetails/TransactionDetails.mdx +98 -0
- package/lib/module/components/TransactionStatus/TransactionStatus.js +77 -0
- package/lib/module/components/TransactionStatus/TransactionStatus.js.map +1 -0
- package/lib/module/components/TransactionStatus/TransactionStatus.mdx +41 -0
- package/lib/module/components/index.js +5 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/icons/registry.js +1 -1
- package/lib/typescript/components/Accordion/Accordion.d.ts +58 -0
- package/lib/typescript/components/Accordion/Accordion.d.ts.map +1 -0
- package/lib/typescript/components/ActionTile/ActionTile.d.ts +26 -0
- package/lib/typescript/components/ActionTile/ActionTile.d.ts.map +1 -0
- package/lib/typescript/components/ActionTile/index.d.ts +2 -0
- package/lib/typescript/components/ActionTile/index.d.ts.map +1 -0
- package/lib/typescript/components/CtaCard/CtaCard.d.ts +61 -0
- package/lib/typescript/components/CtaCard/CtaCard.d.ts.map +1 -0
- package/lib/typescript/components/CtaCard/index.d.ts +2 -0
- package/lib/typescript/components/CtaCard/index.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/ThreadHero/ThreadHero.d.ts +21 -0
- package/lib/typescript/components/ThreadHero/ThreadHero.d.ts.map +1 -0
- package/lib/typescript/components/TransactionBubble/TransactionBubble.d.ts +24 -0
- package/lib/typescript/components/TransactionBubble/TransactionBubble.d.ts.map +1 -0
- package/lib/typescript/components/TransactionDetails/TransactionDetails.d.ts +57 -0
- package/lib/typescript/components/TransactionDetails/TransactionDetails.d.ts.map +1 -0
- package/lib/typescript/components/TransactionStatus/TransactionStatus.d.ts +16 -0
- package/lib/typescript/components/TransactionStatus/TransactionStatus.d.ts.map +1 -0
- package/lib/typescript/components/index.d.ts +5 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/icons/registry.d.ts +1 -1
- package/package.json +5 -2
- package/src/components/.token-metadata.json +161 -0
- package/src/components/Accordion/Accordion.mdx +122 -0
- package/src/components/Accordion/Accordion.tsx +279 -0
- package/src/components/ActionTile/ActionTile.mdx +54 -0
- package/src/components/ActionTile/ActionTile.tsx +100 -0
- package/src/components/ActionTile/index.ts +1 -0
- package/src/components/CtaCard/CtaCard.mdx +66 -0
- package/src/components/CtaCard/CtaCard.tsx +185 -0
- package/src/components/CtaCard/index.ts +1 -0
- package/src/components/MoneyValue/MoneyValue.tsx +39 -3
- package/src/components/ThreadHero/ThreadHero.mdx +69 -0
- package/src/components/ThreadHero/ThreadHero.tsx +124 -0
- package/src/components/TransactionBubble/TransactionBubble.mdx +40 -0
- package/src/components/TransactionBubble/TransactionBubble.tsx +113 -0
- package/src/components/TransactionDetails/TransactionDetails.mdx +98 -0
- package/src/components/TransactionDetails/TransactionDetails.tsx +236 -0
- package/src/components/TransactionStatus/TransactionStatus.mdx +41 -0
- package/src/components/TransactionStatus/TransactionStatus.tsx +94 -0
- package/src/components/index.ts +5 -0
- package/src/icons/registry.ts +1 -1
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Meta, Story, Canvas, PureArgsTable as ArgsTable } from '@storybook/addon-docs/blocks';
|
|
2
|
+
import * as CtaCardStories from './CtaCard.stories';
|
|
3
|
+
import CtaCard from './CtaCard';
|
|
4
|
+
|
|
5
|
+
<Meta of={CtaCardStories} />
|
|
6
|
+
|
|
7
|
+
# CtaCard
|
|
8
|
+
|
|
9
|
+
`CtaCard` is a component used to display a Call-to-Action with an icon, title, body text, and a button.
|
|
10
|
+
It is designed to be flexible, allowing content to be passed via props or fully customized via slots.
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## Available Collections and Modes
|
|
14
|
+
|
|
15
|
+
This component does not use any design token collections with multiple modes.
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
import { CtaCard } from 'jfs-components'; // Adjust import based on your package structure
|
|
20
|
+
|
|
21
|
+
// Basic Usage
|
|
22
|
+
<CtaCard
|
|
23
|
+
title="Lets create your UPI ID"
|
|
24
|
+
body="Send and receive money securely."
|
|
25
|
+
iconName="ic_upi_number"
|
|
26
|
+
buttonLabel="Get started"
|
|
27
|
+
onPressButton={() => console.log('Pressed')}
|
|
28
|
+
/>
|
|
29
|
+
|
|
30
|
+
// Using Slots
|
|
31
|
+
<CtaCard
|
|
32
|
+
titleSlot={<CustomTitle />}
|
|
33
|
+
buttonSlot={<CustomButton />}
|
|
34
|
+
/>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
<Canvas>
|
|
38
|
+
<Story of={CtaCardStories.Default} />
|
|
39
|
+
</Canvas>
|
|
40
|
+
|
|
41
|
+
## Props
|
|
42
|
+
|
|
43
|
+
<ArgsTable of={CtaCard} />
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## Design Tokens
|
|
47
|
+
|
|
48
|
+
This component uses the following design tokens, resolved through `getVariableByName`:
|
|
49
|
+
|
|
50
|
+
- **`ctaCard/background`**
|
|
51
|
+
- **`ctaCard/body/color`**
|
|
52
|
+
- **`ctaCard/body/fontFamily`**
|
|
53
|
+
- **`ctaCard/body/fontSize`**
|
|
54
|
+
- **`ctaCard/body/lineHeight`**
|
|
55
|
+
- **`ctaCard/content/gap`**
|
|
56
|
+
- **`ctaCard/gap`**
|
|
57
|
+
- **`ctaCard/padding/horizontal`**
|
|
58
|
+
- **`ctaCard/padding/vertical`**
|
|
59
|
+
- **`ctaCard/radius`**
|
|
60
|
+
- **`ctaCard/title/color`**
|
|
61
|
+
- **`ctaCard/title/fontFamily`**
|
|
62
|
+
- **`ctaCard/title/fontSize`**
|
|
63
|
+
- **`ctaCard/title/lineHeight`**
|
|
64
|
+
|
|
65
|
+
All tokens support mode-based theming through the `modes` prop.
|
|
66
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["default"],"sourceRoot":"../../../../src","sources":["components/CtaCard/index.ts"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,WAAW","ignoreList":[]}
|
|
@@ -49,29 +49,56 @@ const CURRENCY_SYMBOLS = {
|
|
|
49
49
|
* (e.g. "INR", "USD"). When an ISO code is provided, it will be mapped to the
|
|
50
50
|
* appropriate symbol, with special care to support INR and other major currencies.
|
|
51
51
|
*
|
|
52
|
+
* Negative values are auto-detected from the value prop (e.g., -500 or "-500").
|
|
53
|
+
* The `negative` prop can be used to explicitly override this behavior.
|
|
54
|
+
*
|
|
52
55
|
* @component
|
|
53
56
|
* @param {Object} props
|
|
54
|
-
* @param {string|number} [props.value="500"] - Monetary value to display.
|
|
57
|
+
* @param {string|number} [props.value="500"] - Monetary value to display. Negative values are auto-detected.
|
|
55
58
|
* @param {string} [props.currency="₹"] - Currency symbol or ISO code (e.g. "INR").
|
|
59
|
+
* @param {boolean} [props.negative] - Explicitly override negative display. If undefined, auto-detects from value.
|
|
56
60
|
* @param {Object} [props.modes={}] - Modes object passed directly to `getVariableByName`.
|
|
57
61
|
* Example: {"MoneyValue / Theme": "Default"}
|
|
58
62
|
* @param {Object} [props.style] - Optional container style overrides.
|
|
59
63
|
* @param {Object} [props.valueStyle] - Optional value text style overrides.
|
|
60
64
|
* @param {Object} [props.currencyStyle] - Optional currency text style overrides.
|
|
65
|
+
* @param {Object} [props.negativeSignStyle] - Optional negative sign text style overrides.
|
|
61
66
|
* @param {string} [props.accessibilityLabel] - Accessibility label for screen readers. If not provided, generates from value and currency
|
|
62
67
|
* @param {string} [props.accessibilityHint] - Additional accessibility hint for screen readers
|
|
63
68
|
*/
|
|
64
69
|
function MoneyValue({
|
|
65
70
|
value = '500',
|
|
66
71
|
currency = '₹',
|
|
72
|
+
negative,
|
|
67
73
|
modes = {},
|
|
68
74
|
style,
|
|
69
75
|
valueStyle,
|
|
70
76
|
currencyStyle,
|
|
77
|
+
negativeSignStyle,
|
|
71
78
|
accessibilityLabel,
|
|
72
79
|
accessibilityHint,
|
|
73
80
|
...rest
|
|
74
81
|
}) {
|
|
82
|
+
// Auto-detect negative from value and compute display value
|
|
83
|
+
const {
|
|
84
|
+
isNegative,
|
|
85
|
+
displayValue
|
|
86
|
+
} = React.useMemo(() => {
|
|
87
|
+
const stringValue = String(value);
|
|
88
|
+
const trimmed = stringValue.trim();
|
|
89
|
+
const valueIsNegative = trimmed.startsWith('-') || typeof value === 'number' && value < 0;
|
|
90
|
+
|
|
91
|
+
// Strip leading minus sign for display (we show it separately)
|
|
92
|
+
const absoluteValue = trimmed.startsWith('-') ? trimmed.slice(1) : trimmed;
|
|
93
|
+
|
|
94
|
+
// Use explicit negative prop if provided, otherwise use auto-detected
|
|
95
|
+
const showNegative = negative !== undefined ? negative : valueIsNegative;
|
|
96
|
+
return {
|
|
97
|
+
isNegative: showNegative,
|
|
98
|
+
displayValue: absoluteValue
|
|
99
|
+
};
|
|
100
|
+
}, [value, negative]);
|
|
101
|
+
|
|
75
102
|
// Resolve typography and layout tokens from Figma
|
|
76
103
|
const textColor = getVariableByName('moneyValue/text/color', modes) || '#0f0d0a';
|
|
77
104
|
const fontSize = getVariableByName('moneyValue/supportText/fontSize', modes) || 14;
|
|
@@ -101,14 +128,19 @@ function MoneyValue({
|
|
|
101
128
|
};
|
|
102
129
|
|
|
103
130
|
// Generate default accessibility label from value and currency
|
|
104
|
-
const defaultAccessibilityLabel = accessibilityLabel || `${resolvedCurrency} ${
|
|
131
|
+
const defaultAccessibilityLabel = accessibilityLabel || `${isNegative ? 'negative ' : ''}${resolvedCurrency} ${displayValue}`;
|
|
105
132
|
return /*#__PURE__*/_jsxs(View, {
|
|
106
133
|
style: [containerStyle, style],
|
|
107
134
|
accessibilityRole: "text",
|
|
108
135
|
accessibilityLabel: defaultAccessibilityLabel,
|
|
109
136
|
accessibilityHint: accessibilityHint,
|
|
110
137
|
...rest,
|
|
111
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
138
|
+
children: [isNegative && /*#__PURE__*/_jsx(Text, {
|
|
139
|
+
style: [baseTextStyle, negativeSignStyle],
|
|
140
|
+
accessibilityElementsHidden: true,
|
|
141
|
+
importantForAccessibility: "no",
|
|
142
|
+
children: "-"
|
|
143
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
112
144
|
style: [baseTextStyle, currencyStyle],
|
|
113
145
|
accessibilityElementsHidden: true,
|
|
114
146
|
importantForAccessibility: "no",
|
|
@@ -117,7 +149,7 @@ function MoneyValue({
|
|
|
117
149
|
style: [baseTextStyle, valueStyle],
|
|
118
150
|
accessibilityElementsHidden: true,
|
|
119
151
|
importantForAccessibility: "no",
|
|
120
|
-
children:
|
|
152
|
+
children: displayValue
|
|
121
153
|
})]
|
|
122
154
|
});
|
|
123
155
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","Text","getVariableByName","jsx","_jsx","jsxs","_jsxs","CURRENCY_SYMBOLS","INR","USD","EUR","GBP","JPY","CNY","AUD","CAD","CHF","HKD","SGD","NZD","SEK","NOK","DKK","RUB","BRL","ZAR","AED","SAR","TRY","KRW","IDR","THB","MYR","PHP","VND","PKR","BDT","LKR","NPR","MoneyValue","value","currency","modes","style","valueStyle","currencyStyle","accessibilityLabel","accessibilityHint","rest","textColor","fontSize","lineHeight","fontWeightValue","fontWeight","toString","fontFamily","gap","resolvedCurrency","
|
|
1
|
+
{"version":3,"names":["React","View","Text","getVariableByName","jsx","_jsx","jsxs","_jsxs","CURRENCY_SYMBOLS","INR","USD","EUR","GBP","JPY","CNY","AUD","CAD","CHF","HKD","SGD","NZD","SEK","NOK","DKK","RUB","BRL","ZAR","AED","SAR","TRY","KRW","IDR","THB","MYR","PHP","VND","PKR","BDT","LKR","NPR","MoneyValue","value","currency","negative","modes","style","valueStyle","currencyStyle","negativeSignStyle","accessibilityLabel","accessibilityHint","rest","isNegative","displayValue","useMemo","stringValue","String","trimmed","trim","valueIsNegative","startsWith","absoluteValue","slice","showNegative","undefined","textColor","fontSize","lineHeight","fontWeightValue","fontWeight","toString","fontFamily","gap","resolvedCurrency","upper","toUpperCase","baseTextStyle","color","containerStyle","flexDirection","alignItems","defaultAccessibilityLabel","accessibilityRole","children","accessibilityElementsHidden","importantForAccessibility"],"sourceRoot":"../../../../src","sources":["components/MoneyValue/MoneyValue.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,QAAwD,cAAc;AACzF,SAASC,iBAAiB,QAAQ,8CAA8C;;AAEhF;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IA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PpE,IAAA,CAACH,IAAI;MACH2C,KAAK,EAAE,CAAC+B,aAAa,EAAE9B,UAAU,CAAE;MACnCsC,2BAA2B,EAAE,IAAK;MAClCC,yBAAyB,EAAC,IAAI;MAAAF,QAAA,EAE7B9B;IAAY,CACT,CAAC;EAAA,CACH,CAAC;AAEX;AAEA,eAAeb,UAAU","ignoreList":[]}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { isValidElement, cloneElement } from 'react';
|
|
4
|
+
import { View, Text } from 'react-native';
|
|
5
|
+
import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
/**
|
|
8
|
+
* ThreadHero component displaying a central identity with avatar, title, subtitle, and caption.
|
|
9
|
+
*/
|
|
10
|
+
export default function ThreadHero({
|
|
11
|
+
title = 'Subhash Rajan',
|
|
12
|
+
subtitle = 'Banking name: SHIVASHANKAR RAJAN',
|
|
13
|
+
caption,
|
|
14
|
+
renderAvatar,
|
|
15
|
+
modes = {},
|
|
16
|
+
style
|
|
17
|
+
}) {
|
|
18
|
+
// Container Gaps
|
|
19
|
+
const containerGap = Number(getVariableByName('threadHero/gap', modes)) || 8;
|
|
20
|
+
const detailsGap = Number(getVariableByName('threadHero/details/gap', modes)) || 2;
|
|
21
|
+
|
|
22
|
+
// Title Styles
|
|
23
|
+
const titleColor = getVariableByName('threadHero/title/color', modes) || '#191b1e';
|
|
24
|
+
const titleFontSize = Number(getVariableByName('threadHero/title/fontSize', modes)) || 16;
|
|
25
|
+
const titleFontFamily = getVariableByName('threadHero/title/fontFamily', modes) || 'System';
|
|
26
|
+
const titleLineHeight = Number(getVariableByName('threadHero/title/lineHeight', modes)) || 20;
|
|
27
|
+
const titleFontWeight = getVariableByName('threadHero/title/fontWeight', modes) || '600';
|
|
28
|
+
|
|
29
|
+
// Subtitle Styles
|
|
30
|
+
const subtitleColor = getVariableByName('threadHero/subtitle/color', modes) || '#5d5d61';
|
|
31
|
+
const subtitleFontSize = Number(getVariableByName('threadHero/subtitle/fontSize', modes)) || 12;
|
|
32
|
+
const subtitleFontFamily = getVariableByName('threadHero/subtitle/fontFamily', modes) || 'System';
|
|
33
|
+
const subtitleLineHeight = Number(getVariableByName('threadHero/subtitle/lineHeight', modes)) || 18;
|
|
34
|
+
const subtitleFontWeight = getVariableByName('threadHero/subtitle/fontWeight', modes) || '500';
|
|
35
|
+
|
|
36
|
+
// Caption Styles
|
|
37
|
+
const captionColor = getVariableByName('threadHero/caption/color', modes) || '#5d5d61';
|
|
38
|
+
const captionFontSize = Number(getVariableByName('threadHero/caption/fontSize', modes)) || 12;
|
|
39
|
+
const captionFontFamily = getVariableByName('threadHero/caption/fontFamily', modes) || 'System';
|
|
40
|
+
const captionLineHeight = Number(getVariableByName('threadHero/caption/lineHeight', modes)) || 18;
|
|
41
|
+
const captionFontWeight = getVariableByName('threadHero/caption/fontWeight', modes) || '500';
|
|
42
|
+
|
|
43
|
+
// Styles
|
|
44
|
+
const containerStyle = {
|
|
45
|
+
flexDirection: 'column',
|
|
46
|
+
alignItems: 'center',
|
|
47
|
+
gap: containerGap,
|
|
48
|
+
...style
|
|
49
|
+
};
|
|
50
|
+
const detailsStyle = {
|
|
51
|
+
flexDirection: 'column',
|
|
52
|
+
alignItems: 'center',
|
|
53
|
+
gap: detailsGap,
|
|
54
|
+
width: '100%'
|
|
55
|
+
};
|
|
56
|
+
const titleStyle = {
|
|
57
|
+
color: titleColor,
|
|
58
|
+
fontSize: titleFontSize,
|
|
59
|
+
fontFamily: titleFontFamily,
|
|
60
|
+
lineHeight: titleLineHeight,
|
|
61
|
+
fontWeight: titleFontWeight,
|
|
62
|
+
textAlign: 'center',
|
|
63
|
+
minWidth: '100%'
|
|
64
|
+
};
|
|
65
|
+
const subtitleStyle = {
|
|
66
|
+
color: subtitleColor,
|
|
67
|
+
fontSize: subtitleFontSize,
|
|
68
|
+
fontFamily: subtitleFontFamily,
|
|
69
|
+
lineHeight: subtitleLineHeight,
|
|
70
|
+
fontWeight: subtitleFontWeight,
|
|
71
|
+
textAlign: 'center',
|
|
72
|
+
minWidth: '100%'
|
|
73
|
+
};
|
|
74
|
+
const captionStyle = {
|
|
75
|
+
color: captionColor,
|
|
76
|
+
fontSize: captionFontSize,
|
|
77
|
+
fontFamily: captionFontFamily,
|
|
78
|
+
lineHeight: captionLineHeight,
|
|
79
|
+
fontWeight: captionFontWeight,
|
|
80
|
+
textAlign: 'center',
|
|
81
|
+
width: '100%'
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
// Process Avatar Slot to inject modes
|
|
85
|
+
const avatarContent = /*#__PURE__*/isValidElement(renderAvatar) ? /*#__PURE__*/cloneElement(renderAvatar, {
|
|
86
|
+
modes
|
|
87
|
+
}) : renderAvatar;
|
|
88
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
89
|
+
style: containerStyle,
|
|
90
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
91
|
+
style: detailsStyle,
|
|
92
|
+
children: [avatarContent, title ? /*#__PURE__*/_jsx(Text, {
|
|
93
|
+
style: titleStyle,
|
|
94
|
+
children: title
|
|
95
|
+
}) : null, subtitle ? /*#__PURE__*/_jsx(Text, {
|
|
96
|
+
style: subtitleStyle,
|
|
97
|
+
numberOfLines: 1,
|
|
98
|
+
ellipsizeMode: "tail",
|
|
99
|
+
children: subtitle
|
|
100
|
+
}) : null]
|
|
101
|
+
}), caption ? /*#__PURE__*/_jsx(Text, {
|
|
102
|
+
style: captionStyle,
|
|
103
|
+
numberOfLines: 1,
|
|
104
|
+
ellipsizeMode: "tail",
|
|
105
|
+
children: caption
|
|
106
|
+
}) : null]
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=ThreadHero.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","isValidElement","cloneElement","View","Text","getVariableByName","jsx","_jsx","jsxs","_jsxs","ThreadHero","title","subtitle","caption","renderAvatar","modes","style","containerGap","Number","detailsGap","titleColor","titleFontSize","titleFontFamily","titleLineHeight","titleFontWeight","subtitleColor","subtitleFontSize","subtitleFontFamily","subtitleLineHeight","subtitleFontWeight","captionColor","captionFontSize","captionFontFamily","captionLineHeight","captionFontWeight","containerStyle","flexDirection","alignItems","gap","detailsStyle","width","titleStyle","color","fontSize","fontFamily","lineHeight","fontWeight","textAlign","minWidth","subtitleStyle","captionStyle","avatarContent","children","numberOfLines","ellipsizeMode"],"sourceRoot":"../../../../src","sources":["components/ThreadHero/ThreadHero.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,cAAc,EAAEC,YAAY,QAAwB,OAAO;AAC3E,SAASC,IAAI,EAAEC,IAAI,QAAwC,cAAc;AACzE,SAASC,iBAAiB,QAAQ,8CAA8C;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAiBhF;AACA;AACA;AACA,eAAe,SAASC,UAAUA,CAAC;EAC/BC,KAAK,GAAG,eAAe;EACvBC,QAAQ,GAAG,kCAAkC;EAC7CC,OAAO;EACPC,YAAY;EACZC,KAAK,GAAG,CAAC,CAAC;EACVC;AACa,CAAC,EAAE;EAChB;EACA,MAAMC,YAAY,GAAGC,MAAM,CAACb,iBAAiB,CAAC,gBAAgB,EAAEU,KAAK,CAAC,CAAC,IAAI,CAAC;EAC5E,MAAMI,UAAU,GAAGD,MAAM,CAACb,iBAAiB,CAAC,wBAAwB,EAAEU,KAAK,CAAC,CAAC,IAAI,CAAC;;EAElF;EACA,MAAMK,UAAU,GAAGf,iBAAiB,CAAC,wBAAwB,EAAEU,KAAK,CAAC,IAAI,SAAS;EAClF,MAAMM,aAAa,GAAGH,MAAM,CAACb,iBAAiB,CAAC,2BAA2B,EAAEU,KAAK,CAAC,CAAC,IAAI,EAAE;EACzF,MAAMO,eAAe,GAAGjB,iBAAiB,CAAC,6BAA6B,EAAEU,KAAK,CA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,UAAW;QAAAW,QAAA,EAAEzC;MAAK,CAAO,CAAC,GAAG,IAAI,EACtDC,QAAQ,gBACLL,IAAA,CAACH,IAAI;QAACY,KAAK,EAAEiC,aAAc;QAACI,aAAa,EAAE,CAAE;QAACC,aAAa,EAAC,MAAM;QAAAF,QAAA,EAC7DxC;MAAQ,CACP,CAAC,GACP,IAAI;IAAA,CACN,CAAC,EACNC,OAAO,gBACJN,IAAA,CAACH,IAAI;MAACY,KAAK,EAAEkC,YAAa;MAACG,aAAa,EAAE,CAAE;MAACC,aAAa,EAAC,MAAM;MAAAF,QAAA,EAC5DvC;IAAO,CACN,CAAC,GACP,IAAI;EAAA,CACN,CAAC;AAEf","ignoreList":[]}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Meta, Story, Canvas, PureArgsTable as ArgsTable } from '@storybook/addon-docs/blocks';
|
|
2
|
+
import * as ThreadHeroStories from './ThreadHero.stories';
|
|
3
|
+
import ThreadHero from './ThreadHero';
|
|
4
|
+
|
|
5
|
+
<Meta of={ThreadHeroStories} />
|
|
6
|
+
|
|
7
|
+
# ThreadHero
|
|
8
|
+
|
|
9
|
+
The `ThreadHero` component displays a central user identity with an avatar, title, subtitle, and an optional caption.
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## Available Collections and Modes
|
|
13
|
+
|
|
14
|
+
This component does not use any design token collections with multiple modes.
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import ThreadHero from './ThreadHero';
|
|
19
|
+
import Avatar from '../Avatar/Avatar';
|
|
20
|
+
|
|
21
|
+
<ThreadHero
|
|
22
|
+
title="Subhash Rajan"
|
|
23
|
+
subtitle="Banking name: SHIVASHANKAR RAJAN"
|
|
24
|
+
caption="+91 00000 00000"
|
|
25
|
+
renderAvatar={<Avatar size="small" initials="SR" />}
|
|
26
|
+
/>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Props
|
|
30
|
+
|
|
31
|
+
<ArgsTable of={ThreadHero} />
|
|
32
|
+
|
|
33
|
+
## Stories
|
|
34
|
+
|
|
35
|
+
### Default
|
|
36
|
+
|
|
37
|
+
<Canvas>
|
|
38
|
+
<Story of={ThreadHeroStories.Default} />
|
|
39
|
+
</Canvas>
|
|
40
|
+
|
|
41
|
+
### Without Caption
|
|
42
|
+
|
|
43
|
+
<Canvas>
|
|
44
|
+
<Story of={ThreadHeroStories.WithoutCaption} />
|
|
45
|
+
</Canvas>
|
|
46
|
+
|
|
47
|
+
## Design Tokens
|
|
48
|
+
|
|
49
|
+
This component uses the following design tokens, resolved through `getVariableByName`:
|
|
50
|
+
|
|
51
|
+
- **`threadHero/caption/color`**
|
|
52
|
+
- **`threadHero/caption/fontFamily`**
|
|
53
|
+
- **`threadHero/caption/fontSize`**
|
|
54
|
+
- **`threadHero/caption/fontWeight`**
|
|
55
|
+
- **`threadHero/caption/lineHeight`**
|
|
56
|
+
- **`threadHero/details/gap`**
|
|
57
|
+
- **`threadHero/gap`**
|
|
58
|
+
- **`threadHero/subtitle/color`**
|
|
59
|
+
- **`threadHero/subtitle/fontFamily`**
|
|
60
|
+
- **`threadHero/subtitle/fontSize`**
|
|
61
|
+
- **`threadHero/subtitle/fontWeight`**
|
|
62
|
+
- **`threadHero/subtitle/lineHeight`**
|
|
63
|
+
- **`threadHero/title/color`**
|
|
64
|
+
- **`threadHero/title/fontFamily`**
|
|
65
|
+
- **`threadHero/title/fontSize`**
|
|
66
|
+
- **`threadHero/title/fontWeight`**
|
|
67
|
+
- **`threadHero/title/lineHeight`**
|
|
68
|
+
|
|
69
|
+
All tokens support mode-based theming through the `modes` prop.
|
|
@@ -0,0 +1,96 @@
|
|
|
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 MoneyValue from '../MoneyValue/MoneyValue';
|
|
7
|
+
import NavArrow from '../NavArrow/NavArrow';
|
|
8
|
+
import TransactionStatus from '../TransactionStatus/TransactionStatus';
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
/**
|
|
11
|
+
* TransactionBubble component displaying transaction details in a bubble card.
|
|
12
|
+
*
|
|
13
|
+
* @component
|
|
14
|
+
*/
|
|
15
|
+
export default function TransactionBubble({
|
|
16
|
+
description = 'Payment to Uber India',
|
|
17
|
+
amount = '56',
|
|
18
|
+
currency = '₹',
|
|
19
|
+
status = 'Expired',
|
|
20
|
+
statusDate = '20 Mar 2025',
|
|
21
|
+
modes = {},
|
|
22
|
+
style
|
|
23
|
+
}) {
|
|
24
|
+
// --- Container Tokens ---
|
|
25
|
+
const backgroundColor = getVariableByName('transactionBubble/background', modes) || '#ffffff';
|
|
26
|
+
const borderColor = getVariableByName('transactionBubble/border/color', modes) || '#e5e5e5';
|
|
27
|
+
const borderWidth = Number(getVariableByName('transactionBubble/border/size', modes)) || 1;
|
|
28
|
+
const borderRadius = Number(getVariableByName('transactionBubble/radius', modes)) || 23;
|
|
29
|
+
const padding = Number(getVariableByName('transactionBubble/padding', modes)) || 16;
|
|
30
|
+
const gap = Number(getVariableByName('transactionBubble/gap', modes)) || 8;
|
|
31
|
+
|
|
32
|
+
// --- Description Tokens ---
|
|
33
|
+
const descColor = getVariableByName('transactionBubble/description/color', modes) || '#24262b';
|
|
34
|
+
const descFontSize = Number(getVariableByName('transactionBubble/description/fontSize', modes)) || 14;
|
|
35
|
+
const descLineHeight = Number(getVariableByName('transactionBubble/description/lineHeight', modes)) || 17;
|
|
36
|
+
const descFontFamily = getVariableByName('transactionBubble/description/fontFamily', modes) || 'System';
|
|
37
|
+
|
|
38
|
+
// --- Status Row Tokens ---
|
|
39
|
+
// Status wrapping gap from TransactionBubble definition for the row container
|
|
40
|
+
const statusHeight = Number(getVariableByName('transactionBubble/statusWrap/height', modes)) || 18;
|
|
41
|
+
const containerStyle = {
|
|
42
|
+
backgroundColor,
|
|
43
|
+
borderColor,
|
|
44
|
+
borderWidth,
|
|
45
|
+
borderRadius,
|
|
46
|
+
padding,
|
|
47
|
+
gap,
|
|
48
|
+
alignItems: 'flex-start',
|
|
49
|
+
width: 231,
|
|
50
|
+
// Fixed width from design or prop? Design shows w-[231px]. We can make it auto or fixed. Let's respect style prop.
|
|
51
|
+
...style
|
|
52
|
+
};
|
|
53
|
+
const descriptionStyle = {
|
|
54
|
+
color: descColor,
|
|
55
|
+
fontSize: descFontSize,
|
|
56
|
+
lineHeight: descLineHeight,
|
|
57
|
+
fontFamily: descFontFamily,
|
|
58
|
+
fontWeight: '500' // Hardcoded in design as 'Medium' -> 500
|
|
59
|
+
};
|
|
60
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
61
|
+
style: containerStyle,
|
|
62
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
63
|
+
style: {
|
|
64
|
+
gap: 8,
|
|
65
|
+
width: '100%'
|
|
66
|
+
},
|
|
67
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
68
|
+
style: descriptionStyle,
|
|
69
|
+
numberOfLines: 1,
|
|
70
|
+
ellipsizeMode: "tail",
|
|
71
|
+
children: description
|
|
72
|
+
}), /*#__PURE__*/_jsx(MoneyValue, {
|
|
73
|
+
value: amount,
|
|
74
|
+
currency: currency,
|
|
75
|
+
modes: modes
|
|
76
|
+
})]
|
|
77
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
78
|
+
style: {
|
|
79
|
+
flexDirection: 'row',
|
|
80
|
+
alignItems: 'center',
|
|
81
|
+
justifyContent: 'space-between',
|
|
82
|
+
width: '100%',
|
|
83
|
+
height: statusHeight // Enforce height from design
|
|
84
|
+
},
|
|
85
|
+
children: [/*#__PURE__*/_jsx(TransactionStatus, {
|
|
86
|
+
status: status,
|
|
87
|
+
date: statusDate,
|
|
88
|
+
modes: modes
|
|
89
|
+
}), /*#__PURE__*/_jsx(NavArrow, {
|
|
90
|
+
direction: "Forward",
|
|
91
|
+
modes: modes
|
|
92
|
+
})]
|
|
93
|
+
})]
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=TransactionBubble.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","Text","getVariableByName","MoneyValue","NavArrow","TransactionStatus","jsx","_jsx","jsxs","_jsxs","TransactionBubble","description","amount","currency","status","statusDate","modes","style","backgroundColor","borderColor","borderWidth","Number","borderRadius","padding","gap","descColor","descFontSize","descLineHeight","descFontFamily","statusHeight","containerStyle","alignItems","width","descriptionStyle","color","fontSize","lineHeight","fontFamily","fontWeight","children","numberOfLines","ellipsizeMode","value","flexDirection","justifyContent","height","date","direction"],"sourceRoot":"../../../../src","sources":["components/TransactionBubble/TransactionBubble.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,QAAwC,cAAc;AACzE,SAASC,iBAAiB,QAAQ,8CAA8C;AAChF,OAAOC,UAAU,MAAM,0BAA0B;AACjD,OAAOC,QAAQ,MAAM,sBAAsB;AAC3C,OAAOC,iBAAiB,MAAM,wCAAwC;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAmBtE;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,iBAAiBA,CAAC;EACtCC,WAAW,GAAG,uBAAuB;EACrCC,MAAM,GAAG,IAAI;EACbC,QAAQ,GAAG,GAAG;EACdC,MAAM,GAAG,SAAS;EAClBC,UAAU,GAAG,aAAa;EAC1BC,KAAK,GAAG,CAAC,CAAC;EACVC;AACoB,CAAC,EAAE;EACvB;EACA,MAAMC,eAAe,GAAGhB,iBAAiB,CAAC,8BAA8B,EAAEc,KAAK,CAAC,IAAI,SAAS;EAC7F,MAAMG,WAAW,GAAGjB,iBAAiB,CAAC,gCAAgC,EAAEc,KAAK,CAAC,IAAI,SAAS;EAC3F,MAAMI,WAAW,GAAGC,MAAM,CAACnB,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AI;IAACiB,KAAK,EAAEa,cAAe;IAAAS,QAAA,gBAExB9B,KAAA,CAACT,IAAI;MAACiB,KAAK,EAAE;QAAEO,GAAG,EAAE,CAAC;QAAEQ,KAAK,EAAE;MAAO,CAAE;MAAAO,QAAA,gBACnChC,IAAA,CAACN,IAAI;QAACgB,KAAK,EAAEgB,gBAAiB;QAACO,aAAa,EAAE,CAAE;QAACC,aAAa,EAAC,MAAM;QAAAF,QAAA,EAChE5B;MAAW,CACV,CAAC,eAEPJ,IAAA,CAACJ,UAAU;QACPuC,KAAK,EAAE9B,MAAO;QACdC,QAAQ,EAAEA,QAAS;QACnBG,KAAK,EAAEA;MAAM,CAChB,CAAC;IAAA,CACA,CAAC,eAGPP,KAAA,CAACT,IAAI;MAACiB,KAAK,EAAE;QACT0B,aAAa,EAAE,KAAK;QACpBZ,UAAU,EAAE,QAAQ;QACpBa,cAAc,EAAE,eAAe;QAC/BZ,KAAK,EAAE,MAAM;QACba,MAAM,EAAEhB,YAAY,CAAE;MAC1B,CAAE;MAAAU,QAAA,gBACEhC,IAAA,CAACF,iBAAiB;QACdS,MAAM,EAAEA,MAAO;QACfgC,IAAI,EAAE/B,UAAW;QACjBC,KAAK,EAAEA;MAAM,CAChB,CAAC,eAEFT,IAAA,CAACH,QAAQ;QACL2C,SAAS,EAAC,SAAS;QACnB/B,KAAK,EAAEA;MAAM,CAChB,CAAC;IAAA,CACA,CAAC;EAAA,CACL,CAAC;AAEf","ignoreList":[]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Meta, Story, Canvas, PureArgsTable as ArgsTable } from '@storybook/addon-docs/blocks';
|
|
2
|
+
import * as TransactionBubbleStories from './TransactionBubble.stories';
|
|
3
|
+
import TransactionBubble from './TransactionBubble';
|
|
4
|
+
|
|
5
|
+
<Meta of={TransactionBubbleStories} />
|
|
6
|
+
|
|
7
|
+
# TransactionBubble
|
|
8
|
+
|
|
9
|
+
TransactionBubble component with design-token-driven styling.
|
|
10
|
+
|
|
11
|
+
## Available Collections and Modes
|
|
12
|
+
|
|
13
|
+
This component does not use any design token collections with multiple modes.
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
<Canvas>
|
|
17
|
+
<Story of={TransactionBubbleStories.Default} />
|
|
18
|
+
</Canvas>
|
|
19
|
+
|
|
20
|
+
## Props
|
|
21
|
+
|
|
22
|
+
<ArgsTable of={TransactionBubble} />
|
|
23
|
+
|
|
24
|
+
## Design Tokens
|
|
25
|
+
|
|
26
|
+
This component uses the following design tokens, resolved through `getVariableByName`:
|
|
27
|
+
|
|
28
|
+
- **`transactionBubble/background`**
|
|
29
|
+
- **`transactionBubble/border/color`**
|
|
30
|
+
- **`transactionBubble/border/size`**
|
|
31
|
+
- **`transactionBubble/description/color`**
|
|
32
|
+
- **`transactionBubble/description/fontFamily`**
|
|
33
|
+
- **`transactionBubble/description/fontSize`**
|
|
34
|
+
- **`transactionBubble/description/lineHeight`**
|
|
35
|
+
- **`transactionBubble/gap`**
|
|
36
|
+
- **`transactionBubble/padding`**
|
|
37
|
+
- **`transactionBubble/radius`**
|
|
38
|
+
- **`transactionBubble/statusWrap/height`**
|
|
39
|
+
|
|
40
|
+
All tokens support mode-based theming through the `modes` prop.
|