jfs-components 0.0.78 → 0.0.79
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/CHANGELOG.md +11 -0
- package/lib/commonjs/components/Attached/Attached.js +144 -0
- package/lib/commonjs/components/Card/Card.js +25 -2
- package/lib/commonjs/components/FullscreenModal/FullscreenModal.js +4 -6
- package/lib/commonjs/components/ListItem/ListItem.js +22 -15
- package/lib/commonjs/components/PlanComparisonCard/PlanComparisonCard.js +328 -0
- package/lib/commonjs/components/Slot/Slot.js +73 -0
- package/lib/commonjs/components/index.js +21 -0
- package/lib/commonjs/icons/registry.js +1 -1
- package/lib/module/components/Attached/Attached.js +139 -0
- package/lib/module/components/Card/Card.js +25 -2
- package/lib/module/components/FullscreenModal/FullscreenModal.js +4 -6
- package/lib/module/components/ListItem/ListItem.js +22 -15
- package/lib/module/components/PlanComparisonCard/PlanComparisonCard.js +322 -0
- package/lib/module/components/Slot/Slot.js +68 -0
- package/lib/module/components/index.js +3 -0
- package/lib/module/icons/registry.js +1 -1
- package/lib/typescript/src/components/Attached/Attached.d.ts +61 -0
- package/lib/typescript/src/components/Card/Card.d.ts +9 -2
- package/lib/typescript/src/components/ListItem/ListItem.d.ts +15 -5
- package/lib/typescript/src/components/PlanComparisonCard/PlanComparisonCard.d.ts +64 -0
- package/lib/typescript/src/components/Slot/Slot.d.ts +52 -0
- package/lib/typescript/src/components/index.d.ts +3 -0
- package/lib/typescript/src/icons/registry.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/Attached/Attached.tsx +181 -0
- package/src/components/Card/Card.tsx +28 -1
- package/src/components/FullscreenModal/FullscreenModal.tsx +3 -3
- package/src/components/ListItem/ListItem.tsx +35 -16
- package/src/components/PlanComparisonCard/PlanComparisonCard.tsx +426 -0
- package/src/components/Slot/Slot.tsx +91 -0
- package/src/components/index.ts +3 -0
- package/src/icons/registry.ts +1 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useMemo } from 'react';
|
|
4
|
+
import { View } from 'react-native';
|
|
5
|
+
import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
|
|
6
|
+
import { useTokens } from '../../design-tokens/JFSThemeProvider';
|
|
7
|
+
import { cloneChildrenWithModes, EMPTY_MODES } from '../../utils/react-utils';
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
/**
|
|
10
|
+
* Slot — a token-driven layout container for grouped slot content.
|
|
11
|
+
*
|
|
12
|
+
* Use `Slot` instead of a raw `View` when you need a vertical or horizontal
|
|
13
|
+
* stack with design-token gap spacing and automatic `modes` propagation to
|
|
14
|
+
* children. Typical usage is nesting a column of actions inside a
|
|
15
|
+
* direction-locked parent such as `ActionFooter`:
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <ActionFooter modes={modes}>
|
|
20
|
+
* <Slot layoutDirection="vertical" modes={modes}>
|
|
21
|
+
* <Button label="Continue" modes={primaryModes} />
|
|
22
|
+
* <Disclaimer disclaimer="Terms apply." modes={modes} />
|
|
23
|
+
* </Slot>
|
|
24
|
+
* </ActionFooter>
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
function Slot({
|
|
28
|
+
children,
|
|
29
|
+
layoutDirection = 'vertical',
|
|
30
|
+
alignCrossAxis,
|
|
31
|
+
justifyMainAxis,
|
|
32
|
+
modes: propModes = EMPTY_MODES,
|
|
33
|
+
style,
|
|
34
|
+
...rest
|
|
35
|
+
}) {
|
|
36
|
+
const {
|
|
37
|
+
modes: globalModes
|
|
38
|
+
} = useTokens();
|
|
39
|
+
const modes = useMemo(() => ({
|
|
40
|
+
...globalModes,
|
|
41
|
+
...propModes
|
|
42
|
+
}), [globalModes, propModes]);
|
|
43
|
+
const {
|
|
44
|
+
containerStyle,
|
|
45
|
+
processedChildren
|
|
46
|
+
} = useMemo(() => {
|
|
47
|
+
const gap = getVariableByName('slot/gap', modes) ?? 8;
|
|
48
|
+
const isHorizontal = layoutDirection === 'horizontal';
|
|
49
|
+
const container = {
|
|
50
|
+
flexDirection: isHorizontal ? 'row' : 'column',
|
|
51
|
+
alignItems: alignCrossAxis ?? (isHorizontal ? 'flex-start' : 'stretch'),
|
|
52
|
+
justifyContent: justifyMainAxis ?? (isHorizontal ? 'center' : undefined),
|
|
53
|
+
alignSelf: 'stretch',
|
|
54
|
+
gap
|
|
55
|
+
};
|
|
56
|
+
const processed = children ? cloneChildrenWithModes(children, modes) : null;
|
|
57
|
+
return {
|
|
58
|
+
containerStyle: container,
|
|
59
|
+
processedChildren: processed
|
|
60
|
+
};
|
|
61
|
+
}, [children, modes, layoutDirection, alignCrossAxis, justifyMainAxis]);
|
|
62
|
+
return /*#__PURE__*/_jsx(View, {
|
|
63
|
+
style: [containerStyle, style],
|
|
64
|
+
...rest,
|
|
65
|
+
children: processedChildren
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
export default /*#__PURE__*/React.memo(Slot);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
export { default as AccountCard } from './AccountCard/AccountCard';
|
|
4
4
|
export { default as ActionFooter } from './ActionFooter/ActionFooter';
|
|
5
|
+
export { default as Attached } from './Attached/Attached';
|
|
5
6
|
export { default as AppBar } from './AppBar/AppBar';
|
|
6
7
|
export { default as Avatar } from './Avatar/Avatar';
|
|
7
8
|
export { default as AvatarGroup } from './AvatarGroup/AvatarGroup';
|
|
@@ -64,6 +65,7 @@ export { default as Numpad } from './Numpad/Numpad';
|
|
|
64
65
|
export { default as Title } from './Title/Title';
|
|
65
66
|
export { default as Screen } from './Screen/Screen';
|
|
66
67
|
export { default as Section } from './Section/Section';
|
|
68
|
+
export { default as Slot } from './Slot/Slot';
|
|
67
69
|
export { default as Stepper } from './Stepper/Stepper';
|
|
68
70
|
export { Step } from './Stepper/Step';
|
|
69
71
|
export { StepLabel } from './Stepper/StepLabel';
|
|
@@ -111,6 +113,7 @@ export { default as AmountInput } from './AmountInput/AmountInput';
|
|
|
111
113
|
export { default as PageHero } from './PageHero/PageHero';
|
|
112
114
|
export { default as Popup } from './Popup/Popup';
|
|
113
115
|
export { default as PortfolioHero } from './PortfolioHero/PortfolioHero';
|
|
116
|
+
export { default as PlanComparisonCard } from './PlanComparisonCard/PlanComparisonCard';
|
|
114
117
|
export { default as PoweredByLabel } from './PoweredByLabel/PoweredByLabel';
|
|
115
118
|
export { default as ProductLabel } from './ProductLabel/ProductLabel';
|
|
116
119
|
export { default as ProductOverview } from './ProductOverview/ProductOverview';
|