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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/CHANGELOG.md +21 -1
  2. package/dist/components/AvatarFavicon/AvatarFavicon.cjs +1 -1
  3. package/dist/components/AvatarFavicon/AvatarFavicon.cjs.map +1 -1
  4. package/dist/components/AvatarFavicon/AvatarFavicon.mjs +1 -1
  5. package/dist/components/AvatarFavicon/AvatarFavicon.mjs.map +1 -1
  6. package/dist/components/AvatarGroup/AvatarGroup.cjs +2 -3
  7. package/dist/components/AvatarGroup/AvatarGroup.cjs.map +1 -1
  8. package/dist/components/AvatarGroup/AvatarGroup.d.cts.map +1 -1
  9. package/dist/components/AvatarGroup/AvatarGroup.d.mts.map +1 -1
  10. package/dist/components/AvatarGroup/AvatarGroup.mjs +1 -2
  11. package/dist/components/AvatarGroup/AvatarGroup.mjs.map +1 -1
  12. package/dist/components/AvatarIcon/AvatarIcon.types.cjs.map +1 -1
  13. package/dist/components/AvatarIcon/AvatarIcon.types.d.cts +1 -2
  14. package/dist/components/AvatarIcon/AvatarIcon.types.d.cts.map +1 -1
  15. package/dist/components/AvatarIcon/AvatarIcon.types.d.mts +1 -2
  16. package/dist/components/AvatarIcon/AvatarIcon.types.d.mts.map +1 -1
  17. package/dist/components/AvatarIcon/AvatarIcon.types.mjs.map +1 -1
  18. package/dist/components/AvatarNetwork/AvatarNetwork.cjs +1 -1
  19. package/dist/components/AvatarNetwork/AvatarNetwork.cjs.map +1 -1
  20. package/dist/components/AvatarNetwork/AvatarNetwork.mjs +1 -1
  21. package/dist/components/AvatarNetwork/AvatarNetwork.mjs.map +1 -1
  22. package/dist/components/AvatarToken/AvatarToken.cjs +1 -1
  23. package/dist/components/AvatarToken/AvatarToken.cjs.map +1 -1
  24. package/dist/components/AvatarToken/AvatarToken.mjs +1 -1
  25. package/dist/components/AvatarToken/AvatarToken.mjs.map +1 -1
  26. package/dist/components/BadgeIcon/BadgeIcon.cjs +1 -1
  27. package/dist/components/BadgeIcon/BadgeIcon.cjs.map +1 -1
  28. package/dist/components/BadgeIcon/BadgeIcon.mjs +1 -1
  29. package/dist/components/BadgeIcon/BadgeIcon.mjs.map +1 -1
  30. package/dist/components/Box/Box.cjs +42 -8
  31. package/dist/components/Box/Box.cjs.map +1 -1
  32. package/dist/components/Box/Box.constants.cjs +218 -1
  33. package/dist/components/Box/Box.constants.cjs.map +1 -1
  34. package/dist/components/Box/Box.constants.d.cts +16 -1
  35. package/dist/components/Box/Box.constants.d.cts.map +1 -1
  36. package/dist/components/Box/Box.constants.d.mts +16 -1
  37. package/dist/components/Box/Box.constants.d.mts.map +1 -1
  38. package/dist/components/Box/Box.constants.mjs +217 -0
  39. package/dist/components/Box/Box.constants.mjs.map +1 -1
  40. package/dist/components/Box/Box.d.cts +1 -1
  41. package/dist/components/Box/Box.d.cts.map +1 -1
  42. package/dist/components/Box/Box.d.mts +1 -1
  43. package/dist/components/Box/Box.d.mts.map +1 -1
  44. package/dist/components/Box/Box.mjs +21 -6
  45. package/dist/components/Box/Box.mjs.map +1 -1
  46. package/dist/components/Box/Box.types.cjs.map +1 -1
  47. package/dist/components/Box/Box.types.d.cts +84 -1
  48. package/dist/components/Box/Box.types.d.cts.map +1 -1
  49. package/dist/components/Box/Box.types.d.mts +84 -1
  50. package/dist/components/Box/Box.types.d.mts.map +1 -1
  51. package/dist/components/Box/Box.types.mjs.map +1 -1
  52. package/dist/components/Box/index.cjs +3 -1
  53. package/dist/components/Box/index.cjs.map +1 -1
  54. package/dist/components/Box/index.d.cts +1 -1
  55. package/dist/components/Box/index.d.cts.map +1 -1
  56. package/dist/components/Box/index.d.mts +1 -1
  57. package/dist/components/Box/index.d.mts.map +1 -1
  58. package/dist/components/Box/index.mjs +1 -1
  59. package/dist/components/Box/index.mjs.map +1 -1
  60. package/dist/components/ButtonBase/ButtonBase.cjs +4 -4
  61. package/dist/components/ButtonBase/ButtonBase.cjs.map +1 -1
  62. package/dist/components/ButtonBase/ButtonBase.mjs +4 -4
  63. package/dist/components/ButtonBase/ButtonBase.mjs.map +1 -1
  64. package/dist/components/Checkbox/Checkbox.cjs +2 -2
  65. package/dist/components/Checkbox/Checkbox.cjs.map +1 -1
  66. package/dist/components/Checkbox/Checkbox.mjs +2 -2
  67. package/dist/components/Checkbox/Checkbox.mjs.map +1 -1
  68. package/dist/components/Icon/icons/AppleLogo.cjs +32 -0
  69. package/dist/components/Icon/icons/AppleLogo.cjs.map +1 -0
  70. package/dist/components/Icon/icons/AppleLogo.d.cts +4 -0
  71. package/dist/components/Icon/icons/AppleLogo.d.cts.map +1 -0
  72. package/dist/components/Icon/icons/AppleLogo.d.mts +4 -0
  73. package/dist/components/Icon/icons/AppleLogo.d.mts.map +1 -0
  74. package/dist/components/Icon/icons/AppleLogo.mjs +7 -0
  75. package/dist/components/Icon/icons/AppleLogo.mjs.map +1 -0
  76. package/dist/components/Icon/icons/Backspace.cjs +32 -0
  77. package/dist/components/Icon/icons/Backspace.cjs.map +1 -0
  78. package/dist/components/Icon/icons/Backspace.d.cts +4 -0
  79. package/dist/components/Icon/icons/Backspace.d.cts.map +1 -0
  80. package/dist/components/Icon/icons/Backspace.d.mts +4 -0
  81. package/dist/components/Icon/icons/Backspace.d.mts.map +1 -0
  82. package/dist/components/Icon/icons/Backspace.mjs +7 -0
  83. package/dist/components/Icon/icons/Backspace.mjs.map +1 -0
  84. package/dist/components/Icon/icons/Candlestick.cjs +32 -0
  85. package/dist/components/Icon/icons/Candlestick.cjs.map +1 -0
  86. package/dist/components/Icon/icons/Candlestick.d.cts +4 -0
  87. package/dist/components/Icon/icons/Candlestick.d.cts.map +1 -0
  88. package/dist/components/Icon/icons/Candlestick.d.mts +4 -0
  89. package/dist/components/Icon/icons/Candlestick.d.mts.map +1 -0
  90. package/dist/components/Icon/icons/Candlestick.mjs +7 -0
  91. package/dist/components/Icon/icons/Candlestick.mjs.map +1 -0
  92. package/dist/components/Icon/icons/Clear.cjs +32 -0
  93. package/dist/components/Icon/icons/Clear.cjs.map +1 -0
  94. package/dist/components/Icon/icons/Clear.d.cts +4 -0
  95. package/dist/components/Icon/icons/Clear.d.cts.map +1 -0
  96. package/dist/components/Icon/icons/Clear.d.mts +4 -0
  97. package/dist/components/Icon/icons/Clear.d.mts.map +1 -0
  98. package/dist/components/Icon/icons/Clear.mjs +7 -0
  99. package/dist/components/Icon/icons/Clear.mjs.map +1 -0
  100. package/dist/components/Icon/icons/Error.cjs +2 -2
  101. package/dist/components/Icon/icons/Error.cjs.map +1 -1
  102. package/dist/components/Icon/icons/Error.mjs +2 -2
  103. package/dist/components/Icon/icons/Error.mjs.map +1 -1
  104. package/dist/components/Icon/icons/HashTag.cjs +2 -2
  105. package/dist/components/Icon/icons/HashTag.cjs.map +1 -1
  106. package/dist/components/Icon/icons/HashTag.mjs +2 -2
  107. package/dist/components/Icon/icons/HashTag.mjs.map +1 -1
  108. package/dist/components/Icon/icons/MetamaskFoxOutline.cjs +32 -0
  109. package/dist/components/Icon/icons/MetamaskFoxOutline.cjs.map +1 -0
  110. package/dist/components/Icon/icons/MetamaskFoxOutline.d.cts +4 -0
  111. package/dist/components/Icon/icons/MetamaskFoxOutline.d.cts.map +1 -0
  112. package/dist/components/Icon/icons/MetamaskFoxOutline.d.mts +4 -0
  113. package/dist/components/Icon/icons/MetamaskFoxOutline.d.mts.map +1 -0
  114. package/dist/components/Icon/icons/MetamaskFoxOutline.mjs +7 -0
  115. package/dist/components/Icon/icons/MetamaskFoxOutline.mjs.map +1 -0
  116. package/dist/components/Icon/icons/index.cjs +10 -0
  117. package/dist/components/Icon/icons/index.cjs.map +1 -1
  118. package/dist/components/Icon/icons/index.d.cts +5 -0
  119. package/dist/components/Icon/icons/index.d.cts.map +1 -1
  120. package/dist/components/Icon/icons/index.d.mts +5 -0
  121. package/dist/components/Icon/icons/index.d.mts.map +1 -1
  122. package/dist/components/Icon/icons/index.mjs +10 -0
  123. package/dist/components/Icon/icons/index.mjs.map +1 -1
  124. package/dist/components/Text/Text.constants.cjs +15 -0
  125. package/dist/components/Text/Text.constants.cjs.map +1 -1
  126. package/dist/components/Text/Text.constants.d.cts.map +1 -1
  127. package/dist/components/Text/Text.constants.d.mts.map +1 -1
  128. package/dist/components/Text/Text.constants.mjs +15 -0
  129. package/dist/components/Text/Text.constants.mjs.map +1 -1
  130. package/dist/components/Text/Text.types.cjs.map +1 -1
  131. package/dist/components/Text/Text.types.d.cts +2 -2
  132. package/dist/components/Text/Text.types.d.mts +2 -2
  133. package/dist/components/Text/Text.types.mjs.map +1 -1
  134. package/dist/components/index.cjs +4 -2
  135. package/dist/components/index.cjs.map +1 -1
  136. package/dist/components/index.d.cts +1 -1
  137. package/dist/components/index.d.cts.map +1 -1
  138. package/dist/components/index.d.mts +1 -1
  139. package/dist/components/index.d.mts.map +1 -1
  140. package/dist/components/index.mjs +1 -1
  141. package/dist/components/index.mjs.map +1 -1
  142. package/dist/components/temp-components/Jazzicon/Jazzicon.cjs +5 -2
  143. package/dist/components/temp-components/Jazzicon/Jazzicon.cjs.map +1 -1
  144. package/dist/components/temp-components/Jazzicon/Jazzicon.d.cts.map +1 -1
  145. package/dist/components/temp-components/Jazzicon/Jazzicon.d.mts.map +1 -1
  146. package/dist/components/temp-components/Jazzicon/Jazzicon.mjs +5 -2
  147. package/dist/components/temp-components/Jazzicon/Jazzicon.mjs.map +1 -1
  148. package/dist/components/temp-components/Jazzicon/Jazzicon.utilities.cjs +6 -3
  149. package/dist/components/temp-components/Jazzicon/Jazzicon.utilities.cjs.map +1 -1
  150. package/dist/components/temp-components/Jazzicon/Jazzicon.utilities.d.cts +6 -3
  151. package/dist/components/temp-components/Jazzicon/Jazzicon.utilities.d.cts.map +1 -1
  152. package/dist/components/temp-components/Jazzicon/Jazzicon.utilities.d.mts +6 -3
  153. package/dist/components/temp-components/Jazzicon/Jazzicon.utilities.d.mts.map +1 -1
  154. package/dist/components/temp-components/Jazzicon/Jazzicon.utilities.mjs +6 -3
  155. package/dist/components/temp-components/Jazzicon/Jazzicon.utilities.mjs.map +1 -1
  156. package/dist/types/index.cjs +148 -1
  157. package/dist/types/index.cjs.map +1 -1
  158. package/dist/types/index.d.cts +143 -1
  159. package/dist/types/index.d.cts.map +1 -1
  160. package/dist/types/index.d.mts +143 -1
  161. package/dist/types/index.d.mts.map +1 -1
  162. package/dist/types/index.mjs +147 -0
  163. package/dist/types/index.mjs.map +1 -1
  164. package/dist/utils/tw-merge.cjs +1 -5
  165. package/dist/utils/tw-merge.cjs.map +1 -1
  166. package/dist/utils/tw-merge.d.cts.map +1 -1
  167. package/dist/utils/tw-merge.d.mts.map +1 -1
  168. package/dist/utils/tw-merge.mjs +1 -5
  169. package/dist/utils/tw-merge.mjs.map +1 -1
  170. package/package.json +8 -8
