@metamask-previews/design-system-react-native 0.1.0-preview.a448767 → 0.2.0-preview.ec6504c

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 (77) hide show
  1. package/CHANGELOG.md +21 -1
  2. package/dist/components/Box/Box.cjs +22 -5
  3. package/dist/components/Box/Box.cjs.map +1 -1
  4. package/dist/components/Box/Box.constants.cjs +218 -1
  5. package/dist/components/Box/Box.constants.cjs.map +1 -1
  6. package/dist/components/Box/Box.constants.d.cts +16 -1
  7. package/dist/components/Box/Box.constants.d.cts.map +1 -1
  8. package/dist/components/Box/Box.constants.d.mts +16 -1
  9. package/dist/components/Box/Box.constants.d.mts.map +1 -1
  10. package/dist/components/Box/Box.constants.mjs +217 -0
  11. package/dist/components/Box/Box.constants.mjs.map +1 -1
  12. package/dist/components/Box/Box.d.cts +1 -1
  13. package/dist/components/Box/Box.d.cts.map +1 -1
  14. package/dist/components/Box/Box.d.mts +1 -1
  15. package/dist/components/Box/Box.d.mts.map +1 -1
  16. package/dist/components/Box/Box.mjs +23 -6
  17. package/dist/components/Box/Box.mjs.map +1 -1
  18. package/dist/components/Box/Box.types.cjs.map +1 -1
  19. package/dist/components/Box/Box.types.d.cts +84 -1
  20. package/dist/components/Box/Box.types.d.cts.map +1 -1
  21. package/dist/components/Box/Box.types.d.mts +84 -1
  22. package/dist/components/Box/Box.types.d.mts.map +1 -1
  23. package/dist/components/Box/Box.types.mjs.map +1 -1
  24. package/dist/components/Box/index.cjs.map +1 -1
  25. package/dist/components/Box/index.d.cts +1 -1
  26. package/dist/components/Box/index.d.cts.map +1 -1
  27. package/dist/components/Box/index.d.mts +1 -1
  28. package/dist/components/Box/index.d.mts.map +1 -1
  29. package/dist/components/Box/index.mjs.map +1 -1
  30. package/dist/components/ButtonBase/ButtonBase.cjs +3 -4
  31. package/dist/components/ButtonBase/ButtonBase.cjs.map +1 -1
  32. package/dist/components/ButtonBase/ButtonBase.d.cts.map +1 -1
  33. package/dist/components/ButtonBase/ButtonBase.d.mts.map +1 -1
  34. package/dist/components/ButtonBase/ButtonBase.mjs +1 -2
  35. package/dist/components/ButtonBase/ButtonBase.mjs.map +1 -1
  36. package/dist/components/Checkbox/Checkbox.cjs +1 -1
  37. package/dist/components/Checkbox/Checkbox.cjs.map +1 -1
  38. package/dist/components/Checkbox/Checkbox.mjs +1 -1
  39. package/dist/components/Checkbox/Checkbox.mjs.map +1 -1
  40. package/dist/components/Icon/Icon.assets.cjs +10 -0
  41. package/dist/components/Icon/Icon.assets.cjs.map +1 -1
  42. package/dist/components/Icon/Icon.assets.d.cts.map +1 -1
  43. package/dist/components/Icon/Icon.assets.d.mts.map +1 -1
  44. package/dist/components/Icon/Icon.assets.mjs +10 -0
  45. package/dist/components/Icon/Icon.assets.mjs.map +1 -1
  46. package/dist/components/Icon/assets/apple-logo.svg +1 -0
  47. package/dist/components/Icon/assets/backspace.svg +1 -0
  48. package/dist/components/Icon/assets/candlestick.svg +1 -0
  49. package/dist/components/Icon/assets/clear.svg +1 -0
  50. package/dist/components/Icon/assets/error.svg +1 -1
  51. package/dist/components/Icon/assets/hash-tag.svg +1 -1
  52. package/dist/components/Icon/assets/metamask-fox-outline.svg +1 -0
  53. package/dist/components/Text/Text.constants.cjs +9 -0
  54. package/dist/components/Text/Text.constants.cjs.map +1 -1
  55. package/dist/components/Text/Text.constants.d.cts.map +1 -1
  56. package/dist/components/Text/Text.constants.d.mts.map +1 -1
  57. package/dist/components/Text/Text.constants.mjs +9 -0
  58. package/dist/components/Text/Text.constants.mjs.map +1 -1
  59. package/dist/components/Text/Text.types.cjs.map +1 -1
  60. package/dist/components/Text/Text.types.d.cts +2 -2
  61. package/dist/components/Text/Text.types.d.mts +2 -2
  62. package/dist/components/Text/Text.types.mjs.map +1 -1
  63. package/dist/components/TextButton/TextButton.cjs +1 -0
  64. package/dist/components/TextButton/TextButton.cjs.map +1 -1
  65. package/dist/components/TextButton/TextButton.d.cts.map +1 -1
  66. package/dist/components/TextButton/TextButton.d.mts.map +1 -1
  67. package/dist/components/TextButton/TextButton.mjs +1 -0
  68. package/dist/components/TextButton/TextButton.mjs.map +1 -1
  69. package/dist/types/index.cjs +145 -1
  70. package/dist/types/index.cjs.map +1 -1
  71. package/dist/types/index.d.cts +143 -1
  72. package/dist/types/index.d.cts.map +1 -1
  73. package/dist/types/index.d.mts +143 -1
  74. package/dist/types/index.d.mts.map +1 -1
  75. package/dist/types/index.mjs +144 -0
  76. package/dist/types/index.mjs.map +1 -1
  77. package/package.json +8 -7
