jfs-components 0.0.62 → 0.0.63
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 +36 -0
- package/lib/commonjs/components/Accordion/Accordion.js +1 -1
- package/lib/commonjs/components/ActionFooter/ActionFooter.js +1 -1
- package/lib/commonjs/components/ActionTile/ActionTile.js +2 -1
- package/lib/commonjs/components/AmountInput/AmountInput.js +2 -1
- package/lib/commonjs/components/AppBar/AppBar.js +1 -1
- package/lib/commonjs/components/Avatar/Avatar.js +184 -162
- package/lib/commonjs/components/AvatarGroup/AvatarGroup.js +1 -1
- package/lib/commonjs/components/Badge/Badge.js +2 -1
- package/lib/commonjs/components/Balance/Balance.js +2 -1
- package/lib/commonjs/components/BottomNav/BottomNav.js +2 -1
- package/lib/commonjs/components/BottomNavItem/BottomNavItem.js +106 -86
- package/lib/commonjs/components/Button/Button.js +190 -93
- package/lib/commonjs/components/ButtonGroup/ButtonGroup.js +1 -1
- package/lib/commonjs/components/Card/Card.js +2 -1
- package/lib/commonjs/components/CardCTA/CardCTA.js +1 -1
- package/lib/commonjs/components/CardProviderInfo/CardProviderInfo.js +1 -1
- package/lib/commonjs/components/Carousel/Carousel.js +3 -2
- package/lib/commonjs/components/Checkbox/Checkbox.js +2 -1
- package/lib/commonjs/components/ChipGroup/ChipGroup.js +1 -1
- package/lib/commonjs/components/ChipSelect/ChipSelect.js +2 -1
- package/lib/commonjs/components/DebitCard/DebitCard.js +1 -1
- package/lib/commonjs/components/Disclaimer/Disclaimer.js +2 -1
- package/lib/commonjs/components/Divider/Divider.js +2 -1
- package/lib/commonjs/components/Drawer/Drawer.js +2 -1
- package/lib/commonjs/components/EmptyState/EmptyState.js +2 -1
- package/lib/commonjs/components/FilterBar/FilterBar.js +1 -1
- package/lib/commonjs/components/Form/Form.js +2 -1
- package/lib/commonjs/components/FormField/FormField.js +3 -2
- package/lib/commonjs/components/HStack/HStack.js +1 -1
- package/lib/commonjs/components/HoldingsCard/HoldingsCard.js +2 -1
- package/lib/commonjs/components/IconButton/IconButton.js +118 -128
- package/lib/commonjs/components/IconCapsule/IconCapsule.js +61 -57
- package/lib/commonjs/components/InputSearch/InputSearch.js +7 -3
- package/lib/commonjs/components/LazyList/LazyList.js +1 -1
- package/lib/commonjs/components/LinearMeter/LinearMeter.js +3 -2
- package/lib/commonjs/components/ListGroup/ListGroup.js +1 -1
- package/lib/commonjs/components/ListItem/ListItem.js +190 -142
- package/lib/commonjs/components/MediaCard/MediaCard.js +3 -3
- package/lib/commonjs/components/MerchantProfile/MerchantProfile.js +2 -1
- package/lib/commonjs/components/MoneyValue/MoneyValue.js +2 -1
- package/lib/commonjs/components/NavArrow/NavArrow.js +82 -59
- package/lib/commonjs/components/NoteInput/NoteInput.js +2 -1
- package/lib/commonjs/components/Nudge/Nudge.js +1 -1
- package/lib/commonjs/components/Numpad/Numpad.js +2 -1
- package/lib/commonjs/components/OTP/OTP.js +1 -1
- package/lib/commonjs/components/PaymentFeedback/PaymentFeedback.js +2 -1
- package/lib/commonjs/components/Popup/Popup.js +2 -1
- package/lib/commonjs/components/ProductLabel/ProductLabel.js +2 -1
- package/lib/commonjs/components/ProgressBadge/ProgressBadge.js +2 -1
- package/lib/commonjs/components/RadioButton/RadioButton.js +2 -1
- package/lib/commonjs/components/RechargeCard/RechargeCard.js +2 -1
- package/lib/commonjs/components/Screen/Screen.js +1 -1
- package/lib/commonjs/components/Section/Section.js +268 -156
- package/lib/commonjs/components/SegmentedControl/SegmentedControl.js +3 -2
- package/lib/commonjs/components/StatItem/StatItem.js +2 -1
- package/lib/commonjs/components/StatusHero/StatusHero.js +2 -1
- package/lib/commonjs/components/Stepper/Step.js +2 -1
- package/lib/commonjs/components/Stepper/StepLabel.js +2 -1
- package/lib/commonjs/components/Stepper/Stepper.js +2 -1
- package/lib/commonjs/components/SupportText/SupportText.js +2 -1
- package/lib/commonjs/components/SupportText/SupportTextIcon.js +2 -1
- package/lib/commonjs/components/SwappableAmount/SwappableAmount.js +2 -1
- package/lib/commonjs/components/Tabs/TabItem.js +2 -1
- package/lib/commonjs/components/Tabs/Tabs.js +2 -1
- package/lib/commonjs/components/Text/Text.js +2 -1
- package/lib/commonjs/components/TextInput/TextInput.js +2 -2
- package/lib/commonjs/components/ThreadHero/ThreadHero.js +2 -1
- package/lib/commonjs/components/Title/Title.js +2 -1
- package/lib/commonjs/components/Toast/Toast.js +2 -1
- package/lib/commonjs/components/Toggle/Toggle.js +2 -1
- package/lib/commonjs/components/Tooltip/Tooltip.js +2 -1
- package/lib/commonjs/components/TransactionBubble/TransactionBubble.js +1 -1
- package/lib/commonjs/components/TransactionDetails/TransactionDetails.js +2 -2
- package/lib/commonjs/components/TransactionStatus/TransactionStatus.js +3 -2
- package/lib/commonjs/components/UpiHandle/UpiHandle.js +144 -110
- package/lib/commonjs/components/VStack/VStack.js +1 -1
- package/lib/commonjs/design-tokens/figma-variables-resolver.js +21 -3
- package/lib/commonjs/icons/registry.js +1 -1
- package/lib/commonjs/utils/react-utils.js +17 -0
- package/lib/module/components/Accordion/Accordion.js +2 -2
- package/lib/module/components/ActionFooter/ActionFooter.js +2 -2
- package/lib/module/components/ActionTile/ActionTile.js +2 -1
- package/lib/module/components/AmountInput/AmountInput.js +2 -1
- package/lib/module/components/AppBar/AppBar.js +2 -2
- package/lib/module/components/Avatar/Avatar.js +184 -162
- package/lib/module/components/AvatarGroup/AvatarGroup.js +2 -2
- package/lib/module/components/Badge/Badge.js +2 -1
- package/lib/module/components/Balance/Balance.js +2 -1
- package/lib/module/components/BottomNav/BottomNav.js +2 -1
- package/lib/module/components/BottomNavItem/BottomNavItem.js +108 -88
- package/lib/module/components/Button/Button.js +192 -95
- package/lib/module/components/ButtonGroup/ButtonGroup.js +2 -2
- package/lib/module/components/Card/Card.js +2 -1
- package/lib/module/components/CardCTA/CardCTA.js +2 -2
- package/lib/module/components/CardProviderInfo/CardProviderInfo.js +2 -2
- package/lib/module/components/Carousel/Carousel.js +3 -2
- package/lib/module/components/Checkbox/Checkbox.js +2 -1
- package/lib/module/components/ChipGroup/ChipGroup.js +2 -2
- package/lib/module/components/ChipSelect/ChipSelect.js +2 -1
- package/lib/module/components/DebitCard/DebitCard.js +2 -2
- package/lib/module/components/Disclaimer/Disclaimer.js +2 -1
- package/lib/module/components/Divider/Divider.js +2 -1
- package/lib/module/components/Drawer/Drawer.js +2 -1
- package/lib/module/components/EmptyState/EmptyState.js +2 -1
- package/lib/module/components/FilterBar/FilterBar.js +2 -2
- package/lib/module/components/Form/Form.js +2 -1
- package/lib/module/components/FormField/FormField.js +3 -2
- package/lib/module/components/HStack/HStack.js +2 -2
- package/lib/module/components/HoldingsCard/HoldingsCard.js +2 -1
- package/lib/module/components/IconButton/IconButton.js +120 -130
- package/lib/module/components/IconCapsule/IconCapsule.js +60 -57
- package/lib/module/components/InputSearch/InputSearch.js +7 -3
- package/lib/module/components/LazyList/LazyList.js +2 -2
- package/lib/module/components/LinearMeter/LinearMeter.js +3 -2
- package/lib/module/components/ListGroup/ListGroup.js +2 -2
- package/lib/module/components/ListItem/ListItem.js +194 -146
- package/lib/module/components/MediaCard/MediaCard.js +4 -2
- package/lib/module/components/MerchantProfile/MerchantProfile.js +2 -1
- package/lib/module/components/MoneyValue/MoneyValue.js +2 -1
- package/lib/module/components/NavArrow/NavArrow.js +82 -58
- package/lib/module/components/NoteInput/NoteInput.js +2 -1
- package/lib/module/components/Nudge/Nudge.js +2 -2
- package/lib/module/components/Numpad/Numpad.js +2 -1
- package/lib/module/components/OTP/OTP.js +2 -2
- package/lib/module/components/PaymentFeedback/PaymentFeedback.js +2 -1
- package/lib/module/components/Popup/Popup.js +2 -1
- package/lib/module/components/ProductLabel/ProductLabel.js +2 -1
- package/lib/module/components/ProgressBadge/ProgressBadge.js +2 -1
- package/lib/module/components/RadioButton/RadioButton.js +2 -1
- package/lib/module/components/RechargeCard/RechargeCard.js +2 -1
- package/lib/module/components/Screen/Screen.js +2 -2
- package/lib/module/components/Section/Section.js +271 -159
- package/lib/module/components/SegmentedControl/SegmentedControl.js +3 -2
- package/lib/module/components/StatItem/StatItem.js +2 -1
- package/lib/module/components/StatusHero/StatusHero.js +2 -1
- package/lib/module/components/Stepper/Step.js +2 -1
- package/lib/module/components/Stepper/StepLabel.js +2 -1
- package/lib/module/components/Stepper/Stepper.js +2 -1
- package/lib/module/components/SupportText/SupportText.js +2 -1
- package/lib/module/components/SupportText/SupportTextIcon.js +2 -1
- package/lib/module/components/SwappableAmount/SwappableAmount.js +2 -1
- package/lib/module/components/Tabs/TabItem.js +2 -1
- package/lib/module/components/Tabs/Tabs.js +2 -1
- package/lib/module/components/Text/Text.js +2 -1
- package/lib/module/components/TextInput/TextInput.js +3 -3
- package/lib/module/components/ThreadHero/ThreadHero.js +2 -1
- package/lib/module/components/Title/Title.js +2 -1
- package/lib/module/components/Toast/Toast.js +2 -1
- package/lib/module/components/Toggle/Toggle.js +2 -1
- package/lib/module/components/Tooltip/Tooltip.js +2 -1
- package/lib/module/components/TransactionBubble/TransactionBubble.js +2 -2
- package/lib/module/components/TransactionDetails/TransactionDetails.js +3 -3
- package/lib/module/components/TransactionStatus/TransactionStatus.js +3 -2
- package/lib/module/components/UpiHandle/UpiHandle.js +147 -113
- package/lib/module/components/VStack/VStack.js +2 -2
- package/lib/module/design-tokens/figma-variables-resolver.js +21 -3
- package/lib/module/icons/registry.js +1 -1
- package/lib/module/utils/react-utils.js +16 -0
- package/lib/typescript/src/components/Avatar/Avatar.d.ts +11 -17
- package/lib/typescript/src/components/BottomNavItem/BottomNavItem.d.ts +12 -8
- package/lib/typescript/src/components/Button/Button.d.ts +18 -1
- package/lib/typescript/src/components/IconButton/IconButton.d.ts +12 -29
- package/lib/typescript/src/components/IconCapsule/IconCapsule.d.ts +10 -18
- package/lib/typescript/src/components/InputSearch/InputSearch.d.ts +8 -3
- package/lib/typescript/src/components/ListItem/ListItem.d.ts +14 -1
- package/lib/typescript/src/components/NavArrow/NavArrow.d.ts +12 -11
- package/lib/typescript/src/components/Section/Section.d.ts +2 -48
- package/lib/typescript/src/components/UpiHandle/UpiHandle.d.ts +13 -12
- package/lib/typescript/src/icons/registry.d.ts +1 -1
- package/lib/typescript/src/utils/react-utils.d.ts +15 -0
- package/package.json +4 -6
- package/src/components/Accordion/Accordion.tsx +2 -2
- package/src/components/ActionFooter/ActionFooter.tsx +2 -2
- package/src/components/ActionTile/ActionTile.tsx +2 -1
- package/src/components/AmountInput/AmountInput.tsx +2 -1
- package/src/components/AppBar/AppBar.tsx +2 -2
- package/src/components/Avatar/Avatar.tsx +229 -158
- package/src/components/AvatarGroup/AvatarGroup.tsx +2 -2
- package/src/components/Badge/Badge.tsx +2 -1
- package/src/components/Balance/Balance.tsx +2 -1
- package/src/components/BottomNav/BottomNav.tsx +2 -1
- package/src/components/BottomNavItem/BottomNavItem.tsx +159 -88
- package/src/components/Button/Button.tsx +228 -101
- package/src/components/ButtonGroup/ButtonGroup.tsx +2 -2
- package/src/components/Card/Card.tsx +2 -1
- package/src/components/CardCTA/CardCTA.tsx +2 -2
- package/src/components/CardProviderInfo/CardProviderInfo.tsx +2 -2
- package/src/components/Carousel/Carousel.tsx +3 -2
- package/src/components/Checkbox/Checkbox.tsx +2 -1
- package/src/components/ChipGroup/ChipGroup.tsx +2 -2
- package/src/components/ChipSelect/ChipSelect.tsx +2 -1
- package/src/components/DebitCard/DebitCard.tsx +2 -2
- package/src/components/Disclaimer/Disclaimer.tsx +2 -1
- package/src/components/Divider/Divider.tsx +2 -1
- package/src/components/Drawer/Drawer.tsx +2 -1
- package/src/components/EmptyState/EmptyState.tsx +2 -1
- package/src/components/FilterBar/FilterBar.tsx +2 -2
- package/src/components/Form/Form.tsx +2 -1
- package/src/components/FormField/FormField.tsx +3 -2
- package/src/components/HStack/HStack.tsx +2 -2
- package/src/components/HoldingsCard/HoldingsCard.tsx +2 -1
- package/src/components/IconButton/IconButton.tsx +154 -126
- package/src/components/IconCapsule/IconCapsule.tsx +73 -54
- package/src/components/InputSearch/InputSearch.tsx +19 -5
- package/src/components/LazyList/LazyList.tsx +2 -2
- package/src/components/LinearMeter/LinearMeter.tsx +3 -2
- package/src/components/ListGroup/ListGroup.tsx +2 -2
- package/src/components/ListItem/ListItem.tsx +257 -187
- package/src/components/MediaCard/MediaCard.tsx +2 -1
- package/src/components/MerchantProfile/MerchantProfile.tsx +2 -1
- package/src/components/MoneyValue/MoneyValue.tsx +2 -1
- package/src/components/NavArrow/NavArrow.tsx +91 -58
- package/src/components/NoteInput/NoteInput.tsx +2 -1
- package/src/components/Nudge/Nudge.tsx +2 -2
- package/src/components/Numpad/Numpad.tsx +2 -1
- package/src/components/OTP/OTP.tsx +2 -2
- package/src/components/PaymentFeedback/PaymentFeedback.tsx +2 -1
- package/src/components/Popup/Popup.tsx +2 -1
- package/src/components/ProductLabel/ProductLabel.tsx +2 -1
- package/src/components/ProgressBadge/ProgressBadge.tsx +2 -2
- package/src/components/RadioButton/RadioButton.tsx +2 -1
- package/src/components/RechargeCard/RechargeCard.tsx +2 -1
- package/src/components/Screen/Screen.tsx +2 -2
- package/src/components/Section/Section.tsx +323 -167
- package/src/components/SegmentedControl/SegmentedControl.tsx +3 -2
- package/src/components/StatItem/StatItem.tsx +2 -1
- package/src/components/StatusHero/StatusHero.tsx +2 -1
- package/src/components/Stepper/Step.tsx +2 -1
- package/src/components/Stepper/StepLabel.tsx +2 -1
- package/src/components/Stepper/Stepper.tsx +2 -1
- package/src/components/SupportText/SupportText.tsx +2 -1
- package/src/components/SupportText/SupportTextIcon.tsx +2 -1
- package/src/components/SwappableAmount/SwappableAmount.tsx +2 -1
- package/src/components/Tabs/TabItem.tsx +2 -1
- package/src/components/Tabs/Tabs.tsx +2 -1
- package/src/components/Text/Text.tsx +2 -1
- package/src/components/TextInput/TextInput.tsx +3 -3
- package/src/components/ThreadHero/ThreadHero.tsx +2 -1
- package/src/components/Title/Title.tsx +2 -1
- package/src/components/Toast/Toast.tsx +2 -1
- package/src/components/Toggle/Toggle.tsx +2 -1
- package/src/components/Tooltip/Tooltip.tsx +2 -1
- package/src/components/TransactionBubble/TransactionBubble.tsx +2 -2
- package/src/components/TransactionDetails/TransactionDetails.tsx +3 -3
- package/src/components/TransactionStatus/TransactionStatus.tsx +3 -2
- package/src/components/UpiHandle/UpiHandle.tsx +193 -125
- package/src/components/VStack/VStack.tsx +2 -2
- package/src/design-tokens/figma-variables-resolver.ts +21 -3
- package/src/icons/registry.ts +1 -1
- package/src/utils/react-utils.ts +16 -0
- package/lib/typescript/App.d.ts +0 -2
- package/lib/typescript/index.d.ts +0 -2
- package/lib/typescript/metro.config.d.ts +0 -78
- package/lib/typescript/react-native.config.d.ts +0 -4
|
@@ -10,6 +10,7 @@ exports.default = void 0;
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _reactNative = require("react-native");
|
|
12
12
|
var _figmaVariablesResolver = require("../../design-tokens/figma-variables-resolver");
|
|
13
|
+
var _reactUtils = require("../../utils/react-utils");
|
|
13
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
15
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
15
16
|
// ---------------------------------------------------------------------------
|
|
@@ -17,7 +18,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
17
18
|
// ---------------------------------------------------------------------------
|
|
18
19
|
|
|
19
20
|
const CarouselContext = /*#__PURE__*/(0, _react.createContext)({
|
|
20
|
-
modes:
|
|
21
|
+
modes: _reactUtils.EMPTY_MODES,
|
|
21
22
|
activeIndex: 0,
|
|
22
23
|
totalItems: 0,
|
|
23
24
|
goTo: () => {},
|
|
@@ -35,7 +36,7 @@ const CarouselContext = /*#__PURE__*/(0, _react.createContext)({
|
|
|
35
36
|
|
|
36
37
|
function Carousel({
|
|
37
38
|
children,
|
|
38
|
-
modes =
|
|
39
|
+
modes = _reactUtils.EMPTY_MODES,
|
|
39
40
|
autoPlay = false,
|
|
40
41
|
autoPlayInterval = 4000,
|
|
41
42
|
showPagination = true,
|
|
@@ -8,6 +8,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _reactNativeSvg = _interopRequireWildcard(require("react-native-svg"));
|
|
10
10
|
var _figmaVariablesResolver = require("../../design-tokens/figma-variables-resolver");
|
|
11
|
+
var _reactUtils = require("../../utils/react-utils");
|
|
11
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
13
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
14
|
/**
|
|
@@ -63,7 +64,7 @@ function Checkbox({
|
|
|
63
64
|
defaultChecked = false,
|
|
64
65
|
onValueChange,
|
|
65
66
|
disabled = false,
|
|
66
|
-
modes =
|
|
67
|
+
modes = _reactUtils.EMPTY_MODES,
|
|
67
68
|
style,
|
|
68
69
|
accessibilityLabel
|
|
69
70
|
}) {
|
|
@@ -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 _Icon = _interopRequireDefault(require("../../icons/Icon"));
|
|
11
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -18,7 +19,7 @@ function ChipSelect({
|
|
|
18
19
|
label = 'Date',
|
|
19
20
|
active = false,
|
|
20
21
|
icon = 'ic_calendar_week',
|
|
21
|
-
modes =
|
|
22
|
+
modes = _reactUtils.EMPTY_MODES,
|
|
22
23
|
style,
|
|
23
24
|
labelSlot,
|
|
24
25
|
onPress
|
|
@@ -8,6 +8,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _figmaVariablesResolver = require("../../design-tokens/figma-variables-resolver");
|
|
10
10
|
var _JFSThemeProvider = require("../../design-tokens/JFSThemeProvider");
|
|
11
|
+
var _reactUtils = require("../../utils/react-utils");
|
|
11
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
14
|
/**
|
|
@@ -33,7 +34,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
33
34
|
*/
|
|
34
35
|
function Disclaimer({
|
|
35
36
|
disclaimer = 'All financial services are provided by Jio Payments Bank Pvt. Ltd.',
|
|
36
|
-
modes: propModes =
|
|
37
|
+
modes: propModes = _reactUtils.EMPTY_MODES,
|
|
37
38
|
style,
|
|
38
39
|
textStyle,
|
|
39
40
|
accessibilityLabel,
|
|
@@ -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
|
/**
|
|
@@ -36,7 +37,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
36
37
|
*/
|
|
37
38
|
function Divider({
|
|
38
39
|
direction = 'horizontal',
|
|
39
|
-
modes =
|
|
40
|
+
modes = _reactUtils.EMPTY_MODES,
|
|
40
41
|
style,
|
|
41
42
|
accessibilityLabel = undefined
|
|
42
43
|
}) {
|
|
@@ -9,6 +9,7 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
var _reactNativeGestureHandler = require("react-native-gesture-handler");
|
|
10
10
|
var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
|
|
11
11
|
var _figmaVariablesResolver = require("../../design-tokens/figma-variables-resolver");
|
|
12
|
+
var _reactUtils = require("../../utils/react-utils");
|
|
12
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
14
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
15
|
const AnimatedScrollView = _reactNativeReanimated.default.createAnimatedComponent(_reactNativeGestureHandler.ScrollView);
|
|
@@ -49,7 +50,7 @@ function rubberBand(value, min, max, friction = 0.55) {
|
|
|
49
50
|
* Uses react-native-gesture-handler and react-native-reanimated.
|
|
50
51
|
*/
|
|
51
52
|
function Drawer({
|
|
52
|
-
modes =
|
|
53
|
+
modes = _reactUtils.EMPTY_MODES,
|
|
53
54
|
style,
|
|
54
55
|
title,
|
|
55
56
|
header,
|
|
@@ -10,6 +10,7 @@ var _figmaVariablesResolver = require("../../design-tokens/figma-variables-resol
|
|
|
10
10
|
var _JFSThemeProvider = require("../../design-tokens/JFSThemeProvider");
|
|
11
11
|
var _IconCapsule = _interopRequireDefault(require("../IconCapsule/IconCapsule"));
|
|
12
12
|
var _Button = _interopRequireDefault(require("../Button/Button"));
|
|
13
|
+
var _reactUtils = require("../../utils/react-utils");
|
|
13
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
16
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
@@ -24,7 +25,7 @@ function EmptyState({
|
|
|
24
25
|
showDescription = true,
|
|
25
26
|
iconSlot,
|
|
26
27
|
buttonSlot,
|
|
27
|
-
modes: propModes =
|
|
28
|
+
modes: propModes = _reactUtils.EMPTY_MODES,
|
|
28
29
|
style,
|
|
29
30
|
testID
|
|
30
31
|
}) {
|
|
@@ -9,6 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _reactNative = require("react-native");
|
|
10
10
|
var _figmaVariablesResolver = require("../../design-tokens/figma-variables-resolver");
|
|
11
11
|
var _JFSThemeProvider = require("../../design-tokens/JFSThemeProvider");
|
|
12
|
+
var _reactUtils = require("../../utils/react-utils");
|
|
12
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
14
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
15
|
const FormContext = /*#__PURE__*/(0, _react.createContext)(null);
|
|
@@ -19,7 +20,7 @@ function Form({
|
|
|
19
20
|
children,
|
|
20
21
|
validationErrors: externalErrors,
|
|
21
22
|
onSubmit,
|
|
22
|
-
modes: propModes =
|
|
23
|
+
modes: propModes = _reactUtils.EMPTY_MODES,
|
|
23
24
|
style,
|
|
24
25
|
accessibilityLabel,
|
|
25
26
|
testID
|
|
@@ -7,6 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireWildcard(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 _JFSThemeProvider = require("../../design-tokens/JFSThemeProvider");
|
|
11
12
|
var _TextInput = _interopRequireDefault(require("../TextInput/TextInput"));
|
|
12
13
|
var _SupportText = _interopRequireDefault(require("../SupportText/SupportText"));
|
|
@@ -20,7 +21,7 @@ function useFormField(props) {
|
|
|
20
21
|
isInvalid = false,
|
|
21
22
|
supportText,
|
|
22
23
|
errorMessage,
|
|
23
|
-
modes: propModes =
|
|
24
|
+
modes: propModes = _reactUtils.EMPTY_MODES,
|
|
24
25
|
onFocus,
|
|
25
26
|
onBlur
|
|
26
27
|
} = props;
|
|
@@ -146,7 +147,7 @@ function FormField({
|
|
|
146
147
|
isInvalid = false,
|
|
147
148
|
supportText,
|
|
148
149
|
errorMessage,
|
|
149
|
-
modes =
|
|
150
|
+
modes = _reactUtils.EMPTY_MODES,
|
|
150
151
|
style,
|
|
151
152
|
onFocus,
|
|
152
153
|
onBlur,
|
|
@@ -8,6 +8,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _figmaVariablesResolver = require("../../design-tokens/figma-variables-resolver");
|
|
10
10
|
var _RadioButton = _interopRequireDefault(require("../RadioButton/RadioButton"));
|
|
11
|
+
var _reactUtils = require("../../utils/react-utils");
|
|
11
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
14
|
const GRID_COLUMNS = 3;
|
|
@@ -36,7 +37,7 @@ function HoldingsCard({
|
|
|
36
37
|
selected = false,
|
|
37
38
|
disabled = false,
|
|
38
39
|
onPress,
|
|
39
|
-
modes =
|
|
40
|
+
modes = _reactUtils.EMPTY_MODES,
|
|
40
41
|
style,
|
|
41
42
|
testID
|
|
42
43
|
}) {
|
|
@@ -9,44 +9,78 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
var _figmaVariablesResolver = require("../../design-tokens/figma-variables-resolver");
|
|
10
10
|
var _Icon = _interopRequireDefault(require("../../icons/Icon"));
|
|
11
11
|
var _webPlatformUtils = require("../../utils/web-platform-utils");
|
|
12
|
+
var _reactUtils = require("../../utils/react-utils");
|
|
12
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
15
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
// Module-scope constants
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
|
|
20
|
+
const IS_WEB = _reactNative.Platform.OS === 'web';
|
|
21
|
+
const IS_IOS = _reactNative.Platform.OS === 'ios';
|
|
22
|
+
const PRESS_DELAY = IS_IOS ? 130 : 0;
|
|
23
|
+
|
|
24
|
+
// Pressed visual is applied through Pressable's style callback so the host
|
|
25
|
+
// view updates without scheduling a React render. Hover/focus stay mirrored
|
|
26
|
+
// in React state because they're sustained visual states (web only).
|
|
27
|
+
const pressedOverlayStyle = {
|
|
28
|
+
opacity: 0.7
|
|
29
|
+
};
|
|
30
|
+
const hoverOverlayStyle = {
|
|
31
|
+
opacity: 0.85
|
|
32
|
+
};
|
|
33
|
+
const focusOverlayStyle = {
|
|
34
|
+
borderWidth: 1,
|
|
35
|
+
borderColor: '#222'
|
|
36
|
+
};
|
|
37
|
+
function resolveIconButtonTokens(modes, disabled) {
|
|
38
|
+
const radiusRaw = (0, _figmaVariablesResolver.getVariableByName)('iconButton/radius', modes) ?? 9999;
|
|
39
|
+
const padding = (0, _figmaVariablesResolver.getVariableByName)('iconButton/padding', modes) ?? 12;
|
|
40
|
+
const backgroundColor = (0, _figmaVariablesResolver.getVariableByName)('iconButton/background', modes) ?? '#cfa159';
|
|
41
|
+
const borderColor = (0, _figmaVariablesResolver.getVariableByName)('iconButton/border/color', modes) ?? '#ffffff00';
|
|
42
|
+
const borderSize = (0, _figmaVariablesResolver.getVariableByName)('iconButton/border/size', modes) ?? 1;
|
|
43
|
+
const iconColor = (0, _figmaVariablesResolver.getVariableByName)('iconButton/icon/color', modes) ?? '#0f0d0a';
|
|
44
|
+
const iconSize = (0, _figmaVariablesResolver.getVariableByName)('iconButton/icon/size', modes) ?? 18;
|
|
45
|
+
|
|
46
|
+
// 9999 is the design-token sentinel for "perfect circle"
|
|
47
|
+
const buttonSize = padding * 2 + iconSize;
|
|
48
|
+
const borderRadius = radiusRaw === 9999 ? buttonSize / 2 : radiusRaw;
|
|
49
|
+
return {
|
|
50
|
+
baseContainerStyle: {
|
|
51
|
+
width: buttonSize,
|
|
52
|
+
height: buttonSize,
|
|
53
|
+
borderRadius,
|
|
54
|
+
borderWidth: borderSize,
|
|
55
|
+
borderColor,
|
|
56
|
+
backgroundColor,
|
|
57
|
+
overflow: 'hidden',
|
|
58
|
+
alignItems: 'center',
|
|
59
|
+
justifyContent: 'center',
|
|
60
|
+
padding,
|
|
61
|
+
opacity: disabled ? 0.5 : 1
|
|
62
|
+
},
|
|
63
|
+
iconColor,
|
|
64
|
+
iconSize
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
15
68
|
/**
|
|
16
69
|
* IconButton component that displays an icon within a pressable button container.
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* @param {Object} [props.style] - Additional styles for the container
|
|
28
|
-
* @param {string} [props.accessibilityLabel] - Accessibility label for screen readers. If not provided, defaults to iconName
|
|
29
|
-
* @param {string} [props.accessibilityHint] - Additional accessibility hint for screen readers
|
|
30
|
-
* @param {Object} [props.accessibilityState] - Additional accessibility state information
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* ```jsx
|
|
34
|
-
* // Default icon button
|
|
35
|
-
* <IconButton modes={{}} />
|
|
36
|
-
*
|
|
37
|
-
* // Custom icon with size mode
|
|
38
|
-
* <IconButton iconName="ic_rupee" modes={{"Button / Size": "M"}} />
|
|
39
|
-
*
|
|
40
|
-
* // With appearance mode
|
|
41
|
-
* <IconButton modes={{"Appearance": "high"}} onPress={() => console.log('pressed')} />
|
|
42
|
-
*
|
|
43
|
-
* // With accessibility label
|
|
44
|
-
* <IconButton iconName="ic_search" accessibilityLabel={undefined} accessibilityHint="Opens the search screen" />
|
|
45
|
-
* ```
|
|
70
|
+
*
|
|
71
|
+
* Performance notes:
|
|
72
|
+
* - Token reads collapsed into a single `useMemo([modes, disabled, isToggle, isActive])`.
|
|
73
|
+
* - Press visual goes through Pressable's `({ pressed })` style callback so
|
|
74
|
+
* a scroll-cancelled touch never schedules a React render. iOS gets
|
|
75
|
+
* `unstable_pressDelay={130}`.
|
|
76
|
+
* - Hover and focus state are mirrored on web only (gated setters).
|
|
77
|
+
* - The previous version had a redundant `manualPressStyle` (a duplicate
|
|
78
|
+
* pressed transform mirrored via React state) — removed.
|
|
79
|
+
* - Wrapped in `React.memo`.
|
|
46
80
|
*/
|
|
47
81
|
function IconButton({
|
|
48
|
-
iconName =
|
|
49
|
-
modes =
|
|
82
|
+
iconName = 'ic_card',
|
|
83
|
+
modes = _reactUtils.EMPTY_MODES,
|
|
50
84
|
onPress,
|
|
51
85
|
disabled = false,
|
|
52
86
|
style,
|
|
@@ -60,63 +94,30 @@ function IconButton({
|
|
|
60
94
|
isActive = false,
|
|
61
95
|
...rest
|
|
62
96
|
}) {
|
|
97
|
+
// Merge explicit props with modes for token resolution. Memoize the merged
|
|
98
|
+
// object so its identity is stable when none of the inputs change — that
|
|
99
|
+
// keeps the resolver's WeakMap cache hot.
|
|
100
|
+
const componentModes = (0, _react.useMemo)(() => ({
|
|
101
|
+
...modes,
|
|
102
|
+
isToggle,
|
|
103
|
+
isActive
|
|
104
|
+
}), [modes, isToggle, isActive]);
|
|
105
|
+
const tokens = (0, _react.useMemo)(() => resolveIconButtonTokens(componentModes, disabled), [componentModes, disabled]);
|
|
63
106
|
const [isFocused, setIsFocused] = (0, _react.useState)(false);
|
|
64
107
|
const [isHovered, setIsHovered] = (0, _react.useState)(false);
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
'isActive': isActive
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
// Resolve design tokens using only the Figma-defined base tokens for Icon Button (node 72:14)
|
|
76
|
-
const radius = (0, _figmaVariablesResolver.getVariableByName)('iconButton/radius', componentModes) ?? 9999;
|
|
77
|
-
const padding = (0, _figmaVariablesResolver.getVariableByName)('iconButton/padding', componentModes) ?? 12;
|
|
78
|
-
const backgroundColor = (0, _figmaVariablesResolver.getVariableByName)('iconButton/background', componentModes) ?? '#cfa159';
|
|
79
|
-
const borderColor = (0, _figmaVariablesResolver.getVariableByName)('iconButton/border/color', componentModes) ?? '#ffffff00';
|
|
80
|
-
const borderSize = (0, _figmaVariablesResolver.getVariableByName)('iconButton/border/size', componentModes) ?? 1;
|
|
81
|
-
const iconColor = (0, _figmaVariablesResolver.getVariableByName)('iconButton/icon/color', componentModes) ?? '#0f0d0a';
|
|
82
|
-
const iconSize = (0, _figmaVariablesResolver.getVariableByName)('iconButton/icon/size', componentModes) ?? 18;
|
|
108
|
+
const userHandlersRef = (0, _react.useRef)({});
|
|
109
|
+
userHandlersRef.current.onPressIn = rest?.onPressIn;
|
|
110
|
+
userHandlersRef.current.onPressOut = rest?.onPressOut;
|
|
111
|
+
userHandlersRef.current.onFocus = rest?.onFocus;
|
|
112
|
+
userHandlersRef.current.onBlur = rest?.onBlur;
|
|
113
|
+
userHandlersRef.current.onHoverIn = rest?.onHoverIn;
|
|
114
|
+
userHandlersRef.current.onHoverOut = rest?.onHoverOut;
|
|
83
115
|
|
|
84
116
|
// Determine which icon to display
|
|
85
|
-
|
|
86
|
-
// Otherwise use standard iconName
|
|
87
|
-
let finalIconName = iconName;
|
|
88
|
-
if (isToggle) {
|
|
89
|
-
if (isActive && activeIcon) {
|
|
90
|
-
finalIconName = activeIcon;
|
|
91
|
-
} else if (!isActive && inactiveIcon) {
|
|
92
|
-
finalIconName = inactiveIcon;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// Convert radius to React Native format (if 9999, use padding*2 for perfect circle)
|
|
97
|
-
// For a button, the size is determined by padding, so radius should be padding*2 for a circle
|
|
98
|
-
const buttonSize = padding * 2 + iconSize;
|
|
99
|
-
const borderRadius = radius === 9999 ? buttonSize / 2 : radius;
|
|
100
|
-
|
|
101
|
-
// Container base style
|
|
102
|
-
const baseContainerStyle = {
|
|
103
|
-
width: buttonSize,
|
|
104
|
-
height: buttonSize,
|
|
105
|
-
borderRadius: borderRadius,
|
|
106
|
-
borderWidth: borderSize,
|
|
107
|
-
borderColor: borderColor,
|
|
108
|
-
backgroundColor: backgroundColor,
|
|
109
|
-
overflow: 'hidden',
|
|
110
|
-
alignItems: 'center',
|
|
111
|
-
justifyContent: 'center',
|
|
112
|
-
padding: padding,
|
|
113
|
-
opacity: disabled ? 0.5 : 1
|
|
114
|
-
};
|
|
117
|
+
const finalIconName = isToggle ? isActive && activeIcon ? activeIcon : !isActive && inactiveIcon ? inactiveIcon : iconName : iconName;
|
|
115
118
|
|
|
116
119
|
// Generate default accessibility label from icon name if not provided
|
|
117
120
|
const defaultAccessibilityLabel = accessibilityLabel || iconName.replace(/^ic_/, '').replace(/_/g, ' ').replace(/\b\w/g, l => l.toUpperCase());
|
|
118
|
-
|
|
119
|
-
// Get web platform support props
|
|
120
121
|
const webProps = (0, _webPlatformUtils.usePressableWebSupport)({
|
|
121
122
|
restProps: rest,
|
|
122
123
|
onPress: disabled ? undefined : onPress,
|
|
@@ -124,6 +125,31 @@ function IconButton({
|
|
|
124
125
|
accessibilityLabel: defaultAccessibilityLabel,
|
|
125
126
|
webAccessibilityProps
|
|
126
127
|
});
|
|
128
|
+
const handlePressIn = (0, _react.useCallback)(e => {
|
|
129
|
+
userHandlersRef.current.onPressIn?.(e);
|
|
130
|
+
}, []);
|
|
131
|
+
const handlePressOut = (0, _react.useCallback)(e => {
|
|
132
|
+
userHandlersRef.current.onPressOut?.(e);
|
|
133
|
+
}, []);
|
|
134
|
+
const handleFocus = (0, _react.useCallback)(e => {
|
|
135
|
+
if (IS_WEB) setIsFocused(true);
|
|
136
|
+
userHandlersRef.current.onFocus?.(e);
|
|
137
|
+
}, []);
|
|
138
|
+
const handleBlur = (0, _react.useCallback)(e => {
|
|
139
|
+
if (IS_WEB) setIsFocused(false);
|
|
140
|
+
userHandlersRef.current.onBlur?.(e);
|
|
141
|
+
}, []);
|
|
142
|
+
const handleHoverIn = (0, _react.useCallback)(e => {
|
|
143
|
+
if (IS_WEB) setIsHovered(true);
|
|
144
|
+
userHandlersRef.current.onHoverIn?.(e);
|
|
145
|
+
}, []);
|
|
146
|
+
const handleHoverOut = (0, _react.useCallback)(e => {
|
|
147
|
+
if (IS_WEB) setIsHovered(false);
|
|
148
|
+
userHandlersRef.current.onHoverOut?.(e);
|
|
149
|
+
}, []);
|
|
150
|
+
const styleCallback = (0, _react.useCallback)(({
|
|
151
|
+
pressed
|
|
152
|
+
}) => [tokens.baseContainerStyle, style, pressed && !disabled ? pressedOverlayStyle : null, isHovered && !disabled ? hoverOverlayStyle : null, isFocused && !disabled ? focusOverlayStyle : null], [tokens.baseContainerStyle, style, isHovered, isFocused, disabled]);
|
|
127
153
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
128
154
|
accessibilityRole: "button",
|
|
129
155
|
accessibilityLabel: undefined,
|
|
@@ -134,58 +160,22 @@ function IconButton({
|
|
|
134
160
|
},
|
|
135
161
|
onPress: onPress,
|
|
136
162
|
disabled: disabled,
|
|
137
|
-
onPressIn:
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
onFocus: e => {
|
|
146
|
-
setIsFocused(true);
|
|
147
|
-
rest?.onFocus?.(e);
|
|
148
|
-
},
|
|
149
|
-
onBlur: e => {
|
|
150
|
-
setIsFocused(false);
|
|
151
|
-
rest?.onBlur?.(e);
|
|
152
|
-
},
|
|
153
|
-
onHoverIn: e => {
|
|
154
|
-
setIsHovered(true);
|
|
155
|
-
rest?.onHoverIn?.(e);
|
|
156
|
-
},
|
|
157
|
-
onHoverOut: e => {
|
|
158
|
-
setIsHovered(false);
|
|
159
|
-
rest?.onHoverOut?.(e);
|
|
160
|
-
},
|
|
161
|
-
style: ({
|
|
162
|
-
pressed
|
|
163
|
-
}) => {
|
|
164
|
-
const pressedStyle = pressed && !disabled ? {
|
|
165
|
-
opacity: 0.7
|
|
166
|
-
} : null;
|
|
167
|
-
const hoverStyle = isHovered && !disabled ? {
|
|
168
|
-
opacity: 0.85
|
|
169
|
-
} : null;
|
|
170
|
-
const focusStyle = isFocused && !disabled ? {
|
|
171
|
-
borderWidth: 1,
|
|
172
|
-
borderColor: '#222'
|
|
173
|
-
} : null;
|
|
174
|
-
const manualPressStyle = isPressed && !disabled ? {
|
|
175
|
-
transform: [{
|
|
176
|
-
scale: 0.98
|
|
177
|
-
}]
|
|
178
|
-
} : null;
|
|
179
|
-
return [baseContainerStyle, style, pressedStyle, hoverStyle, focusStyle, manualPressStyle];
|
|
180
|
-
},
|
|
163
|
+
onPressIn: handlePressIn,
|
|
164
|
+
onPressOut: handlePressOut,
|
|
165
|
+
onFocus: handleFocus,
|
|
166
|
+
onBlur: handleBlur,
|
|
167
|
+
onHoverIn: handleHoverIn,
|
|
168
|
+
onHoverOut: handleHoverOut,
|
|
169
|
+
unstable_pressDelay: PRESS_DELAY,
|
|
170
|
+
style: styleCallback,
|
|
181
171
|
...webProps,
|
|
182
172
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
183
173
|
name: finalIconName,
|
|
184
|
-
size: iconSize,
|
|
185
|
-
color: iconColor,
|
|
174
|
+
size: tokens.iconSize,
|
|
175
|
+
color: tokens.iconColor,
|
|
186
176
|
accessibilityElementsHidden: true,
|
|
187
177
|
importantForAccessibility: "no"
|
|
188
178
|
})
|
|
189
179
|
});
|
|
190
180
|
}
|
|
191
|
-
var _default = exports.default = IconButton;
|
|
181
|
+
var _default = exports.default = /*#__PURE__*/_react.default.memo(IconButton);
|