@@ -1,5 +1,5 @@
1
1
  import type { ComponentProps } from "react";
2
- import type { BoxFlexDirection, BoxFlexWrap, BoxSpacing, BoxAlignItems, BoxJustifyContent } from "../../types/index.cjs";
2
+ import type { BoxFlexDirection, BoxFlexWrap, BoxSpacing, BoxBorderWidth, BoxAlignItems, BoxJustifyContent, BoxBackgroundColor, BoxBorderColor } from "../../types/index.cjs";
3
3
  export type BoxProps = ComponentProps<'div'> & {
4
4
  /**
5
5
  * The flex-direction style of the component.
@@ -22,6 +22,89 @@ export type BoxProps = ComponentProps<'div'> & {
22
22
  * The justify-content style of the component.
23
23
  */
24
24
  justifyContent?: BoxJustifyContent;
25
+ /**
26
+ * The margin of the component.
27
+ * Use 0-12 for margin of 0px-48px.
28
+ */
29
+ margin?: BoxSpacing;
30
+ /**
31
+ * The top margin of the component.
32
+ * Use 0-12 for margin of 0px-48px.
33
+ */
34
+ marginTop?: BoxSpacing;
35
+ /**
36
+ * The right margin of the component.
37
+ * Use 0-12 for margin of 0px-48px.
38
+ */
39
+ marginRight?: BoxSpacing;
40
+ /**
41
+ * The bottom margin of the component.
42
+ * Use 0-12 for margin of 0px-48px.
43
+ */
44
+ marginBottom?: BoxSpacing;
45
+ /**
46
+ * The left margin of the component.
47
+ * Use 0-12 for margin of 0px-48px.
48
+ */
49
+ marginLeft?: BoxSpacing;
50
+ /**
51
+ * The horizontal margin of the component.
52
+ * Use 0-12 for margin of 0px-48px.
53
+ */
54
+ marginHorizontal?: BoxSpacing;
55
+ /**
56
+ * The vertical margin of the component.
57
+ * Use 0-12 for margin of 0px-48px.
58
+ */
59
+ marginVertical?: BoxSpacing;
60
+ /**
61
+ * The padding of the component.
62
+ * Use 0-12 for padding of 0px-48px.
63
+ */
64
+ padding?: BoxSpacing;
65
+ /**
66
+ * The top padding of the component.
67
+ * Use 0-12 for padding of 0px-48px.
68
+ */
69
+ paddingTop?: BoxSpacing;
70
+ /**
71
+ * The right padding of the component.
72
+ * Use 0-12 for padding of 0px-48px.
73
+ */
74
+ paddingRight?: BoxSpacing;
75
+ /**
76
+ * The bottom padding of the component.
77
+ * Use 0-12 for padding of 0px-48px.
78
+ */
79
+ paddingBottom?: BoxSpacing;
80
+ /**
81
+ * The left padding of the component.
82
+ * Use 0-12 for padding of 0px-48px.
83
+ */
84
+ paddingLeft?: BoxSpacing;
85
+ /**
86
+ * The horizontal padding of the component.
87
+ * Use 0-12 for padding of 0px-48px.
88
+ */
89
+ paddingHorizontal?: BoxSpacing;
90
+ /**
91
+ * The vertical padding of the component.
92
+ * Use 0-12 for padding of 0px-48px.
93
+ */
94
+ paddingVertical?: BoxSpacing;
95
+ /**
96
+ * The border width of the component.
97
+ * Use 0, 1, 2, 4, or 8 for border width of 0px, 1px, 2px, 4px, or 8px.
98
+ */
99
+ borderWidth?: BoxBorderWidth;
100
+ /**
101
+ * The border color of the component.
102
+ */
103
+ borderColor?: BoxBorderColor;
104
+ /**
105
+ * The background color of the component.
106
+ */
107
+ backgroundColor?: BoxBackgroundColor;
25
108
  /**
26
109
  * Optional prop for additional CSS classes to be applied to the Box component.
27
110
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Box.types.d.cts","sourceRoot":"","sources":["../../../src/components/Box/Box.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc;AAE5C,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,aAAa,EACb,iBAAiB,EAClB,8BAAoB;AAErB,MAAM,MAAM,QAAQ,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IAC7C;;OAEG;IACH,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC;;OAEG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB;;;OAGG;IACH,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B;;OAEG;IACH,cAAc,CAAC,EAAE,iBAAiB,CAAC;IACnC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
1
+ {"version":3,"file":"Box.types.d.cts","sourceRoot":"","sources":["../../../src/components/Box/Box.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc;AAE5C,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACf,8BAAoB;AAErB,MAAM,MAAM,QAAQ,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IAC7C;;OAEG;IACH,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC;;OAEG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB;;;OAGG;IACH,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B;;OAEG;IACH,cAAc,CAAC,EAAE,iBAAiB,CAAC;IACnC;;;OAGG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB;;;OAGG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB;;;OAGG;IACH,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,UAAU,CAAC;IAC9B;;;OAGG;IACH,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B;;;OAGG;IACH,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;OAGG;IACH,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,UAAU,CAAC;IAC3B;;;OAGG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAC/B;;;OAGG;IACH,eAAe,CAAC,EAAE,UAAU,CAAC;IAC7B;;;OAGG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B;;OAEG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B;;OAEG;IACH,eAAe,CAAC,EAAE,kBAAkB,CAAC;IACrC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { ComponentProps } from "react";
2
- import type { BoxFlexDirection, BoxFlexWrap, BoxSpacing, BoxAlignItems, BoxJustifyContent } from "../../types/index.mjs";
2
+ import type { BoxFlexDirection, BoxFlexWrap, BoxSpacing, BoxBorderWidth, BoxAlignItems, BoxJustifyContent, BoxBackgroundColor, BoxBorderColor } from "../../types/index.mjs";
3
3
  export type BoxProps = ComponentProps<'div'> & {
4
4
  /**
5
5
  * The flex-direction style of the component.
@@ -22,6 +22,89 @@ export type BoxProps = ComponentProps<'div'> & {
22
22
  * The justify-content style of the component.
23
23
  */
24
24
  justifyContent?: BoxJustifyContent;
25
+ /**
26
+ * The margin of the component.
27
+ * Use 0-12 for margin of 0px-48px.
28
+ */
29
+ margin?: BoxSpacing;
30
+ /**
31
+ * The top margin of the component.
32
+ * Use 0-12 for margin of 0px-48px.
33
+ */
34
+ marginTop?: BoxSpacing;
35
+ /**
36
+ * The right margin of the component.
37
+ * Use 0-12 for margin of 0px-48px.
38
+ */
39
+ marginRight?: BoxSpacing;
40
+ /**
41
+ * The bottom margin of the component.
42
+ * Use 0-12 for margin of 0px-48px.
43
+ */
44
+ marginBottom?: BoxSpacing;
45
+ /**
46
+ * The left margin of the component.
47
+ * Use 0-12 for margin of 0px-48px.
48
+ */
49
+ marginLeft?: BoxSpacing;
50
+ /**
51
+ * The horizontal margin of the component.
52
+ * Use 0-12 for margin of 0px-48px.
53
+ */
54
+ marginHorizontal?: BoxSpacing;
55
+ /**
56
+ * The vertical margin of the component.
57
+ * Use 0-12 for margin of 0px-48px.
58
+ */
59
+ marginVertical?: BoxSpacing;
60
+ /**
61
+ * The padding of the component.
62
+ * Use 0-12 for padding of 0px-48px.
63
+ */
64
+ padding?: BoxSpacing;
65
+ /**
66
+ * The top padding of the component.
67
+ * Use 0-12 for padding of 0px-48px.
68
+ */
69
+ paddingTop?: BoxSpacing;
70
+ /**
71
+ * The right padding of the component.
72
+ * Use 0-12 for padding of 0px-48px.
73
+ */
74
+ paddingRight?: BoxSpacing;
75
+ /**
76
+ * The bottom padding of the component.
77
+ * Use 0-12 for padding of 0px-48px.
78
+ */
79
+ paddingBottom?: BoxSpacing;
80
+ /**
81
+ * The left padding of the component.
82
+ * Use 0-12 for padding of 0px-48px.
83
+ */
84
+ paddingLeft?: BoxSpacing;
85
+ /**
86
+ * The horizontal padding of the component.
87
+ * Use 0-12 for padding of 0px-48px.
88
+ */
89
+ paddingHorizontal?: BoxSpacing;
90
+ /**
91
+ * The vertical padding of the component.
92
+ * Use 0-12 for padding of 0px-48px.
93
+ */
94
+ paddingVertical?: BoxSpacing;
95
+ /**
96
+ * The border width of the component.
97
+ * Use 0, 1, 2, 4, or 8 for border width of 0px, 1px, 2px, 4px, or 8px.
98
+ */
99
+ borderWidth?: BoxBorderWidth;
100
+ /**
101
+ * The border color of the component.
102
+ */
103
+ borderColor?: BoxBorderColor;
104
+ /**
105
+ * The background color of the component.
106
+ */
107
+ backgroundColor?: BoxBackgroundColor;
25
108
  /**
26
109
  * Optional prop for additional CSS classes to be applied to the Box component.
27
110
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Box.types.d.mts","sourceRoot":"","sources":["../../../src/components/Box/Box.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc;AAE5C,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,aAAa,EACb,iBAAiB,EAClB,8BAAoB;AAErB,MAAM,MAAM,QAAQ,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IAC7C;;OAEG;IACH,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC;;OAEG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB;;;OAGG;IACH,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B;;OAEG;IACH,cAAc,CAAC,EAAE,iBAAiB,CAAC;IACnC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
1
+ {"version":3,"file":"Box.types.d.mts","sourceRoot":"","sources":["../../../src/components/Box/Box.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc;AAE5C,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACf,8BAAoB;AAErB,MAAM,MAAM,QAAQ,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IAC7C;;OAEG;IACH,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC;;OAEG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB;;;OAGG;IACH,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B;;OAEG;IACH,cAAc,CAAC,EAAE,iBAAiB,CAAC;IACnC;;;OAGG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB;;;OAGG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB;;;OAGG;IACH,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,UAAU,CAAC;IAC9B;;;OAGG;IACH,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B;;;OAGG;IACH,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;OAGG;IACH,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,UAAU,CAAC;IAC3B;;;OAGG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAC/B;;;OAGG;IACH,eAAe,CAAC,EAAE,UAAU,CAAC;IAC7B;;;OAGG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B;;OAEG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B;;OAEG;IACH,eAAe,CAAC,EAAE,kBAAkB,CAAC;IACrC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Box.types.mjs","sourceRoot":"","sources":["../../../src/components/Box/Box.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps } from 'react';\n\nimport type {\n BoxFlexDirection,\n BoxFlexWrap,\n BoxSpacing,\n BoxAlignItems,\n BoxJustifyContent,\n} from '../../types';\n\nexport type BoxProps = ComponentProps<'div'> & {\n /**\n * The flex-direction style of the component.\n */\n flexDirection?: BoxFlexDirection;\n /**\n * The flex-wrap style of the component.\n */\n flexWrap?: BoxFlexWrap;\n /**\n * The gap between the component's children.\n * Use 0-12 for a gap of 0px-48px.\n */\n gap?: BoxSpacing;\n /**\n * The align-items style of the component.\n */\n alignItems?: BoxAlignItems;\n /**\n * The justify-content style of the component.\n */\n justifyContent?: BoxJustifyContent;\n /**\n * Optional prop for additional CSS classes to be applied to the Box component.\n */\n className?: string;\n};\n"]}
1
+ {"version":3,"file":"Box.types.mjs","sourceRoot":"","sources":["../../../src/components/Box/Box.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps } from 'react';\n\nimport type {\n BoxFlexDirection,\n BoxFlexWrap,\n BoxSpacing,\n BoxBorderWidth,\n BoxAlignItems,\n BoxJustifyContent,\n BoxBackgroundColor,\n BoxBorderColor,\n} from '../../types';\n\nexport type BoxProps = ComponentProps<'div'> & {\n /**\n * The flex-direction style of the component.\n */\n flexDirection?: BoxFlexDirection;\n /**\n * The flex-wrap style of the component.\n */\n flexWrap?: BoxFlexWrap;\n /**\n * The gap between the component's children.\n * Use 0-12 for a gap of 0px-48px.\n */\n gap?: BoxSpacing;\n /**\n * The align-items style of the component.\n */\n alignItems?: BoxAlignItems;\n /**\n * The justify-content style of the component.\n */\n justifyContent?: BoxJustifyContent;\n /**\n * The margin of the component.\n * Use 0-12 for margin of 0px-48px.\n */\n margin?: BoxSpacing;\n /**\n * The top margin of the component.\n * Use 0-12 for margin of 0px-48px.\n */\n marginTop?: BoxSpacing;\n /**\n * The right margin of the component.\n * Use 0-12 for margin of 0px-48px.\n */\n marginRight?: BoxSpacing;\n /**\n * The bottom margin of the component.\n * Use 0-12 for margin of 0px-48px.\n */\n marginBottom?: BoxSpacing;\n /**\n * The left margin of the component.\n * Use 0-12 for margin of 0px-48px.\n */\n marginLeft?: BoxSpacing;\n /**\n * The horizontal margin of the component.\n * Use 0-12 for margin of 0px-48px.\n */\n marginHorizontal?: BoxSpacing;\n /**\n * The vertical margin of the component.\n * Use 0-12 for margin of 0px-48px.\n */\n marginVertical?: BoxSpacing;\n /**\n * The padding of the component.\n * Use 0-12 for padding of 0px-48px.\n */\n padding?: BoxSpacing;\n /**\n * The top padding of the component.\n * Use 0-12 for padding of 0px-48px.\n */\n paddingTop?: BoxSpacing;\n /**\n * The right padding of the component.\n * Use 0-12 for padding of 0px-48px.\n */\n paddingRight?: BoxSpacing;\n /**\n * The bottom padding of the component.\n * Use 0-12 for padding of 0px-48px.\n */\n paddingBottom?: BoxSpacing;\n /**\n * The left padding of the component.\n * Use 0-12 for padding of 0px-48px.\n */\n paddingLeft?: BoxSpacing;\n /**\n * The horizontal padding of the component.\n * Use 0-12 for padding of 0px-48px.\n */\n paddingHorizontal?: BoxSpacing;\n /**\n * The vertical padding of the component.\n * Use 0-12 for padding of 0px-48px.\n */\n paddingVertical?: BoxSpacing;\n /**\n * The border width of the component.\n * Use 0, 1, 2, 4, or 8 for border width of 0px, 1px, 2px, 4px, or 8px.\n */\n borderWidth?: BoxBorderWidth;\n /**\n * The border color of the component.\n */\n borderColor?: BoxBorderColor;\n /**\n * The background color of the component.\n */\n backgroundColor?: BoxBackgroundColor;\n /**\n * Optional prop for additional CSS classes to be applied to the Box component.\n */\n className?: string;\n};\n"]}
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Box = exports.BoxJustifyContent = exports.BoxAlignItems = exports.BoxFlexWrap = exports.BoxFlexDirection = void 0;
3
+ exports.Box = exports.BoxBorderColor = exports.BoxBackgroundColor = exports.BoxJustifyContent = exports.BoxAlignItems = exports.BoxFlexWrap = exports.BoxFlexDirection = void 0;
4
4
  var types_1 = require("../../types/index.cjs");
