@metamask-previews/design-system-react 0.24.0-preview.a0fe3894 → 0.25.0-preview.1f40f69f

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 (148) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/dist/components/AvatarBase/AvatarBase.cjs +1 -1
  3. package/dist/components/AvatarBase/AvatarBase.cjs.map +1 -1
  4. package/dist/components/AvatarBase/AvatarBase.mjs +1 -1
  5. package/dist/components/AvatarBase/AvatarBase.mjs.map +1 -1
  6. package/dist/components/AvatarFavicon/AvatarFavicon.cjs +1 -1
  7. package/dist/components/AvatarFavicon/AvatarFavicon.cjs.map +1 -1
  8. package/dist/components/AvatarFavicon/AvatarFavicon.mjs +1 -1
  9. package/dist/components/AvatarFavicon/AvatarFavicon.mjs.map +1 -1
  10. package/dist/components/AvatarNetwork/AvatarNetwork.cjs +1 -1
  11. package/dist/components/AvatarNetwork/AvatarNetwork.cjs.map +1 -1
  12. package/dist/components/AvatarNetwork/AvatarNetwork.mjs +1 -1
  13. package/dist/components/AvatarNetwork/AvatarNetwork.mjs.map +1 -1
  14. package/dist/components/AvatarToken/AvatarToken.cjs +2 -2
  15. package/dist/components/AvatarToken/AvatarToken.cjs.map +1 -1
  16. package/dist/components/AvatarToken/AvatarToken.mjs +2 -2
  17. package/dist/components/AvatarToken/AvatarToken.mjs.map +1 -1
  18. package/dist/components/FormTextField/FormTextField.cjs +38 -0
  19. package/dist/components/FormTextField/FormTextField.cjs.map +1 -0
  20. package/dist/components/FormTextField/FormTextField.d.cts +4 -0
  21. package/dist/components/FormTextField/FormTextField.d.cts.map +1 -0
  22. package/dist/components/FormTextField/FormTextField.d.mts +4 -0
  23. package/dist/components/FormTextField/FormTextField.d.mts.map +1 -0
  24. package/dist/components/FormTextField/FormTextField.mjs +19 -0
  25. package/dist/components/FormTextField/FormTextField.mjs.map +1 -0
  26. package/dist/components/FormTextField/FormTextField.types.cjs +3 -0
  27. package/dist/components/FormTextField/FormTextField.types.cjs.map +1 -0
  28. package/dist/components/FormTextField/FormTextField.types.d.cts +50 -0
  29. package/dist/components/FormTextField/FormTextField.types.d.cts.map +1 -0
  30. package/dist/components/FormTextField/FormTextField.types.d.mts +50 -0
  31. package/dist/components/FormTextField/FormTextField.types.d.mts.map +1 -0
  32. package/dist/components/FormTextField/FormTextField.types.mjs +2 -0
  33. package/dist/components/FormTextField/FormTextField.types.mjs.map +1 -0
  34. package/dist/components/FormTextField/index.cjs +6 -0
  35. package/dist/components/FormTextField/index.cjs.map +1 -0
  36. package/dist/components/FormTextField/index.d.cts +3 -0
  37. package/dist/components/FormTextField/index.d.cts.map +1 -0
  38. package/dist/components/FormTextField/index.d.mts +3 -0
  39. package/dist/components/FormTextField/index.d.mts.map +1 -0
  40. package/dist/components/FormTextField/index.mjs +2 -0
  41. package/dist/components/FormTextField/index.mjs.map +1 -0
  42. package/dist/components/Popover/Popover.cjs +129 -0
  43. package/dist/components/Popover/Popover.cjs.map +1 -0
  44. package/dist/components/Popover/Popover.constants.cjs +28 -0
  45. package/dist/components/Popover/Popover.constants.cjs.map +1 -0
  46. package/dist/components/Popover/Popover.constants.d.cts +12 -0
  47. package/dist/components/Popover/Popover.constants.d.cts.map +1 -0
  48. package/dist/components/Popover/Popover.constants.d.mts +12 -0
  49. package/dist/components/Popover/Popover.constants.d.mts.map +1 -0
  50. package/dist/components/Popover/Popover.constants.mjs +25 -0
  51. package/dist/components/Popover/Popover.constants.mjs.map +1 -0
  52. package/dist/components/Popover/Popover.d.cts +4 -0
  53. package/dist/components/Popover/Popover.d.cts.map +1 -0
  54. package/dist/components/Popover/Popover.d.mts +4 -0
  55. package/dist/components/Popover/Popover.d.mts.map +1 -0
  56. package/dist/components/Popover/Popover.mjs +110 -0
  57. package/dist/components/Popover/Popover.mjs.map +1 -0
  58. package/dist/components/Popover/Popover.types.cjs +33 -0
  59. package/dist/components/Popover/Popover.types.cjs.map +1 -0
  60. package/dist/components/Popover/Popover.types.d.cts +128 -0
  61. package/dist/components/Popover/Popover.types.d.cts.map +1 -0
  62. package/dist/components/Popover/Popover.types.d.mts +128 -0
  63. package/dist/components/Popover/Popover.types.d.mts.map +1 -0
  64. package/dist/components/Popover/Popover.types.mjs +30 -0
  65. package/dist/components/Popover/Popover.types.mjs.map +1 -0
  66. package/dist/components/Popover/index.cjs +9 -0
  67. package/dist/components/Popover/index.cjs.map +1 -0
  68. package/dist/components/Popover/index.d.cts +4 -0
  69. package/dist/components/Popover/index.d.cts.map +1 -0
  70. package/dist/components/Popover/index.d.mts +4 -0
  71. package/dist/components/Popover/index.d.mts.map +1 -0
  72. package/dist/components/Popover/index.mjs +3 -0
  73. package/dist/components/Popover/index.mjs.map +1 -0
  74. package/dist/components/TextArea/TextArea.cjs +37 -0
  75. package/dist/components/TextArea/TextArea.cjs.map +1 -0
  76. package/dist/components/TextArea/TextArea.constants.cjs +35 -0
  77. package/dist/components/TextArea/TextArea.constants.cjs.map +1 -0
  78. package/dist/components/TextArea/TextArea.constants.d.cts +28 -0
  79. package/dist/components/TextArea/TextArea.constants.d.cts.map +1 -0
  80. package/dist/components/TextArea/TextArea.constants.d.mts +28 -0
  81. package/dist/components/TextArea/TextArea.constants.d.mts.map +1 -0
  82. package/dist/components/TextArea/TextArea.constants.mjs +32 -0
  83. package/dist/components/TextArea/TextArea.constants.mjs.map +1 -0
  84. package/dist/components/TextArea/TextArea.d.cts +9 -0
  85. package/dist/components/TextArea/TextArea.d.cts.map +1 -0
  86. package/dist/components/TextArea/TextArea.d.mts +9 -0
  87. package/dist/components/TextArea/TextArea.d.mts.map +1 -0
  88. package/dist/components/TextArea/TextArea.mjs +18 -0
  89. package/dist/components/TextArea/TextArea.mjs.map +1 -0
  90. package/dist/components/TextArea/TextArea.types.cjs +3 -0
  91. package/dist/components/TextArea/TextArea.types.cjs.map +1 -0
  92. package/dist/components/TextArea/TextArea.types.d.cts +33 -0
  93. package/dist/components/TextArea/TextArea.types.d.cts.map +1 -0
  94. package/dist/components/TextArea/TextArea.types.d.mts +33 -0
  95. package/dist/components/TextArea/TextArea.types.d.mts.map +1 -0
  96. package/dist/components/TextArea/TextArea.types.mjs +2 -0
  97. package/dist/components/TextArea/TextArea.types.mjs.map +1 -0
  98. package/dist/components/TextArea/index.cjs +8 -0
  99. package/dist/components/TextArea/index.cjs.map +1 -0
  100. package/dist/components/TextArea/index.d.cts +4 -0
  101. package/dist/components/TextArea/index.d.cts.map +1 -0
  102. package/dist/components/TextArea/index.d.mts +4 -0
  103. package/dist/components/TextArea/index.d.mts.map +1 -0
  104. package/dist/components/TextArea/index.mjs +3 -0
  105. package/dist/components/TextArea/index.mjs.map +1 -0
  106. package/dist/components/TextFieldSearch/TextFieldSearch.cjs +40 -0
  107. package/dist/components/TextFieldSearch/TextFieldSearch.cjs.map +1 -0
  108. package/dist/components/TextFieldSearch/TextFieldSearch.d.cts +6 -0
  109. package/dist/components/TextFieldSearch/TextFieldSearch.d.cts.map +1 -0
  110. package/dist/components/TextFieldSearch/TextFieldSearch.d.mts +6 -0
  111. package/dist/components/TextFieldSearch/TextFieldSearch.d.mts.map +1 -0
  112. package/dist/components/TextFieldSearch/TextFieldSearch.mjs +21 -0
  113. package/dist/components/TextFieldSearch/TextFieldSearch.mjs.map +1 -0
  114. package/dist/components/TextFieldSearch/TextFieldSearch.types.cjs +3 -0
  115. package/dist/components/TextFieldSearch/TextFieldSearch.types.cjs.map +1 -0
  116. package/dist/components/TextFieldSearch/TextFieldSearch.types.d.cts +17 -0
  117. package/dist/components/TextFieldSearch/TextFieldSearch.types.d.cts.map +1 -0
  118. package/dist/components/TextFieldSearch/TextFieldSearch.types.d.mts +17 -0
  119. package/dist/components/TextFieldSearch/TextFieldSearch.types.d.mts.map +1 -0
  120. package/dist/components/TextFieldSearch/TextFieldSearch.types.mjs +2 -0
  121. package/dist/components/TextFieldSearch/TextFieldSearch.types.mjs.map +1 -0
  122. package/dist/components/TextFieldSearch/index.cjs +6 -0
  123. package/dist/components/TextFieldSearch/index.cjs.map +1 -0
  124. package/dist/components/TextFieldSearch/index.d.cts +3 -0
  125. package/dist/components/TextFieldSearch/index.d.cts.map +1 -0
  126. package/dist/components/TextFieldSearch/index.d.mts +3 -0
  127. package/dist/components/TextFieldSearch/index.d.mts.map +1 -0
  128. package/dist/components/TextFieldSearch/index.mjs +2 -0
  129. package/dist/components/TextFieldSearch/index.mjs.map +1 -0
  130. package/dist/components/Toast/Toast.cjs +1 -1
  131. package/dist/components/Toast/Toast.cjs.map +1 -1
  132. package/dist/components/Toast/Toast.mjs +1 -1
  133. package/dist/components/Toast/Toast.mjs.map +1 -1
  134. package/dist/components/Toast/Toaster.cjs +75 -39
  135. package/dist/components/Toast/Toaster.cjs.map +1 -1
  136. package/dist/components/Toast/Toaster.d.cts.map +1 -1
  137. package/dist/components/Toast/Toaster.d.mts.map +1 -1
  138. package/dist/components/Toast/Toaster.mjs +76 -40
  139. package/dist/components/Toast/Toaster.mjs.map +1 -1
  140. package/dist/components/index.cjs +13 -1
  141. package/dist/components/index.cjs.map +1 -1
  142. package/dist/components/index.d.cts +8 -0
  143. package/dist/components/index.d.cts.map +1 -1
  144. package/dist/components/index.d.mts +8 -0
  145. package/dist/components/index.d.mts.map +1 -1
  146. package/dist/components/index.mjs +4 -0
  147. package/dist/components/index.mjs.map +1 -1
  148. package/package.json +6 -5
