@metamask/design-system-react-native 0.11.0 → 0.12.0

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 (187) hide show
  1. package/CHANGELOG.md +21 -1
  2. package/dist/components/AvatarNetwork/AvatarNetwork.types.cjs.map +1 -1
  3. package/dist/components/AvatarNetwork/AvatarNetwork.types.d.cts +7 -9
  4. package/dist/components/AvatarNetwork/AvatarNetwork.types.d.cts.map +1 -1
  5. package/dist/components/AvatarNetwork/AvatarNetwork.types.d.mts +7 -9
  6. package/dist/components/AvatarNetwork/AvatarNetwork.types.d.mts.map +1 -1
  7. package/dist/components/AvatarNetwork/AvatarNetwork.types.mjs.map +1 -1
  8. package/dist/components/BannerAlert/BannerAlert.cjs +23 -0
  9. package/dist/components/BannerAlert/BannerAlert.cjs.map +1 -0
  10. package/dist/components/BannerAlert/BannerAlert.constants.cjs +30 -0
  11. package/dist/components/BannerAlert/BannerAlert.constants.cjs.map +1 -0
  12. package/dist/components/BannerAlert/BannerAlert.constants.d.cts +7 -0
  13. package/dist/components/BannerAlert/BannerAlert.constants.d.cts.map +1 -0
  14. package/dist/components/BannerAlert/BannerAlert.constants.d.mts +7 -0
  15. package/dist/components/BannerAlert/BannerAlert.constants.d.mts.map +1 -0
  16. package/dist/components/BannerAlert/BannerAlert.constants.mjs +27 -0
  17. package/dist/components/BannerAlert/BannerAlert.constants.mjs.map +1 -0
  18. package/dist/components/BannerAlert/BannerAlert.d.cts +4 -0
  19. package/dist/components/BannerAlert/BannerAlert.d.cts.map +1 -0
  20. package/dist/components/BannerAlert/BannerAlert.d.mts +4 -0
  21. package/dist/components/BannerAlert/BannerAlert.d.mts.map +1 -0
  22. package/dist/components/BannerAlert/BannerAlert.mjs +23 -0
  23. package/dist/components/BannerAlert/BannerAlert.mjs.map +1 -0
  24. package/dist/components/BannerAlert/BannerAlert.types.cjs +3 -0
  25. package/dist/components/BannerAlert/BannerAlert.types.cjs.map +1 -0
  26. package/dist/components/BannerAlert/BannerAlert.types.d.cts +10 -0
  27. package/dist/components/BannerAlert/BannerAlert.types.d.cts.map +1 -0
  28. package/dist/components/BannerAlert/BannerAlert.types.d.mts +10 -0
  29. package/dist/components/BannerAlert/BannerAlert.types.d.mts.map +1 -0
  30. package/dist/components/BannerAlert/BannerAlert.types.mjs +2 -0
  31. package/dist/components/BannerAlert/BannerAlert.types.mjs.map +1 -0
  32. package/dist/components/BannerAlert/index.cjs +8 -0
  33. package/dist/components/BannerAlert/index.cjs.map +1 -0
  34. package/dist/components/BannerAlert/index.d.cts +4 -0
  35. package/dist/components/BannerAlert/index.d.cts.map +1 -0
  36. package/dist/components/BannerAlert/index.d.mts +4 -0
  37. package/dist/components/BannerAlert/index.d.mts.map +1 -0
  38. package/dist/components/BannerAlert/index.mjs +3 -0
  39. package/dist/components/BannerAlert/index.mjs.map +1 -0
  40. package/dist/components/Icon/assets/candlestick.svg +1 -1
  41. package/dist/components/Input/Input.cjs +4 -3
  42. package/dist/components/Input/Input.cjs.map +1 -1
  43. package/dist/components/Input/Input.constants.cjs +69 -0
  44. package/dist/components/Input/Input.constants.cjs.map +1 -0
  45. package/dist/components/Input/Input.constants.d.cts +11 -0
  46. package/dist/components/Input/Input.constants.d.cts.map +1 -0
  47. package/dist/components/Input/Input.constants.d.mts +11 -0
  48. package/dist/components/Input/Input.constants.d.mts.map +1 -0
  49. package/dist/components/Input/Input.constants.mjs +66 -0
  50. package/dist/components/Input/Input.constants.mjs.map +1 -0
  51. package/dist/components/Input/Input.d.cts.map +1 -1
  52. package/dist/components/Input/Input.d.mts.map +1 -1
  53. package/dist/components/Input/Input.mjs +4 -3
  54. package/dist/components/Input/Input.mjs.map +1 -1
  55. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.cjs +33 -0
  56. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.cjs.map +1 -0
  57. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.cts +14 -0
  58. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.cts.map +1 -0
  59. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.mts +14 -0
  60. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.mts.map +1 -0
  61. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.mjs +35 -0
  62. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.mjs.map +1 -0
  63. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.cjs +39 -0
  64. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.cjs.map +1 -0
  65. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.cts +25 -0
  66. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.cts.map +1 -0
  67. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.mts +25 -0
  68. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.mts.map +1 -0
  69. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.mjs +41 -0
  70. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.mjs.map +1 -0
  71. package/dist/components/KeyValueRow/KeyValueRow.cjs +76 -0
  72. package/dist/components/KeyValueRow/KeyValueRow.cjs.map +1 -0
  73. package/dist/components/KeyValueRow/KeyValueRow.d.cts +25 -0
  74. package/dist/components/KeyValueRow/KeyValueRow.d.cts.map +1 -0
  75. package/dist/components/KeyValueRow/KeyValueRow.d.mts +25 -0
  76. package/dist/components/KeyValueRow/KeyValueRow.d.mts.map +1 -0
  77. package/dist/components/KeyValueRow/KeyValueRow.mjs +77 -0
  78. package/dist/components/KeyValueRow/KeyValueRow.mjs.map +1 -0
  79. package/dist/components/KeyValueRow/KeyValueRow.types.cjs +29 -0
  80. package/dist/components/KeyValueRow/KeyValueRow.types.cjs.map +1 -0
  81. package/dist/components/KeyValueRow/KeyValueRow.types.d.cts +177 -0
  82. package/dist/components/KeyValueRow/KeyValueRow.types.d.cts.map +1 -0
  83. package/dist/components/KeyValueRow/KeyValueRow.types.d.mts +177 -0
  84. package/dist/components/KeyValueRow/KeyValueRow.types.d.mts.map +1 -0
  85. package/dist/components/KeyValueRow/KeyValueRow.types.mjs +26 -0
  86. package/dist/components/KeyValueRow/KeyValueRow.types.mjs.map +1 -0
  87. package/dist/components/KeyValueRow/KeyValueRow.utils.cjs +6 -0
  88. package/dist/components/KeyValueRow/KeyValueRow.utils.cjs.map +1 -0
  89. package/dist/components/KeyValueRow/KeyValueRow.utils.d.cts +3 -0
  90. package/dist/components/KeyValueRow/KeyValueRow.utils.d.cts.map +1 -0
  91. package/dist/components/KeyValueRow/KeyValueRow.utils.d.mts +3 -0
  92. package/dist/components/KeyValueRow/KeyValueRow.utils.d.mts.map +1 -0
  93. package/dist/components/KeyValueRow/KeyValueRow.utils.mjs +2 -0
  94. package/dist/components/KeyValueRow/KeyValueRow.utils.mjs.map +1 -0
  95. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.cjs +29 -0
  96. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.cjs.map +1 -0
  97. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.cts +17 -0
  98. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.cts.map +1 -0
  99. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.mts +17 -0
  100. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.mts.map +1 -0
  101. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.mjs +31 -0
  102. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.mjs.map +1 -0
  103. package/dist/components/KeyValueRow/index.cjs +15 -0
  104. package/dist/components/KeyValueRow/index.cjs.map +1 -0
  105. package/dist/components/KeyValueRow/index.d.cts +3 -0
  106. package/dist/components/KeyValueRow/index.d.cts.map +1 -0
  107. package/dist/components/KeyValueRow/index.d.mts +3 -0
  108. package/dist/components/KeyValueRow/index.d.mts.map +1 -0
  109. package/dist/components/KeyValueRow/index.mjs +3 -0
  110. package/dist/components/KeyValueRow/index.mjs.map +1 -0
  111. package/dist/components/TextButton/TextButton.cjs +12 -36
  112. package/dist/components/TextButton/TextButton.cjs.map +1 -1
  113. package/dist/components/TextButton/TextButton.d.cts.map +1 -1
  114. package/dist/components/TextButton/TextButton.d.mts.map +1 -1
  115. package/dist/components/TextButton/TextButton.mjs +14 -38
  116. package/dist/components/TextButton/TextButton.mjs.map +1 -1
  117. package/dist/components/TextButton/TextButton.types.cjs.map +1 -1
  118. package/dist/components/TextButton/TextButton.types.d.cts +8 -60
  119. package/dist/components/TextButton/TextButton.types.d.cts.map +1 -1
  120. package/dist/components/TextButton/TextButton.types.d.mts +8 -60
  121. package/dist/components/TextButton/TextButton.types.d.mts.map +1 -1
  122. package/dist/components/TextButton/TextButton.types.mjs.map +1 -1
  123. package/dist/components/TextButton/index.cjs +1 -3
  124. package/dist/components/TextButton/index.cjs.map +1 -1
  125. package/dist/components/TextButton/index.d.cts +0 -1
  126. package/dist/components/TextButton/index.d.cts.map +1 -1
  127. package/dist/components/TextButton/index.d.mts +0 -1
  128. package/dist/components/TextButton/index.d.mts.map +1 -1
  129. package/dist/components/TextButton/index.mjs +0 -1
  130. package/dist/components/TextButton/index.mjs.map +1 -1
  131. package/dist/components/TextField/TextField.cjs +22 -8
  132. package/dist/components/TextField/TextField.cjs.map +1 -1
  133. package/dist/components/TextField/TextField.d.cts +0 -2
  134. package/dist/components/TextField/TextField.d.cts.map +1 -1
  135. package/dist/components/TextField/TextField.d.mts +0 -2
  136. package/dist/components/TextField/TextField.d.mts.map +1 -1
  137. package/dist/components/TextField/TextField.mjs +22 -8
  138. package/dist/components/TextField/TextField.mjs.map +1 -1
  139. package/dist/components/TextField/TextField.types.cjs +0 -10
  140. package/dist/components/TextField/TextField.types.cjs.map +1 -1
  141. package/dist/components/TextField/TextField.types.d.cts +0 -14
  142. package/dist/components/TextField/TextField.types.d.cts.map +1 -1
  143. package/dist/components/TextField/TextField.types.d.mts +0 -14
  144. package/dist/components/TextField/TextField.types.d.mts.map +1 -1
  145. package/dist/components/TextField/TextField.types.mjs +1 -9
  146. package/dist/components/TextField/TextField.types.mjs.map +1 -1
  147. package/dist/components/TextField/index.cjs +1 -3
  148. package/dist/components/TextField/index.cjs.map +1 -1
  149. package/dist/components/TextField/index.d.cts +0 -1
  150. package/dist/components/TextField/index.d.cts.map +1 -1
  151. package/dist/components/TextField/index.d.mts +0 -1
  152. package/dist/components/TextField/index.d.mts.map +1 -1
  153. package/dist/components/TextField/index.mjs +0 -1
  154. package/dist/components/TextField/index.mjs.map +1 -1
  155. package/dist/components/index.cjs +4 -3
  156. package/dist/components/index.cjs.map +1 -1
  157. package/dist/components/index.d.cts +4 -2
  158. package/dist/components/index.d.cts.map +1 -1
  159. package/dist/components/index.d.mts +4 -2
  160. package/dist/components/index.d.mts.map +1 -1
  161. package/dist/components/index.mjs +3 -2
  162. package/dist/components/index.mjs.map +1 -1
  163. package/dist/types/index.cjs +1 -11
  164. package/dist/types/index.cjs.map +1 -1
  165. package/dist/types/index.d.cts +0 -9
  166. package/dist/types/index.d.cts.map +1 -1
  167. package/dist/types/index.d.mts +0 -9
  168. package/dist/types/index.d.mts.map +1 -1
  169. package/dist/types/index.mjs +0 -10
  170. package/dist/types/index.mjs.map +1 -1
  171. package/package.json +2 -2
  172. package/dist/components/TextButton/TextButton.constants.cjs +0 -12
  173. package/dist/components/TextButton/TextButton.constants.cjs.map +0 -1
  174. package/dist/components/TextButton/TextButton.constants.d.cts +0 -4
  175. package/dist/components/TextButton/TextButton.constants.d.cts.map +0 -1
  176. package/dist/components/TextButton/TextButton.constants.d.mts +0 -4
  177. package/dist/components/TextButton/TextButton.constants.d.mts.map +0 -1
  178. package/dist/components/TextButton/TextButton.constants.mjs +0 -9
  179. package/dist/components/TextButton/TextButton.constants.mjs.map +0 -1
  180. package/dist/components/TextField/TextField.constants.cjs +0 -13
  181. package/dist/components/TextField/TextField.constants.cjs.map +0 -1
  182. package/dist/components/TextField/TextField.constants.d.cts +0 -6
  183. package/dist/components/TextField/TextField.constants.d.cts.map +0 -1
  184. package/dist/components/TextField/TextField.constants.d.mts +0 -6
  185. package/dist/components/TextField/TextField.constants.d.mts.map +0 -1
  186. package/dist/components/TextField/TextField.constants.mjs +0 -10
  187. package/dist/components/TextField/TextField.constants.mjs.map +0 -1
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import type { KeyValueSectionProps } from "../KeyValueRow.types.mjs";
3
+ /**
4
+ * A container representing either the left or right side of the KeyValueRow.
5
+ * For desired results, use only two <KeyValueSection> components within the <KeyValueRowRoot>.
6
+ *
7
+ * @param props - Component props.
8
+ * @param props.children - The child components.
9
+ * @param props.align - The alignment of the section.
10
+ * @param props.twClassName - Optional Tailwind class names to override root styles.
11
+ * @param props.style - Optional additional styles for the root element.
12
+ *
13
+ * @returns The rendered KeyValueSection component.
14
+ */
15
+ declare const KeyValueSection: React.FC<KeyValueSectionProps>;
16
+ export default KeyValueSection;
17
+ //# sourceMappingURL=KeyValueSection.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KeyValueSection.d.mts","sourceRoot":"","sources":["../../../../src/components/KeyValueRow/KeyValueSection/KeyValueSection.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAI1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,iCAA6B;AAEjE;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAcnD,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -0,0 +1,31 @@
1
+ function $importDefault(module) {
2
+ if (module?.__esModule) {
3
+ return module.default;
4
+ }
5
+ return module;
6
+ }
7
+ import { useTailwind } from "@metamask/design-system-twrnc-preset";
8
+ import $React from "react";
9
+ const React = $importDefault($React);
10
+ import { View } from "react-native/index.js";
11
+ import { KeyValueRowSectionAlignments } from "../KeyValueRow.types.mjs";
12
+ /**
13
+ * A container representing either the left or right side of the KeyValueRow.
14
+ * For desired results, use only two <KeyValueSection> components within the <KeyValueRowRoot>.
15
+ *
16
+ * @param props - Component props.
17
+ * @param props.children - The child components.
18
+ * @param props.align - The alignment of the section.
19
+ * @param props.twClassName - Optional Tailwind class names to override root styles.
20
+ * @param props.style - Optional additional styles for the root element.
21
+ *
22
+ * @returns The rendered KeyValueSection component.
23
+ */
24
+ const KeyValueSection = ({ children, align = KeyValueRowSectionAlignments.Left, twClassName, style, ...props }) => {
25
+ const tw = useTailwind();
26
+ return (<View style={[tw.style('flex-1', align, twClassName), style]} {...props}>
27
+ {children}
28
+ </View>);
29
+ };
30
+ export default KeyValueSection;
31
+ //# sourceMappingURL=KeyValueSection.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KeyValueSection.mjs","sourceRoot":"","sources":["../../../../src/components/KeyValueRow/KeyValueSection/KeyValueSection.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,6CAA6C;AACnE,OAAO,MAAK,cAAc;;AAC1B,OAAO,EAAE,IAAI,EAAE,8BAAqB;AAEpC,OAAO,EAAE,4BAA4B,EAAE,iCAA6B;AAGpE;;;;;;;;;;;GAWG;AACH,MAAM,eAAe,GAAmC,CAAC,EACvD,QAAQ,EACR,KAAK,GAAG,4BAA4B,CAAC,IAAI,EACzC,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IAEzB,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,EAAE,WAAW,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CACtE;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport { KeyValueRowSectionAlignments } from '../KeyValueRow.types';\nimport type { KeyValueSectionProps } from '../KeyValueRow.types';\n\n/**\n * A container representing either the left or right side of the KeyValueRow.\n * For desired results, use only two <KeyValueSection> components within the <KeyValueRowRoot>.\n *\n * @param props - Component props.\n * @param props.children - The child components.\n * @param props.align - The alignment of the section.\n * @param props.twClassName - Optional Tailwind class names to override root styles.\n * @param props.style - Optional additional styles for the root element.\n *\n * @returns The rendered KeyValueSection component.\n */\nconst KeyValueSection: React.FC<KeyValueSectionProps> = ({\n children,\n align = KeyValueRowSectionAlignments.Left,\n twClassName,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n\n return (\n <View style={[tw.style('flex-1', align, twClassName), style]} {...props}>\n {children}\n </View>\n );\n};\n\nexport default KeyValueSection;\n"]}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.IconSizes = exports.TooltipSizes = exports.KeyValueRowFieldIconSides = exports.KeyValueRowSectionAlignments = exports.default = exports.KeyValueRowStubs = void 0;
7
+ var KeyValueRow_1 = require("./KeyValueRow.cjs");
8
+ Object.defineProperty(exports, "KeyValueRowStubs", { enumerable: true, get: function () { return KeyValueRow_1.KeyValueRowStubs; } });
9
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(KeyValueRow_1).default; } });
10
+ var KeyValueRow_types_1 = require("./KeyValueRow.types.cjs");
11
+ Object.defineProperty(exports, "KeyValueRowSectionAlignments", { enumerable: true, get: function () { return KeyValueRow_types_1.KeyValueRowSectionAlignments; } });
12
+ Object.defineProperty(exports, "KeyValueRowFieldIconSides", { enumerable: true, get: function () { return KeyValueRow_types_1.KeyValueRowFieldIconSides; } });
13
+ Object.defineProperty(exports, "TooltipSizes", { enumerable: true, get: function () { return KeyValueRow_types_1.TooltipSizes; } });
14
+ Object.defineProperty(exports, "IconSizes", { enumerable: true, get: function () { return KeyValueRow_types_1.IconSizes; } });
15
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/KeyValueRow/index.tsx"],"names":[],"mappings":";;;;;;AAAA,iDAA0D;AAAjD,+GAAA,gBAAgB,OAAA;AAAE,uHAAA,OAAO,OAAA;AAClC,6DAY6B;AAX3B,iIAAA,4BAA4B,OAAA;AAC5B,8HAAA,yBAAyB,OAAA;AACzB,iHAAA,YAAY,OAAA;AACZ,8GAAA,SAAS,OAAA","sourcesContent":["export { KeyValueRowStubs, default } from './KeyValueRow';\nexport {\n KeyValueRowSectionAlignments,\n KeyValueRowFieldIconSides,\n TooltipSizes,\n IconSizes,\n type KeyValueRowTooltip,\n type KeyValueRowField,\n type PreDefinedKeyValueRowLabel,\n type KeyValueRowLabelProps,\n type KeyValueRowRootProps,\n type KeyValueSectionProps,\n type KeyValueRowProps,\n} from './KeyValueRow.types';\n"]}
@@ -0,0 +1,3 @@
1
+ export { KeyValueRowStubs, default } from "./KeyValueRow.cjs";
2
+ export { KeyValueRowSectionAlignments, KeyValueRowFieldIconSides, TooltipSizes, IconSizes, type KeyValueRowTooltip, type KeyValueRowField, type PreDefinedKeyValueRowLabel, type KeyValueRowLabelProps, type KeyValueRowRootProps, type KeyValueSectionProps, type KeyValueRowProps, } from "./KeyValueRow.types.cjs";
3
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/KeyValueRow/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,0BAAsB;AAC1D,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,EACzB,YAAY,EACZ,SAAS,EACT,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,GACtB,gCAA4B"}
@@ -0,0 +1,3 @@
1
+ export { KeyValueRowStubs, default } from "./KeyValueRow.mjs";
2
+ export { KeyValueRowSectionAlignments, KeyValueRowFieldIconSides, TooltipSizes, IconSizes, type KeyValueRowTooltip, type KeyValueRowField, type PreDefinedKeyValueRowLabel, type KeyValueRowLabelProps, type KeyValueRowRootProps, type KeyValueSectionProps, type KeyValueRowProps, } from "./KeyValueRow.types.mjs";
3
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/KeyValueRow/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,0BAAsB;AAC1D,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,EACzB,YAAY,EACZ,SAAS,EACT,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,GACtB,gCAA4B"}
@@ -0,0 +1,3 @@
1
+ export { KeyValueRowStubs, default } from "./KeyValueRow.mjs";
2
+ export { KeyValueRowSectionAlignments, KeyValueRowFieldIconSides, TooltipSizes, IconSizes } from "./KeyValueRow.types.mjs";
3
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/KeyValueRow/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,0BAAsB;AAC1D,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,EACzB,YAAY,EACZ,SAAS,EAQV,gCAA4B","sourcesContent":["export { KeyValueRowStubs, default } from './KeyValueRow';\nexport {\n KeyValueRowSectionAlignments,\n KeyValueRowFieldIconSides,\n TooltipSizes,\n IconSizes,\n type KeyValueRowTooltip,\n type KeyValueRowField,\n type PreDefinedKeyValueRowLabel,\n type KeyValueRowLabelProps,\n type KeyValueRowRootProps,\n type KeyValueSectionProps,\n type KeyValueRowProps,\n} from './KeyValueRow.types';\n"]}
@@ -24,45 +24,21 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.TextButton = void 0;
27
- const design_system_twrnc_preset_1 = require("@metamask/design-system-twrnc-preset");
28
27
  const react_1 = __importStar(require("react"));
