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 AccordionStories from './Accordion.stories';
|
|
3
3
|
import Accordion from './Accordion';
|
|
4
4
|
import { AccessibilitySection, AnatomySection, UsageConstraintsSection } from '../docs/DocSections';
|
|
@@ -7,6 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _figmaVariablesResolver = require("../../design-tokens/figma-variables-resolver");
|
|
10
|
+
var _reactUtils = require("../../utils/react-utils");
|
|
10
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
13
|
/**
|
|
@@ -96,20 +97,7 @@ function ActionFooter({
|
|
|
96
97
|
} : {};
|
|
97
98
|
|
|
98
99
|
// Pass modes prop to all slot children
|
|
99
|
-
const childrenWithModes =
|
|
100
|
-
if (/*#__PURE__*/_react.default.isValidElement(child)) {
|
|
101
|
-
// Merge modes: child's modes take precedence over parent's modes
|
|
102
|
-
const childModes = child.props.modes;
|
|
103
|
-
const mergedModes = childModes ? {
|
|
104
|
-
...modes,
|
|
105
|
-
...childModes
|
|
106
|
-
} : modes;
|
|
107
|
-
return /*#__PURE__*/_react.default.cloneElement(child, {
|
|
108
|
-
modes: mergedModes
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
return child;
|
|
112
|
-
});
|
|
100
|
+
const childrenWithModes = (0, _reactUtils.cloneChildrenWithModes)(children, modes);
|
|
113
101
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
114
102
|
style: [containerStyle, webShadow, style],
|
|
115
103
|
accessibilityRole: "toolbar",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_figmaVariablesResolver","_jsxRuntime","e","__esModule","default","ActionFooter","children","modes","style","accessibilityLabel","backgroundColor","getVariableByName","gap","paddingHorizontal","paddingTop","paddingBottom","shadowStyle","Platform","select","ios","shadowColor","shadowOffset","width","height","shadowOpacity","shadowRadius","android","elevation","containerStyle","paddingLeft","paddingRight","slotStyle","flexDirection","alignItems","flex","webShadow","OS","boxShadow","childrenWithModes","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_figmaVariablesResolver","_reactUtils","_jsxRuntime","e","__esModule","default","ActionFooter","children","modes","style","accessibilityLabel","backgroundColor","getVariableByName","gap","paddingHorizontal","paddingTop","paddingBottom","shadowStyle","Platform","select","ios","shadowColor","shadowOffset","width","height","shadowOpacity","shadowRadius","android","elevation","containerStyle","paddingLeft","paddingRight","slotStyle","flexDirection","alignItems","flex","webShadow","OS","boxShadow","childrenWithModes","cloneChildrenWithModes","jsx","View","accessibilityRole","_default","exports"],"sourceRoot":"../../../../src","sources":["components/ActionFooter/ActionFooter.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAMA,IAAAE,uBAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA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B,cAAyB,GAAG;IAChClB,eAAe;IACfmB,WAAW,EAAEhB,iBAAiB;IAC9BiB,YAAY,EAAEjB,iBAAiB;IAC/BC,UAAU;IACVC,aAAa;IACb,GAAGC;EACL,CAAC;;EAED;EACA,MAAMe,SAAoB,GAAG;IAC3BC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,YAAY;IACxBrB,GAAG;IACHsB,IAAI,EAAE;EACR,CAAC;;EAED;EACA,MAAMC,SAAS,GAAGlB,qBAAQ,CAACmB,EAAE,KAAK,KAAK,GACnC;IAAEC,SAAS,EAAE;EAAuF,CAAC,GACrG,CAAC,CAAC;;EAEN;EACA,MAAMC,iBAAiB,GAAG,IAAAC,kCAAsB,EAACjC,QAAQ,EAAEC,KAAK,CAAC;EAEjE,oBACE,IAAAN,WAAA,CAAAuC,GAAA,EAAC1C,YAAA,CAAA2C,IAAI;IACHjC,KAAK,EAAE,CAACoB,cAAc,EAAEO,SAAS,EAAE3B,KAAK,CAAE;IAC1CkC,iBAAiB,EAAC,SAAS;IAC3BjC,kBAAkB,EAAEA,kBAAmB;IAAAH,QAAA,eAEvC,IAAAL,WAAA,CAAAuC,GAAA,EAAC1C,YAAA,CAAA2C,IAAI;MAACjC,KAAK,EAAEuB,SAAU;MAAAzB,QAAA,EACpBgC;IAAiB,CACd;EAAC,CACH,CAAC;AAEX;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAxC,OAAA,GAEcC,YAAY","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta, Story, Canvas,
|
|
1
|
+
import { Meta, Story, Canvas, Controls } from '@storybook/blocks';
|
|
2
2
|
import * as ActionFooterStories from './ActionFooter.stories';
|
|
3
3
|
import ActionFooter from './ActionFooter';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta, Story, Canvas, PureArgsTable as Controls } from '@storybook/
|
|
1
|
+
import { Meta, Story, Canvas, PureArgsTable as Controls } from '@storybook/blocks';
|
|
2
2
|
import * as ActionTileStories from './ActionTile.stories';
|
|
3
3
|
|
|
4
4
|
<Meta of={ActionTileStories} />
|
|
@@ -15,6 +15,10 @@ This component uses the following design token collections. Each collection supp
|
|
|
15
15
|
### Color Mode
|
|
16
16
|
- **Modes:** Light | Dark
|
|
17
17
|
- **Default:** Light
|
|
18
|
+
|
|
19
|
+
### Colors Router
|
|
20
|
+
- **Modes:** POC | Old
|
|
21
|
+
- **Default:** POC
|
|
18
22
|
## Usage
|
|
19
23
|
|
|
20
24
|
```tsx
|
|
@@ -3,20 +3,19 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
6
|
+
exports.default = AppBar;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
8
|
var _reactNative = require("react-native");
|
|
10
9
|
var _figmaVariablesResolver = require("../../design-tokens/figma-variables-resolver");
|
|
11
10
|
var _JFSThemeProvider = require("../../design-tokens/JFSThemeProvider");
|
|
12
|
-
var
|
|
13
|
-
var _Avatar = _interopRequireDefault(require("../Avatar/Avatar"));
|
|
11
|
+
var _NavArrow = _interopRequireDefault(require("../NavArrow/NavArrow"));
|
|
14
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
-
|
|
14
|
+
// We might need to import Image or Svg if we had the assets locally, but for now we'll use placeholders or standard icons for defaults.
|
|
15
|
+
// The user prompt mentioned "Use getVariableByName... strict camelCase".
|
|
16
|
+
|
|
17
17
|
/**
|
|
18
18
|
* Helper function to recursively clone children and pass modes prop to components that accept it.
|
|
19
|
-
* This ensures that all child components in slots receive the modes prop from the parent.
|
|
20
19
|
*/function cloneChildrenWithModes(children, modes) {
|
|
21
20
|
return _react.default.Children.map(children, child => {
|
|
22
21
|
if (! /*#__PURE__*/_react.default.isValidElement(child)) {
|
|
@@ -29,7 +28,6 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
29
28
|
|
|
30
29
|
// Clone the child with modes prop if it doesn't already have one
|
|
31
30
|
// or merge with existing modes if it does
|
|
32
|
-
// Merge order: parent modes first, then child's explicit modes override them
|
|
33
31
|
const existingModes = child.props?.modes;
|
|
34
32
|
const mergedModes = existingModes ? {
|
|
35
33
|
...modes,
|
|
@@ -46,41 +44,15 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
46
44
|
}, processedChildren);
|
|
47
45
|
})?.filter(child => child !== null && child !== undefined) ?? [];
|
|
48
46
|
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* AppBar component that mirrors the Figma "AppBar" component.
|
|
52
|
-
*
|
|
53
|
-
* This component supports:
|
|
54
|
-
* - **leading** IconButton (default: back button with ic_chevron_left)
|
|
55
|
-
* - **middle** slot for custom content (typically title or search)
|
|
56
|
-
* - **actions** slot for custom action buttons (default: two IconButtons)
|
|
57
|
-
* - **design-token driven styling** via `getVariableByName` and `modes`
|
|
58
|
-
*
|
|
59
|
-
* Wherever the Figma layer name contains "Slot", this component exposes a
|
|
60
|
-
* dedicated React "slot" prop:
|
|
61
|
-
* - Slot "Middle" → `middleSlot`
|
|
62
|
-
* - Slot "Actions" → `actionsSlot`
|
|
63
|
-
*
|
|
64
|
-
* @component
|
|
65
|
-
* @param {Object} props
|
|
66
|
-
* @param {React.ReactNode} [props.leading] - Optional leading element. Defaults to IconButton with ic_chevron_left.
|
|
67
|
-
* @param {React.ReactNode} [props.middleSlot] - Optional custom slot for middle content (Figma Slot "Middle").
|
|
68
|
-
* @param {React.ReactNode} [props.actionsSlot] - Optional custom slot for action buttons (Figma Slot "Actions").
|
|
69
|
-
* @param {Object} [props.modes={}] - Modes object passed to `getVariableByName` for all design tokens.
|
|
70
|
-
* @param {Function} [props.onLeadingPress] - Callback when leading button is pressed (only used if leading is not provided).
|
|
71
|
-
* @param {Object} [props.style] - Optional container style overrides.
|
|
72
|
-
* @param {string} [props.accessibilityLabel] - Accessibility label for the app bar
|
|
73
|
-
* @param {string} [props.accessibilityHint] - Additional accessibility hint for screen readers
|
|
74
|
-
*/
|
|
75
|
-
|
|
76
47
|
function AppBar({
|
|
77
|
-
|
|
48
|
+
type = 'MainPage',
|
|
49
|
+
leadingSlot,
|
|
78
50
|
middleSlot,
|
|
79
51
|
actionsSlot,
|
|
80
52
|
modes: propModes = {},
|
|
81
53
|
onLeadingPress,
|
|
82
54
|
style,
|
|
83
|
-
accessibilityLabel
|
|
55
|
+
accessibilityLabel,
|
|
84
56
|
accessibilityHint,
|
|
85
57
|
...rest
|
|
86
58
|
}) {
|
|
@@ -91,88 +63,104 @@ function AppBar({
|
|
|
91
63
|
...globalModes,
|
|
92
64
|
...propModes
|
|
93
65
|
};
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
setChildFocused(false);
|
|
107
|
-
existingOnBlur?.(e);
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
// Resolve container tokens
|
|
112
|
-
const paddingHorizontal = (0, _figmaVariablesResolver.getVariableByName)('appBarActions/padding/horizontal', modes) ?? 16;
|
|
113
|
-
const paddingVertical = (0, _figmaVariablesResolver.getVariableByName)('appBarActions/padding/vertical', modes) ?? 10;
|
|
114
|
-
const actionsGap = (0, _figmaVariablesResolver.getVariableByName)('appBarActions/actions/gap', modes) ?? 8;
|
|
66
|
+
const isMain = type === 'MainPage';
|
|
67
|
+
const isSub = type === 'SubPage';
|
|
68
|
+
|
|
69
|
+
// --- Tokens ---
|
|
70
|
+
// Construct token keys based on type. keys must be camelCase as per instruction.
|
|
71
|
+
// We use explicit string literals so that the extraction script can find them.
|
|
72
|
+
const paddingHorizontal = isMain ? (0, _figmaVariablesResolver.getVariableByName)('appBar/mainPage/padding/horizontal', modes) : (0, _figmaVariablesResolver.getVariableByName)('appBar/subPage/padding/horizontal', modes);
|
|
73
|
+
const paddingVertical = isMain ? (0, _figmaVariablesResolver.getVariableByName)('appBar/mainPage/padding/vertical', modes) : (0, _figmaVariablesResolver.getVariableByName)('appBar/subPage/padding/vertical', modes);
|
|
74
|
+
const backgroundColor = isMain ? (0, _figmaVariablesResolver.getVariableByName)('appBar/mainPage/background', modes) : (0, _figmaVariablesResolver.getVariableByName)('appBar/subPage/background', modes);
|
|
75
|
+
const actionsGap = isMain ? (0, _figmaVariablesResolver.getVariableByName)('appBar/mainPage/actions/gap', modes) : (0, _figmaVariablesResolver.getVariableByName)('appBar/subPage/actions/gap', modes);
|
|
76
|
+
|
|
77
|
+
// Layout styles
|
|
115
78
|
const containerStyle = {
|
|
116
79
|
flexDirection: 'row',
|
|
117
80
|
alignItems: 'center',
|
|
118
81
|
justifyContent: 'space-between',
|
|
119
|
-
paddingHorizontal,
|
|
120
|
-
paddingVertical,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
alignItems: 'center'
|
|
82
|
+
paddingHorizontal: paddingHorizontal ?? 16,
|
|
83
|
+
paddingVertical: paddingVertical ?? (isMain ? 16 : 10),
|
|
84
|
+
backgroundColor: backgroundColor ?? '#FFFFFF'
|
|
85
|
+
// We can set minHeight if we want to enforce consistency, but padding should dictate it mostly.
|
|
86
|
+
// Figma shows specific heights implicitly via padding + content.
|
|
87
|
+
// MainPage: h=68 (16 top/bot padding? 36 height content?)
|
|
88
|
+
// SubPage: h=52
|
|
127
89
|
};
|
|
128
90
|
|
|
129
|
-
//
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
91
|
+
// --- Leading Slot Default ---
|
|
92
|
+
// SubPage default: Back Arrow
|
|
93
|
+
// MainPage default: Jio Logo (We'll use a placeholder or basic text if no asset,
|
|
94
|
+
// but looking at "AppBarHome" before, it had "ic_hellojio". Let's stick to generic defaults or empty if not provided,
|
|
95
|
+
// but usually a component library provides sensible defaults.)
|
|
96
|
+
|
|
97
|
+
// Actually, let's implement the specific defaults mentioned in the plan/analysis
|
|
98
|
+
// SubPage: NavArrow props (icon, etc). We'll use IconButton with 'ic_chevron_left' as a close approximation.
|
|
99
|
+
|
|
100
|
+
let defaultLeading = null;
|
|
101
|
+
if (leadingSlot === undefined) {
|
|
102
|
+
if (isSub) {
|
|
103
|
+
defaultLeading = /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
104
|
+
...(onLeadingPress ? {
|
|
105
|
+
onPress: onLeadingPress
|
|
106
|
+
} : {}),
|
|
107
|
+
hitSlop: 8,
|
|
108
|
+
accessibilityRole: "button",
|
|
109
|
+
accessibilityLabel: "Back",
|
|
110
|
+
style: ({
|
|
111
|
+
pressed
|
|
112
|
+
}) => ({
|
|
113
|
+
opacity: pressed ? 0.7 : 1,
|
|
114
|
+
alignItems: 'center',
|
|
115
|
+
justifyContent: 'center'
|
|
116
|
+
}),
|
|
117
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_NavArrow.default, {
|
|
118
|
+
direction: "Back",
|
|
119
|
+
modes: modes
|
|
120
|
+
})
|
|
121
|
+
});
|
|
122
|
+
} else {
|
|
123
|
+
// MainPage default leading: often the Brand Logo.
|
|
124
|
+
// We'll leave it empty or render a placeholder if desired, but standard AppBar often lets consumer pass logo.
|
|
125
|
+
// Previous code had `leadingIconName='ic_hellojio'` for Home.
|
|
126
|
+
// We will render nothing by default for MainPage leading to keep it flexible, OR a specialized Logo component if we had one.
|
|
127
|
+
// For now, let's assume consumer passes it for MainPage, or we leave empty.
|
|
128
|
+
// Wait, Figma screenshot shows "Jio" logo.
|
|
129
|
+
// The user said: "mostly token namings are 'camelCase'. Maximize existing component usage."
|
|
130
|
+
// I'll leave defaultLeading as null for MainPage unless I have a "BrandLogo" component.
|
|
131
|
+
}
|
|
132
|
+
}
|
|
157
133
|
|
|
158
|
-
//
|
|
159
|
-
const
|
|
160
|
-
const
|
|
134
|
+
// --- Process Slots ---
|
|
135
|
+
const processedLeading = leadingSlot ? cloneChildrenWithModes([leadingSlot], modes)[0] : defaultLeading;
|
|
136
|
+
const processedMiddle = middleSlot ? cloneChildrenWithModes(_react.default.Children.toArray(middleSlot), modes) : null;
|
|
161
137
|
|
|
162
|
-
//
|
|
163
|
-
|
|
138
|
+
// Actions Gap wrapper
|
|
139
|
+
// The Figma has "Actions" slot with a gap.
|
|
140
|
+
const actionsStyle = {
|
|
141
|
+
flexDirection: 'row',
|
|
142
|
+
alignItems: 'center',
|
|
143
|
+
gap: actionsGap ?? 0
|
|
144
|
+
};
|
|
145
|
+
const processedActions = actionsSlot ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
146
|
+
style: actionsStyle,
|
|
147
|
+
children: cloneChildrenWithModes(_react.default.Children.toArray(actionsSlot), modes)
|
|
148
|
+
}) : null;
|
|
164
149
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
165
|
-
style: [containerStyle,
|
|
166
|
-
borderBottomWidth: 2,
|
|
167
|
-
borderBottomColor: '#222'
|
|
168
|
-
} : null, style],
|
|
150
|
+
style: [containerStyle, style],
|
|
169
151
|
accessibilityRole: "header",
|
|
170
|
-
accessibilityLabel: accessibilityLabel,
|
|
171
|
-
...(accessibilityHint
|
|
152
|
+
accessibilityLabel: accessibilityLabel || (isMain ? "Main Header" : "Sub Header"),
|
|
153
|
+
...(accessibilityHint ? {
|
|
172
154
|
accessibilityHint
|
|
173
155
|
} : {}),
|
|
174
156
|
...rest,
|
|
175
|
-
children: [
|
|
157
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
158
|
+
style: {
|
|
159
|
+
flexDirection: 'row',
|
|
160
|
+
alignItems: 'center'
|
|
161
|
+
},
|
|
162
|
+
children: processedLeading
|
|
163
|
+
}), processedMiddle && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
176
164
|
style: {
|
|
177
165
|
position: 'absolute',
|
|
178
166
|
left: 0,
|
|
@@ -181,141 +169,15 @@ function AppBar({
|
|
|
181
169
|
bottom: 0,
|
|
182
170
|
alignItems: 'center',
|
|
183
171
|
justifyContent: 'center',
|
|
184
|
-
|
|
185
|
-
|
|
172
|
+
zIndex: -1 // Behind actions if overlap? Or should be on top?
|
|
173
|
+
// Usually middle title shouldn't block actions. `pointerEvents="box-none"` is safer.
|
|
186
174
|
},
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
children: processedMiddleSlot
|
|
175
|
+
pointerEvents: "box-none",
|
|
176
|
+
children: processedMiddle
|
|
190
177
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
191
|
-
style:
|
|
192
|
-
children:
|
|
193
|
-
})]
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* AppBarHome component that mirrors the Figma "AppBar.home" component.
|
|
199
|
-
*
|
|
200
|
-
* This component supports:
|
|
201
|
-
* - **leading** IconButton (default: circular button with customizable icon)
|
|
202
|
-
* - **actions** slot for custom action buttons (default: search and notification IconButtons)
|
|
203
|
-
* - **avatar** Avatar component on the right
|
|
204
|
-
* - **design-token driven styling** via `getVariableByName` and `modes`
|
|
205
|
-
*
|
|
206
|
-
* Wherever the Figma layer name contains "Slot", this component exposes a
|
|
207
|
-
* dedicated React "slot" prop:
|
|
208
|
-
* - Slot "Actions" → `actionsSlot`
|
|
209
|
-
*
|
|
210
|
-
* @component
|
|
211
|
-
* @param {Object} props
|
|
212
|
-
* @param {React.ReactNode} [props.leading] - Optional leading element. Defaults to IconButton with customizable icon.
|
|
213
|
-
* @param {React.ReactNode} [props.actionsSlot] - Optional custom slot for action buttons (Figma Slot "Actions").
|
|
214
|
-
* @param {Object} [props.modes={}] - Modes object passed to `getVariableByName` for all design tokens.
|
|
215
|
-
* @param {Function} [props.onLeadingPress] - Callback when leading button is pressed (only used if leading is not provided).
|
|
216
|
-
* @param {string} [props.leadingIconName] - Icon name for default leading button (default: 'ic_hellojio').
|
|
217
|
-
* @param {Object} [props.avatarProps] - Props to pass to Avatar component.
|
|
218
|
-
* @param {Object} [props.style] - Optional container style overrides.
|
|
219
|
-
* @param {string} [props.accessibilityLabel] - Accessibility label for the app bar
|
|
220
|
-
* @param {string} [props.accessibilityHint] - Additional accessibility hint for screen readers
|
|
221
|
-
*/
|
|
222
|
-
|
|
223
|
-
function AppBarHome({
|
|
224
|
-
leading,
|
|
225
|
-
actionsSlot,
|
|
226
|
-
modes: propModes = {},
|
|
227
|
-
onLeadingPress,
|
|
228
|
-
leadingIconName = 'ic_hellojio',
|
|
229
|
-
avatarProps,
|
|
230
|
-
style,
|
|
231
|
-
accessibilityLabel = "Home app bar",
|
|
232
|
-
accessibilityHint,
|
|
233
|
-
...rest
|
|
234
|
-
}) {
|
|
235
|
-
const {
|
|
236
|
-
modes: globalModes
|
|
237
|
-
} = (0, _JFSThemeProvider.useTokens)();
|
|
238
|
-
const modes = {
|
|
239
|
-
...globalModes,
|
|
240
|
-
...propModes
|
|
241
|
-
};
|
|
242
|
-
|
|
243
|
-
// Resolve container tokens
|
|
244
|
-
const paddingHorizontal = (0, _figmaVariablesResolver.getVariableByName)('appBarHome/padding/horizontal', modes) ?? 16;
|
|
245
|
-
const paddingVertical = (0, _figmaVariablesResolver.getVariableByName)('appBarHome/padding/vertical', modes) ?? 16;
|
|
246
|
-
const actionsGap = (0, _figmaVariablesResolver.getVariableByName)('appBarHome/actions/gap', modes) ?? 0;
|
|
247
|
-
const containerStyle = {
|
|
248
|
-
flexDirection: 'row',
|
|
249
|
-
alignItems: 'center',
|
|
250
|
-
justifyContent: 'space-between',
|
|
251
|
-
paddingHorizontal,
|
|
252
|
-
paddingVertical,
|
|
253
|
-
width: '100%'
|
|
254
|
-
};
|
|
255
|
-
const homeActionsRowStyle = {
|
|
256
|
-
flexDirection: 'row',
|
|
257
|
-
gap: actionsGap,
|
|
258
|
-
alignItems: 'center'
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
// Default leading: IconButton with customizable icon
|
|
262
|
-
// The IconButton already handles its own circular styling, so we just use it directly
|
|
263
|
-
const defaultLeading = leading ?? /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
264
|
-
iconName: leadingIconName,
|
|
265
|
-
modes: modes,
|
|
266
|
-
...(onLeadingPress !== undefined ? {
|
|
267
|
-
onPress: onLeadingPress
|
|
268
|
-
} : {}),
|
|
269
|
-
accessibilityLabel: "Home",
|
|
270
|
-
accessibilityHint: "Opens home menu"
|
|
271
|
-
});
|
|
272
|
-
|
|
273
|
-
// Default actions: Search and Notification IconButtons
|
|
274
|
-
const defaultActions = actionsSlot ?? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
275
|
-
style: homeActionsRowStyle,
|
|
276
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
277
|
-
iconName: "ic_search",
|
|
278
|
-
modes: modes,
|
|
279
|
-
onPress: () => {},
|
|
280
|
-
accessibilityLabel: "Search",
|
|
281
|
-
accessibilityHint: "Opens search screen"
|
|
282
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
283
|
-
iconName: "ic_notification",
|
|
284
|
-
modes: modes,
|
|
285
|
-
onPress: () => {},
|
|
286
|
-
accessibilityLabel: "Notifications",
|
|
287
|
-
accessibilityHint: "Opens notifications"
|
|
288
|
-
})]
|
|
289
|
-
});
|
|
290
|
-
|
|
291
|
-
// Clone slot children and pass modes to all children that accept it
|
|
292
|
-
const processedActionsSlot = actionsSlot ? cloneChildrenWithModes(_react.default.Children.toArray(actionsSlot), modes) : defaultActions;
|
|
293
|
-
|
|
294
|
-
// Process leading if it's a React element
|
|
295
|
-
const processedLeading = /*#__PURE__*/_react.default.isValidElement(leading) ? cloneChildrenWithModes([leading], modes)[0] : defaultLeading;
|
|
296
|
-
|
|
297
|
-
// Process avatar with modes
|
|
298
|
-
const avatarModes = avatarProps?.modes ? {
|
|
299
|
-
...modes,
|
|
300
|
-
...avatarProps.modes
|
|
301
|
-
} : modes;
|
|
302
|
-
const processedAvatar = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.default, {
|
|
303
|
-
...(avatarProps ?? {}),
|
|
304
|
-
modes: avatarModes
|
|
305
|
-
});
|
|
306
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
307
|
-
style: [containerStyle, style],
|
|
308
|
-
accessibilityRole: "header",
|
|
309
|
-
accessibilityLabel: accessibilityLabel,
|
|
310
|
-
...(accessibilityHint !== undefined ? {
|
|
311
|
-
accessibilityHint
|
|
312
|
-
} : {}),
|
|
313
|
-
...rest,
|
|
314
|
-
children: [processedLeading, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
315
|
-
style: homeActionsRowStyle,
|
|
316
|
-
children: [processedActionsSlot, processedAvatar]
|
|
178
|
+
style: actionsStyle,
|
|
179
|
+
children: processedActions
|
|
317
180
|
})]
|
|
318
181
|
});
|
|
319
182
|
}
|
|
320
|
-
var _default = exports.default = AppBar;
|
|
321
183
|
//# sourceMappingURL=AppBar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_figmaVariablesResolver","_JFSThemeProvider","_NavArrow","_jsxRuntime","e","__esModule","default","cloneChildrenWithModes","children","modes","React","Children","map","child","isValidElement","childChildren","props","hasChildren","undefined","existingModes","mergedModes","processedChildren","toArray","cloneElement","filter","AppBar","type","leadingSlot","middleSlot","actionsSlot","propModes","onLeadingPress","style","accessibilityLabel","accessibilityHint","rest","globalModes","useTokens","isMain","isSub","paddingHorizontal","getVariableByName","paddingVertical","backgroundColor","actionsGap","containerStyle","flexDirection","alignItems","justifyContent","defaultLeading","jsx","Pressable","onPress","hitSlop","accessibilityRole","pressed","opacity","direction","processedLeading","processedMiddle","actionsStyle","gap","processedActions","View","jsxs","position","left","right","top","bottom","zIndex","pointerEvents"],"sourceRoot":"../../../../src","sources":["components/AppBar/AppBar.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,uBAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AAGA,IAAAI,SAAA,GAAAL,sBAAA,CAAAC,OAAA;AAA2C,IAAAK,WAAA,GAAAL,OAAA;AAAA,SAAAD,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAC3C;AACA;;AAEA;AACA;AACA,GACA,SAASG,sBAAsBA,CAC7BC,QAAyB,EACzBC,KAA0B,EACP;EACnB,OAAOC,cAAK,CAACC,QAAQ,CAACC,GAAG,CAACJ,QAAQ,EAAGK,KAAK,IAAK;IAC7C,IAAI,eAACH,cAAK,CAACI,cAAc,CAACD,KAAK,CAAC,EAAE;MAChC,OAAOA,KAAK;IACd;;IAEA;IACA,MAAME,aAAa,GAAIF,KAAK,CAACG,KAAK,EAAUR,QAAQ;IACpD,MAAMS,WAAW,GAAGF,aAAa,KAAKG,SAAS,IAAIH,aAAa,KAAK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