@@ -0,0 +1,128 @@
1
+ import type { ComponentProps, CSSProperties, ReactNode } from "react";
2
+ /**
3
+ * Popover - placement of the floating element relative to the reference element.
4
+ * Mirrors the placements supported by `react-popper` (`Auto` enables both
5
+ * `flip` and `preventOverflow` automatically).
6
+ */
7
+ export declare const PopoverPosition: {
8
+ readonly Auto: "auto";
9
+ readonly Top: "top";
10
+ readonly TopStart: "top-start";
11
+ readonly TopEnd: "top-end";
12
+ readonly Right: "right";
13
+ readonly RightStart: "right-start";
14
+ readonly RightEnd: "right-end";
15
+ readonly Bottom: "bottom";
16
+ readonly BottomStart: "bottom-start";
17
+ readonly BottomEnd: "bottom-end";
18
+ readonly Left: "left";
19
+ readonly LeftStart: "left-start";
20
+ readonly LeftEnd: "left-end";
21
+ };
22
+ export type PopoverPosition = (typeof PopoverPosition)[keyof typeof PopoverPosition];
23
+ /**
24
+ * Popover - ARIA role for the floating element.
25
+ * Use `Dialog` when the contents are interactive, `Tooltip` for purely
26
+ * informational content.
27
+ */
28
+ export declare const PopoverRole: {
29
+ readonly Tooltip: "tooltip";
30
+ readonly Dialog: "dialog";
31
+ };
32
+ export type PopoverRole = (typeof PopoverRole)[keyof typeof PopoverRole];
33
+ export type PopoverProps = Omit<ComponentProps<'div'>, 'role'> & {
34
+ /**
35
+ * The contents of the Popover.
36
+ */
37
+ children?: ReactNode;
38
+ /**
39
+ * Additional class names to merge onto the Popover root.
40
+ */
41
+ className?: string;
42
+ /**
43
+ * Inline styles applied to the Popover root. Merged after the styles
44
+ * computed by `react-popper`.
45
+ */
46
+ style?: CSSProperties;
47
+ /**
48
+ * Placement relative to `referenceElement`. When `PopoverPosition.Auto`,
49
+ * `flip` and `preventOverflow` are forced on regardless of their props.
50
+ *
51
+ * @default PopoverPosition.Auto
52
+ */
53
+ position?: PopoverPosition;
54
+ /**
55
+ * ARIA role applied to the Popover root.
56
+ *
57
+ * @default PopoverRole.Tooltip
58
+ */
59
+ role?: PopoverRole;
60
+ /**
61
+ * Render an arrow pointing at the reference element.
62
+ *
63
+ * @default false
64
+ */
65
+ hasArrow?: boolean;
66
+ /**
67
+ * Props forwarded to the arrow element. `ref`, `style`, and `children` are
68
+ * reserved for internal use (popper positioning, rotation styles, and the
69
+ * arrow visual) and cannot be overridden.
70
+ */
71
+ arrowProps?: Omit<ComponentProps<'div'>, 'ref' | 'style' | 'children'>;
72
+ /**
73
+ * Match the popover width to the reference element's `clientWidth`.
74
+ *
75
+ * @default false
76
+ */
77
+ matchWidth?: boolean;
78
+ /**
79
+ * Keep the Popover within the viewport. Forced on when
80
+ * `position === PopoverPosition.Auto`.
81
+ *
82
+ * @default false
83
+ */
84
+ preventOverflow?: boolean;
85
+ /**
86
+ * Allow flipping to the opposite side when there is not enough space.
87
+ * Forced on when `position === PopoverPosition.Auto`.
88
+ *
89
+ * @default false
90
+ */
91
+ flip?: boolean;
92
+ /**
93
+ * Hide the Popover when the reference element is scrolled out of view.
94
+ *
95
+ * @default true
96
+ */
97
+ referenceHidden?: boolean;
98
+ /**
99
+ * The element the Popover is positioned against.
100
+ */
101
+ referenceElement?: HTMLElement | null;
102
+ /**
103
+ * Whether the Popover is open. Nothing is rendered when `false`.
104
+ */
105
+ isOpen?: boolean;
106
+ /**
107
+ * `[skidding, distance]` offset (in px) applied to the Popover.
108
+ *
109
+ * @default [0, 8]
110
+ */
111
+ offset?: [number, number];
112
+ /**
113
+ * Render the Popover into `document.body` via `createPortal`.
114
+ *
115
+ * @default false
116
+ */
117
+ isPortal?: boolean;
118
+ /**
119
+ * Called when the user presses the Escape key while the Popover is open.
120
+ */
121
+ onPressEscKey?: () => void;
122
+ /**
123
+ * Called when the user clicks outside the Popover and the reference element
124
+ * while the Popover is open.
125
+ */
126
+ onClickOutside?: () => void;
127
+ };
128
+ //# sourceMappingURL=Popover.types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Popover.types.d.mts","sourceRoot":"","sources":["../../../src/components/Popover/Popover.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc;AAEtE;;;;GAIG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;CAclB,CAAC;AACX,MAAM,MAAM,eAAe,GACzB,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAEzD;;;;GAIG;AACH,eAAO,MAAM,WAAW;;;CAGd,CAAC;AACX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAEzE,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,GAAG;IAC/D;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B;;;;OAIG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,UAAU,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,UAAU,CAAC,CAAC;IACvE;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,gBAAgB,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACtC;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC7B,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Popover - placement of the floating element relative to the reference element.
3
+ * Mirrors the placements supported by `react-popper` (`Auto` enables both
4
+ * `flip` and `preventOverflow` automatically).
5
+ */
6
+ export const PopoverPosition = {
7
+ Auto: 'auto',
8
+ Top: 'top',
9
+ TopStart: 'top-start',
10
+ TopEnd: 'top-end',
11
+ Right: 'right',
12
+ RightStart: 'right-start',
13
+ RightEnd: 'right-end',
14
+ Bottom: 'bottom',
15
+ BottomStart: 'bottom-start',
16
+ BottomEnd: 'bottom-end',
17
+ Left: 'left',
18
+ LeftStart: 'left-start',
19
+ LeftEnd: 'left-end',
20
+ };
21
+ /**
22
+ * Popover - ARIA role for the floating element.
23
+ * Use `Dialog` when the contents are interactive, `Tooltip` for purely
24
+ * informational content.
25
+ */
26
+ export const PopoverRole = {
27
+ Tooltip: 'tooltip',
28
+ Dialog: 'dialog',
29
+ };
30
+ //# sourceMappingURL=Popover.types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Popover.types.mjs","sourceRoot":"","sources":["../../../src/components/Popover/Popover.types.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,QAAQ,EAAE,WAAW;IACrB,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,OAAO;IACd,UAAU,EAAE,aAAa;IACzB,QAAQ,EAAE,WAAW;IACrB,MAAM,EAAE,QAAQ;IAChB,WAAW,EAAE,cAAc;IAC3B,SAAS,EAAE,YAAY;IACvB,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,YAAY;IACvB,OAAO,EAAE,UAAU;CACX,CAAC;AAIX;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;CACR,CAAC","sourcesContent":["import type { ComponentProps, CSSProperties, ReactNode } from 'react';\n\n/**\n * Popover - placement of the floating element relative to the reference element.\n * Mirrors the placements supported by `react-popper` (`Auto` enables both\n * `flip` and `preventOverflow` automatically).\n */\nexport const PopoverPosition = {\n Auto: 'auto',\n Top: 'top',\n TopStart: 'top-start',\n TopEnd: 'top-end',\n Right: 'right',\n RightStart: 'right-start',\n RightEnd: 'right-end',\n Bottom: 'bottom',\n BottomStart: 'bottom-start',\n BottomEnd: 'bottom-end',\n Left: 'left',\n LeftStart: 'left-start',\n LeftEnd: 'left-end',\n} as const;\nexport type PopoverPosition =\n (typeof PopoverPosition)[keyof typeof PopoverPosition];\n\n/**\n * Popover - ARIA role for the floating element.\n * Use `Dialog` when the contents are interactive, `Tooltip` for purely\n * informational content.\n */\nexport const PopoverRole = {\n Tooltip: 'tooltip',\n Dialog: 'dialog',\n} as const;\nexport type PopoverRole = (typeof PopoverRole)[keyof typeof PopoverRole];\n\nexport type PopoverProps = Omit<ComponentProps<'div'>, 'role'> & {\n /**\n * The contents of the Popover.\n */\n children?: ReactNode;\n /**\n * Additional class names to merge onto the Popover root.\n */\n className?: string;\n /**\n * Inline styles applied to the Popover root. Merged after the styles\n * computed by `react-popper`.\n */\n style?: CSSProperties;\n /**\n * Placement relative to `referenceElement`. When `PopoverPosition.Auto`,\n * `flip` and `preventOverflow` are forced on regardless of their props.\n *\n * @default PopoverPosition.Auto\n */\n position?: PopoverPosition;\n /**\n * ARIA role applied to the Popover root.\n *\n * @default PopoverRole.Tooltip\n */\n role?: PopoverRole;\n /**\n * Render an arrow pointing at the reference element.\n *\n * @default false\n */\n hasArrow?: boolean;\n /**\n * Props forwarded to the arrow element. `ref`, `style`, and `children` are\n * reserved for internal use (popper positioning, rotation styles, and the\n * arrow visual) and cannot be overridden.\n */\n arrowProps?: Omit<ComponentProps<'div'>, 'ref' | 'style' | 'children'>;\n /**\n * Match the popover width to the reference element's `clientWidth`.\n *\n * @default false\n */\n matchWidth?: boolean;\n /**\n * Keep the Popover within the viewport. Forced on when\n * `position === PopoverPosition.Auto`.\n *\n * @default false\n */\n preventOverflow?: boolean;\n /**\n * Allow flipping to the opposite side when there is not enough space.\n * Forced on when `position === PopoverPosition.Auto`.\n *\n * @default false\n */\n flip?: boolean;\n /**\n * Hide the Popover when the reference element is scrolled out of view.\n *\n * @default true\n */\n referenceHidden?: boolean;\n /**\n * The element the Popover is positioned against.\n */\n referenceElement?: HTMLElement | null;\n /**\n * Whether the Popover is open. Nothing is rendered when `false`.\n */\n isOpen?: boolean;\n /**\n * `[skidding, distance]` offset (in px) applied to the Popover.\n *\n * @default [0, 8]\n */\n offset?: [number, number];\n /**\n * Render the Popover into `document.body` via `createPortal`.\n *\n * @default false\n */\n isPortal?: boolean;\n /**\n * Called when the user presses the Escape key while the Popover is open.\n */\n onPressEscKey?: () => void;\n /**\n * Called when the user clicks outside the Popover and the reference element\n * while the Popover is open.\n */\n onClickOutside?: () => void;\n};\n"]}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PopoverRole = exports.PopoverPosition = exports.Popover = void 0;
4
+ var Popover_1 = require("./Popover.cjs");
5
+ Object.defineProperty(exports, "Popover", { enumerable: true, get: function () { return Popover_1.Popover; } });
6
+ var Popover_types_1 = require("./Popover.types.cjs");
7
+ Object.defineProperty(exports, "PopoverPosition", { enumerable: true, get: function () { return Popover_types_1.PopoverPosition; } });
8
+ Object.defineProperty(exports, "PopoverRole", { enumerable: true, get: function () { return Popover_types_1.PopoverRole; } });
9
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/Popover/index.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAChB,qDAA+D;AAAtD,gHAAA,eAAe,OAAA;AAAE,4GAAA,WAAW,OAAA","sourcesContent":["export { Popover } from './Popover';\nexport { PopoverPosition, PopoverRole } from './Popover.types';\nexport type { PopoverProps } from './Popover.types';\n"]}
@@ -0,0 +1,4 @@
1
+ export { Popover } from "./Popover.cjs";
2
+ export { PopoverPosition, PopoverRole } from "./Popover.types.cjs";
3
+ export type { PopoverProps } from "./Popover.types.cjs";
4
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Popover/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,sBAAkB;AACpC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,4BAAwB;AAC/D,YAAY,EAAE,YAAY,EAAE,4BAAwB"}
@@ -0,0 +1,4 @@
1
+ export { Popover } from "./Popover.mjs";
2
+ export { PopoverPosition, PopoverRole } from "./Popover.types.mjs";
3
+ export type { PopoverProps } from "./Popover.types.mjs";
4
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/Popover/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,sBAAkB;AACpC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,4BAAwB;AAC/D,YAAY,EAAE,YAAY,EAAE,4BAAwB"}
@@ -0,0 +1,3 @@
1
+ export { Popover } from "./Popover.mjs";
2
+ export { PopoverPosition, PopoverRole } from "./Popover.types.mjs";
3
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/Popover/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,sBAAkB;AACpC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,4BAAwB","sourcesContent":["export { Popover } from './Popover';\nexport { PopoverPosition, PopoverRole } from './Popover.types';\nexport type { PopoverProps } from './Popover.types';\n"]}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.TextArea = void 0;
27
+ const react_1 = __importStar(require("react"));
28
+ const tw_merge_1 = require("../../utils/tw-merge.cjs");
29
+ const TextArea_constants_1 = require("./TextArea.constants.cjs");
30
+ exports.TextArea = (0, react_1.forwardRef)(({ value, placeholder, autoFocus = false, isDisabled = false, isReadOnly = false, isError = false, onBlur, onChange, onFocus, resize = TextArea_constants_1.TextAreaResize.None, className, ...props }, ref) => {
31
+ const textAreaClassName = (0, tw_merge_1.twMerge)('m-0 block min-h-24 w-full rounded-lg border bg-muted px-4 py-3 text-default outline-none transition-colors', 'text-s-body-md font-regular leading-s-body-md tracking-s-body-md md:text-l-body-md md:leading-l-body-md md:tracking-l-body-md', 'placeholder:text-alternative', TextArea_constants_1.CLASSMAP_TEXTAREA_RESIZE[resize], 'border-muted', isDisabled && 'cursor-not-allowed border-muted opacity-50', !isDisabled && isError && 'border-error-default', !isDisabled &&
32
+ !isError &&
33
+ 'focus:border-default read-only:focus:border-muted', className);
34
+ return (react_1.default.createElement("textarea", { ...props, ref: ref, value: value, placeholder: placeholder, className: textAreaClassName, disabled: isDisabled, readOnly: isReadOnly, autoFocus: autoFocus, "aria-invalid": isError || undefined, onChange: onChange, onFocus: onFocus, onBlur: onBlur }));
35
+ });
36
+ exports.TextArea.displayName = 'TextArea';
37
+ //# sourceMappingURL=TextArea.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextArea.cjs","sourceRoot":"","sources":["../../../src/components/TextArea/TextArea.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAE1C,uDAA+C;AAE/C,iEAAgF;AAGnE,QAAA,QAAQ,GAAG,IAAA,kBAAU,EAChC,CACE,EACE,KAAK,EACL,WAAW,EACX,SAAS,GAAG,KAAK,EACjB,UAAU,GAAG,KAAK,EAClB,UAAU,GAAG,KAAK,EAClB,OAAO,GAAG,KAAK,EACf,MAAM,EACN,QAAQ,EACR,OAAO,EACP,MAAM,GAAG,mCAAc,CAAC,IAAI,EAC5B,SAAS,EACT,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,iBAAiB,GAAG,IAAA,kBAAO,EAC/B,4GAA4G,EAC5G,+HAA+H,EAC/H,8BAA8B,EAC9B,6CAAwB,CAAC,MAAM,CAAC,EAChC,cAAc,EACd,UAAU,IAAI,4CAA4C,EAC1D,CAAC,UAAU,IAAI,OAAO,IAAI,sBAAsB,EAChD,CAAC,UAAU;QACT,CAAC,OAAO;QACR,mDAAmD,EACrD,SAAS,CACV,CAAC;IAEF,OAAO,CACL,+CACM,KAAK,EACT,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,iBAAiB,EAC5B,QAAQ,EAAE,UAAU,EACpB,QAAQ,EAAE,UAAU,EACpB,SAAS,EAAE,SAAS,kBACN,OAAO,IAAI,SAAS,EAClC,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,GACd,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAQ,CAAC,WAAW,GAAG,UAAU,CAAC","sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { twMerge } from '../../utils/tw-merge';\n\nimport { CLASSMAP_TEXTAREA_RESIZE, TextAreaResize } from './TextArea.constants';\nimport type { TextAreaProps } from './TextArea.types';\n\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n (\n {\n value,\n placeholder,\n autoFocus = false,\n isDisabled = false,\n isReadOnly = false,\n isError = false,\n onBlur,\n onChange,\n onFocus,\n resize = TextAreaResize.None,\n className,\n ...props\n },\n ref,\n ) => {\n const textAreaClassName = twMerge(\n 'm-0 block min-h-24 w-full rounded-lg border bg-muted px-4 py-3 text-default outline-none transition-colors',\n 'text-s-body-md font-regular leading-s-body-md tracking-s-body-md md:text-l-body-md md:leading-l-body-md md:tracking-l-body-md',\n 'placeholder:text-alternative',\n CLASSMAP_TEXTAREA_RESIZE[resize],\n 'border-muted',\n isDisabled && 'cursor-not-allowed border-muted opacity-50',\n !isDisabled && isError && 'border-error-default',\n !isDisabled &&\n !isError &&\n 'focus:border-default read-only:focus:border-muted',\n className,\n );\n\n return (\n <textarea\n {...props}\n ref={ref}\n value={value}\n placeholder={placeholder}\n className={textAreaClassName}\n disabled={isDisabled}\n readOnly={isReadOnly}\n autoFocus={autoFocus}\n aria-invalid={isError || undefined}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={onBlur}\n />\n );\n },\n);\n\nTextArea.displayName = 'TextArea';\n"]}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CLASSMAP_TEXTAREA_RESIZE = exports.TextAreaResize = void 0;
4
+ /**
5
+ * TextAreaResize - resize
6
+ * Controls the resize behavior of the textarea element.
7
+ */
8
+ exports.TextAreaResize = {
9
+ /**
10
+ * The textarea cannot be resized.
11
+ */
12
+ None: 'none',
13
+ /**
14
+ * The textarea can be resized both horizontally and vertically.
15
+ */
16
+ Both: 'both',
17
+ /**
18
+ * The textarea can only be resized horizontally.
19
+ */
20
+ Horizontal: 'horizontal',
21
+ /**
22
+ * The textarea can only be resized vertically.
23
+ */
24
+ Vertical: 'vertical',
25
+ };
26
+ /**
27
+ * Maps TextAreaResize values to Tailwind CSS resize classes.
28
+ */
29
+ exports.CLASSMAP_TEXTAREA_RESIZE = {
30
+ [exports.TextAreaResize.None]: 'resize-none',
31
+ [exports.TextAreaResize.Both]: 'resize',
32
+ [exports.TextAreaResize.Horizontal]: 'resize-x',
33
+ [exports.TextAreaResize.Vertical]: 'resize-y',
34
+ };
35
+ //# sourceMappingURL=TextArea.constants.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextArea.constants.cjs","sourceRoot":"","sources":["../../../src/components/TextArea/TextArea.constants.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACU,QAAA,cAAc,GAAG;IAC5B;;OAEG;IACH,IAAI,EAAE,MAAM;IACZ;;OAEG;IACH,IAAI,EAAE,MAAM;IACZ;;OAEG;IACH,UAAU,EAAE,YAAY;IACxB;;OAEG;IACH,QAAQ,EAAE,UAAU;CACZ,CAAC;AAIX;;GAEG;AACU,QAAA,wBAAwB,GAAmC;IACtE,CAAC,sBAAc,CAAC,IAAI,CAAC,EAAE,aAAa;IACpC,CAAC,sBAAc,CAAC,IAAI,CAAC,EAAE,QAAQ;IAC/B,CAAC,sBAAc,CAAC,UAAU,CAAC,EAAE,UAAU;IACvC,CAAC,sBAAc,CAAC,QAAQ,CAAC,EAAE,UAAU;CACtC,CAAC","sourcesContent":["/**\n * TextAreaResize - resize\n * Controls the resize behavior of the textarea element.\n */\nexport const TextAreaResize = {\n /**\n * The textarea cannot be resized.\n */\n None: 'none',\n /**\n * The textarea can be resized both horizontally and vertically.\n */\n Both: 'both',\n /**\n * The textarea can only be resized horizontally.\n */\n Horizontal: 'horizontal',\n /**\n * The textarea can only be resized vertically.\n */\n Vertical: 'vertical',\n} as const;\nexport type TextAreaResize =\n (typeof TextAreaResize)[keyof typeof TextAreaResize];\n\n/**\n * Maps TextAreaResize values to Tailwind CSS resize classes.\n */\nexport const CLASSMAP_TEXTAREA_RESIZE: Record<TextAreaResize, string> = {\n [TextAreaResize.None]: 'resize-none',\n [TextAreaResize.Both]: 'resize',\n [TextAreaResize.Horizontal]: 'resize-x',\n [TextAreaResize.Vertical]: 'resize-y',\n};\n"]}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * TextAreaResize - resize
3
+ * Controls the resize behavior of the textarea element.
4
+ */
5
+ export declare const TextAreaResize: {
6
+ /**
7
+ * The textarea cannot be resized.
8
+ */
9
+ readonly None: "none";
10
+ /**
11
+ * The textarea can be resized both horizontally and vertically.
12
+ */
13
+ readonly Both: "both";
14
+ /**
15
+ * The textarea can only be resized horizontally.
16
+ */
17
+ readonly Horizontal: "horizontal";
18
+ /**
19
+ * The textarea can only be resized vertically.
20
+ */
21
+ readonly Vertical: "vertical";
22
+ };
23
+ export type TextAreaResize = (typeof TextAreaResize)[keyof typeof TextAreaResize];
24
+ /**
25
+ * Maps TextAreaResize values to Tailwind CSS resize classes.
26
+ */
27
+ export declare const CLASSMAP_TEXTAREA_RESIZE: Record<TextAreaResize, string>;
28
+ //# sourceMappingURL=TextArea.constants.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextArea.constants.d.cts","sourceRoot":"","sources":["../../../src/components/TextArea/TextArea.constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,cAAc;IACzB;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;CAEK,CAAC;AACX,MAAM,MAAM,cAAc,GACxB,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAKnE,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * TextAreaResize - resize
3
+ * Controls the resize behavior of the textarea element.
4
+ */
5
+ export declare const TextAreaResize: {
6
+ /**
7
+ * The textarea cannot be resized.
8
+ */
9
+ readonly None: "none";
10
+ /**
11
+ * The textarea can be resized both horizontally and vertically.
12
+ */
13
+ readonly Both: "both";
14
+ /**
15
+ * The textarea can only be resized horizontally.
16
+ */
17
+ readonly Horizontal: "horizontal";
18
+ /**
19
+ * The textarea can only be resized vertically.
20
+ */
21
+ readonly Vertical: "vertical";
22
+ };
23
+ export type TextAreaResize = (typeof TextAreaResize)[keyof typeof TextAreaResize];
24
+ /**
25
+ * Maps TextAreaResize values to Tailwind CSS resize classes.
26
+ */
27
+ export declare const CLASSMAP_TEXTAREA_RESIZE: Record<TextAreaResize, string>;
28
+ //# sourceMappingURL=TextArea.constants.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextArea.constants.d.mts","sourceRoot":"","sources":["../../../src/components/TextArea/TextArea.constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,cAAc;IACzB;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;CAEK,CAAC;AACX,MAAM,MAAM,cAAc,GACxB,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAKnE,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * TextAreaResize - resize
3
+ * Controls the resize behavior of the textarea element.
4
+ */
5
+ export const TextAreaResize = {
6
+ /**
7
+ * The textarea cannot be resized.
8
+ */
9
+ None: 'none',
10
+ /**
11
+ * The textarea can be resized both horizontally and vertically.
12
+ */
13
+ Both: 'both',
14
+ /**
15
+ * The textarea can only be resized horizontally.
16
+ */
17
+ Horizontal: 'horizontal',
18
+ /**
19
+ * The textarea can only be resized vertically.
20
+ */
21
+ Vertical: 'vertical',
22
+ };
23
+ /**
24
+ * Maps TextAreaResize values to Tailwind CSS resize classes.
25
+ */
26
+ export const CLASSMAP_TEXTAREA_RESIZE = {
27
+ [TextAreaResize.None]: 'resize-none',
28
+ [TextAreaResize.Both]: 'resize',
29
+ [TextAreaResize.Horizontal]: 'resize-x',
30
+ [TextAreaResize.Vertical]: 'resize-y',
31
+ };
32
+ //# sourceMappingURL=TextArea.constants.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextArea.constants.mjs","sourceRoot":"","sources":["../../../src/components/TextArea/TextArea.constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B;;OAEG;IACH,IAAI,EAAE,MAAM;IACZ;;OAEG;IACH,IAAI,EAAE,MAAM;IACZ;;OAEG;IACH,UAAU,EAAE,YAAY;IACxB;;OAEG;IACH,QAAQ,EAAE,UAAU;CACZ,CAAC;AAIX;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAmC;IACtE,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,aAAa;IACpC,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,QAAQ;IAC/B,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,UAAU;IACvC,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,UAAU;CACtC,CAAC","sourcesContent":["/**\n * TextAreaResize - resize\n * Controls the resize behavior of the textarea element.\n */\nexport const TextAreaResize = {\n /**\n * The textarea cannot be resized.\n */\n None: 'none',\n /**\n * The textarea can be resized both horizontally and vertically.\n */\n Both: 'both',\n /**\n * The textarea can only be resized horizontally.\n */\n Horizontal: 'horizontal',\n /**\n * The textarea can only be resized vertically.\n */\n Vertical: 'vertical',\n} as const;\nexport type TextAreaResize =\n (typeof TextAreaResize)[keyof typeof TextAreaResize];\n\n/**\n * Maps TextAreaResize values to Tailwind CSS resize classes.\n */\nexport const CLASSMAP_TEXTAREA_RESIZE: Record<TextAreaResize, string> = {\n [TextAreaResize.None]: 'resize-none',\n [TextAreaResize.Both]: 'resize',\n [TextAreaResize.Horizontal]: 'resize-x',\n [TextAreaResize.Vertical]: 'resize-y',\n};\n"]}
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import { TextAreaResize } from "./TextArea.constants.cjs";
3
+ export declare const TextArea: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref">, "value" | "disabled" | "placeholder" | "readOnly" | "defaultValue" | "autoFocus" | "onFocus" | "onBlur" | "onChange"> & Omit<import("@metamask-previews/design-system-shared").TextAreaPropsShared, "textVariant"> & {
4
+ resize?: TextAreaResize | undefined;
5
+ onChange?: ((event: React.ChangeEvent<HTMLTextAreaElement, Element>) => void) | undefined;
6
+ onFocus?: ((event: React.FocusEvent<HTMLTextAreaElement, Element>) => void) | undefined;
7
+ onBlur?: ((event: React.FocusEvent<HTMLTextAreaElement, Element>) => void) | undefined;
8
+ } & React.RefAttributes<HTMLTextAreaElement>>;
9
+ //# sourceMappingURL=TextArea.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextArea.d.cts","sourceRoot":"","sources":["../../../src/components/TextArea/TextArea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,cAAc;AAI1C,OAAO,EAA4B,cAAc,EAAE,iCAA6B;AAGhF,eAAO,MAAM,QAAQ;;;;;6CAiDpB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import { TextAreaResize } from "./TextArea.constants.mjs";
3
+ export declare const TextArea: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref">, "value" | "disabled" | "placeholder" | "readOnly" | "defaultValue" | "autoFocus" | "onFocus" | "onBlur" | "onChange"> & Omit<import("@metamask-previews/design-system-shared").TextAreaPropsShared, "textVariant"> & {
4
+ resize?: TextAreaResize | undefined;
5
+ onChange?: ((event: React.ChangeEvent<HTMLTextAreaElement, Element>) => void) | undefined;
6
+ onFocus?: ((event: React.FocusEvent<HTMLTextAreaElement, Element>) => void) | undefined;
7
+ onBlur?: ((event: React.FocusEvent<HTMLTextAreaElement, Element>) => void) | undefined;
8
+ } & React.RefAttributes<HTMLTextAreaElement>>;
9
+ //# sourceMappingURL=TextArea.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextArea.d.mts","sourceRoot":"","sources":["../../../src/components/TextArea/TextArea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,cAAc;AAI1C,OAAO,EAA4B,cAAc,EAAE,iCAA6B;AAGhF,eAAO,MAAM,QAAQ;;;;;6CAiDpB,CAAC"}
@@ -0,0 +1,18 @@
1
+ function $importDefault(module) {
2
+ if (module?.__esModule) {
3
+ return module.default;
4
+ }
5
+ return module;
6
+ }
7
+ import $React, { forwardRef } from "react";
8
+ const React = $importDefault($React);
9
+ import { twMerge } from "../../utils/tw-merge.mjs";
10
+ import { CLASSMAP_TEXTAREA_RESIZE, TextAreaResize } from "./TextArea.constants.mjs";
11
+ export const TextArea = forwardRef(({ value, placeholder, autoFocus = false, isDisabled = false, isReadOnly = false, isError = false, onBlur, onChange, onFocus, resize = TextAreaResize.None, className, ...props }, ref) => {
12
+ const textAreaClassName = twMerge('m-0 block min-h-24 w-full rounded-lg border bg-muted px-4 py-3 text-default outline-none transition-colors', 'text-s-body-md font-regular leading-s-body-md tracking-s-body-md md:text-l-body-md md:leading-l-body-md md:tracking-l-body-md', 'placeholder:text-alternative', CLASSMAP_TEXTAREA_RESIZE[resize], 'border-muted', isDisabled && 'cursor-not-allowed border-muted opacity-50', !isDisabled && isError && 'border-error-default', !isDisabled &&
13
+ !isError &&
14
+ 'focus:border-default read-only:focus:border-muted', className);
15
+ return (React.createElement("textarea", { ...props, ref: ref, value: value, placeholder: placeholder, className: textAreaClassName, disabled: isDisabled, readOnly: isReadOnly, autoFocus: autoFocus, "aria-invalid": isError || undefined, onChange: onChange, onFocus: onFocus, onBlur: onBlur }));
16
+ });
17
+ TextArea.displayName = 'TextArea';
18
+ //# sourceMappingURL=TextArea.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextArea.mjs","sourceRoot":"","sources":["../../../src/components/TextArea/TextArea.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,QAAO,EAAE,UAAU,EAAE,cAAc;;AAE1C,OAAO,EAAE,OAAO,EAAE,iCAA6B;AAE/C,OAAO,EAAE,wBAAwB,EAAE,cAAc,EAAE,iCAA6B;AAGhF,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAChC,CACE,EACE,KAAK,EACL,WAAW,EACX,SAAS,GAAG,KAAK,EACjB,UAAU,GAAG,KAAK,EAClB,UAAU,GAAG,KAAK,EAClB,OAAO,GAAG,KAAK,EACf,MAAM,EACN,QAAQ,EACR,OAAO,EACP,MAAM,GAAG,cAAc,CAAC,IAAI,EAC5B,SAAS,EACT,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,iBAAiB,GAAG,OAAO,CAC/B,4GAA4G,EAC5G,+HAA+H,EAC/H,8BAA8B,EAC9B,wBAAwB,CAAC,MAAM,CAAC,EAChC,cAAc,EACd,UAAU,IAAI,4CAA4C,EAC1D,CAAC,UAAU,IAAI,OAAO,IAAI,sBAAsB,EAChD,CAAC,UAAU;QACT,CAAC,OAAO;QACR,mDAAmD,EACrD,SAAS,CACV,CAAC;IAEF,OAAO,CACL,qCACM,KAAK,EACT,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,iBAAiB,EAC5B,QAAQ,EAAE,UAAU,EACpB,QAAQ,EAAE,UAAU,EACpB,SAAS,EAAE,SAAS,kBACN,OAAO,IAAI,SAAS,EAClC,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,GACd,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC","sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { twMerge } from '../../utils/tw-merge';\n\nimport { CLASSMAP_TEXTAREA_RESIZE, TextAreaResize } from './TextArea.constants';\nimport type { TextAreaProps } from './TextArea.types';\n\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n (\n {\n value,\n placeholder,\n autoFocus = false,\n isDisabled = false,\n isReadOnly = false,\n isError = false,\n onBlur,\n onChange,\n onFocus,\n resize = TextAreaResize.None,\n className,\n ...props\n },\n ref,\n ) => {\n const textAreaClassName = twMerge(\n 'm-0 block min-h-24 w-full rounded-lg border bg-muted px-4 py-3 text-default outline-none transition-colors',\n 'text-s-body-md font-regular leading-s-body-md tracking-s-body-md md:text-l-body-md md:leading-l-body-md md:tracking-l-body-md',\n 'placeholder:text-alternative',\n CLASSMAP_TEXTAREA_RESIZE[resize],\n 'border-muted',\n isDisabled && 'cursor-not-allowed border-muted opacity-50',\n !isDisabled && isError && 'border-error-default',\n !isDisabled &&\n !isError &&\n 'focus:border-default read-only:focus:border-muted',\n className,\n );\n\n return (\n <textarea\n {...props}\n ref={ref}\n value={value}\n placeholder={placeholder}\n className={textAreaClassName}\n disabled={isDisabled}\n readOnly={isReadOnly}\n autoFocus={autoFocus}\n aria-invalid={isError || undefined}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={onBlur}\n />\n );\n },\n);\n\nTextArea.displayName = 'TextArea';\n"]}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=TextArea.types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextArea.types.cjs","sourceRoot":"","sources":["../../../src/components/TextArea/TextArea.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextAreaPropsShared } from '@metamask-previews/design-system-shared';\nimport type { ChangeEvent, ComponentPropsWithoutRef, FocusEvent } from 'react';\n\nimport type { TextAreaResize } from './TextArea.constants';\n\n/**\n * TextArea component props (React platform-specific)\n * Extends shared props from @metamask-previews/design-system-shared with React-specific platform concerns\n */\nexport type TextAreaProps = Omit<\n ComponentPropsWithoutRef<'textarea'>,\n | 'autoFocus'\n | 'defaultValue'\n | 'disabled'\n | 'onBlur'\n | 'onChange'\n | 'onFocus'\n | 'placeholder'\n | 'readOnly'\n | 'value'\n> &\n Omit<TextAreaPropsShared, 'textVariant'> & {\n /**\n * Optional prop to control the resize behavior of the textarea.\n * Possible values:\n * - TextAreaResize.None\n * - TextAreaResize.Both\n * - TextAreaResize.Horizontal\n * - TextAreaResize.Vertical\n *\n * @default TextAreaResize.None\n */\n resize?: TextAreaResize;\n /**\n * Called when the textarea value changes.\n */\n onChange?: (event: ChangeEvent<HTMLTextAreaElement>) => void;\n /**\n * Called when the textarea receives focus.\n */\n onFocus?: (event: FocusEvent<HTMLTextAreaElement>) => void;\n /**\n * Called when the textarea loses focus.\n */\n onBlur?: (event: FocusEvent<HTMLTextAreaElement>) => void;\n };\n"]}
@@ -0,0 +1,33 @@
1
+ import type { TextAreaPropsShared } from "@metamask-previews/design-system-shared";
2
+ import type { ChangeEvent, ComponentPropsWithoutRef, FocusEvent } from "react";
3
+ import type { TextAreaResize } from "./TextArea.constants.cjs";
4
+ /**
5
+ * TextArea component props (React platform-specific)
6
+ * Extends shared props from @metamask-previews/design-system-shared with React-specific platform concerns
7
+ */
8
+ export type TextAreaProps = Omit<ComponentPropsWithoutRef<'textarea'>, 'autoFocus' | 'defaultValue' | 'disabled' | 'onBlur' | 'onChange' | 'onFocus' | 'placeholder' | 'readOnly' | 'value'> & Omit<TextAreaPropsShared, 'textVariant'> & {
9
+ /**
10
+ * Optional prop to control the resize behavior of the textarea.
11
+ * Possible values:
12
+ * - TextAreaResize.None
13
+ * - TextAreaResize.Both
14
+ * - TextAreaResize.Horizontal
15
+ * - TextAreaResize.Vertical
16
+ *
17
+ * @default TextAreaResize.None
18
+ */
19
+ resize?: TextAreaResize;
20
+ /**
21
+ * Called when the textarea value changes.
22
+ */
23
+ onChange?: (event: ChangeEvent<HTMLTextAreaElement>) => void;
24
+ /**
25
+ * Called when the textarea receives focus.
26
+ */
27
+ onFocus?: (event: FocusEvent<HTMLTextAreaElement>) => void;
28
+ /**
29
+ * Called when the textarea loses focus.
30
+ */
31
+ onBlur?: (event: FocusEvent<HTMLTextAreaElement>) => void;
32
+ };
33
+ //# sourceMappingURL=TextArea.types.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextArea.types.d.cts","sourceRoot":"","sources":["../../../src/components/TextArea/TextArea.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,gDAAgD;AACnF,OAAO,KAAK,EAAE,WAAW,EAAE,wBAAwB,EAAE,UAAU,EAAE,cAAc;AAE/E,OAAO,KAAK,EAAE,cAAc,EAAE,iCAA6B;AAE3D;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,CAC9B,wBAAwB,CAAC,UAAU,CAAC,EAClC,WAAW,GACX,cAAc,GACd,UAAU,GACV,QAAQ,GACR,UAAU,GACV,SAAS,GACT,aAAa,GACb,UAAU,GACV,OAAO,CACV,GACC,IAAI,CAAC,mBAAmB,EAAE,aAAa,CAAC,GAAG;IACzC;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;IAC7D;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;IAC3D;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;CAC3D,CAAC"}
@@ -0,0 +1,33 @@
1
+ import type { TextAreaPropsShared } from "@metamask-previews/design-system-shared";
2
+ import type { ChangeEvent, ComponentPropsWithoutRef, FocusEvent } from "react";
3
+ import type { TextAreaResize } from "./TextArea.constants.mjs";
4
+ /**
5
+ * TextArea component props (React platform-specific)
6
+ * Extends shared props from @metamask-previews/design-system-shared with React-specific platform concerns
7
+ */
8
+ export type TextAreaProps = Omit<ComponentPropsWithoutRef<'textarea'>, 'autoFocus' | 'defaultValue' | 'disabled' | 'onBlur' | 'onChange' | 'onFocus' | 'placeholder' | 'readOnly' | 'value'> & Omit<TextAreaPropsShared, 'textVariant'> & {
9
+ /**
10
+ * Optional prop to control the resize behavior of the textarea.
11
+ * Possible values:
12
+ * - TextAreaResize.None
13
+ * - TextAreaResize.Both
14
+ * - TextAreaResize.Horizontal
15
+ * - TextAreaResize.Vertical
16
+ *
17
+ * @default TextAreaResize.None
18
+ */
19
+ resize?: TextAreaResize;
20
+ /**
21
+ * Called when the textarea value changes.
22
+ */
23
+ onChange?: (event: ChangeEvent<HTMLTextAreaElement>) => void;
24
+ /**
25
+ * Called when the textarea receives focus.
26
+ */
27
+ onFocus?: (event: FocusEvent<HTMLTextAreaElement>) => void;
28
+ /**
29
+ * Called when the textarea loses focus.
30
+ */
31
+ onBlur?: (event: FocusEvent<HTMLTextAreaElement>) => void;
32
+ };
33
+ //# sourceMappingURL=TextArea.types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextArea.types.d.mts","sourceRoot":"","sources":["../../../src/components/TextArea/TextArea.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,gDAAgD;AACnF,OAAO,KAAK,EAAE,WAAW,EAAE,wBAAwB,EAAE,UAAU,EAAE,cAAc;AAE/E,OAAO,KAAK,EAAE,cAAc,EAAE,iCAA6B;AAE3D;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,CAC9B,wBAAwB,CAAC,UAAU,CAAC,EAClC,WAAW,GACX,cAAc,GACd,UAAU,GACV,QAAQ,GACR,UAAU,GACV,SAAS,GACT,aAAa,GACb,UAAU,GACV,OAAO,CACV,GACC,IAAI,CAAC,mBAAmB,EAAE,aAAa,CAAC,GAAG;IACzC;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;IAC7D;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;IAC3D;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;CAC3D,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TextArea.types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextArea.types.mjs","sourceRoot":"","sources":["../../../src/components/TextArea/TextArea.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextAreaPropsShared } from '@metamask-previews/design-system-shared';\nimport type { ChangeEvent, ComponentPropsWithoutRef, FocusEvent } from 'react';\n\nimport type { TextAreaResize } from './TextArea.constants';\n\n/**\n * TextArea component props (React platform-specific)\n * Extends shared props from @metamask-previews/design-system-shared with React-specific platform concerns\n */\nexport type TextAreaProps = Omit<\n ComponentPropsWithoutRef<'textarea'>,\n | 'autoFocus'\n | 'defaultValue'\n | 'disabled'\n | 'onBlur'\n | 'onChange'\n | 'onFocus'\n | 'placeholder'\n | 'readOnly'\n | 'value'\n> &\n Omit<TextAreaPropsShared, 'textVariant'> & {\n /**\n * Optional prop to control the resize behavior of the textarea.\n * Possible values:\n * - TextAreaResize.None\n * - TextAreaResize.Both\n * - TextAreaResize.Horizontal\n * - TextAreaResize.Vertical\n *\n * @default TextAreaResize.None\n */\n resize?: TextAreaResize;\n /**\n * Called when the textarea value changes.\n */\n onChange?: (event: ChangeEvent<HTMLTextAreaElement>) => void;\n /**\n * Called when the textarea receives focus.\n */\n onFocus?: (event: FocusEvent<HTMLTextAreaElement>) => void;\n /**\n * Called when the textarea loses focus.\n */\n onBlur?: (event: FocusEvent<HTMLTextAreaElement>) => void;\n };\n"]}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TextArea = exports.TextAreaResize = void 0;
4
+ var TextArea_constants_1 = require("./TextArea.constants.cjs");
5
+ Object.defineProperty(exports, "TextAreaResize", { enumerable: true, get: function () { return TextArea_constants_1.TextAreaResize; } });
6
+ var TextArea_1 = require("./TextArea.cjs");
7
+ Object.defineProperty(exports, "TextArea", { enumerable: true, get: function () { return TextArea_1.TextArea; } });
8
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/TextArea/index.ts"],"names":[],"mappings":";;;AAAA,+DAAsD;AAA7C,oHAAA,cAAc,OAAA;AACvB,2CAAsC;AAA7B,oGAAA,QAAQ,OAAA","sourcesContent":["export { TextAreaResize } from './TextArea.constants';\nexport { TextArea } from './TextArea';\nexport type { TextAreaProps } from './TextArea.types';\n"]}
@@ -0,0 +1,4 @@
1
+ export { TextAreaResize } from "./TextArea.constants.cjs";
2
+ export { TextArea } from "./TextArea.cjs";
3
+ export type { TextAreaProps } from "./TextArea.types.cjs";
4
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/TextArea/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iCAA6B;AACtD,OAAO,EAAE,QAAQ,EAAE,uBAAmB;AACtC,YAAY,EAAE,aAAa,EAAE,6BAAyB"}
@@ -0,0 +1,4 @@
1
+ export { TextAreaResize } from "./TextArea.constants.mjs";
2
+ export { TextArea } from "./TextArea.mjs";
3
+ export type { TextAreaProps } from "./TextArea.types.mjs";
4
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/TextArea/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iCAA6B;AACtD,OAAO,EAAE,QAAQ,EAAE,uBAAmB;AACtC,YAAY,EAAE,aAAa,EAAE,6BAAyB"}
@@ -0,0 +1,3 @@
1
+ export { TextAreaResize } from "./TextArea.constants.mjs";
2
+ export { TextArea } from "./TextArea.mjs";
3
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/TextArea/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iCAA6B;AACtD,OAAO,EAAE,QAAQ,EAAE,uBAAmB","sourcesContent":["export { TextAreaResize } from './TextArea.constants';\nexport { TextArea } from './TextArea';\nexport type { TextAreaProps } from './TextArea.types';\n"]}