@metamask-previews/design-system-react-native 0.46.0-preview.fa32350 → 0.51.0-preview.ed9c7b0

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.
Files changed (125) hide show
  1. package/CHANGELOG.md +89 -1
  2. package/dist/components/AvatarBase/AvatarBase.constants.cjs +1 -1
  3. package/dist/components/AvatarBase/AvatarBase.constants.cjs.map +1 -1
  4. package/dist/components/AvatarBase/AvatarBase.constants.mjs +1 -1
  5. package/dist/components/AvatarBase/AvatarBase.constants.mjs.map +1 -1
  6. package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs +1 -1
  7. package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs.map +1 -1
  8. package/dist/components/BottomSheetDialog/BottomSheetDialog.mjs +1 -1
  9. package/dist/components/BottomSheetDialog/BottomSheetDialog.mjs.map +1 -1
  10. package/dist/components/ButtonBase/ButtonBase.cjs +2 -4
  11. package/dist/components/ButtonBase/ButtonBase.cjs.map +1 -1
  12. package/dist/components/ButtonBase/ButtonBase.constants.cjs +9 -14
  13. package/dist/components/ButtonBase/ButtonBase.constants.cjs.map +1 -1
  14. package/dist/components/ButtonBase/ButtonBase.constants.d.cts +1 -3
  15. package/dist/components/ButtonBase/ButtonBase.constants.d.cts.map +1 -1
  16. package/dist/components/ButtonBase/ButtonBase.constants.d.mts +1 -3
  17. package/dist/components/ButtonBase/ButtonBase.constants.d.mts.map +1 -1
  18. package/dist/components/ButtonBase/ButtonBase.constants.mjs +8 -12
  19. package/dist/components/ButtonBase/ButtonBase.constants.mjs.map +1 -1
  20. package/dist/components/ButtonBase/ButtonBase.d.cts.map +1 -1
  21. package/dist/components/ButtonBase/ButtonBase.d.mts.map +1 -1
  22. package/dist/components/ButtonBase/ButtonBase.mjs +3 -5
  23. package/dist/components/ButtonBase/ButtonBase.mjs.map +1 -1
  24. package/dist/components/ButtonFilter/ButtonFilter.cjs +14 -2
  25. package/dist/components/ButtonFilter/ButtonFilter.cjs.map +1 -1
  26. package/dist/components/ButtonFilter/ButtonFilter.d.cts +11 -0
  27. package/dist/components/ButtonFilter/ButtonFilter.d.cts.map +1 -1
  28. package/dist/components/ButtonFilter/ButtonFilter.d.mts +11 -0
  29. package/dist/components/ButtonFilter/ButtonFilter.d.mts.map +1 -1
  30. package/dist/components/ButtonFilter/ButtonFilter.mjs +14 -2
  31. package/dist/components/ButtonFilter/ButtonFilter.mjs.map +1 -1
  32. package/dist/components/ButtonIcon/ButtonIcon.cjs +1 -2
  33. package/dist/components/ButtonIcon/ButtonIcon.cjs.map +1 -1
  34. package/dist/components/ButtonIcon/ButtonIcon.d.cts.map +1 -1
  35. package/dist/components/ButtonIcon/ButtonIcon.d.mts.map +1 -1
  36. package/dist/components/ButtonIcon/ButtonIcon.mjs +1 -2
  37. package/dist/components/ButtonIcon/ButtonIcon.mjs.map +1 -1
  38. package/dist/components/Card/Card.cjs +15 -9
  39. package/dist/components/Card/Card.cjs.map +1 -1
  40. package/dist/components/Card/Card.d.cts +1 -1
  41. package/dist/components/Card/Card.d.cts.map +1 -1
  42. package/dist/components/Card/Card.d.mts +1 -1
  43. package/dist/components/Card/Card.d.mts.map +1 -1
  44. package/dist/components/Card/Card.mjs +16 -10
  45. package/dist/components/Card/Card.mjs.map +1 -1
  46. package/dist/components/Card/Card.types.cjs.map +1 -1
  47. package/dist/components/Card/Card.types.d.cts +11 -18
  48. package/dist/components/Card/Card.types.d.cts.map +1 -1
  49. package/dist/components/Card/Card.types.d.mts +11 -18
  50. package/dist/components/Card/Card.types.d.mts.map +1 -1
  51. package/dist/components/Card/Card.types.mjs.map +1 -1
  52. package/dist/components/Checkbox/Checkbox.cjs +1 -1
  53. package/dist/components/Checkbox/Checkbox.cjs.map +1 -1
  54. package/dist/components/Checkbox/Checkbox.mjs +1 -1
  55. package/dist/components/Checkbox/Checkbox.mjs.map +1 -1
  56. package/dist/components/HeaderBase/HeaderBase.cjs +7 -7
  57. package/dist/components/HeaderBase/HeaderBase.cjs.map +1 -1
  58. package/dist/components/HeaderBase/HeaderBase.d.cts.map +1 -1
  59. package/dist/components/HeaderBase/HeaderBase.d.mts.map +1 -1
  60. package/dist/components/HeaderBase/HeaderBase.mjs +7 -7
  61. package/dist/components/HeaderBase/HeaderBase.mjs.map +1 -1
  62. package/dist/components/HeaderSubpage/HeaderSubpage.types.cjs.map +1 -1
  63. package/dist/components/HeaderSubpage/HeaderSubpage.types.d.cts +2 -22
  64. package/dist/components/HeaderSubpage/HeaderSubpage.types.d.cts.map +1 -1
  65. package/dist/components/HeaderSubpage/HeaderSubpage.types.d.mts +2 -22
  66. package/dist/components/HeaderSubpage/HeaderSubpage.types.d.mts.map +1 -1
  67. package/dist/components/HeaderSubpage/HeaderSubpage.types.mjs.map +1 -1
  68. package/dist/components/Icon/Icon.assets.cjs +8 -0
  69. package/dist/components/Icon/Icon.assets.cjs.map +1 -1
  70. package/dist/components/Icon/Icon.assets.d.cts.map +1 -1
  71. package/dist/components/Icon/Icon.assets.d.mts.map +1 -1
  72. package/dist/components/Icon/Icon.assets.mjs +8 -0
  73. package/dist/components/Icon/Icon.assets.mjs.map +1 -1
  74. package/dist/components/Icon/assets/arrow-square-out.svg +1 -0
  75. package/dist/components/Icon/assets/clipboard.svg +1 -0
  76. package/dist/components/Icon/assets/copy-success.svg +1 -1
  77. package/dist/components/Icon/assets/infinity.svg +5 -0
  78. package/dist/components/Icon/assets/list-arrow.svg +1 -1
  79. package/dist/components/Icon/assets/more-vertical.svg +1 -1
  80. package/dist/components/Icon/assets/people-filled.svg +5 -0
  81. package/dist/components/KeyValueSelect/KeyValueSelect.cjs +1 -1
  82. package/dist/components/KeyValueSelect/KeyValueSelect.cjs.map +1 -1
  83. package/dist/components/KeyValueSelect/KeyValueSelect.mjs +1 -1
  84. package/dist/components/KeyValueSelect/KeyValueSelect.mjs.map +1 -1
  85. package/dist/components/MainActionButton/MainActionButton.cjs +1 -1
  86. package/dist/components/MainActionButton/MainActionButton.cjs.map +1 -1
  87. package/dist/components/MainActionButton/MainActionButton.mjs +1 -1
  88. package/dist/components/MainActionButton/MainActionButton.mjs.map +1 -1
  89. package/dist/components/SectionHeader/SectionHeader.cjs +2 -2
  90. package/dist/components/SectionHeader/SectionHeader.cjs.map +1 -1
  91. package/dist/components/SectionHeader/SectionHeader.mjs +2 -2
  92. package/dist/components/SectionHeader/SectionHeader.mjs.map +1 -1
  93. package/dist/components/SegmentedControl/SegmentedControl.cjs +1 -2
  94. package/dist/components/SegmentedControl/SegmentedControl.cjs.map +1 -1
  95. package/dist/components/SegmentedControl/SegmentedControl.d.cts.map +1 -1
  96. package/dist/components/SegmentedControl/SegmentedControl.d.mts.map +1 -1
  97. package/dist/components/SegmentedControl/SegmentedControl.mjs +1 -2
  98. package/dist/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
  99. package/dist/components/SelectButton/SelectButton.cjs +18 -4
  100. package/dist/components/SelectButton/SelectButton.cjs.map +1 -1
  101. package/dist/components/SelectButton/SelectButton.d.cts +1 -1
  102. package/dist/components/SelectButton/SelectButton.d.cts.map +1 -1
  103. package/dist/components/SelectButton/SelectButton.d.mts +1 -1
  104. package/dist/components/SelectButton/SelectButton.d.mts.map +1 -1
  105. package/dist/components/SelectButton/SelectButton.mjs +19 -5
  106. package/dist/components/SelectButton/SelectButton.mjs.map +1 -1
  107. package/dist/components/TextArea/TextArea.d.cts +2 -2
  108. package/dist/components/TextArea/TextArea.d.mts +2 -2
  109. package/dist/components/TextField/TextField.cjs +1 -1
  110. package/dist/components/TextField/TextField.cjs.map +1 -1
  111. package/dist/components/TextField/TextField.d.cts +2 -2
  112. package/dist/components/TextField/TextField.d.mts +2 -2
  113. package/dist/components/TextField/TextField.mjs +1 -1
  114. package/dist/components/TextField/TextField.mjs.map +1 -1
  115. package/dist/components/TextFieldSearch/TextFieldSearch.d.cts +2 -2
  116. package/dist/components/TextFieldSearch/TextFieldSearch.d.mts +2 -2
  117. package/package.json +18 -17
  118. package/dist/components/SegmentedControl/SegmentedControl.constants.cjs +0 -12
  119. package/dist/components/SegmentedControl/SegmentedControl.constants.cjs.map +0 -1
  120. package/dist/components/SegmentedControl/SegmentedControl.constants.d.cts +0 -4
  121. package/dist/components/SegmentedControl/SegmentedControl.constants.d.cts.map +0 -1
  122. package/dist/components/SegmentedControl/SegmentedControl.constants.d.mts +0 -4
  123. package/dist/components/SegmentedControl/SegmentedControl.constants.d.mts.map +0 -1
  124. package/dist/components/SegmentedControl/SegmentedControl.constants.mjs +0 -8
  125. package/dist/components/SegmentedControl/SegmentedControl.constants.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonBase.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAkB,cAAc;AAgBvC,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,sYA2BpB,eAAe,sBAwNjB,CAAC"}
