jfs-components 0.0.6 → 0.0.7
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.mdx +1 -1
- package/lib/commonjs/components/ActionFooter/ActionFooter.js +2 -14
- package/lib/commonjs/components/ActionFooter/ActionFooter.js.map +1 -1
- package/lib/commonjs/components/ActionFooter/ActionFooter.mdx +1 -1
- package/lib/commonjs/components/ActionTile/ActionTile.mdx +5 -1
- package/lib/commonjs/components/AppBar/AppBar.js +100 -238
- package/lib/commonjs/components/AppBar/AppBar.js.map +1 -1
- package/lib/commonjs/components/AppBar/AppBar.mdx +51 -39
- package/lib/commonjs/components/Avatar/Avatar.mdx +9 -1
- package/lib/commonjs/components/AvatarGroup/AvatarGroup.mdx +9 -1
- package/lib/commonjs/components/Badge/Badge.mdx +1 -1
- package/lib/commonjs/components/Balance/Balance.js +77 -0
- package/lib/commonjs/components/Balance/Balance.js.map +1 -0
- package/lib/commonjs/components/Balance/Balance.mdx +62 -0
- package/lib/commonjs/components/BottomNav/BottomNav.mdx +5 -1
- package/lib/commonjs/components/BottomNavItem/BottomNavItem.mdx +5 -1
- package/lib/commonjs/components/Button/Button.mdx +5 -1
- package/lib/commonjs/components/ButtonGroup/ButtonGroup.js +64 -0
- package/lib/commonjs/components/ButtonGroup/ButtonGroup.js.map +1 -0
- package/lib/commonjs/components/ButtonGroup/ButtonGroup.mdx +56 -0
- package/lib/commonjs/components/Card/Card.mdx +1 -1
- package/lib/commonjs/components/CardFeedback/CardFeedback.mdx +5 -1
- package/lib/commonjs/components/ChipGroup/ChipGroup.js +54 -0
- package/lib/commonjs/components/ChipGroup/ChipGroup.js.map +1 -0
- package/lib/commonjs/components/ChipGroup/ChipGroup.mdx +40 -0
- package/lib/commonjs/components/ChipSelect/ChipSelect.js +103 -0
- package/lib/commonjs/components/ChipSelect/ChipSelect.js.map +1 -0
- package/lib/commonjs/components/ChipSelect/ChipSelect.mdx +80 -0
- package/lib/commonjs/components/CtaCard/CtaCard.js +5 -18
- package/lib/commonjs/components/CtaCard/CtaCard.js.map +1 -1
- package/lib/commonjs/components/CtaCard/CtaCard.mdx +1 -1
- package/lib/commonjs/components/Disclaimer/Disclaimer.mdx +5 -1
- package/lib/commonjs/components/Divider/Divider.mdx +5 -1
- package/lib/commonjs/components/Drawer/Drawer.mdx +9 -1
- package/lib/commonjs/components/EmptyState/EmptyState.js +138 -0
- package/lib/commonjs/components/EmptyState/EmptyState.js.map +1 -0
- package/lib/commonjs/components/EmptyState/EmptyState.mdx +73 -0
- package/lib/commonjs/components/FilterBar/FilterBar.mdx +1 -1
- package/lib/commonjs/components/HStack/HStack.js +67 -0
- package/lib/commonjs/components/HStack/HStack.js.map +1 -0
- package/lib/commonjs/components/HStack/HStack.mdx +44 -0
- package/lib/commonjs/components/IconButton/IconButton.mdx +5 -1
- package/lib/commonjs/components/IconCapsule/IconCapsule.js +3 -3
- package/lib/commonjs/components/IconCapsule/IconCapsule.js.map +1 -1
- package/lib/commonjs/components/IconCapsule/IconCapsule.mdx +12 -4
- package/lib/commonjs/components/Introduction.mdx +3 -98
- package/lib/commonjs/components/LazyList/LazyList.mdx +1 -1
- package/lib/commonjs/components/ListGroup/ListGroup.js +3 -30
- package/lib/commonjs/components/ListGroup/ListGroup.js.map +1 -1
- package/lib/commonjs/components/ListGroup/ListGroup.mdx +5 -1
- package/lib/commonjs/components/ListItem/ListItem.js +5 -37
- package/lib/commonjs/components/ListItem/ListItem.js.map +1 -1
- package/lib/commonjs/components/ListItem/ListItem.mdx +5 -1
- package/lib/commonjs/components/MediaCard/MediaCard.mdx +5 -1
- package/lib/commonjs/components/MerchantProfile/MerchantProfile.mdx +1 -1
- package/lib/commonjs/components/MoneyValue/MoneyValue.mdx +6 -2
- package/lib/commonjs/components/NavArrow/NavArrow.js +42 -17
- package/lib/commonjs/components/NavArrow/NavArrow.js.map +1 -1
- package/lib/commonjs/components/NavArrow/NavArrow.mdx +5 -1
- package/lib/commonjs/components/PageTitle/PageTitle.mdx +5 -1
- package/lib/commonjs/components/Screen/Screen.js +53 -0
- package/lib/commonjs/components/Screen/Screen.js.map +1 -0
- package/lib/commonjs/components/Screen/Screen.mdx +58 -0
- package/lib/commonjs/components/Section/Section.js +3 -25
- package/lib/commonjs/components/Section/Section.js.map +1 -1
- package/lib/commonjs/components/Section/Section.mdx +5 -1
- package/lib/commonjs/components/Stepper/Step.mdx +5 -1
- package/lib/commonjs/components/Stepper/StepLabel.mdx +5 -1
- package/lib/commonjs/components/Stepper/Stepper.mdx +1 -1
- package/lib/commonjs/components/SupportText/SupportText.js +83 -0
- package/lib/commonjs/components/SupportText/SupportText.js.map +1 -0
- package/lib/commonjs/components/SupportText/SupportText.mdx +48 -0
- package/lib/commonjs/components/SupportText/SupportTextIcon.js +47 -0
- package/lib/commonjs/components/SupportText/SupportTextIcon.js.map +1 -0
- package/lib/commonjs/components/SupportText/SupportTextIcon.mdx +35 -0
- package/lib/commonjs/components/SupportText/index.js +21 -0
- package/lib/commonjs/components/SupportText/index.js.map +1 -0
- package/lib/commonjs/components/TextInput/TextInput.mdx +9 -1
- package/lib/commonjs/components/ThreadHero/ThreadHero.mdx +1 -1
- package/lib/commonjs/components/Tooltip/Tooltip.mdx +5 -1
- package/lib/commonjs/components/TransactionBubble/TransactionBubble.mdx +1 -1
- package/lib/commonjs/components/TransactionDetails/TransactionDetails.js +2 -24
- package/lib/commonjs/components/TransactionDetails/TransactionDetails.js.map +1 -1
- package/lib/commonjs/components/TransactionDetails/TransactionDetails.mdx +1 -1
- package/lib/commonjs/components/TransactionStatus/TransactionStatus.mdx +1 -1
- package/lib/commonjs/components/UpiHandle/UpiHandle.mdx +5 -1
- package/lib/commonjs/components/VStack/VStack.js +73 -0
- package/lib/commonjs/components/VStack/VStack.js.map +1 -0
- package/lib/commonjs/components/VStack/VStack.mdx +44 -0
- package/lib/commonjs/components/index.js +28 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/design-tokens/JFS Variables-variables-full.json +1 -18633
- package/lib/commonjs/design-tokens/figma-variables-resolver.js +3 -9
- package/lib/commonjs/design-tokens/figma-variables-resolver.js.map +1 -2
- package/lib/commonjs/icons/ic_info.svg +1 -0
- package/lib/commonjs/icons/ic_warning.svg +1 -0
- package/lib/commonjs/icons/registry.js +2 -2
- package/lib/commonjs/icons/registry.js.map +1 -1
- package/lib/commonjs/utils/react-utils.js +47 -0
- package/lib/commonjs/utils/react-utils.js.map +1 -0
- package/lib/module/components/Accordion/Accordion.mdx +1 -1
- package/lib/module/components/ActionFooter/ActionFooter.js +2 -14
- package/lib/module/components/ActionFooter/ActionFooter.js.map +1 -1
- package/lib/module/components/ActionFooter/ActionFooter.mdx +1 -1
- package/lib/module/components/ActionTile/ActionTile.mdx +5 -1
- package/lib/module/components/AppBar/AppBar.js +100 -238
- package/lib/module/components/AppBar/AppBar.js.map +1 -1
- package/lib/module/components/AppBar/AppBar.mdx +51 -39
- package/lib/module/components/Avatar/Avatar.mdx +9 -1
- package/lib/module/components/AvatarGroup/AvatarGroup.mdx +9 -1
- package/lib/module/components/Badge/Badge.mdx +1 -1
- package/lib/module/components/Balance/Balance.js +72 -0
- package/lib/module/components/Balance/Balance.js.map +1 -0
- package/lib/module/components/Balance/Balance.mdx +62 -0
- package/lib/module/components/BottomNav/BottomNav.mdx +5 -1
- package/lib/module/components/BottomNavItem/BottomNavItem.mdx +5 -1
- package/lib/module/components/Button/Button.mdx +5 -1
- package/lib/module/components/ButtonGroup/ButtonGroup.js +59 -0
- package/lib/module/components/ButtonGroup/ButtonGroup.js.map +1 -0
- package/lib/module/components/ButtonGroup/ButtonGroup.mdx +56 -0
- package/lib/module/components/Card/Card.mdx +1 -1
- package/lib/module/components/CardFeedback/CardFeedback.mdx +5 -1
- package/lib/module/components/ChipGroup/ChipGroup.js +49 -0
- package/lib/module/components/ChipGroup/ChipGroup.js.map +1 -0
- package/lib/module/components/ChipGroup/ChipGroup.mdx +40 -0
- package/lib/module/components/ChipSelect/ChipSelect.js +98 -0
- package/lib/module/components/ChipSelect/ChipSelect.js.map +1 -0
- package/lib/module/components/ChipSelect/ChipSelect.mdx +80 -0
- package/lib/module/components/CtaCard/CtaCard.js +5 -18
- package/lib/module/components/CtaCard/CtaCard.js.map +1 -1
- package/lib/module/components/CtaCard/CtaCard.mdx +1 -1
- package/lib/module/components/Disclaimer/Disclaimer.mdx +5 -1
- package/lib/module/components/Divider/Divider.mdx +5 -1
- package/lib/module/components/Drawer/Drawer.mdx +9 -1
- package/lib/module/components/EmptyState/EmptyState.js +132 -0
- package/lib/module/components/EmptyState/EmptyState.js.map +1 -0
- package/lib/module/components/EmptyState/EmptyState.mdx +73 -0
- package/lib/module/components/FilterBar/FilterBar.mdx +1 -1
- package/lib/module/components/HStack/HStack.js +61 -0
- package/lib/module/components/HStack/HStack.js.map +1 -0
- package/lib/module/components/HStack/HStack.mdx +44 -0
- package/lib/module/components/IconButton/IconButton.mdx +5 -1
- package/lib/module/components/IconCapsule/IconCapsule.js +3 -3
- package/lib/module/components/IconCapsule/IconCapsule.js.map +1 -1
- package/lib/module/components/IconCapsule/IconCapsule.mdx +12 -4
- package/lib/module/components/Introduction.mdx +3 -98
- package/lib/module/components/LazyList/LazyList.mdx +1 -1
- package/lib/module/components/ListGroup/ListGroup.js +1 -30
- package/lib/module/components/ListGroup/ListGroup.js.map +1 -1
- package/lib/module/components/ListGroup/ListGroup.mdx +5 -1
- package/lib/module/components/ListItem/ListItem.js +1 -35
- package/lib/module/components/ListItem/ListItem.js.map +1 -1
- package/lib/module/components/ListItem/ListItem.mdx +5 -1
- package/lib/module/components/MediaCard/MediaCard.mdx +5 -1
- package/lib/module/components/MerchantProfile/MerchantProfile.mdx +1 -1
- package/lib/module/components/MoneyValue/MoneyValue.mdx +6 -2
- package/lib/module/components/NavArrow/NavArrow.js +42 -17
- package/lib/module/components/NavArrow/NavArrow.js.map +1 -1
- package/lib/module/components/NavArrow/NavArrow.mdx +5 -1
- package/lib/module/components/PageTitle/PageTitle.mdx +5 -1
- package/lib/module/components/Screen/Screen.js +47 -0
- package/lib/module/components/Screen/Screen.js.map +1 -0
- package/lib/module/components/Screen/Screen.mdx +58 -0
- package/lib/module/components/Section/Section.js +1 -23
- package/lib/module/components/Section/Section.js.map +1 -1
- package/lib/module/components/Section/Section.mdx +5 -1
- package/lib/module/components/Stepper/Step.mdx +5 -1
- package/lib/module/components/Stepper/StepLabel.mdx +5 -1
- package/lib/module/components/Stepper/Stepper.mdx +1 -1
- package/lib/module/components/SupportText/SupportText.js +78 -0
- package/lib/module/components/SupportText/SupportText.js.map +1 -0
- package/lib/module/components/SupportText/SupportText.mdx +48 -0
- package/lib/module/components/SupportText/SupportTextIcon.js +42 -0
- package/lib/module/components/SupportText/SupportTextIcon.js.map +1 -0
- package/lib/module/components/SupportText/SupportTextIcon.mdx +35 -0
- package/lib/module/components/SupportText/index.js +5 -0
- package/lib/module/components/SupportText/index.js.map +1 -0
- package/lib/module/components/TextInput/TextInput.mdx +9 -1
- package/lib/module/components/ThreadHero/ThreadHero.mdx +1 -1
- package/lib/module/components/Tooltip/Tooltip.mdx +5 -1
- package/lib/module/components/TransactionBubble/TransactionBubble.mdx +1 -1
- package/lib/module/components/TransactionDetails/TransactionDetails.js +2 -26
- package/lib/module/components/TransactionDetails/TransactionDetails.js.map +1 -1
- package/lib/module/components/TransactionDetails/TransactionDetails.mdx +1 -1
- package/lib/module/components/TransactionStatus/TransactionStatus.mdx +1 -1
- package/lib/module/components/UpiHandle/UpiHandle.mdx +5 -1
- package/lib/module/components/VStack/VStack.js +67 -0
- package/lib/module/components/VStack/VStack.js.map +1 -0
- package/lib/module/components/VStack/VStack.mdx +44 -0
- package/lib/module/components/index.js +4 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/design-tokens/JFS Variables-variables-full.json +1 -18633
- package/lib/module/design-tokens/figma-variables-resolver.js +2 -2
- package/lib/module/design-tokens/figma-variables-resolver.js.map +0 -1
- package/lib/module/icons/ic_info.svg +1 -0
- package/lib/module/icons/ic_warning.svg +1 -0
- package/lib/module/icons/registry.js +2 -2
- package/lib/module/icons/registry.js.map +1 -1
- package/lib/module/utils/react-utils.js +43 -0
- package/lib/module/utils/react-utils.js.map +1 -0
- package/lib/typescript/components/ActionFooter/ActionFooter.d.ts.map +1 -1
- package/lib/typescript/components/AppBar/AppBar.d.ts +34 -68
- package/lib/typescript/components/AppBar/AppBar.d.ts.map +1 -1
- package/lib/typescript/components/Balance/Balance.d.ts +44 -0
- package/lib/typescript/components/Balance/Balance.d.ts.map +1 -0
- package/lib/typescript/components/ButtonGroup/ButtonGroup.d.ts +36 -0
- package/lib/typescript/components/ButtonGroup/ButtonGroup.d.ts.map +1 -0
- package/lib/typescript/components/ChipGroup/ChipGroup.d.ts +29 -0
- package/lib/typescript/components/ChipGroup/ChipGroup.d.ts.map +1 -0
- package/lib/typescript/components/ChipSelect/ChipSelect.d.ts +47 -0
- package/lib/typescript/components/ChipSelect/ChipSelect.d.ts.map +1 -0
- package/lib/typescript/components/CtaCard/CtaCard.d.ts.map +1 -1
- package/lib/typescript/components/EmptyState/EmptyState.d.ts +38 -0
- package/lib/typescript/components/EmptyState/EmptyState.d.ts.map +1 -0
- package/lib/typescript/components/HStack/HStack.d.ts +41 -0
- package/lib/typescript/components/HStack/HStack.d.ts.map +1 -0
- package/lib/typescript/components/ListGroup/ListGroup.d.ts.map +1 -1
- package/lib/typescript/components/ListItem/ListItem.d.ts.map +1 -1
- package/lib/typescript/components/NavArrow/NavArrow.d.ts +3 -3
- package/lib/typescript/components/NavArrow/NavArrow.d.ts.map +1 -1
- package/lib/typescript/components/Screen/Screen.d.ts +23 -0
- package/lib/typescript/components/Screen/Screen.d.ts.map +1 -0
- package/lib/typescript/components/Section/Section.d.ts.map +1 -1
- package/lib/typescript/components/SupportText/SupportText.d.ts +34 -0
- package/lib/typescript/components/SupportText/SupportText.d.ts.map +1 -0
- package/lib/typescript/components/SupportText/SupportTextIcon.d.ts +10 -0
- package/lib/typescript/components/SupportText/SupportTextIcon.d.ts.map +1 -0
- package/lib/typescript/components/SupportText/index.d.ts +3 -0
- package/lib/typescript/components/SupportText/index.d.ts.map +1 -0
- package/lib/typescript/components/TransactionDetails/TransactionDetails.d.ts.map +1 -1
- package/lib/typescript/components/VStack/VStack.d.ts +41 -0
- package/lib/typescript/components/VStack/VStack.d.ts.map +1 -0
- package/lib/typescript/components/index.d.ts +4 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/icons/registry.d.ts +1 -1
- package/lib/typescript/icons/registry.d.ts.map +1 -1
- package/lib/typescript/utils/react-utils.d.ts +7 -0
- package/lib/typescript/utils/react-utils.d.ts.map +1 -0
- package/package.json +7 -5
- package/src/components/.token-metadata.json +468 -12
- package/src/components/Accordion/Accordion.mdx +1 -1
- package/src/components/ActionFooter/ActionFooter.mdx +1 -1
- package/src/components/ActionFooter/ActionFooter.tsx +3 -12
- package/src/components/ActionTile/ActionTile.mdx +5 -1
- package/src/components/AppBar/AppBar.mdx +51 -39
- package/src/components/AppBar/AppBar.tsx +140 -261
- package/src/components/Avatar/Avatar.mdx +9 -1
- package/src/components/AvatarGroup/AvatarGroup.mdx +9 -1
- package/src/components/Badge/Badge.mdx +1 -1
- package/src/components/Balance/Balance.mdx +62 -0
- package/src/components/Balance/Balance.tsx +107 -0
- package/src/components/BottomNav/BottomNav.mdx +5 -1
- package/src/components/BottomNavItem/BottomNavItem.mdx +5 -1
- package/src/components/Button/Button.mdx +5 -1
- package/src/components/ButtonGroup/ButtonGroup.mdx +56 -0
- package/src/components/ButtonGroup/ButtonGroup.tsx +78 -0
- package/src/components/Card/Card.mdx +1 -1
- package/src/components/CardFeedback/CardFeedback.mdx +5 -1
- package/src/components/ChipGroup/ChipGroup.mdx +40 -0
- package/src/components/ChipGroup/ChipGroup.tsx +67 -0
- package/src/components/ChipSelect/ChipSelect.mdx +80 -0
- package/src/components/ChipSelect/ChipSelect.tsx +138 -0
- package/src/components/CtaCard/CtaCard.mdx +1 -1
- package/src/components/CtaCard/CtaCard.tsx +12 -20
- package/src/components/Disclaimer/Disclaimer.mdx +5 -1
- package/src/components/Divider/Divider.mdx +5 -1
- package/src/components/Drawer/Drawer.mdx +9 -1
- package/src/components/EmptyState/EmptyState.mdx +73 -0
- package/src/components/EmptyState/EmptyState.tsx +181 -0
- package/src/components/FilterBar/FilterBar.mdx +1 -1
- package/src/components/HStack/HStack.mdx +44 -0
- package/src/components/HStack/HStack.tsx +95 -0
- package/src/components/IconButton/IconButton.mdx +5 -1
- package/src/components/IconCapsule/IconCapsule.mdx +12 -4
- package/src/components/IconCapsule/IconCapsule.tsx +3 -3
- package/src/components/Introduction.mdx +3 -98
- package/src/components/LazyList/LazyList.mdx +1 -1
- package/src/components/ListGroup/ListGroup.mdx +5 -1
- package/src/components/ListGroup/ListGroup.tsx +5 -43
- package/src/components/ListItem/ListItem.mdx +5 -1
- package/src/components/ListItem/ListItem.tsx +15 -60
- package/src/components/MediaCard/MediaCard.mdx +5 -1
- package/src/components/MerchantProfile/MerchantProfile.mdx +1 -1
- package/src/components/MoneyValue/MoneyValue.mdx +6 -2
- package/src/components/NavArrow/NavArrow.mdx +5 -1
- package/src/components/NavArrow/NavArrow.tsx +48 -16
- package/src/components/PageTitle/PageTitle.mdx +5 -1
- package/src/components/Screen/Screen.mdx +58 -0
- package/src/components/Screen/Screen.tsx +60 -0
- package/src/components/Section/Section.mdx +5 -1
- package/src/components/Section/Section.tsx +17 -46
- package/src/components/Stepper/Step.mdx +5 -1
- package/src/components/Stepper/StepLabel.mdx +5 -1
- package/src/components/Stepper/Stepper.mdx +1 -1
- package/src/components/SupportText/SupportText.mdx +48 -0
- package/src/components/SupportText/SupportText.tsx +104 -0
- package/src/components/SupportText/SupportTextIcon.mdx +35 -0
- package/src/components/SupportText/SupportTextIcon.tsx +45 -0
- package/src/components/SupportText/index.ts +2 -0
- package/src/components/TextInput/TextInput.mdx +9 -1
- package/src/components/ThreadHero/ThreadHero.mdx +1 -1
- package/src/components/Tooltip/Tooltip.mdx +5 -1
- package/src/components/TransactionBubble/TransactionBubble.mdx +1 -1
- package/src/components/TransactionDetails/TransactionDetails.mdx +1 -1
- package/src/components/TransactionDetails/TransactionDetails.tsx +1 -38
- package/src/components/TransactionStatus/TransactionStatus.mdx +1 -1
- package/src/components/UpiHandle/UpiHandle.mdx +5 -1
- package/src/components/VStack/VStack.mdx +44 -0
- package/src/components/VStack/VStack.tsx +100 -0
- package/src/components/index.ts +4 -0
- package/src/design-tokens/JFS Variables-variables-full.json +1 -18633
- package/src/icons/ic_info.svg +1 -0
- package/src/icons/ic_warning.svg +1 -0
- package/src/icons/registry.ts +9 -1
- package/src/utils/react-utils.ts +51 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta, Story, Canvas,
|
|
1
|
+
import { Meta, Story, Canvas, Controls } from '@storybook/blocks';
|
|
2
2
|
import * as IconButtonStories from './IconButton.stories';
|
|
3
3
|
import IconButton from './IconButton';
|
|
4
4
|
import { AccessibilitySection, AnatomySection, UsageConstraintsSection } from '../docs/DocSections';
|
|
@@ -28,6 +28,10 @@ This component uses the following design token collections. Each collection supp
|
|
|
28
28
|
### Color Mode
|
|
29
29
|
- **Modes:** Light | Dark
|
|
30
30
|
- **Default:** Light
|
|
31
|
+
|
|
32
|
+
### Colors Router
|
|
33
|
+
- **Modes:** POC | Old
|
|
34
|
+
- **Default:** POC
|
|
31
35
|
## Usage
|
|
32
36
|
|
|
33
37
|
<Canvas>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta, Story, Canvas,
|
|
1
|
+
import { Meta, Story, Canvas, Controls } from '@storybook/blocks';
|
|
2
2
|
import * as IconCapsuleStories from './IconCapsule.stories';
|
|
3
3
|
import IconCapsule from './IconCapsule';
|
|
4
4
|
import { AccessibilitySection, AnatomySection, UsageConstraintsSection } from '../docs/DocSections';
|
|
@@ -17,6 +17,10 @@ This component uses the following design token collections. Each collection supp
|
|
|
17
17
|
- **Modes:** M | L | S
|
|
18
18
|
- **Default:** M
|
|
19
19
|
|
|
20
|
+
### Emphasis
|
|
21
|
+
- **Modes:** High | Medium | Low
|
|
22
|
+
- **Default:** High
|
|
23
|
+
|
|
20
24
|
### Appearance.Brand
|
|
21
25
|
- **Modes:** Primary | Secondary | Neutral
|
|
22
26
|
- **Default:** Primary
|
|
@@ -24,6 +28,10 @@ This component uses the following design token collections. Each collection supp
|
|
|
24
28
|
### Color Mode
|
|
25
29
|
- **Modes:** Light | Dark
|
|
26
30
|
- **Default:** Light
|
|
31
|
+
|
|
32
|
+
### Colors Router
|
|
33
|
+
- **Modes:** POC | Old
|
|
34
|
+
- **Default:** POC
|
|
27
35
|
## Usage
|
|
28
36
|
|
|
29
37
|
<Canvas>
|
|
@@ -62,11 +70,11 @@ This component uses the following design token collections. Each collection supp
|
|
|
62
70
|
This component uses the following design tokens, resolved through `getVariableByName`:
|
|
63
71
|
|
|
64
72
|
- **`iconCapsule/background`**
|
|
73
|
+
- **`iconCapsule/border/color`**
|
|
74
|
+
- **`iconCapsule/border/size`**
|
|
75
|
+
- **`iconCapsule/icon/color`**
|
|
65
76
|
- **`iconCapsule/icon/size`**
|
|
66
77
|
- **`iconCapsule/radius`**
|
|
67
78
|
- **`iconCapsule/size`**
|
|
68
|
-
- **`iconCapsuleborder/color`**
|
|
69
|
-
- **`iconCapsuleborder/size`**
|
|
70
|
-
- **`iconCapsuleicon/color`**
|
|
71
79
|
|
|
72
80
|
All tokens support mode-based theming through the `modes` prop.
|
|
@@ -52,9 +52,9 @@ function IconCapsule({
|
|
|
52
52
|
const size = getVariableByName('iconCapsule/size', modes) || 42
|
|
53
53
|
const radius = getVariableByName('iconCapsule/radius', modes) || 9999
|
|
54
54
|
const backgroundColor = getVariableByName('iconCapsule/background', modes) || '#cfa159'
|
|
55
|
-
const borderColor = getVariableByName('
|
|
56
|
-
const borderSize = getVariableByName('
|
|
57
|
-
const iconColor = getVariableByName('
|
|
55
|
+
const borderColor = getVariableByName('iconCapsule/border/color', modes) || 'rgba(255,255,255,0)'
|
|
56
|
+
const borderSize = getVariableByName('iconCapsule/border/size', modes) || 1
|
|
57
|
+
const iconColor = getVariableByName('iconCapsule/icon/color', modes) || '#0f0d0a'
|
|
58
58
|
const iconSize = getVariableByName('iconCapsule/icon/size', modes) || 18
|
|
59
59
|
|
|
60
60
|
// Convert radius to React Native format (if 9999, use size/2 for perfect circle)
|
|
@@ -1,102 +1,7 @@
|
|
|
1
|
-
import { Meta } from '@storybook/
|
|
1
|
+
import { Meta } from '@storybook/blocks';
|
|
2
2
|
|
|
3
3
|
<Meta title="Introduction" />
|
|
4
4
|
|
|
5
|
-
#
|
|
6
|
-
|
|
7
|
-
Welcome to the component library documentation for this React Native project. This Storybook instance provides comprehensive documentation and interactive examples of all components in the application.
|
|
8
|
-
|
|
9
|
-
## What is Storybook?
|
|
10
|
-
|
|
11
|
-
Storybook is a tool for building UI components in isolation. It makes development, testing, and documentation easier by providing a sandbox environment where you can:
|
|
12
|
-
|
|
13
|
-
- **Develop components in isolation** - Build components without worrying about app-specific dependencies
|
|
14
|
-
- **Test edge cases** - Easily test components with different props and states
|
|
15
|
-
- **Document components** - Create living documentation that stays in sync with your code
|
|
16
|
-
- **Share with your team** - Provide a visual reference for designers and developers
|
|
17
|
-
|
|
18
|
-
## Documentation Contract
|
|
19
|
-
|
|
20
|
-
Every component page now follows a consistent template:
|
|
21
|
-
|
|
22
|
-
- **Accessibility** — how to label, hint, and expose roles/states so assistive tech users get the right cues.
|
|
23
|
-
- **Anatomy** — key slots/parts you can compose or override (leading/trailing, slots, tokens).
|
|
24
|
-
- **Usage Constraints** — safe overrides, layout expectations, and behaviors to avoid.
|
|
25
|
-
|
|
26
|
-
Use these sections as a checklist when creating or reviewing stories so guidance stays close to the API.
|
|
27
|
-
|
|
28
|
-
## Performance Panel
|
|
29
|
-
|
|
30
|
-
A lightweight performance panel is enabled for all stories. Open the **Performance** addon in the Storybook toolbar to inspect mount/remount timings and interaction costs. Use it to:
|
|
31
|
-
|
|
32
|
-
- Compare render timing between variants without creating extra stories.
|
|
33
|
-
- Spot regressions when props or modes change.
|
|
34
|
-
- Validate that heavy children (lists, drawers, sheets) still mount within budget.
|
|
35
|
-
|
|
36
|
-
## Getting Started
|
|
37
|
-
|
|
38
|
-
### Running Storybook
|
|
39
|
-
|
|
40
|
-
#### For Web (Development)
|
|
41
|
-
```bash
|
|
42
|
-
yarn storybook-web
|
|
43
|
-
```
|
|
44
|
-
This will start Storybook on `http://localhost:6006`
|
|
45
|
-
|
|
46
|
-
#### For React Native (iOS/Android)
|
|
47
|
-
```bash
|
|
48
|
-
# iOS
|
|
49
|
-
yarn ios
|
|
50
|
-
|
|
51
|
-
# Android
|
|
52
|
-
yarn android
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### Building Storybook for Production
|
|
56
|
-
```bash
|
|
57
|
-
yarn build:storybook-web
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
## Component Organization
|
|
61
|
-
|
|
62
|
-
Components are organized in the `src/components` directory. Each component typically includes:
|
|
63
|
-
|
|
64
|
-
- **Component file** - The main component implementation
|
|
65
|
-
- **Story file** - Interactive examples and test cases
|
|
66
|
-
- **Documentation** - Comprehensive documentation with usage examples
|
|
67
|
-
|
|
68
|
-
## Available Components
|
|
69
|
-
|
|
70
|
-
### Avatar
|
|
71
|
-
- **Avatar** - A flexible avatar component that displays user profile pictures or monogram initials. Supports multiple size modes and is fully integrated with Figma design tokens.
|
|
72
|
-
|
|
73
|
-
### IconCapsule
|
|
74
|
-
- **IconCapsule** - A flexible icon capsule component that displays an icon within a styled circular or rounded container. Supports different icons and appearance modes, fully integrated with Figma design tokens.
|
|
75
|
-
|
|
76
|
-
## Documentation Features
|
|
77
|
-
|
|
78
|
-
This Storybook instance includes:
|
|
79
|
-
|
|
80
|
-
- ✅ **Automatic documentation** - Generated from JSDoc comments and component metadata
|
|
81
|
-
- ✅ **Interactive examples** - Live, editable component examples
|
|
82
|
-
- ✅ **Props documentation** - Automatic props table generation
|
|
83
|
-
- ✅ **MDX support** - Rich documentation with Markdown and JSX
|
|
84
|
-
|
|
85
|
-
## Best Practices
|
|
86
|
-
|
|
87
|
-
When creating new components:
|
|
88
|
-
|
|
89
|
-
1. **Add JSDoc comments** - Document your components with JSDoc for automatic documentation
|
|
90
|
-
2. **Create stories** - Add multiple stories showing different states and use cases
|
|
91
|
-
3. **Use TypeScript/PropTypes** - Define prop types for better documentation
|
|
92
|
-
4. **Write MDX docs** - Create comprehensive documentation pages when needed
|
|
93
|
-
|
|
94
|
-
## Resources
|
|
95
|
-
|
|
96
|
-
- [Storybook Documentation](https://storybook.js.org/)
|
|
97
|
-
- [React Native Storybook](https://github.com/storybookjs/react-native)
|
|
98
|
-
|
|
99
|
-
---
|
|
100
|
-
|
|
101
|
-
Happy coding! 🚀
|
|
5
|
+
# Introduction
|
|
102
6
|
|
|
7
|
+
Welcome to the JFS Components Library.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta, Story, Canvas,
|
|
1
|
+
import { Meta, Story, Canvas, Controls } from '@storybook/blocks';
|
|
2
2
|
import * as LazyListStories from './LazyList.stories';
|
|
3
3
|
import LazyList from './LazyList';
|
|
4
4
|
import { AccessibilitySection, AnatomySection, UsageConstraintsSection } from '../docs/DocSections';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta, Story, Canvas,
|
|
1
|
+
import { Meta, Story, Canvas, Controls } from '@storybook/blocks';
|
|
2
2
|
import * as ListGroupStories from './ListGroup.stories';
|
|
3
3
|
import ListGroup from './ListGroup';
|
|
4
4
|
import { AccessibilitySection, AnatomySection, UsageConstraintsSection } from '../docs/DocSections';
|
|
@@ -13,6 +13,10 @@ Helper function to recursively clone children and pass modes prop to components
|
|
|
13
13
|
|
|
14
14
|
This component uses the following design token collections. Each collection supports multiple modes that can be configured via the `modes` prop.
|
|
15
15
|
|
|
16
|
+
### Colors Router
|
|
17
|
+
- **Modes:** POC | Old
|
|
18
|
+
- **Default:** POC
|
|
19
|
+
|
|
16
20
|
### Title Level
|
|
17
21
|
- **Modes:** Default | Bold
|
|
18
22
|
- **Default:** Default
|
|
@@ -6,45 +6,7 @@ import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
|
|
|
6
6
|
* Helper function to recursively clone children and pass modes prop to components that accept it.
|
|
7
7
|
* This ensures that all child components in slots receive the modes prop from the parent.
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
|
-
children: React.ReactNode,
|
|
11
|
-
modes: Record<string, any>
|
|
12
|
-
): React.ReactNode[] {
|
|
13
|
-
const result = React.Children.map(children, (child) => {
|
|
14
|
-
if (!React.isValidElement(child)) {
|
|
15
|
-
return child
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// Get existing children
|
|
19
|
-
const childChildren = (child.props as any)?.children
|
|
20
|
-
const hasChildren = childChildren !== undefined && childChildren !== null
|
|
21
|
-
|
|
22
|
-
// Clone the child with modes prop if it doesn't already have one
|
|
23
|
-
// or merge with existing modes if it does
|
|
24
|
-
// Merge order: parent modes first, then child's explicit modes override them
|
|
25
|
-
const existingModes = (child.props as any)?.modes
|
|
26
|
-
const mergedModes = existingModes ? { ...modes, ...existingModes } : modes
|
|
27
|
-
|
|
28
|
-
// Recursively process children if they exist
|
|
29
|
-
const processedChildren: React.ReactNode | undefined = hasChildren
|
|
30
|
-
? cloneChildrenWithModes(
|
|
31
|
-
React.Children.toArray(childChildren),
|
|
32
|
-
modes
|
|
33
|
-
)
|
|
34
|
-
: undefined
|
|
35
|
-
|
|
36
|
-
// Clone element with modes and processed children
|
|
37
|
-
return React.cloneElement(
|
|
38
|
-
child,
|
|
39
|
-
{
|
|
40
|
-
...(child.props as any),
|
|
41
|
-
modes: mergedModes,
|
|
42
|
-
},
|
|
43
|
-
processedChildren
|
|
44
|
-
)
|
|
45
|
-
})
|
|
46
|
-
return result || []
|
|
47
|
-
}
|
|
9
|
+
import { cloneChildrenWithModes } from '../../utils/react-utils'
|
|
48
10
|
|
|
49
11
|
type ListGroupProps = {
|
|
50
12
|
label?: string;
|
|
@@ -126,7 +88,7 @@ function ListGroup({
|
|
|
126
88
|
const defaultAccessibilityLabel = accessibilityLabel || label || "List group"
|
|
127
89
|
|
|
128
90
|
return (
|
|
129
|
-
<View
|
|
91
|
+
<View
|
|
130
92
|
style={[containerStyle, style]}
|
|
131
93
|
accessibilityRole="list"
|
|
132
94
|
accessibilityLabel={defaultAccessibilityLabel}
|
|
@@ -134,8 +96,8 @@ function ListGroup({
|
|
|
134
96
|
{...rest}
|
|
135
97
|
>
|
|
136
98
|
{label ? (
|
|
137
|
-
<Text
|
|
138
|
-
style={[labelStyle, processedSlot && { marginBottom: gap }]}
|
|
99
|
+
<Text
|
|
100
|
+
style={[labelStyle, processedSlot && { marginBottom: gap }]}
|
|
139
101
|
numberOfLines={1}
|
|
140
102
|
accessibilityElementsHidden={true}
|
|
141
103
|
importantForAccessibility="no"
|
|
@@ -153,7 +115,7 @@ function ListGroup({
|
|
|
153
115
|
const items = React.Children.toArray(processedSlot)
|
|
154
116
|
const isLast = index === items.length - 1
|
|
155
117
|
const wrapperStyle = !isLast ? { marginBottom: gap } : {}
|
|
156
|
-
|
|
118
|
+
|
|
157
119
|
return (
|
|
158
120
|
<View key={child.key || `wrapper-${index}`} style={wrapperStyle}>
|
|
159
121
|
{child}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta, Story, Canvas,
|
|
1
|
+
import { Meta, Story, Canvas, Controls } from '@storybook/blocks';
|
|
2
2
|
import * as ListItemStories from './ListItem.stories';
|
|
3
3
|
import ListItem from './ListItem';
|
|
4
4
|
import { AccessibilitySection, AnatomySection, UsageConstraintsSection } from '../docs/DocSections';
|
|
@@ -26,6 +26,10 @@ This component uses the following design token collections. Each collection supp
|
|
|
26
26
|
### Color Mode
|
|
27
27
|
- **Modes:** Light | Dark
|
|
28
28
|
- **Default:** Light
|
|
29
|
+
|
|
30
|
+
### Colors Router
|
|
31
|
+
- **Modes:** POC | Old
|
|
32
|
+
- **Default:** POC
|
|
29
33
|
## Usage
|
|
30
34
|
|
|
31
35
|
### Horizontal Layout with NavArrow
|
|
@@ -12,52 +12,7 @@ import { usePressableWebSupport, type WebAccessibilityProps } from '../../utils/
|
|
|
12
12
|
* @param forcedModes - Optional modes that will ALWAYS be applied last, overriding any other modes.
|
|
13
13
|
* Useful for slots that need to enforce specific context values.
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
|
-
children: React.ReactNode,
|
|
17
|
-
modes: Record<string, any>,
|
|
18
|
-
forcedModes?: Record<string, any>
|
|
19
|
-
): React.ReactNode[] {
|
|
20
|
-
const result = React.Children.map(children, (child) => {
|
|
21
|
-
if (!React.isValidElement(child)) {
|
|
22
|
-
return child
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// Get existing children
|
|
26
|
-
const childChildren = (child.props as any)?.children
|
|
27
|
-
const hasChildren = childChildren !== undefined && childChildren !== null
|
|
28
|
-
|
|
29
|
-
// Clone the child with modes prop if it doesn't already have one
|
|
30
|
-
// or merge with existing modes if it does
|
|
31
|
-
// Merge order: parent modes first, then child's explicit modes override them,
|
|
32
|
-
// then forcedModes (if provided) are applied last and can never be overridden
|
|
33
|
-
const existingModes = (child.props as any)?.modes
|
|
34
|
-
const mergedModes = forcedModes
|
|
35
|
-
? { ...modes, ...(existingModes || {}), ...forcedModes }
|
|
36
|
-
: existingModes
|
|
37
|
-
? { ...modes, ...existingModes }
|
|
38
|
-
: modes
|
|
39
|
-
|
|
40
|
-
// Recursively process children if they exist
|
|
41
|
-
const processedChildren: React.ReactNode | undefined = hasChildren
|
|
42
|
-
? cloneChildrenWithModes(
|
|
43
|
-
React.Children.toArray(childChildren),
|
|
44
|
-
modes,
|
|
45
|
-
forcedModes
|
|
46
|
-
)
|
|
47
|
-
: undefined
|
|
48
|
-
|
|
49
|
-
// Clone element with modes and processed children
|
|
50
|
-
return React.cloneElement(
|
|
51
|
-
child,
|
|
52
|
-
{
|
|
53
|
-
...(child.props as any),
|
|
54
|
-
modes: mergedModes,
|
|
55
|
-
},
|
|
56
|
-
processedChildren
|
|
57
|
-
)
|
|
58
|
-
})
|
|
59
|
-
return result || []
|
|
60
|
-
}
|
|
15
|
+
import { cloneChildrenWithModes } from '../../utils/react-utils'
|
|
61
16
|
|
|
62
17
|
type ListItemProps = {
|
|
63
18
|
layout?: 'Vertical' | 'Horizontal';
|
|
@@ -179,15 +134,15 @@ function ListItem({
|
|
|
179
134
|
const sharedLayoutStyle: ViewStyle =
|
|
180
135
|
layout === 'Horizontal'
|
|
181
136
|
? {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
137
|
+
flexDirection: 'row' as const,
|
|
138
|
+
alignItems: 'center' as const,
|
|
139
|
+
gap,
|
|
140
|
+
}
|
|
186
141
|
: {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
142
|
+
flexDirection: 'column' as const,
|
|
143
|
+
alignItems: 'center' as const,
|
|
144
|
+
gap,
|
|
145
|
+
}
|
|
191
146
|
|
|
192
147
|
const innerContentBaseStyle: ViewStyle = {
|
|
193
148
|
flexDirection: 'row',
|
|
@@ -224,8 +179,8 @@ function ListItem({
|
|
|
224
179
|
|
|
225
180
|
|
|
226
181
|
// Generate default accessibility label from title and supportText if not provided
|
|
227
|
-
const defaultAccessibilityLabel = accessibilityLabel ||
|
|
228
|
-
(layout === 'Horizontal'
|
|
182
|
+
const defaultAccessibilityLabel = accessibilityLabel ||
|
|
183
|
+
(layout === 'Horizontal'
|
|
229
184
|
? `${title}${showSupportText && supportText ? `, ${supportText}` : ''}`
|
|
230
185
|
: supportText)
|
|
231
186
|
|
|
@@ -330,8 +285,8 @@ function ListItem({
|
|
|
330
285
|
accessibilityRole="button"
|
|
331
286
|
accessibilityLabel={defaultAccessibilityLabel}
|
|
332
287
|
accessibilityHint={accessibilityHint}
|
|
333
|
-
accessibilityState={{
|
|
334
|
-
...accessibilityState
|
|
288
|
+
accessibilityState={{
|
|
289
|
+
...accessibilityState
|
|
335
290
|
}}
|
|
336
291
|
onPress={onPress}
|
|
337
292
|
style={({ pressed }) => [
|
|
@@ -374,8 +329,8 @@ function ListItem({
|
|
|
374
329
|
accessibilityRole="button"
|
|
375
330
|
accessibilityLabel={defaultAccessibilityLabel}
|
|
376
331
|
accessibilityHint={accessibilityHint}
|
|
377
|
-
accessibilityState={{
|
|
378
|
-
...accessibilityState
|
|
332
|
+
accessibilityState={{
|
|
333
|
+
...accessibilityState
|
|
379
334
|
}}
|
|
380
335
|
onPress={onPress}
|
|
381
336
|
style={({ pressed }) => [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta, Story, Canvas,
|
|
1
|
+
import { Meta, Story, Canvas, Controls } from '@storybook/blocks';
|
|
2
2
|
import * as MediaCardStories from './MediaCard.stories';
|
|
3
3
|
import MediaCard from './MediaCard';
|
|
4
4
|
import { AnatomySection, UsageConstraintsSection } from '../docs/DocSections';
|
|
@@ -13,6 +13,10 @@ This component uses the following design token collections. Each collection supp
|
|
|
13
13
|
### Contrast Context
|
|
14
14
|
- **Modes:** on dark | on light
|
|
15
15
|
- **Default:** on dark
|
|
16
|
+
|
|
17
|
+
### Colors Router
|
|
18
|
+
- **Modes:** POC | Old
|
|
19
|
+
- **Default:** POC
|
|
16
20
|
## Usage
|
|
17
21
|
|
|
18
22
|
<Canvas>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta, Story, Canvas,
|
|
1
|
+
import { Meta, Story, Canvas, Controls } from '@storybook/blocks';
|
|
2
2
|
import * as MerchantProfileStories from './MerchantProfile.stories';
|
|
3
3
|
import MerchantProfile from './MerchantProfile';
|
|
4
4
|
import { AccessibilitySection, AnatomySection, UsageConstraintsSection } from '../docs/DocSections';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta, Story, Canvas,
|
|
1
|
+
import { Meta, Story, Canvas, Controls } from '@storybook/blocks';
|
|
2
2
|
import * as MoneyValueStories from './MoneyValue.stories';
|
|
3
3
|
import MoneyValue from './MoneyValue';
|
|
4
4
|
import { AccessibilitySection, AnatomySection, UsageConstraintsSection } from '../docs/DocSections';
|
|
@@ -17,8 +17,12 @@ This component uses the following design token collections. Each collection supp
|
|
|
17
17
|
- **Modes:** Light | Dark
|
|
18
18
|
- **Default:** Light
|
|
19
19
|
|
|
20
|
+
### Colors Router
|
|
21
|
+
- **Modes:** POC | Old
|
|
22
|
+
- **Default:** POC
|
|
23
|
+
|
|
20
24
|
### Context3
|
|
21
|
-
- **Modes:** Default | Transaction Bubble
|
|
25
|
+
- **Modes:** Default | Transaction Bubble | Balance
|
|
22
26
|
- **Default:** Default
|
|
23
27
|
## Usage
|
|
24
28
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta, Story, Canvas,
|
|
1
|
+
import { Meta, Story, Canvas, Controls } from '@storybook/blocks';
|
|
2
2
|
import * as NavArrowStories from './NavArrow.stories';
|
|
3
3
|
import NavArrow from './NavArrow';
|
|
4
4
|
|
|
@@ -16,6 +16,10 @@ This component uses the following design token collections. Each collection supp
|
|
|
16
16
|
- **Modes:** Light | Dark
|
|
17
17
|
- **Default:** Light
|
|
18
18
|
|
|
19
|
+
### Colors Router
|
|
20
|
+
- **Modes:** POC | Old
|
|
21
|
+
- **Default:** POC
|
|
22
|
+
|
|
19
23
|
### Context2
|
|
20
24
|
- **Modes:** Default | AppBar
|
|
21
25
|
- **Default:** Default
|
|
@@ -3,10 +3,10 @@ import { View, type ViewStyle } from 'react-native'
|
|
|
3
3
|
import Svg, { Path } from 'react-native-svg'
|
|
4
4
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
|
|
5
5
|
|
|
6
|
-
type NavArrowDirection = 'Back' | 'Forward'
|
|
6
|
+
type NavArrowDirection = 'Back' | 'Forward' | 'Down'
|
|
7
7
|
|
|
8
8
|
type NavArrowProps = {
|
|
9
|
-
/** Direction of the arrow: 'Back' (left chevron)
|
|
9
|
+
/** Direction of the arrow: 'Back' (left chevron), 'Forward' (right chevron), or 'Down' */
|
|
10
10
|
direction?: NavArrowDirection
|
|
11
11
|
/** Modes used to resolve design tokens */
|
|
12
12
|
modes?: Record<string, any>
|
|
@@ -31,7 +31,7 @@ type NavArrowProps = {
|
|
|
31
31
|
*
|
|
32
32
|
* @component
|
|
33
33
|
* @param {Object} props
|
|
34
|
-
* @param {'Back'|'Forward'} [props.direction='Back'] - Arrow direction
|
|
34
|
+
* @param {'Back'|'Forward'|'Down'} [props.direction='Back'] - Arrow direction
|
|
35
35
|
* @param {Object} [props.modes={}] - Modes for design token resolution
|
|
36
36
|
* @param {Object} [props.style] - Additional container styles
|
|
37
37
|
*/
|
|
@@ -51,18 +51,25 @@ function NavArrow({
|
|
|
51
51
|
Number(getVariableByName('navArrow/icon/height', modes)) || 8
|
|
52
52
|
const strokeWeight =
|
|
53
53
|
Number(getVariableByName('navArrow/icon/strokeWeight', modes)) || 2
|
|
54
|
-
|
|
54
|
+
|
|
55
|
+
// Base dimensions from tokens (these are for Vertical orientation like Back/Forward)
|
|
56
|
+
const baseContainerWidth =
|
|
55
57
|
Number(getVariableByName('navArrow/width', modes)) || 6
|
|
56
|
-
const
|
|
58
|
+
const baseContainerHeight =
|
|
57
59
|
Number(getVariableByName('navArrow/height', modes)) || 10
|
|
60
|
+
|
|
58
61
|
const borderRadius =
|
|
59
62
|
Number(getVariableByName('navArrow/radius', modes)) || 0
|
|
60
63
|
const backgroundColor =
|
|
61
64
|
(getVariableByName('navArrow/background', modes) as string) || 'transparent'
|
|
62
65
|
|
|
66
|
+
// For Down direction, we swap width and height considerations
|
|
67
|
+
const isDown = direction === 'Down'
|
|
68
|
+
|
|
63
69
|
const containerStyle: ViewStyle = {
|
|
64
|
-
width
|
|
65
|
-
|
|
70
|
+
// If Down, we use the height token for width and width token for height
|
|
71
|
+
width: isDown ? baseContainerHeight : baseContainerWidth,
|
|
72
|
+
height: isDown ? baseContainerWidth : baseContainerHeight,
|
|
66
73
|
borderRadius,
|
|
67
74
|
backgroundColor,
|
|
68
75
|
alignItems: 'center',
|
|
@@ -71,12 +78,37 @@ function NavArrow({
|
|
|
71
78
|
}
|
|
72
79
|
|
|
73
80
|
const defaultAccessibilityLabel =
|
|
74
|
-
accessibilityLabel ||
|
|
81
|
+
accessibilityLabel ||
|
|
82
|
+
(direction === 'Back'
|
|
83
|
+
? 'Go back'
|
|
84
|
+
: direction === 'Forward'
|
|
85
|
+
? 'Go forward'
|
|
86
|
+
: 'Go down')
|
|
87
|
+
|
|
88
|
+
// Determine SVG dimensions based on orientation
|
|
89
|
+
// For Down, we swap width/height so the layout box is correct (8x4 instead of 4x8)
|
|
90
|
+
const svgWidth = isDown ? iconHeight : iconWidth
|
|
91
|
+
const svgHeight = isDown ? iconWidth : iconHeight
|
|
75
92
|
|
|
76
|
-
// SVG path
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
93
|
+
// SVG path generation
|
|
94
|
+
let chevronPath
|
|
95
|
+
let transform
|
|
96
|
+
|
|
97
|
+
if (isDown) {
|
|
98
|
+
// Arrow pointing down: M1 1 L[mid] [bottom] L[right] 1
|
|
99
|
+
// Width is iconHeight (8), Height is iconWidth (4)
|
|
100
|
+
// Tip at (4, 3), Left (1, 1), Right (7, 1)
|
|
101
|
+
chevronPath = `M1 1L${svgWidth / 2} ${svgHeight - 1}L${svgWidth - 1} 1`
|
|
102
|
+
} else {
|
|
103
|
+
// Arrow pointing right (Forward)
|
|
104
|
+
// Width is iconWidth (4), Height is iconHeight (8)
|
|
105
|
+
chevronPath = `M1 1L${iconWidth - 1} ${iconHeight / 2}L1 ${iconHeight - 1}`
|
|
106
|
+
|
|
107
|
+
// For Back, we just flip the Forward arrow
|
|
108
|
+
if (direction === 'Back') {
|
|
109
|
+
transform = [{ scaleX: -1 }]
|
|
110
|
+
}
|
|
111
|
+
}
|
|
80
112
|
|
|
81
113
|
return (
|
|
82
114
|
<View
|
|
@@ -86,10 +118,10 @@ function NavArrow({
|
|
|
86
118
|
{...rest}
|
|
87
119
|
>
|
|
88
120
|
<Svg
|
|
89
|
-
width={
|
|
90
|
-
height={
|
|
91
|
-
viewBox={`0 0 ${
|
|
92
|
-
style={
|
|
121
|
+
width={svgWidth}
|
|
122
|
+
height={svgHeight}
|
|
123
|
+
viewBox={`0 0 ${svgWidth} ${svgHeight}`}
|
|
124
|
+
style={transform ? { transform } : undefined}
|
|
93
125
|
>
|
|
94
126
|
<Path
|
|
95
127
|
d={chevronPath}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta, Story, Canvas,
|
|
1
|
+
import { Meta, Story, Canvas, Controls } from '@storybook/blocks';
|
|
2
2
|
import * as PageTitleStories from './PageTitle.stories';
|
|
3
3
|
import PageTitle from './PageTitle';
|
|
4
4
|
import { AccessibilitySection, AnatomySection, UsageConstraintsSection } from '../docs/DocSections';
|
|
@@ -16,6 +16,10 @@ This component uses the following design token collections. Each collection supp
|
|
|
16
16
|
### Color Mode
|
|
17
17
|
- **Modes:** Light | Dark
|
|
18
18
|
- **Default:** Light
|
|
19
|
+
|
|
20
|
+
### Colors Router
|
|
21
|
+
- **Modes:** POC | Old
|
|
22
|
+
- **Default:** POC
|
|
19
23
|
## Usage
|
|
20
24
|
|
|
21
25
|
<Canvas>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Canvas, Meta, Story, Controls } from '@storybook/blocks';
|
|
2
|
+
import * as ScreenStories from './Screen.stories';
|
|
3
|
+
import Screen from './Screen';
|
|
4
|
+
|
|
5
|
+
<Meta of={ScreenStories} />
|
|
6
|
+
|
|
7
|
+
# Screen
|
|
8
|
+
|
|
9
|
+
The `Screen` component acts as the outer most container for a page, providing the correct background color based on the current mode.
|
|
10
|
+
|
|
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
|
+
### Page type
|
|
17
|
+
- **Modes:** MainPage | SubPage
|
|
18
|
+
- **Default:** MainPage
|
|
19
|
+
|
|
20
|
+
### Color Mode
|
|
21
|
+
- **Modes:** Light | Dark
|
|
22
|
+
- **Default:** Light
|
|
23
|
+
|
|
24
|
+
### Colors Router
|
|
25
|
+
- **Modes:** POC | Old
|
|
26
|
+
- **Default:** POC
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
import Screen from 'jfs-components/src/components/Screen/Screen';
|
|
31
|
+
|
|
32
|
+
function MyPage(props) {
|
|
33
|
+
return (
|
|
34
|
+
<Screen modes={props.modes}>
|
|
35
|
+
{/* Content goes here */}
|
|
36
|
+
</Screen>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Props
|
|
42
|
+
|
|
43
|
+
<Controls />
|
|
44
|
+
|
|
45
|
+
## Examples
|
|
46
|
+
|
|
47
|
+
### Default
|
|
48
|
+
|
|
49
|
+
<Canvas of={ScreenStories.Default} />
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
## Design Tokens
|
|
53
|
+
|
|
54
|
+
This component uses the following design tokens, resolved through `getVariableByName`:
|
|
55
|
+
|
|
56
|
+
- **`screen/body/background`**
|
|
57
|
+
|
|
58
|
+
All tokens support mode-based theming through the `modes` prop.
|