@@ -1 +1 @@
1
- {"version":3,"file":"Box.d.cts","sourceRoot":"","sources":["../../../src/components/Box/Box.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAI1B,OAAO,KAAK,EAAE,QAAQ,EAAE,wBAAoB;AAE5C,eAAO,MAAM,GAAG,yGAUb,QAAQ,sBAgBV,CAAC"}
1
+ {"version":3,"file":"Box.d.cts","sourceRoot":"","sources":["../../../src/components/Box/Box.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAqB1B,OAAO,KAAK,EAAE,QAAQ,EAAE,wBAAoB;AAE5C,eAAO,MAAM,GAAG,mVA2Bb,QAAQ,sBAiCV,CAAC"}
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import type { BoxProps } from "./Box.types.mjs";
3
- export declare const Box: ({ flexDirection, flexWrap, gap, alignItems, justifyContent, twClassName, style, children, ...props }: BoxProps) => React.JSX.Element;
3
+ export declare const Box: ({ flexDirection, flexWrap, gap, alignItems, justifyContent, margin, marginTop, marginRight, marginBottom, marginLeft, marginHorizontal, marginVertical, padding, paddingTop, paddingRight, paddingBottom, paddingLeft, paddingHorizontal, paddingVertical, borderWidth, borderColor, backgroundColor, twClassName, style, children, ...props }: BoxProps) => React.JSX.Element;
4
4
  //# sourceMappingURL=Box.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Box.d.mts","sourceRoot":"","sources":["../../../src/components/Box/Box.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAI1B,OAAO,KAAK,EAAE,QAAQ,EAAE,wBAAoB;AAE5C,eAAO,MAAM,GAAG,yGAUb,QAAQ,sBAgBV,CAAC"}
1
+ {"version":3,"file":"Box.d.mts","sourceRoot":"","sources":["../../../src/components/Box/Box.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAqB1B,OAAO,KAAK,EAAE,QAAQ,EAAE,wBAAoB;AAE5C,eAAO,MAAM,GAAG,mVA2Bb,QAAQ,sBAiCV,CAAC"}
@@ -8,18 +8,35 @@ import { useTailwind } from "@metamask-previews/design-system-twrnc-preset";
8
8
  import $React from "react";
9
9
  const React = $importDefault($React);
10
10
  import { View } from "react-native/index.js";
11
- import { TWCLASSMAP_BOX_GAP } from "./Box.constants.mjs";
12
- export const Box = ({ flexDirection, flexWrap, gap, alignItems, justifyContent, twClassName = '', style, children, ...props }) => {
11
+ import { TWCLASSMAP_BOX_GAP, TWCLASSMAP_BOX_MARGIN, TWCLASSMAP_BOX_MARGIN_TOP, TWCLASSMAP_BOX_MARGIN_RIGHT, TWCLASSMAP_BOX_MARGIN_BOTTOM, TWCLASSMAP_BOX_MARGIN_LEFT, TWCLASSMAP_BOX_MARGIN_HORIZONTAL, TWCLASSMAP_BOX_MARGIN_VERTICAL, TWCLASSMAP_BOX_PADDING, TWCLASSMAP_BOX_PADDING_TOP, TWCLASSMAP_BOX_PADDING_RIGHT, TWCLASSMAP_BOX_PADDING_BOTTOM, TWCLASSMAP_BOX_PADDING_LEFT, TWCLASSMAP_BOX_PADDING_HORIZONTAL, TWCLASSMAP_BOX_PADDING_VERTICAL, TWCLASSMAP_BOX_BORDER_WIDTH } from "./Box.constants.mjs";
12
+ export const Box = ({ flexDirection, flexWrap, gap, alignItems, justifyContent, margin, marginTop, marginRight, marginBottom, marginLeft, marginHorizontal, marginVertical, padding, paddingTop, paddingRight, paddingBottom, paddingLeft, paddingHorizontal, paddingVertical, borderWidth, borderColor, backgroundColor, twClassName = '', style, children, ...props }) => {
13
13
  const tw = useTailwind();
14
- const twContainerClassNames = `
14
+ const twContainerClassNames = tw `
15
15
  flex
16
16
  ${flexDirection ?? ''}
17
17
  ${flexWrap ?? ''}
18
18
  ${gap !== undefined ? TWCLASSMAP_BOX_GAP[gap] : ''}
19
19
  ${alignItems ?? ''}
20
- ${justifyContent ?? ''}
21
- ${twClassName}`.trim();
22
- return (<View style={[tw `${twContainerClassNames}`, style]} {...props}>
20
+ ${justifyContent ?? ''}
21
+ ${margin !== undefined ? TWCLASSMAP_BOX_MARGIN[margin] : ''}
22
+ ${marginTop !== undefined ? TWCLASSMAP_BOX_MARGIN_TOP[marginTop] : ''}
23
+ ${marginRight !== undefined ? TWCLASSMAP_BOX_MARGIN_RIGHT[marginRight] : ''}
24
+ ${marginBottom !== undefined ? TWCLASSMAP_BOX_MARGIN_BOTTOM[marginBottom] : ''}
25
+ ${marginLeft !== undefined ? TWCLASSMAP_BOX_MARGIN_LEFT[marginLeft] : ''}
26
+ ${marginHorizontal !== undefined ? TWCLASSMAP_BOX_MARGIN_HORIZONTAL[marginHorizontal] : ''}
27
+ ${marginVertical !== undefined ? TWCLASSMAP_BOX_MARGIN_VERTICAL[marginVertical] : ''}
28
+ ${padding !== undefined ? TWCLASSMAP_BOX_PADDING[padding] : ''}
29
+ ${paddingTop !== undefined ? TWCLASSMAP_BOX_PADDING_TOP[paddingTop] : ''}
30
+ ${paddingRight !== undefined ? TWCLASSMAP_BOX_PADDING_RIGHT[paddingRight] : ''}
31
+ ${paddingBottom !== undefined ? TWCLASSMAP_BOX_PADDING_BOTTOM[paddingBottom] : ''}
32
+ ${paddingLeft !== undefined ? TWCLASSMAP_BOX_PADDING_LEFT[paddingLeft] : ''}
33
+ ${paddingHorizontal !== undefined ? TWCLASSMAP_BOX_PADDING_HORIZONTAL[paddingHorizontal] : ''}
34
+ ${paddingVertical !== undefined ? TWCLASSMAP_BOX_PADDING_VERTICAL[paddingVertical] : ''}
35
+ ${borderWidth !== undefined ? TWCLASSMAP_BOX_BORDER_WIDTH[borderWidth] : ''}
36
+ ${borderColor ?? ''}
37
+ ${backgroundColor ?? ''}
38
+ ${twClassName}`;
39
+ return (<View style={[twContainerClassNames, style]} {...props}>
23
40
  {children}
24
41
  </View>);
25
42
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Box.mjs","sourceRoot":"","sources":["../../../src/components/Box/Box.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,MAAK,cAAc;;AAC1B,OAAO,EAAE,IAAI,EAAE,8BAAqB;AAEpC,OAAO,EAAE,kBAAkB,EAAE,4BAAwB;AAGrD,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,EAClB,aAAa,EACb,QAAQ,EACR,GAAG,EACH,UAAU,EACV,cAAc,EACd,WAAW,GAAG,EAAE,EAChB,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACC,EAAE,EAAE;IACb,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IACzB,MAAM,qBAAqB,GAAG;;MAE1B,aAAa,IAAI,EAAE;MACnB,QAAQ,IAAI,EAAE;MACd,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;MAChD,UAAU,IAAI,EAAE;MAChB,cAAc,IAAI,EAAE;MACpB,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;IAEzB,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA,GAAG,qBAAqB,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAC5D;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 { View } from 'react-native';\n\nimport { TWCLASSMAP_BOX_GAP } from './Box.constants';\nimport type { BoxProps } from './Box.types';\n\nexport const Box = ({\n flexDirection,\n flexWrap,\n gap,\n alignItems,\n justifyContent,\n twClassName = '',\n style,\n children,\n ...props\n}: BoxProps) => {\n const tw = useTailwind();\n const twContainerClassNames = `\n flex\n ${flexDirection ?? ''} \n ${flexWrap ?? ''} \n ${gap !== undefined ? TWCLASSMAP_BOX_GAP[gap] : ''} \n ${alignItems ?? ''} \n ${justifyContent ?? ''} \n ${twClassName}`.trim();\n\n return (\n <View style={[tw`${twContainerClassNames}`, style]} {...props}>\n {children}\n </View>\n );\n};\n"]}
1
+ {"version":3,"file":"Box.mjs","sourceRoot":"","sources":["../../../src/components/Box/Box.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,MAAK,cAAc;;AAC1B,OAAO,EAAE,IAAI,EAAE,8BAAqB;AAEpC,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,yBAAyB,EACzB,2BAA2B,EAC3B,4BAA4B,EAC5B,0BAA0B,EAC1B,gCAAgC,EAChC,8BAA8B,EAC9B,sBAAsB,EACtB,0BAA0B,EAC1B,4BAA4B,EAC5B,6BAA6B,EAC7B,2BAA2B,EAC3B,iCAAiC,EACjC,+BAA+B,EAC/B,2BAA2B,EAC5B,4BAAwB;AAGzB,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,EAClB,aAAa,EACb,QAAQ,EACR,GAAG,EACH,UAAU,EACV,cAAc,EACd,MAAM,EACN,SAAS,EACT,WAAW,EACX,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,OAAO,EACP,UAAU,EACV,YAAY,EACZ,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,WAAW,EACX,WAAW,EACX,eAAe,EACf,WAAW,GAAG,EAAE,EAChB,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACC,EAAE,EAAE;IACb,MAAM,EAAE,GAAG,WAA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AC,aAAa,CAAC,CAAC,CAAC,CAAC,EAAE;MAC/E,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,2BAA2B,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE;MACzE,iBAAiB,KAAK,SAAS,CAAC,CAAC,CAAC,iCAAiC,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,EAAE;MAC3F,eAAe,KAAK,SAAS,CAAC,CAAC,CAAC,+BAA+B,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE;MACrF,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,2BAA2B,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE;MACzE,WAAW,IAAI,EAAE;MACjB,eAAe,IAAI,EAAE;MACrB,WAAW,EAAE,CAAC;IAElB,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,qBAAqB,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CACrD;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 { View } from 'react-native';\n\nimport {\n TWCLASSMAP_BOX_GAP,\n TWCLASSMAP_BOX_MARGIN,\n TWCLASSMAP_BOX_MARGIN_TOP,\n TWCLASSMAP_BOX_MARGIN_RIGHT,\n TWCLASSMAP_BOX_MARGIN_BOTTOM,\n TWCLASSMAP_BOX_MARGIN_LEFT,\n TWCLASSMAP_BOX_MARGIN_HORIZONTAL,\n TWCLASSMAP_BOX_MARGIN_VERTICAL,\n TWCLASSMAP_BOX_PADDING,\n TWCLASSMAP_BOX_PADDING_TOP,\n TWCLASSMAP_BOX_PADDING_RIGHT,\n TWCLASSMAP_BOX_PADDING_BOTTOM,\n TWCLASSMAP_BOX_PADDING_LEFT,\n TWCLASSMAP_BOX_PADDING_HORIZONTAL,\n TWCLASSMAP_BOX_PADDING_VERTICAL,\n TWCLASSMAP_BOX_BORDER_WIDTH,\n} from './Box.constants';\nimport type { BoxProps } from './Box.types';\n\nexport const Box = ({\n flexDirection,\n flexWrap,\n gap,\n alignItems,\n justifyContent,\n margin,\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n marginHorizontal,\n marginVertical,\n padding,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n paddingHorizontal,\n paddingVertical,\n borderWidth,\n borderColor,\n backgroundColor,\n twClassName = '',\n style,\n children,\n ...props\n}: BoxProps) => {\n const tw = useTailwind();\n const twContainerClassNames = tw`\n flex\n ${flexDirection ?? ''} \n ${flexWrap ?? ''} \n ${gap !== undefined ? TWCLASSMAP_BOX_GAP[gap] : ''} \n ${alignItems ?? ''} \n ${justifyContent ?? ''}\n ${margin !== undefined ? TWCLASSMAP_BOX_MARGIN[margin] : ''}\n ${marginTop !== undefined ? TWCLASSMAP_BOX_MARGIN_TOP[marginTop] : ''}\n ${marginRight !== undefined ? TWCLASSMAP_BOX_MARGIN_RIGHT[marginRight] : ''}\n ${marginBottom !== undefined ? TWCLASSMAP_BOX_MARGIN_BOTTOM[marginBottom] : ''}\n ${marginLeft !== undefined ? TWCLASSMAP_BOX_MARGIN_LEFT[marginLeft] : ''}\n ${marginHorizontal !== undefined ? TWCLASSMAP_BOX_MARGIN_HORIZONTAL[marginHorizontal] : ''}\n ${marginVertical !== undefined ? TWCLASSMAP_BOX_MARGIN_VERTICAL[marginVertical] : ''}\n ${padding !== undefined ? TWCLASSMAP_BOX_PADDING[padding] : ''}\n ${paddingTop !== undefined ? TWCLASSMAP_BOX_PADDING_TOP[paddingTop] : ''}\n ${paddingRight !== undefined ? TWCLASSMAP_BOX_PADDING_RIGHT[paddingRight] : ''}\n ${paddingBottom !== undefined ? TWCLASSMAP_BOX_PADDING_BOTTOM[paddingBottom] : ''}\n ${paddingLeft !== undefined ? TWCLASSMAP_BOX_PADDING_LEFT[paddingLeft] : ''}\n ${paddingHorizontal !== undefined ? TWCLASSMAP_BOX_PADDING_HORIZONTAL[paddingHorizontal] : ''}\n ${paddingVertical !== undefined ? TWCLASSMAP_BOX_PADDING_VERTICAL[paddingVertical] : ''}\n ${borderWidth !== undefined ? TWCLASSMAP_BOX_BORDER_WIDTH[borderWidth] : ''}\n ${borderColor ?? ''}\n ${backgroundColor ?? ''}\n ${twClassName}`;\n\n return (\n <View style={[twContainerClassNames, style]} {...props}>\n {children}\n </View>\n );\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Box.types.cjs","sourceRoot":"","sources":["../../../src/components/Box/Box.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ViewProps } from 'react-native';\n\nimport type {\n BoxFlexDirection,\n BoxFlexWrap,\n BoxSpacing,\n BoxAlignItems,\n BoxJustifyContent,\n} from '../../types';\n\nexport type BoxProps = {\n /**\n * The flexDirection style of the component.\n */\n flexDirection?: BoxFlexDirection;\n /**\n * The flexWrap style of the component.\n */\n flexWrap?: BoxFlexWrap;\n /**\n * The gap between the component's children.\n * Use 1-12 for a gap of 4px-48px.\n */\n gap?: BoxSpacing;\n /**\n * The alignItems style of the component.\n */\n alignItems?: BoxAlignItems;\n /**\n * The justifyContent style of the component.\n */\n justifyContent?: BoxJustifyContent;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n} & ViewProps;\n"]}
1
+ {"version":3,"file":"Box.types.cjs","sourceRoot":"","sources":["../../../src/components/Box/Box.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ViewProps } from 'react-native';\n\nimport type {\n BoxFlexDirection,\n BoxFlexWrap,\n BoxSpacing,\n BoxBorderWidth,\n BoxAlignItems,\n BoxJustifyContent,\n BoxBackgroundColor,\n BoxBorderColor,\n} from '../../types';\n\nexport type BoxProps = {\n /**\n * The flexDirection style of the component.\n */\n flexDirection?: BoxFlexDirection;\n /**\n * The flexWrap style of the component.\n */\n flexWrap?: BoxFlexWrap;\n /**\n * The gap between the component's children.\n * Use 1-12 for a gap of 4px-48px.\n */\n gap?: BoxSpacing;\n /**\n * The alignItems style of the component.\n */\n alignItems?: BoxAlignItems;\n /**\n * The justifyContent style of the component.\n */\n justifyContent?: BoxJustifyContent;\n /**\n * The margin of the component.\n * Use 1-12 for margin of 4px-48px.\n */\n margin?: BoxSpacing;\n /**\n * The top margin of the component.\n * Use 1-12 for margin of 4px-48px.\n */\n marginTop?: BoxSpacing;\n /**\n * The right margin of the component.\n * Use 1-12 for margin of 4px-48px.\n */\n marginRight?: BoxSpacing;\n /**\n * The bottom margin of the component.\n * Use 1-12 for margin of 4px-48px.\n */\n marginBottom?: BoxSpacing;\n /**\n * The left margin of the component.\n * Use 1-12 for margin of 4px-48px.\n */\n marginLeft?: BoxSpacing;\n /**\n * The horizontal margin of the component.\n * Use 1-12 for margin of 4px-48px.\n */\n marginHorizontal?: BoxSpacing;\n /**\n * The vertical margin of the component.\n * Use 1-12 for margin of 4px-48px.\n */\n marginVertical?: BoxSpacing;\n /**\n * The padding of the component.\n * Use 1-12 for padding of 4px-48px.\n */\n padding?: BoxSpacing;\n /**\n * The top padding of the component.\n * Use 1-12 for padding of 4px-48px.\n */\n paddingTop?: BoxSpacing;\n /**\n * The right padding of the component.\n * Use 1-12 for padding of 4px-48px.\n */\n paddingRight?: BoxSpacing;\n /**\n * The bottom padding of the component.\n * Use 1-12 for padding of 4px-48px.\n */\n paddingBottom?: BoxSpacing;\n /**\n * The left padding of the component.\n * Use 1-12 for padding of 4px-48px.\n */\n paddingLeft?: BoxSpacing;\n /**\n * The horizontal padding of the component.\n * Use 1-12 for padding of 4px-48px.\n */\n paddingHorizontal?: BoxSpacing;\n /**\n * The vertical padding of the component.\n * Use 1-12 for padding of 4px-48px.\n */\n paddingVertical?: BoxSpacing;\n /**\n * The border width of the component.\n * Use 0, 1, 2, 4, or 8 for border width of 0px, 1px, 2px, 4px, or 8px.\n */\n borderWidth?: BoxBorderWidth;\n /**\n * The border color of the component.\n */\n borderColor?: BoxBorderColor;\n /**\n * The background color of the component.\n */\n backgroundColor?: BoxBackgroundColor;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n} & ViewProps;\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { ViewProps } from "react-native/index.js";
2
- import type { BoxFlexDirection, BoxFlexWrap, BoxSpacing, BoxAlignItems, BoxJustifyContent } from "../../types/index.cjs";
2
+ import type { BoxFlexDirection, BoxFlexWrap, BoxSpacing, BoxBorderWidth, BoxAlignItems, BoxJustifyContent, BoxBackgroundColor, BoxBorderColor } from "../../types/index.cjs";
3
3
  export type BoxProps = {
4
4
  /**
5
5
  * The flexDirection style of the component.
@@ -22,6 +22,89 @@ export type BoxProps = {
22
22
  * The justifyContent style of the component.
23
23
  */
24
24
  justifyContent?: BoxJustifyContent;
25
+ /**
26
+ * The margin of the component.
27
+ * Use 1-12 for margin of 4px-48px.
28
+ */
29
+ margin?: BoxSpacing;
30
+ /**
31
+ * The top margin of the component.
32
+ * Use 1-12 for margin of 4px-48px.
33
+ */
34
+ marginTop?: BoxSpacing;
35
+ /**
36
+ * The right margin of the component.
37
+ * Use 1-12 for margin of 4px-48px.
38
+ */
39
+ marginRight?: BoxSpacing;
40
+ /**
41
+ * The bottom margin of the component.
42
+ * Use 1-12 for margin of 4px-48px.
43
+ */
44
+ marginBottom?: BoxSpacing;
45
+ /**
46
+ * The left margin of the component.
47
+ * Use 1-12 for margin of 4px-48px.
48
+ */
49
+ marginLeft?: BoxSpacing;
50
+ /**
51
+ * The horizontal margin of the component.
52
+ * Use 1-12 for margin of 4px-48px.
53
+ */
54
+ marginHorizontal?: BoxSpacing;
55
+ /**
56
+ * The vertical margin of the component.
57
+ * Use 1-12 for margin of 4px-48px.
58
+ */
59
+ marginVertical?: BoxSpacing;
60
+ /**
61
+ * The padding of the component.
62
+ * Use 1-12 for padding of 4px-48px.
63
+ */
64
+ padding?: BoxSpacing;
65
+ /**
66
+ * The top padding of the component.
67
+ * Use 1-12 for padding of 4px-48px.
68
+ */
69
+ paddingTop?: BoxSpacing;
70
+ /**
71
+ * The right padding of the component.
72
+ * Use 1-12 for padding of 4px-48px.
73
+ */
74
+ paddingRight?: BoxSpacing;
75
+ /**
76
+ * The bottom padding of the component.
77
+ * Use 1-12 for padding of 4px-48px.
78
+ */
79
+ paddingBottom?: BoxSpacing;
80
+ /**
81
+ * The left padding of the component.
82
+ * Use 1-12 for padding of 4px-48px.
83
+ */
84
+ paddingLeft?: BoxSpacing;
85
+ /**
86
+ * The horizontal padding of the component.
87
+ * Use 1-12 for padding of 4px-48px.
88
+ */
89
+ paddingHorizontal?: BoxSpacing;
90
+ /**
91
+ * The vertical padding of the component.
92
+ * Use 1-12 for padding of 4px-48px.
93
+ */
94
+ paddingVertical?: BoxSpacing;
95
+ /**
96
+ * The border width of the component.
97
+ * Use 0, 1, 2, 4, or 8 for border width of 0px, 1px, 2px, 4px, or 8px.
98
+ */
99
+ borderWidth?: BoxBorderWidth;
100
+ /**
101
+ * The border color of the component.
102
+ */
103
+ borderColor?: BoxBorderColor;
104
+ /**
105
+ * The background color of the component.
106
+ */
107
+ backgroundColor?: BoxBackgroundColor;
25
108
  /**
26
109
  * Optional prop to add twrnc overriding classNames.
27
110
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Box.types.d.cts","sourceRoot":"","sources":["../../../src/components/Box/Box.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAE9C,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,aAAa,EACb,iBAAiB,EAClB,8BAAoB;AAErB,MAAM,MAAM,QAAQ,GAAG;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC;;OAEG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB;;;OAGG;IACH,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B;;OAEG;IACH,cAAc,CAAC,EAAE,iBAAiB,CAAC;IACnC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,SAAS,CAAC"}
1
+ {"version":3,"file":"Box.types.d.cts","sourceRoot":"","sources":["../../../src/components/Box/Box.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAE9C,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACf,8BAAoB;AAErB,MAAM,MAAM,QAAQ,GAAG;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC;;OAEG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB;;;OAGG;IACH,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B;;OAEG;IACH,cAAc,CAAC,EAAE,iBAAiB,CAAC;IACnC;;;OAGG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB;;;OAGG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB;;;OAGG;IACH,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,UAAU,CAAC;IAC9B;;;OAGG;IACH,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B;;;OAGG;IACH,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;OAGG;IACH,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,UAAU,CAAC;IAC3B;;;OAGG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAC/B;;;OAGG;IACH,eAAe,CAAC,EAAE,UAAU,CAAC;IAC7B;;;OAGG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B;;OAEG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B;;OAEG;IACH,eAAe,CAAC,EAAE,kBAAkB,CAAC;IACrC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,SAAS,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { ViewProps } from "react-native/index.js";
2
- import type { BoxFlexDirection, BoxFlexWrap, BoxSpacing, BoxAlignItems, BoxJustifyContent } from "../../types/index.mjs";
2
+ import type { BoxFlexDirection, BoxFlexWrap, BoxSpacing, BoxBorderWidth, BoxAlignItems, BoxJustifyContent, BoxBackgroundColor, BoxBorderColor } from "../../types/index.mjs";
3
3
  export type BoxProps = {
4
4
  /**
5
5
  * The flexDirection style of the component.
@@ -22,6 +22,89 @@ export type BoxProps = {
22
22
  * The justifyContent style of the component.
23
23
  */
24
24
  justifyContent?: BoxJustifyContent;
25
+ /**
26
+ * The margin of the component.
27
+ * Use 1-12 for margin of 4px-48px.
28
+ */
29
+ margin?: BoxSpacing;
30
+ /**
31
+ * The top margin of the component.
32
+ * Use 1-12 for margin of 4px-48px.
33
+ */
34
+ marginTop?: BoxSpacing;
35
+ /**
36
+ * The right margin of the component.
37
+ * Use 1-12 for margin of 4px-48px.
38
+ */
39
+ marginRight?: BoxSpacing;
40
+ /**
41
+ * The bottom margin of the component.
42
+ * Use 1-12 for margin of 4px-48px.
43
+ */
44
+ marginBottom?: BoxSpacing;
45
+ /**
46
+ * The left margin of the component.
47
+ * Use 1-12 for margin of 4px-48px.
48
+ */
49
+ marginLeft?: BoxSpacing;
50
+ /**
51
+ * The horizontal margin of the component.
52
+ * Use 1-12 for margin of 4px-48px.
53
+ */
54
+ marginHorizontal?: BoxSpacing;
55
+ /**
56
+ * The vertical margin of the component.
57
+ * Use 1-12 for margin of 4px-48px.
58
+ */
59
+ marginVertical?: BoxSpacing;
60
+ /**
61
+ * The padding of the component.
62
+ * Use 1-12 for padding of 4px-48px.
63
+ */
64
+ padding?: BoxSpacing;
65
+ /**
66
+ * The top padding of the component.
67
+ * Use 1-12 for padding of 4px-48px.
68
+ */
69
+ paddingTop?: BoxSpacing;
70
+ /**
71
+ * The right padding of the component.
72
+ * Use 1-12 for padding of 4px-48px.
73
+ */
74
+ paddingRight?: BoxSpacing;
75
+ /**
76
+ * The bottom padding of the component.
77
+ * Use 1-12 for padding of 4px-48px.
78
+ */
79
+ paddingBottom?: BoxSpacing;
80
+ /**
81
+ * The left padding of the component.
82
+ * Use 1-12 for padding of 4px-48px.
83
+ */
84
+ paddingLeft?: BoxSpacing;
85
+ /**
86
+ * The horizontal padding of the component.
87
+ * Use 1-12 for padding of 4px-48px.
88
+ */
89
+ paddingHorizontal?: BoxSpacing;
90
+ /**
91
+ * The vertical padding of the component.
92
+ * Use 1-12 for padding of 4px-48px.
93
+ */
94
+ paddingVertical?: BoxSpacing;
95
+ /**
96
+ * The border width of the component.
97
+ * Use 0, 1, 2, 4, or 8 for border width of 0px, 1px, 2px, 4px, or 8px.
98
+ */
99
+ borderWidth?: BoxBorderWidth;
100
+ /**
101
+ * The border color of the component.
102
+ */
103
+ borderColor?: BoxBorderColor;
104
+ /**
105
+ * The background color of the component.
106
+ */
107
+ backgroundColor?: BoxBackgroundColor;
25
108
  /**
26
109
  * Optional prop to add twrnc overriding classNames.
27
110
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Box.types.d.mts","sourceRoot":"","sources":["../../../src/components/Box/Box.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAE9C,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,aAAa,EACb,iBAAiB,EAClB,8BAAoB;AAErB,MAAM,MAAM,QAAQ,GAAG;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC;;OAEG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB;;;OAGG;IACH,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B;;OAEG;IACH,cAAc,CAAC,EAAE,iBAAiB,CAAC;IACnC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,SAAS,CAAC"}
1
+ {"version":3,"file":"Box.types.d.mts","sourceRoot":"","sources":["../../../src/components/Box/Box.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAE9C,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACf,8BAAoB;AAErB,MAAM,MAAM,QAAQ,GAAG;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC;;OAEG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB;;;OAGG;IACH,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B;;OAEG;IACH,cAAc,CAAC,EAAE,iBAAiB,CAAC;IACnC;;;OAGG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB;;;OAGG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB;;;OAGG;IACH,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,UAAU,CAAC;IAC9B;;;OAGG;IACH,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B;;;OAGG;IACH,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;OAGG;IACH,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,UAAU,CAAC;IAC3B;;;OAGG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAC/B;;;OAGG;IACH,eAAe,CAAC,EAAE,UAAU,CAAC;IAC7B;;;OAGG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B;;OAEG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B;;OAEG;IACH,eAAe,CAAC,EAAE,kBAAkB,CAAC;IACrC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,SAAS,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Box.types.mjs","sourceRoot":"","sources":["../../../src/components/Box/Box.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ViewProps } from 'react-native';\n\nimport type {\n BoxFlexDirection,\n BoxFlexWrap,\n BoxSpacing,\n BoxAlignItems,\n BoxJustifyContent,\n} from '../../types';\n\nexport type BoxProps = {\n /**\n * The flexDirection style of the component.\n */\n flexDirection?: BoxFlexDirection;\n /**\n * The flexWrap style of the component.\n */\n flexWrap?: BoxFlexWrap;\n /**\n * The gap between the component's children.\n * Use 1-12 for a gap of 4px-48px.\n */\n gap?: BoxSpacing;\n /**\n * The alignItems style of the component.\n */\n alignItems?: BoxAlignItems;\n /**\n * The justifyContent style of the component.\n */\n justifyContent?: BoxJustifyContent;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n} & ViewProps;\n"]}
1
+ {"version":3,"file":"Box.types.mjs","sourceRoot":"","sources":["../../../src/components/Box/Box.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ViewProps } from 'react-native';\n\nimport type {\n BoxFlexDirection,\n BoxFlexWrap,\n BoxSpacing,\n BoxBorderWidth,\n BoxAlignItems,\n BoxJustifyContent,\n BoxBackgroundColor,\n BoxBorderColor,\n} from '../../types';\n\nexport type BoxProps = {\n /**\n * The flexDirection style of the component.\n */\n flexDirection?: BoxFlexDirection;\n /**\n * The flexWrap style of the component.\n */\n flexWrap?: BoxFlexWrap;\n /**\n * The gap between the component's children.\n * Use 1-12 for a gap of 4px-48px.\n */\n gap?: BoxSpacing;\n /**\n * The alignItems style of the component.\n */\n alignItems?: BoxAlignItems;\n /**\n * The justifyContent style of the component.\n */\n justifyContent?: BoxJustifyContent;\n /**\n * The margin of the component.\n * Use 1-12 for margin of 4px-48px.\n */\n margin?: BoxSpacing;\n /**\n * The top margin of the component.\n * Use 1-12 for margin of 4px-48px.\n */\n marginTop?: BoxSpacing;\n /**\n * The right margin of the component.\n * Use 1-12 for margin of 4px-48px.\n */\n marginRight?: BoxSpacing;\n /**\n * The bottom margin of the component.\n * Use 1-12 for margin of 4px-48px.\n */\n marginBottom?: BoxSpacing;\n /**\n * The left margin of the component.\n * Use 1-12 for margin of 4px-48px.\n */\n marginLeft?: BoxSpacing;\n /**\n * The horizontal margin of the component.\n * Use 1-12 for margin of 4px-48px.\n */\n marginHorizontal?: BoxSpacing;\n /**\n * The vertical margin of the component.\n * Use 1-12 for margin of 4px-48px.\n */\n marginVertical?: BoxSpacing;\n /**\n * The padding of the component.\n * Use 1-12 for padding of 4px-48px.\n */\n padding?: BoxSpacing;\n /**\n * The top padding of the component.\n * Use 1-12 for padding of 4px-48px.\n */\n paddingTop?: BoxSpacing;\n /**\n * The right padding of the component.\n * Use 1-12 for padding of 4px-48px.\n */\n paddingRight?: BoxSpacing;\n /**\n * The bottom padding of the component.\n * Use 1-12 for padding of 4px-48px.\n */\n paddingBottom?: BoxSpacing;\n /**\n * The left padding of the component.\n * Use 1-12 for padding of 4px-48px.\n */\n paddingLeft?: BoxSpacing;\n /**\n * The horizontal padding of the component.\n * Use 1-12 for padding of 4px-48px.\n */\n paddingHorizontal?: BoxSpacing;\n /**\n * The vertical padding of the component.\n * Use 1-12 for padding of 4px-48px.\n */\n paddingVertical?: BoxSpacing;\n /**\n * The border width of the component.\n * Use 0, 1, 2, 4, or 8 for border width of 0px, 1px, 2px, 4px, or 8px.\n */\n borderWidth?: BoxBorderWidth;\n /**\n * The border color of the component.\n */\n borderColor?: BoxBorderColor;\n /**\n * The background color of the component.\n */\n backgroundColor?: BoxBackgroundColor;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n} & ViewProps;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/Box/index.ts"],"names":[],"mappings":";;;AAAA,+CAKqB;AAJnB,yGAAA,gBAAgB,OAAA;AAChB,oGAAA,WAAW,OAAA;AACX,sGAAA,aAAa,OAAA;AACb,0GAAA,iBAAiB,OAAA;AAGnB,iCAA4B;AAAnB,0FAAA,GAAG,OAAA","sourcesContent":["export {\n BoxFlexDirection,\n BoxFlexWrap,\n BoxAlignItems,\n BoxJustifyContent,\n} from '../../types';\nexport type { BoxSpacing } from '../../types';\nexport { Box } from './Box';\nexport type { BoxProps } from './Box.types';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/Box/index.ts"],"names":[],"mappings":";;;AAAA,+CAKqB;AAJnB,yGAAA,gBAAgB,OAAA;AAChB,oGAAA,WAAW,OAAA;AACX,sGAAA,aAAa,OAAA;AACb,0GAAA,iBAAiB,OAAA;AAGnB,iCAA4B;AAAnB,0FAAA,GAAG,OAAA","sourcesContent":["export {\n BoxFlexDirection,\n BoxFlexWrap,\n BoxAlignItems,\n BoxJustifyContent,\n} from '../../types';\nexport type { BoxSpacing, BoxBorderWidth } from '../../types';\nexport { Box } from './Box';\nexport type { BoxProps } from './Box.types';\n"]}
@@ -1,5 +1,5 @@
1
1
  export { BoxFlexDirection, BoxFlexWrap, BoxAlignItems, BoxJustifyContent, } from "../../types/index.cjs";
2
- export type { BoxSpacing } from "../../types/index.cjs";
2
+ export type { BoxSpacing, BoxBorderWidth } from "../../types/index.cjs";
3
3
  export { Box } from "./Box.cjs";
4
4
  export type { BoxProps } from "./Box.types.cjs";
5
5
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Box/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,iBAAiB,GAClB,8BAAoB;AACrB,YAAY,EAAE,UAAU,EAAE,8BAAoB;AAC9C,OAAO,EAAE,GAAG,EAAE,kBAAc;AAC5B,YAAY,EAAE,QAAQ,EAAE,wBAAoB"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Box/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,iBAAiB,GAClB,8BAAoB;AACrB,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,8BAAoB;AAC9D,OAAO,EAAE,GAAG,EAAE,kBAAc;AAC5B,YAAY,EAAE,QAAQ,EAAE,wBAAoB"}
@@ -1,5 +1,5 @@
1
1
  export { BoxFlexDirection, BoxFlexWrap, BoxAlignItems, BoxJustifyContent, } from "../../types/index.mjs";
2
- export type { BoxSpacing } from "../../types/index.mjs";
2
+ export type { BoxSpacing, BoxBorderWidth } from "../../types/index.mjs";
3
3
  export { Box } from "./Box.mjs";
4
4
  export type { BoxProps } from "./Box.types.mjs";
5
5
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/Box/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,iBAAiB,GAClB,8BAAoB;AACrB,YAAY,EAAE,UAAU,EAAE,8BAAoB;AAC9C,OAAO,EAAE,GAAG,EAAE,kBAAc;AAC5B,YAAY,EAAE,QAAQ,EAAE,wBAAoB"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/Box/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,iBAAiB,GAClB,8BAAoB;AACrB,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,8BAAoB;AAC9D,OAAO,EAAE,GAAG,EAAE,kBAAc;AAC5B,YAAY,EAAE,QAAQ,EAAE,wBAAoB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/Box/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,iBAAiB,EAClB,8BAAoB;AAErB,OAAO,EAAE,GAAG,EAAE,kBAAc","sourcesContent":["export {\n BoxFlexDirection,\n BoxFlexWrap,\n BoxAlignItems,\n BoxJustifyContent,\n} from '../../types';\nexport type { BoxSpacing } from '../../types';\nexport { Box } from './Box';\nexport type { BoxProps } from './Box.types';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/Box/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,iBAAiB,EAClB,8BAAoB;AAErB,OAAO,EAAE,GAAG,EAAE,kBAAc","sourcesContent":["export {\n BoxFlexDirection,\n BoxFlexWrap,\n BoxAlignItems,\n BoxJustifyContent,\n} from '../../types';\nexport type { BoxSpacing, BoxBorderWidth } from '../../types';\nexport { Box } from './Box';\nexport type { BoxProps } from './Box.types';\n"]}
@@ -29,7 +29,6 @@ const react_1 = __importStar(require("react"));
29
29
  const react_native_1 = require("react-native/index.js");
30
30
  const types_1 = require("../../types/index.cjs");
31
31
  const Icon_1 = require("../Icon/index.cjs");
32
- const Icon_2 = require("../Icon/index.cjs");
33
32
  const ButtonAnimated_1 = require("../temp-components/ButtonAnimated/index.cjs");
34
33
  const Spinner_1 = require("../temp-components/Spinner/index.cjs");
35
34
  const TextOrChildren_1 = require("../temp-components/TextOrChildren/TextOrChildren.cjs");
@@ -104,14 +103,14 @@ const ButtonBase = ({ children, textProps, size = types_1.ButtonBaseSize.Lg, isL
104
103
  <react_native_1.View style={tw `absolute inset-0 flex items-center justify-center ${isLoading ? 'opacity-100' : 'opacity-0'}`} testID="spinner-container">
105
104
  <Spinner_1.Spinner color={textClassName
106
105
  ? textClassName(pressed)
107
- : Icon_2.IconColor.IconDefault} loadingText={loadingText} loadingTextProps={{
106
+ : Icon_1.IconColor.IconDefault} loadingText={loadingText} loadingTextProps={{
108
107
  numberOfLines: 1,
109
108
  twClassName: textClassName ? textClassName(pressed) : '',
110
109
  ...spinnerProps?.loadingTextProps,
111
110
  }} {...spinnerProps}/>
112
111
  </react_native_1.View>
113
112
  <react_native_1.View style={tw `flex-row items-center justify-center gap-x-2 ${isLoading ? 'opacity-0' : 'opacity-100'}`} testID="content-container">
114
- {finalStartIconName ? (<Icon_1.Icon name={finalStartIconName} size={Icon_2.IconSize.Sm} twClassName={`shrink-0 ${iconClassName ? iconClassName(pressed) : ''}`} {...startIconProps}/>) : (startAccessory)}
113
+ {finalStartIconName ? (<Icon_1.Icon name={finalStartIconName} size={Icon_1.IconSize.Sm} twClassName={`shrink-0 ${iconClassName ? iconClassName(pressed) : ''}`} {...startIconProps}/>) : (startAccessory)}
115
114
  <TextOrChildren_1.TextOrChildren textProps={{
116
115
  variant: Text_1.TextVariant.BodyMd,
117
116
  fontWeight: Text_1.FontWeight.Medium,
@@ -121,7 +120,7 @@ const ButtonBase = ({ children, textProps, size = types_1.ButtonBaseSize.Lg, isL
121
120
  }}>
122
121
  {children}
123
122
  </TextOrChildren_1.TextOrChildren>
124
- {finalEndIconName ? (<Icon_1.Icon name={finalEndIconName} size={Icon_2.IconSize.Sm} twClassName={`shrink-0 ${iconClassName ? iconClassName(pressed) : ''}`} {...endIconProps}/>) : (endAccessory)}
123
+ {finalEndIconName ? (<Icon_1.Icon name={finalEndIconName} size={Icon_1.IconSize.Sm} twClassName={`shrink-0 ${iconClassName ? iconClassName(pressed) : ''}`} {...endIconProps}/>) : (endAccessory)}
125
124
  </react_native_1.View>
126
125
  </>)}
127
126
  </ButtonAnimated_1.ButtonAnimated>);
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonBase.cjs","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8FAA4E;AAC5E,+CAAuC;AACvC,wDAAoC;AAGpC,iDAA6C;AAC7C,4CAA+B;AAC/B,4CAA8C;AAC9C,gFAAmE;AACnE,kEAAqD;AACrD,yFAAkF;AAClF,4CAA6D;AAE7D,qEAA8E;AAGvE,MAAM,UAAU,GAAG,CAAC,EACzB,QAAQ,EACR,SAAS,EACT,IAAI,GAAG,sBAAc,CAAC,EAAE,EACxB,SAAS,EACT,WAAW,EACX,YAAY,EACZ,aAAa,EACb,cAAc,EACd,cAAc,EACd,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,WAAW,EACX,WAAW,GAAG,EAAE,EAChB,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,IAAA,wCAAW,GAAE,CAAC;IAEzB,MAAM,kBAAkB,GAAG,aAAa,IAAI,cAAc,EAAE,IAAI,CAAC;IACjE,MAAM,gBAAgB,GAAG,WAAW,IAAI,YAAY,EAAE,IAAI,CAAC;IAE3D,+CAA+C;IAC/C,MAAM,uBAAuB,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QAC3C,IAAI,kBAAkB,EAAE;YACtB,OAAO,kBAAkB,CAAC;SAC3B;QAED,6DAA6D;QAC7D,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AC,YAAY,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACvE,IAAI,YAAY,CAAC,EACjB,CACH,CAAC,CAAC,CAAC,CACF,YAAY,CACb,CACH;UAAA,EAAE,mBAAI,CACR;QAAA,GAAG,CACJ,CACH;IAAA,EAAE,+BAAc,CAAC,CAClB,CAAC;AACJ,CAAC,CAAC;AAvLW,QAAA,UAAU,cAuLrB","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useMemo } from 'react';\nimport { View } from 'react-native';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport { ButtonBaseSize } from '../../types';\nimport { Icon } from '../Icon';\nimport { IconColor, IconSize } from '../Icon';\nimport { ButtonAnimated } from '../temp-components/ButtonAnimated';\nimport { Spinner } from '../temp-components/Spinner';\nimport { TextOrChildren } from '../temp-components/TextOrChildren/TextOrChildren';\nimport { TextVariant, FontWeight, TextColor } from '../Text';\n\nimport { TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION } 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 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 // 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, please wait';\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 const containerClassName =\n typeof twClassName === 'function'\n ? twClassName(pressed)\n : twClassName;\n\n const baseContainerClassNames = `\n flex-row items-center justify-center rounded-xl bg-muted px-4 min-w-[80px] overflow-hidden\n ${TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION[size]}\n ${isDisabled ? 'opacity-50' : 'opacity-100'}\n ${isFullWidth ? 'w-full' : 'w-auto'}\n ${containerClassName}\n `;\n\n const computedStyle: StyleProp<ViewStyle>[] = [\n tw`${baseContainerClassNames}`,\n ];\n if (typeof style === 'function') {\n const additionalStyle = style({ pressed });\n if (additionalStyle) {\n computedStyle.push(additionalStyle);\n }\n } else if (style) {\n computedStyle.push(style);\n }\n\n return computedStyle;\n }}\n {...props}\n >\n {({ pressed }) => (\n <>\n <View\n style={tw`absolute inset-0 flex items-center justify-center ${\n isLoading ? 'opacity-100' : 'opacity-0'\n }`}\n testID=\"spinner-container\"\n >\n <Spinner\n color={\n textClassName\n ? (textClassName(pressed) as IconColor)\n : IconColor.IconDefault\n }\n loadingText={loadingText}\n loadingTextProps={{\n numberOfLines: 1,\n twClassName: textClassName ? textClassName(pressed) : '',\n ...spinnerProps?.loadingTextProps,\n }}\n {...spinnerProps}\n />\n </View>\n <View\n style={tw`flex-row items-center justify-center gap-x-2 ${\n isLoading ? 'opacity-0' : 'opacity-100'\n }`}\n testID=\"content-container\"\n >\n {finalStartIconName ? (\n <Icon\n name={finalStartIconName}\n size={IconSize.Sm}\n twClassName={`shrink-0 ${iconClassName ? iconClassName(pressed) : ''}`}\n {...startIconProps}\n />\n ) : (\n startAccessory\n )}\n <TextOrChildren\n textProps={{\n variant: TextVariant.BodyMd,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextDefault,\n twClassName: `shrink grow-0 flex-wrap text-center ${textClassName ? textClassName(pressed) : ''}`,\n ...textProps,\n }}\n >\n {children}\n </TextOrChildren>\n {finalEndIconName ? (\n <Icon\n name={finalEndIconName}\n size={IconSize.Sm}\n twClassName={`shrink-0 ${iconClassName ? iconClassName(pressed) : ''}`}\n {...endIconProps}\n />\n ) : (\n endAccessory\n )}\n </View>\n </>\n )}\n </ButtonAnimated>\n );\n};\n"]}
1
+ {"version":3,"file":"ButtonBase.cjs","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8FAA4E;AAC5E,+CAAuC;AACvC,wDAAoC;AAGpC,iDAA6C;AAC7C,4CAAoD;AACpD,gFAAmE;AACnE,kEAAqD;AACrD,yFAAkF;AAClF,4CAA6D;AAE7D,qEAA8E;AAGvE,MAAM,UAAU,GAAG,CAAC,EACzB,QAAQ,EACR,SAAS,EACT,IAAI,GAAG,sBAAc,CAAC,EAAE,EACxB,SAAS,EACT,WAAW,EACX,YAAY,EACZ,aAAa,EACb,cAAc,EACd,cAAc,EACd,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,WAAW,EACX,WAAW,GAAG,EAAE,EAChB,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,CAAC;gBACT,OAAO,EAAE,kBAAW,CAAC,MAAM;gBAC3B,UAAU,EAAE,iBAAU,CAAC,MAAM;gBAC7B,KAAK,EAAE,gBAAS,CAAC,WAAW;gBAC5B,WAAW,EAAE,uCAAuC,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE;gBACjG,GAAG,SAAS;aACb,CAAC,CAEF;cAAA,CAAC,QAAQ,CACX;YAAA,EAAE,+BAAc,CAChB;YAAA,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAClB,CAAC,WAAI,CACH,IAAI,CAAC,CAAC,gBAAgB,CAAC,CACvB,IAAI,CAAC,CAAC,eAAQ,CAAC,EAAE,CAAC,CAClB,WAAW,CAAC,CAAC,YAAY,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACvE,IAAI,YAAY,CAAC,EACjB,CACH,CAAC,CAAC,CAAC,CACF,YAAY,CACb,CACH;UAAA,EAAE,mBAAI,CACR;QAAA,GAAG,CACJ,CACH;IAAA,EAAE,+BAAc,CAAC,CAClB,CAAC;AACJ,CAAC,CAAC;AAvLW,QAAA,UAAU,cAuLrB","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useMemo } from 'react';\nimport { View } from 'react-native';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport { ButtonBaseSize } from '../../types';\nimport { Icon, IconColor, IconSize } from '../Icon';\nimport { ButtonAnimated } from '../temp-components/ButtonAnimated';\nimport { Spinner } from '../temp-components/Spinner';\nimport { TextOrChildren } from '../temp-components/TextOrChildren/TextOrChildren';\nimport { TextVariant, FontWeight, TextColor } from '../Text';\n\nimport { TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION } 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 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 // 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, please wait';\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 const containerClassName =\n typeof twClassName === 'function'\n ? twClassName(pressed)\n : twClassName;\n\n const baseContainerClassNames = `\n flex-row items-center justify-center rounded-xl bg-muted px-4 min-w-[80px] overflow-hidden\n ${TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION[size]}\n ${isDisabled ? 'opacity-50' : 'opacity-100'}\n ${isFullWidth ? 'w-full' : 'w-auto'}\n ${containerClassName}\n `;\n\n const computedStyle: StyleProp<ViewStyle>[] = [\n tw`${baseContainerClassNames}`,\n ];\n if (typeof style === 'function') {\n const additionalStyle = style({ pressed });\n if (additionalStyle) {\n computedStyle.push(additionalStyle);\n }\n } else if (style) {\n computedStyle.push(style);\n }\n\n return computedStyle;\n }}\n {...props}\n >\n {({ pressed }) => (\n <>\n <View\n style={tw`absolute inset-0 flex items-center justify-center ${\n isLoading ? 'opacity-100' : 'opacity-0'\n }`}\n testID=\"spinner-container\"\n >\n <Spinner\n color={\n textClassName\n ? (textClassName(pressed) as IconColor)\n : IconColor.IconDefault\n }\n loadingText={loadingText}\n loadingTextProps={{\n numberOfLines: 1,\n twClassName: textClassName ? textClassName(pressed) : '',\n ...spinnerProps?.loadingTextProps,\n }}\n {...spinnerProps}\n />\n </View>\n <View\n style={tw`flex-row items-center justify-center gap-x-2 ${\n isLoading ? 'opacity-0' : 'opacity-100'\n }`}\n testID=\"content-container\"\n >\n {finalStartIconName ? (\n <Icon\n name={finalStartIconName}\n size={IconSize.Sm}\n twClassName={`shrink-0 ${iconClassName ? iconClassName(pressed) : ''}`}\n {...startIconProps}\n />\n ) : (\n startAccessory\n )}\n <TextOrChildren\n textProps={{\n variant: TextVariant.BodyMd,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextDefault,\n twClassName: `shrink grow-0 flex-wrap text-center ${textClassName ? textClassName(pressed) : ''}`,\n ...textProps,\n }}\n >\n {children}\n </TextOrChildren>\n {finalEndIconName ? (\n <Icon\n name={finalEndIconName}\n size={IconSize.Sm}\n twClassName={`shrink-0 ${iconClassName ? iconClassName(pressed) : ''}`}\n {...endIconProps}\n />\n ) : (\n endAccessory\n )}\n </View>\n </>\n )}\n </ButtonAnimated>\n );\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonBase.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,cAAc;AAavC,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,4VAyBpB,eAAe,sBA8JjB,CAAC"}
1
+ {"version":3,"file":"ButtonBase.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,cAAc;AAYvC,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,4VAyBpB,eAAe,sBA8JjB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonBase.d.mts","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,cAAc;AAavC,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,4VAyBpB,eAAe,sBA8JjB,CAAC"}
1
+ {"version":3,"file":"ButtonBase.d.mts","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,cAAc;AAYvC,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,4VAyBpB,eAAe,sBA8JjB,CAAC"}
@@ -9,8 +9,7 @@ import $React, { useMemo } from "react";
9
9
  const React = $importDefault($React);
10
10
  import { View } from "react-native/index.js";
11
11
  import { ButtonBaseSize } from "../../types/index.mjs";
12
- import { Icon } from "../Icon/index.mjs";
13
- import { IconColor, IconSize } from "../Icon/index.mjs";
12
+ import { Icon, IconColor, IconSize } from "../Icon/index.mjs";
14
13
  import { ButtonAnimated } from "../temp-components/ButtonAnimated/index.mjs";
15
14
  import { Spinner } from "../temp-components/Spinner/index.mjs";
16
15
  import { TextOrChildren } from "../temp-components/TextOrChildren/TextOrChildren.mjs";
@@ -1 +1 @@
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C,EAAE,CAAC,CAClB,WAAW,CAAC,CAAC,YAAY,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACvE,IAAI,YAAY,CAAC,EACjB,CACH,CAAC,CAAC,CAAC,CACF,YAAY,CACb,CACH;UAAA,EAAE,IAAI,CACR;QAAA,GAAG,CACJ,CACH;IAAA,EAAE,cAAc,CAAC,CAClB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useMemo } from 'react';\nimport { View } from 'react-native';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport { ButtonBaseSize } from '../../types';\nimport { Icon } from '../Icon';\nimport { IconColor, IconSize } from '../Icon';\nimport { ButtonAnimated } from '../temp-components/ButtonAnimated';\nimport { Spinner } from '../temp-components/Spinner';\nimport { TextOrChildren } from '../temp-components/TextOrChildren/TextOrChildren';\nimport { TextVariant, FontWeight, TextColor } from '../Text';\n\nimport { TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION } 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 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 // 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, please wait';\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 const containerClassName =\n typeof twClassName === 'function'\n ? twClassName(pressed)\n : twClassName;\n\n const baseContainerClassNames = `\n flex-row items-center justify-center rounded-xl bg-muted px-4 min-w-[80px] overflow-hidden\n ${TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION[size]}\n ${isDisabled ? 'opacity-50' : 'opacity-100'}\n ${isFullWidth ? 'w-full' : 'w-auto'}\n ${containerClassName}\n `;\n\n const computedStyle: StyleProp<ViewStyle>[] = [\n tw`${baseContainerClassNames}`,\n ];\n if (typeof style === 'function') {\n const additionalStyle = style({ pressed });\n if (additionalStyle) {\n computedStyle.push(additionalStyle);\n }\n } else if (style) {\n computedStyle.push(style);\n }\n\n return computedStyle;\n }}\n {...props}\n >\n {({ pressed }) => (\n <>\n <View\n style={tw`absolute inset-0 flex items-center justify-center ${\n isLoading ? 'opacity-100' : 'opacity-0'\n }`}\n testID=\"spinner-container\"\n >\n <Spinner\n color={\n textClassName\n ? (textClassName(pressed) as IconColor)\n : IconColor.IconDefault\n }\n loadingText={loadingText}\n loadingTextProps={{\n numberOfLines: 1,\n twClassName: textClassName ? textClassName(pressed) : '',\n ...spinnerProps?.loadingTextProps,\n }}\n {...spinnerProps}\n />\n </View>\n <View\n style={tw`flex-row items-center justify-center gap-x-2 ${\n isLoading ? 'opacity-0' : 'opacity-100'\n }`}\n testID=\"content-container\"\n >\n {finalStartIconName ? (\n <Icon\n name={finalStartIconName}\n size={IconSize.Sm}\n twClassName={`shrink-0 ${iconClassName ? iconClassName(pressed) : ''}`}\n {...startIconProps}\n />\n ) : (\n startAccessory\n )}\n <TextOrChildren\n textProps={{\n variant: TextVariant.BodyMd,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextDefault,\n twClassName: `shrink grow-0 flex-wrap text-center ${textClassName ? textClassName(pressed) : ''}`,\n ...textProps,\n }}\n >\n {children}\n </TextOrChildren>\n {finalEndIconName ? (\n <Icon\n name={finalEndIconName}\n size={IconSize.Sm}\n twClassName={`shrink-0 ${iconClassName ? iconClassName(pressed) : ''}`}\n {...endIconProps}\n />\n ) : (\n endAccessory\n )}\n </View>\n </>\n )}\n </ButtonAnimated>\n );\n};\n"]}
1
+ {"version":3,"file":"ButtonBase.mjs","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,QAAO,EAAE,OAAO,EAAE,cAAc;;AACvC,OAAO,EAAE,IAAI,EAAE,8BAAqB;AAGpC,OAAO,EAAE,cAAc,EAAE,8BAAoB;AAC7C,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,0BAAgB;AACpD,OAAO,EAAE,cAAc,EAAE,oDAA0C;AACnE,OAAO,EAAE,OAAO,EAAE,6CAAmC;AACrD,OAAO,EAAE,cAAc,EAAE,6DAAyD;AAClF,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,0BAAgB;AAE7D,O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C,CAAC,QAAQ,CAAC,EAAE,CAAC,CAClB,WAAW,CAAC,CAAC,YAAY,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACvE,IAAI,cAAc,CAAC,EACnB,CACH,CAAC,CAAC,CAAC,CACF,cAAc,CACf,CACD;YAAA,CAAC,cAAc,CACb,SAAS,CAAC,CAAC;gBACT,OAAO,EAAE,WAAW,CAAC,MAAM;gBAC3B,UAAU,EAAE,UAAU,CAAC,MAAM;gBAC7B,KAAK,EAAE,SAAS,CAAC,WAAW;gBAC5B,WAAW,EAAE,uCAAuC,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE;gBACjG,GAAG,SAAS;aACb,CAAC,CAEF;cAAA,CAAC,QAAQ,CACX;YAAA,EAAE,cAAc,CAChB;YAAA,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAClB,CAAC,IAAI,CACH,IAAI,CAAC,CAAC,gBAAgB,CAAC,CACvB,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAClB,WAAW,CAAC,CAAC,YAAY,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACvE,IAAI,YAAY,CAAC,EACjB,CACH,CAAC,CAAC,CAAC,CACF,YAAY,CACb,CACH;UAAA,EAAE,IAAI,CACR;QAAA,GAAG,CACJ,CACH;IAAA,EAAE,cAAc,CAAC,CAClB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useMemo } from 'react';\nimport { View } from 'react-native';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport { ButtonBaseSize } from '../../types';\nimport { Icon, IconColor, IconSize } from '../Icon';\nimport { ButtonAnimated } from '../temp-components/ButtonAnimated';\nimport { Spinner } from '../temp-components/Spinner';\nimport { TextOrChildren } from '../temp-components/TextOrChildren/TextOrChildren';\nimport { TextVariant, FontWeight, TextColor } from '../Text';\n\nimport { TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION } 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 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 // 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, please wait';\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 const containerClassName =\n typeof twClassName === 'function'\n ? twClassName(pressed)\n : twClassName;\n\n const baseContainerClassNames = `\n flex-row items-center justify-center rounded-xl bg-muted px-4 min-w-[80px] overflow-hidden\n ${TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION[size]}\n ${isDisabled ? 'opacity-50' : 'opacity-100'}\n ${isFullWidth ? 'w-full' : 'w-auto'}\n ${containerClassName}\n `;\n\n const computedStyle: StyleProp<ViewStyle>[] = [\n tw`${baseContainerClassNames}`,\n ];\n if (typeof style === 'function') {\n const additionalStyle = style({ pressed });\n if (additionalStyle) {\n computedStyle.push(additionalStyle);\n }\n } else if (style) {\n computedStyle.push(style);\n }\n\n return computedStyle;\n }}\n {...props}\n >\n {({ pressed }) => (\n <>\n <View\n style={tw`absolute inset-0 flex items-center justify-center ${\n isLoading ? 'opacity-100' : 'opacity-0'\n }`}\n testID=\"spinner-container\"\n >\n <Spinner\n color={\n textClassName\n ? (textClassName(pressed) as IconColor)\n : IconColor.IconDefault\n }\n loadingText={loadingText}\n loadingTextProps={{\n numberOfLines: 1,\n twClassName: textClassName ? textClassName(pressed) : '',\n ...spinnerProps?.loadingTextProps,\n }}\n {...spinnerProps}\n />\n </View>\n <View\n style={tw`flex-row items-center justify-center gap-x-2 ${\n isLoading ? 'opacity-0' : 'opacity-100'\n }`}\n testID=\"content-container\"\n >\n {finalStartIconName ? (\n <Icon\n name={finalStartIconName}\n size={IconSize.Sm}\n twClassName={`shrink-0 ${iconClassName ? iconClassName(pressed) : ''}`}\n {...startIconProps}\n />\n ) : (\n startAccessory\n )}\n <TextOrChildren\n textProps={{\n variant: TextVariant.BodyMd,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextDefault,\n twClassName: `shrink grow-0 flex-wrap text-center ${textClassName ? textClassName(pressed) : ''}`,\n ...textProps,\n }}\n >\n {children}\n </TextOrChildren>\n {finalEndIconName ? (\n <Icon\n name={finalEndIconName}\n size={IconSize.Sm}\n twClassName={`shrink-0 ${iconClassName ? iconClassName(pressed) : ''}`}\n {...endIconProps}\n />\n ) : (\n endAccessory\n )}\n </View>\n </>\n )}\n </ButtonAnimated>\n );\n};\n"]}
@@ -103,7 +103,7 @@ exports.Checkbox = (0, react_1.forwardRef)(({ isSelected, isDisabled = false, is
103
103
  ]} disabled={isDisabled} {...props}>
104
104
  {({ pressed }) => (<>
105
105
  <AnimatedView {...checkboxContainerProps} style={[
106
- tw `${getCheckboxContainerStyle(pressed)} flex h-[22px] w-[22px] items-center justify-center rounded border-2`,
106
+ tw `${getCheckboxContainerStyle(pressed)} flex size-[22px] items-center justify-center rounded border-2`,
107
107
  { transform: [{ scale: scaleAnim }] },
108
108
  ]}>
109
109
  {/* Always render icon, opacity driven by iconAnim */}
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.cjs","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8FAA4E;AAC5E,+CAMe;AAEf,wDAA2D;AAE3D,4CAA8D;AAC9D,gFAAmE;AAInE,MAAM,YAAY,GAAG,uBAAQ,CAAC,IAAI,CAAC;AAEtB,QAAA,QAAQ,GAAG,IAAA,kBAAU,EAChC,CACE,EACE,UAAU,EACV,UAAU,GAAG,KAAK,EAClB,SAAS,GAAG,KAAK,EACjB,KAAK,GAAG,EAAE,EACV,UAAU,EACV,QAAQ,EACR,sBAAsB,EACtB,gBAAgB,EAChB,WAAW,GAAG,EAAE,EAChB,KAAK,EACL,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,mBAAmB;IACnB,MAAM,SAAS,GAAG,IAAA,cAAM,EAAC,IAAI,uBAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IACxD,MAAM,QAAQ,GAAG,IAAA,cAAM,EAAC,IAAI,uBAAQ,CAAC,K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AS,CAAC,CACb,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, {\n forwardRef,\n useRef,\n useImperativeHandle,\n useCallback,\n useEffect,\n} from 'react';\nimport type { PressableStateCallbackType } from 'react-native';\nimport { Pressable, Animated, Easing } from 'react-native';\n\nimport { Icon, IconName, IconColor, IconSize } from '../Icon';\nimport { TextOrChildren } from '../temp-components/TextOrChildren';\n\nimport type { CheckboxProps } from './Checkbox.types';\n\nconst AnimatedView = Animated.View;\n\nexport const Checkbox = forwardRef<{ toggle: () => void }, CheckboxProps>(\n (\n {\n isSelected,\n isDisabled = false,\n isInvalid = false,\n label = '',\n labelProps,\n onChange,\n checkboxContainerProps,\n checkedIconProps,\n twClassName = '',\n style,\n ...props\n },\n ref,\n ) => {\n // Animation values\n const scaleAnim = useRef(new Animated.Value(1)).current;\n const iconAnim = useRef(new Animated.Value(isSelected ? 1 : 0)).current;\n\n // Sync icon opacity whenever selection changes\n useEffect(() => {\n Animated.timing(iconAnim, {\n toValue: isSelected ? 1 : 0,\n duration: 300,\n easing: Easing.ease,\n useNativeDriver: true,\n }).start();\n }, [isSelected, iconAnim]);\n\n // Bounce effect when toggling\n const animateScale = useCallback(() => {\n Animated.sequence([\n Animated.timing(scaleAnim, {\n toValue: 1.15,\n duration: 100,\n easing: Easing.ease,\n useNativeDriver: true,\n }),\n Animated.timing(scaleAnim, {\n toValue: 1,\n duration: 100,\n easing: Easing.ease,\n useNativeDriver: true,\n }),\n ]).start();\n }, [scaleAnim]);\n\n // Press handler: notify parent, then bounce\n const handlePress = () => {\n if (isDisabled) {\n return;\n }\n onChange?.(!isSelected);\n animateScale();\n };\n\n useImperativeHandle(ref, () => ({ toggle: handlePress }), [handlePress]);\n\n const tw = useTailwind();\n const twContainerClassNames = tw`flex-row items-center ${\n isDisabled ? 'opacity-50' : 'opacity-100'\n } ${twClassName}`;\n\n const getCheckboxContainerStyle = useCallback(\n (pressed: boolean): string => {\n const baseBg = isSelected ? 'bg-primary-default' : 'bg-default';\n let baseBorder = 'border-default';\n if (isSelected) {\n baseBorder = 'border-primary-default';\n } else if (isInvalid) {\n baseBorder = 'border-error-default';\n }\n const pressedBg = isSelected\n ? 'bg-primary-default-pressed'\n : 'bg-default-pressed';\n let pressedBorder = 'border-default';\n if (isSelected) {\n pressedBorder = 'border-primary-default-pressed';\n } else if (isInvalid) {\n pressedBorder = 'border-error-default';\n }\n return pressed\n ? `${pressedBg} ${pressedBorder}`\n : `${baseBg} ${baseBorder}`;\n },\n [isSelected, isInvalid],\n );\n\n return (\n <Pressable\n onPress={handlePress}\n accessible\n accessibilityRole=\"checkbox\"\n accessibilityState={{\n checked: isSelected,\n disabled: isDisabled,\n }}\n accessibilityLabel={typeof label === 'string' ? label : undefined}\n style={(state: PressableStateCallbackType) => [\n twContainerClassNames,\n typeof style === 'function' ? style(state) : style,\n ]}\n disabled={isDisabled}\n {...props}\n >\n {({ pressed }) => (\n <>\n <AnimatedView\n {...checkboxContainerProps}\n style={[\n tw`${getCheckboxContainerStyle(pressed)} flex h-[22px] w-[22px] items-center justify-center rounded border-2`,\n { transform: [{ scale: scaleAnim }] },\n ]}\n >\n {/* Always render icon, opacity driven by iconAnim */}\n <Animated.View style={{ opacity: iconAnim }}>\n <Icon\n name={IconName.Check}\n color={IconColor.PrimaryInverse}\n size={IconSize.Sm}\n {...checkedIconProps}\n />\n </Animated.View>\n </AnimatedView>\n {label ? (\n <TextOrChildren\n textProps={{ ...labelProps, twClassName: 'ml-3' }}\n >\n {label}\n </TextOrChildren>\n ) : null}\n </>\n )}\n </Pressable>\n );\n },\n);\n"]}
1
+ {"version":3,"file":"Checkbox.cjs","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8FAA4E;AAC5E,+CAMe;AAEf,wDAA2D;AAE3D,4CAA8D;AAC9D,gFAAmE;AAInE,MAAM,YAA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CAAC,eAAQ,CAAC,KAAK,CAAC,CACrB,KAAK,CAAC,CAAC,gBAAS,CAAC,cAAc,CAAC,CAChC,IAAI,CAAC,CAAC,eAAQ,CAAC,EAAE,CAAC,CAClB,IAAI,gBAAgB,CAAC,EAEzB;cAAA,EAAE,uBAAQ,CAAC,IAAI,CACjB;YAAA,EAAE,YAAY,CACd;YAAA,CAAC,KAAK,CAAC,CAAC,CAAC,CACP,CAAC,+BAAc,CACb,SAAS,CAAC,CAAC,EAAE,GAAG,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,CAElD;gBAAA,CAAC,KAAK,CACR;cAAA,EAAE,+BAAc,CAAC,CAClB,CAAC,CAAC,CAAC,IAAI,CACV;UAAA,GAAG,CACJ,CACH;MAAA,EAAE,wBAAS,CAAC,CACb,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, {\n forwardRef,\n useRef,\n useImperativeHandle,\n useCallback,\n useEffect,\n} from 'react';\nimport type { PressableStateCallbackType } from 'react-native';\nimport { Pressable, Animated, Easing } from 'react-native';\n\nimport { Icon, IconName, IconColor, IconSize } from '../Icon';\nimport { TextOrChildren } from '../temp-components/TextOrChildren';\n\nimport type { CheckboxProps } from './Checkbox.types';\n\nconst AnimatedView = Animated.View;\n\nexport const Checkbox = forwardRef<{ toggle: () => void }, CheckboxProps>(\n (\n {\n isSelected,\n isDisabled = false,\n isInvalid = false,\n label = '',\n labelProps,\n onChange,\n checkboxContainerProps,\n checkedIconProps,\n twClassName = '',\n style,\n ...props\n },\n ref,\n ) => {\n // Animation values\n const scaleAnim = useRef(new Animated.Value(1)).current;\n const iconAnim = useRef(new Animated.Value(isSelected ? 1 : 0)).current;\n\n // Sync icon opacity whenever selection changes\n useEffect(() => {\n Animated.timing(iconAnim, {\n toValue: isSelected ? 1 : 0,\n duration: 300,\n easing: Easing.ease,\n useNativeDriver: true,\n }).start();\n }, [isSelected, iconAnim]);\n\n // Bounce effect when toggling\n const animateScale = useCallback(() => {\n Animated.sequence([\n Animated.timing(scaleAnim, {\n toValue: 1.15,\n duration: 100,\n easing: Easing.ease,\n useNativeDriver: true,\n }),\n Animated.timing(scaleAnim, {\n toValue: 1,\n duration: 100,\n easing: Easing.ease,\n useNativeDriver: true,\n }),\n ]).start();\n }, [scaleAnim]);\n\n // Press handler: notify parent, then bounce\n const handlePress = () => {\n if (isDisabled) {\n return;\n }\n onChange?.(!isSelected);\n animateScale();\n };\n\n useImperativeHandle(ref, () => ({ toggle: handlePress }), [handlePress]);\n\n const tw = useTailwind();\n const twContainerClassNames = tw`flex-row items-center ${\n isDisabled ? 'opacity-50' : 'opacity-100'\n } ${twClassName}`;\n\n const getCheckboxContainerStyle = useCallback(\n (pressed: boolean): string => {\n const baseBg = isSelected ? 'bg-primary-default' : 'bg-default';\n let baseBorder = 'border-default';\n if (isSelected) {\n baseBorder = 'border-primary-default';\n } else if (isInvalid) {\n baseBorder = 'border-error-default';\n }\n const pressedBg = isSelected\n ? 'bg-primary-default-pressed'\n : 'bg-default-pressed';\n let pressedBorder = 'border-default';\n if (isSelected) {\n pressedBorder = 'border-primary-default-pressed';\n } else if (isInvalid) {\n pressedBorder = 'border-error-default';\n }\n return pressed\n ? `${pressedBg} ${pressedBorder}`\n : `${baseBg} ${baseBorder}`;\n },\n [isSelected, isInvalid],\n );\n\n return (\n <Pressable\n onPress={handlePress}\n accessible\n accessibilityRole=\"checkbox\"\n accessibilityState={{\n checked: isSelected,\n disabled: isDisabled,\n }}\n accessibilityLabel={typeof label === 'string' ? label : undefined}\n style={(state: PressableStateCallbackType) => [\n twContainerClassNames,\n typeof style === 'function' ? style(state) : style,\n ]}\n disabled={isDisabled}\n {...props}\n >\n {({ pressed }) => (\n <>\n <AnimatedView\n {...checkboxContainerProps}\n style={[\n tw`${getCheckboxContainerStyle(pressed)} flex size-[22px] items-center justify-center rounded border-2`,\n { transform: [{ scale: scaleAnim }] },\n ]}\n >\n {/* Always render icon, opacity driven by iconAnim */}\n <Animated.View style={{ opacity: iconAnim }}>\n <Icon\n name={IconName.Check}\n color={IconColor.PrimaryInverse}\n size={IconSize.Sm}\n {...checkedIconProps}\n />\n </Animated.View>\n </AnimatedView>\n {label ? (\n <TextOrChildren\n textProps={{ ...labelProps, twClassName: 'ml-3' }}\n >\n {label}\n </TextOrChildren>\n ) : null}\n </>\n )}\n </Pressable>\n );\n },\n);\n"]}
@@ -84,7 +84,7 @@ export const Checkbox = forwardRef(({ isSelected, isDisabled = false, isInvalid
84
84
  ]} disabled={isDisabled} {...props}>
85
85
  {({ pressed }) => (<>
86
86
  <AnimatedView {...checkboxContainerProps} style={[
87
- tw `${getCheckboxContainerStyle(pressed)} flex h-[22px] w-[22px] items-center justify-center rounded border-2`,
87
+ tw `${getCheckboxContainerStyle(pressed)} flex size-[22px] items-center justify-center rounded border-2`,
88
88
  { transform: [{ scale: scaleAnim }] },
89
89
  ]}>
90
90
  {/* Always render icon, opacity driven by iconAnim */}