@audira/carbon-react-native 1.0.0-beta.7 → 1.0.0-beta.8

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 (460) hide show
  1. package/lib/commonjs/components/modal/Modal.js +19 -15
  2. package/lib/commonjs/components/modal/Modal.js.map +1 -1
  3. package/lib/module/components/modal/Modal.js +19 -15
  4. package/lib/module/components/modal/Modal.js.map +1 -1
  5. package/lib/typescript/commonjs/components/modal/Modal.d.ts.map +1 -1
  6. package/lib/typescript/module/components/modal/Modal.d.ts.map +1 -1
  7. package/lib/typescript/tsconfig.tsbuildinfo +1 -1
  8. package/package.json +2 -1
  9. package/src/_internal/contexts/button-group/ButtonGroupContext.ts +25 -0
  10. package/src/_internal/contexts/button-group/index.tsx +1 -0
  11. package/src/_internal/contexts/global-config/GlobalConfigContext.ts +30 -0
  12. package/src/_internal/contexts/global-config/index.ts +1 -0
  13. package/src/_internal/contexts/index.ts +3 -0
  14. package/src/_internal/contexts/modal/ModalContext.ts +15 -0
  15. package/src/_internal/contexts/modal/index.ts +1 -0
  16. package/src/_internal/globals/breakpoint/index.ts +13 -0
  17. package/src/_internal/globals/color-scheme/index.ts +13 -0
  18. package/src/_internal/globals/index.ts +7 -0
  19. package/src/_internal/helpers/index.ts +5 -0
  20. package/src/_internal/helpers/math/clamp.ts +3 -0
  21. package/src/_internal/helpers/math/index.ts +1 -0
  22. package/src/_internal/providers/breakpoint/BreakpointProvider.tsx +42 -0
  23. package/src/_internal/providers/breakpoint/BreakpointProviderProps.ts +3 -0
  24. package/src/_internal/providers/breakpoint/index.tsx +2 -0
  25. package/src/_internal/providers/global-config/GlobalConfigProvider.tsx +30 -0
  26. package/src/_internal/providers/global-config/GlobalConfigProviderProps.ts +7 -0
  27. package/src/_internal/providers/global-config/index.tsx +2 -0
  28. package/src/_internal/providers/index.ts +3 -0
  29. package/src/_internal/providers/theme/ThemeProvider.tsx +45 -0
  30. package/src/_internal/providers/theme/ThemeProviderProps.ts +8 -0
  31. package/src/_internal/providers/theme/index.tsx +2 -0
  32. package/src/_internal/style-sheets/common-style-sheet.ts +24 -0
  33. package/src/_internal/style-sheets/flex-style-sheet.ts +84 -0
  34. package/src/_internal/style-sheets/index.ts +3 -0
  35. package/src/_internal/style-sheets/text-style-sheet.ts +62 -0
  36. package/src/carbon-react-native/CarbonReactNative.tsx +41 -0
  37. package/src/carbon-react-native/CarbonReactNativeProps.ts +7 -0
  38. package/src/carbon-react-native/index.tsx +2 -0
  39. package/src/carbon-style-sheet/breakpoint.ts +16 -0
  40. package/src/carbon-style-sheet/color.ts +13 -0
  41. package/src/carbon-style-sheet/create.ts +232 -0
  42. package/src/carbon-style-sheet/index.tsx +51 -0
  43. package/src/carbon-style-sheet/use.tsx +16 -0
  44. package/src/components/accordion/Accordion.tsx +132 -0
  45. package/src/components/accordion/AccordionHeaderProps.ts +17 -0
  46. package/src/components/accordion/AccordionItemProps.ts +24 -0
  47. package/src/components/accordion/AccordionItemRef.ts +10 -0
  48. package/src/components/accordion/AccordionProps.ts +19 -0
  49. package/src/components/accordion/AccordionRef.ts +6 -0
  50. package/src/components/accordion/AccordionSize.ts +4 -0
  51. package/src/components/accordion/_Header.tsx +201 -0
  52. package/src/components/accordion/_HeaderBorder.tsx +75 -0
  53. package/src/components/accordion/_Item.tsx +175 -0
  54. package/src/components/accordion/_ItemRefBase.ts +7 -0
  55. package/src/components/accordion/_chevron/Chevron.tsx +97 -0
  56. package/src/components/accordion/_chevron/ChevronProps.ts +10 -0
  57. package/src/components/accordion/_chevron/index.ts +2 -0
  58. package/src/components/accordion/_context.ts +20 -0
  59. package/src/components/accordion/_motion.ts +27 -0
  60. package/src/components/accordion/_styles.ts +24 -0
  61. package/src/components/accordion/index.tsx +7 -0
  62. package/src/components/button/Size.ts +7 -0
  63. package/src/components/button/base/Base.tsx +328 -0
  64. package/src/components/button/base/BaseProps.ts +60 -0
  65. package/src/components/button/base/BaseRef.ts +6 -0
  66. package/src/components/button/base/index.tsx +3 -0
  67. package/src/components/button/base-color/BaseColor.tsx +289 -0
  68. package/src/components/button/base-color/BaseColorProps.ts +32 -0
  69. package/src/components/button/base-color/BaseColorRef.ts +6 -0
  70. package/src/components/button/base-color/BaseColorState.ts +6 -0
  71. package/src/components/button/base-color/index.tsx +4 -0
  72. package/src/components/button/ghost/Ghost.tsx +165 -0
  73. package/src/components/button/ghost/GhostProps.ts +10 -0
  74. package/src/components/button/ghost/GhostRef.ts +6 -0
  75. package/src/components/button/ghost/index.tsx +3 -0
  76. package/src/components/button/ghost-danger/GhostDanger.tsx +165 -0
  77. package/src/components/button/ghost-danger/GhostDangerProps.ts +10 -0
  78. package/src/components/button/ghost-danger/GhostDangerRef.ts +6 -0
  79. package/src/components/button/ghost-danger/index.tsx +3 -0
  80. package/src/components/button/ghost-icon/GhostIcon.tsx +127 -0
  81. package/src/components/button/ghost-icon/GhostIconProps.ts +17 -0
  82. package/src/components/button/ghost-icon/GhostIconRef.ts +6 -0
  83. package/src/components/button/ghost-icon/index.tsx +3 -0
  84. package/src/components/button/index.tsx +11 -0
  85. package/src/components/button/primary/Primary.tsx +140 -0
  86. package/src/components/button/primary/PrimaryProps.ts +11 -0
  87. package/src/components/button/primary/PrimaryRef.ts +6 -0
  88. package/src/components/button/primary/index.tsx +3 -0
  89. package/src/components/button/primary-danger/PrimaryDanger.tsx +140 -0
  90. package/src/components/button/primary-danger/PrimaryDangerProps.ts +12 -0
  91. package/src/components/button/primary-danger/PrimaryDangerRef.ts +6 -0
  92. package/src/components/button/primary-danger/index.tsx +3 -0
  93. package/src/components/button/secondary/Secondary.tsx +140 -0
  94. package/src/components/button/secondary/SecondaryProps.ts +12 -0
  95. package/src/components/button/secondary/SecondaryRef.ts +6 -0
  96. package/src/components/button/secondary/index.tsx +3 -0
  97. package/src/components/button/tertiary/Tertiary.tsx +157 -0
  98. package/src/components/button/tertiary/TertiaryProps.ts +12 -0
  99. package/src/components/button/tertiary/TertiaryRef.ts +6 -0
  100. package/src/components/button/tertiary/index.tsx +3 -0
  101. package/src/components/button/tertiary-danger/TertiaryDanger.tsx +157 -0
  102. package/src/components/button/tertiary-danger/TertiaryDangerProps.ts +12 -0
  103. package/src/components/button/tertiary-danger/TertiaryDangerRef.ts +6 -0
  104. package/src/components/button/tertiary-danger/index.tsx +3 -0
  105. package/src/components/button-group/ButtonGroup.tsx +145 -0
  106. package/src/components/button-group/ButtonGroupProps.ts +37 -0
  107. package/src/components/button-group/ButtonGroupRef.ts +6 -0
  108. package/src/components/button-group/index.tsx +3 -0
  109. package/src/components/checkbox/Checkbox.tsx +221 -0
  110. package/src/components/checkbox/CheckboxProps.ts +39 -0
  111. package/src/components/checkbox/CheckboxRef.ts +10 -0
  112. package/src/components/checkbox/_RefBase.ts +11 -0
  113. package/src/components/checkbox/index.tsx +3 -0
  114. package/src/components/checkbox-group/CheckboxGroup.tsx +227 -0
  115. package/src/components/checkbox-group/CheckboxGroupHelperTextMode.ts +4 -0
  116. package/src/components/checkbox-group/CheckboxGroupProps.ts +28 -0
  117. package/src/components/checkbox-group/CheckboxGroupRef.ts +6 -0
  118. package/src/components/checkbox-group/index.tsx +4 -0
  119. package/src/components/checkbox-input/CheckboxInput.tsx +340 -0
  120. package/src/components/checkbox-input/CheckboxInputInteractiveState.ts +6 -0
  121. package/src/components/checkbox-input/CheckboxInputProps.ts +25 -0
  122. package/src/components/checkbox-input/CheckboxInputRef.ts +11 -0
  123. package/src/components/checkbox-input/CheckboxInputValue.ts +6 -0
  124. package/src/components/checkbox-input/_RefBase.ts +11 -0
  125. package/src/components/checkbox-input/index.tsx +5 -0
  126. package/src/components/collapsible/Collapsible.tsx +274 -0
  127. package/src/components/collapsible/CollapsibleProps.ts +17 -0
  128. package/src/components/collapsible/CollapsibleRef.ts +11 -0
  129. package/src/components/collapsible/_RefBase.ts +6 -0
  130. package/src/components/collapsible/index.ts +3 -0
  131. package/src/components/form-helper-text/FormHelperText.tsx +109 -0
  132. package/src/components/form-helper-text/FormHelperTextProps.ts +15 -0
  133. package/src/components/form-helper-text/FormHelperTextRef.ts +6 -0
  134. package/src/components/form-helper-text/index.tsx +3 -0
  135. package/src/components/form-label/FormLabel.tsx +85 -0
  136. package/src/components/form-label/FormLabelProps.ts +17 -0
  137. package/src/components/form-label/FormLabelRef.ts +6 -0
  138. package/src/components/form-label/index.tsx +3 -0
  139. package/src/components/icon/Icon.tsx +48 -0
  140. package/src/components/icon/IconProps.ts +11 -0
  141. package/src/components/icon/index.tsx +2 -0
  142. package/src/components/index.tsx +35 -0
  143. package/src/components/inline-loading/InlineLoading.tsx +144 -0
  144. package/src/components/inline-loading/InlineLoadingProps.ts +24 -0
  145. package/src/components/inline-loading/InlineLoadingRef.ts +6 -0
  146. package/src/components/inline-loading/InlineLoadingState.ts +5 -0
  147. package/src/components/inline-loading/index.tsx +4 -0
  148. package/src/components/layer/Layer.tsx +87 -0
  149. package/src/components/layer/LayerContext.ts +9 -0
  150. package/src/components/layer/LayerProps.ts +16 -0
  151. package/src/components/layer/LayerRef.ts +6 -0
  152. package/src/components/layer/index.tsx +4 -0
  153. package/src/components/loading/Loading.tsx +116 -0
  154. package/src/components/loading/LoadingProps.ts +14 -0
  155. package/src/components/loading/LoadingRef.ts +4 -0
  156. package/src/components/loading/LoadingType.ts +3 -0
  157. package/src/components/loading/_circular-progress/CircularProgress.tsx +113 -0
  158. package/src/components/loading/_circular-progress/CircularProgressProps.ts +18 -0
  159. package/src/components/loading/_circular-progress/index.ts +2 -0
  160. package/src/components/loading/_map-circle-background-color.ts +26 -0
  161. package/src/components/loading/_map-circle-stroke-color.ts +13 -0
  162. package/src/components/loading/index.ts +4 -0
  163. package/src/components/modal/Modal.tsx +397 -0
  164. package/src/components/modal/ModalProps.ts +24 -0
  165. package/src/components/modal/ModalRef.ts +6 -0
  166. package/src/components/modal/ModalSize.ts +5 -0
  167. package/src/components/modal/index.tsx +4 -0
  168. package/src/components/modal-content/ModalContent.tsx +182 -0
  169. package/src/components/modal-content/ModalContentProps.ts +7 -0
  170. package/src/components/modal-content/ModalContentRef.ts +6 -0
  171. package/src/components/modal-content/index.tsx +3 -0
  172. package/src/components/notification/NotificationColor.ts +3 -0
  173. package/src/components/notification/_VariantContextProvider.tsx +39 -0
  174. package/src/components/notification/_status-hooks/_base/UseBaseData.ts +11 -0
  175. package/src/components/notification/_status-hooks/_base/UseBaseProps.ts +21 -0
  176. package/src/components/notification/_status-hooks/_base/index.tsx +3 -0
  177. package/src/components/notification/_status-hooks/_base/useBase.tsx +77 -0
  178. package/src/components/notification/_status-hooks/error/UseErrorData.ts +11 -0
  179. package/src/components/notification/_status-hooks/error/UseErrorProps.ts +8 -0
  180. package/src/components/notification/_status-hooks/error/index.tsx +3 -0
  181. package/src/components/notification/_status-hooks/error/useError.tsx +122 -0
  182. package/src/components/notification/_status-hooks/index.tsx +4 -0
  183. package/src/components/notification/_status-hooks/informational/UseInformationalData.ts +11 -0
  184. package/src/components/notification/_status-hooks/informational/UseInformationalProps.ts +8 -0
  185. package/src/components/notification/_status-hooks/informational/index.tsx +3 -0
  186. package/src/components/notification/_status-hooks/informational/useInformational.tsx +122 -0
  187. package/src/components/notification/_status-hooks/success/UseSuccessData.ts +11 -0
  188. package/src/components/notification/_status-hooks/success/UseSuccessProps.ts +8 -0
  189. package/src/components/notification/_status-hooks/success/index.tsx +3 -0
  190. package/src/components/notification/_status-hooks/success/useSuccess.tsx +122 -0
  191. package/src/components/notification/_status-hooks/warning/UseWarningData.ts +11 -0
  192. package/src/components/notification/_status-hooks/warning/UseWarningProps.ts +8 -0
  193. package/src/components/notification/_status-hooks/warning/index.tsx +3 -0
  194. package/src/components/notification/_status-hooks/warning/useWarning.tsx +122 -0
  195. package/src/components/notification/_variant-context.ts +15 -0
  196. package/src/components/notification/_variants/_ButtonGhost.tsx +73 -0
  197. package/src/components/notification/_variants/_ButtonTertiary.tsx +73 -0
  198. package/src/components/notification/_variants/actionable/ActionableVariant.tsx +70 -0
  199. package/src/components/notification/_variants/actionable/ActionableVariantProps.ts +46 -0
  200. package/src/components/notification/_variants/actionable/ActionableVariantRef.ts +6 -0
  201. package/src/components/notification/_variants/actionable/index.tsx +3 -0
  202. package/src/components/notification/_variants/actionable-inline/ActionableInlineVariant.tsx +70 -0
  203. package/src/components/notification/_variants/actionable-inline/ActionableInlineVariantProps.ts +46 -0
  204. package/src/components/notification/_variants/actionable-inline/ActionableInlineVariantRef.ts +6 -0
  205. package/src/components/notification/_variants/actionable-inline/index.tsx +3 -0
  206. package/src/components/notification/_variants/callout/CalloutVariant.tsx +59 -0
  207. package/src/components/notification/_variants/callout/CalloutVariantProps.ts +26 -0
  208. package/src/components/notification/_variants/callout/CalloutVariantRef.ts +6 -0
  209. package/src/components/notification/_variants/callout/index.tsx +3 -0
  210. package/src/components/notification/_variants/callout-inline/CalloutInlineVariant.tsx +59 -0
  211. package/src/components/notification/_variants/callout-inline/CalloutInlineVariantProps.ts +26 -0
  212. package/src/components/notification/_variants/callout-inline/CalloutInlineVariantRef.ts +6 -0
  213. package/src/components/notification/_variants/callout-inline/index.tsx +3 -0
  214. package/src/components/notification/_variants/index.tsx +5 -0
  215. package/src/components/notification/_variants/toast/ToastVariant.tsx +115 -0
  216. package/src/components/notification/_variants/toast/ToastVariantProps.ts +30 -0
  217. package/src/components/notification/_variants/toast/ToastVariantRef.ts +6 -0
  218. package/src/components/notification/_variants/toast/index.tsx +3 -0
  219. package/src/components/notification/actionable/error/Error.tsx +78 -0
  220. package/src/components/notification/actionable/error/ErrorProps.ts +14 -0
  221. package/src/components/notification/actionable/error/ErrorRef.ts +6 -0
  222. package/src/components/notification/actionable/error/index.tsx +3 -0
  223. package/src/components/notification/actionable/index.tsx +4 -0
  224. package/src/components/notification/actionable/informational/Informational.tsx +78 -0
  225. package/src/components/notification/actionable/informational/InformationalProps.ts +14 -0
  226. package/src/components/notification/actionable/informational/InformationalRef.ts +6 -0
  227. package/src/components/notification/actionable/informational/index.tsx +3 -0
  228. package/src/components/notification/actionable/success/Success.tsx +78 -0
  229. package/src/components/notification/actionable/success/SuccessProps.ts +14 -0
  230. package/src/components/notification/actionable/success/SuccessRef.ts +6 -0
  231. package/src/components/notification/actionable/success/index.tsx +3 -0
  232. package/src/components/notification/actionable/warning/Warning.tsx +78 -0
  233. package/src/components/notification/actionable/warning/WarningProps.ts +14 -0
  234. package/src/components/notification/actionable/warning/WarningRef.ts +6 -0
  235. package/src/components/notification/actionable/warning/index.tsx +3 -0
  236. package/src/components/notification/actionable-inline/error/Error.tsx +77 -0
  237. package/src/components/notification/actionable-inline/error/ErrorProps.ts +14 -0
  238. package/src/components/notification/actionable-inline/error/ErrorRef.ts +6 -0
  239. package/src/components/notification/actionable-inline/error/index.tsx +3 -0
  240. package/src/components/notification/actionable-inline/index.tsx +4 -0
  241. package/src/components/notification/actionable-inline/informational/Informational.tsx +77 -0
  242. package/src/components/notification/actionable-inline/informational/InformationalProps.ts +14 -0
  243. package/src/components/notification/actionable-inline/informational/InformationalRef.ts +6 -0
  244. package/src/components/notification/actionable-inline/informational/index.tsx +3 -0
  245. package/src/components/notification/actionable-inline/success/Success.tsx +77 -0
  246. package/src/components/notification/actionable-inline/success/SuccessProps.ts +14 -0
  247. package/src/components/notification/actionable-inline/success/SuccessRef.ts +6 -0
  248. package/src/components/notification/actionable-inline/success/index.tsx +3 -0
  249. package/src/components/notification/actionable-inline/warning/Warning.tsx +77 -0
  250. package/src/components/notification/actionable-inline/warning/WarningProps.ts +14 -0
  251. package/src/components/notification/actionable-inline/warning/WarningRef.ts +6 -0
  252. package/src/components/notification/actionable-inline/warning/index.tsx +3 -0
  253. package/src/components/notification/base/Base.tsx +292 -0
  254. package/src/components/notification/base/BaseProps.ts +59 -0
  255. package/src/components/notification/base/BaseRef.ts +6 -0
  256. package/src/components/notification/base/index.tsx +3 -0
  257. package/src/components/notification/callout/error/Error.tsx +78 -0
  258. package/src/components/notification/callout/error/ErrorProps.ts +14 -0
  259. package/src/components/notification/callout/error/ErrorRef.ts +6 -0
  260. package/src/components/notification/callout/error/index.tsx +3 -0
  261. package/src/components/notification/callout/index.tsx +4 -0
  262. package/src/components/notification/callout/informational/Informational.tsx +78 -0
  263. package/src/components/notification/callout/informational/InformationalProps.ts +14 -0
  264. package/src/components/notification/callout/informational/InformationalRef.ts +6 -0
  265. package/src/components/notification/callout/informational/index.tsx +3 -0
  266. package/src/components/notification/callout/success/Success.tsx +78 -0
  267. package/src/components/notification/callout/success/SuccessProps.ts +14 -0
  268. package/src/components/notification/callout/success/SuccessRef.ts +6 -0
  269. package/src/components/notification/callout/success/index.tsx +3 -0
  270. package/src/components/notification/callout/warning/Warning.tsx +78 -0
  271. package/src/components/notification/callout/warning/WarningProps.ts +14 -0
  272. package/src/components/notification/callout/warning/WarningRef.ts +6 -0
  273. package/src/components/notification/callout/warning/index.tsx +3 -0
  274. package/src/components/notification/callout-inline/error/Error.tsx +77 -0
  275. package/src/components/notification/callout-inline/error/ErrorProps.ts +14 -0
  276. package/src/components/notification/callout-inline/error/ErrorRef.ts +6 -0
  277. package/src/components/notification/callout-inline/error/index.tsx +3 -0
  278. package/src/components/notification/callout-inline/index.tsx +4 -0
  279. package/src/components/notification/callout-inline/informational/Informational.tsx +77 -0
  280. package/src/components/notification/callout-inline/informational/InformationalProps.ts +14 -0
  281. package/src/components/notification/callout-inline/informational/InformationalRef.ts +6 -0
  282. package/src/components/notification/callout-inline/informational/index.tsx +3 -0
  283. package/src/components/notification/callout-inline/success/Success.tsx +77 -0
  284. package/src/components/notification/callout-inline/success/SuccessProps.ts +14 -0
  285. package/src/components/notification/callout-inline/success/SuccessRef.ts +6 -0
  286. package/src/components/notification/callout-inline/success/index.tsx +3 -0
  287. package/src/components/notification/callout-inline/warning/Warning.tsx +77 -0
  288. package/src/components/notification/callout-inline/warning/WarningProps.ts +14 -0
  289. package/src/components/notification/callout-inline/warning/WarningRef.ts +6 -0
  290. package/src/components/notification/callout-inline/warning/index.tsx +3 -0
  291. package/src/components/notification/index.tsx +18 -0
  292. package/src/components/notification/subtitle/Subtitle.tsx +75 -0
  293. package/src/components/notification/subtitle/SubtitleProps.ts +6 -0
  294. package/src/components/notification/subtitle/SubtitleRef.ts +6 -0
  295. package/src/components/notification/subtitle/index.tsx +3 -0
  296. package/src/components/notification/subtitle-link/SubtitleLink.tsx +74 -0
  297. package/src/components/notification/subtitle-link/SubtitleLinkProps.ts +6 -0
  298. package/src/components/notification/subtitle-link/SubtitleLinkRef.ts +6 -0
  299. package/src/components/notification/subtitle-link/index.tsx +3 -0
  300. package/src/components/notification/toast/error/Error.tsx +78 -0
  301. package/src/components/notification/toast/error/ErrorProps.ts +14 -0
  302. package/src/components/notification/toast/error/ErrorRef.ts +6 -0
  303. package/src/components/notification/toast/error/index.tsx +3 -0
  304. package/src/components/notification/toast/index.tsx +4 -0
  305. package/src/components/notification/toast/informational/Informational.tsx +78 -0
  306. package/src/components/notification/toast/informational/InformationalProps.ts +14 -0
  307. package/src/components/notification/toast/informational/InformationalRef.ts +6 -0
  308. package/src/components/notification/toast/informational/index.tsx +3 -0
  309. package/src/components/notification/toast/success/Success.tsx +78 -0
  310. package/src/components/notification/toast/success/SuccessProps.ts +14 -0
  311. package/src/components/notification/toast/success/SuccessRef.ts +6 -0
  312. package/src/components/notification/toast/success/index.tsx +3 -0
  313. package/src/components/notification/toast/warning/Warning.tsx +78 -0
  314. package/src/components/notification/toast/warning/WarningProps.ts +14 -0
  315. package/src/components/notification/toast/warning/WarningRef.ts +6 -0
  316. package/src/components/notification/toast/warning/index.tsx +3 -0
  317. package/src/components/radio-button/RadioButton.tsx +216 -0
  318. package/src/components/radio-button/RadioButtonProps.ts +44 -0
  319. package/src/components/radio-button/RadioButtonRef.ts +10 -0
  320. package/src/components/radio-button/_RefBase.ts +11 -0
  321. package/src/components/radio-button/index.tsx +3 -0
  322. package/src/components/radio-button-group/RadioButtonGroup.tsx +246 -0
  323. package/src/components/radio-button-group/RadioButtonGroupHelperTextMode.ts +4 -0
  324. package/src/components/radio-button-group/RadioButtonGroupItemProps.ts +10 -0
  325. package/src/components/radio-button-group/RadioButtonGroupItemRef.ts +6 -0
  326. package/src/components/radio-button-group/RadioButtonGroupProps.ts +35 -0
  327. package/src/components/radio-button-group/RadioButtonGroupRef.ts +10 -0
  328. package/src/components/radio-button-group/_Item.tsx +101 -0
  329. package/src/components/radio-button-group/_RefBase.ts +11 -0
  330. package/src/components/radio-button-group/_item-context.tsx +18 -0
  331. package/src/components/radio-button-group/index.tsx +6 -0
  332. package/src/components/radio-button-input/RadioButtonInput.tsx +295 -0
  333. package/src/components/radio-button-input/RadioButtonInputInteractiveState.ts +6 -0
  334. package/src/components/radio-button-input/RadioButtonInputProps.ts +25 -0
  335. package/src/components/radio-button-input/RadioButtonInputRef.ts +10 -0
  336. package/src/components/radio-button-input/_RefBase.ts +7 -0
  337. package/src/components/radio-button-input/index.tsx +4 -0
  338. package/src/components/switch/Switch.tsx +487 -0
  339. package/src/components/switch/SwitchProps.ts +38 -0
  340. package/src/components/switch/SwitchRef.ts +10 -0
  341. package/src/components/switch/SwitchSize.ts +4 -0
  342. package/src/components/switch/SwitchState.ts +4 -0
  343. package/src/components/switch/_RefBase.ts +7 -0
  344. package/src/components/switch/index.ts +5 -0
  345. package/src/components/text/Text.tsx +171 -0
  346. package/src/components/text/TextProps.ts +20 -0
  347. package/src/components/text/TextRef.ts +6 -0
  348. package/src/components/text/index.ts +3 -0
  349. package/src/components/text-area/TextArea.tsx +266 -0
  350. package/src/components/text-area/TextAreaProps.ts +13 -0
  351. package/src/components/text-area/TextAreaRef.ts +10 -0
  352. package/src/components/text-area/_TextAreaRefBase.ts +7 -0
  353. package/src/components/text-area/index.tsx +3 -0
  354. package/src/components/text-area-field/TextAreaField.tsx +75 -0
  355. package/src/components/text-area-field/TextAreaFieldInteractiveState.ts +5 -0
  356. package/src/components/text-area-field/TextAreaFieldProps.ts +6 -0
  357. package/src/components/text-area-field/TextAreaFieldRef.ts +6 -0
  358. package/src/components/text-area-field/index.tsx +4 -0
  359. package/src/components/text-area-fluid/TextAreaFluid.tsx +157 -0
  360. package/src/components/text-area-fluid/TextAreaFluidProps.ts +13 -0
  361. package/src/components/text-area-fluid/TextAreaFluidRef.ts +6 -0
  362. package/src/components/text-area-fluid/index.tsx +3 -0
  363. package/src/components/text-input/TextInput.tsx +270 -0
  364. package/src/components/text-input/TextInputProps.ts +13 -0
  365. package/src/components/text-input/TextInputRef.ts +10 -0
  366. package/src/components/text-input/TextInputSize.ts +5 -0
  367. package/src/components/text-input/_TextInputRefBase.ts +7 -0
  368. package/src/components/text-input/index.ts +4 -0
  369. package/src/components/text-input-field/TextInputField.tsx +435 -0
  370. package/src/components/text-input-field/TextInputFieldInteractiveState.ts +6 -0
  371. package/src/components/text-input-field/TextInputFieldProps.ts +31 -0
  372. package/src/components/text-input-field/TextInputFieldRef.ts +8 -0
  373. package/src/components/text-input-field/TextInputFieldSize.ts +4 -0
  374. package/src/components/text-input-field/_rn-text-input/RNTextInput.tsx +161 -0
  375. package/src/components/text-input-field/_rn-text-input/RNTextInputProps.ts +11 -0
  376. package/src/components/text-input-field/_rn-text-input/RNTextInputRef.ts +6 -0
  377. package/src/components/text-input-field/_rn-text-input/index.ts +3 -0
  378. package/src/components/text-input-field/index.tsx +5 -0
  379. package/src/components/text-input-fluid/TextInputFluid.tsx +166 -0
  380. package/src/components/text-input-fluid/TextInputFluidProps.ts +14 -0
  381. package/src/components/text-input-fluid/TextInputFluidRef.ts +6 -0
  382. package/src/components/text-input-fluid/index.tsx +3 -0
  383. package/src/components/toggle/State.ts +5 -0
  384. package/src/components/toggle/base/Base.tsx +302 -0
  385. package/src/components/toggle/base/BaseProps.ts +54 -0
  386. package/src/components/toggle/base/BaseRef.ts +10 -0
  387. package/src/components/toggle/base/_RefBase.ts +11 -0
  388. package/src/components/toggle/base/index.tsx +3 -0
  389. package/src/components/toggle/default/Default.tsx +38 -0
  390. package/src/components/toggle/default/DefaultProps.ts +9 -0
  391. package/src/components/toggle/default/DefaultRef.ts +6 -0
  392. package/src/components/toggle/default/index.tsx +3 -0
  393. package/src/components/toggle/index.tsx +4 -0
  394. package/src/components/toggle/small/Small.tsx +38 -0
  395. package/src/components/toggle/small/SmallProps.ts +7 -0
  396. package/src/components/toggle/small/SmallRef.ts +6 -0
  397. package/src/components/toggle/small/index.tsx +3 -0
  398. package/src/const/dialog-animation-configs/carbon-react.ts +53 -0
  399. package/src/const/dialog-animation-configs/fade-bottom-up-2.ts +36 -0
  400. package/src/const/dialog-animation-configs/fade-bottom-up.ts +36 -0
  401. package/src/const/dialog-animation-configs/index.ts +3 -0
  402. package/src/const/index.ts +5 -0
  403. package/src/contexts/breakpoint/BreakpointContext.ts +19 -0
  404. package/src/contexts/breakpoint/index.ts +1 -0
  405. package/src/contexts/dialog/DialogContext.ts +27 -0
  406. package/src/contexts/dialog/DialogData.ts +27 -0
  407. package/src/contexts/dialog/DialogType.ts +7 -0
  408. package/src/contexts/dialog/index.ts +2 -0
  409. package/src/contexts/index.ts +4 -0
  410. package/src/contexts/theme/ThemeContext.ts +24 -0
  411. package/src/contexts/theme/index.ts +1 -0
  412. package/src/contexts/toast/ToastContext.ts +24 -0
  413. package/src/contexts/toast/ToastContextShowConfig.ts +6 -0
  414. package/src/contexts/toast/index.ts +2 -0
  415. package/src/helpers/breakpoint/get-token.ts +20 -0
  416. package/src/helpers/breakpoint/index.ts +1 -0
  417. package/src/helpers/color/get-color-scheme.ts +19 -0
  418. package/src/helpers/color/get-color-token.ts +23 -0
  419. package/src/helpers/color/hex-to-rgba.ts +11 -0
  420. package/src/helpers/color/index.ts +3 -0
  421. package/src/helpers/index.ts +7 -0
  422. package/src/hooks/breakpoint/index.tsx +1 -0
  423. package/src/hooks/breakpoint/use.tsx +30 -0
  424. package/src/hooks/index.tsx +9 -0
  425. package/src/index.ts +9 -0
  426. package/src/providers/dialog/DialogProvider.tsx +122 -0
  427. package/src/providers/dialog/DialogProviderAnimationConfig.ts +49 -0
  428. package/src/providers/dialog/DialogProviderProps.ts +28 -0
  429. package/src/providers/dialog/DialogProviderRef.ts +6 -0
  430. package/src/providers/dialog/_controller/Controller.tsx +223 -0
  431. package/src/providers/dialog/_controller/ControllerProps.ts +11 -0
  432. package/src/providers/dialog/_controller/ControllerRef.ts +6 -0
  433. package/src/providers/dialog/_controller/_modal/Modal.tsx +148 -0
  434. package/src/providers/dialog/_controller/_modal/ModalProps.ts +11 -0
  435. package/src/providers/dialog/_controller/_modal/ModalRef.ts +8 -0
  436. package/src/providers/dialog/_controller/_modal/_Interpolation.ts +9 -0
  437. package/src/providers/dialog/_controller/_modal/index.ts +3 -0
  438. package/src/providers/dialog/_controller/_overlay/Overlay.tsx +132 -0
  439. package/src/providers/dialog/_controller/_overlay/OverlayProps.ts +9 -0
  440. package/src/providers/dialog/_controller/_overlay/OverlayRef.ts +10 -0
  441. package/src/providers/dialog/_controller/_overlay/_OverlayRefBase.ts +3 -0
  442. package/src/providers/dialog/_controller/_overlay/index.ts +3 -0
  443. package/src/providers/dialog/_controller/index.ts +3 -0
  444. package/src/providers/dialog/index.ts +4 -0
  445. package/src/providers/index.ts +2 -0
  446. package/src/providers/toast/ToastProvider.tsx +73 -0
  447. package/src/providers/toast/ToastProviderProps.ts +3 -0
  448. package/src/providers/toast/ToastRef.ts +6 -0
  449. package/src/providers/toast/_overlay/Overlay.tsx +208 -0
  450. package/src/providers/toast/_overlay/OverlayRef.ts +6 -0
  451. package/src/providers/toast/_overlay/_component-wrapper/ComponentWrapper.tsx +168 -0
  452. package/src/providers/toast/_overlay/_component-wrapper/ComponentWrapperProps.ts +8 -0
  453. package/src/providers/toast/_overlay/_component-wrapper/ComponentWrapperRef.ts +6 -0
  454. package/src/providers/toast/_overlay/_component-wrapper/index.ts +3 -0
  455. package/src/providers/toast/_overlay/index.ts +2 -0
  456. package/src/providers/toast/index.tsx +3 -0
  457. package/src/types/index.ts +7 -0
  458. package/src/types/shared.ts +1 -0
  459. package/src/types/theme/ColorScheme.ts +1 -0
  460. package/src/types/theme/index.ts +1 -0