1
+ {"version":3,"file":"ButtonBase.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAkB,cAAc;AAevC,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,sYA2BpB,eAAe,sBAsNjB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonBase.d.mts","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAkB,cAAc;AAgBvC,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,sYA2BpB,eAAe,sBAwNjB,CAAC"}
1
+ {"version":3,"file":"ButtonBase.d.mts","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAkB,cAAc;AAevC,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,sYA2BpB,eAAe,sBAsNjB,CAAC"}
@@ -13,7 +13,7 @@ import { BoxRow } from "../BoxRow/index.mjs";
13
13
  import { Icon, IconColor } from "../Icon/index.mjs";
14
14
  import { ButtonAnimated } from "../temp-components/ButtonAnimated/index.mjs";
15
15
  import { Spinner } from "../temp-components/Spinner/index.mjs";
16
- import { MAP_BUTTONBASE_SIZE_ICONSIZE, MAP_BUTTONBASE_SIZE_TEXT_VARIANT, getButtonBaseBorderRadiusTwClass, getButtonBaseHorizontalPaddingTwClasses, TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION } from "./ButtonBase.constants.mjs";
16
+ import { MAP_BUTTONBASE_SIZE_ICONSIZE, MAP_BUTTONBASE_SIZE_TEXT_VARIANT, getButtonBaseHorizontalPaddingTwClasses, TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION } from "./ButtonBase.constants.mjs";
17
17
  export const ButtonBase = ({ children, textProps, size = ButtonBaseSize.Lg, isLoading, loadingText, spinnerProps, loadingWrapperProps, contentWrapperProps, startIconName, startIconProps, startAccessory, endIconName, endIconProps, endAccessory, isDisabled, isFullWidth, twClassName, textClassName, iconClassName, style, accessibilityLabel, accessibilityHint, accessibilityRole = 'button', accessibilityActions, onAccessibilityAction, ...props }) => {
18
18
  const tw = useTailwind();
19
19
  const finalStartIconName = startIconName ?? startIconProps?.name;
@@ -67,11 +67,9 @@ export const ButtonBase = ({ children, textProps, size = ButtonBaseSize.Lg, isLo
67
67
  // Build button container styles
68
68
  const buttonStyles = tw.style(
69
69
  // Base layout - flex container for button content
70
- 'flex-row items-center justify-center',
70
+ 'flex-row items-center justify-center rounded-full',
71
71
  // Visual styling
72
- 'bg-muted overflow-hidden',
73
- // Conditional Border Radius and Horizontal Spacing based on requirements
74
- getButtonBaseBorderRadiusTwClass(size), getButtonBaseHorizontalPaddingTwClasses(size, hasStart, hasEnd),
72
+ 'bg-muted overflow-hidden', getButtonBaseHorizontalPaddingTwClasses(hasStart, hasEnd),
75
73
  // Size
76
74
  TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION[size],
77
75
  // State-based opacity
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonBase.mjs","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,SAAS,EACV,gDAAgD;AACjD,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,QAAO,EAAE,OAAO,EAAE,cAAc;;AAGvC,OAAO,EAAE,GAAG,EAAE,yBAAe;AAC7B,OAAO,EAAE,MAAM,EAAE,4BAAkB;AACnC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,0BAAgB;AAC1C,OAAO,EAAE,cAAc,EAAE,oDAA0C;AACnE,OAAO,EAAE,OAAO,EAAE,6CAAmC;AAErD,OAAO,EACL,4BAA4B,EAC5B,gCAAgC,EAChC,gCAAgC,EAChC,uCAAuC,EACvC,oCAAoC,EACrC,mCAA+B;AAGhC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EACzB,QAAQ,EACR,SAAS,EACT,IAAI,GAAG,cAAc,CAAC,EAAE,EACxB,SAAS,EACT,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,cAAc,EACd,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,KAAK,EACL,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,GAAG,QAAQ,EAC5B,oBAAoB,EACpB,qBAAqB,EACrB,GAAG,KAAK,EACQ,EAAE,EAAE;IACpB,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IAEzB,MAAM,kBAAkB,GAAG,aAAa,IAAI,cAAc,EAAE,IAAI,CAAC;IACjE,MAAM,gBAAgB,GAAG,WAAW,IAAI,YAAY,EAAE,IAAI,CAAC;IAE3D,MAAM,QAA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AAqC,EACrC,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CACnD,EACD,SAAS,EAAE,WAAW,CACvB;iBACF,CAAC,CAEF;cAAA,CAAC,QAAQ,CACX;YAAA,EAAE,MAAM,CACV;UAAA,GAAG,CACJ,CAAC;QACJ,CAAC,CACH;IAAA,EAAE,cAAc,CAAC,CAClB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n ButtonBaseSize,\n FontWeight,\n mergeTwClassName,\n TextColor,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useMemo } from 'react';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport { Box } from '../Box';\nimport { BoxRow } from '../BoxRow';\nimport { Icon, IconColor } from '../Icon';\nimport { ButtonAnimated } from '../temp-components/ButtonAnimated';\nimport { Spinner } from '../temp-components/Spinner';\n\nimport {\n MAP_BUTTONBASE_SIZE_ICONSIZE,\n MAP_BUTTONBASE_SIZE_TEXT_VARIANT,\n getButtonBaseBorderRadiusTwClass,\n getButtonBaseHorizontalPaddingTwClasses,\n TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION,\n} from './ButtonBase.constants';\nimport type { ButtonBaseProps } from './ButtonBase.types';\n\nexport const ButtonBase = ({\n children,\n textProps,\n size = ButtonBaseSize.Lg,\n isLoading,\n loadingText,\n spinnerProps,\n loadingWrapperProps,\n contentWrapperProps,\n startIconName,\n startIconProps,\n startAccessory,\n endIconName,\n endIconProps,\n endAccessory,\n isDisabled,\n isFullWidth,\n twClassName,\n textClassName,\n iconClassName,\n style,\n accessibilityLabel,\n accessibilityHint,\n accessibilityRole = 'button',\n accessibilityActions,\n onAccessibilityAction,\n ...props\n}: ButtonBaseProps) => {\n const tw = useTailwind();\n\n const finalStartIconName = startIconName ?? startIconProps?.name;\n const finalEndIconName = endIconName ?? endIconProps?.name;\n\n const hasStart = Boolean(finalStartIconName || startAccessory);\n const hasEnd = Boolean(finalEndIconName || endAccessory);\n const hasAccessories = hasStart || hasEnd;\n\n const iconSize = MAP_BUTTONBASE_SIZE_ICONSIZE[size];\n const labelTextVariant = MAP_BUTTONBASE_SIZE_TEXT_VARIANT[size];\n\n // Generate accessibility label if not provided\n const finalAccessibilityLabel = useMemo(() => {\n if (accessibilityLabel) {\n return accessibilityLabel;\n }\n\n // For loading state with loadingText, prioritize loadingText\n if (isLoading && loadingText) {\n return loadingText;\n }\n\n // If children is a string, use it as the label\n if (typeof children === 'string') {\n return children;\n }\n\n return undefined;\n }, [accessibilityLabel, children, isLoading, loadingText]);\n\n // Generate accessibility hint for loading state if not provided\n const finalAccessibilityHint = useMemo(() => {\n if (accessibilityHint) {\n return accessibilityHint;\n }\n\n if (isLoading) {\n return 'Button is currently loading';\n }\n\n return undefined;\n }, [accessibilityHint, isLoading]);\n\n // Create accessibilityState object with only truthy values\n const accessibilityState = useMemo(() => {\n const state: { disabled?: boolean; busy?: boolean } = {};\n\n if (isDisabled || isLoading) {\n state.disabled = true;\n }\n\n if (isLoading) {\n state.busy = true;\n }\n\n return state;\n }, [isDisabled, isLoading]);\n\n return (\n <ButtonAnimated\n disabled={isDisabled || isLoading}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={finalAccessibilityLabel}\n accessibilityHint={finalAccessibilityHint}\n accessibilityActions={accessibilityActions}\n onAccessibilityAction={onAccessibilityAction}\n accessibilityState={accessibilityState}\n accessible\n style={({ pressed }) => {\n // Evaluate custom className if it's a function\n const customClassName =\n typeof twClassName === 'function'\n ? twClassName(pressed)\n : twClassName;\n\n // Build button container styles\n const buttonStyles = tw.style(\n // Base layout - flex container for button content\n 'flex-row items-center justify-center',\n // Visual styling\n 'bg-muted overflow-hidden',\n // Conditional Border Radius and Horizontal Spacing based on requirements\n getButtonBaseBorderRadiusTwClass(size),\n getButtonBaseHorizontalPaddingTwClasses(size, hasStart, hasEnd),\n // Size\n TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION[size],\n // State-based opacity\n isDisabled ? 'opacity-50' : 'opacity-100',\n // Width - use self-start to prevent stretching when not full width\n isFullWidth ? 'w-full' : 'self-start',\n // Custom classes\n customClassName,\n );\n\n // Merge with additional styles if provided\n const computedStyle: StyleProp<ViewStyle>[] = [buttonStyles];\n\n const additionalStyle =\n typeof style === 'function' ? style({ pressed }) : style;\n\n if (additionalStyle) {\n computedStyle.push(additionalStyle);\n }\n\n return computedStyle;\n }}\n {...props}\n >\n {({ pressed }) => {\n const { twClassName: loadingWrapperTw, ...restLoadingWrapper } =\n loadingWrapperProps ?? {};\n const { twClassName: contentWrapperTw, ...restContentWrapper } =\n contentWrapperProps ?? {};\n\n return (\n <>\n {/* Loading spinner overlay */}\n {isLoading && (\n <Box\n {...restLoadingWrapper}\n twClassName={mergeTwClassName(\n 'absolute inset-0 flex items-center justify-center',\n loadingWrapperTw,\n )}\n >\n <Spinner\n color={\n textClassName\n ? (textClassName(pressed) as IconColor)\n : IconColor.IconDefault\n }\n loadingText={loadingText}\n {...spinnerProps}\n spinnerIconProps={{\n size: iconSize,\n ...spinnerProps?.spinnerIconProps,\n }}\n loadingTextProps={{\n numberOfLines: 1,\n variant: labelTextVariant,\n twClassName: textClassName ? textClassName(pressed) : '',\n ...spinnerProps?.loadingTextProps,\n }}\n />\n </Box>\n )}\n\n <BoxRow\n {...restContentWrapper}\n twClassName={\n isLoading\n ? mergeTwClassName('opacity-0', contentWrapperTw)\n : contentWrapperTw\n }\n gap={hasAccessories ? 1 : 0}\n startAccessory={\n finalStartIconName ? (\n <Icon\n name={finalStartIconName}\n size={iconSize}\n {...startIconProps}\n twClassName={mergeTwClassName(\n mergeTwClassName(\n 'shrink-0',\n iconClassName ? iconClassName(pressed) : undefined,\n ),\n startIconProps?.twClassName,\n )}\n />\n ) : (\n startAccessory\n )\n }\n endAccessory={\n finalEndIconName ? (\n <Icon\n name={finalEndIconName}\n size={iconSize}\n {...endIconProps}\n twClassName={mergeTwClassName(\n mergeTwClassName(\n 'shrink-0',\n iconClassName ? iconClassName(pressed) : undefined,\n ),\n endIconProps?.twClassName,\n )}\n />\n ) : (\n endAccessory\n )\n }\n textProps={{\n variant: labelTextVariant,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextDefault,\n numberOfLines: 1,\n ellipsizeMode: 'clip',\n ...textProps,\n twClassName: mergeTwClassName(\n mergeTwClassName(\n 'shrink grow-0 flex-wrap text-center',\n textClassName ? textClassName(pressed) : undefined,\n ),\n textProps?.twClassName,\n ),\n }}\n >\n {children}\n </BoxRow>\n </>\n );\n }}\n </ButtonAnimated>\n );\n};\n"]}
1
+ {"version":3,"file":"ButtonBase.mjs","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,SAAS,EACV,gDAAgD;AACjD,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,QAAO,EAAE,OAAO,EAAE,cAAc;;AAGvC,OAAO,EAAE,GAAG,EAAE,yBAAe;AAC7B,OAAO,EAAE,MAAM,EAAE,4BAAkB;AACnC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,0BAAgB;AAC1C,OAAO,EAAE,cAAc,EAAE,oDAA0C;AACnE,OAAO,EAAE,OAAO,EAAE,6CAAmC;AAErD,OAAO,EACL,4BAA4B,EAC5B,gCAAgC,EAChC,uCAAuC,EACvC,oCAAoC,EACrC,mCAA+B;AAGhC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EACzB,QAAQ,EACR,SAAS,EACT,IAAI,GAAG,cAAc,CAAC,EAAE,EACxB,SAAS,EACT,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,cAAc,EACd,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,KAAK,EACL,kBAAkB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AAC,CAAC;oBACT,OAAO,EAAE,gBAAgB;oBACzB,UAAU,EAAE,UAAU,CAAC,MAAM;oBAC7B,KAAK,EAAE,SAAS,CAAC,WAAW;oBAC5B,aAAa,EAAE,CAAC;oBAChB,aAAa,EAAE,MAAM;oBACrB,GAAG,SAAS;oBACZ,WAAW,EAAE,gBAAgB,CAC3B,gBAAgB,CACd,qCAAqC,EACrC,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CACnD,EACD,SAAS,EAAE,WAAW,CACvB;iBACF,CAAC,CAEF;cAAA,CAAC,QAAQ,CACX;YAAA,EAAE,MAAM,CACV;UAAA,GAAG,CACJ,CAAC;QACJ,CAAC,CACH;IAAA,EAAE,cAAc,CAAC,CAClB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n ButtonBaseSize,\n FontWeight,\n mergeTwClassName,\n TextColor,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useMemo } from 'react';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport { Box } from '../Box';\nimport { BoxRow } from '../BoxRow';\nimport { Icon, IconColor } from '../Icon';\nimport { ButtonAnimated } from '../temp-components/ButtonAnimated';\nimport { Spinner } from '../temp-components/Spinner';\n\nimport {\n MAP_BUTTONBASE_SIZE_ICONSIZE,\n MAP_BUTTONBASE_SIZE_TEXT_VARIANT,\n getButtonBaseHorizontalPaddingTwClasses,\n TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION,\n} from './ButtonBase.constants';\nimport type { ButtonBaseProps } from './ButtonBase.types';\n\nexport const ButtonBase = ({\n children,\n textProps,\n size = ButtonBaseSize.Lg,\n isLoading,\n loadingText,\n spinnerProps,\n loadingWrapperProps,\n contentWrapperProps,\n startIconName,\n startIconProps,\n startAccessory,\n endIconName,\n endIconProps,\n endAccessory,\n isDisabled,\n isFullWidth,\n twClassName,\n textClassName,\n iconClassName,\n style,\n accessibilityLabel,\n accessibilityHint,\n accessibilityRole = 'button',\n accessibilityActions,\n onAccessibilityAction,\n ...props\n}: ButtonBaseProps) => {\n const tw = useTailwind();\n\n const finalStartIconName = startIconName ?? startIconProps?.name;\n const finalEndIconName = endIconName ?? endIconProps?.name;\n\n const hasStart = Boolean(finalStartIconName || startAccessory);\n const hasEnd = Boolean(finalEndIconName || endAccessory);\n const hasAccessories = hasStart || hasEnd;\n\n const iconSize = MAP_BUTTONBASE_SIZE_ICONSIZE[size];\n const labelTextVariant = MAP_BUTTONBASE_SIZE_TEXT_VARIANT[size];\n\n // Generate accessibility label if not provided\n const finalAccessibilityLabel = useMemo(() => {\n if (accessibilityLabel) {\n return accessibilityLabel;\n }\n\n // For loading state with loadingText, prioritize loadingText\n if (isLoading && loadingText) {\n return loadingText;\n }\n\n // If children is a string, use it as the label\n if (typeof children === 'string') {\n return children;\n }\n\n return undefined;\n }, [accessibilityLabel, children, isLoading, loadingText]);\n\n // Generate accessibility hint for loading state if not provided\n const finalAccessibilityHint = useMemo(() => {\n if (accessibilityHint) {\n return accessibilityHint;\n }\n\n if (isLoading) {\n return 'Button is currently loading';\n }\n\n return undefined;\n }, [accessibilityHint, isLoading]);\n\n // Create accessibilityState object with only truthy values\n const accessibilityState = useMemo(() => {\n const state: { disabled?: boolean; busy?: boolean } = {};\n\n if (isDisabled || isLoading) {\n state.disabled = true;\n }\n\n if (isLoading) {\n state.busy = true;\n }\n\n return state;\n }, [isDisabled, isLoading]);\n\n return (\n <ButtonAnimated\n disabled={isDisabled || isLoading}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={finalAccessibilityLabel}\n accessibilityHint={finalAccessibilityHint}\n accessibilityActions={accessibilityActions}\n onAccessibilityAction={onAccessibilityAction}\n accessibilityState={accessibilityState}\n accessible\n style={({ pressed }) => {\n // Evaluate custom className if it's a function\n const customClassName =\n typeof twClassName === 'function'\n ? twClassName(pressed)\n : twClassName;\n\n // Build button container styles\n const buttonStyles = tw.style(\n // Base layout - flex container for button content\n 'flex-row items-center justify-center rounded-full',\n // Visual styling\n 'bg-muted overflow-hidden',\n getButtonBaseHorizontalPaddingTwClasses(hasStart, hasEnd),\n // Size\n TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION[size],\n // State-based opacity\n isDisabled ? 'opacity-50' : 'opacity-100',\n // Width - use self-start to prevent stretching when not full width\n isFullWidth ? 'w-full' : 'self-start',\n // Custom classes\n customClassName,\n );\n\n // Merge with additional styles if provided\n const computedStyle: StyleProp<ViewStyle>[] = [buttonStyles];\n\n const additionalStyle =\n typeof style === 'function' ? style({ pressed }) : style;\n\n if (additionalStyle) {\n computedStyle.push(additionalStyle);\n }\n\n return computedStyle;\n }}\n {...props}\n >\n {({ pressed }) => {\n const { twClassName: loadingWrapperTw, ...restLoadingWrapper } =\n loadingWrapperProps ?? {};\n const { twClassName: contentWrapperTw, ...restContentWrapper } =\n contentWrapperProps ?? {};\n\n return (\n <>\n {/* Loading spinner overlay */}\n {isLoading && (\n <Box\n {...restLoadingWrapper}\n twClassName={mergeTwClassName(\n 'absolute inset-0 flex items-center justify-center',\n loadingWrapperTw,\n )}\n >\n <Spinner\n color={\n textClassName\n ? (textClassName(pressed) as IconColor)\n : IconColor.IconDefault\n }\n loadingText={loadingText}\n {...spinnerProps}\n spinnerIconProps={{\n size: iconSize,\n ...spinnerProps?.spinnerIconProps,\n }}\n loadingTextProps={{\n numberOfLines: 1,\n variant: labelTextVariant,\n twClassName: textClassName ? textClassName(pressed) : '',\n ...spinnerProps?.loadingTextProps,\n }}\n />\n </Box>\n )}\n\n <BoxRow\n {...restContentWrapper}\n twClassName={\n isLoading\n ? mergeTwClassName('opacity-0', contentWrapperTw)\n : contentWrapperTw\n }\n gap={hasAccessories ? 1 : 0}\n startAccessory={\n finalStartIconName ? (\n <Icon\n name={finalStartIconName}\n size={iconSize}\n {...startIconProps}\n twClassName={mergeTwClassName(\n mergeTwClassName(\n 'shrink-0',\n iconClassName ? iconClassName(pressed) : undefined,\n ),\n startIconProps?.twClassName,\n )}\n />\n ) : (\n startAccessory\n )\n }\n endAccessory={\n finalEndIconName ? (\n <Icon\n name={finalEndIconName}\n size={iconSize}\n {...endIconProps}\n twClassName={mergeTwClassName(\n mergeTwClassName(\n 'shrink-0',\n iconClassName ? iconClassName(pressed) : undefined,\n ),\n endIconProps?.twClassName,\n )}\n />\n ) : (\n endAccessory\n )\n }\n textProps={{\n variant: labelTextVariant,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextDefault,\n numberOfLines: 1,\n ellipsizeMode: 'clip',\n ...textProps,\n twClassName: mergeTwClassName(\n mergeTwClassName(\n 'shrink grow-0 flex-wrap text-center',\n textClassName ? textClassName(pressed) : undefined,\n ),\n textProps?.twClassName,\n ),\n }}\n >\n {children}\n </BoxRow>\n </>\n );\n }}\n </ButtonAnimated>\n );\n};\n"]}
@@ -7,7 +7,19 @@ exports.ButtonFilter = void 0;
7
7
  const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-twrnc-preset");
8
8
  const react_1 = __importDefault(require("react"));
9
9
  const ButtonBase_1 = require("../ButtonBase/index.cjs");
10
- const ButtonFilter = ({ isActive = false, twClassName, textProps, style, ...props }) => {
10
+ /**
11
+ * @deprecated Use `FilterButton` instead. This component will be removed
12
+ * in a future major version of the design system.
13
+ *
14
+ * @param props - Component props.
15
+ * @param props.isActive - Whether the filter is in the active state.
16
+ * @param props.twClassName - Tailwind override classes for the container.
17
+ * @param props.textProps - Props forwarded to the internal text element.
18
+ * @param props.style - Style overrides applied to the container.
19
+ * @returns The rendered filter button element.
20
+ */
21
+ const ButtonFilter = (props) => {
22
+ const { isActive = false, twClassName, textProps, style, ...restProps } = props;
11
23
  const tw = (0, design_system_twrnc_preset_1.useTailwind)();
12
24
  const mergedStyle = [
13
25
  tw.style(isActive ? 'bg-icon-default' : 'bg-background-muted', twClassName),
@@ -22,7 +34,7 @@ const ButtonFilter = ({ isActive = false, twClassName, textProps, style, ...prop
22
34
  .filter(Boolean)
23
35
  .join(' '),
24
36
  };
25
- return (<ButtonBase_1.ButtonBase textProps={mergedTextProps} style={mergedStyle} {...props}/>);
37
+ return (<ButtonBase_1.ButtonBase textProps={mergedTextProps} style={mergedStyle} {...restProps}/>);
26
38
  };
27
39
  exports.ButtonFilter = ButtonFilter;
28
40
  //# sourceMappingURL=ButtonFilter.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonFilter.cjs","sourceRoot":"","sources":["../../../src/components/ButtonFilter/ButtonFilter.tsx"],"names":[],"mappings":";;;;;;AAAA,8FAA4E;AAC5E,kDAA0B;AAE1B,wDAA2C;AAIpC,MAAM,YAAY,GAAgC,CAAC,EACxD,QAAQ,GAAG,KAAK,EAChB,WAAW,EACX,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IAEzB,MAAM,WAAW,GAAG;QAClB,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,qBAAqB,EAAE,WAAW,CAAC;QAC3E,KAAK;KACN,CAAC;IAEF,MAAM,eAAe,GAAG;QACtB,GAAG,SAAS;QACZ,WAAW,EAAE;YACX,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,cAAc;YAC/C,SAAS,EAAE,WAAW;SACvB;aACE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC;KACb,CAAC;IAEF,OAAO,CACL,CAAC,uBAAU,CAAC,SAAS,CAAC,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,CAAC,IAAI,KAAK,CAAC,EAAG,CAC1E,CAAC;AACJ,CAAC,CAAC;AA3BW,QAAA,YAAY,gBA2BvB","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\n\nimport { ButtonBase } from '../ButtonBase';\n\nimport type { ButtonFilterProps } from './ButtonFilter.types';\n\nexport const ButtonFilter: React.FC<ButtonFilterProps> = ({\n isActive = false,\n twClassName,\n textProps,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n\n const mergedStyle = [\n tw.style(isActive ? 'bg-icon-default' : 'bg-background-muted', twClassName),\n style,\n ];\n\n const mergedTextProps = {\n ...textProps,\n twClassName: [\n isActive ? 'text-icon-inverse' : 'text-default',\n textProps?.twClassName,\n ]\n .filter(Boolean)\n .join(' '),\n };\n\n return (\n <ButtonBase textProps={mergedTextProps} style={mergedStyle} {...props} />\n );\n};\n"]}
1
+ {"version":3,"file":"ButtonFilter.cjs","sourceRoot":"","sources":["../../../src/components/ButtonFilter/ButtonFilter.tsx"],"names":[],"mappings":";;;;;;AAAA,8FAA4E;AAC5E,kDAA0B;AAE1B,wDAA2C;AAI3C;;;;;;;;;;GAUG;AACI,MAAM,YAAY,GAAgC,CAAC,KAAK,EAAE,EAAE;IACjE,MAAM,EACJ,QAAQ,GAAG,KAAK,EAChB,WAAW,EACX,SAAS,EACT,KAAK,EACL,GAAG,SAAS,EACb,GAAG,KAAK,CAAC;IACV,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IAEzB,MAAM,WAAW,GAAG;QAClB,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,qBAAqB,EAAE,WAAW,CAAC;QAC3E,KAAK;KACN,CAAC;IAEF,MAAM,eAAe,GAAG;QACtB,GAAG,SAAS;QACZ,WAAW,EAAE;YACX,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,cAAc;YAC/C,SAAS,EAAE,WAAW;SACvB;aACE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC;KACb,CAAC;IAEF,OAAO,CACL,CAAC,uBAAU,CACT,SAAS,CAAC,CAAC,eAAe,CAAC,CAC3B,KAAK,CAAC,CAAC,WAAW,CAAC,CACnB,IAAI,SAAS,CAAC,EACd,CACH,CAAC;AACJ,CAAC,CAAC;AAhCW,QAAA,YAAY,gBAgCvB","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\n\nimport { ButtonBase } from '../ButtonBase';\n\nimport type { ButtonFilterProps } from './ButtonFilter.types';\n\n/**\n * @deprecated Use `FilterButton` instead. This component will be removed\n * in a future major version of the design system.\n *\n * @param props - Component props.\n * @param props.isActive - Whether the filter is in the active state.\n * @param props.twClassName - Tailwind override classes for the container.\n * @param props.textProps - Props forwarded to the internal text element.\n * @param props.style - Style overrides applied to the container.\n * @returns The rendered filter button element.\n */\nexport const ButtonFilter: React.FC<ButtonFilterProps> = (props) => {\n const {\n isActive = false,\n twClassName,\n textProps,\n style,\n ...restProps\n } = props;\n const tw = useTailwind();\n\n const mergedStyle = [\n tw.style(isActive ? 'bg-icon-default' : 'bg-background-muted', twClassName),\n style,\n ];\n\n const mergedTextProps = {\n ...textProps,\n twClassName: [\n isActive ? 'text-icon-inverse' : 'text-default',\n textProps?.twClassName,\n ]\n .filter(Boolean)\n .join(' '),\n };\n\n return (\n <ButtonBase\n textProps={mergedTextProps}\n style={mergedStyle}\n {...restProps}\n />\n );\n};\n"]}
@@ -1,4 +1,15 @@
1
1
  import React from "react";
2
2
  import type { ButtonFilterProps } from "./ButtonFilter.types.cjs";
3
+ /**
4
+ * @deprecated Use `FilterButton` instead. This component will be removed
5
+ * in a future major version of the design system.
6
+ *
7
+ * @param props - Component props.
8
+ * @param props.isActive - Whether the filter is in the active state.
9
+ * @param props.twClassName - Tailwind override classes for the container.
10
+ * @param props.textProps - Props forwarded to the internal text element.
11
+ * @param props.style - Style overrides applied to the container.
12
+ * @returns The rendered filter button element.
13
+ */
3
14
  export declare const ButtonFilter: React.FC<ButtonFilterProps>;
4
15
  //# sourceMappingURL=ButtonFilter.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonFilter.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonFilter/ButtonFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAI1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,iCAA6B;AAE9D,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA2BpD,CAAC"}
1
+ {"version":3,"file":"ButtonFilter.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonFilter/ButtonFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAI1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,iCAA6B;AAE9D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAgCpD,CAAC"}
@@ -1,4 +1,15 @@
1
1
  import React from "react";
2
2
  import type { ButtonFilterProps } from "./ButtonFilter.types.mjs";
3
+ /**
4
+ * @deprecated Use `FilterButton` instead. This component will be removed
5
+ * in a future major version of the design system.
6
+ *
7
+ * @param props - Component props.
8
+ * @param props.isActive - Whether the filter is in the active state.
9
+ * @param props.twClassName - Tailwind override classes for the container.
10
+ * @param props.textProps - Props forwarded to the internal text element.
11
+ * @param props.style - Style overrides applied to the container.
12
+ * @returns The rendered filter button element.
13
+ */
3
14
  export declare const ButtonFilter: React.FC<ButtonFilterProps>;
4
15
  //# sourceMappingURL=ButtonFilter.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonFilter.d.mts","sourceRoot":"","sources":["../../../src/components/ButtonFilter/ButtonFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAI1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,iCAA6B;AAE9D,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA2BpD,CAAC"}
1
+ {"version":3,"file":"ButtonFilter.d.mts","sourceRoot":"","sources":["../../../src/components/ButtonFilter/ButtonFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAI1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,iCAA6B;AAE9D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAgCpD,CAAC"}
@@ -8,7 +8,19 @@ import { useTailwind } from "@metamask-previews/design-system-twrnc-preset";
8
8
  import $React from "react";
9
9
  const React = $importDefault($React);
10
10
  import { ButtonBase } from "../ButtonBase/index.mjs";
11
- export const ButtonFilter = ({ isActive = false, twClassName, textProps, style, ...props }) => {
11
+ /**
12
+ * @deprecated Use `FilterButton` instead. This component will be removed
13
+ * in a future major version of the design system.
14
+ *
15
+ * @param props - Component props.
16
+ * @param props.isActive - Whether the filter is in the active state.
17
+ * @param props.twClassName - Tailwind override classes for the container.
18
+ * @param props.textProps - Props forwarded to the internal text element.
19
+ * @param props.style - Style overrides applied to the container.
20
+ * @returns The rendered filter button element.
21
+ */
22
+ export const ButtonFilter = (props) => {
23
+ const { isActive = false, twClassName, textProps, style, ...restProps } = props;
12
24
  const tw = useTailwind();
13
25
  const mergedStyle = [
14
26
  tw.style(isActive ? 'bg-icon-default' : 'bg-background-muted', twClassName),
@@ -23,6 +35,6 @@ export const ButtonFilter = ({ isActive = false, twClassName, textProps, style,
23
35
  .filter(Boolean)
24
36
  .join(' '),
25
37
  };
26
- return (<ButtonBase textProps={mergedTextProps} style={mergedStyle} {...props}/>);
38
+ return (<ButtonBase textProps={mergedTextProps} style={mergedStyle} {...restProps}/>);
27
39
  };
28
40
  //# sourceMappingURL=ButtonFilter.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonFilter.mjs","sourceRoot":"","sources":["../../../src/components/ButtonFilter/ButtonFilter.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,MAAK,cAAc;;AAE1B,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAI3C,MAAM,CAAC,MAAM,YAAY,GAAgC,CAAC,EACxD,QAAQ,GAAG,KAAK,EAChB,WAAW,EACX,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IAEzB,MAAM,WAAW,GAAG;QAClB,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,qBAAqB,EAAE,WAAW,CAAC;QAC3E,KAAK;KACN,CAAC;IAEF,MAAM,eAAe,GAAG;QACtB,GAAG,SAAS;QACZ,WAAW,EAAE;YACX,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,cAAc;YAC/C,SAAS,EAAE,WAAW;SACvB;aACE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC;KACb,CAAC;IAEF,OAAO,CACL,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,CAAC,IAAI,KAAK,CAAC,EAAG,CAC1E,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\n\nimport { ButtonBase } from '../ButtonBase';\n\nimport type { ButtonFilterProps } from './ButtonFilter.types';\n\nexport const ButtonFilter: React.FC<ButtonFilterProps> = ({\n isActive = false,\n twClassName,\n textProps,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n\n const mergedStyle = [\n tw.style(isActive ? 'bg-icon-default' : 'bg-background-muted', twClassName),\n style,\n ];\n\n const mergedTextProps = {\n ...textProps,\n twClassName: [\n isActive ? 'text-icon-inverse' : 'text-default',\n textProps?.twClassName,\n ]\n .filter(Boolean)\n .join(' '),\n };\n\n return (\n <ButtonBase textProps={mergedTextProps} style={mergedStyle} {...props} />\n );\n};\n"]}
1
+ {"version":3,"file":"ButtonFilter.mjs","sourceRoot":"","sources":["../../../src/components/ButtonFilter/ButtonFilter.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,MAAK,cAAc;;AAE1B,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAI3C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,YAAY,GAAgC,CAAC,KAAK,EAAE,EAAE;IACjE,MAAM,EACJ,QAAQ,GAAG,KAAK,EAChB,WAAW,EACX,SAAS,EACT,KAAK,EACL,GAAG,SAAS,EACb,GAAG,KAAK,CAAC;IACV,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IAEzB,MAAM,WAAW,GAAG;QAClB,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,qBAAqB,EAAE,WAAW,CAAC;QAC3E,KAAK;KACN,CAAC;IAEF,MAAM,eAAe,GAAG;QACtB,GAAG,SAAS;QACZ,WAAW,EAAE;YACX,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,cAAc;YAC/C,SAAS,EAAE,WAAW;SACvB;aACE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC;KACb,CAAC;IAEF,OAAO,CACL,CAAC,UAAU,CACT,SAAS,CAAC,CAAC,eAAe,CAAC,CAC3B,KAAK,CAAC,CAAC,WAAW,CAAC,CACnB,IAAI,SAAS,CAAC,EACd,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\n\nimport { ButtonBase } from '../ButtonBase';\n\nimport type { ButtonFilterProps } from './ButtonFilter.types';\n\n/**\n * @deprecated Use `FilterButton` instead. This component will be removed\n * in a future major version of the design system.\n *\n * @param props - Component props.\n * @param props.isActive - Whether the filter is in the active state.\n * @param props.twClassName - Tailwind override classes for the container.\n * @param props.textProps - Props forwarded to the internal text element.\n * @param props.style - Style overrides applied to the container.\n * @returns The rendered filter button element.\n */\nexport const ButtonFilter: React.FC<ButtonFilterProps> = (props) => {\n const {\n isActive = false,\n twClassName,\n textProps,\n style,\n ...restProps\n } = props;\n const tw = useTailwind();\n\n const mergedStyle = [\n tw.style(isActive ? 'bg-icon-default' : 'bg-background-muted', twClassName),\n style,\n ];\n\n const mergedTextProps = {\n ...textProps,\n twClassName: [\n isActive ? 'text-icon-inverse' : 'text-default',\n textProps?.twClassName,\n ]\n .filter(Boolean)\n .join(' '),\n };\n\n return (\n <ButtonBase\n textProps={mergedTextProps}\n style={mergedStyle}\n {...restProps}\n />\n );\n};\n"]}
@@ -46,7 +46,6 @@ const ButtonIcon = ({ size = design_system_shared_1.ButtonIconSize.Md, iconName,
46
46
  const twIconColorClassNames = variant === design_system_shared_1.ButtonIconVariant.Floating
47
47
  ? 'text-primary-inverse'
48
48
  : 'text-icon-default';
49
- const borderRadiusClass = variant === design_system_shared_1.ButtonIconVariant.Default ? 'rounded-lg' : 'rounded-full';
50
49
  const onPressInHandler = (event) => {
51
50
  setIsPressed(true);
52
51
  onPressIn?.(event);
@@ -56,7 +55,7 @@ const ButtonIcon = ({ size = design_system_shared_1.ButtonIconSize.Md, iconName,
56
55
  onPressOut?.(event);
57
56
  };
58
57
  return (<ButtonAnimated_1.ButtonAnimated disabled={isDisabled} onPressIn={onPressInHandler} onPressOut={onPressOutHandler} accessible testID="button-icon" {...props} style={[
59
- tw.style('items-center justify-center', ButtonIcon_constants_1.TWCLASSMAP_BUTTONICON_SIZE_DIMENSION[size], borderRadiusClass, backgroundColor, isDisabled ? 'opacity-50' : 'opacity-100', twClassName),
58
+ tw.style('items-center justify-center rounded-full', ButtonIcon_constants_1.TWCLASSMAP_BUTTONICON_SIZE_DIMENSION[size], backgroundColor, isDisabled ? 'opacity-50' : 'opacity-100', twClassName),
60
59
  style,
61
60
  ]}>
62
61
  <Icon_1.Icon name={iconName} color={twIconColorClassNames} size={ButtonIcon_constants_1.MAP_BUTTONICON_SIZE_ICONSIZE[size]} {...iconProps}/>
@@ -1 +1 @@
1
- {"version":3,"file":"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AAE,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC,CAAC;IAEF,MAAM,iBAAiB,GAAG,CAAC,KAA4B,EAAE,EAAE;QACzD,YAAY,CAAC,KAAK,CAAC,CAAC;QACpB,UAAU,EAAE,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,+BAAc,CACb,QAAQ,CAAC,CAAC,UAAU,CAAC,CACrB,SAAS,CAAC,CAAC,gBAAgB,CAAC,CAC5B,UAAU,CAAC,CAAC,iBAAiB,CAAC,CAC9B,UAAU,CACV,MAAM,CAAC,aAAa,CACpB,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,6BAA6B,EAC7B,2DAAoC,CAAC,IAAI,CAAC,EAC1C,iBAAiB,EACjB,eAAe,EACf,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa,EACzC,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CAEF;MAAA,CAAC,WAAI,CACH,IAAI,CAAC,CAAC,QAAQ,CAAC,CACf,KAAK,CAAC,CAAC,qBAAkC,CAAC,CAC1C,IAAI,CAAC,CAAC,mDAA4B,CAAC,IAAI,CAAC,CAAC,CACzC,IAAI,SAAS,CAAC,EAElB;IAAA,EAAE,+BAAc,CAAC,CAClB,CAAC;AACJ,CAAC,CAAC;AAtEW,QAAA,UAAU,cAsErB","sourcesContent":["import {\n IconColor,\n ButtonIconSize,\n ButtonIconVariant,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useState } from 'react';\nimport type { GestureResponderEvent } from 'react-native';\n\nimport { Icon } from '../Icon';\nimport { ButtonAnimated } from '../temp-components/ButtonAnimated';\n\nimport {\n MAP_BUTTONICON_SIZE_ICONSIZE,\n TWCLASSMAP_BUTTONICON_SIZE_DIMENSION,\n} from './ButtonIcon.constants';\nimport type { ButtonIconProps } from './ButtonIcon.types';\n\nexport const ButtonIcon = ({\n size = ButtonIconSize.Md,\n iconName,\n iconProps,\n isDisabled = false,\n variant = ButtonIconVariant.Default,\n onPressIn,\n onPressOut,\n twClassName,\n style,\n ...props\n}: ButtonIconProps) => {\n const [isPressed, setIsPressed] = useState(false);\n const tw = useTailwind();\n\n let backgroundColor = 'bg-transparent';\n if (variant === ButtonIconVariant.Floating) {\n backgroundColor = 'bg-icon-default';\n } else if (variant === ButtonIconVariant.Filled) {\n backgroundColor = isPressed ? 'bg-muted-pressed' : 'bg-muted';\n } else if (isPressed) {\n backgroundColor = 'bg-pressed';\n }\n\n const twIconColorClassNames =\n variant === ButtonIconVariant.Floating\n ? 'text-primary-inverse'\n : 'text-icon-default';\n\n const borderRadiusClass =\n variant === ButtonIconVariant.Default ? 'rounded-lg' : 'rounded-full';\n\n const onPressInHandler = (event: GestureResponderEvent) => {\n setIsPressed(true);\n onPressIn?.(event);\n };\n\n const onPressOutHandler = (event: GestureResponderEvent) => {\n setIsPressed(false);\n onPressOut?.(event);\n };\n\n return (\n <ButtonAnimated\n disabled={isDisabled}\n onPressIn={onPressInHandler}\n onPressOut={onPressOutHandler}\n accessible\n testID=\"button-icon\"\n {...props}\n style={[\n tw.style(\n 'items-center justify-center',\n TWCLASSMAP_BUTTONICON_SIZE_DIMENSION[size],\n borderRadiusClass,\n backgroundColor,\n isDisabled ? 'opacity-50' : 'opacity-100',\n twClassName,\n ),\n style,\n ]}\n >\n <Icon\n name={iconName}\n color={twIconColorClassNames as IconColor}\n size={MAP_BUTTONICON_SIZE_ICONSIZE[size]}\n {...iconProps}\n />\n </ButtonAnimated>\n );\n};\n"]}
1
+ {"version":3,"file":"ButtonIcon.cjs","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kFAIiD;AACjD,8FAA4E;AAC5E,+CAAwC;AAGxC,4CAA+B;AAC/B,gFAAmE;AAEnE,qEAGgC;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,CAAC,CAAC,iBAAiB,CAAC,CAC9B,UAAU,CACV,MAAM,CAAC,aAAa,CACpB,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,0CAA0C,EAC1C,2DAAoC,CAAC,IAAI,CAAC,EAC1C,eAAe,EACf,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa,EACzC,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CAEF;MAAA,CAAC,WAAI,CACH,IAAI,CAAC,CAAC,QAAQ,CAAC,CACf,KAAK,CAAC,CAAC,qBAAkC,CAAC,CAC1C,IAAI,CAAC,CAAC,mDAA4B,CAAC,IAAI,CAAC,CAAC,CACzC,IAAI,SAAS,CAAC,EAElB;IAAA,EAAE,+BAAc,CAAC,CAClB,CAAC;AACJ,CAAC,CAAC;AAlEW,QAAA,UAAU,cAkErB","sourcesContent":["import {\n IconColor,\n ButtonIconSize,\n ButtonIconVariant,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useState } from 'react';\nimport type { GestureResponderEvent } from 'react-native';\n\nimport { Icon } from '../Icon';\nimport { ButtonAnimated } from '../temp-components/ButtonAnimated';\n\nimport {\n MAP_BUTTONICON_SIZE_ICONSIZE,\n TWCLASSMAP_BUTTONICON_SIZE_DIMENSION,\n} from './ButtonIcon.constants';\nimport type { ButtonIconProps } from './ButtonIcon.types';\n\nexport const ButtonIcon = ({\n size = ButtonIconSize.Md,\n iconName,\n iconProps,\n isDisabled = false,\n variant = ButtonIconVariant.Default,\n onPressIn,\n onPressOut,\n twClassName,\n style,\n ...props\n}: ButtonIconProps) => {\n const [isPressed, setIsPressed] = useState(false);\n const tw = useTailwind();\n\n let backgroundColor = 'bg-transparent';\n if (variant === ButtonIconVariant.Floating) {\n backgroundColor = 'bg-icon-default';\n } else if (variant === ButtonIconVariant.Filled) {\n backgroundColor = isPressed ? 'bg-muted-pressed' : 'bg-muted';\n } else if (isPressed) {\n backgroundColor = 'bg-pressed';\n }\n\n const twIconColorClassNames =\n variant === ButtonIconVariant.Floating\n ? 'text-primary-inverse'\n : 'text-icon-default';\n\n const onPressInHandler = (event: GestureResponderEvent) => {\n setIsPressed(true);\n onPressIn?.(event);\n };\n\n const onPressOutHandler = (event: GestureResponderEvent) => {\n setIsPressed(false);\n onPressOut?.(event);\n };\n\n return (\n <ButtonAnimated\n disabled={isDisabled}\n onPressIn={onPressInHandler}\n onPressOut={onPressOutHandler}\n accessible\n testID=\"button-icon\"\n {...props}\n style={[\n tw.style(\n 'items-center justify-center rounded-full',\n TWCLASSMAP_BUTTONICON_SIZE_DIMENSION[size],\n backgroundColor,\n isDisabled ? 'opacity-50' : 'opacity-100',\n twClassName,\n ),\n style,\n ]}\n >\n <Icon\n name={iconName}\n color={twIconColorClassNames as IconColor}\n size={MAP_BUTTONICON_SIZE_ICONSIZE[size]}\n {...iconProps}\n />\n </ButtonAnimated>\n );\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonIcon.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAmB,cAAc;AAUxC,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,4GAWpB,eAAe,sBA2DjB,CAAC"}
1
+ {"version":3,"file":"ButtonIcon.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAmB,cAAc;AAUxC,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,4GAWpB,eAAe,sBAuDjB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonIcon.d.mts","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAmB,cAAc;AAUxC,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,4GAWpB,eAAe,sBA2DjB,CAAC"}
1
+ {"version":3,"file":"ButtonIcon.d.mts","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAmB,cAAc;AAUxC,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,4GAWpB,eAAe,sBAuDjB,CAAC"}
@@ -27,7 +27,6 @@ export const ButtonIcon = ({ size = ButtonIconSize.Md, iconName, iconProps, isDi
27
27
  const twIconColorClassNames = variant === ButtonIconVariant.Floating
28
28
  ? 'text-primary-inverse'
29
29
  : 'text-icon-default';
30
- const borderRadiusClass = variant === ButtonIconVariant.Default ? 'rounded-lg' : 'rounded-full';
31
30
  const onPressInHandler = (event) => {
32
31
  setIsPressed(true);
33
32
  onPressIn?.(event);
@@ -37,7 +36,7 @@ export const ButtonIcon = ({ size = ButtonIconSize.Md, iconName, iconProps, isDi
37
36
  onPressOut?.(event);
38
37
  };
39
38
  return (<ButtonAnimated disabled={isDisabled} onPressIn={onPressInHandler} onPressOut={onPressOutHandler} accessible testID="button-icon" {...props} style={[
40
- tw.style('items-center justify-center', TWCLASSMAP_BUTTONICON_SIZE_DIMENSION[size], borderRadiusClass, backgroundColor, isDisabled ? 'opacity-50' : 'opacity-100', twClassName),
39
+ tw.style('items-center justify-center rounded-full', TWCLASSMAP_BUTTONICON_SIZE_DIMENSION[size], backgroundColor, isDisabled ? 'opacity-50' : 'opacity-100', twClassName),
41
40
  style,
42
41
  ]}>
43
42
  <Icon name={iconName} color={twIconColorClassNames} size={MAP_BUTTONICON_SIZE_ICONSIZE[size]} {...iconProps}/>
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonIcon.mjs","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,SAAS,EACT,c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;QACxD,YAAY,CAAC,IAAI,CAAC,CAAC;QACnB,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC,CAAC;IAEF,MAAM,iBAAiB,GAAG,CAAC,KAA4B,EAAE,EAAE;QACzD,YAAY,CAAC,KAAK,CAAC,CAAC;QACpB,UAAU,EAAE,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,cAAc,CACb,QAAQ,CAAC,CAAC,UAAU,CAAC,CACrB,SAAS,CAAC,CAAC,gBAAgB,CAAC,CAC5B,UAAU,CAAC,CAAC,iBAAiB,CAAC,CAC9B,UAAU,CACV,MAAM,CAAC,aAAa,CACpB,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,6BAA6B,EAC7B,oCAAoC,CAAC,IAAI,CAAC,EAC1C,iBAAiB,EACjB,eAAe,EACf,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa,EACzC,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CAEF;MAAA,CAAC,IAAI,CACH,IAAI,CAAC,CAAC,QAAQ,CAAC,CACf,KAAK,CAAC,CAAC,qBAAkC,CAAC,CAC1C,IAAI,CAAC,CAAC,4BAA4B,CAAC,IAAI,CAAC,CAAC,CACzC,IAAI,SAAS,CAAC,EAElB;IAAA,EAAE,cAAc,CAAC,CAClB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n IconColor,\n ButtonIconSize,\n ButtonIconVariant,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useState } from 'react';\nimport type { GestureResponderEvent } from 'react-native';\n\nimport { Icon } from '../Icon';\nimport { ButtonAnimated } from '../temp-components/ButtonAnimated';\n\nimport {\n MAP_BUTTONICON_SIZE_ICONSIZE,\n TWCLASSMAP_BUTTONICON_SIZE_DIMENSION,\n} from './ButtonIcon.constants';\nimport type { ButtonIconProps } from './ButtonIcon.types';\n\nexport const ButtonIcon = ({\n size = ButtonIconSize.Md,\n iconName,\n iconProps,\n isDisabled = false,\n variant = ButtonIconVariant.Default,\n onPressIn,\n onPressOut,\n twClassName,\n style,\n ...props\n}: ButtonIconProps) => {\n const [isPressed, setIsPressed] = useState(false);\n const tw = useTailwind();\n\n let backgroundColor = 'bg-transparent';\n if (variant === ButtonIconVariant.Floating) {\n backgroundColor = 'bg-icon-default';\n } else if (variant === ButtonIconVariant.Filled) {\n backgroundColor = isPressed ? 'bg-muted-pressed' : 'bg-muted';\n } else if (isPressed) {\n backgroundColor = 'bg-pressed';\n }\n\n const twIconColorClassNames =\n variant === ButtonIconVariant.Floating\n ? 'text-primary-inverse'\n : 'text-icon-default';\n\n const borderRadiusClass =\n variant === ButtonIconVariant.Default ? 'rounded-lg' : 'rounded-full';\n\n const onPressInHandler = (event: GestureResponderEvent) => {\n setIsPressed(true);\n onPressIn?.(event);\n };\n\n const onPressOutHandler = (event: GestureResponderEvent) => {\n setIsPressed(false);\n onPressOut?.(event);\n };\n\n return (\n <ButtonAnimated\n disabled={isDisabled}\n onPressIn={onPressInHandler}\n onPressOut={onPressOutHandler}\n accessible\n testID=\"button-icon\"\n {...props}\n style={[\n tw.style(\n 'items-center justify-center',\n TWCLASSMAP_BUTTONICON_SIZE_DIMENSION[size],\n borderRadiusClass,\n backgroundColor,\n isDisabled ? 'opacity-50' : 'opacity-100',\n twClassName,\n ),\n style,\n ]}\n >\n <Icon\n name={iconName}\n color={twIconColorClassNames as IconColor}\n size={MAP_BUTTONICON_SIZE_ICONSIZE[size]}\n {...iconProps}\n />\n </ButtonAnimated>\n );\n};\n"]}
1
+ {"version":3,"file":"ButtonIcon.mjs","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,SAAS,EACT,cAAc,EACd,iBAAiB,EAClB,gDAAgD;AACjD,OAAO,EAAE,WAAW,EAAE,sD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,CAAC;QACpB,UAAU,EAAE,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,cAAc,CACb,QAAQ,CAAC,CAAC,UAAU,CAAC,CACrB,SAAS,CAAC,CAAC,gBAAgB,CAAC,CAC5B,UAAU,CAAC,CAAC,iBAAiB,CAAC,CAC9B,UAAU,CACV,MAAM,CAAC,aAAa,CACpB,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,0CAA0C,EAC1C,oCAAoC,CAAC,IAAI,CAAC,EAC1C,eAAe,EACf,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa,EACzC,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CAEF;MAAA,CAAC,IAAI,CACH,IAAI,CAAC,CAAC,QAAQ,CAAC,CACf,KAAK,CAAC,CAAC,qBAAkC,CAAC,CAC1C,IAAI,CAAC,CAAC,4BAA4B,CAAC,IAAI,CAAC,CAAC,CACzC,IAAI,SAAS,CAAC,EAElB;IAAA,EAAE,cAAc,CAAC,CAClB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n IconColor,\n ButtonIconSize,\n ButtonIconVariant,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useState } from 'react';\nimport type { GestureResponderEvent } from 'react-native';\n\nimport { Icon } from '../Icon';\nimport { ButtonAnimated } from '../temp-components/ButtonAnimated';\n\nimport {\n MAP_BUTTONICON_SIZE_ICONSIZE,\n TWCLASSMAP_BUTTONICON_SIZE_DIMENSION,\n} from './ButtonIcon.constants';\nimport type { ButtonIconProps } from './ButtonIcon.types';\n\nexport const ButtonIcon = ({\n size = ButtonIconSize.Md,\n iconName,\n iconProps,\n isDisabled = false,\n variant = ButtonIconVariant.Default,\n onPressIn,\n onPressOut,\n twClassName,\n style,\n ...props\n}: ButtonIconProps) => {\n const [isPressed, setIsPressed] = useState(false);\n const tw = useTailwind();\n\n let backgroundColor = 'bg-transparent';\n if (variant === ButtonIconVariant.Floating) {\n backgroundColor = 'bg-icon-default';\n } else if (variant === ButtonIconVariant.Filled) {\n backgroundColor = isPressed ? 'bg-muted-pressed' : 'bg-muted';\n } else if (isPressed) {\n backgroundColor = 'bg-pressed';\n }\n\n const twIconColorClassNames =\n variant === ButtonIconVariant.Floating\n ? 'text-primary-inverse'\n : 'text-icon-default';\n\n const onPressInHandler = (event: GestureResponderEvent) => {\n setIsPressed(true);\n onPressIn?.(event);\n };\n\n const onPressOutHandler = (event: GestureResponderEvent) => {\n setIsPressed(false);\n onPressOut?.(event);\n };\n\n return (\n <ButtonAnimated\n disabled={isDisabled}\n onPressIn={onPressInHandler}\n onPressOut={onPressOutHandler}\n accessible\n testID=\"button-icon\"\n {...props}\n style={[\n tw.style(\n 'items-center justify-center rounded-full',\n TWCLASSMAP_BUTTONICON_SIZE_DIMENSION[size],\n backgroundColor,\n isDisabled ? 'opacity-50' : 'opacity-100',\n twClassName,\n ),\n style,\n ]}\n >\n <Icon\n name={iconName}\n color={twIconColorClassNames as IconColor}\n size={MAP_BUTTONICON_SIZE_ICONSIZE[size]}\n {...iconProps}\n />\n </ButtonAnimated>\n );\n};\n"]}
@@ -7,20 +7,26 @@ exports.Card = void 0;
7
7
  const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-twrnc-preset");
8
8
  const react_1 = __importDefault(require("react"));
9
9
  const react_native_1 = require("react-native");
10
- const Card = ({ children, onPress, twClassName, touchableOpacityProps, style, ...props }) => {
10
+ const Card = ({ children, isInteractive = false, twClassName, style, accessibilityRole, ...props }) => {
11
11
  const tw = (0, design_system_twrnc_preset_1.useTailwind)();
12
- const cardStyle = [
13
- tw.style('p-4 rounded border border-default bg-default', twClassName),
14
- style,
15
- ];
16
- if (onPress) {
17
- return (<react_native_1.TouchableOpacity {...props} onPress={onPress} style={cardStyle} {...touchableOpacityProps}>
12
+ const baseClassName = 'p-4 rounded-2xl bg-section';
13
+ if (isInteractive) {
14
+ const getPressableStyle = ({ pressed, }) => {
15
+ const baseStyle = tw.style(baseClassName, twClassName, pressed && 'bg-pressed');
16
+ const userStyle = typeof style === 'function' ? style({ pressed }) : style;
17
+ return userStyle ? [baseStyle, userStyle] : baseStyle;
18
+ };
19
+ return (<react_native_1.Pressable accessibilityRole={accessibilityRole ?? 'button'} style={getPressableStyle} {...props}>
18
20
  {children}
19
- </react_native_1.TouchableOpacity>);
21
+ </react_native_1.Pressable>);
20
22
  }
21
- return (<react_native_1.View style={cardStyle} {...props}>
23
+ return (<react_native_1.View style={[
24
+ tw.style(baseClassName, twClassName),
25
+ style,
26
+ ]} {...props}>
22
27
  {children}
23
28
  </react_native_1.View>);
24
29
  };
25
30
  exports.Card = Card;
31
+ exports.Card.displayName = 'Card';
26
32
  //# sourceMappingURL=Card.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Card.cjs","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":";;;;;;AAAA,8FAA4E;AAC5E,kDAA0B;AAC1B,+CAAsD;AAI/C,MAAM,IAAI,GAAG,CAAC,EACnB,QAAQ,EACR,OAAO,EACP,WAAW,EACX,qBAAqB,EACrB,KAAK,EACL,GAAG,KAAK,EACE,EAAE,EAAE;IACd,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IAEzB,MAAM,SAAS,GAAG;QAChB,EAAE,CAAC,KAAK,CAAC,8CAA8C,EAAE,WAAW,CAAC;QACrE,KAAK;KACN,CAAC;IAEF,IAAI,OAAO,EAAE;QACX,OAAO,CACL,CAAC,+BAAgB,CACf,IAAI,KAAK,CAAC,CACV,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,KAAK,CAAC,CAAC,SAAS,CAAC,CACjB,IAAI,qBAAqB,CAAC,CAE1B;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,+BAAgB,CAAC,CACpB,CAAC;KACH;IAED,OAAO,CACL,CAAC,mBAAI,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,KAAK,CAAC,CAChC;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAjCW,QAAA,IAAI,QAiCf","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { TouchableOpacity, View } from 'react-native';\n\nimport type { CardProps } from './Card.types';\n\nexport const Card = ({\n children,\n onPress,\n twClassName,\n touchableOpacityProps,\n style,\n ...props\n}: CardProps) => {\n const tw = useTailwind();\n\n const cardStyle = [\n tw.style('p-4 rounded border border-default bg-default', twClassName),\n style,\n ];\n\n if (onPress) {\n return (\n <TouchableOpacity\n {...props}\n onPress={onPress}\n style={cardStyle}\n {...touchableOpacityProps}\n >\n {children}\n </TouchableOpacity>\n );\n }\n\n return (\n <View style={cardStyle} {...props}>\n {children}\n </View>\n );\n};\n"]}
1
+ {"version":3,"file":"Card.cjs","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":";;;;;;AAAA,8FAA4E;AAC5E,kDAA0B;AAC1B,+CAA+C;AAUxC,MAAM,IAAI,GAAwB,CAAC,EACxC,QAAQ,EACR,aAAa,GAAG,KAAK,EACrB,WAAW,EACX,KAAK,EACL,iBAAiB,EACjB,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IACzB,MAAM,aAAa,GAAG,4BAA4B,CAAC;IAEnD,IAAI,aAAa,EAAE;QACjB,MAAM,iBAAiB,GAAG,CAAC,EACzB,OAAO,GACoB,EAAwB,EAAE;YACrD,MAAM,SAAS,GAAG,EAAE,CAAC,KAAK,CACxB,aAAa,EACb,WAAW,EACX,OAAO,IAAI,YAAY,CACxB,CAAC;YACF,MAAM,SAAS,GACb,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;YAE3D,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACxD,CAAC,CAAC;QAEF,OAAO,CACL,CAAC,wBAAS,CACR,iBAAiB,CAAC,CAAC,iBAAiB,IAAI,QAAQ,CAAC,CACjD,KAAK,CAAC,CAAC,iBAAiB,CAAC,CACzB,IAAK,KAAoD,CAAC,CAE1D;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,wBAAS,CAAC,CACb,CAAC;KACH;IAED,OAAO,CACL,CAAC,mBAAI,CACH,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CAAC,aAAa,EAAE,WAAW,CAAC;YACpC,KAA6B;SAC9B,CAAC,CACF,IAAI,KAAK,CAAC,CAEV;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAhDW,QAAA,IAAI,QAgDf;AAEF,YAAI,CAAC,WAAW,GAAG,MAAM,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { Pressable, View } from 'react-native';\nimport type {\n PressableProps,\n PressableStateCallbackType,\n StyleProp,\n ViewStyle,\n} from 'react-native';\n\nimport type { CardProps } from './Card.types';\n\nexport const Card: React.FC<CardProps> = ({\n children,\n isInteractive = false,\n twClassName,\n style,\n accessibilityRole,\n ...props\n}) => {\n const tw = useTailwind();\n const baseClassName = 'p-4 rounded-2xl bg-section';\n\n if (isInteractive) {\n const getPressableStyle = ({\n pressed,\n }: PressableStateCallbackType): StyleProp<ViewStyle> => {\n const baseStyle = tw.style(\n baseClassName,\n twClassName,\n pressed && 'bg-pressed',\n );\n const userStyle =\n typeof style === 'function' ? style({ pressed }) : style;\n\n return userStyle ? [baseStyle, userStyle] : baseStyle;\n };\n\n return (\n <Pressable\n accessibilityRole={accessibilityRole ?? 'button'}\n style={getPressableStyle}\n {...(props as Omit<PressableProps, 'children' | 'style'>)}\n >\n {children}\n </Pressable>\n );\n }\n\n return (\n <View\n style={[\n tw.style(baseClassName, twClassName),\n style as StyleProp<ViewStyle>,\n ]}\n {...props}\n >\n {children}\n </View>\n );\n};\n\nCard.displayName = 'Card';\n"]}
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import type { CardProps } from "./Card.types.cjs";
3
- export declare const Card: ({ children, onPress, twClassName, touchableOpacityProps, style, ...props }: CardProps) => React.JSX.Element;
3
+ export declare const Card: React.FC<CardProps>;
4
4
  //# sourceMappingURL=Card.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Card.d.cts","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAG1B,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAE9C,eAAO,MAAM,IAAI,+EAOd,SAAS,sBA0BX,CAAC"}
1
+ {"version":3,"file":"Card.d.cts","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAS1B,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAE9C,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAgDpC,CAAC"}
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import type { CardProps } from "./Card.types.mjs";
3
- export declare const Card: ({ children, onPress, twClassName, touchableOpacityProps, style, ...props }: CardProps) => React.JSX.Element;
3
+ export declare const Card: React.FC<CardProps>;
4
4
  //# sourceMappingURL=Card.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Card.d.mts","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAG1B,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAE9C,eAAO,MAAM,IAAI,+EAOd,SAAS,sBA0BX,CAAC"}
1
+ {"version":3,"file":"Card.d.mts","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAS1B,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAE9C,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAgDpC,CAAC"}
@@ -7,20 +7,26 @@ function $importDefault(module) {
7
7
  import { useTailwind } from "@metamask-previews/design-system-twrnc-preset";
8
8
  import $React from "react";
9
9
  const React = $importDefault($React);
10
- import { TouchableOpacity, View } from "react-native";
11
- export const Card = ({ children, onPress, twClassName, touchableOpacityProps, style, ...props }) => {
10
+ import { Pressable, View } from "react-native";
11
+ export const Card = ({ children, isInteractive = false, twClassName, style, accessibilityRole, ...props }) => {
12
12
  const tw = useTailwind();
13
- const cardStyle = [
14
- tw.style('p-4 rounded border border-default bg-default', twClassName),
15
- style,
16
- ];
17
- if (onPress) {
18
- return (<TouchableOpacity {...props} onPress={onPress} style={cardStyle} {...touchableOpacityProps}>
13
+ const baseClassName = 'p-4 rounded-2xl bg-section';
14
+ if (isInteractive) {
15
+ const getPressableStyle = ({ pressed, }) => {
16
+ const baseStyle = tw.style(baseClassName, twClassName, pressed && 'bg-pressed');
17
+ const userStyle = typeof style === 'function' ? style({ pressed }) : style;
18
+ return userStyle ? [baseStyle, userStyle] : baseStyle;
19
+ };
20
+ return (<Pressable accessibilityRole={accessibilityRole ?? 'button'} style={getPressableStyle} {...props}>
19
21
  {children}
20
- </TouchableOpacity>);
22
+ </Pressable>);
21
23
  }
22
- return (<View style={cardStyle} {...props}>
24
+ return (<View style={[
25
+ tw.style(baseClassName, twClassName),
26
+ style,
27
+ ]} {...props}>
23
28
  {children}
24
29
  </View>);
25
30
  };
31
+ Card.displayName = 'Card';
26
32
  //# sourceMappingURL=Card.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Card.mjs","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,MAAK,cAAc;;AAC1B,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,qBAAqB;AAItD,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,EACnB,QAAQ,EACR,OAAO,EACP,WAAW,EACX,qBAAqB,EACrB,KAAK,EACL,GAAG,KAAK,EACE,EAAE,EAAE;IACd,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IAEzB,MAAM,SAAS,GAAG;QAChB,EAAE,CAAC,KAAK,CAAC,8CAA8C,EAAE,WAAW,CAAC;QACrE,KAAK;KACN,CAAC;IAEF,IAAI,OAAO,EAAE;QACX,OAAO,CACL,CAAC,gBAAgB,CACf,IAAI,KAAK,CAAC,CACV,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,KAAK,CAAC,CAAC,SAAS,CAAC,CACjB,IAAI,qBAAqB,CAAC,CAE1B;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,gBAAgB,CAAC,CACpB,CAAC;KACH;IAED,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,KAAK,CAAC,CAChC;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { TouchableOpacity, View } from 'react-native';\n\nimport type { CardProps } from './Card.types';\n\nexport const Card = ({\n children,\n onPress,\n twClassName,\n touchableOpacityProps,\n style,\n ...props\n}: CardProps) => {\n const tw = useTailwind();\n\n const cardStyle = [\n tw.style('p-4 rounded border border-default bg-default', twClassName),\n style,\n ];\n\n if (onPress) {\n return (\n <TouchableOpacity\n {...props}\n onPress={onPress}\n style={cardStyle}\n {...touchableOpacityProps}\n >\n {children}\n </TouchableOpacity>\n );\n }\n\n return (\n <View style={cardStyle} {...props}>\n {children}\n </View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AAI,KAAK,CAAC,CAEV;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { Pressable, View } from 'react-native';\nimport type {\n PressableProps,\n PressableStateCallbackType,\n StyleProp,\n ViewStyle,\n} from 'react-native';\n\nimport type { CardProps } from './Card.types';\n\nexport const Card: React.FC<CardProps> = ({\n children,\n isInteractive = false,\n twClassName,\n style,\n accessibilityRole,\n ...props\n}) => {\n const tw = useTailwind();\n const baseClassName = 'p-4 rounded-2xl bg-section';\n\n if (isInteractive) {\n const getPressableStyle = ({\n pressed,\n }: PressableStateCallbackType): StyleProp<ViewStyle> => {\n const baseStyle = tw.style(\n baseClassName,\n twClassName,\n pressed && 'bg-pressed',\n );\n const userStyle =\n typeof style === 'function' ? style({ pressed }) : style;\n\n return userStyle ? [baseStyle, userStyle] : baseStyle;\n };\n\n return (\n <Pressable\n accessibilityRole={accessibilityRole ?? 'button'}\n style={getPressableStyle}\n {...(props as Omit<PressableProps, 'children' | 'style'>)}\n >\n {children}\n </Pressable>\n );\n }\n\n return (\n <View\n style={[\n tw.style(baseClassName, twClassName),\n style as StyleProp<ViewStyle>,\n ]}\n {...props}\n >\n {children}\n </View>\n );\n};\n\nCard.displayName = 'Card';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Card.types.cjs","sourceRoot":"","sources":["../../../src/components/Card/Card.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react';\nimport type { TouchableOpacityProps } from 'react-native';\n\n/**\n * Card component props.\n */\nexport type CardProps = {\n /**\n * Content to display inside the card.\n */\n children: ReactNode;\n /**\n * Optional callback when the card is pressed.\n * When provided, the card wraps content in a TouchableOpacity.\n */\n onPress?: () => void;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n /**\n * Optional props to pass to the underlying TouchableOpacity when onPress is provided.\n */\n touchableOpacityProps?: Omit<\n TouchableOpacityProps,\n 'onPress' | 'style' | 'children'\n >;\n} & TouchableOpacityProps;\n"]}
1
+ {"version":3,"file":"Card.types.cjs","sourceRoot":"","sources":["../../../src/components/Card/Card.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react';\nimport type { PressableProps, ViewProps } from 'react-native';\n\n/**\n * Card component props.\n *\n * When `isInteractive` is `false` (default), the root is a `View`.\n * When `true`, the root is a `Pressable` and all `PressableProps` are available.\n */\nexport type CardProps =\n | ({\n children: ReactNode;\n twClassName?: string;\n isInteractive?: false;\n } & ViewProps)\n | ({\n children: ReactNode;\n twClassName?: string;\n isInteractive: true;\n } & Omit<PressableProps, 'children'>);\n"]}
@@ -1,25 +1,18 @@
1
1
  import type { ReactNode } from "react";
2
- import type { TouchableOpacityProps } from "react-native";
2
+ import type { PressableProps, ViewProps } from "react-native";
3
3
  /**
4
4
  * Card component props.
5
+ *
6
+ * When `isInteractive` is `false` (default), the root is a `View`.
7
+ * When `true`, the root is a `Pressable` and all `PressableProps` are available.
5
8
  */
6
- export type CardProps = {
7
- /**
8
- * Content to display inside the card.
9
- */
9
+ export type CardProps = ({
10
10
  children: ReactNode;
11
- /**
12
- * Optional callback when the card is pressed.
13
- * When provided, the card wraps content in a TouchableOpacity.
14
- */
15
- onPress?: () => void;
16
- /**
17
- * Optional prop to add twrnc overriding classNames.
18
- */
19
11
  twClassName?: string;
20
- /**
21
- * Optional props to pass to the underlying TouchableOpacity when onPress is provided.
22
- */
23
- touchableOpacityProps?: Omit<TouchableOpacityProps, 'onPress' | 'style' | 'children'>;
24
- } & TouchableOpacityProps;
12
+ isInteractive?: false;
13
+ } & ViewProps) | ({
14
+ children: ReactNode;
15
+ twClassName?: string;
16
+ isInteractive: true;
17
+ } & Omit<PressableProps, 'children'>);
25
18
  //# sourceMappingURL=Card.types.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Card.types.d.cts","sourceRoot":"","sources":["../../../src/components/Card/Card.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc;AACvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB;AAE1D;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,qBAAqB,CAAC,EAAE,IAAI,CAC1B,qBAAqB,EACrB,SAAS,GAAG,OAAO,GAAG,UAAU,CACjC,CAAC;CACH,GAAG,qBAAqB,CAAC"}
1
+ {"version":3,"file":"Card.types.d.cts","sourceRoot":"","sources":["../../../src/components/Card/Card.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,qBAAqB;AAE9D;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GACjB,CAAC;IACC,QAAQ,EAAE,SAAS,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,KAAK,CAAC;CACvB,GAAG,SAAS,CAAC,GACd,CAAC;IACC,QAAQ,EAAE,SAAS,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,IAAI,CAAC;CACrB,GAAG,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC,CAAC"}
@@ -1,25 +1,18 @@
1
1
  import type { ReactNode } from "react";
2
- import type { TouchableOpacityProps } from "react-native";
2
+ import type { PressableProps, ViewProps } from "react-native";
3
3
  /**
4
4
  * Card component props.
5
+ *
6
+ * When `isInteractive` is `false` (default), the root is a `View`.
7
+ * When `true`, the root is a `Pressable` and all `PressableProps` are available.
5
8
  */
6
- export type CardProps = {
7
- /**
8
- * Content to display inside the card.
9
- */
9
+ export type CardProps = ({
10
10
  children: ReactNode;
11
- /**
12
- * Optional callback when the card is pressed.
13
- * When provided, the card wraps content in a TouchableOpacity.
14
- */
15
- onPress?: () => void;
16
- /**
17
- * Optional prop to add twrnc overriding classNames.
18
- */
19
11
  twClassName?: string;
20
- /**
21
- * Optional props to pass to the underlying TouchableOpacity when onPress is provided.
22
- */
23
- touchableOpacityProps?: Omit<TouchableOpacityProps, 'onPress' | 'style' | 'children'>;
24
- } & TouchableOpacityProps;
12
+ isInteractive?: false;
13
+ } & ViewProps) | ({
14
+ children: ReactNode;
15
+ twClassName?: string;
16
+ isInteractive: true;
17
+ } & Omit<PressableProps, 'children'>);
25
18
  //# sourceMappingURL=Card.types.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Card.types.d.mts","sourceRoot":"","sources":["../../../src/components/Card/Card.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc;AACvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB;AAE1D;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,qBAAqB,CAAC,EAAE,IAAI,CAC1B,qBAAqB,EACrB,SAAS,GAAG,OAAO,GAAG,UAAU,CACjC,CAAC;CACH,GAAG,qBAAqB,CAAC"}
1
+ {"version":3,"file":"Card.types.d.mts","sourceRoot":"","sources":["../../../src/components/Card/Card.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,qBAAqB;AAE9D;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GACjB,CAAC;IACC,QAAQ,EAAE,SAAS,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,KAAK,CAAC;CACvB,GAAG,SAAS,CAAC,GACd,CAAC;IACC,QAAQ,EAAE,SAAS,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,IAAI,CAAC;CACrB,GAAG,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Card.types.mjs","sourceRoot":"","sources":["../../../src/components/Card/Card.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react';\nimport type { TouchableOpacityProps } from 'react-native';\n\n/**\n * Card component props.\n */\nexport type CardProps = {\n /**\n * Content to display inside the card.\n */\n children: ReactNode;\n /**\n * Optional callback when the card is pressed.\n * When provided, the card wraps content in a TouchableOpacity.\n */\n onPress?: () => void;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n /**\n * Optional props to pass to the underlying TouchableOpacity when onPress is provided.\n */\n touchableOpacityProps?: Omit<\n TouchableOpacityProps,\n 'onPress' | 'style' | 'children'\n >;\n} & TouchableOpacityProps;\n"]}
1
+ {"version":3,"file":"Card.types.mjs","sourceRoot":"","sources":["../../../src/components/Card/Card.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react';\nimport type { PressableProps, ViewProps } from 'react-native';\n\n/**\n * Card component props.\n *\n * When `isInteractive` is `false` (default), the root is a `View`.\n * When `true`, the root is a `Pressable` and all `PressableProps` are available.\n */\nexport type CardProps =\n | ({\n children: ReactNode;\n twClassName?: string;\n isInteractive?: false;\n } & ViewProps)\n | ({\n children: ReactNode;\n twClassName?: string;\n isInteractive: true;\n } & Omit<PressableProps, 'children'>);\n"]}
@@ -101,7 +101,7 @@ exports.Checkbox = (0, react_1.forwardRef)(({ isSelected, isDisabled = false, is
101
101
  ]}>
102
102
  {({ pressed }) => (<>
103
103
  <AnimatedView {...checkboxContainerProps} style={[
104
- tw `${getCheckboxContainerStyle(pressed)} flex size-[22px] items-center justify-center rounded border-2`,
104
+ tw `${getCheckboxContainerStyle(pressed)} flex size-[22px] items-center justify-center rounded-full border-2`,
105
105
  { transform: [{ scale: scaleAnim }] },
106
106
  ]}>
107
107
  {/* Always render icon, opacity driven by iconAnim */}