5
5
  Object.defineProperty(exports, "BoxFlexDirection", { enumerable: true, get: function () { return types_1.BoxFlexDirection; } });
6
6
  Object.defineProperty(exports, "BoxFlexWrap", { enumerable: true, get: function () { return types_1.BoxFlexWrap; } });
7
7
  Object.defineProperty(exports, "BoxAlignItems", { enumerable: true, get: function () { return types_1.BoxAlignItems; } });
8
8
  Object.defineProperty(exports, "BoxJustifyContent", { enumerable: true, get: function () { return types_1.BoxJustifyContent; } });
9
+ Object.defineProperty(exports, "BoxBackgroundColor", { enumerable: true, get: function () { return types_1.BoxBackgroundColor; } });
10
+ Object.defineProperty(exports, "BoxBorderColor", { enumerable: true, get: function () { return types_1.BoxBorderColor; } });
9
11
  var Box_1 = require("./Box.cjs");
10
12
  Object.defineProperty(exports, "Box", { enumerable: true, get: function () { return Box_1.Box; } });
11
13
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/Box/index.ts"],"names":[],"mappings":";;;AAAA,+CAKqB;AAJnB,yGAAA,gBAAgB,OAAA;AAChB,oGAAA,WAAW,OAAA;AACX,sGAAA,aAAa,OAAA;AACb,0GAAA,iBAAiB,OAAA;AAGnB,iCAA4B;AAAnB,0FAAA,GAAG,OAAA","sourcesContent":["export {\n BoxFlexDirection,\n BoxFlexWrap,\n BoxAlignItems,\n BoxJustifyContent,\n} from '../../types';\nexport type { BoxSpacing } from '../../types';\nexport { Box } from './Box';\nexport type { BoxProps } from './Box.types';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/Box/index.ts"],"names":[],"mappings":";;;AAAA,+CAOqB;AANnB,yGAAA,gBAAgB,OAAA;AAChB,oGAAA,WAAW,OAAA;AACX,sGAAA,aAAa,OAAA;AACb,0GAAA,iBAAiB,OAAA;AACjB,2GAAA,kBAAkB,OAAA;AAClB,uGAAA,cAAc,OAAA;AAGhB,iCAA4B;AAAnB,0FAAA,GAAG,OAAA","sourcesContent":["export {\n BoxFlexDirection,\n BoxFlexWrap,\n BoxAlignItems,\n BoxJustifyContent,\n BoxBackgroundColor,\n BoxBorderColor,\n} from '../../types';\nexport type { BoxSpacing } from '../../types';\nexport { Box } from './Box';\nexport type { BoxProps } from './Box.types';\n"]}
@@ -1,4 +1,4 @@
1
- export { BoxFlexDirection, BoxFlexWrap, BoxAlignItems, BoxJustifyContent, } from "../../types/index.cjs";
1
+ export { BoxFlexDirection, BoxFlexWrap, BoxAlignItems, BoxJustifyContent, BoxBackgroundColor, BoxBorderColor, } from "../../types/index.cjs";
2
2
  export type { BoxSpacing } from "../../types/index.cjs";
3
3
  export { Box } from "./Box.cjs";
4
4
  export type { BoxProps } from "./Box.types.cjs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Box/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,iBAAiB,GAClB,8BAAoB;AACrB,YAAY,EAAE,UAAU,EAAE,8BAAoB;AAC9C,OAAO,EAAE,GAAG,EAAE,kBAAc;AAC5B,YAAY,EAAE,QAAQ,EAAE,wBAAoB"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Box/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,GACf,8BAAoB;AACrB,YAAY,EAAE,UAAU,EAAE,8BAAoB;AAC9C,OAAO,EAAE,GAAG,EAAE,kBAAc;AAC5B,YAAY,EAAE,QAAQ,EAAE,wBAAoB"}
@@ -1,4 +1,4 @@
1
- export { BoxFlexDirection, BoxFlexWrap, BoxAlignItems, BoxJustifyContent, } from "../../types/index.mjs";
1
+ export { BoxFlexDirection, BoxFlexWrap, BoxAlignItems, BoxJustifyContent, BoxBackgroundColor, BoxBorderColor, } from "../../types/index.mjs";
2
2
  export type { BoxSpacing } from "../../types/index.mjs";
3
3
  export { Box } from "./Box.mjs";
4
4
  export type { BoxProps } from "./Box.types.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/Box/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,iBAAiB,GAClB,8BAAoB;AACrB,YAAY,EAAE,UAAU,EAAE,8BAAoB;AAC9C,OAAO,EAAE,GAAG,EAAE,kBAAc;AAC5B,YAAY,EAAE,QAAQ,EAAE,wBAAoB"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/Box/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,GACf,8BAAoB;AACrB,YAAY,EAAE,UAAU,EAAE,8BAAoB;AAC9C,OAAO,EAAE,GAAG,EAAE,kBAAc;AAC5B,YAAY,EAAE,QAAQ,EAAE,wBAAoB"}
@@ -1,3 +1,3 @@
1
- export { BoxFlexDirection, BoxFlexWrap, BoxAlignItems, BoxJustifyContent } from "../../types/index.mjs";
1
+ export { BoxFlexDirection, BoxFlexWrap, BoxAlignItems, BoxJustifyContent, BoxBackgroundColor, BoxBorderColor } from "../../types/index.mjs";
2
2
  export { Box } from "./Box.mjs";