@@ -0,0 +1,6 @@
1
+ export type BaseColorState =
2
+ | "default"
3
+ | "focused"
4
+ | "hovered"
5
+ | "pressed"
6
+ | "disabled"
@@ -0,0 +1,4 @@
1
+ export * from "./BaseColor"
2
+ export * from "./BaseColorProps"
3
+ export * from "./BaseColorRef"
4
+ export * from "./BaseColorState"
@@ -0,0 +1,165 @@
1
+ import {
2
+ forwardRef,
3
+ useContext,
4
+ } from "react"
5
+
6
+ import {
7
+ StyleSheet,
8
+ type TextStyle,
9
+ type ViewStyle,
10
+ } from "react-native"
11
+
12
+ import {
13
+ Color,
14
+ Spacing,
15
+ } from "@audira/carbon-react-native-elements"
16
+
17
+ import {
18
+ CarbonStyleSheet,
19
+ } from "../../../carbon-style-sheet"
20
+
21
+ import {
22
+ ThemeContext,
23
+ } from "../../../contexts"
24
+
25
+ import {
26
+ BaseColor,
27
+ type BaseColorProps,
28
+ type BaseColorState,
29
+ } from "../base-color"
30
+
31
+ import type {
32
+ GhostProps,
33
+ } from "./GhostProps"
34
+
35
+ import type {
36
+ GhostRef,
37
+ } from "./GhostRef"
38
+
39
+ export const Ghost = forwardRef<GhostRef, GhostProps>(
40
+ function Ghost(
41
+ {
42
+ text,
43
+ iconProps,
44
+ ...props
45
+ },
46
+ ref,
47
+ ) {
48
+
49
+ const
50
+ themeContext =
51
+ useContext(ThemeContext)
52
+
53
+ return (
54
+ <BaseColor
55
+ { ...props }
56
+ ref={ ref }
57
+ text={ text }
58
+ android_rippleEffectColor={ mapAndroidRippleEffectColor[themeContext.colorScheme] }
59
+ colorStateStyle={{
60
+ background: {
61
+ default: backgroundStyleSheet.default,
62
+ focused: backgroundStyleSheet.focused,
63
+ hovered: backgroundStyleSheet.hovered,
64
+ pressed: backgroundStyleSheet.pressed,
65
+ disabled: backgroundStyleSheet.disabled,
66
+ },
67
+ text: {
68
+ default: textStyleSheet.default,
69
+ focused: textStyleSheet.focused,
70
+ hovered: textStyleSheet.hovered,
71
+ pressed: textStyleSheet.pressed,
72
+ disabled: textStyleSheet.disabled,
73
+ },
74
+ icon: mapIconColor[themeContext.colorScheme],
75
+ }}
76
+ iconProps={{
77
+ ...iconProps,
78
+ style: [mapIconPLByText[`${!!text}`], iconProps?.style],
79
+ }}
80
+ />
81
+ )
82
+
83
+ },
84
+ )
85
+
86
+ const
87
+ backgroundStyleSheet =
88
+ CarbonStyleSheet.create<
89
+ Record<keyof BaseColorProps["colorStateStyle"]["background"], ViewStyle>
90
+ >({
91
+ default: {
92
+ backgroundColor: "transparent",
93
+ },
94
+ focused: {
95
+ borderWidth: 1,
96
+ borderColor: CarbonStyleSheet.color.focus,
97
+ },
98
+ hovered: {
99
+ backgroundColor: CarbonStyleSheet.color.background_hover,
100
+ },
101
+ pressed: {
102
+ backgroundColor: CarbonStyleSheet.color.background_active,
103
+ },
104
+ disabled: {
105
+ backgroundColor: "transparent",
106
+ },
107
+ }),
108
+
109
+ textStyleSheet =
110
+ CarbonStyleSheet.create<
111
+ Record<keyof BaseColorProps["colorStateStyle"]["text"], TextStyle>
112
+ >({
113
+ default: {
114
+ color: CarbonStyleSheet.color.link_primary,
115
+ },
116
+ focused: {
117
+ color: CarbonStyleSheet.color.link_primary,
118
+ },
119
+ hovered: {
120
+ color: CarbonStyleSheet.color.link_primary_hover,
121
+ },
122
+ pressed: {
123
+ color: CarbonStyleSheet.color.link_primary,
124
+ },
125
+ disabled: {
126
+ color: CarbonStyleSheet.color.text_disabled,
127
+ },
128
+ }),
129
+
130
+ style =
131
+ StyleSheet.create({
132
+ iconPL8: {
133
+ paddingLeft: Spacing.spacing_03,
134
+ },
135
+ }),
136
+
137
+ mapIconPLByText: Record<string, typeof style["iconPL8"] | null> =
138
+ {
139
+ false: null,
140
+ true: style.iconPL8,
141
+ },
142
+
143
+ mapIconColor: Record<ThemeContext["colorScheme"], Record<BaseColorState, string>> =
144
+ {
145
+ gray_10: {
146
+ default: Color.Token.gray_10.link_primary,
147
+ focused: Color.Token.gray_10.link_primary,
148
+ hovered: Color.Token.gray_10.link_primary_hover,
149
+ pressed: Color.Token.gray_10.link_primary,
150
+ disabled: Color.Token.gray_10.icon_disabled,
151
+ },
152
+ gray_100: {
153
+ default: Color.Token.gray_100.link_primary,
154
+ focused: Color.Token.gray_100.link_primary,
155
+ hovered: Color.Token.gray_100.link_primary_hover,
156
+ pressed: Color.Token.gray_100.link_primary,
157
+ disabled: Color.Token.gray_100.icon_disabled,
158
+ },
159
+ },
160
+
161
+ mapAndroidRippleEffectColor: Record<ThemeContext["colorScheme"], string> =
162
+ {
163
+ gray_10: Color.Token.gray_10.background_active,
164
+ gray_100: Color.Token.gray_100.background_active,
165
+ }
@@ -0,0 +1,10 @@
1
+ import type {
2
+ BaseColorProps,
3
+ } from "../base-color/BaseColorProps"
4
+
5
+ export interface GhostProps extends Omit<
6
+ BaseColorProps,
7
+ | "android_rippleEffectColor"
8
+ | "colorStateStyle"
9
+ > {
10
+ }
@@ -0,0 +1,6 @@
1
+ import type {
2
+ BaseColorRef,
3
+ } from "../base-color/BaseColorRef"
4
+
5
+ export interface GhostRef extends BaseColorRef {
6
+ }
@@ -0,0 +1,3 @@
1
+ export * from "./Ghost"
2
+ export * from "./GhostProps"
3
+ export * from "./GhostRef"
@@ -0,0 +1,165 @@
1
+ import {
2
+ forwardRef,
3
+ useContext,
4
+ } from "react"
5
+
6
+ import {
7
+ StyleSheet,
8
+ type TextStyle,
9
+ type ViewStyle,
10
+ } from "react-native"
11
+
12
+ import {
13
+ Color,
14
+ Spacing,
15
+ } from "@audira/carbon-react-native-elements"
16
+
17
+ import {
18
+ CarbonStyleSheet,
19
+ } from "../../../carbon-style-sheet"
20
+ import {
21
+ ThemeContext,
22
+ } from "../../../contexts"
23
+
24
+
25
+ import {
26
+ BaseColor,
27
+ type BaseColorProps,
28
+ type BaseColorState,
29
+ } from "../base-color"
30
+
31
+ import type {
32
+ GhostDangerProps,
33
+ } from "./GhostDangerProps"
34
+
35
+ import type {
36
+ GhostDangerRef,
37
+ } from "./GhostDangerRef"
38
+
39
+ export const GhostDanger = forwardRef<GhostDangerRef, GhostDangerProps>(
40
+ function GhostDanger(
41
+ {
42
+ text,
43
+ iconProps,
44
+ ...props
45
+ },
46
+ ref,
47
+ ) {
48
+
49
+ const
50
+ themeContext =
51
+ useContext(ThemeContext)
52
+
53
+ return (
54
+ <BaseColor
55
+ { ...props }
56
+ ref={ ref }
57
+ text={ text }
58
+ android_rippleEffectColor={ mapAndroidRippleEffectColor[themeContext.colorScheme] }
59
+ colorStateStyle={{
60
+ background: {
61
+ default: backgroundStyleSheet.default,
62
+ focused: backgroundStyleSheet.focused,
63
+ hovered: backgroundStyleSheet.hovered,
64
+ pressed: backgroundStyleSheet.pressed,
65
+ disabled: backgroundStyleSheet.disabled,
66
+ },
67
+ text: {
68
+ default: textStyleSheet.default,
69
+ focused: textStyleSheet.focused,
70
+ hovered: textStyleSheet.hovered,
71
+ pressed: textStyleSheet.pressed,
72
+ disabled: textStyleSheet.disabled,
73
+ },
74
+ icon: mapIconColor[themeContext.colorScheme],
75
+ }}
76
+ iconProps={{
77
+ ...iconProps,
78
+ style: [mapIconPLByText[`${!!text}`], iconProps?.style],
79
+ }}
80
+ />
81
+ )
82
+
83
+ },
84
+ )
85
+
86
+ const
87
+ backgroundStyleSheet =
88
+ CarbonStyleSheet.create<
89
+ Record<keyof BaseColorProps["colorStateStyle"]["background"], ViewStyle>
90
+ >({
91
+ default: {
92
+ backgroundColor: "transparent",
93
+ },
94
+ focused: {
95
+ borderWidth: 1,
96
+ borderColor: CarbonStyleSheet.color.focus,
97
+ },
98
+ hovered: {
99
+ backgroundColor: CarbonStyleSheet.color.button_danger_hover,
100
+ },
101
+ pressed: {
102
+ backgroundColor: CarbonStyleSheet.color.button_danger_active,
103
+ },
104
+ disabled: {
105
+ backgroundColor: CarbonStyleSheet.color.button_disabled,
106
+ },
107
+ }),
108
+
109
+ textStyleSheet =
110
+ CarbonStyleSheet.create<
111
+ Record<keyof BaseColorProps["colorStateStyle"]["text"], TextStyle>
112
+ >({
113
+ default: {
114
+ color: CarbonStyleSheet.color.button_danger_secondary,
115
+ },
116
+ focused: {
117
+ color: CarbonStyleSheet.color.button_danger_secondary,
118
+ },
119
+ hovered: {
120
+ color: CarbonStyleSheet.color.text_on_color,
121
+ },
122
+ pressed: {
123
+ color: CarbonStyleSheet.color.text_on_color,
124
+ },
125
+ disabled: {
126
+ color: CarbonStyleSheet.color.text_disabled,
127
+ },
128
+ }),
129
+
130
+ style =
131
+ StyleSheet.create({
132
+ iconPL8: {
133
+ paddingLeft: Spacing.spacing_03,
134
+ },
135
+ }),
136
+
137
+ mapIconPLByText: Record<string, typeof style["iconPL8"] | null> =
138
+ {
139
+ false: null,
140
+ true: style.iconPL8,
141
+ },
142
+
143
+ mapIconColor: Record<ThemeContext["colorScheme"], Record<BaseColorState, string>> =
144
+ {
145
+ gray_10: {
146
+ default: Color.Token.gray_10.button_danger_secondary,
147
+ focused: Color.Token.gray_10.button_danger_secondary,
148
+ hovered: Color.Token.gray_10.icon_on_color,
149
+ pressed: Color.Token.gray_10.icon_on_color,
150
+ disabled: Color.Token.gray_10.icon_disabled,
151
+ },
152
+ gray_100: {
153
+ default: Color.Token.gray_100.button_danger_secondary,
154
+ focused: Color.Token.gray_100.button_danger_secondary,
155
+ hovered: Color.Token.gray_100.icon_on_color,
156
+ pressed: Color.Token.gray_100.icon_on_color,
157
+ disabled: Color.Token.gray_100.icon_disabled,
158
+ },
159
+ },
160
+
161
+ mapAndroidRippleEffectColor: Record<ThemeContext["colorScheme"], string> =
162
+ {
163
+ gray_10: Color.Token.gray_10.button_danger_active,
164
+ gray_100: Color.Token.gray_100.button_danger_active,
165
+ }
@@ -0,0 +1,10 @@
1
+ import type {
2
+ BaseColorProps,
3
+ } from "../base-color/BaseColorProps"
4
+
5
+ export interface GhostDangerProps extends Omit<
6
+ BaseColorProps,
7
+ | "android_rippleEffectColor"
8
+ | "colorStateStyle"
9
+ > {
10
+ }
@@ -0,0 +1,6 @@
1
+ import type {
2
+ BaseColorRef,
3
+ } from "../base-color/BaseColorRef"
4
+
5
+ export interface GhostDangerRef extends BaseColorRef {
6
+ }
@@ -0,0 +1,3 @@
1
+ export * from "./GhostDanger"
2
+ export * from "./GhostDangerProps"
3
+ export * from "./GhostDangerRef"
@@ -0,0 +1,127 @@
1
+ import {
2
+ forwardRef,
3
+ useContext,
4
+ } from "react"
5
+
6
+ import {
7
+ StyleSheet,
8
+ type ViewStyle,
9
+ } from "react-native"
10
+
11
+ import {
12
+ Color,
13
+ } from "@audira/carbon-react-native-elements"
14
+
15
+ import {
16
+ CarbonStyleSheet,
17
+ } from "../../../carbon-style-sheet"
18
+
19
+ import {
20
+ ThemeContext,
21
+ } from "../../../contexts"
22
+
23
+ import {
24
+ BaseColor,
25
+ type BaseColorProps,
26
+ type BaseColorState,
27
+ } from "../base-color"
28
+
29
+ import type {
30
+ GhostIconProps,
31
+ } from "./GhostIconProps"
32
+
33
+ import type {
34
+ GhostIconRef,
35
+ } from "./GhostIconRef"
36
+
37
+ export const GhostIcon = forwardRef<GhostIconRef, GhostIconProps>(
38
+ function GhostIcon(
39
+ props,
40
+ ref,
41
+ ) {
42
+
43
+ const
44
+ themeContext =
45
+ useContext(ThemeContext)
46
+
47
+ return (
48
+ <BaseColor
49
+ { ...props }
50
+ ref={ ref }
51
+ android_rippleEffectColor={ mapAndroidRippleEffectColor[themeContext.colorScheme] }
52
+ colorStateStyle={{
53
+ background: {
54
+ default: backgroundStyleSheet.default,
55
+ focused: backgroundStyleSheet.focused,
56
+ hovered: backgroundStyleSheet.hovered,
57
+ pressed: backgroundStyleSheet.pressed,
58
+ disabled: backgroundStyleSheet.disabled,
59
+ },
60
+ text: {
61
+ default: style.text,
62
+ focused: style.text,
63
+ hovered: style.text,
64
+ pressed: style.text,
65
+ disabled: style.text,
66
+ },
67
+ icon: mapIconColor[themeContext.colorScheme],
68
+ }}
69
+ />
70
+ )
71
+
72
+ },
73
+ )
74
+
75
+ const
76
+ backgroundStyleSheet =
77
+ CarbonStyleSheet.create<
78
+ Record<keyof BaseColorProps["colorStateStyle"]["background"], ViewStyle>
79
+ >({
80
+ default: {
81
+ backgroundColor: "transparent",
82
+ },
83
+ focused: {
84
+ borderWidth: 1,
85
+ borderColor: CarbonStyleSheet.color.focus,
86
+ },
87
+ hovered: {
88
+ backgroundColor: CarbonStyleSheet.color.background_hover,
89
+ },
90
+ pressed: {
91
+ backgroundColor: CarbonStyleSheet.color.background_active,
92
+ },
93
+ disabled: {
94
+ backgroundColor: "transparent",
95
+ },
96
+ }),
97
+
98
+ style =
99
+ StyleSheet.create({
100
+ text: {
101
+ color: "transparent",
102
+ },
103
+ }),
104
+
105
+ mapIconColor: Record<ThemeContext["colorScheme"], Record<BaseColorState, string>> =
106
+ {
107
+ gray_10: {
108
+ default: Color.Token.gray_10.icon_primary,
109
+ focused: Color.Token.gray_10.icon_primary,
110
+ hovered: Color.Token.gray_10.icon_primary,
111
+ pressed: Color.Token.gray_10.icon_primary,
112
+ disabled: Color.Token.gray_10.icon_disabled,
113
+ },
114
+ gray_100: {
115
+ default: Color.Token.gray_100.icon_primary,
116
+ focused: Color.Token.gray_100.icon_primary,
117
+ hovered: Color.Token.gray_100.icon_primary,
118
+ pressed: Color.Token.gray_100.icon_primary,
119
+ disabled: Color.Token.gray_100.icon_disabled,
120
+ },
121
+ },
122
+
123
+ mapAndroidRippleEffectColor: Record<ThemeContext["colorScheme"], string> =
124
+ {
125
+ gray_10: Color.Token.gray_10.background_active,
126
+ gray_100: Color.Token.gray_100.background_active,
127
+ }
@@ -0,0 +1,17 @@
1
+ import type {
2
+ InlineLoadingProps,
3
+ } from "../../inline-loading/InlineLoadingProps"
4
+
5
+ import type {
6
+ BaseColorProps,
7
+ } from "../base-color/BaseColorProps"
8
+
9
+ export interface GhostIconProps extends Omit<
10
+ BaseColorProps,
11
+ | "android_rippleEffectColor"
12
+ | "colorStateStyle"
13
+ | "text"
14
+ | "inlineLoadingProps"
15
+ > {
16
+ inlineLoadingProps?: Omit<InlineLoadingProps, "text">,
17
+ }
@@ -0,0 +1,6 @@
1
+ import type {
2
+ BaseColorRef,
3
+ } from "../base-color/BaseColorRef"
4
+
5
+ export interface GhostIconRef extends BaseColorRef {
6
+ }
@@ -0,0 +1,3 @@
1
+ export * from "./GhostIcon"
2
+ export * from "./GhostIconProps"
3
+ export * from "./GhostIconRef"
@@ -0,0 +1,11 @@
1
+ export * from "./base"
2
+ export * from "./base-color"
3
+ export * from "./ghost"
4
+ export * from "./ghost-danger"
5
+ export * from "./ghost-icon"
6
+ export * from "./primary"
7
+ export * from "./primary-danger"
8
+ export * from "./secondary"
9
+ export * from "./Size"
10
+ export * from "./tertiary"
11
+ export * from "./tertiary-danger"
@@ -0,0 +1,140 @@
1
+ import {
2
+ forwardRef,
3
+ useContext,
4
+ } from "react"
5
+
6
+ import type {
7
+ TextStyle,
8
+ ViewStyle,
9
+ } from "react-native"
10
+
11
+ import {
12
+ Color,
13
+ } from "@audira/carbon-react-native-elements"
14
+
15
+ import {
16
+ CarbonStyleSheet,
17
+ } from "../../../carbon-style-sheet"
18
+
19
+ import {
20
+ ThemeContext,
21
+ } from "../../../contexts"
22
+
23
+ import {
24
+ BaseColor,
25
+ type BaseColorProps,
26
+ type BaseColorState,
27
+ } from "../base-color"
28
+
29
+ import type {
30
+ PrimaryProps,
31
+ } from "./PrimaryProps"
32
+
33
+ import type {
34
+ PrimaryRef,
35
+ } from "./PrimaryRef"
36
+
37
+ export const Primary = forwardRef<PrimaryRef, PrimaryProps>(
38
+ function Primary(
39
+ props,
40
+ ref,
41
+ ) {
42
+
43
+ const
44
+ themeContext =
45
+ useContext(ThemeContext)
46
+
47
+ return (
48
+ <BaseColor
49
+ { ...props }
50
+ ref={ ref }
51
+ android_rippleEffectColor={ mapAndroidRippleEffectColor[themeContext.colorScheme] }
52
+ colorStateStyle={{
53
+ background: {
54
+ default: backgroundStyleSheet.default,
55
+ focused: backgroundStyleSheet.focused,
56
+ hovered: backgroundStyleSheet.hovered,
57
+ pressed: backgroundStyleSheet.pressed,
58
+ disabled: backgroundStyleSheet.disabled,
59
+ },
60
+ text: {
61
+ default: textStyleSheet.default,
62
+ focused: textStyleSheet.focused,
63
+ hovered: textStyleSheet.hovered,
64
+ pressed: textStyleSheet.pressed,
65
+ disabled: textStyleSheet.disabled,
66
+ },
67
+ icon: mapIconColor[themeContext.colorScheme],
68
+ }}
69
+ />
70
+ )
71
+
72
+ },
73
+ )
74
+
75
+ const
76
+ backgroundStyleSheet =
77
+ CarbonStyleSheet.create<
78
+ Record<keyof BaseColorProps["colorStateStyle"]["background"], ViewStyle>
79
+ >({
80
+ default: {
81
+ backgroundColor: CarbonStyleSheet.color.button_primary,
82
+ },
83
+ focused: {
84
+ backgroundColor: CarbonStyleSheet.color.button_primary,
85
+ },
86
+ hovered: {
87
+ backgroundColor: CarbonStyleSheet.color.button_primary_hover,
88
+ },
89
+ pressed: {
90
+ backgroundColor: CarbonStyleSheet.color.button_primary_active,
91
+ },
92
+ disabled: {
93
+ backgroundColor: CarbonStyleSheet.color.button_disabled,
94
+ },
95
+ }),
96
+
97
+ textStyleSheet =
98
+ CarbonStyleSheet.create<
99
+ Record<keyof BaseColorProps["colorStateStyle"]["text"], TextStyle>
100
+ >({
101
+ default: {
102
+ color: CarbonStyleSheet.color.text_on_color,
103
+ },
104
+ focused: {
105
+ color: CarbonStyleSheet.color.text_on_color,
106
+ },
107
+ hovered: {
108
+ color: CarbonStyleSheet.color.text_on_color,
109
+ },
110
+ pressed: {
111
+ color: CarbonStyleSheet.color.text_on_color,
112
+ },
113
+ disabled: {
114
+ color: CarbonStyleSheet.color.text_on_color_disabled,
115
+ },
116
+ }),
117
+
118
+ mapIconColor: Record<ThemeContext["colorScheme"], Record<BaseColorState, string>> =
119
+ {
120
+ gray_10: {
121
+ default: Color.Token.gray_10.icon_on_color,
122
+ focused: Color.Token.gray_10.icon_on_color,
123
+ hovered: Color.Token.gray_10.icon_on_color,
124
+ pressed: Color.Token.gray_10.icon_on_color,
125
+ disabled: Color.Token.gray_10.icon_on_color_disabled,
126
+ },
127
+ gray_100: {
128
+ default: Color.Token.gray_100.icon_on_color,
129
+ focused: Color.Token.gray_100.icon_on_color,
130
+ hovered: Color.Token.gray_100.icon_on_color,
131
+ pressed: Color.Token.gray_100.icon_on_color,
132
+ disabled: Color.Token.gray_100.icon_on_color_disabled,
133
+ },
134
+ },
135
+
136
+ mapAndroidRippleEffectColor: Record<ThemeContext["colorScheme"], string> =
137
+ {
138
+ gray_10: Color.Token.gray_10.button_primary_active,
139
+ gray_100: Color.Token.gray_100.button_primary_active,
140
+ }