29
- const react_native_1 = require("react-native/index.js");
30
28
  const types_1 = require("../../types/index.cjs");
31
- const Icon_1 = require("../Icon/index.cjs");
32
29
  const Text_1 = require("../Text/index.cjs");
33
- const TextButton_constants_1 = require("./TextButton.constants.cjs");
34
- const TextButton = ({ children, size = types_1.TextButtonSize.BodyMd, textProps, startIconName, startIconProps, startAccessory, endIconName, endIconProps, endAccessory, isDisabled = false, isInverse = false, twClassName = '', accessibilityRole, accessibilityLabel, style, ...props }) => {
35
- const tw = (0, design_system_twrnc_preset_1.useTailwind)();
36
- /**
37
- * Calculating the baselineOffset. This baselineOffset is needed to make sure
38
- * the TextButton aligns perfectly when placed within Text elements
39
- */
40
- // eslint-disable-next-line tailwindcss/no-custom-classname
41
- const { fontSize, lineHeight } = tw `text-${TextButton_constants_1.MAP_TEXTBUTTON_SIZE_TEXTVARIANT[size]}`;
42
- const baselineOffset = (lineHeight - fontSize) / 2;
43
- const getTextColor = (0, react_1.useCallback)((pressed) => {
44
- if (isInverse) {
45
- return 'text-primary-inverse';
46
- }
47
- return pressed ? 'text-primary-default-pressed' : 'text-primary-default';
48
- }, [isInverse]);
49
- const getTextDecoration = (0, react_1.useCallback)((pressed) => isInverse || pressed ? 'underline' : 'no-underline', [isInverse]);
50
- return (<Text_1.Text>
51
- <react_native_1.Pressable accessibilityRole={accessibilityRole ?? 'button'} accessibilityLabel={accessibilityLabel} disabled={isDisabled} style={({ pressed }) => [
52
- { transform: [{ translateY: baselineOffset }] },
53
- tw `flex-row items-center ${pressed ? 'bg-pressed' : 'bg-transparent'} ${isDisabled ? 'opacity-50' : 'opacity-100'} ${twClassName}`,
54
- style,
55
- ]} {...props}>
56
- {({ pressed }) => (<>
57
- {startIconName ? (<Icon_1.Icon name={startIconName} size={Icon_1.IconSize.Sm} testID="start-icon" twClassName={`${getTextColor(pressed)} mr-1`} {...startIconProps}/>) : (startAccessory)}
58
-
59
- <Text_1.Text variant={TextButton_constants_1.MAP_TEXTBUTTON_SIZE_TEXTVARIANT[size]} fontWeight={Text_1.FontWeight.Medium} {...textProps} twClassName={` ${getTextColor(pressed)} ${getTextDecoration(pressed)} ${textProps?.twClassName ?? ''} `}>
60
- {children}
61
- </Text_1.Text>
62
-
63
- {endIconName ? (<Icon_1.Icon name={endIconName} size={Icon_1.IconSize.Sm} testID="end-icon" twClassName={`${getTextColor(pressed)} ml-1`} {...endIconProps}/>) : (endAccessory)}
64
- </>)}
65
- </react_native_1.Pressable>
30
+ const TextButton = ({ children, variant = types_1.TextVariant.BodyMd, fontWeight = Text_1.FontWeight.Medium, twClassName, accessibilityRole = 'link', onPress, onPressIn, onPressOut, suppressHighlighting = true, ...rest }) => {
31
+ const [pressed, setPressed] = (0, react_1.useState)(false);
32
+ const handlePressIn = (e) => {
33
+ setPressed(true);
34
+ onPressIn?.(e);
35
+ };
36
+ const handlePressOut = (e) => {
37
+ setPressed(false);
38
+ onPressOut?.(e);
39
+ };
40
+ return (<Text_1.Text {...rest} accessibilityRole={accessibilityRole} variant={variant} fontWeight={fontWeight} color={pressed ? types_1.TextColor.PrimaryDefaultPressed : types_1.TextColor.PrimaryDefault} twClassName={twClassName} onPress={onPress} onPressIn={handlePressIn} onPressOut={handlePressOut} suppressHighlighting={suppressHighlighting}>
41
+ {children}
66
42
  </Text_1.Text>);
67
43
  };
68
44
  exports.TextButton = TextButton;
@@ -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;;YAAA,CAAC,WAAW,CAAC,CAAC,CAAC,CACb,CAAC,WAAI,CACH,IAAI,CAAC,CAAC,WAAW,CAAC,CAClB,IAAI,CAAC,CAAC,eAAQ,CAAC,EAAE,CAAC,CAClB,MAAM,CAAC,UAAU,CACjB,WAAW,CAAC,CAAC,GAAG,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAC7C,IAAI,YAAY,CAAC,EACjB,CACH,CAAC,CAAC,CAAC,CACF,YAAY,CACb,CACH;UAAA,GAAG,CACJ,CACH;MAAA,EAAE,wBAAS,CACb;IAAA,EAAE,WAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AApGW,QAAA,UAAU,cAoGrB","sourcesContent":["import { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React, { useCallback } from 'react';\nimport { Pressable } from 'react-native';\n\nimport { TextButtonSize } from '../../types';\nimport { Icon, IconSize } from '../Icon';\nimport { Text, FontWeight } from '../Text';\n\nimport { MAP_TEXTBUTTON_SIZE_TEXTVARIANT } from './TextButton.constants';\nimport type { TextButtonProps } from './TextButton.types';\n\nexport const TextButton: React.FC<TextButtonProps> = ({\n children,\n size = TextButtonSize.BodyMd,\n textProps,\n startIconName,\n startIconProps,\n startAccessory,\n endIconName,\n endIconProps,\n endAccessory,\n isDisabled = false,\n isInverse = false,\n twClassName = '',\n accessibilityRole,\n accessibilityLabel,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n /**\n * Calculating the baselineOffset. This baselineOffset is needed to make sure\n * the TextButton aligns perfectly when placed within Text elements\n */\n // eslint-disable-next-line tailwindcss/no-custom-classname\n const { fontSize, lineHeight } = tw`text-${\n MAP_TEXTBUTTON_SIZE_TEXTVARIANT[size] as string\n }` as {\n fontSize: number;\n lineHeight: number;\n };\n const baselineOffset = (lineHeight - fontSize) / 2;\n\n const getTextColor = useCallback(\n (pressed: boolean): string => {\n if (isInverse) {\n return 'text-primary-inverse';\n }\n return pressed ? 'text-primary-default-pressed' : 'text-primary-default';\n },\n [isInverse],\n );\n\n const getTextDecoration = useCallback(\n (pressed: boolean): string =>\n isInverse || pressed ? 'underline' : 'no-underline',\n [isInverse],\n );\n\n return (\n <Text>\n <Pressable\n accessibilityRole={accessibilityRole ?? 'button'}\n accessibilityLabel={accessibilityLabel}\n disabled={isDisabled}\n style={({ pressed }) => [\n { transform: [{ translateY: baselineOffset }] },\n tw`flex-row items-center ${pressed ? 'bg-pressed' : 'bg-transparent'} ${isDisabled ? 'opacity-50' : 'opacity-100'} ${twClassName}`,\n style,\n ]}\n {...props}\n >\n {({ pressed }) => (\n <>\n {startIconName ? (\n <Icon\n name={startIconName}\n size={IconSize.Sm}\n testID=\"start-icon\"\n twClassName={`${getTextColor(pressed)} mr-1`}\n {...startIconProps}\n />\n ) : (\n startAccessory\n )}\n\n <Text\n variant={MAP_TEXTBUTTON_SIZE_TEXTVARIANT[size]}\n fontWeight={FontWeight.Medium}\n {...textProps}\n twClassName={` ${getTextColor(pressed)} ${getTextDecoration(pressed)} ${textProps?.twClassName ?? ''} `}\n >\n {children}\n </Text>\n\n {endIconName ? (\n <Icon\n name={endIconName}\n size={IconSize.Sm}\n testID=\"end-icon\"\n twClassName={`${getTextColor(pressed)} ml-1`}\n {...endIconProps}\n />\n ) : (\n endAccessory\n )}\n </>\n )}\n </Pressable>\n </Text>\n );\n};\n"]}
1
+ {"version":3,"file":"TextButton.cjs","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAwC;AAExC,iDAAqD;AACrD,4CAA2C;AAIpC,MAAM,UAAU,GAA8B,CAAC,EACpD,QAAQ,EACR,OAAO,GAAG,mBAAW,CAAC,MAAM,EAC5B,UAAU,GAAG,iBAAU,CAAC,MAAM,EAC9B,WAAW,EACX,iBAAiB,GAAG,MAAM,EAC1B,OAAO,EACP,SAAS,EACT,UAAU,EACV,oBAAoB,GAAG,IAAI,EAC3B,GAAG,IAAI,EACR,EAAE,EAAE;IACH,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAE9C,MAAM,aAAa,GAA8C,CAAC,CAAC,EAAE,EAAE;QACrE,UAAU,CAAC,IAAI,CAAC,CAAC;QACjB,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC,CAAC;IAEF,MAAM,cAAc,GAA+C,CAAC,CAAC,EAAE,EAAE;QACvE,UAAU,CAAC,KAAK,CAAC,CAAC;QAClB,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,WAAI,CACH,IAAI,IAAI,CAAC,CACT,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,KAAK,CAAC,CACJ,OAAO,CAAC,CAAC,CAAC,iBAAS,CAAC,qBAAqB,CAAC,CAAC,CAAC,iBAAS,CAAC,cAAc,CACrE,CACD,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,SAAS,CAAC,CAAC,aAAa,CAAC,CACzB,UAAU,CAAC,CAAC,cAAc,CAAC,CAC3B,oBAAoB,CAAC,CAAC,oBAAoB,CAAC,CAE3C;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,WAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AA1CW,QAAA,UAAU,cA0CrB","sourcesContent":["import React, { useState } from 'react';\n\nimport { TextVariant, TextColor } from '../../types';\nimport { Text, FontWeight } from '../Text';\n\nimport type { TextButtonProps } from './TextButton.types';\n\nexport const TextButton: React.FC<TextButtonProps> = ({\n children,\n variant = TextVariant.BodyMd,\n fontWeight = FontWeight.Medium,\n twClassName,\n accessibilityRole = 'link',\n onPress,\n onPressIn,\n onPressOut,\n suppressHighlighting = true,\n ...rest\n}) => {\n const [pressed, setPressed] = useState(false);\n\n const handlePressIn: NonNullable<TextButtonProps['onPressIn']> = (e) => {\n setPressed(true);\n onPressIn?.(e);\n };\n\n const handlePressOut: NonNullable<TextButtonProps['onPressOut']> = (e) => {\n setPressed(false);\n onPressOut?.(e);\n };\n\n return (\n <Text\n {...rest}\n accessibilityRole={accessibilityRole}\n variant={variant}\n fontWeight={fontWeight}\n color={\n pressed ? TextColor.PrimaryDefaultPressed : TextColor.PrimaryDefault\n }\n twClassName={twClassName}\n onPress={onPress}\n onPressIn={handlePressIn}\n onPressOut={handlePressOut}\n suppressHighlighting={suppressHighlighting}\n >\n {children}\n </Text>\n );\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"TextButton.d.cts","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsB,cAAc;AAQ3C,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAoGhD,CAAC"}
1
+ {"version":3,"file":"TextButton.d.cts","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,cAAc;AAKxC,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA0ChD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TextButton.d.mts","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsB,cAAc;AAQ3C,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAoGhD,CAAC"}
1
+ {"version":3,"file":"TextButton.d.mts","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,cAAc;AAKxC,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA0ChD,CAAC"}
@@ -4,46 +4,22 @@ function $importDefault(module) {
4
4
  }
5
5
  return module;
6
6
  }
7
- import { useTailwind } from "@metamask/design-system-twrnc-preset";
8
- import $React, { useCallback } from "react";
7
+ import $React, { useState } from "react";
9
8
  const React = $importDefault($React);
10
- import { Pressable } from "react-native/index.js";
11
- import { TextButtonSize } from "../../types/index.mjs";
12
- import { Icon, IconSize } from "../Icon/index.mjs";
9
+ import { TextVariant, TextColor } from "../../types/index.mjs";
13
10
  import { Text, FontWeight } from "../Text/index.mjs";
14
- import { MAP_TEXTBUTTON_SIZE_TEXTVARIANT } from "./TextButton.constants.mjs";
15
- export const TextButton = ({ children, size = TextButtonSize.BodyMd, textProps, startIconName, startIconProps, startAccessory, endIconName, endIconProps, endAccessory, isDisabled = false, isInverse = false, twClassName = '', accessibilityRole, accessibilityLabel, style, ...props }) => {
16
- const tw = useTailwind();
17
- /**
18
- * Calculating the baselineOffset. This baselineOffset is needed to make sure
19
- * the TextButton aligns perfectly when placed within Text elements
20
- */
21
- // eslint-disable-next-line tailwindcss/no-custom-classname
22
- const { fontSize, lineHeight } = tw `text-${MAP_TEXTBUTTON_SIZE_TEXTVARIANT[size]}`;
23
- const baselineOffset = (lineHeight - fontSize) / 2;
24
- const getTextColor = useCallback((pressed) => {
25
- if (isInverse) {
26
- return 'text-primary-inverse';
27
- }
28
- return pressed ? 'text-primary-default-pressed' : 'text-primary-default';
29
- }, [isInverse]);
30
- const getTextDecoration = useCallback((pressed) => isInverse || pressed ? 'underline' : 'no-underline', [isInverse]);
31
- return (<Text>
32
- <Pressable accessibilityRole={accessibilityRole ?? 'button'} accessibilityLabel={accessibilityLabel} disabled={isDisabled} style={({ pressed }) => [
33
- { transform: [{ translateY: baselineOffset }] },
34
- tw `flex-row items-center ${pressed ? 'bg-pressed' : 'bg-transparent'} ${isDisabled ? 'opacity-50' : 'opacity-100'} ${twClassName}`,
35
- style,
36
- ]} {...props}>
37
- {({ pressed }) => (<>
38
- {startIconName ? (<Icon name={startIconName} size={IconSize.Sm} testID="start-icon" twClassName={`${getTextColor(pressed)} mr-1`} {...startIconProps}/>) : (startAccessory)}
39
-
40
- <Text variant={MAP_TEXTBUTTON_SIZE_TEXTVARIANT[size]} fontWeight={FontWeight.Medium} {...textProps} twClassName={` ${getTextColor(pressed)} ${getTextDecoration(pressed)} ${textProps?.twClassName ?? ''} `}>
41
- {children}
42
- </Text>
43
-
44
- {endIconName ? (<Icon name={endIconName} size={IconSize.Sm} testID="end-icon" twClassName={`${getTextColor(pressed)} ml-1`} {...endIconProps}/>) : (endAccessory)}
45
- </>)}
46
- </Pressable>
11
+ export const TextButton = ({ children, variant = TextVariant.BodyMd, fontWeight = FontWeight.Medium, twClassName, accessibilityRole = 'link', onPress, onPressIn, onPressOut, suppressHighlighting = true, ...rest }) => {
12
+ const [pressed, setPressed] = useState(false);
13
+ const handlePressIn = (e) => {
14
+ setPressed(true);
15
+ onPressIn?.(e);
16
+ };
17
+ const handlePressOut = (e) => {
18
+ setPressed(false);
19
+ onPressOut?.(e);
20
+ };
21
+ return (<Text {...rest} accessibilityRole={accessibilityRole} variant={variant} fontWeight={fontWeight} color={pressed ? TextColor.PrimaryDefaultPressed : TextColor.PrimaryDefault} twClassName={twClassName} onPress={onPress} onPressIn={handlePressIn} onPressOut={handlePressOut} suppressHighlighting={suppressHighlighting}>
22
+ {children}
47
23
  </Text>);
48
24
  };
49
25
  //# sourceMappingURL=TextButton.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextButton.mjs","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,6CAA6C;AACnE,OAAO,QAAO,EAAE,WAAW,EAAE,cAAc;;AAC3C,OAAO,EAAE,SA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,CACb,CAAC,IAAI,CACH,IAAI,CAAC,CAAC,WAAW,CAAC,CAClB,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAClB,MAAM,CAAC,UAAU,CACjB,WAAW,CAAC,CAAC,GAAG,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAC7C,IAAI,YAAY,CAAC,EACjB,CACH,CAAC,CAAC,CAAC,CACF,YAAY,CACb,CACH;UAAA,GAAG,CACJ,CACH;MAAA,EAAE,SAAS,CACb;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React, { useCallback } from 'react';\nimport { Pressable } from 'react-native';\n\nimport { TextButtonSize } from '../../types';\nimport { Icon, IconSize } from '../Icon';\nimport { Text, FontWeight } from '../Text';\n\nimport { MAP_TEXTBUTTON_SIZE_TEXTVARIANT } from './TextButton.constants';\nimport type { TextButtonProps } from './TextButton.types';\n\nexport const TextButton: React.FC<TextButtonProps> = ({\n children,\n size = TextButtonSize.BodyMd,\n textProps,\n startIconName,\n startIconProps,\n startAccessory,\n endIconName,\n endIconProps,\n endAccessory,\n isDisabled = false,\n isInverse = false,\n twClassName = '',\n accessibilityRole,\n accessibilityLabel,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n /**\n * Calculating the baselineOffset. This baselineOffset is needed to make sure\n * the TextButton aligns perfectly when placed within Text elements\n */\n // eslint-disable-next-line tailwindcss/no-custom-classname\n const { fontSize, lineHeight } = tw`text-${\n MAP_TEXTBUTTON_SIZE_TEXTVARIANT[size] as string\n }` as {\n fontSize: number;\n lineHeight: number;\n };\n const baselineOffset = (lineHeight - fontSize) / 2;\n\n const getTextColor = useCallback(\n (pressed: boolean): string => {\n if (isInverse) {\n return 'text-primary-inverse';\n }\n return pressed ? 'text-primary-default-pressed' : 'text-primary-default';\n },\n [isInverse],\n );\n\n const getTextDecoration = useCallback(\n (pressed: boolean): string =>\n isInverse || pressed ? 'underline' : 'no-underline',\n [isInverse],\n );\n\n return (\n <Text>\n <Pressable\n accessibilityRole={accessibilityRole ?? 'button'}\n accessibilityLabel={accessibilityLabel}\n disabled={isDisabled}\n style={({ pressed }) => [\n { transform: [{ translateY: baselineOffset }] },\n tw`flex-row items-center ${pressed ? 'bg-pressed' : 'bg-transparent'} ${isDisabled ? 'opacity-50' : 'opacity-100'} ${twClassName}`,\n style,\n ]}\n {...props}\n >\n {({ pressed }) => (\n <>\n {startIconName ? (\n <Icon\n name={startIconName}\n size={IconSize.Sm}\n testID=\"start-icon\"\n twClassName={`${getTextColor(pressed)} mr-1`}\n {...startIconProps}\n />\n ) : (\n startAccessory\n )}\n\n <Text\n variant={MAP_TEXTBUTTON_SIZE_TEXTVARIANT[size]}\n fontWeight={FontWeight.Medium}\n {...textProps}\n twClassName={` ${getTextColor(pressed)} ${getTextDecoration(pressed)} ${textProps?.twClassName ?? ''} `}\n >\n {children}\n </Text>\n\n {endIconName ? (\n <Icon\n name={endIconName}\n size={IconSize.Sm}\n testID=\"end-icon\"\n twClassName={`${getTextColor(pressed)} ml-1`}\n {...endIconProps}\n />\n ) : (\n endAccessory\n )}\n </>\n )}\n </Pressable>\n </Text>\n );\n};\n"]}
1
+ {"version":3,"file":"TextButton.mjs","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,QAAO,EAAE,QAAQ,EAAE,cAAc;;AAExC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,8BAAoB;AACrD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,0BAAgB;AAI3C,MAAM,CAAC,MAAM,UAAU,GAA8B,CAAC,EACpD,QAAQ,EACR,OAAO,GAAG,WAAW,CAAC,MAAM,EAC5B,UAAU,GAAG,UAAU,CAAC,MAAM,EAC9B,WAAW,EACX,iBAAiB,GAAG,MAAM,EAC1B,OAAO,EACP,SAAS,EACT,UAAU,EACV,oBAAoB,GAAG,IAAI,EAC3B,GAAG,IAAI,EACR,EAAE,EAAE;IACH,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE9C,MAAM,aAAa,GAA8C,CAAC,CAAC,EAAE,EAAE;QACrE,UAAU,CAAC,IAAI,CAAC,CAAC;QACjB,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC,CAAC;IAEF,MAAM,cAAc,GAA+C,CAAC,CAAC,EAAE,EAAE;QACvE,UAAU,CAAC,KAAK,CAAC,CAAC;QAClB,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,IAAI,CACH,IAAI,IAAI,CAAC,CACT,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,KAAK,CAAC,CACJ,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,qBAAqB,CAAC,CAAC,CAAC,SAAS,CAAC,cAAc,CACrE,CACD,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,SAAS,CAAC,CAAC,aAAa,CAAC,CACzB,UAAU,CAAC,CAAC,cAAc,CAAC,CAC3B,oBAAoB,CAAC,CAAC,oBAAoB,CAAC,CAE3C;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React, { useState } from 'react';\n\nimport { TextVariant, TextColor } from '../../types';\nimport { Text, FontWeight } from '../Text';\n\nimport type { TextButtonProps } from './TextButton.types';\n\nexport const TextButton: React.FC<TextButtonProps> = ({\n children,\n variant = TextVariant.BodyMd,\n fontWeight = FontWeight.Medium,\n twClassName,\n accessibilityRole = 'link',\n onPress,\n onPressIn,\n onPressOut,\n suppressHighlighting = true,\n ...rest\n}) => {\n const [pressed, setPressed] = useState(false);\n\n const handlePressIn: NonNullable<TextButtonProps['onPressIn']> = (e) => {\n setPressed(true);\n onPressIn?.(e);\n };\n\n const handlePressOut: NonNullable<TextButtonProps['onPressOut']> = (e) => {\n setPressed(false);\n onPressOut?.(e);\n };\n\n return (\n <Text\n {...rest}\n accessibilityRole={accessibilityRole}\n variant={variant}\n fontWeight={fontWeight}\n color={\n pressed ? TextColor.PrimaryDefaultPressed : TextColor.PrimaryDefault\n }\n twClassName={twClassName}\n onPress={onPress}\n onPressIn={handlePressIn}\n onPressOut={handlePressOut}\n suppressHighlighting={suppressHighlighting}\n >\n {children}\n </Text>\n );\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"TextButton.types.cjs","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { PressableProps, StyleProp, ViewStyle } from 'react-native';\n\nimport type { TextButtonSize } from '../../types';\nimport type { IconProps, IconName } from '../Icon';\nimport type { TextProps } from '../Text';\n\n/**\n * TextButton component props.\n */\nexport type TextButtonProps = {\n /**\n * Required prop for the content to be rendered within the TextButton\n */\n children: string;\n /**\n * Optional prop to control the size of the TextButton\n *\n * @default TextButtonSize.BodyMd\n */\n size?: TextButtonSize;\n /**\n * Optional props to be passed to the Text component when children is a string\n */\n textProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional prop to specify an icon to show at the start of the button\n */\n startIconName?: IconName;\n /**\n * Optional prop to pass additional properties to the start icon\n */\n startIconProps?: Partial<IconProps>;\n /**\n * Optional prop for a custom element to show at the start of the button\n */\n startAccessory?: React.ReactNode;\n /**\n * Optional prop to specify an icon to show at the end of the button\n */\n endIconName?: IconName;\n /**\n * Optional prop to pass additional properties to the end icon\n */\n endIconProps?: Partial<IconProps>;\n /**\n * Optional prop for a custom element to show at the end of the button\n */\n endAccessory?: React.ReactNode;\n /**\n * Optional prop that when true, disables the button\n *\n * @default false\n */\n isDisabled?: boolean;\n /**\n * Optional prop to show the inverse state of the button, which is reserved for buttons on colored backgrounds.\n *\n * @default false\n */\n isInverse?: boolean;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n /**\n * Optional prop to control the style.\n */\n style?: StyleProp<ViewStyle>;\n} & Omit<PressableProps, 'disabled'>;\n"]}
1
+ {"version":3,"file":"TextButton.types.cjs","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextProps } from '../Text';\n\n/**\n * Props for `TextButton`, a text-only control for links and inline actions.\n * Extends {@link Text} props.\n */\nexport type TextButtonProps = Omit<\n TextProps,\n 'children' | 'color' | 'onPress'\n> & {\n /**\n * Content shown as the label.\n */\n children: React.ReactNode;\n /**\n * Called when the user presses the label. Primary interaction for this control.\n */\n onPress?: TextProps['onPress'];\n};\n"]}
@@ -1,68 +1,16 @@
1
- import type { PressableProps, StyleProp, ViewStyle } from "react-native/index.js";
2
- import type { TextButtonSize } from "../../types/index.cjs";
3
- import type { IconProps, IconName } from "../Icon/index.cjs";
4
1
  import type { TextProps } from "../Text/index.cjs";
5
2
  /**
6
- * TextButton component props.
3
+ * Props for `TextButton`, a text-only control for links and inline actions.
4
+ * Extends {@link Text} props.
7
5
  */
8
- export type TextButtonProps = {
6
+ export type TextButtonProps = Omit<TextProps, 'children' | 'color' | 'onPress'> & {
9
7
  /**
10
- * Required prop for the content to be rendered within the TextButton
8
+ * Content shown as the label.
11
9
  */
12
- children: string;
10
+ children: React.ReactNode;
13
11
  /**
14
- * Optional prop to control the size of the TextButton
15
- *
16
- * @default TextButtonSize.BodyMd
12
+ * Called when the user presses the label. Primary interaction for this control.
17
13
  */
18
- size?: TextButtonSize;
19
- /**
20
- * Optional props to be passed to the Text component when children is a string
21
- */
22
- textProps?: Omit<Partial<TextProps>, 'children'>;
23
- /**
24
- * Optional prop to specify an icon to show at the start of the button
25
- */
26
- startIconName?: IconName;
27
- /**
28
- * Optional prop to pass additional properties to the start icon
29
- */
30
- startIconProps?: Partial<IconProps>;
31
- /**
32
- * Optional prop for a custom element to show at the start of the button
33
- */
34
- startAccessory?: React.ReactNode;
35
- /**
36
- * Optional prop to specify an icon to show at the end of the button
37
- */
38
- endIconName?: IconName;
39
- /**
40
- * Optional prop to pass additional properties to the end icon
41
- */
42
- endIconProps?: Partial<IconProps>;
43
- /**
44
- * Optional prop for a custom element to show at the end of the button
45
- */
46
- endAccessory?: React.ReactNode;
47
- /**
48
- * Optional prop that when true, disables the button
49
- *
50
- * @default false
51
- */
52
- isDisabled?: boolean;
53
- /**
54
- * Optional prop to show the inverse state of the button, which is reserved for buttons on colored backgrounds.
55
- *
56
- * @default false
57
- */
58
- isInverse?: boolean;
59
- /**
60
- * Optional prop to add twrnc overriding classNames.
61
- */
62
- twClassName?: string;
63
- /**
64
- * Optional prop to control the style.
65
- */
66
- style?: StyleProp<ViewStyle>;
67
- } & Omit<PressableProps, 'disabled'>;
14
+ onPress?: TextProps['onPress'];
15
+ };
68
16
  //# sourceMappingURL=TextButton.types.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextButton.types.d.cts","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAEzE,OAAO,KAAK,EAAE,cAAc,EAAE,8BAAoB;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,0BAAgB;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IACjD;;OAEG;IACH,aAAa,CAAC,EAAE,QAAQ,CAAC;IACzB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IACpC;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC;;OAEG;IACH,WAAW,CAAC,EAAE,QAAQ,CAAC;IACvB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAClC;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,GAAG,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC"}
1
+ {"version":3,"file":"TextButton.types.d.cts","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,SAAS,EACT,UAAU,GAAG,OAAO,GAAG,SAAS,CACjC,GAAG;IACF;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAChC,CAAC"}
@@ -1,68 +1,16 @@
1
- import type { PressableProps, StyleProp, ViewStyle } from "react-native/index.js";
2
- import type { TextButtonSize } from "../../types/index.mjs";
3
- import type { IconProps, IconName } from "../Icon/index.mjs";
4
1
  import type { TextProps } from "../Text/index.mjs";
5
2
  /**
6
- * TextButton component props.
3
+ * Props for `TextButton`, a text-only control for links and inline actions.
4
+ * Extends {@link Text} props.
7
5
  */
8
- export type TextButtonProps = {
6
+ export type TextButtonProps = Omit<TextProps, 'children' | 'color' | 'onPress'> & {
9
7
  /**
10
- * Required prop for the content to be rendered within the TextButton
8
+ * Content shown as the label.
11
9
  */
12
- children: string;
10
+ children: React.ReactNode;
13
11
  /**
14
- * Optional prop to control the size of the TextButton
15
- *
16
- * @default TextButtonSize.BodyMd
12
+ * Called when the user presses the label. Primary interaction for this control.
17
13
  */
18
- size?: TextButtonSize;
19
- /**
20
- * Optional props to be passed to the Text component when children is a string
21
- */
22
- textProps?: Omit<Partial<TextProps>, 'children'>;
23
- /**
24
- * Optional prop to specify an icon to show at the start of the button
25
- */
26
- startIconName?: IconName;
27
- /**
28
- * Optional prop to pass additional properties to the start icon
29
- */
30
- startIconProps?: Partial<IconProps>;
31
- /**
32
- * Optional prop for a custom element to show at the start of the button
33
- */
34
- startAccessory?: React.ReactNode;
35
- /**
36
- * Optional prop to specify an icon to show at the end of the button
37
- */
38
- endIconName?: IconName;
39
- /**
40
- * Optional prop to pass additional properties to the end icon
41
- */
42
- endIconProps?: Partial<IconProps>;
43
- /**
44
- * Optional prop for a custom element to show at the end of the button
45
- */
46
- endAccessory?: React.ReactNode;
47
- /**
48
- * Optional prop that when true, disables the button
49
- *
50
- * @default false
51
- */
52
- isDisabled?: boolean;
53
- /**
54
- * Optional prop to show the inverse state of the button, which is reserved for buttons on colored backgrounds.
55
- *
56
- * @default false
57
- */
58
- isInverse?: boolean;
59
- /**
60
- * Optional prop to add twrnc overriding classNames.
61
- */
62
- twClassName?: string;
63
- /**
64
- * Optional prop to control the style.
65
- */
66
- style?: StyleProp<ViewStyle>;
67
- } & Omit<PressableProps, 'disabled'>;
14
+ onPress?: TextProps['onPress'];
15
+ };
68
16
  //# sourceMappingURL=TextButton.types.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextButton.types.d.mts","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAEzE,OAAO,KAAK,EAAE,cAAc,EAAE,8BAAoB;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,0BAAgB;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IACjD;;OAEG;IACH,aAAa,CAAC,EAAE,QAAQ,CAAC;IACzB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IACpC;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC;;OAEG;IACH,WAAW,CAAC,EAAE,QAAQ,CAAC;IACvB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAClC;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,GAAG,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC"}
1
+ {"version":3,"file":"TextButton.types.d.mts","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,SAAS,EACT,UAAU,GAAG,OAAO,GAAG,SAAS,CACjC,GAAG;IACF;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAChC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TextButton.types.mjs","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { PressableProps, StyleProp, ViewStyle } from 'react-native';\n\nimport type { TextButtonSize } from '../../types';\nimport type { IconProps, IconName } from '../Icon';\nimport type { TextProps } from '../Text';\n\n/**\n * TextButton component props.\n */\nexport type TextButtonProps = {\n /**\n * Required prop for the content to be rendered within the TextButton\n */\n children: string;\n /**\n * Optional prop to control the size of the TextButton\n *\n * @default TextButtonSize.BodyMd\n */\n size?: TextButtonSize;\n /**\n * Optional props to be passed to the Text component when children is a string\n */\n textProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional prop to specify an icon to show at the start of the button\n */\n startIconName?: IconName;\n /**\n * Optional prop to pass additional properties to the start icon\n */\n startIconProps?: Partial<IconProps>;\n /**\n * Optional prop for a custom element to show at the start of the button\n */\n startAccessory?: React.ReactNode;\n /**\n * Optional prop to specify an icon to show at the end of the button\n */\n endIconName?: IconName;\n /**\n * Optional prop to pass additional properties to the end icon\n */\n endIconProps?: Partial<IconProps>;\n /**\n * Optional prop for a custom element to show at the end of the button\n */\n endAccessory?: React.ReactNode;\n /**\n * Optional prop that when true, disables the button\n *\n * @default false\n */\n isDisabled?: boolean;\n /**\n * Optional prop to show the inverse state of the button, which is reserved for buttons on colored backgrounds.\n *\n * @default false\n */\n isInverse?: boolean;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n /**\n * Optional prop to control the style.\n */\n style?: StyleProp<ViewStyle>;\n} & Omit<PressableProps, 'disabled'>;\n"]}
1
+ {"version":3,"file":"TextButton.types.mjs","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextProps } from '../Text';\n\n/**\n * Props for `TextButton`, a text-only control for links and inline actions.\n * Extends {@link Text} props.\n */\nexport type TextButtonProps = Omit<\n TextProps,\n 'children' | 'color' | 'onPress'\n> & {\n /**\n * Content shown as the label.\n */\n children: React.ReactNode;\n /**\n * Called when the user presses the label. Primary interaction for this control.\n */\n onPress?: TextProps['onPress'];\n};\n"]}
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TextButton = exports.TextButtonSize = void 0;
4
- var types_1 = require("../../types/index.cjs");
5
- Object.defineProperty(exports, "TextButtonSize", { enumerable: true, get: function () { return types_1.TextButtonSize; } });
3
+ exports.TextButton = void 0;
6
4
  var TextButton_1 = require("./TextButton.cjs");
7
5
  Object.defineProperty(exports, "TextButton", { enumerable: true, get: function () { return TextButton_1.TextButton; } });
8
6
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/TextButton/index.ts"],"names":[],"mappings":";;;AAAA,+CAA6C;AAApC,uGAAA,cAAc,OAAA;AACvB,+CAA0C;AAAjC,wGAAA,UAAU,OAAA","sourcesContent":["export { TextButtonSize } from '../../types';\nexport { TextButton } from './TextButton';\nexport type { TextButtonProps } from './TextButton.types';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/TextButton/index.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAAjC,wGAAA,UAAU,OAAA","sourcesContent":["export { TextButton } from './TextButton';\nexport type { TextButtonProps } from './TextButton.types';\n"]}
@@ -1,4 +1,3 @@
1
- export { TextButtonSize } from "../../types/index.cjs";
2
1
  export { TextButton } from "./TextButton.cjs";
3
2
  export type { TextButtonProps } from "./TextButton.types.cjs";
4
3
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/TextButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,8BAAoB;AAC7C,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/TextButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
@@ -1,4 +1,3 @@
1
- export { TextButtonSize } from "../../types/index.mjs";
2
1
  export { TextButton } from "./TextButton.mjs";
3
2
  export type { TextButtonProps } from "./TextButton.types.mjs";
4
3
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/TextButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,8BAAoB;AAC7C,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/TextButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
@@ -1,3 +1,2 @@
1
- export { TextButtonSize } from "../../types/index.mjs";
2
1
  export { TextButton } from "./TextButton.mjs";
3
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/TextButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,8BAAoB;AAC7C,OAAO,EAAE,UAAU,EAAE,yBAAqB","sourcesContent":["export { TextButtonSize } from '../../types';\nexport { TextButton } from './TextButton';\nexport type { TextButtonProps } from './TextButton.types';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/TextButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,yBAAqB","sourcesContent":["export { TextButton } from './TextButton';\nexport type { TextButtonProps } from './TextButton.types';\n"]}