3
3
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/Box/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,iBAAiB,EAClB,8BAAoB;AAErB,OAAO,EAAE,GAAG,EAAE,kBAAc","sourcesContent":["export {\n BoxFlexDirection,\n BoxFlexWrap,\n BoxAlignItems,\n BoxJustifyContent,\n} from '../../types';\nexport type { BoxSpacing } from '../../types';\nexport { Box } from './Box';\nexport type { BoxProps } from './Box.types';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/Box/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACf,8BAAoB;AAErB,OAAO,EAAE,GAAG,EAAE,kBAAc","sourcesContent":["export {\n BoxFlexDirection,\n BoxFlexWrap,\n BoxAlignItems,\n BoxJustifyContent,\n BoxBackgroundColor,\n BoxBorderColor,\n} from '../../types';\nexport type { BoxSpacing } from '../../types';\nexport { Box } from './Box';\nexport type { BoxProps } from './Box.types';\n"]}
@@ -50,7 +50,7 @@ exports.ButtonBase = (0, react_1.forwardRef)(({ children, className, size = type
50
50
  react_1.default.createElement("span", { className: "sr-only", "aria-live": "polite", "aria-atomic": "true" }, loadingText || 'Loading')));
51
51
  const renderStartContent = () => {
52
52
  if (startIconName) {
53
- return (react_1.default.createElement(Icon_1.Icon, { name: startIconName, size: Icon_1.IconSize.Sm, className: (0, tw_merge_1.twMerge)('mr-2 flex-shrink-0 text-inherit', startIconProps?.className), "aria-hidden": "true", ...startIconProps }));
53
+ return (react_1.default.createElement(Icon_1.Icon, { name: startIconName, size: Icon_1.IconSize.Sm, className: (0, tw_merge_1.twMerge)('mr-2 shrink-0 text-inherit', startIconProps?.className), "aria-hidden": "true", ...startIconProps }));
54
54
  }
55
55
  if (startAccessory) {
56
56
  return (react_1.default.createElement("span", { className: "mr-2", "aria-hidden": "true" }, startAccessory));
@@ -59,7 +59,7 @@ exports.ButtonBase = (0, react_1.forwardRef)(({ children, className, size = type
59
59
  };
60
60
  const renderEndContent = () => {
61
61
  if (endIconName) {
62
- return (react_1.default.createElement(Icon_1.Icon, { name: endIconName, size: Icon_1.IconSize.Sm, className: (0, tw_merge_1.twMerge)('ml-2 flex-shrink-0 text-inherit', endIconProps?.className), "aria-hidden": "true", ...endIconProps }));
62
+ return (react_1.default.createElement(Icon_1.Icon, { name: endIconName, size: Icon_1.IconSize.Sm, className: (0, tw_merge_1.twMerge)('ml-2 shrink-0 text-inherit', endIconProps?.className), "aria-hidden": "true", ...endIconProps }));
63
63
  }
64
64
  if (endAccessory) {
65
65
  return (react_1.default.createElement("span", { className: "ml-2", "aria-hidden": "true" }, endAccessory));
@@ -75,7 +75,7 @@ exports.ButtonBase = (0, react_1.forwardRef)(({ children, className, size = type
75
75
  };
76
76
  const mergedClassName = (0, tw_merge_1.twMerge)(
77
77
  // Base styles
78
- 'inline-flex items-center justify-center', 'rounded-xl px-4', 'font-medium text-default', 'bg-muted', 'min-w-[80px] overflow-hidden',
78
+ 'inline-flex items-center justify-center', 'rounded-xl px-4', 'font-medium text-default', 'bg-muted', 'min-w-20 overflow-hidden',
79
79
  // Add relative positioning for loading state
80
80
  'relative',
81
81
  // Size
@@ -84,7 +84,7 @@ exports.ButtonBase = (0, react_1.forwardRef)(({ children, className, size = type
84
84
  isFullWidth && 'w-full',
85
85
  // Animation classes - only applied when interactive
86
86
  isInteractive && [
87
- 'transition-[transform,colors,opacity]',
87
+ 'transition-all',
88
88
  'duration-100',
89
89
  'ease-linear',
90
90
  'active:scale-[0.97]',
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonBase.cjs","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAuD;AACvD,+CAA0C;AAE1C,iDAA6C;AAC7C,uDAA+C;AAC/C,4CAAmD;AACnD,4CAAsD;AAEtD,qEAA8E;AAGjE,QAAA,UAAU,GAAG,IAAA,kBAAU,EAClC,CACE,EACE,QAAQ,EACR,SAAS,EACT,IAAI,GAAG,sBAAc,CAAC,EAAE,EACxB,WAAW,EACX,OAAO,EACP,UAAU,EACV,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,cAAc,EACd,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,KAAK,EACL,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,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,2DAAoC,CAAC,IAAI,CAAC;IAC1C,aAAa;IACb,WAAW,IAAI,QAAQ;IACvB,oDAAoD;IACpD,aAAa,IAAI;QACf,uCAAuC;QACvC,cAAc;QACd,aAAa;QACb,qBAAqB;QACrB,2CAA2C;KAC5C;IACD,0DAA0D;IAC1D,CAAC,UAAU,IAAI,SAAS,CAAC,IAAI,oBAAoB,EACjD,UAAU,IAAI,YAAY;IAC1B,iBAAiB;IACjB,SAAS,CACV,CAAC;IAEF,OAAO,CACL,8BAAC,SAAS,IACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,eAAe,EAC1B,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,UAAU,IAAI,SAAS,CAAC,mBAC1C,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,eACnC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,gBAC7B,SAAS,qBACJ,cAAc,sBACb,eAAe,kBACnB,WAAW,mBACV,YAAY,mBACZ,YAAY,mBACZ,YAAY,EAC3B,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,EACpC,QAAQ,EAAE,WAAW,EAAE,EACvB,KAAK,EAAE,KAAK,KACR,KAAK;QAER,kBAAkB,EAAE;QACrB,8BAAC,sBAAS,QACP,SAAS,CAAC,CAAC,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC,aAAa,EAAE,CACzC;QACX,gBAAgB,EAAE,CACT,CACb,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,kBAAU,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["import { Slot, Slottable } from '@radix-ui/react-slot';\nimport React, { forwardRef } from 'react';\n\nimport { ButtonBaseSize } from '../../types';\nimport { twMerge } from '../../utils/tw-merge';\nimport { Icon, IconName, IconSize } from '../Icon';\nimport { Text, FontWeight, TextColor } from '../Text';\n\nimport { TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION } from './ButtonBase.constants';\nimport type { ButtonBaseProps } from './ButtonBase.types';\n\nexport const ButtonBase = forwardRef<HTMLButtonElement, ButtonBaseProps>(\n (\n {\n children,\n className,\n size = ButtonBaseSize.Lg,\n isFullWidth,\n asChild,\n isDisabled,\n isLoading,\n loadingText,\n loadingIconProps,\n loadingTextProps,\n startIconName,\n startIconProps,\n startAccessory,\n endIconName,\n endIconProps,\n endAccessory,\n textProps,\n style,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n 'aria-pressed': ariaPressed,\n 'aria-expanded': ariaExpanded,\n 'aria-controls': ariaControls,\n 'aria-haspopup': ariaHaspopup,\n ...props\n },\n ref,\n ) => {\n const Component = asChild ? Slot : 'button';\n const isInteractive = !(isDisabled ?? isLoading);\n\n // Calculate tabIndex based on asChild and disabled state\n const getTabIndex = () => {\n if (asChild) {\n return undefined;\n }\n return isDisabled ? -1 : undefined;\n };\n\n const renderLoadingState = () => (\n <>\n <span className=\"absolute inline-flex items-center\" aria-hidden=\"true\">\n <Icon\n name={IconName.Loading}\n size={IconSize.Sm}\n className={twMerge(\n 'mr-2 animate-spin text-inherit',\n loadingIconProps?.className,\n )}\n {...loadingIconProps}\n />\n <Text\n fontWeight={FontWeight.Medium}\n color={TextColor.Inherit}\n asChild\n {...loadingTextProps}\n >\n <span>{loadingText}</span>\n </Text>\n </span>\n <span className=\"invisible inline-flex items-center\">{children}</span>\n {/* Screen reader announcement for loading */}\n <span className=\"sr-only\" aria-live=\"polite\" aria-atomic=\"true\">\n {loadingText || 'Loading'}\n </span>\n </>\n );\n\n const renderStartContent = () => {\n if (startIconName) {\n return (\n <Icon\n name={startIconName}\n size={IconSize.Sm}\n className={twMerge(\n 'mr-2 flex-shrink-0 text-inherit',\n startIconProps?.className,\n )}\n aria-hidden=\"true\"\n {...startIconProps}\n />\n );\n }\n if (startAccessory) {\n return (\n <span className=\"mr-2\" aria-hidden=\"true\">\n {startAccessory}\n </span>\n );\n }\n return null;\n };\n\n const renderEndContent = () => {\n if (endIconName) {\n return (\n <Icon\n name={endIconName}\n size={IconSize.Sm}\n className={twMerge(\n 'ml-2 flex-shrink-0 text-inherit',\n endIconProps?.className,\n )}\n aria-hidden=\"true\"\n {...endIconProps}\n />\n );\n }\n if (endAccessory) {\n return (\n <span className=\"ml-2\" aria-hidden=\"true\">\n {endAccessory}\n </span>\n );\n }\n return null;\n };\n\n const renderContent = () => {\n if (children && typeof children === 'string') {\n return (\n <Text\n fontWeight={FontWeight.Medium}\n color={TextColor.Inherit}\n asChild\n {...textProps}\n >\n <span>{children}</span>\n </Text>\n );\n }\n return children;\n };\n\n const mergedClassName = twMerge(\n // Base styles\n 'inline-flex items-center justify-center',\n 'rounded-xl px-4',\n 'font-medium text-default',\n 'bg-muted',\n 'min-w-[80px] overflow-hidden',\n // Add relative positioning for loading state\n 'relative',\n // Size\n TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION[size],\n // Full width\n isFullWidth && 'w-full',\n // Animation classes - only applied when interactive\n isInteractive && [\n 'transition-[transform,colors,opacity]',\n 'duration-100',\n 'ease-linear',\n 'active:scale-[0.97]',\n 'active:ease-[cubic-bezier(0.3,0.8,0.3,1)]',\n ],\n // Disabled state - apply to both isDisabled and isLoading\n (isDisabled || isLoading) && 'cursor-not-allowed',\n isDisabled && 'opacity-50',\n // Custom classes\n className,\n );\n\n return (\n <Component\n ref={ref}\n className={mergedClassName}\n disabled={asChild ? undefined : (isDisabled ?? isLoading)}\n aria-disabled={isDisabled ? 'true' : undefined}\n aria-busy={isLoading ? 'true' : undefined}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n aria-pressed={ariaPressed}\n aria-expanded={ariaExpanded}\n aria-controls={ariaControls}\n aria-haspopup={ariaHaspopup}\n role={asChild ? undefined : 'button'}\n tabIndex={getTabIndex()}\n style={style}\n {...props}\n >\n {renderStartContent()}\n <Slottable>\n {isLoading ? renderLoadingState() : renderContent()}\n </Slottable>\n {renderEndContent()}\n </Component>\n );\n },\n);\n\nButtonBase.displayName = 'ButtonBase';\n"]}
1
+ {"version":3,"file":"ButtonBase.cjs","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAuD;AACvD,+CAA0C;AAE1C,iDAA6C;AAC7C,uDAA+C;AAC/C,4CAAmD;AACnD,4CAAsD;AAEtD,qEAA8E;AAGjE,QAAA,UAAU,GAAG,IAAA,kBAAU,EAClC,CACE,EACE,QAAQ,EACR,SAAS,EACT,IAAI,GAAG,sBAAc,CAAC,EAAE,EACxB,WAAW,EACX,OAAO,EACP,UAAU,EACV,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,cAAc,EACd,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,KAAK,EACL,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,cAAc,EACjC,kBAAkB,EAAE,eAAe,EACnC,cAAc,EAAE,WAAW,EAC3B,eAAe,EAAE,YAAY,EAC7B,eAAe,EAAE,YAAY,EAC7B,eAAe,EAAE,YAAY,EAC7B,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,iBAAI,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC5C,MAAM,aAAa,GAAG,CAAC,CAAC,UAAU,IAAI,SAAS,CAAC,CAAC;IAEjD,yDAAyD;IACzD,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,IAAI,OAAO,EAAE;YACX,OAAO,SAAS,CAAC;SAClB;QACD,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACrC,CAAC,CAAC;IAEF,MAAM,kBAAkB,GAAG,GAA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AAC,MAAM,CAAC,CAAC,CAAC,SAAS,gBAC7B,SAAS,qBACJ,cAAc,sBACb,eAAe,kBACnB,WAAW,mBACV,YAAY,mBACZ,YAAY,mBACZ,YAAY,EAC3B,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,EACpC,QAAQ,EAAE,WAAW,EAAE,EACvB,KAAK,EAAE,KAAK,KACR,KAAK;QAER,kBAAkB,EAAE;QACrB,8BAAC,sBAAS,QACP,SAAS,CAAC,CAAC,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC,aAAa,EAAE,CACzC;QACX,gBAAgB,EAAE,CACT,CACb,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,kBAAU,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["import { Slot, Slottable } from '@radix-ui/react-slot';\nimport React, { forwardRef } from 'react';\n\nimport { ButtonBaseSize } from '../../types';\nimport { twMerge } from '../../utils/tw-merge';\nimport { Icon, IconName, IconSize } from '../Icon';\nimport { Text, FontWeight, TextColor } from '../Text';\n\nimport { TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION } from './ButtonBase.constants';\nimport type { ButtonBaseProps } from './ButtonBase.types';\n\nexport const ButtonBase = forwardRef<HTMLButtonElement, ButtonBaseProps>(\n (\n {\n children,\n className,\n size = ButtonBaseSize.Lg,\n isFullWidth,\n asChild,\n isDisabled,\n isLoading,\n loadingText,\n loadingIconProps,\n loadingTextProps,\n startIconName,\n startIconProps,\n startAccessory,\n endIconName,\n endIconProps,\n endAccessory,\n textProps,\n style,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n 'aria-pressed': ariaPressed,\n 'aria-expanded': ariaExpanded,\n 'aria-controls': ariaControls,\n 'aria-haspopup': ariaHaspopup,\n ...props\n },\n ref,\n ) => {\n const Component = asChild ? Slot : 'button';\n const isInteractive = !(isDisabled ?? isLoading);\n\n // Calculate tabIndex based on asChild and disabled state\n const getTabIndex = () => {\n if (asChild) {\n return undefined;\n }\n return isDisabled ? -1 : undefined;\n };\n\n const renderLoadingState = () => (\n <>\n <span className=\"absolute inline-flex items-center\" aria-hidden=\"true\">\n <Icon\n name={IconName.Loading}\n size={IconSize.Sm}\n className={twMerge(\n 'mr-2 animate-spin text-inherit',\n loadingIconProps?.className,\n )}\n {...loadingIconProps}\n />\n <Text\n fontWeight={FontWeight.Medium}\n color={TextColor.Inherit}\n asChild\n {...loadingTextProps}\n >\n <span>{loadingText}</span>\n </Text>\n </span>\n <span className=\"invisible inline-flex items-center\">{children}</span>\n {/* Screen reader announcement for loading */}\n <span className=\"sr-only\" aria-live=\"polite\" aria-atomic=\"true\">\n {loadingText || 'Loading'}\n </span>\n </>\n );\n\n const renderStartContent = () => {\n if (startIconName) {\n return (\n <Icon\n name={startIconName}\n size={IconSize.Sm}\n className={twMerge(\n 'mr-2 shrink-0 text-inherit',\n startIconProps?.className,\n )}\n aria-hidden=\"true\"\n {...startIconProps}\n />\n );\n }\n if (startAccessory) {\n return (\n <span className=\"mr-2\" aria-hidden=\"true\">\n {startAccessory}\n </span>\n );\n }\n return null;\n };\n\n const renderEndContent = () => {\n if (endIconName) {\n return (\n <Icon\n name={endIconName}\n size={IconSize.Sm}\n className={twMerge(\n 'ml-2 shrink-0 text-inherit',\n endIconProps?.className,\n )}\n aria-hidden=\"true\"\n {...endIconProps}\n />\n );\n }\n if (endAccessory) {\n return (\n <span className=\"ml-2\" aria-hidden=\"true\">\n {endAccessory}\n </span>\n );\n }\n return null;\n };\n\n const renderContent = () => {\n if (children && typeof children === 'string') {\n return (\n <Text\n fontWeight={FontWeight.Medium}\n color={TextColor.Inherit}\n asChild\n {...textProps}\n >\n <span>{children}</span>\n </Text>\n );\n }\n return children;\n };\n\n const mergedClassName = twMerge(\n // Base styles\n 'inline-flex items-center justify-center',\n 'rounded-xl px-4',\n 'font-medium text-default',\n 'bg-muted',\n 'min-w-20 overflow-hidden',\n // Add relative positioning for loading state\n 'relative',\n // Size\n TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION[size],\n // Full width\n isFullWidth && 'w-full',\n // Animation classes - only applied when interactive\n isInteractive && [\n 'transition-all',\n 'duration-100',\n 'ease-linear',\n 'active:scale-[0.97]',\n 'active:ease-[cubic-bezier(0.3,0.8,0.3,1)]',\n ],\n // Disabled state - apply to both isDisabled and isLoading\n (isDisabled || isLoading) && 'cursor-not-allowed',\n isDisabled && 'opacity-50',\n // Custom classes\n className,\n );\n\n return (\n <Component\n ref={ref}\n className={mergedClassName}\n disabled={asChild ? undefined : (isDisabled ?? isLoading)}\n aria-disabled={isDisabled ? 'true' : undefined}\n aria-busy={isLoading ? 'true' : undefined}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n aria-pressed={ariaPressed}\n aria-expanded={ariaExpanded}\n aria-controls={ariaControls}\n aria-haspopup={ariaHaspopup}\n role={asChild ? undefined : 'button'}\n tabIndex={getTabIndex()}\n style={style}\n {...props}\n >\n {renderStartContent()}\n <Slottable>\n {isLoading ? renderLoadingState() : renderContent()}\n </Slottable>\n {renderEndContent()}\n </Component>\n );\n },\n);\n\nButtonBase.displayName = 'ButtonBase';\n"]}
@@ -31,7 +31,7 @@ export const ButtonBase = forwardRef(({ children, className, size = ButtonBaseSi
31
31
  React.createElement("span", { className: "sr-only", "aria-live": "polite", "aria-atomic": "true" }, loadingText || 'Loading')));
32
32
  const renderStartContent = () => {
33
33
  if (startIconName) {
34
- return (React.createElement(Icon, { name: startIconName, size: IconSize.Sm, className: twMerge('mr-2 flex-shrink-0 text-inherit', startIconProps?.className), "aria-hidden": "true", ...startIconProps }));
34
+ return (React.createElement(Icon, { name: startIconName, size: IconSize.Sm, className: twMerge('mr-2 shrink-0 text-inherit', startIconProps?.className), "aria-hidden": "true", ...startIconProps }));
35
35
  }
36
36
  if (startAccessory) {
37
37
  return (React.createElement("span", { className: "mr-2", "aria-hidden": "true" }, startAccessory));
@@ -40,7 +40,7 @@ export const ButtonBase = forwardRef(({ children, className, size = ButtonBaseSi
40
40
  };
41
41
  const renderEndContent = () => {
42
42
  if (endIconName) {
43
- return (React.createElement(Icon, { name: endIconName, size: IconSize.Sm, className: twMerge('ml-2 flex-shrink-0 text-inherit', endIconProps?.className), "aria-hidden": "true", ...endIconProps }));
43
+ return (React.createElement(Icon, { name: endIconName, size: IconSize.Sm, className: twMerge('ml-2 shrink-0 text-inherit', endIconProps?.className), "aria-hidden": "true", ...endIconProps }));
44
44
  }
45
45
  if (endAccessory) {
46
46
  return (React.createElement("span", { className: "ml-2", "aria-hidden": "true" }, endAccessory));
@@ -56,7 +56,7 @@ export const ButtonBase = forwardRef(({ children, className, size = ButtonBaseSi
56
56
  };
57
57
  const mergedClassName = twMerge(
58
58
  // Base styles
59
- 'inline-flex items-center justify-center', 'rounded-xl px-4', 'font-medium text-default', 'bg-muted', 'min-w-[80px] overflow-hidden',
59
+ 'inline-flex items-center justify-center', 'rounded-xl px-4', 'font-medium text-default', 'bg-muted', 'min-w-20 overflow-hidden',
60
60
  // Add relative positioning for loading state
61
61
  'relative',
62
62
  // Size
@@ -65,7 +65,7 @@ export const ButtonBase = forwardRef(({ children, className, size = ButtonBaseSi
65
65
  isFullWidth && 'w-full',
66
66
  // Animation classes - only applied when interactive
67
67
  isInteractive && [
68
- 'transition-[transform,colors,opacity]',
68
+ 'transition-all',
69
69
  'duration-100',
70
70
  'ease-linear',
71
71
  'active:scale-[0.97]',
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonBase.mjs","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,6BAA6B;AACvD,OAAO,QAAO,EAAE,UAAU,EAAE,cAAc;;AAE1C,OAAO,EAAE,cAAc,EAAE,8BAAoB;AAC7C,OAAO,EAAE,OAAO,EAAE,iCAA6B;AAC/C,OAAO,EAAE,IAAI,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vB,KAAK,EAAE,KAAK,KACR,KAAK;QAER,kBAAkB,EAAE;QACrB,oBAAC,SAAS,QACP,SAAS,CAAC,CAAC,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC,aAAa,EAAE,CACzC;QACX,gBAAgB,EAAE,CACT,CACb,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["import { Slot, Slottable } from '@radix-ui/react-slot';\nimport React, { forwardRef } from 'react';\n\nimport { ButtonBaseSize } from '../../types';\nimport { twMerge } from '../../utils/tw-merge';\nimport { Icon, IconName, IconSize } from '../Icon';\nimport { Text, FontWeight, TextColor } from '../Text';\n\nimport { TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION } from './ButtonBase.constants';\nimport type { ButtonBaseProps } from './ButtonBase.types';\n\nexport const ButtonBase = forwardRef<HTMLButtonElement, ButtonBaseProps>(\n (\n {\n children,\n className,\n size = ButtonBaseSize.Lg,\n isFullWidth,\n asChild,\n isDisabled,\n isLoading,\n loadingText,\n loadingIconProps,\n loadingTextProps,\n startIconName,\n startIconProps,\n startAccessory,\n endIconName,\n endIconProps,\n endAccessory,\n textProps,\n style,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n 'aria-pressed': ariaPressed,\n 'aria-expanded': ariaExpanded,\n 'aria-controls': ariaControls,\n 'aria-haspopup': ariaHaspopup,\n ...props\n },\n ref,\n ) => {\n const Component = asChild ? Slot : 'button';\n const isInteractive = !(isDisabled ?? isLoading);\n\n // Calculate tabIndex based on asChild and disabled state\n const getTabIndex = () => {\n if (asChild) {\n return undefined;\n }\n return isDisabled ? -1 : undefined;\n };\n\n const renderLoadingState = () => (\n <>\n <span className=\"absolute inline-flex items-center\" aria-hidden=\"true\">\n <Icon\n name={IconName.Loading}\n size={IconSize.Sm}\n className={twMerge(\n 'mr-2 animate-spin text-inherit',\n loadingIconProps?.className,\n )}\n {...loadingIconProps}\n />\n <Text\n fontWeight={FontWeight.Medium}\n color={TextColor.Inherit}\n asChild\n {...loadingTextProps}\n >\n <span>{loadingText}</span>\n </Text>\n </span>\n <span className=\"invisible inline-flex items-center\">{children}</span>\n {/* Screen reader announcement for loading */}\n <span className=\"sr-only\" aria-live=\"polite\" aria-atomic=\"true\">\n {loadingText || 'Loading'}\n </span>\n </>\n );\n\n const renderStartContent = () => {\n if (startIconName) {\n return (\n <Icon\n name={startIconName}\n size={IconSize.Sm}\n className={twMerge(\n 'mr-2 flex-shrink-0 text-inherit',\n startIconProps?.className,\n )}\n aria-hidden=\"true\"\n {...startIconProps}\n />\n );\n }\n if (startAccessory) {\n return (\n <span className=\"mr-2\" aria-hidden=\"true\">\n {startAccessory}\n </span>\n );\n }\n return null;\n };\n\n const renderEndContent = () => {\n if (endIconName) {\n return (\n <Icon\n name={endIconName}\n size={IconSize.Sm}\n className={twMerge(\n 'ml-2 flex-shrink-0 text-inherit',\n endIconProps?.className,\n )}\n aria-hidden=\"true\"\n {...endIconProps}\n />\n );\n }\n if (endAccessory) {\n return (\n <span className=\"ml-2\" aria-hidden=\"true\">\n {endAccessory}\n </span>\n );\n }\n return null;\n };\n\n const renderContent = () => {\n if (children && typeof children === 'string') {\n return (\n <Text\n fontWeight={FontWeight.Medium}\n color={TextColor.Inherit}\n asChild\n {...textProps}\n >\n <span>{children}</span>\n </Text>\n );\n }\n return children;\n };\n\n const mergedClassName = twMerge(\n // Base styles\n 'inline-flex items-center justify-center',\n 'rounded-xl px-4',\n 'font-medium text-default',\n 'bg-muted',\n 'min-w-[80px] overflow-hidden',\n // Add relative positioning for loading state\n 'relative',\n // Size\n TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION[size],\n // Full width\n isFullWidth && 'w-full',\n // Animation classes - only applied when interactive\n isInteractive && [\n 'transition-[transform,colors,opacity]',\n 'duration-100',\n 'ease-linear',\n 'active:scale-[0.97]',\n 'active:ease-[cubic-bezier(0.3,0.8,0.3,1)]',\n ],\n // Disabled state - apply to both isDisabled and isLoading\n (isDisabled || isLoading) && 'cursor-not-allowed',\n isDisabled && 'opacity-50',\n // Custom classes\n className,\n );\n\n return (\n <Component\n ref={ref}\n className={mergedClassName}\n disabled={asChild ? undefined : (isDisabled ?? isLoading)}\n aria-disabled={isDisabled ? 'true' : undefined}\n aria-busy={isLoading ? 'true' : undefined}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n aria-pressed={ariaPressed}\n aria-expanded={ariaExpanded}\n aria-controls={ariaControls}\n aria-haspopup={ariaHaspopup}\n role={asChild ? undefined : 'button'}\n tabIndex={getTabIndex()}\n style={style}\n {...props}\n >\n {renderStartContent()}\n <Slottable>\n {isLoading ? renderLoadingState() : renderContent()}\n </Slottable>\n {renderEndContent()}\n </Component>\n );\n },\n);\n\nButtonBase.displayName = 'ButtonBase';\n"]}
1
+ {"version":3,"file":"ButtonBase.mjs","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,6BAA6B;AACvD,OAAO,QAAO,EAAE,UAAU,EAAE,cAAc;;AAE1C,OAAO,EAAE,cAAc,EAAE,8BAAoB;AAC7C,OAAO,EAAE,OAAO,EAAE,iCAA6B;AAC/C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,0BAAgB;AACnD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,0BAAgB;AAEtD,OAAO,EAAE,oCAAoC,EAAE,mCAA+B;AAG9E,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAClC,CACE,EACE,QAAQ,EACR,SAAS,EACT,IAAI,GAAG,cAAc,CAAC,EAAE,EACxB,WAAW,EACX,OAAO,EACP,UAAU,EACV,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,cAAc,EACd,W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AAU,EACV,0BAA0B;IAC1B,6CAA6C;IAC7C,UAAU;IACV,OAAO;IACP,oCAAoC,CAAC,IAAI,CAAC;IAC1C,aAAa;IACb,WAAW,IAAI,QAAQ;IACvB,oDAAoD;IACpD,aAAa,IAAI;QACf,gBAAgB;QAChB,cAAc;QACd,aAAa;QACb,qBAAqB;QACrB,2CAA2C;KAC5C;IACD,0DAA0D;IAC1D,CAAC,UAAU,IAAI,SAAS,CAAC,IAAI,oBAAoB,EACjD,UAAU,IAAI,YAAY;IAC1B,iBAAiB;IACjB,SAAS,CACV,CAAC;IAEF,OAAO,CACL,oBAAC,SAAS,IACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,eAAe,EAC1B,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,UAAU,IAAI,SAAS,CAAC,mBAC1C,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,eACnC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,gBAC7B,SAAS,qBACJ,cAAc,sBACb,eAAe,kBACnB,WAAW,mBACV,YAAY,mBACZ,YAAY,mBACZ,YAAY,EAC3B,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,EACpC,QAAQ,EAAE,WAAW,EAAE,EACvB,KAAK,EAAE,KAAK,KACR,KAAK;QAER,kBAAkB,EAAE;QACrB,oBAAC,SAAS,QACP,SAAS,CAAC,CAAC,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC,aAAa,EAAE,CACzC;QACX,gBAAgB,EAAE,CACT,CACb,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["import { Slot, Slottable } from '@radix-ui/react-slot';\nimport React, { forwardRef } from 'react';\n\nimport { ButtonBaseSize } from '../../types';\nimport { twMerge } from '../../utils/tw-merge';\nimport { Icon, IconName, IconSize } from '../Icon';\nimport { Text, FontWeight, TextColor } from '../Text';\n\nimport { TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION } from './ButtonBase.constants';\nimport type { ButtonBaseProps } from './ButtonBase.types';\n\nexport const ButtonBase = forwardRef<HTMLButtonElement, ButtonBaseProps>(\n (\n {\n children,\n className,\n size = ButtonBaseSize.Lg,\n isFullWidth,\n asChild,\n isDisabled,\n isLoading,\n loadingText,\n loadingIconProps,\n loadingTextProps,\n startIconName,\n startIconProps,\n startAccessory,\n endIconName,\n endIconProps,\n endAccessory,\n textProps,\n style,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n 'aria-pressed': ariaPressed,\n 'aria-expanded': ariaExpanded,\n 'aria-controls': ariaControls,\n 'aria-haspopup': ariaHaspopup,\n ...props\n },\n ref,\n ) => {\n const Component = asChild ? Slot : 'button';\n const isInteractive = !(isDisabled ?? isLoading);\n\n // Calculate tabIndex based on asChild and disabled state\n const getTabIndex = () => {\n if (asChild) {\n return undefined;\n }\n return isDisabled ? -1 : undefined;\n };\n\n const renderLoadingState = () => (\n <>\n <span className=\"absolute inline-flex items-center\" aria-hidden=\"true\">\n <Icon\n name={IconName.Loading}\n size={IconSize.Sm}\n className={twMerge(\n 'mr-2 animate-spin text-inherit',\n loadingIconProps?.className,\n )}\n {...loadingIconProps}\n />\n <Text\n fontWeight={FontWeight.Medium}\n color={TextColor.Inherit}\n asChild\n {...loadingTextProps}\n >\n <span>{loadingText}</span>\n </Text>\n </span>\n <span className=\"invisible inline-flex items-center\">{children}</span>\n {/* Screen reader announcement for loading */}\n <span className=\"sr-only\" aria-live=\"polite\" aria-atomic=\"true\">\n {loadingText || 'Loading'}\n </span>\n </>\n );\n\n const renderStartContent = () => {\n if (startIconName) {\n return (\n <Icon\n name={startIconName}\n size={IconSize.Sm}\n className={twMerge(\n 'mr-2 shrink-0 text-inherit',\n startIconProps?.className,\n )}\n aria-hidden=\"true\"\n {...startIconProps}\n />\n );\n }\n if (startAccessory) {\n return (\n <span className=\"mr-2\" aria-hidden=\"true\">\n {startAccessory}\n </span>\n );\n }\n return null;\n };\n\n const renderEndContent = () => {\n if (endIconName) {\n return (\n <Icon\n name={endIconName}\n size={IconSize.Sm}\n className={twMerge(\n 'ml-2 shrink-0 text-inherit',\n endIconProps?.className,\n )}\n aria-hidden=\"true\"\n {...endIconProps}\n />\n );\n }\n if (endAccessory) {\n return (\n <span className=\"ml-2\" aria-hidden=\"true\">\n {endAccessory}\n </span>\n );\n }\n return null;\n };\n\n const renderContent = () => {\n if (children && typeof children === 'string') {\n return (\n <Text\n fontWeight={FontWeight.Medium}\n color={TextColor.Inherit}\n asChild\n {...textProps}\n >\n <span>{children}</span>\n </Text>\n );\n }\n return children;\n };\n\n const mergedClassName = twMerge(\n // Base styles\n 'inline-flex items-center justify-center',\n 'rounded-xl px-4',\n 'font-medium text-default',\n 'bg-muted',\n 'min-w-20 overflow-hidden',\n // Add relative positioning for loading state\n 'relative',\n // Size\n TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION[size],\n // Full width\n isFullWidth && 'w-full',\n // Animation classes - only applied when interactive\n isInteractive && [\n 'transition-all',\n 'duration-100',\n 'ease-linear',\n 'active:scale-[0.97]',\n 'active:ease-[cubic-bezier(0.3,0.8,0.3,1)]',\n ],\n // Disabled state - apply to both isDisabled and isLoading\n (isDisabled || isLoading) && 'cursor-not-allowed',\n isDisabled && 'opacity-50',\n // Custom classes\n className,\n );\n\n return (\n <Component\n ref={ref}\n className={mergedClassName}\n disabled={asChild ? undefined : (isDisabled ?? isLoading)}\n aria-disabled={isDisabled ? 'true' : undefined}\n aria-busy={isLoading ? 'true' : undefined}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n aria-pressed={ariaPressed}\n aria-expanded={ariaExpanded}\n aria-controls={ariaControls}\n aria-haspopup={ariaHaspopup}\n role={asChild ? undefined : 'button'}\n tabIndex={getTabIndex()}\n style={style}\n {...props}\n >\n {renderStartContent()}\n <Slottable>\n {isLoading ? renderLoadingState() : renderContent()}\n </Slottable>\n {renderEndContent()}\n </Component>\n );\n },\n);\n\nButtonBase.displayName = 'ButtonBase';\n"]}
@@ -59,11 +59,11 @@ exports.Checkbox = (0, react_1.forwardRef)(({ id, isSelected, isDisabled = false
59
59
  else if (isInvalid) {
60
60
  baseBorder = 'border-error-default';
61
61
  }
62
- const checkboxClasses = (0, tw_merge_1.twMerge)('relative flex h-6 w-6 items-center justify-center rounded border-2 p-0 transition-transform active:scale-95', baseBg, baseBorder, checkboxContainerProps?.className);
62
+ const checkboxClasses = (0, tw_merge_1.twMerge)('relative flex size-6 items-center justify-center rounded border-2 p-0 transition-transform active:scale-95', baseBg, baseBorder, checkboxContainerProps?.className);
63
63
  const iconClasses = (0, tw_merge_1.twMerge)('pointer-events-none transition-opacity', isSelected ? 'opacity-100' : 'opacity-0', checkedIconProps?.className);
64
64
  return (react_1.default.createElement("label", { htmlFor: id, className: outerClassName, style: style, ...props },
65
65
  react_1.default.createElement("div", { className: "relative" },
66
- react_1.default.createElement("input", { type: "checkbox", id: id, checked: isSelected, disabled: isDisabled, "aria-invalid": isInvalid, onChange: handleChange, onKeyDown: handleKeyDown, className: "absolute inset-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed", ...inputProps }),
66
+ react_1.default.createElement("input", { type: "checkbox", id: id, checked: isSelected, disabled: isDisabled, "aria-invalid": isInvalid, onChange: handleChange, onKeyDown: handleKeyDown, className: "absolute inset-0 size-full cursor-pointer opacity-0 disabled:cursor-not-allowed", ...inputProps }),
67
67
  react_1.default.createElement("div", { className: checkboxClasses, ...checkboxContainerProps },
68
68
  react_1.default.createElement(Icon_1.Icon, { name: Icon_1.IconName.Check, color: Icon_1.IconColor.PrimaryInverse, size: Icon_1.IconSize.Sm, ...checkedIconProps, className: iconClasses }))),
69
69
  label ? (react_1.default.createElement(Text_1.Text, { asChild: true, ...labelProps, className: (0, tw_merge_1.twMerge)('ml-3', labelProps?.className) },
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.cjs","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+CAA+D;AAE/D,uDAA+C;AAC/C,4CAA8D;AAC9D,4CAA+B;AAIlB,QAAA,QAAQ,GAAG,IAAA,kBAAU,EAChC,CACE,EACE,EAAE,EACF,UAAU,EACV,UAAU,GAAG,KAAK,EAClB,SAAS,GAAG,KAAK,EACjB,KAAK,EACL,UAAU,EACV,QAAQ,EACR,UAAU,EACV,sBAAsB,EACtB,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,YAAY,GAAG,CAAC,KAAoC,EAAE,EAAE;QAC5D,IAAI,UAAU,EAAE;YACd,OAAO;SACR;QACD,QAAQ,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,IAAI,UAAU,EAAE;YACd,OAAO;SACR;QACD,QAAQ,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC;IAC1B,CAAC,CAAC;IAEF,MAAM,aAAa,GAAG,CAAC,KAAsC,EAAE,EAAE;QAC/D,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,EAAE;YACzB,KAAK,CAAC,cAAc,EAAE,CAAC;YACvB,WAAW,EAAE,CAAC;SACf;IACH,CAAC,CAAC;IAEF,IAAA,2BAAmB,EAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAEzE,MAAM,cAAc,GAAG,IAAA,kBAAO,EAC5B,0BAA0B,EAC1B,UAAU,IAAI,+BAA+B,EAC7C,SAAS,CACV,CAAC;IAEF,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AO,KAAK,CAAQ,CACf,CACR,CAAC,CAAC,CAAC,IAAI,CACF,CACT,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAQ,CAAC,WAAW,GAAG,UAAU,CAAC","sourcesContent":["import type { ChangeEvent, KeyboardEvent } from 'react';\nimport React, { forwardRef, useImperativeHandle } from 'react';\n\nimport { twMerge } from '../../utils/tw-merge';\nimport { Icon, IconName, IconColor, IconSize } from '../Icon';\nimport { Text } from '../Text';\n\nimport type { CheckboxProps } from './Checkbox.types';\n\nexport const Checkbox = forwardRef<{ toggle: () => void }, CheckboxProps>(\n (\n {\n id,\n isSelected,\n isDisabled = false,\n isInvalid = false,\n label,\n labelProps,\n onChange,\n inputProps,\n checkboxContainerProps,\n checkedIconProps,\n className,\n style,\n ...props\n },\n ref,\n ) => {\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n if (isDisabled) {\n return;\n }\n onChange?.(event.target.checked);\n };\n\n const handleClick = () => {\n if (isDisabled) {\n return;\n }\n onChange?.(!isSelected);\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n event.preventDefault();\n handleClick();\n }\n };\n\n useImperativeHandle(ref, () => ({ toggle: handleClick }), [handleClick]);\n\n const outerClassName = twMerge(\n 'inline-flex items-center',\n isDisabled && 'cursor-not-allowed opacity-50',\n className,\n );\n\n const baseBg = isSelected\n ? 'bg-primary-default hover:bg-primary-default-hover active:bg-primary-default-pressed'\n : 'bg-default hover:bg-default-hover active:bg-default-pressed';\n let baseBorder = 'border-default';\n if (isSelected) {\n baseBorder = 'border-primary-default';\n } else if (isInvalid) {\n baseBorder = 'border-error-default';\n }\n\n const checkboxClasses = twMerge(\n 'relative flex h-6 w-6 items-center justify-center rounded border-2 p-0 transition-transform active:scale-95',\n baseBg,\n baseBorder,\n checkboxContainerProps?.className,\n );\n\n const iconClasses = twMerge(\n 'pointer-events-none transition-opacity',\n isSelected ? 'opacity-100' : 'opacity-0',\n checkedIconProps?.className,\n );\n\n return (\n <label htmlFor={id} className={outerClassName} style={style} {...props}>\n <div className=\"relative\">\n <input\n type=\"checkbox\"\n id={id}\n checked={isSelected}\n disabled={isDisabled}\n aria-invalid={isInvalid}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n className=\"absolute inset-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed\"\n {...inputProps}\n />\n <div className={checkboxClasses} {...checkboxContainerProps}>\n <Icon\n name={IconName.Check}\n color={IconColor.PrimaryInverse}\n size={IconSize.Sm}\n {...checkedIconProps}\n className={iconClasses}\n />\n </div>\n </div>\n {label ? (\n <Text\n asChild\n {...labelProps}\n className={twMerge('ml-3', labelProps?.className)}\n >\n <span>{label}</span>\n </Text>\n ) : null}\n </label>\n );\n },\n);\n\nCheckbox.displayName = 'Checkbox';\n"]}
1
+ {"version":3,"file":"Checkbox.cjs","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+CAA+D;AAE/D,uDAA+C;AAC/C,4CAA8D;AAC9D,4CAA+B;AAIlB,QAAA,QAAQ,GAAG,IAAA,kBAAU,EAChC,CACE,EACE,EAAE,EACF,UAAU,EACV,UAAU,GAAG,KAAK,EAClB,SAAS,GAAG,KAAK,EACjB,KAAK,EACL,UAAU,EACV,QAAQ,EACR,UAAU,EACV,sBAAsB,EACtB,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,YAAY,GAAG,CAAC,KAAoC,EAAE,EAAE;QAC5D,IAAI,UAAU,EAAE;YACd,OAAO;SACR;QACD,QAAQ,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,IAAI,UAAU,EAAE;YACd,OAAO;SACR;QACD,QAAQ,EAAE,CAAC,CAA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AQ,EAAE,YAAY,EACtB,SAAS,EAAE,aAAa,EACxB,SAAS,EAAC,iFAAiF,KACvF,UAAU,GACd;YACF,uCAAK,SAAS,EAAE,eAAe,KAAM,sBAAsB;gBACzD,8BAAC,WAAI,IACH,IAAI,EAAE,eAAQ,CAAC,KAAK,EACpB,KAAK,EAAE,gBAAS,CAAC,cAAc,EAC/B,IAAI,EAAE,eAAQ,CAAC,EAAE,KACb,gBAAgB,EACpB,SAAS,EAAE,WAAW,GACtB,CACE,CACF;QACL,KAAK,CAAC,CAAC,CAAC,CACP,8BAAC,WAAI,IACH,OAAO,WACH,UAAU,EACd,SAAS,EAAE,IAAA,kBAAO,EAAC,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC;YAEjD,4CAAO,KAAK,CAAQ,CACf,CACR,CAAC,CAAC,CAAC,IAAI,CACF,CACT,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAQ,CAAC,WAAW,GAAG,UAAU,CAAC","sourcesContent":["import type { ChangeEvent, KeyboardEvent } from 'react';\nimport React, { forwardRef, useImperativeHandle } from 'react';\n\nimport { twMerge } from '../../utils/tw-merge';\nimport { Icon, IconName, IconColor, IconSize } from '../Icon';\nimport { Text } from '../Text';\n\nimport type { CheckboxProps } from './Checkbox.types';\n\nexport const Checkbox = forwardRef<{ toggle: () => void }, CheckboxProps>(\n (\n {\n id,\n isSelected,\n isDisabled = false,\n isInvalid = false,\n label,\n labelProps,\n onChange,\n inputProps,\n checkboxContainerProps,\n checkedIconProps,\n className,\n style,\n ...props\n },\n ref,\n ) => {\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n if (isDisabled) {\n return;\n }\n onChange?.(event.target.checked);\n };\n\n const handleClick = () => {\n if (isDisabled) {\n return;\n }\n onChange?.(!isSelected);\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n event.preventDefault();\n handleClick();\n }\n };\n\n useImperativeHandle(ref, () => ({ toggle: handleClick }), [handleClick]);\n\n const outerClassName = twMerge(\n 'inline-flex items-center',\n isDisabled && 'cursor-not-allowed opacity-50',\n className,\n );\n\n const baseBg = isSelected\n ? 'bg-primary-default hover:bg-primary-default-hover active:bg-primary-default-pressed'\n : 'bg-default hover:bg-default-hover active:bg-default-pressed';\n let baseBorder = 'border-default';\n if (isSelected) {\n baseBorder = 'border-primary-default';\n } else if (isInvalid) {\n baseBorder = 'border-error-default';\n }\n\n const checkboxClasses = twMerge(\n 'relative flex size-6 items-center justify-center rounded border-2 p-0 transition-transform active:scale-95',\n baseBg,\n baseBorder,\n checkboxContainerProps?.className,\n );\n\n const iconClasses = twMerge(\n 'pointer-events-none transition-opacity',\n isSelected ? 'opacity-100' : 'opacity-0',\n checkedIconProps?.className,\n );\n\n return (\n <label htmlFor={id} className={outerClassName} style={style} {...props}>\n <div className=\"relative\">\n <input\n type=\"checkbox\"\n id={id}\n checked={isSelected}\n disabled={isDisabled}\n aria-invalid={isInvalid}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n className=\"absolute inset-0 size-full cursor-pointer opacity-0 disabled:cursor-not-allowed\"\n {...inputProps}\n />\n <div className={checkboxClasses} {...checkboxContainerProps}>\n <Icon\n name={IconName.Check}\n color={IconColor.PrimaryInverse}\n size={IconSize.Sm}\n {...checkedIconProps}\n className={iconClasses}\n />\n </div>\n </div>\n {label ? (\n <Text\n asChild\n {...labelProps}\n className={twMerge('ml-3', labelProps?.className)}\n >\n <span>{label}</span>\n </Text>\n ) : null}\n </label>\n );\n },\n);\n\nCheckbox.displayName = 'Checkbox';\n"]}
@@ -40,11 +40,11 @@ export const Checkbox = forwardRef(({ id, isSelected, isDisabled = false, isInva
40
40
  else if (isInvalid) {
41
41
  baseBorder = 'border-error-default';
42
42
  }
43
- const checkboxClasses = twMerge('relative flex h-6 w-6 items-center justify-center rounded border-2 p-0 transition-transform active:scale-95', baseBg, baseBorder, checkboxContainerProps?.className);
43
+ const checkboxClasses = twMerge('relative flex size-6 items-center justify-center rounded border-2 p-0 transition-transform active:scale-95', baseBg, baseBorder, checkboxContainerProps?.className);
44
44
  const iconClasses = twMerge('pointer-events-none transition-opacity', isSelected ? 'opacity-100' : 'opacity-0', checkedIconProps?.className);
45
45
  return (React.createElement("label", { htmlFor: id, className: outerClassName, style: style, ...props },
46
46
  React.createElement("div", { className: "relative" },
47
- React.createElement("input", { type: "checkbox", id: id, checked: isSelected, disabled: isDisabled, "aria-invalid": isInvalid, onChange: handleChange, onKeyDown: handleKeyDown, className: "absolute inset-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed", ...inputProps }),
47
+ React.createElement("input", { type: "checkbox", id: id, checked: isSelected, disabled: isDisabled, "aria-invalid": isInvalid, onChange: handleChange, onKeyDown: handleKeyDown, className: "absolute inset-0 size-full cursor-pointer opacity-0 disabled:cursor-not-allowed", ...inputProps }),
48
48
  React.createElement("div", { className: checkboxClasses, ...checkboxContainerProps },
49
49
  React.createElement(Icon, { name: IconName.Check, color: IconColor.PrimaryInverse, size: IconSize.Sm, ...checkedIconProps, className: iconClasses }))),
50
50
  label ? (React.createElement(Text, { asChild: true, ...labelProps, className: twMerge('ml-3', labelProps?.className) },
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.mjs","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":";;;;;;AACA,OAAO,QAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,cAAc;;AAE/D,OAAO,EAAE,OAAO,EAAE,iCAA6B;AAC/C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,0BAAgB;AAC9D,OAAO,EAAE,IAAI,EAAE,0BAAgB;AAI/B,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAChC,CACE,EACE,EAAE,EACF,UAAU,EACV,UAAU,GAAG,KAAK,EAClB,SAAS,GAAG,KAAK,EACjB,KAAK,EACL,UAAU,EACV,QAAQ,EACR,UAAU,EACV,sBAAsB,EAC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C,aAAa,CAAC,CAAC,CAAC,WAAW,EACxC,gBAAgB,EAAE,SAAS,CAC5B,CAAC;IAEF,OAAO,CACL,+BAAO,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,KAAM,KAAK;QACpE,6BAAK,SAAS,EAAC,UAAU;YACvB,+BACE,IAAI,EAAC,UAAU,EACf,EAAE,EAAE,EAAE,EACN,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,UAAU,kBACN,SAAS,EACvB,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,aAAa,EACxB,SAAS,EAAC,qFAAqF,KAC3F,UAAU,GACd;YACF,6BAAK,SAAS,EAAE,eAAe,KAAM,sBAAsB;gBACzD,oBAAC,IAAI,IACH,IAAI,EAAE,QAAQ,CAAC,KAAK,EACpB,KAAK,EAAE,SAAS,CAAC,cAAc,EAC/B,IAAI,EAAE,QAAQ,CAAC,EAAE,KACb,gBAAgB,EACpB,SAAS,EAAE,WAAW,GACtB,CACE,CACF;QACL,KAAK,CAAC,CAAC,CAAC,CACP,oBAAC,IAAI,IACH,OAAO,WACH,UAAU,EACd,SAAS,EAAE,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC;YAEjD,kCAAO,KAAK,CAAQ,CACf,CACR,CAAC,CAAC,CAAC,IAAI,CACF,CACT,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC","sourcesContent":["import type { ChangeEvent, KeyboardEvent } from 'react';\nimport React, { forwardRef, useImperativeHandle } from 'react';\n\nimport { twMerge } from '../../utils/tw-merge';\nimport { Icon, IconName, IconColor, IconSize } from '../Icon';\nimport { Text } from '../Text';\n\nimport type { CheckboxProps } from './Checkbox.types';\n\nexport const Checkbox = forwardRef<{ toggle: () => void }, CheckboxProps>(\n (\n {\n id,\n isSelected,\n isDisabled = false,\n isInvalid = false,\n label,\n labelProps,\n onChange,\n inputProps,\n checkboxContainerProps,\n checkedIconProps,\n className,\n style,\n ...props\n },\n ref,\n ) => {\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n if (isDisabled) {\n return;\n }\n onChange?.(event.target.checked);\n };\n\n const handleClick = () => {\n if (isDisabled) {\n return;\n }\n onChange?.(!isSelected);\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n event.preventDefault();\n handleClick();\n }\n };\n\n useImperativeHandle(ref, () => ({ toggle: handleClick }), [handleClick]);\n\n const outerClassName = twMerge(\n 'inline-flex items-center',\n isDisabled && 'cursor-not-allowed opacity-50',\n className,\n );\n\n const baseBg = isSelected\n ? 'bg-primary-default hover:bg-primary-default-hover active:bg-primary-default-pressed'\n : 'bg-default hover:bg-default-hover active:bg-default-pressed';\n let baseBorder = 'border-default';\n if (isSelected) {\n baseBorder = 'border-primary-default';\n } else if (isInvalid) {\n baseBorder = 'border-error-default';\n }\n\n const checkboxClasses = twMerge(\n 'relative flex h-6 w-6 items-center justify-center rounded border-2 p-0 transition-transform active:scale-95',\n baseBg,\n baseBorder,\n checkboxContainerProps?.className,\n );\n\n const iconClasses = twMerge(\n 'pointer-events-none transition-opacity',\n isSelected ? 'opacity-100' : 'opacity-0',\n checkedIconProps?.className,\n );\n\n return (\n <label htmlFor={id} className={outerClassName} style={style} {...props}>\n <div className=\"relative\">\n <input\n type=\"checkbox\"\n id={id}\n checked={isSelected}\n disabled={isDisabled}\n aria-invalid={isInvalid}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n className=\"absolute inset-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed\"\n {...inputProps}\n />\n <div className={checkboxClasses} {...checkboxContainerProps}>\n <Icon\n name={IconName.Check}\n color={IconColor.PrimaryInverse}\n size={IconSize.Sm}\n {...checkedIconProps}\n className={iconClasses}\n />\n </div>\n </div>\n {label ? (\n <Text\n asChild\n {...labelProps}\n className={twMerge('ml-3', labelProps?.className)}\n >\n <span>{label}</span>\n </Text>\n ) : null}\n </label>\n );\n },\n);\n\nCheckbox.displayName = 'Checkbox';\n"]}
1
+ {"version":3,"file":"Checkbox.mjs","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":";;;;;;AACA,OAAO,QAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,cAAc;;AAE/D,OAAO,EAAE,OAAO,EAAE,iCAA6B;AAC/C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,0BAAgB;AAC9D,OAAO,EAAE,IAAI,EAAE,0BAAgB;AAI/B,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAChC,CACE,EACE,EAAE,EACF,UAAU,EACV,UAAU,GAAG,KAAK,EAClB,SAAS,GAAG,KAAK,EACjB,KAAK,EACL,UAAU,EACV,QAAQ,EACR,UAAU,EACV,sBAAsB,EACtB,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,YAAY,GAAG,CAAC,KAAoC,EAAE,EAAE;QAC5D,IAAI,UAAU,EAAE;YACd,OAAO;SACR;QACD,QAAQ,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,IAAI,UAAU,EAAE;YACd,OAAO;SACR;QACD,QAAQ,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC;IAC1B,CAAC,CAAC;IAEF,MAAM,aAAa,GAAG,CAAC,KAAsC,EAAE,EAAE;QAC/D,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,EAAE;YACzB,KAAK,CAAC,cAAc,EAAE,CAAC;YACvB,WAAW,EAAE,CAAC;SACf;IACH,CAAC,CAAC;IAEF,mBAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,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,CACP,oBAAC,IAAI,IACH,OAAO,WACH,UAAU,EACd,SAAS,EAAE,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC;YAEjD,kCAAO,KAAK,CAAQ,CACf,CACR,CAAC,CAAC,CAAC,IAAI,CACF,CACT,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC","sourcesContent":["import type { ChangeEvent, KeyboardEvent } from 'react';\nimport React, { forwardRef, useImperativeHandle } from 'react';\n\nimport { twMerge } from '../../utils/tw-merge';\nimport { Icon, IconName, IconColor, IconSize } from '../Icon';\nimport { Text } from '../Text';\n\nimport type { CheckboxProps } from './Checkbox.types';\n\nexport const Checkbox = forwardRef<{ toggle: () => void }, CheckboxProps>(\n (\n {\n id,\n isSelected,\n isDisabled = false,\n isInvalid = false,\n label,\n labelProps,\n onChange,\n inputProps,\n checkboxContainerProps,\n checkedIconProps,\n className,\n style,\n ...props\n },\n ref,\n ) => {\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n if (isDisabled) {\n return;\n }\n onChange?.(event.target.checked);\n };\n\n const handleClick = () => {\n if (isDisabled) {\n return;\n }\n onChange?.(!isSelected);\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n event.preventDefault();\n handleClick();\n }\n };\n\n useImperativeHandle(ref, () => ({ toggle: handleClick }), [handleClick]);\n\n const outerClassName = twMerge(\n 'inline-flex items-center',\n isDisabled && 'cursor-not-allowed opacity-50',\n className,\n );\n\n const baseBg = isSelected\n ? 'bg-primary-default hover:bg-primary-default-hover active:bg-primary-default-pressed'\n : 'bg-default hover:bg-default-hover active:bg-default-pressed';\n let baseBorder = 'border-default';\n if (isSelected) {\n baseBorder = 'border-primary-default';\n } else if (isInvalid) {\n baseBorder = 'border-error-default';\n }\n\n const checkboxClasses = twMerge(\n 'relative flex size-6 items-center justify-center rounded border-2 p-0 transition-transform active:scale-95',\n baseBg,\n baseBorder,\n checkboxContainerProps?.className,\n );\n\n const iconClasses = twMerge(\n 'pointer-events-none transition-opacity',\n isSelected ? 'opacity-100' : 'opacity-0',\n checkedIconProps?.className,\n );\n\n return (\n <label htmlFor={id} className={outerClassName} style={style} {...props}>\n <div className=\"relative\">\n <input\n type=\"checkbox\"\n id={id}\n checked={isSelected}\n disabled={isDisabled}\n aria-invalid={isInvalid}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n className=\"absolute inset-0 size-full cursor-pointer opacity-0 disabled:cursor-not-allowed\"\n {...inputProps}\n />\n <div className={checkboxClasses} {...checkboxContainerProps}>\n <Icon\n name={IconName.Check}\n color={IconColor.PrimaryInverse}\n size={IconSize.Sm}\n {...checkedIconProps}\n className={iconClasses}\n />\n </div>\n </div>\n {label ? (\n <Text\n asChild\n {...labelProps}\n className={twMerge('ml-3', labelProps?.className)}\n >\n <span>{label}</span>\n </Text>\n ) : null}\n </label>\n );\n },\n);\n\nCheckbox.displayName = 'Checkbox';\n"]}
@@ -0,0 +1,32 @@
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
+ const React = __importStar(require("react"));
27
+ const react_1 = require("react");
28
+ const SvgAppleLogo = (props, ref) => React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", ref: ref, ...props },
29
+ React.createElement("path", { d: "M14.935 5.204c.689-.863 1.156-2.022 1.033-3.206-1.009.05-2.24.666-2.952 1.53-.64.74-1.207 1.947-1.059 3.081 1.132.099 2.264-.566 2.978-1.405M15.955 6.83c-1.644-.097-3.042.935-3.828.935s-1.988-.885-3.289-.861c-1.693.025-3.263.983-4.122 2.508-1.767 3.049-.467 7.572 1.252 10.056.834 1.228 1.84 2.581 3.165 2.533 1.252-.05 1.742-.812 3.264-.812 1.52 0 1.963.812 3.288.787 1.374-.025 2.234-1.23 3.068-2.46.957-1.4 1.349-2.752 1.374-2.826-.025-.025-2.65-1.033-2.675-4.057-.025-2.532 2.061-3.737 2.16-3.812-1.178-1.744-3.019-1.94-3.657-1.99" }));
30
+ const ForwardRef = (0, react_1.forwardRef)(SvgAppleLogo);
31
+ exports.default = ForwardRef;
32
+ //# sourceMappingURL=AppleLogo.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppleLogo.cjs","sourceRoot":"","sources":["../../../../src/components/Icon/icons/AppleLogo.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAE/B,iCAAwC;AACxC,MAAM,YAAY,GAAG,CAAC,KAA8B,EAAE,GAAuB,EAAE,EAAE,CAAC,6BAAK,KAAK,EAAC,4BAA4B,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,cAAc,EAAC,GAAG,EAAE,GAAG,KAAM,KAAK;IAAE,8BAAM,CAAC,EAAC,whBAAwhB,GAAG,CAAM,CAAC;AACjuB,MAAM,UAAU,GAAG,IAAA,kBAAU,EAAC,YAAY,CAAC,CAAC;AAC5C,kBAAe,UAAU,CAAC","sourcesContent":["import * as React from \"react\";\nimport type { SVGProps } from \"react\";\nimport { Ref, forwardRef } from \"react\";\nconst SvgAppleLogo = (props: SVGProps<SVGSVGElement>, ref: Ref<SVGSVGElement>) => <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" ref={ref} {...props}><path d=\"M14.935 5.204c.689-.863 1.156-2.022 1.033-3.206-1.009.05-2.24.666-2.952 1.53-.64.74-1.207 1.947-1.059 3.081 1.132.099 2.264-.566 2.978-1.405M15.955 6.83c-1.644-.097-3.042.935-3.828.935s-1.988-.885-3.289-.861c-1.693.025-3.263.983-4.122 2.508-1.767 3.049-.467 7.572 1.252 10.056.834 1.228 1.84 2.581 3.165 2.533 1.252-.05 1.742-.812 3.264-.812 1.52 0 1.963.812 3.288.787 1.374-.025 2.234-1.23 3.068-2.46.957-1.4 1.349-2.752 1.374-2.826-.025-.025-2.65-1.033-2.675-4.057-.025-2.532 2.061-3.737 2.16-3.812-1.178-1.744-3.019-1.94-3.657-1.99\" /></svg>;\nconst ForwardRef = forwardRef(SvgAppleLogo);\nexport default ForwardRef;"]}
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ declare const ForwardRef: React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGSVGElement>, "ref"> & React.RefAttributes<SVGSVGElement>>;
3
+ export default ForwardRef;
4
+ //# sourceMappingURL=AppleLogo.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppleLogo.d.cts","sourceRoot":"","sources":["../../../../src/components/Icon/icons/AppleLogo.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,cAAc;AAI/B,QAAA,MAAM,UAAU,kHAA2B,CAAC;AAC5C,eAAe,UAAU,CAAC"}