@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.
- package/lib/commonjs/components/modal/Modal.js +19 -15
- package/lib/commonjs/components/modal/Modal.js.map +1 -1
- package/lib/module/components/modal/Modal.js +19 -15
- package/lib/module/components/modal/Modal.js.map +1 -1
- package/lib/typescript/commonjs/components/modal/Modal.d.ts.map +1 -1
- package/lib/typescript/module/components/modal/Modal.d.ts.map +1 -1
- package/lib/typescript/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -1
- package/src/_internal/contexts/button-group/ButtonGroupContext.ts +25 -0
- package/src/_internal/contexts/button-group/index.tsx +1 -0
- package/src/_internal/contexts/global-config/GlobalConfigContext.ts +30 -0
- package/src/_internal/contexts/global-config/index.ts +1 -0
- package/src/_internal/contexts/index.ts +3 -0
- package/src/_internal/contexts/modal/ModalContext.ts +15 -0
- package/src/_internal/contexts/modal/index.ts +1 -0
- package/src/_internal/globals/breakpoint/index.ts +13 -0
- package/src/_internal/globals/color-scheme/index.ts +13 -0
- package/src/_internal/globals/index.ts +7 -0
- package/src/_internal/helpers/index.ts +5 -0
- package/src/_internal/helpers/math/clamp.ts +3 -0
- package/src/_internal/helpers/math/index.ts +1 -0
- package/src/_internal/providers/breakpoint/BreakpointProvider.tsx +42 -0
- package/src/_internal/providers/breakpoint/BreakpointProviderProps.ts +3 -0
- package/src/_internal/providers/breakpoint/index.tsx +2 -0
- package/src/_internal/providers/global-config/GlobalConfigProvider.tsx +30 -0
- package/src/_internal/providers/global-config/GlobalConfigProviderProps.ts +7 -0
- package/src/_internal/providers/global-config/index.tsx +2 -0
- package/src/_internal/providers/index.ts +3 -0
- package/src/_internal/providers/theme/ThemeProvider.tsx +45 -0
- package/src/_internal/providers/theme/ThemeProviderProps.ts +8 -0
- package/src/_internal/providers/theme/index.tsx +2 -0
- package/src/_internal/style-sheets/common-style-sheet.ts +24 -0
- package/src/_internal/style-sheets/flex-style-sheet.ts +84 -0
- package/src/_internal/style-sheets/index.ts +3 -0
- package/src/_internal/style-sheets/text-style-sheet.ts +62 -0
- package/src/carbon-react-native/CarbonReactNative.tsx +41 -0
- package/src/carbon-react-native/CarbonReactNativeProps.ts +7 -0
- package/src/carbon-react-native/index.tsx +2 -0
- package/src/carbon-style-sheet/breakpoint.ts +16 -0
- package/src/carbon-style-sheet/color.ts +13 -0
- package/src/carbon-style-sheet/create.ts +232 -0
- package/src/carbon-style-sheet/index.tsx +51 -0
- package/src/carbon-style-sheet/use.tsx +16 -0
- package/src/components/accordion/Accordion.tsx +132 -0
- package/src/components/accordion/AccordionHeaderProps.ts +17 -0
- package/src/components/accordion/AccordionItemProps.ts +24 -0
- package/src/components/accordion/AccordionItemRef.ts +10 -0
- package/src/components/accordion/AccordionProps.ts +19 -0
- package/src/components/accordion/AccordionRef.ts +6 -0
- package/src/components/accordion/AccordionSize.ts +4 -0
- package/src/components/accordion/_Header.tsx +201 -0
- package/src/components/accordion/_HeaderBorder.tsx +75 -0
- package/src/components/accordion/_Item.tsx +175 -0
- package/src/components/accordion/_ItemRefBase.ts +7 -0
- package/src/components/accordion/_chevron/Chevron.tsx +97 -0
- package/src/components/accordion/_chevron/ChevronProps.ts +10 -0
- package/src/components/accordion/_chevron/index.ts +2 -0
- package/src/components/accordion/_context.ts +20 -0
- package/src/components/accordion/_motion.ts +27 -0
- package/src/components/accordion/_styles.ts +24 -0
- package/src/components/accordion/index.tsx +7 -0
- package/src/components/button/Size.ts +7 -0
- package/src/components/button/base/Base.tsx +328 -0
- package/src/components/button/base/BaseProps.ts +60 -0
- package/src/components/button/base/BaseRef.ts +6 -0
- package/src/components/button/base/index.tsx +3 -0
- package/src/components/button/base-color/BaseColor.tsx +289 -0
- package/src/components/button/base-color/BaseColorProps.ts +32 -0
- package/src/components/button/base-color/BaseColorRef.ts +6 -0
- package/src/components/button/base-color/BaseColorState.ts +6 -0
- package/src/components/button/base-color/index.tsx +4 -0
- package/src/components/button/ghost/Ghost.tsx +165 -0
- package/src/components/button/ghost/GhostProps.ts +10 -0
- package/src/components/button/ghost/GhostRef.ts +6 -0
- package/src/components/button/ghost/index.tsx +3 -0
- package/src/components/button/ghost-danger/GhostDanger.tsx +165 -0
- package/src/components/button/ghost-danger/GhostDangerProps.ts +10 -0
- package/src/components/button/ghost-danger/GhostDangerRef.ts +6 -0
- package/src/components/button/ghost-danger/index.tsx +3 -0
- package/src/components/button/ghost-icon/GhostIcon.tsx +127 -0
- package/src/components/button/ghost-icon/GhostIconProps.ts +17 -0
- package/src/components/button/ghost-icon/GhostIconRef.ts +6 -0
- package/src/components/button/ghost-icon/index.tsx +3 -0
- package/src/components/button/index.tsx +11 -0
- package/src/components/button/primary/Primary.tsx +140 -0
- package/src/components/button/primary/PrimaryProps.ts +11 -0
- package/src/components/button/primary/PrimaryRef.ts +6 -0
- package/src/components/button/primary/index.tsx +3 -0
- package/src/components/button/primary-danger/PrimaryDanger.tsx +140 -0
- package/src/components/button/primary-danger/PrimaryDangerProps.ts +12 -0
- package/src/components/button/primary-danger/PrimaryDangerRef.ts +6 -0
- package/src/components/button/primary-danger/index.tsx +3 -0
- package/src/components/button/secondary/Secondary.tsx +140 -0
- package/src/components/button/secondary/SecondaryProps.ts +12 -0
- package/src/components/button/secondary/SecondaryRef.ts +6 -0
- package/src/components/button/secondary/index.tsx +3 -0
- package/src/components/button/tertiary/Tertiary.tsx +157 -0
- package/src/components/button/tertiary/TertiaryProps.ts +12 -0
- package/src/components/button/tertiary/TertiaryRef.ts +6 -0
- package/src/components/button/tertiary/index.tsx +3 -0
- package/src/components/button/tertiary-danger/TertiaryDanger.tsx +157 -0
- package/src/components/button/tertiary-danger/TertiaryDangerProps.ts +12 -0
- package/src/components/button/tertiary-danger/TertiaryDangerRef.ts +6 -0
- package/src/components/button/tertiary-danger/index.tsx +3 -0
- package/src/components/button-group/ButtonGroup.tsx +145 -0
- package/src/components/button-group/ButtonGroupProps.ts +37 -0
- package/src/components/button-group/ButtonGroupRef.ts +6 -0
- package/src/components/button-group/index.tsx +3 -0
- package/src/components/checkbox/Checkbox.tsx +221 -0
- package/src/components/checkbox/CheckboxProps.ts +39 -0
- package/src/components/checkbox/CheckboxRef.ts +10 -0
- package/src/components/checkbox/_RefBase.ts +11 -0
- package/src/components/checkbox/index.tsx +3 -0
- package/src/components/checkbox-group/CheckboxGroup.tsx +227 -0
- package/src/components/checkbox-group/CheckboxGroupHelperTextMode.ts +4 -0
- package/src/components/checkbox-group/CheckboxGroupProps.ts +28 -0
- package/src/components/checkbox-group/CheckboxGroupRef.ts +6 -0
- package/src/components/checkbox-group/index.tsx +4 -0
- package/src/components/checkbox-input/CheckboxInput.tsx +340 -0
- package/src/components/checkbox-input/CheckboxInputInteractiveState.ts +6 -0
- package/src/components/checkbox-input/CheckboxInputProps.ts +25 -0
- package/src/components/checkbox-input/CheckboxInputRef.ts +11 -0
- package/src/components/checkbox-input/CheckboxInputValue.ts +6 -0
- package/src/components/checkbox-input/_RefBase.ts +11 -0
- package/src/components/checkbox-input/index.tsx +5 -0
- package/src/components/collapsible/Collapsible.tsx +274 -0
- package/src/components/collapsible/CollapsibleProps.ts +17 -0
- package/src/components/collapsible/CollapsibleRef.ts +11 -0
- package/src/components/collapsible/_RefBase.ts +6 -0
- package/src/components/collapsible/index.ts +3 -0
- package/src/components/form-helper-text/FormHelperText.tsx +109 -0
- package/src/components/form-helper-text/FormHelperTextProps.ts +15 -0
- package/src/components/form-helper-text/FormHelperTextRef.ts +6 -0
- package/src/components/form-helper-text/index.tsx +3 -0
- package/src/components/form-label/FormLabel.tsx +85 -0
- package/src/components/form-label/FormLabelProps.ts +17 -0
- package/src/components/form-label/FormLabelRef.ts +6 -0
- package/src/components/form-label/index.tsx +3 -0
- package/src/components/icon/Icon.tsx +48 -0
- package/src/components/icon/IconProps.ts +11 -0
- package/src/components/icon/index.tsx +2 -0
- package/src/components/index.tsx +35 -0
- package/src/components/inline-loading/InlineLoading.tsx +144 -0
- package/src/components/inline-loading/InlineLoadingProps.ts +24 -0
- package/src/components/inline-loading/InlineLoadingRef.ts +6 -0
- package/src/components/inline-loading/InlineLoadingState.ts +5 -0
- package/src/components/inline-loading/index.tsx +4 -0
- package/src/components/layer/Layer.tsx +87 -0
- package/src/components/layer/LayerContext.ts +9 -0
- package/src/components/layer/LayerProps.ts +16 -0
- package/src/components/layer/LayerRef.ts +6 -0
- package/src/components/layer/index.tsx +4 -0
- package/src/components/loading/Loading.tsx +116 -0
- package/src/components/loading/LoadingProps.ts +14 -0
- package/src/components/loading/LoadingRef.ts +4 -0
- package/src/components/loading/LoadingType.ts +3 -0
- package/src/components/loading/_circular-progress/CircularProgress.tsx +113 -0
- package/src/components/loading/_circular-progress/CircularProgressProps.ts +18 -0
- package/src/components/loading/_circular-progress/index.ts +2 -0
- package/src/components/loading/_map-circle-background-color.ts +26 -0
- package/src/components/loading/_map-circle-stroke-color.ts +13 -0
- package/src/components/loading/index.ts +4 -0
- package/src/components/modal/Modal.tsx +397 -0
- package/src/components/modal/ModalProps.ts +24 -0
- package/src/components/modal/ModalRef.ts +6 -0
- package/src/components/modal/ModalSize.ts +5 -0
- package/src/components/modal/index.tsx +4 -0
- package/src/components/modal-content/ModalContent.tsx +182 -0
- package/src/components/modal-content/ModalContentProps.ts +7 -0
- package/src/components/modal-content/ModalContentRef.ts +6 -0
- package/src/components/modal-content/index.tsx +3 -0
- package/src/components/notification/NotificationColor.ts +3 -0
- package/src/components/notification/_VariantContextProvider.tsx +39 -0
- package/src/components/notification/_status-hooks/_base/UseBaseData.ts +11 -0
- package/src/components/notification/_status-hooks/_base/UseBaseProps.ts +21 -0
- package/src/components/notification/_status-hooks/_base/index.tsx +3 -0
- package/src/components/notification/_status-hooks/_base/useBase.tsx +77 -0
- package/src/components/notification/_status-hooks/error/UseErrorData.ts +11 -0
- package/src/components/notification/_status-hooks/error/UseErrorProps.ts +8 -0
- package/src/components/notification/_status-hooks/error/index.tsx +3 -0
- package/src/components/notification/_status-hooks/error/useError.tsx +122 -0
- package/src/components/notification/_status-hooks/index.tsx +4 -0
- package/src/components/notification/_status-hooks/informational/UseInformationalData.ts +11 -0
- package/src/components/notification/_status-hooks/informational/UseInformationalProps.ts +8 -0
- package/src/components/notification/_status-hooks/informational/index.tsx +3 -0
- package/src/components/notification/_status-hooks/informational/useInformational.tsx +122 -0
- package/src/components/notification/_status-hooks/success/UseSuccessData.ts +11 -0
- package/src/components/notification/_status-hooks/success/UseSuccessProps.ts +8 -0
- package/src/components/notification/_status-hooks/success/index.tsx +3 -0
- package/src/components/notification/_status-hooks/success/useSuccess.tsx +122 -0
- package/src/components/notification/_status-hooks/warning/UseWarningData.ts +11 -0
- package/src/components/notification/_status-hooks/warning/UseWarningProps.ts +8 -0
- package/src/components/notification/_status-hooks/warning/index.tsx +3 -0
- package/src/components/notification/_status-hooks/warning/useWarning.tsx +122 -0
- package/src/components/notification/_variant-context.ts +15 -0
- package/src/components/notification/_variants/_ButtonGhost.tsx +73 -0
- package/src/components/notification/_variants/_ButtonTertiary.tsx +73 -0
- package/src/components/notification/_variants/actionable/ActionableVariant.tsx +70 -0
- package/src/components/notification/_variants/actionable/ActionableVariantProps.ts +46 -0
- package/src/components/notification/_variants/actionable/ActionableVariantRef.ts +6 -0
- package/src/components/notification/_variants/actionable/index.tsx +3 -0
- package/src/components/notification/_variants/actionable-inline/ActionableInlineVariant.tsx +70 -0
- package/src/components/notification/_variants/actionable-inline/ActionableInlineVariantProps.ts +46 -0
- package/src/components/notification/_variants/actionable-inline/ActionableInlineVariantRef.ts +6 -0
- package/src/components/notification/_variants/actionable-inline/index.tsx +3 -0
- package/src/components/notification/_variants/callout/CalloutVariant.tsx +59 -0
- package/src/components/notification/_variants/callout/CalloutVariantProps.ts +26 -0
- package/src/components/notification/_variants/callout/CalloutVariantRef.ts +6 -0
- package/src/components/notification/_variants/callout/index.tsx +3 -0
- package/src/components/notification/_variants/callout-inline/CalloutInlineVariant.tsx +59 -0
- package/src/components/notification/_variants/callout-inline/CalloutInlineVariantProps.ts +26 -0
- package/src/components/notification/_variants/callout-inline/CalloutInlineVariantRef.ts +6 -0
- package/src/components/notification/_variants/callout-inline/index.tsx +3 -0
- package/src/components/notification/_variants/index.tsx +5 -0
- package/src/components/notification/_variants/toast/ToastVariant.tsx +115 -0
- package/src/components/notification/_variants/toast/ToastVariantProps.ts +30 -0
- package/src/components/notification/_variants/toast/ToastVariantRef.ts +6 -0
- package/src/components/notification/_variants/toast/index.tsx +3 -0
- package/src/components/notification/actionable/error/Error.tsx +78 -0
- package/src/components/notification/actionable/error/ErrorProps.ts +14 -0
- package/src/components/notification/actionable/error/ErrorRef.ts +6 -0
- package/src/components/notification/actionable/error/index.tsx +3 -0
- package/src/components/notification/actionable/index.tsx +4 -0
- package/src/components/notification/actionable/informational/Informational.tsx +78 -0
- package/src/components/notification/actionable/informational/InformationalProps.ts +14 -0
- package/src/components/notification/actionable/informational/InformationalRef.ts +6 -0
- package/src/components/notification/actionable/informational/index.tsx +3 -0
- package/src/components/notification/actionable/success/Success.tsx +78 -0
- package/src/components/notification/actionable/success/SuccessProps.ts +14 -0
- package/src/components/notification/actionable/success/SuccessRef.ts +6 -0
- package/src/components/notification/actionable/success/index.tsx +3 -0
- package/src/components/notification/actionable/warning/Warning.tsx +78 -0
- package/src/components/notification/actionable/warning/WarningProps.ts +14 -0
- package/src/components/notification/actionable/warning/WarningRef.ts +6 -0
- package/src/components/notification/actionable/warning/index.tsx +3 -0
- package/src/components/notification/actionable-inline/error/Error.tsx +77 -0
- package/src/components/notification/actionable-inline/error/ErrorProps.ts +14 -0
- package/src/components/notification/actionable-inline/error/ErrorRef.ts +6 -0
- package/src/components/notification/actionable-inline/error/index.tsx +3 -0
- package/src/components/notification/actionable-inline/index.tsx +4 -0
- package/src/components/notification/actionable-inline/informational/Informational.tsx +77 -0
- package/src/components/notification/actionable-inline/informational/InformationalProps.ts +14 -0
- package/src/components/notification/actionable-inline/informational/InformationalRef.ts +6 -0
- package/src/components/notification/actionable-inline/informational/index.tsx +3 -0
- package/src/components/notification/actionable-inline/success/Success.tsx +77 -0
- package/src/components/notification/actionable-inline/success/SuccessProps.ts +14 -0
- package/src/components/notification/actionable-inline/success/SuccessRef.ts +6 -0
- package/src/components/notification/actionable-inline/success/index.tsx +3 -0
- package/src/components/notification/actionable-inline/warning/Warning.tsx +77 -0
- package/src/components/notification/actionable-inline/warning/WarningProps.ts +14 -0
- package/src/components/notification/actionable-inline/warning/WarningRef.ts +6 -0
- package/src/components/notification/actionable-inline/warning/index.tsx +3 -0
- package/src/components/notification/base/Base.tsx +292 -0
- package/src/components/notification/base/BaseProps.ts +59 -0
- package/src/components/notification/base/BaseRef.ts +6 -0
- package/src/components/notification/base/index.tsx +3 -0
- package/src/components/notification/callout/error/Error.tsx +78 -0
- package/src/components/notification/callout/error/ErrorProps.ts +14 -0
- package/src/components/notification/callout/error/ErrorRef.ts +6 -0
- package/src/components/notification/callout/error/index.tsx +3 -0
- package/src/components/notification/callout/index.tsx +4 -0
- package/src/components/notification/callout/informational/Informational.tsx +78 -0
- package/src/components/notification/callout/informational/InformationalProps.ts +14 -0
- package/src/components/notification/callout/informational/InformationalRef.ts +6 -0
- package/src/components/notification/callout/informational/index.tsx +3 -0
- package/src/components/notification/callout/success/Success.tsx +78 -0
- package/src/components/notification/callout/success/SuccessProps.ts +14 -0
- package/src/components/notification/callout/success/SuccessRef.ts +6 -0
- package/src/components/notification/callout/success/index.tsx +3 -0
- package/src/components/notification/callout/warning/Warning.tsx +78 -0
- package/src/components/notification/callout/warning/WarningProps.ts +14 -0
- package/src/components/notification/callout/warning/WarningRef.ts +6 -0
- package/src/components/notification/callout/warning/index.tsx +3 -0
- package/src/components/notification/callout-inline/error/Error.tsx +77 -0
- package/src/components/notification/callout-inline/error/ErrorProps.ts +14 -0
- package/src/components/notification/callout-inline/error/ErrorRef.ts +6 -0
- package/src/components/notification/callout-inline/error/index.tsx +3 -0
- package/src/components/notification/callout-inline/index.tsx +4 -0
- package/src/components/notification/callout-inline/informational/Informational.tsx +77 -0
- package/src/components/notification/callout-inline/informational/InformationalProps.ts +14 -0
- package/src/components/notification/callout-inline/informational/InformationalRef.ts +6 -0
- package/src/components/notification/callout-inline/informational/index.tsx +3 -0
- package/src/components/notification/callout-inline/success/Success.tsx +77 -0
- package/src/components/notification/callout-inline/success/SuccessProps.ts +14 -0
- package/src/components/notification/callout-inline/success/SuccessRef.ts +6 -0
- package/src/components/notification/callout-inline/success/index.tsx +3 -0
- package/src/components/notification/callout-inline/warning/Warning.tsx +77 -0
- package/src/components/notification/callout-inline/warning/WarningProps.ts +14 -0
- package/src/components/notification/callout-inline/warning/WarningRef.ts +6 -0
- package/src/components/notification/callout-inline/warning/index.tsx +3 -0
- package/src/components/notification/index.tsx +18 -0
- package/src/components/notification/subtitle/Subtitle.tsx +75 -0
- package/src/components/notification/subtitle/SubtitleProps.ts +6 -0
- package/src/components/notification/subtitle/SubtitleRef.ts +6 -0
- package/src/components/notification/subtitle/index.tsx +3 -0
- package/src/components/notification/subtitle-link/SubtitleLink.tsx +74 -0
- package/src/components/notification/subtitle-link/SubtitleLinkProps.ts +6 -0
- package/src/components/notification/subtitle-link/SubtitleLinkRef.ts +6 -0
- package/src/components/notification/subtitle-link/index.tsx +3 -0
- package/src/components/notification/toast/error/Error.tsx +78 -0
- package/src/components/notification/toast/error/ErrorProps.ts +14 -0
- package/src/components/notification/toast/error/ErrorRef.ts +6 -0
- package/src/components/notification/toast/error/index.tsx +3 -0
- package/src/components/notification/toast/index.tsx +4 -0
- package/src/components/notification/toast/informational/Informational.tsx +78 -0
- package/src/components/notification/toast/informational/InformationalProps.ts +14 -0
- package/src/components/notification/toast/informational/InformationalRef.ts +6 -0
- package/src/components/notification/toast/informational/index.tsx +3 -0
- package/src/components/notification/toast/success/Success.tsx +78 -0
- package/src/components/notification/toast/success/SuccessProps.ts +14 -0
- package/src/components/notification/toast/success/SuccessRef.ts +6 -0
- package/src/components/notification/toast/success/index.tsx +3 -0
- package/src/components/notification/toast/warning/Warning.tsx +78 -0
- package/src/components/notification/toast/warning/WarningProps.ts +14 -0
- package/src/components/notification/toast/warning/WarningRef.ts +6 -0
- package/src/components/notification/toast/warning/index.tsx +3 -0
- package/src/components/radio-button/RadioButton.tsx +216 -0
- package/src/components/radio-button/RadioButtonProps.ts +44 -0
- package/src/components/radio-button/RadioButtonRef.ts +10 -0
- package/src/components/radio-button/_RefBase.ts +11 -0
- package/src/components/radio-button/index.tsx +3 -0
- package/src/components/radio-button-group/RadioButtonGroup.tsx +246 -0
- package/src/components/radio-button-group/RadioButtonGroupHelperTextMode.ts +4 -0
- package/src/components/radio-button-group/RadioButtonGroupItemProps.ts +10 -0
- package/src/components/radio-button-group/RadioButtonGroupItemRef.ts +6 -0
- package/src/components/radio-button-group/RadioButtonGroupProps.ts +35 -0
- package/src/components/radio-button-group/RadioButtonGroupRef.ts +10 -0
- package/src/components/radio-button-group/_Item.tsx +101 -0
- package/src/components/radio-button-group/_RefBase.ts +11 -0
- package/src/components/radio-button-group/_item-context.tsx +18 -0
- package/src/components/radio-button-group/index.tsx +6 -0
- package/src/components/radio-button-input/RadioButtonInput.tsx +295 -0
- package/src/components/radio-button-input/RadioButtonInputInteractiveState.ts +6 -0
- package/src/components/radio-button-input/RadioButtonInputProps.ts +25 -0
- package/src/components/radio-button-input/RadioButtonInputRef.ts +10 -0
- package/src/components/radio-button-input/_RefBase.ts +7 -0
- package/src/components/radio-button-input/index.tsx +4 -0
- package/src/components/switch/Switch.tsx +487 -0
- package/src/components/switch/SwitchProps.ts +38 -0
- package/src/components/switch/SwitchRef.ts +10 -0
- package/src/components/switch/SwitchSize.ts +4 -0
- package/src/components/switch/SwitchState.ts +4 -0
- package/src/components/switch/_RefBase.ts +7 -0
- package/src/components/switch/index.ts +5 -0
- package/src/components/text/Text.tsx +171 -0
- package/src/components/text/TextProps.ts +20 -0
- package/src/components/text/TextRef.ts +6 -0
- package/src/components/text/index.ts +3 -0
- package/src/components/text-area/TextArea.tsx +266 -0
- package/src/components/text-area/TextAreaProps.ts +13 -0
- package/src/components/text-area/TextAreaRef.ts +10 -0
- package/src/components/text-area/_TextAreaRefBase.ts +7 -0
- package/src/components/text-area/index.tsx +3 -0
- package/src/components/text-area-field/TextAreaField.tsx +75 -0
- package/src/components/text-area-field/TextAreaFieldInteractiveState.ts +5 -0
- package/src/components/text-area-field/TextAreaFieldProps.ts +6 -0
- package/src/components/text-area-field/TextAreaFieldRef.ts +6 -0
- package/src/components/text-area-field/index.tsx +4 -0
- package/src/components/text-area-fluid/TextAreaFluid.tsx +157 -0
- package/src/components/text-area-fluid/TextAreaFluidProps.ts +13 -0
- package/src/components/text-area-fluid/TextAreaFluidRef.ts +6 -0
- package/src/components/text-area-fluid/index.tsx +3 -0
- package/src/components/text-input/TextInput.tsx +270 -0
- package/src/components/text-input/TextInputProps.ts +13 -0
- package/src/components/text-input/TextInputRef.ts +10 -0
- package/src/components/text-input/TextInputSize.ts +5 -0
- package/src/components/text-input/_TextInputRefBase.ts +7 -0
- package/src/components/text-input/index.ts +4 -0
- package/src/components/text-input-field/TextInputField.tsx +435 -0
- package/src/components/text-input-field/TextInputFieldInteractiveState.ts +6 -0
- package/src/components/text-input-field/TextInputFieldProps.ts +31 -0
- package/src/components/text-input-field/TextInputFieldRef.ts +8 -0
- package/src/components/text-input-field/TextInputFieldSize.ts +4 -0
- package/src/components/text-input-field/_rn-text-input/RNTextInput.tsx +161 -0
- package/src/components/text-input-field/_rn-text-input/RNTextInputProps.ts +11 -0
- package/src/components/text-input-field/_rn-text-input/RNTextInputRef.ts +6 -0
- package/src/components/text-input-field/_rn-text-input/index.ts +3 -0
- package/src/components/text-input-field/index.tsx +5 -0
- package/src/components/text-input-fluid/TextInputFluid.tsx +166 -0
- package/src/components/text-input-fluid/TextInputFluidProps.ts +14 -0
- package/src/components/text-input-fluid/TextInputFluidRef.ts +6 -0
- package/src/components/text-input-fluid/index.tsx +3 -0
- package/src/components/toggle/State.ts +5 -0
- package/src/components/toggle/base/Base.tsx +302 -0
- package/src/components/toggle/base/BaseProps.ts +54 -0
- package/src/components/toggle/base/BaseRef.ts +10 -0
- package/src/components/toggle/base/_RefBase.ts +11 -0
- package/src/components/toggle/base/index.tsx +3 -0
- package/src/components/toggle/default/Default.tsx +38 -0
- package/src/components/toggle/default/DefaultProps.ts +9 -0
- package/src/components/toggle/default/DefaultRef.ts +6 -0
- package/src/components/toggle/default/index.tsx +3 -0
- package/src/components/toggle/index.tsx +4 -0
- package/src/components/toggle/small/Small.tsx +38 -0
- package/src/components/toggle/small/SmallProps.ts +7 -0
- package/src/components/toggle/small/SmallRef.ts +6 -0
- package/src/components/toggle/small/index.tsx +3 -0
- package/src/const/dialog-animation-configs/carbon-react.ts +53 -0
- package/src/const/dialog-animation-configs/fade-bottom-up-2.ts +36 -0
- package/src/const/dialog-animation-configs/fade-bottom-up.ts +36 -0
- package/src/const/dialog-animation-configs/index.ts +3 -0
- package/src/const/index.ts +5 -0
- package/src/contexts/breakpoint/BreakpointContext.ts +19 -0
- package/src/contexts/breakpoint/index.ts +1 -0
- package/src/contexts/dialog/DialogContext.ts +27 -0
- package/src/contexts/dialog/DialogData.ts +27 -0
- package/src/contexts/dialog/DialogType.ts +7 -0
- package/src/contexts/dialog/index.ts +2 -0
- package/src/contexts/index.ts +4 -0
- package/src/contexts/theme/ThemeContext.ts +24 -0
- package/src/contexts/theme/index.ts +1 -0
- package/src/contexts/toast/ToastContext.ts +24 -0
- package/src/contexts/toast/ToastContextShowConfig.ts +6 -0
- package/src/contexts/toast/index.ts +2 -0
- package/src/helpers/breakpoint/get-token.ts +20 -0
- package/src/helpers/breakpoint/index.ts +1 -0
- package/src/helpers/color/get-color-scheme.ts +19 -0
- package/src/helpers/color/get-color-token.ts +23 -0
- package/src/helpers/color/hex-to-rgba.ts +11 -0
- package/src/helpers/color/index.ts +3 -0
- package/src/helpers/index.ts +7 -0
- package/src/hooks/breakpoint/index.tsx +1 -0
- package/src/hooks/breakpoint/use.tsx +30 -0
- package/src/hooks/index.tsx +9 -0
- package/src/index.ts +9 -0
- package/src/providers/dialog/DialogProvider.tsx +122 -0
- package/src/providers/dialog/DialogProviderAnimationConfig.ts +49 -0
- package/src/providers/dialog/DialogProviderProps.ts +28 -0
- package/src/providers/dialog/DialogProviderRef.ts +6 -0
- package/src/providers/dialog/_controller/Controller.tsx +223 -0
- package/src/providers/dialog/_controller/ControllerProps.ts +11 -0
- package/src/providers/dialog/_controller/ControllerRef.ts +6 -0
- package/src/providers/dialog/_controller/_modal/Modal.tsx +148 -0
- package/src/providers/dialog/_controller/_modal/ModalProps.ts +11 -0
- package/src/providers/dialog/_controller/_modal/ModalRef.ts +8 -0
- package/src/providers/dialog/_controller/_modal/_Interpolation.ts +9 -0
- package/src/providers/dialog/_controller/_modal/index.ts +3 -0
- package/src/providers/dialog/_controller/_overlay/Overlay.tsx +132 -0
- package/src/providers/dialog/_controller/_overlay/OverlayProps.ts +9 -0
- package/src/providers/dialog/_controller/_overlay/OverlayRef.ts +10 -0
- package/src/providers/dialog/_controller/_overlay/_OverlayRefBase.ts +3 -0
- package/src/providers/dialog/_controller/_overlay/index.ts +3 -0
- package/src/providers/dialog/_controller/index.ts +3 -0
- package/src/providers/dialog/index.ts +4 -0
- package/src/providers/index.ts +2 -0
- package/src/providers/toast/ToastProvider.tsx +73 -0
- package/src/providers/toast/ToastProviderProps.ts +3 -0
- package/src/providers/toast/ToastRef.ts +6 -0
- package/src/providers/toast/_overlay/Overlay.tsx +208 -0
- package/src/providers/toast/_overlay/OverlayRef.ts +6 -0
- package/src/providers/toast/_overlay/_component-wrapper/ComponentWrapper.tsx +168 -0
- package/src/providers/toast/_overlay/_component-wrapper/ComponentWrapperProps.ts +8 -0
- package/src/providers/toast/_overlay/_component-wrapper/ComponentWrapperRef.ts +6 -0
- package/src/providers/toast/_overlay/_component-wrapper/index.ts +3 -0
- package/src/providers/toast/_overlay/index.ts +2 -0
- package/src/providers/toast/index.tsx +3 -0
- package/src/types/index.ts +7 -0
- package/src/types/shared.ts +1 -0
- package/src/types/theme/ColorScheme.ts +1 -0
- package/src/types/theme/index.ts +1 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import {
|
|
2
|
+
forwardRef,
|
|
3
|
+
} from "react"
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
useInformational,
|
|
7
|
+
} from "../../_status-hooks"
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
ActionableInlineVariant,
|
|
11
|
+
} from "../../_variants"
|
|
12
|
+
|
|
13
|
+
import type {
|
|
14
|
+
InformationalProps,
|
|
15
|
+
} from "./InformationalProps"
|
|
16
|
+
|
|
17
|
+
import type {
|
|
18
|
+
InformationalRef,
|
|
19
|
+
} from "./InformationalRef"
|
|
20
|
+
|
|
21
|
+
export const Informational = forwardRef<InformationalRef, InformationalProps>(
|
|
22
|
+
function Informational(
|
|
23
|
+
{
|
|
24
|
+
color,
|
|
25
|
+
iconProps,
|
|
26
|
+
iconCloseProps,
|
|
27
|
+
titleStyle: titleStyleProp,
|
|
28
|
+
leftBarStyle: leftBarStyleProp,
|
|
29
|
+
style: styleProp,
|
|
30
|
+
...props
|
|
31
|
+
},
|
|
32
|
+
ref,
|
|
33
|
+
) {
|
|
34
|
+
|
|
35
|
+
const {
|
|
36
|
+
Icon,
|
|
37
|
+
iconProps: iconPropsData,
|
|
38
|
+
iconCloseProps: iconClosePropsData,
|
|
39
|
+
titleStyle,
|
|
40
|
+
leftBarStyle,
|
|
41
|
+
style,
|
|
42
|
+
} =
|
|
43
|
+
useInformational({
|
|
44
|
+
color,
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<ActionableInlineVariant
|
|
49
|
+
{ ...props }
|
|
50
|
+
color={ color }
|
|
51
|
+
Icon={ Icon }
|
|
52
|
+
iconProps={{
|
|
53
|
+
...iconProps,
|
|
54
|
+
...iconPropsData,
|
|
55
|
+
}}
|
|
56
|
+
iconCloseProps={{
|
|
57
|
+
...iconCloseProps,
|
|
58
|
+
...iconClosePropsData,
|
|
59
|
+
}}
|
|
60
|
+
titleStyle={ [
|
|
61
|
+
titleStyle,
|
|
62
|
+
titleStyleProp,
|
|
63
|
+
] }
|
|
64
|
+
leftBarStyle={ [
|
|
65
|
+
leftBarStyle,
|
|
66
|
+
leftBarStyleProp,
|
|
67
|
+
] }
|
|
68
|
+
style={ [
|
|
69
|
+
style,
|
|
70
|
+
styleProp,
|
|
71
|
+
] }
|
|
72
|
+
ref={ ref }
|
|
73
|
+
/>
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
},
|
|
77
|
+
)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ActionableInlineVariantProps,
|
|
3
|
+
} from "../../_variants/actionable-inline"
|
|
4
|
+
|
|
5
|
+
export interface InformationalProps extends Omit<ActionableInlineVariantProps, "icon"> {
|
|
6
|
+
iconProps?: Omit<
|
|
7
|
+
NonNullable<ActionableInlineVariantProps["iconProps"]>,
|
|
8
|
+
| "color"
|
|
9
|
+
>,
|
|
10
|
+
iconCloseProps?: Omit<
|
|
11
|
+
NonNullable<ActionableInlineVariantProps["iconCloseProps"]>,
|
|
12
|
+
| "color"
|
|
13
|
+
>,
|
|
14
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import {
|
|
2
|
+
forwardRef,
|
|
3
|
+
} from "react"
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
useSuccess,
|
|
7
|
+
} from "../../_status-hooks"
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
ActionableInlineVariant,
|
|
11
|
+
} from "../../_variants"
|
|
12
|
+
|
|
13
|
+
import type {
|
|
14
|
+
SuccessProps,
|
|
15
|
+
} from "./SuccessProps"
|
|
16
|
+
|
|
17
|
+
import type {
|
|
18
|
+
SuccessRef,
|
|
19
|
+
} from "./SuccessRef"
|
|
20
|
+
|
|
21
|
+
export const Success = forwardRef<SuccessRef, SuccessProps>(
|
|
22
|
+
function Success(
|
|
23
|
+
{
|
|
24
|
+
color,
|
|
25
|
+
iconProps,
|
|
26
|
+
iconCloseProps,
|
|
27
|
+
titleStyle: titleStyleProp,
|
|
28
|
+
leftBarStyle: leftBarStyleProp,
|
|
29
|
+
style: styleProp,
|
|
30
|
+
...props
|
|
31
|
+
},
|
|
32
|
+
ref,
|
|
33
|
+
) {
|
|
34
|
+
|
|
35
|
+
const {
|
|
36
|
+
Icon,
|
|
37
|
+
iconProps: iconPropsData,
|
|
38
|
+
iconCloseProps: iconClosePropsData,
|
|
39
|
+
titleStyle,
|
|
40
|
+
leftBarStyle,
|
|
41
|
+
style,
|
|
42
|
+
} =
|
|
43
|
+
useSuccess({
|
|
44
|
+
color,
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<ActionableInlineVariant
|
|
49
|
+
{ ...props }
|
|
50
|
+
color={ color }
|
|
51
|
+
Icon={ Icon }
|
|
52
|
+
iconProps={{
|
|
53
|
+
...iconProps,
|
|
54
|
+
...iconPropsData,
|
|
55
|
+
}}
|
|
56
|
+
iconCloseProps={{
|
|
57
|
+
...iconCloseProps,
|
|
58
|
+
...iconClosePropsData,
|
|
59
|
+
}}
|
|
60
|
+
titleStyle={ [
|
|
61
|
+
titleStyle,
|
|
62
|
+
titleStyleProp,
|
|
63
|
+
] }
|
|
64
|
+
leftBarStyle={ [
|
|
65
|
+
leftBarStyle,
|
|
66
|
+
leftBarStyleProp,
|
|
67
|
+
] }
|
|
68
|
+
style={ [
|
|
69
|
+
style,
|
|
70
|
+
styleProp,
|
|
71
|
+
] }
|
|
72
|
+
ref={ ref }
|
|
73
|
+
/>
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
},
|
|
77
|
+
)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ActionableInlineVariantProps,
|
|
3
|
+
} from "../../_variants/actionable-inline"
|
|
4
|
+
|
|
5
|
+
export interface SuccessProps extends Omit<ActionableInlineVariantProps, "icon"> {
|
|
6
|
+
iconProps?: Omit<
|
|
7
|
+
NonNullable<ActionableInlineVariantProps["iconProps"]>,
|
|
8
|
+
| "color"
|
|
9
|
+
>,
|
|
10
|
+
iconCloseProps?: Omit<
|
|
11
|
+
NonNullable<ActionableInlineVariantProps["iconCloseProps"]>,
|
|
12
|
+
| "color"
|
|
13
|
+
>,
|
|
14
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import {
|
|
2
|
+
forwardRef,
|
|
3
|
+
} from "react"
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
useWarning,
|
|
7
|
+
} from "../../_status-hooks"
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
ActionableInlineVariant,
|
|
11
|
+
} from "../../_variants"
|
|
12
|
+
|
|
13
|
+
import type {
|
|
14
|
+
WarningProps,
|
|
15
|
+
} from "./WarningProps"
|
|
16
|
+
|
|
17
|
+
import type {
|
|
18
|
+
WarningRef,
|
|
19
|
+
} from "./WarningRef"
|
|
20
|
+
|
|
21
|
+
export const Warning = forwardRef<WarningRef, WarningProps>(
|
|
22
|
+
function Warning(
|
|
23
|
+
{
|
|
24
|
+
color,
|
|
25
|
+
iconProps,
|
|
26
|
+
iconCloseProps,
|
|
27
|
+
titleStyle: titleStyleProp,
|
|
28
|
+
leftBarStyle: leftBarStyleProp,
|
|
29
|
+
style: styleProp,
|
|
30
|
+
...props
|
|
31
|
+
},
|
|
32
|
+
ref,
|
|
33
|
+
) {
|
|
34
|
+
|
|
35
|
+
const {
|
|
36
|
+
Icon,
|
|
37
|
+
iconProps: iconPropsData,
|
|
38
|
+
iconCloseProps: iconClosePropsData,
|
|
39
|
+
titleStyle,
|
|
40
|
+
leftBarStyle,
|
|
41
|
+
style,
|
|
42
|
+
} =
|
|
43
|
+
useWarning({
|
|
44
|
+
color,
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<ActionableInlineVariant
|
|
49
|
+
{ ...props }
|
|
50
|
+
color={ color }
|
|
51
|
+
Icon={ Icon }
|
|
52
|
+
iconProps={{
|
|
53
|
+
...iconProps,
|
|
54
|
+
...iconPropsData,
|
|
55
|
+
}}
|
|
56
|
+
iconCloseProps={{
|
|
57
|
+
...iconCloseProps,
|
|
58
|
+
...iconClosePropsData,
|
|
59
|
+
}}
|
|
60
|
+
titleStyle={ [
|
|
61
|
+
titleStyle,
|
|
62
|
+
titleStyleProp,
|
|
63
|
+
] }
|
|
64
|
+
leftBarStyle={ [
|
|
65
|
+
leftBarStyle,
|
|
66
|
+
leftBarStyleProp,
|
|
67
|
+
] }
|
|
68
|
+
style={ [
|
|
69
|
+
style,
|
|
70
|
+
styleProp,
|
|
71
|
+
] }
|
|
72
|
+
ref={ ref }
|
|
73
|
+
/>
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
},
|
|
77
|
+
)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ActionableInlineVariantProps,
|
|
3
|
+
} from "../../_variants/actionable-inline"
|
|
4
|
+
|
|
5
|
+
export interface WarningProps extends Omit<ActionableInlineVariantProps, "icon"> {
|
|
6
|
+
iconProps?: Omit<
|
|
7
|
+
NonNullable<ActionableInlineVariantProps["iconProps"]>,
|
|
8
|
+
| "color"
|
|
9
|
+
>,
|
|
10
|
+
iconCloseProps?: Omit<
|
|
11
|
+
NonNullable<ActionableInlineVariantProps["iconCloseProps"]>,
|
|
12
|
+
| "color"
|
|
13
|
+
>,
|
|
14
|
+
}
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import {
|
|
2
|
+
forwardRef,
|
|
3
|
+
useContext,
|
|
4
|
+
} from "react"
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
StyleSheet,
|
|
8
|
+
View,
|
|
9
|
+
type ViewStyle,
|
|
10
|
+
} from "react-native"
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
Color,
|
|
14
|
+
Spacing,
|
|
15
|
+
} from "@audira/carbon-react-native-elements"
|
|
16
|
+
|
|
17
|
+
import IconClose from "@carbon/icons/svg/32/close.svg"
|
|
18
|
+
|
|
19
|
+
import {
|
|
20
|
+
GlobalConfigContext,
|
|
21
|
+
} from "../../../_internal/contexts"
|
|
22
|
+
|
|
23
|
+
import {
|
|
24
|
+
CommonStyleSheet,
|
|
25
|
+
FlexStyleSheet,
|
|
26
|
+
} from "../../../_internal/style-sheets"
|
|
27
|
+
|
|
28
|
+
import {
|
|
29
|
+
CarbonStyleSheet,
|
|
30
|
+
} from "../../../carbon-style-sheet"
|
|
31
|
+
|
|
32
|
+
import {
|
|
33
|
+
ThemeContext,
|
|
34
|
+
} from "../../../contexts"
|
|
35
|
+
|
|
36
|
+
import {
|
|
37
|
+
BaseColor as ButtonBaseColor,
|
|
38
|
+
type BaseColorProps,
|
|
39
|
+
} from "../../button/base-color"
|
|
40
|
+
|
|
41
|
+
import {
|
|
42
|
+
Text,
|
|
43
|
+
} from "../../text"
|
|
44
|
+
|
|
45
|
+
import type {
|
|
46
|
+
BaseProps,
|
|
47
|
+
} from "./BaseProps"
|
|
48
|
+
|
|
49
|
+
import type {
|
|
50
|
+
BaseRef,
|
|
51
|
+
} from "./BaseRef"
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
export const Base = forwardRef<BaseRef, BaseProps>(
|
|
55
|
+
function Base(
|
|
56
|
+
{
|
|
57
|
+
title,
|
|
58
|
+
body,
|
|
59
|
+
inline,
|
|
60
|
+
|
|
61
|
+
Icon,
|
|
62
|
+
iconProps,
|
|
63
|
+
iconContainerStyle,
|
|
64
|
+
|
|
65
|
+
iconClose,
|
|
66
|
+
onPressIconClose,
|
|
67
|
+
iconCloseProps,
|
|
68
|
+
iconCloseButtonProps,
|
|
69
|
+
|
|
70
|
+
nodes,
|
|
71
|
+
|
|
72
|
+
titleStyle,
|
|
73
|
+
leftBarStyle,
|
|
74
|
+
leftContainerStyle,
|
|
75
|
+
contentContainerStyle,
|
|
76
|
+
|
|
77
|
+
style,
|
|
78
|
+
dir,
|
|
79
|
+
...props
|
|
80
|
+
},
|
|
81
|
+
ref,
|
|
82
|
+
) {
|
|
83
|
+
|
|
84
|
+
const
|
|
85
|
+
globalConfigContext =
|
|
86
|
+
useContext(GlobalConfigContext),
|
|
87
|
+
|
|
88
|
+
themeContext =
|
|
89
|
+
useContext(ThemeContext)
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<View
|
|
93
|
+
{ ...props }
|
|
94
|
+
dir={ dir ?? globalConfigContext.rtl ? "rtl" : undefined }
|
|
95
|
+
style={ [
|
|
96
|
+
FlexStyleSheet.flex_row,
|
|
97
|
+
globalConfigContext.rtl ? CommonStyleSheet.rtl : undefined,
|
|
98
|
+
style,
|
|
99
|
+
] }
|
|
100
|
+
ref={ ref }
|
|
101
|
+
>
|
|
102
|
+
<View
|
|
103
|
+
style={ [
|
|
104
|
+
baseStyle.leftBar,
|
|
105
|
+
leftBarStyle,
|
|
106
|
+
] }
|
|
107
|
+
/>
|
|
108
|
+
|
|
109
|
+
<View
|
|
110
|
+
style={ [
|
|
111
|
+
FlexStyleSheet.flex_auto,
|
|
112
|
+
FlexStyleSheet.flex_row,
|
|
113
|
+
!inline
|
|
114
|
+
? baseStyle.leftContainerNonInline
|
|
115
|
+
: FlexStyleSheet.items_center,
|
|
116
|
+
leftContainerStyle,
|
|
117
|
+
] }
|
|
118
|
+
>
|
|
119
|
+
{ !!Icon && (
|
|
120
|
+
<View
|
|
121
|
+
style={ [
|
|
122
|
+
baseStyle.iconContainer,
|
|
123
|
+
iconContainerStyle,
|
|
124
|
+
] }
|
|
125
|
+
>
|
|
126
|
+
<Icon
|
|
127
|
+
{ ...iconProps }
|
|
128
|
+
width={ 20 }
|
|
129
|
+
height={ 20 }
|
|
130
|
+
/>
|
|
131
|
+
</View>
|
|
132
|
+
) }
|
|
133
|
+
|
|
134
|
+
{ nodes?.beforeContentContainer }
|
|
135
|
+
|
|
136
|
+
{ (!!title || !!body) && (
|
|
137
|
+
<View
|
|
138
|
+
style={ [
|
|
139
|
+
FlexStyleSheet.flex_auto,
|
|
140
|
+
contentContainerStyle,
|
|
141
|
+
] }
|
|
142
|
+
>
|
|
143
|
+
{ !inline ? (<>
|
|
144
|
+
|
|
145
|
+
{ !!title && (
|
|
146
|
+
<Text
|
|
147
|
+
type="heading_compact_01"
|
|
148
|
+
style={ titleStyle }
|
|
149
|
+
>
|
|
150
|
+
{ title }
|
|
151
|
+
</Text>
|
|
152
|
+
) }
|
|
153
|
+
|
|
154
|
+
{ body }
|
|
155
|
+
|
|
156
|
+
</>) : (
|
|
157
|
+
|
|
158
|
+
<Text
|
|
159
|
+
type="heading_compact_01"
|
|
160
|
+
style={ [baseStyle.inlineTextWrapper, titleStyle] }
|
|
161
|
+
>
|
|
162
|
+
{ !globalConfigContext.rtl
|
|
163
|
+
? (
|
|
164
|
+
<>{ title }{ title && body ? " " : "" }{ body }</>
|
|
165
|
+
)
|
|
166
|
+
: (
|
|
167
|
+
<>{ body }{ title && body ? " " : "" }{ title }</>
|
|
168
|
+
) }
|
|
169
|
+
</Text>
|
|
170
|
+
|
|
171
|
+
) }
|
|
172
|
+
|
|
173
|
+
{ nodes?.beforeContentContainerEnd }
|
|
174
|
+
</View>
|
|
175
|
+
) }
|
|
176
|
+
|
|
177
|
+
{ nodes?.afterContentContainer }
|
|
178
|
+
</View>
|
|
179
|
+
|
|
180
|
+
{ nodes?.beforeButtonClose }
|
|
181
|
+
|
|
182
|
+
{ !!iconClose && (
|
|
183
|
+
<ButtonBaseColor
|
|
184
|
+
{ ...iconCloseButtonProps }
|
|
185
|
+
text=""
|
|
186
|
+
android_rippleEffectColor={ mapAndroidRippleEffectColor[themeContext.colorScheme] }
|
|
187
|
+
size="large_expressive"
|
|
188
|
+
Icon={ IconClose }
|
|
189
|
+
iconProps={ iconCloseProps }
|
|
190
|
+
onPress={ onPressIconClose }
|
|
191
|
+
colorStateStyle={{
|
|
192
|
+
background: {
|
|
193
|
+
default: backgroundStyleSheet.default,
|
|
194
|
+
focused: backgroundStyleSheet.focused,
|
|
195
|
+
hovered: backgroundStyleSheet.hovered,
|
|
196
|
+
pressed: backgroundStyleSheet.pressed,
|
|
197
|
+
disabled: backgroundStyleSheet.disabled,
|
|
198
|
+
},
|
|
199
|
+
text: {
|
|
200
|
+
default: baseStyle.text,
|
|
201
|
+
focused: baseStyle.text,
|
|
202
|
+
hovered: baseStyle.text,
|
|
203
|
+
pressed: baseStyle.text,
|
|
204
|
+
disabled: baseStyle.text,
|
|
205
|
+
},
|
|
206
|
+
/**
|
|
207
|
+
* Means nothing since we used `iconNode` prop
|
|
208
|
+
*/
|
|
209
|
+
icon: {
|
|
210
|
+
default: "transparent",
|
|
211
|
+
focused: "transparent",
|
|
212
|
+
hovered: "transparent",
|
|
213
|
+
pressed: "transparent",
|
|
214
|
+
disabled: "transparent",
|
|
215
|
+
},
|
|
216
|
+
}}
|
|
217
|
+
style={ [
|
|
218
|
+
FlexStyleSheet.justify_center,
|
|
219
|
+
baseStyle.buttonIconClose,
|
|
220
|
+
iconCloseButtonProps?.style,
|
|
221
|
+
] }
|
|
222
|
+
/>
|
|
223
|
+
) }
|
|
224
|
+
</View>
|
|
225
|
+
)
|
|
226
|
+
|
|
227
|
+
},
|
|
228
|
+
)
|
|
229
|
+
|
|
230
|
+
const
|
|
231
|
+
baseStyle =
|
|
232
|
+
StyleSheet.create({
|
|
233
|
+
leftBar: {
|
|
234
|
+
position: "absolute",
|
|
235
|
+
top: -1,
|
|
236
|
+
bottom: -1,
|
|
237
|
+
width: 3,
|
|
238
|
+
},
|
|
239
|
+
iconContainer: {
|
|
240
|
+
marginStart: Spacing.spacing_05,
|
|
241
|
+
marginEnd: Spacing.spacing_05,
|
|
242
|
+
},
|
|
243
|
+
leftContainerNonInline: {
|
|
244
|
+
marginTop: Spacing.spacing_05,
|
|
245
|
+
marginBottom: Spacing.spacing_05,
|
|
246
|
+
},
|
|
247
|
+
inlineTextWrapper: {
|
|
248
|
+
marginTop: Spacing.spacing_04,
|
|
249
|
+
marginBottom: Spacing.spacing_04,
|
|
250
|
+
},
|
|
251
|
+
buttonIconClose: {
|
|
252
|
+
width: 48,
|
|
253
|
+
height: 48,
|
|
254
|
+
minWidth: 48,
|
|
255
|
+
minHeight: 48,
|
|
256
|
+
paddingTop: 0,
|
|
257
|
+
paddingRight: 0,
|
|
258
|
+
paddingBottom: 0,
|
|
259
|
+
paddingLeft: 0,
|
|
260
|
+
},
|
|
261
|
+
text: {
|
|
262
|
+
color: "transparent",
|
|
263
|
+
},
|
|
264
|
+
}),
|
|
265
|
+
|
|
266
|
+
backgroundStyleSheet =
|
|
267
|
+
CarbonStyleSheet.create<
|
|
268
|
+
Record<keyof BaseColorProps["colorStateStyle"]["background"], ViewStyle>
|
|
269
|
+
>({
|
|
270
|
+
default: {
|
|
271
|
+
backgroundColor: "transparent",
|
|
272
|
+
},
|
|
273
|
+
focused: {
|
|
274
|
+
borderWidth: 1,
|
|
275
|
+
borderColor: CarbonStyleSheet.color.focus,
|
|
276
|
+
},
|
|
277
|
+
hovered: {
|
|
278
|
+
backgroundColor: CarbonStyleSheet.color.background_hover,
|
|
279
|
+
},
|
|
280
|
+
pressed: {
|
|
281
|
+
backgroundColor: CarbonStyleSheet.color.background_active,
|
|
282
|
+
},
|
|
283
|
+
disabled: {
|
|
284
|
+
backgroundColor: "transparent",
|
|
285
|
+
},
|
|
286
|
+
}),
|
|
287
|
+
|
|
288
|
+
mapAndroidRippleEffectColor: Record<ThemeContext["colorScheme"], string> =
|
|
289
|
+
{
|
|
290
|
+
gray_10: Color.Token.gray_10.background_active,
|
|
291
|
+
gray_100: Color.Token.gray_100.background_active,
|
|
292
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ViewProps,
|
|
3
|
+
} from "react-native"
|
|
4
|
+
|
|
5
|
+
import type {
|
|
6
|
+
SvgProps,
|
|
7
|
+
} from "react-native-svg"
|
|
8
|
+
|
|
9
|
+
import type {
|
|
10
|
+
BaseColorProps,
|
|
11
|
+
} from "../../button/base-color"
|
|
12
|
+
|
|
13
|
+
import type {
|
|
14
|
+
TextProps,
|
|
15
|
+
} from "../../text/TextProps"
|
|
16
|
+
|
|
17
|
+
export interface BaseProps extends Omit<ViewProps, "children"> {
|
|
18
|
+
title?: string,
|
|
19
|
+
/**
|
|
20
|
+
* You can fill it with string or number to render quickly useful message.
|
|
21
|
+
* Alternatively, you can use `<Notification.Subtitle>` with `<Notification.SubtitleLink>` if necessary
|
|
22
|
+
*/
|
|
23
|
+
body?: React.ReactNode,
|
|
24
|
+
inline?: boolean,
|
|
25
|
+
|
|
26
|
+
Icon?: BaseColorProps["Icon"],
|
|
27
|
+
iconProps?: Omit<SvgProps, "width" | "height">,
|
|
28
|
+
iconContainerStyle?: ViewProps["style"],
|
|
29
|
+
|
|
30
|
+
iconClose?: boolean,
|
|
31
|
+
onPressIconClose?: BaseColorProps["onPress"],
|
|
32
|
+
iconCloseProps?: Omit<
|
|
33
|
+
SvgProps,
|
|
34
|
+
| "width"
|
|
35
|
+
| "height"
|
|
36
|
+
>,
|
|
37
|
+
iconCloseButtonProps?: Omit<
|
|
38
|
+
BaseColorProps,
|
|
39
|
+
| "text"
|
|
40
|
+
| "size"
|
|
41
|
+
| "icon"
|
|
42
|
+
| "iconNode"
|
|
43
|
+
| "colorStateStyle"
|
|
44
|
+
| "onPress"
|
|
45
|
+
>,
|
|
46
|
+
|
|
47
|
+
nodes?: Partial<Record<
|
|
48
|
+
| "beforeContentContainer"
|
|
49
|
+
| "beforeButtonClose"
|
|
50
|
+
| "afterContentContainer"
|
|
51
|
+
| "beforeContentContainerEnd",
|
|
52
|
+
React.ReactNode
|
|
53
|
+
>>,
|
|
54
|
+
|
|
55
|
+
titleStyle?: TextProps["style"],
|
|
56
|
+
leftBarStyle?: ViewProps["style"],
|
|
57
|
+
leftContainerStyle?: ViewProps["style"],
|
|
58
|
+
contentContainerStyle?: ViewProps["style"],
|
|
59
|
+
}
|