react-native-molecules 0.5.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Accordion/Accordion.tsx +89 -0
- package/components/Accordion/AccordionItem.tsx +94 -0
- package/components/Accordion/AccordionItemContent.tsx +17 -0
- package/components/Accordion/AccordionItemHeader.tsx +122 -0
- package/components/Accordion/index.tsx +36 -0
- package/components/Accordion/utils.ts +62 -0
- package/components/ActivityIndicator/ActivityIndicator.ios.tsx +1 -0
- package/components/ActivityIndicator/ActivityIndicator.tsx +200 -0
- package/components/ActivityIndicator/AnimatedSpinner.tsx +121 -0
- package/components/ActivityIndicator/index.tsx +17 -0
- package/components/Appbar/AppbarActions.tsx +13 -0
- package/components/Appbar/AppbarBase.tsx +60 -0
- package/components/Appbar/AppbarCenterAligned.tsx +13 -0
- package/components/Appbar/AppbarLarge.tsx +13 -0
- package/components/Appbar/AppbarLeft.tsx +26 -0
- package/components/Appbar/AppbarMedium.tsx +13 -0
- package/components/Appbar/AppbarRight.tsx +40 -0
- package/components/Appbar/AppbarSmall.tsx +13 -0
- package/components/Appbar/AppbarTitle.tsx +49 -0
- package/components/Appbar/index.tsx +46 -0
- package/components/Appbar/types.ts +19 -0
- package/components/Appbar/utils.ts +127 -0
- package/components/Avatar/Avatar.tsx +189 -0
- package/components/Avatar/index.tsx +11 -0
- package/components/Avatar/utils.ts +35 -0
- package/components/Backdrop/Backdrop.tsx +18 -0
- package/components/Backdrop/index.tsx +11 -0
- package/components/Backdrop/types.ts +3 -0
- package/components/Backdrop/utils.ts +21 -0
- package/components/Badge/Badge.tsx +29 -0
- package/components/Badge/index.tsx +11 -0
- package/components/Badge/utils.ts +38 -0
- package/components/Button/Button.tsx +349 -0
- package/components/Button/index.tsx +11 -0
- package/components/Button/types.ts +5 -0
- package/components/Button/utils.ts +416 -0
- package/components/Card/Card.tsx +160 -0
- package/components/Card/CardActions.tsx +18 -0
- package/components/Card/CardContent.tsx +29 -0
- package/components/Card/CardHeader.tsx +31 -0
- package/components/Card/CardHeadline.tsx +15 -0
- package/components/Card/CardMedia.tsx +36 -0
- package/components/Card/CardSubhead.tsx +15 -0
- package/components/Card/CardText.tsx +13 -0
- package/components/Card/CardTypography.tsx +113 -0
- package/components/Card/index.tsx +38 -0
- package/components/Card/types.ts +1 -0
- package/components/Card/utils.ts +23 -0
- package/components/Checkbox/Checkbox.tsx +123 -0
- package/components/Checkbox/CheckboxBase.ios.tsx +86 -0
- package/components/Checkbox/CheckboxBase.tsx +216 -0
- package/components/Checkbox/index.tsx +11 -0
- package/components/Checkbox/types.ts +72 -0
- package/components/Checkbox/utils.ts +210 -0
- package/components/Chip/Chip.tsx +416 -0
- package/components/Chip/index.tsx +51 -0
- package/components/Chip/utils.ts +100 -0
- package/components/DatePickerDocked/DatePickerDocked.tsx +30 -0
- package/components/DatePickerDocked/DatePickerDockedHeader.tsx +129 -0
- package/components/DatePickerDocked/index.tsx +21 -0
- package/components/DatePickerDocked/types.ts +11 -0
- package/components/DatePickerDocked/utils.ts +155 -0
- package/components/DatePickerInline/AutoSizer.tsx +46 -0
- package/components/DatePickerInline/DatePickerContext.tsx +21 -0
- package/components/DatePickerInline/DatePickerInline.tsx +82 -0
- package/components/DatePickerInline/DatePickerInlineBase.tsx +181 -0
- package/components/DatePickerInline/DatePickerInlineHeader.tsx +108 -0
- package/components/DatePickerInline/Day.tsx +88 -0
- package/components/DatePickerInline/DayName.tsx +17 -0
- package/components/DatePickerInline/DayNames.tsx +32 -0
- package/components/DatePickerInline/DayRange.tsx +48 -0
- package/components/DatePickerInline/HeaderItem.tsx +111 -0
- package/components/DatePickerInline/Month.tsx +233 -0
- package/components/DatePickerInline/MonthPicker.tsx +174 -0
- package/components/DatePickerInline/Swiper.native.tsx +172 -0
- package/components/DatePickerInline/Swiper.tsx +172 -0
- package/components/DatePickerInline/SwiperUtils.ts +40 -0
- package/components/DatePickerInline/Week.tsx +67 -0
- package/components/DatePickerInline/YearPicker.tsx +139 -0
- package/components/DatePickerInline/dateUtils.tsx +334 -0
- package/components/DatePickerInline/index.tsx +41 -0
- package/components/DatePickerInline/types.ts +104 -0
- package/components/DatePickerInline/utils.ts +367 -0
- package/components/DatePickerInput/DatePickerInput.tsx +139 -0
- package/components/DatePickerInput/DatePickerInputModal.tsx +48 -0
- package/components/DatePickerInput/DatePickerInputWithoutModal.tsx +77 -0
- package/components/DatePickerInput/DateRangeInput.tsx +88 -0
- package/components/DatePickerInput/index.tsx +14 -0
- package/components/DatePickerInput/inputUtils.ts +138 -0
- package/components/DatePickerInput/types.ts +28 -0
- package/components/DatePickerInput/utils.ts +16 -0
- package/components/DatePickerModal/AnimatedCrossView.tsx +94 -0
- package/components/DatePickerModal/CalendarEdit.tsx +139 -0
- package/components/DatePickerModal/DatePickerModal.tsx +85 -0
- package/components/DatePickerModal/DatePickerModalContent.tsx +155 -0
- package/components/DatePickerModal/DatePickerModalContentHeader.tsx +213 -0
- package/components/DatePickerModal/DatePickerModalHeader.tsx +74 -0
- package/components/DatePickerModal/DatePickerModalHeaderBackground.tsx +13 -0
- package/components/DatePickerModal/index.tsx +20 -0
- package/components/DatePickerModal/types.ts +92 -0
- package/components/DatePickerModal/utils.ts +121 -0
- package/components/DateTimePicker/DateTimePicker.tsx +172 -0
- package/components/DateTimePicker/index.tsx +14 -0
- package/components/DateTimePicker/utils.ts +13 -0
- package/components/Dialog/Dialog.tsx +66 -0
- package/components/Dialog/DialogActions.tsx +89 -0
- package/components/Dialog/DialogContent.tsx +37 -0
- package/components/Dialog/DialogIcon.tsx +69 -0
- package/components/Dialog/DialogTitle.tsx +68 -0
- package/components/Dialog/index.tsx +37 -0
- package/components/Dialog/utils.ts +80 -0
- package/components/Drawer/Collapsible/DrawerCollapsible.tsx +22 -0
- package/components/Drawer/Collapsible/DrawerCollapsibleItem.tsx +38 -0
- package/components/Drawer/Collapsible/DrawerCollapsibleItemContent.tsx +16 -0
- package/components/Drawer/Collapsible/DrawerCollapsibleItemHeader.tsx +48 -0
- package/components/Drawer/Collapsible/index.tsx +23 -0
- package/components/Drawer/Collapsible/utils.ts +49 -0
- package/components/Drawer/Drawer.tsx +43 -0
- package/components/Drawer/DrawerContent.tsx +35 -0
- package/components/Drawer/DrawerFooter.tsx +27 -0
- package/components/Drawer/DrawerHeader.tsx +27 -0
- package/components/Drawer/DrawerItem.tsx +206 -0
- package/components/Drawer/DrawerItemGroup.tsx +82 -0
- package/components/Drawer/index.tsx +47 -0
- package/components/Drawer/types.ts +3 -0
- package/components/Drawer/utils.ts +8 -0
- package/components/ElementGroup/ElementGroup.tsx +139 -0
- package/components/ElementGroup/index.tsx +11 -0
- package/components/ElementGroup/utils.ts +25 -0
- package/components/FAB/FAB.tsx +176 -0
- package/components/FAB/index.tsx +12 -0
- package/components/FAB/types.ts +1 -0
- package/components/FAB/utils.ts +221 -0
- package/components/FilePicker/FilePicker.tsx +133 -0
- package/components/FilePicker/index.tsx +11 -0
- package/components/FilePicker/utils.ts +13 -0
- package/components/HelperText/HelperText.tsx +139 -0
- package/components/HelperText/index.tsx +11 -0
- package/components/HelperText/utils.ts +29 -0
- package/components/HorizontalDivider/HorizontalDivider.tsx +101 -0
- package/components/HorizontalDivider/index.tsx +13 -0
- package/components/Icon/CrossFadeIcon.tsx +116 -0
- package/components/Icon/Icon.tsx +41 -0
- package/components/Icon/iconFactory.tsx +23 -0
- package/components/Icon/index.tsx +11 -0
- package/components/Icon/types.ts +35 -0
- package/components/IconButton/IconButton.tsx +218 -0
- package/components/IconButton/index.tsx +11 -0
- package/components/IconButton/types.ts +1 -0
- package/components/IconButton/utils.ts +325 -0
- package/components/If/index.tsx +13 -0
- package/components/InputAddon/InputAddon.tsx +27 -0
- package/components/InputAddon/index.tsx +11 -0
- package/components/InputAddon/utils.ts +33 -0
- package/components/Link/Link.tsx +48 -0
- package/components/Link/index.tsx +11 -0
- package/components/Link/utils.ts +37 -0
- package/components/ListItem/ListItem.tsx +136 -0
- package/components/ListItem/ListItemDescription.tsx +25 -0
- package/components/ListItem/ListItemTitle.tsx +25 -0
- package/components/ListItem/index.tsx +18 -0
- package/components/ListItem/utils.ts +113 -0
- package/components/Menu/Menu.tsx +69 -0
- package/components/Menu/MenuDivider.tsx +13 -0
- package/components/Menu/MenuItem.tsx +128 -0
- package/components/Menu/index.tsx +19 -0
- package/components/Menu/utils.ts +92 -0
- package/components/Modal/Modal.tsx +261 -0
- package/components/Modal/index.tsx +11 -0
- package/components/Modal/utils.ts +45 -0
- package/components/NavigationRail/NavigationRail.tsx +32 -0
- package/components/NavigationRail/NavigationRailContent.tsx +25 -0
- package/components/NavigationRail/NavigationRailFooter.tsx +18 -0
- package/components/NavigationRail/NavigationRailHeader.tsx +18 -0
- package/components/NavigationRail/NavigationRailItem.tsx +226 -0
- package/components/NavigationRail/index.tsx +35 -0
- package/components/NavigationRail/utils.ts +170 -0
- package/components/NavigationStack/NavigationStack.tsx +85 -0
- package/components/NavigationStack/NavigationStackItem.tsx +60 -0
- package/components/NavigationStack/index.tsx +20 -0
- package/components/NavigationStack/utils.tsx +16 -0
- package/components/Popover/Popover.native.tsx +185 -0
- package/components/Popover/Popover.tsx +198 -0
- package/components/Popover/common.ts +459 -0
- package/components/Popover/index.ts +2 -0
- package/components/Portal/Portal.tsx +13 -0
- package/components/Portal/index.tsx +12 -0
- package/components/RadioButton/RadioButton.tsx +138 -0
- package/components/RadioButton/RadioButtonAndroid.tsx +188 -0
- package/components/RadioButton/RadioButtonGroup.tsx +98 -0
- package/components/RadioButton/RadioButtonIOS.tsx +106 -0
- package/components/RadioButton/RadioButtonItem.tsx +232 -0
- package/components/RadioButton/index.ts +27 -0
- package/components/RadioButton/utils.ts +164 -0
- package/components/Rating/Rating.tsx +149 -0
- package/components/Rating/RatingItem.tsx +125 -0
- package/components/Rating/index.tsx +13 -0
- package/components/Rating/utils.ts +38 -0
- package/components/Select/Select.tsx +1038 -0
- package/components/Select/index.ts +14 -0
- package/components/Select/types.ts +115 -0
- package/components/StateLayer/StateLayer.tsx +12 -0
- package/components/StateLayer/index.tsx +11 -0
- package/components/StateLayer/utils.ts +17 -0
- package/components/Surface/BackgroundContextWrapper.tsx +27 -0
- package/components/Surface/Surface.android.tsx +62 -0
- package/components/Surface/Surface.ios.tsx +123 -0
- package/components/Surface/Surface.tsx +48 -0
- package/components/Surface/index.tsx +12 -0
- package/components/Surface/utils.ts +106 -0
- package/components/Switch/Switch.ios.tsx +67 -0
- package/components/Switch/Switch.tsx +278 -0
- package/components/Switch/index.tsx +11 -0
- package/components/Switch/utils.ts +283 -0
- package/components/Tabs/TabItem.tsx +150 -0
- package/components/Tabs/TabLabel.tsx +84 -0
- package/components/Tabs/Tabs.tsx +398 -0
- package/components/Tabs/index.tsx +21 -0
- package/components/Tabs/utils.ts +126 -0
- package/components/Text/Text.tsx +23 -0
- package/components/Text/index.tsx +2 -0
- package/components/Text/textFactory.tsx +33 -0
- package/components/TextInput/InputLabel.tsx +181 -0
- package/components/TextInput/TextInput.tsx +693 -0
- package/components/TextInput/index.tsx +16 -0
- package/components/TextInput/types.ts +96 -0
- package/components/TextInput/utils.ts +544 -0
- package/components/TextInputWithMask/TextInputMask.tsx +57 -0
- package/components/TextInputWithMask/index.tsx +11 -0
- package/components/TextInputWithMask/utils.ts +56 -0
- package/components/TimePicker/AmPmSwitcher.tsx +99 -0
- package/components/TimePicker/AnalogClock.tsx +165 -0
- package/components/TimePicker/AnalogClockHours.tsx +163 -0
- package/components/TimePicker/AnalogClockMinutes.tsx +68 -0
- package/components/TimePicker/AnimatedClockSwitcher.tsx +72 -0
- package/components/TimePicker/DisplayModeContext.tsx +6 -0
- package/components/TimePicker/TimeInput.tsx +112 -0
- package/components/TimePicker/TimeInputs.tsx +148 -0
- package/components/TimePicker/TimePicker.tsx +130 -0
- package/components/TimePicker/index.tsx +19 -0
- package/components/TimePicker/timeUtils.ts +159 -0
- package/components/TimePicker/utils.ts +285 -0
- package/components/TimePickerField/TimePickerField.tsx +152 -0
- package/components/TimePickerField/index.tsx +14 -0
- package/components/TimePickerField/sanitizeTime.ts +85 -0
- package/components/TimePickerField/utils.ts +95 -0
- package/components/TimePickerModal/TimePickerModal.tsx +115 -0
- package/components/TimePickerModal/index.tsx +14 -0
- package/components/TimePickerModal/utils.ts +48 -0
- package/components/Tooltip/Tooltip.tsx +137 -0
- package/components/Tooltip/TooltipContent.tsx +12 -0
- package/components/Tooltip/TooltipTrigger.tsx +94 -0
- package/components/Tooltip/index.tsx +20 -0
- package/components/Tooltip/utils.ts +21 -0
- package/components/TouchableRipple/TouchableRipple.native.tsx +105 -0
- package/components/TouchableRipple/TouchableRipple.tsx +286 -0
- package/components/TouchableRipple/index.tsx +14 -0
- package/components/TouchableRipple/utils.ts +15 -0
- package/components/VerticalDivider/VerticalDivider.tsx +99 -0
- package/components/VerticalDivider/index.tsx +13 -0
- package/context-bridge/index.tsx +87 -0
- package/core/componentsRegistry.ts +164 -0
- package/core/index.tsx +2 -0
- package/fast-context/index.tsx +190 -0
- package/hocs/index.tsx +5 -0
- package/hocs/typedMemo.tsx +5 -0
- package/hocs/withKeyboardAccessibility.tsx +231 -0
- package/hocs/withPortal.tsx +16 -0
- package/hooks/createPsuedoHook.tsx +50 -0
- package/hooks/index.tsx +29 -0
- package/hooks/useActionState.native.tsx +22 -0
- package/hooks/useActionState.tsx +34 -0
- package/hooks/useActive.tsx +5 -0
- package/hooks/useBreakpoints.tsx +7 -0
- package/hooks/useColorMode.tsx +17 -0
- package/hooks/useContrastColor.ts +15 -0
- package/hooks/useControlledValue.tsx +68 -0
- package/hooks/useFilePicker.tsx +48 -0
- package/hooks/useFocus.tsx +5 -0
- package/hooks/useHandleNumberFormat.tsx +106 -0
- package/hooks/useHover.tsx +5 -0
- package/hooks/useKeyboardDismissable.ts +66 -0
- package/hooks/useLatest.tsx +9 -0
- package/hooks/useMediaQuery.tsx +64 -0
- package/hooks/useMergedRefs.ts +14 -0
- package/hooks/usePrevious.ts +13 -0
- package/hooks/useQueryFilter.tsx +35 -0
- package/hooks/useSearchable.tsx +74 -0
- package/hooks/useSubcomponents.tsx +59 -0
- package/hooks/useTheme.ts +3 -0
- package/hooks/useToggle.tsx +24 -0
- package/package.json +114 -0
- package/shortcuts-manager/EventsManager.tsx +121 -0
- package/shortcuts-manager/ShortcutsManager/ShortcutsManager.native.tsx +9 -0
- package/shortcuts-manager/ShortcutsManager/ShortcutsManager.tsx +58 -0
- package/shortcuts-manager/ShortcutsManager/index.tsx +2 -0
- package/shortcuts-manager/ShortcutsManager/utils.tsx +30 -0
- package/shortcuts-manager/index.tsx +6 -0
- package/shortcuts-manager/types.ts +24 -0
- package/shortcuts-manager/useIsKeyPressed/index.tsx +1 -0
- package/shortcuts-manager/useIsKeyPressed/useIsKeyPress.tsx +9 -0
- package/shortcuts-manager/useSetScopes/index.tsx +1 -0
- package/shortcuts-manager/useSetScopes/useSetScopes.native.tsx +9 -0
- package/shortcuts-manager/useSetScopes/useSetScopes.tsx +25 -0
- package/shortcuts-manager/useShortcut/index.tsx +2 -0
- package/shortcuts-manager/useShortcut/types.ts +3 -0
- package/shortcuts-manager/useShortcut/useShortcut.native.tsx +9 -0
- package/shortcuts-manager/useShortcut/useShortcut.tsx +61 -0
- package/shortcuts-manager/utils.ts +105 -0
- package/styles/index.ts +4 -0
- package/styles/overlay.ts +69 -0
- package/styles/shadow.ts +21 -0
- package/styles/themes/DarkTheme.tsx +98 -0
- package/styles/themes/LightTheme.tsx +212 -0
- package/styles/themes/tokens.ts +248 -0
- package/styles/utils.ts +11 -0
- package/types/index.ts +129 -0
- package/types/theme.ts +159 -0
- package/utils/DocumentPicker/documentPicker.native.ts +10 -0
- package/utils/DocumentPicker/documentPicker.ts +76 -0
- package/utils/DocumentPicker/index.ts +2 -0
- package/utils/DocumentPicker/types.ts +28 -0
- package/utils/addEventListener.tsx +51 -0
- package/utils/backgroundContext.ts +9 -0
- package/utils/color.ts +22 -0
- package/utils/compare/index.ts +54 -0
- package/utils/composeEventHandlers.ts +9 -0
- package/utils/createNumberMask/createNumberMask.ts +98 -0
- package/utils/createNumberMask/index.ts +5 -0
- package/utils/createSyntheticEvent.ts +31 -0
- package/utils/date-fns.ts +7 -0
- package/utils/dateTimePicker.ts +5 -0
- package/utils/escapeRegex.ts +9 -0
- package/utils/extractTextStyles.ts +52 -0
- package/utils/formatNumberWithMask/formatNumberWithMask.ts +26 -0
- package/utils/formatNumberWithMask/formatWithMask.ts +119 -0
- package/utils/formatNumberWithMask/index.ts +6 -0
- package/utils/getCursorStyle/getCursorStyle.native.ts +1 -0
- package/utils/getCursorStyle/getCursorStyle.ts +1 -0
- package/utils/getCursorStyle/index.ts +1 -0
- package/utils/getOS/getOS.native.ts +7 -0
- package/utils/getOS/getOS.ts +24 -0
- package/utils/getOS/index.ts +1 -0
- package/utils/getyearRange.ts +5 -0
- package/utils/index.ts +20 -0
- package/utils/lodash.ts +50 -0
- package/utils/mergeRefs.ts +13 -0
- package/utils/normalizeBorderRadiuses.ts +24 -0
- package/utils/normalizeSpacings.ts +110 -0
- package/utils/normalizeToNumberString/index.ts +4 -0
- package/utils/normalizeToNumberString/normalizeToNumberString.ts +48 -0
- package/utils/repository.ts +103 -0
- package/utils/resolveColorMode.ts +9 -0
- package/utils/resolveStateVariant.ts +26 -0
- package/utils/tokenStylesParser.ts +7 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { Children, cloneElement, forwardRef, memo, type ReactElement, useMemo } from 'react';
|
|
2
|
+
import { View, type ViewProps, type ViewStyle } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { isNil } from '../../utils/lodash';
|
|
5
|
+
import { elementGroupStyles } from './utils';
|
|
6
|
+
|
|
7
|
+
export enum Orientation {
|
|
8
|
+
Horizontal = 'horizontal',
|
|
9
|
+
Vertical = 'vertical',
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type Props = Omit<ViewProps, 'style'> & {
|
|
13
|
+
orientation?: `${Orientation}`;
|
|
14
|
+
borderRadius?: number | string;
|
|
15
|
+
style?: ViewStyle;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const ElementGroup = (
|
|
19
|
+
{
|
|
20
|
+
orientation: orientationProp = Orientation.Horizontal,
|
|
21
|
+
children,
|
|
22
|
+
style,
|
|
23
|
+
borderRadius: borderRadiusProp,
|
|
24
|
+
...props
|
|
25
|
+
}: Props,
|
|
26
|
+
ref: any,
|
|
27
|
+
) => {
|
|
28
|
+
const orientation = orientationProp === Orientation.Vertical ? 'vertial' : 'horizontal';
|
|
29
|
+
elementGroupStyles.useVariants({
|
|
30
|
+
orientation: orientation as any,
|
|
31
|
+
});
|
|
32
|
+
// const componentStyles = useComponentStyles(
|
|
33
|
+
// 'ElementGroup',
|
|
34
|
+
// [style, !isNil(borderRadiusProp) ? { borderRadius: borderRadiusProp } : {}],
|
|
35
|
+
// {
|
|
36
|
+
// orientation: orientation === Orientation.Vertical ? 'vertial' : 'horizontal',
|
|
37
|
+
// },
|
|
38
|
+
// );
|
|
39
|
+
|
|
40
|
+
const { containerStyle, borderRadius, borderRadiuses } = useMemo(() => {
|
|
41
|
+
const {
|
|
42
|
+
borderRadius: _borderRadius,
|
|
43
|
+
borderTopLeftRadius,
|
|
44
|
+
borderTopRightRadius,
|
|
45
|
+
borderBottomLeftRadius,
|
|
46
|
+
borderBottomRightRadius,
|
|
47
|
+
...restStyle
|
|
48
|
+
} = elementGroupStyles.root as any;
|
|
49
|
+
const {
|
|
50
|
+
borderTopLeftRadius: _borderTopLeftRadius,
|
|
51
|
+
borderTopRightRadius: _borderTopRightRadius,
|
|
52
|
+
borderBottomLeftRadius: _borderBottomLeftRadius,
|
|
53
|
+
borderBottomRightRadius: _borderBottomRightRadius,
|
|
54
|
+
..._restStyle
|
|
55
|
+
} = style ?? {};
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
containerStyle: [restStyle, _restStyle],
|
|
59
|
+
borderRadius: borderRadiusProp || _borderRadius,
|
|
60
|
+
borderRadiuses: {
|
|
61
|
+
borderTopLeftRadius: borderTopLeftRadius || _borderTopLeftRadius,
|
|
62
|
+
borderTopRightRadius: borderTopRightRadius || _borderTopRightRadius,
|
|
63
|
+
borderBottomLeftRadius: borderBottomLeftRadius || _borderBottomLeftRadius,
|
|
64
|
+
borderBottomRightRadius: borderBottomRightRadius || _borderBottomRightRadius,
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
68
|
+
}, [style, borderRadiusProp, orientation]);
|
|
69
|
+
|
|
70
|
+
const modifiedChildren = useMemo(() => {
|
|
71
|
+
if (!children) return null;
|
|
72
|
+
|
|
73
|
+
if (!Array.isArray(children) || children.length <= 1) return children;
|
|
74
|
+
|
|
75
|
+
// if we have enough elements for left, right
|
|
76
|
+
return Children.map(children, (child: ReactElement, index) => {
|
|
77
|
+
const [firstBorderProp, lastBorderProp] = {
|
|
78
|
+
[Orientation.Horizontal]: ['borderTopRightRadius', 'borderBottomLeftRadius'],
|
|
79
|
+
[Orientation.Vertical]: ['borderBottomLeftRadius', 'borderTopRightRadius'],
|
|
80
|
+
}[orientation as Orientation];
|
|
81
|
+
|
|
82
|
+
const isFirstChild = index === 0;
|
|
83
|
+
const isLastChild = index === children.length - 1;
|
|
84
|
+
|
|
85
|
+
const prop = isFirstChild ? 'first' : isLastChild ? 'last' : 'middle';
|
|
86
|
+
|
|
87
|
+
type KeyOfBorderRadiuses = keyof typeof borderRadiuses;
|
|
88
|
+
|
|
89
|
+
const mapBorderRadiusFromProp = {
|
|
90
|
+
[firstBorderProp]: !isNil(borderRadiuses[firstBorderProp as KeyOfBorderRadiuses])
|
|
91
|
+
? borderRadiuses[firstBorderProp as KeyOfBorderRadiuses]
|
|
92
|
+
: borderRadius,
|
|
93
|
+
[lastBorderProp]: !isNil(borderRadiuses[lastBorderProp as KeyOfBorderRadiuses])
|
|
94
|
+
? borderRadiuses[lastBorderProp as KeyOfBorderRadiuses]
|
|
95
|
+
: borderRadius,
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const borderRadiusStyles = {
|
|
99
|
+
first: {
|
|
100
|
+
[firstBorderProp]: 0,
|
|
101
|
+
borderBottomRightRadius: 0,
|
|
102
|
+
|
|
103
|
+
borderTopLeftRadius: !isNil(borderRadiuses.borderTopLeftRadius)
|
|
104
|
+
? borderRadiuses.borderTopLeftRadius
|
|
105
|
+
: borderRadius,
|
|
106
|
+
[lastBorderProp]: mapBorderRadiusFromProp[lastBorderProp],
|
|
107
|
+
},
|
|
108
|
+
middle: {
|
|
109
|
+
borderTopLeftRadius: 0,
|
|
110
|
+
borderBottomRightRadius: 0,
|
|
111
|
+
borderTopRightRadius: 0,
|
|
112
|
+
borderBottomLeftRadius: 0,
|
|
113
|
+
},
|
|
114
|
+
last: {
|
|
115
|
+
borderTopLeftRadius: 0,
|
|
116
|
+
[lastBorderProp]: 0,
|
|
117
|
+
|
|
118
|
+
borderBottomRightRadius: !isNil(borderRadiuses.borderBottomRightRadius)
|
|
119
|
+
? borderRadiuses.borderBottomRightRadius
|
|
120
|
+
: borderRadius,
|
|
121
|
+
[firstBorderProp]: mapBorderRadiusFromProp[firstBorderProp],
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
return cloneElement(child, {
|
|
126
|
+
...(child.props as any),
|
|
127
|
+
style: [(child.props as any).style, borderRadiusStyles[prop]].flat(),
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
}, [borderRadius, borderRadiuses, children, orientation]);
|
|
131
|
+
|
|
132
|
+
return (
|
|
133
|
+
<View {...props} style={containerStyle} ref={ref}>
|
|
134
|
+
{modifiedChildren}
|
|
135
|
+
</View>
|
|
136
|
+
);
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
export default memo(forwardRef(ElementGroup));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { getRegisteredComponentWithFallback, registerMoleculesComponents } from '../../core';
|
|
2
|
+
import ElementGroupDefault from './ElementGroup';
|
|
3
|
+
|
|
4
|
+
registerMoleculesComponents({
|
|
5
|
+
ElementGroup: ElementGroupDefault,
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export const ElementGroup = getRegisteredComponentWithFallback('ElementGroup', ElementGroupDefault);
|
|
9
|
+
|
|
10
|
+
export type { Props as ElementGroupProps } from './ElementGroup';
|
|
11
|
+
export { elementGroupStyles } from './utils';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
2
|
+
|
|
3
|
+
import { getRegisteredMoleculesComponentStyles, registerComponentsStyles } from '../../core';
|
|
4
|
+
|
|
5
|
+
const elementGroupStylesDefault = StyleSheet.create(theme => ({
|
|
6
|
+
root: {
|
|
7
|
+
borderRadius: theme.shapes.corner.extraSmall,
|
|
8
|
+
variants: {
|
|
9
|
+
orientation: {
|
|
10
|
+
horizontal: {
|
|
11
|
+
flexDirection: 'row',
|
|
12
|
+
},
|
|
13
|
+
vertical: {
|
|
14
|
+
flexDirection: 'column',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
}));
|
|
20
|
+
|
|
21
|
+
registerComponentsStyles({
|
|
22
|
+
ElementGroup: elementGroupStylesDefault,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export const elementGroupStyles = getRegisteredMoleculesComponentStyles('ElementGroup');
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { forwardRef, memo, useMemo } from 'react';
|
|
2
|
+
import type { TextProps, ViewProps, ViewStyle } from 'react-native';
|
|
3
|
+
import { Text } from 'react-native';
|
|
4
|
+
|
|
5
|
+
import { useActionState } from '../../hooks';
|
|
6
|
+
import type { MD3Elevation } from '../../types/theme';
|
|
7
|
+
import { resolveStateVariant } from '../../utils';
|
|
8
|
+
import { Icon, type IconProps, type IconType } from '../Icon';
|
|
9
|
+
import { StateLayer } from '../StateLayer';
|
|
10
|
+
import { Surface, type SurfaceProps } from '../Surface';
|
|
11
|
+
import { TouchableRipple, type TouchableRippleProps } from '../TouchableRipple';
|
|
12
|
+
import type { FABVariant } from './types';
|
|
13
|
+
import { fabStyles, iconSizeMap } from './utils';
|
|
14
|
+
|
|
15
|
+
export type Props = Omit<TouchableRippleProps, 'children'> & {
|
|
16
|
+
/**
|
|
17
|
+
* name of the icon
|
|
18
|
+
* */
|
|
19
|
+
iconName: string;
|
|
20
|
+
/**
|
|
21
|
+
* type of the icon
|
|
22
|
+
* */
|
|
23
|
+
iconType?: IconType;
|
|
24
|
+
/**
|
|
25
|
+
* icon component's props
|
|
26
|
+
* */
|
|
27
|
+
iconProps?: Omit<IconProps, 'name' | 'type' | 'ref'>;
|
|
28
|
+
/**
|
|
29
|
+
* Label of the FAB, if provided the FAB will be on extended mode
|
|
30
|
+
* */
|
|
31
|
+
label?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Props of the label
|
|
34
|
+
* */
|
|
35
|
+
labelProps?: Omit<Partial<TextProps>, 'children'>;
|
|
36
|
+
/**
|
|
37
|
+
* Props for the surface container
|
|
38
|
+
* */
|
|
39
|
+
containerProps?: Omit<SurfaceProps, 'style' | 'ref'>;
|
|
40
|
+
/**
|
|
41
|
+
* Props for the innner touchable container
|
|
42
|
+
* */
|
|
43
|
+
innerContainerStyle?: ViewStyle;
|
|
44
|
+
/**
|
|
45
|
+
* sizes of the FAB
|
|
46
|
+
* @default 'md'
|
|
47
|
+
* */
|
|
48
|
+
size?: 'sm' | 'md' | 'lg';
|
|
49
|
+
/**
|
|
50
|
+
* variants of the FAB
|
|
51
|
+
* */
|
|
52
|
+
variant?: FABVariant;
|
|
53
|
+
/**
|
|
54
|
+
* Elevation level
|
|
55
|
+
* @default 2
|
|
56
|
+
* */
|
|
57
|
+
elevation?: MD3Elevation;
|
|
58
|
+
/**
|
|
59
|
+
* Props for the state layer
|
|
60
|
+
* */
|
|
61
|
+
stateLayerProps?: ViewProps;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const emptyObj = {};
|
|
65
|
+
|
|
66
|
+
const FAB = (
|
|
67
|
+
{
|
|
68
|
+
iconName,
|
|
69
|
+
iconType,
|
|
70
|
+
iconProps = emptyObj,
|
|
71
|
+
label,
|
|
72
|
+
variant = 'primary',
|
|
73
|
+
size = 'md',
|
|
74
|
+
elevation: elevationProp,
|
|
75
|
+
containerProps,
|
|
76
|
+
innerContainerStyle: innerContainerStyleProp = emptyObj,
|
|
77
|
+
labelProps = emptyObj,
|
|
78
|
+
stateLayerProps = emptyObj,
|
|
79
|
+
disabled = false,
|
|
80
|
+
onPress,
|
|
81
|
+
style,
|
|
82
|
+
testID,
|
|
83
|
+
...rest
|
|
84
|
+
}: Props,
|
|
85
|
+
ref: any,
|
|
86
|
+
) => {
|
|
87
|
+
const { hovered, actionsRef } = useActionState({ ref, actionsToListen: ['hover'] });
|
|
88
|
+
|
|
89
|
+
const elevation = useMemo(
|
|
90
|
+
() => (elevationProp === undefined ? 3 : elevationProp),
|
|
91
|
+
[elevationProp],
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
const state = resolveStateVariant({
|
|
95
|
+
disabled,
|
|
96
|
+
hovered,
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
fabStyles.useVariants({
|
|
100
|
+
variant,
|
|
101
|
+
size,
|
|
102
|
+
state: state as any,
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
const {
|
|
106
|
+
containerStyle,
|
|
107
|
+
innerContainerStyle,
|
|
108
|
+
iconStyle,
|
|
109
|
+
labelStyle,
|
|
110
|
+
iconSize,
|
|
111
|
+
stateLayerStyle,
|
|
112
|
+
} = useMemo(() => {
|
|
113
|
+
return {
|
|
114
|
+
containerStyle: [fabStyles.root, style],
|
|
115
|
+
innerContainerStyle: [fabStyles.innerContainer, innerContainerStyleProp],
|
|
116
|
+
iconStyle: [fabStyles.icon, iconProps?.style],
|
|
117
|
+
// @ts-ignore
|
|
118
|
+
labelStyle: [fabStyles.label, labelProps?.style],
|
|
119
|
+
iconSize: iconSizeMap[size],
|
|
120
|
+
stateLayerStyle: [fabStyles.stateLayer, stateLayerProps?.style],
|
|
121
|
+
};
|
|
122
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
123
|
+
}, [
|
|
124
|
+
iconProps?.style,
|
|
125
|
+
innerContainerStyleProp,
|
|
126
|
+
labelProps?.style,
|
|
127
|
+
stateLayerProps?.style,
|
|
128
|
+
style,
|
|
129
|
+
state,
|
|
130
|
+
variant,
|
|
131
|
+
size,
|
|
132
|
+
]);
|
|
133
|
+
// TODO: abstract the stateLayer
|
|
134
|
+
return (
|
|
135
|
+
<Surface
|
|
136
|
+
testID={testID ? `${testID}-container` : ''}
|
|
137
|
+
{...containerProps}
|
|
138
|
+
elevation={(disabled ? 0 : hovered ? elevation + 1 : elevation) as MD3Elevation}
|
|
139
|
+
style={containerStyle}>
|
|
140
|
+
<TouchableRipple
|
|
141
|
+
testID={testID}
|
|
142
|
+
{...rest}
|
|
143
|
+
disabled={disabled}
|
|
144
|
+
onPress={onPress}
|
|
145
|
+
style={innerContainerStyle}
|
|
146
|
+
ref={actionsRef}>
|
|
147
|
+
<>
|
|
148
|
+
<Icon
|
|
149
|
+
name={iconName}
|
|
150
|
+
type={iconType}
|
|
151
|
+
testID={testID ? `${testID}-icon` : ''}
|
|
152
|
+
{...iconProps}
|
|
153
|
+
size={iconSize}
|
|
154
|
+
style={iconStyle}
|
|
155
|
+
/>
|
|
156
|
+
{label && (
|
|
157
|
+
<Text
|
|
158
|
+
selectable={false}
|
|
159
|
+
testID={testID ? `${testID}-label` : ''}
|
|
160
|
+
{...labelProps}
|
|
161
|
+
style={labelStyle}>
|
|
162
|
+
{label}
|
|
163
|
+
</Text>
|
|
164
|
+
)}
|
|
165
|
+
<StateLayer
|
|
166
|
+
testID={testID ? `${testID}-stateLayer` : ''}
|
|
167
|
+
{...stateLayerProps}
|
|
168
|
+
style={stateLayerStyle}
|
|
169
|
+
/>
|
|
170
|
+
</>
|
|
171
|
+
</TouchableRipple>
|
|
172
|
+
</Surface>
|
|
173
|
+
);
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
export default memo(forwardRef(FAB));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { getRegisteredComponentWithFallback, registerMoleculesComponents } from '../../core';
|
|
2
|
+
import FABDefault from './FAB';
|
|
3
|
+
|
|
4
|
+
registerMoleculesComponents({
|
|
5
|
+
FAB: FABDefault,
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export const FAB = getRegisteredComponentWithFallback('FAB', FABDefault);
|
|
9
|
+
|
|
10
|
+
export type { Props as FABProps } from './FAB';
|
|
11
|
+
export type { States } from './utils';
|
|
12
|
+
export { fabStyles } from './utils';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type FABVariant = 'primary' | 'secondary' | 'tertiary' | 'surface';
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
2
|
+
|
|
3
|
+
import { getRegisteredMoleculesComponentStyles, registerComponentsStyles } from '../../core';
|
|
4
|
+
|
|
5
|
+
export const iconSizeMap = {
|
|
6
|
+
xs: 18,
|
|
7
|
+
sm: 24,
|
|
8
|
+
md: 28,
|
|
9
|
+
lg: 36,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const fabStylesDefault = StyleSheet.create(theme => ({
|
|
13
|
+
root: {
|
|
14
|
+
...{ iconSize: 24 },
|
|
15
|
+
|
|
16
|
+
variants: {
|
|
17
|
+
state: {
|
|
18
|
+
disabled: {
|
|
19
|
+
backgroundColor: theme.colors.surfaceDisabled,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
variant: {
|
|
24
|
+
primary: {
|
|
25
|
+
backgroundColor: theme.colors.primaryContainer,
|
|
26
|
+
},
|
|
27
|
+
secondary: {
|
|
28
|
+
backgroundColor: theme.colors.secondaryContainer,
|
|
29
|
+
},
|
|
30
|
+
tertiary: {
|
|
31
|
+
backgroundColor: theme.colors.tertiaryContainer,
|
|
32
|
+
},
|
|
33
|
+
surface: {
|
|
34
|
+
backgroundColor: theme.colors.surface,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
size: {
|
|
39
|
+
xs: {
|
|
40
|
+
minHeight: 32,
|
|
41
|
+
minWidth: 32,
|
|
42
|
+
borderRadius: theme.shapes.corner.small,
|
|
43
|
+
},
|
|
44
|
+
sm: {
|
|
45
|
+
minHeight: 40,
|
|
46
|
+
minWidth: 40,
|
|
47
|
+
borderRadius: theme.shapes.corner.medium,
|
|
48
|
+
},
|
|
49
|
+
md: {
|
|
50
|
+
minHeight: 56,
|
|
51
|
+
minWidth: 56,
|
|
52
|
+
borderRadius: theme.shapes.corner.large,
|
|
53
|
+
},
|
|
54
|
+
lg: {
|
|
55
|
+
minHeight: 96,
|
|
56
|
+
minWidth: 96,
|
|
57
|
+
borderRadius: theme.shapes.corner.extraLarge,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
innerContainer: {
|
|
64
|
+
flexGrow: 1,
|
|
65
|
+
flexDirection: 'row',
|
|
66
|
+
alignItems: 'center',
|
|
67
|
+
justifyContent: 'center',
|
|
68
|
+
|
|
69
|
+
variants: {
|
|
70
|
+
size: {
|
|
71
|
+
xs: {
|
|
72
|
+
borderRadius: theme.shapes.corner.small,
|
|
73
|
+
},
|
|
74
|
+
sm: {
|
|
75
|
+
padding: theme.spacings['3'],
|
|
76
|
+
borderRadius: theme.shapes.corner.medium,
|
|
77
|
+
},
|
|
78
|
+
md: {
|
|
79
|
+
padding: theme.spacings['4'],
|
|
80
|
+
borderRadius: theme.shapes.corner.large,
|
|
81
|
+
},
|
|
82
|
+
lg: {
|
|
83
|
+
padding: theme.spacings['7'],
|
|
84
|
+
borderRadius: theme.shapes.corner.extraLarge,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
stateLayer: {
|
|
91
|
+
variants: {
|
|
92
|
+
state: {
|
|
93
|
+
disabled: {
|
|
94
|
+
backgroundColor: theme.colors.stateLayer.disabled.onSurface,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
size: {
|
|
99
|
+
xs: {
|
|
100
|
+
borderRadius: theme.shapes.corner.small,
|
|
101
|
+
},
|
|
102
|
+
sm: {
|
|
103
|
+
borderRadius: theme.shapes.corner.medium,
|
|
104
|
+
},
|
|
105
|
+
md: {
|
|
106
|
+
borderRadius: theme.shapes.corner.large,
|
|
107
|
+
},
|
|
108
|
+
lg: {
|
|
109
|
+
borderRadius: theme.shapes.corner.extraLarge,
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
compoundVariants: [
|
|
114
|
+
{
|
|
115
|
+
variant: 'primary',
|
|
116
|
+
state: 'hovered',
|
|
117
|
+
styles: {
|
|
118
|
+
backgroundColor: theme.colors.stateLayer.hover.onPrimaryContainer,
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
variant: 'secondary',
|
|
123
|
+
state: 'hovered',
|
|
124
|
+
styles: {
|
|
125
|
+
backgroundColor: theme.colors.stateLayer.hover.onSecondaryContainer,
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
variant: 'tertiary',
|
|
130
|
+
state: 'hovered',
|
|
131
|
+
styles: {
|
|
132
|
+
backgroundColor: theme.colors.stateLayer.hover.onTertiaryContainer,
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
variant: 'surface',
|
|
137
|
+
state: 'hovered',
|
|
138
|
+
styles: {
|
|
139
|
+
backgroundColor: theme.colors.stateLayer.hover.primary,
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
],
|
|
143
|
+
},
|
|
144
|
+
|
|
145
|
+
icon: {
|
|
146
|
+
variants: {
|
|
147
|
+
state: {
|
|
148
|
+
disabled: {
|
|
149
|
+
color: theme.colors.onSurfaceDisabled,
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
|
|
153
|
+
variant: {
|
|
154
|
+
primary: {
|
|
155
|
+
color: theme.colors.onPrimaryContainer,
|
|
156
|
+
},
|
|
157
|
+
secondary: {
|
|
158
|
+
color: theme.colors.onSecondaryContainer,
|
|
159
|
+
},
|
|
160
|
+
tertiary: {
|
|
161
|
+
color: theme.colors.onTertiaryContainer,
|
|
162
|
+
},
|
|
163
|
+
surface: {
|
|
164
|
+
color: theme.colors.primary,
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
|
|
170
|
+
label: {
|
|
171
|
+
fontSize: theme.typescale.labelSmall.fontSize,
|
|
172
|
+
lineHeight: theme.typescale.labelSmall.lineHeight,
|
|
173
|
+
fontWeight: theme.typescale.labelMedium.labelSmall,
|
|
174
|
+
marginLeft: theme.spacings['1'],
|
|
175
|
+
variants: {
|
|
176
|
+
state: {
|
|
177
|
+
disabled: {
|
|
178
|
+
color: theme.colors.onSurfaceDisabled,
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
|
|
182
|
+
variant: {
|
|
183
|
+
primary: {
|
|
184
|
+
color: theme.colors.onPrimaryContainer,
|
|
185
|
+
},
|
|
186
|
+
secondary: {
|
|
187
|
+
color: theme.colors.onPrimaryContainer,
|
|
188
|
+
},
|
|
189
|
+
tertiary: {
|
|
190
|
+
color: theme.colors.onPrimaryContainer,
|
|
191
|
+
},
|
|
192
|
+
surface: {
|
|
193
|
+
color: theme.colors.primary,
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
|
|
197
|
+
size: {
|
|
198
|
+
sm: {
|
|
199
|
+
...theme.typescale.labelMedium,
|
|
200
|
+
marginLeft: theme.spacings['1'],
|
|
201
|
+
},
|
|
202
|
+
md: {
|
|
203
|
+
...theme.typescale.labelLarge,
|
|
204
|
+
marginLeft: theme.spacings['2'],
|
|
205
|
+
},
|
|
206
|
+
lg: {
|
|
207
|
+
...theme.typescale.bodyExtraLarge,
|
|
208
|
+
marginLeft: theme.spacings['3'],
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
}));
|
|
214
|
+
|
|
215
|
+
registerComponentsStyles({
|
|
216
|
+
FAB: fabStylesDefault,
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
export const fabStyles = getRegisteredMoleculesComponentStyles('FAB');
|
|
220
|
+
|
|
221
|
+
export type States = 'hovered' | 'disabled';
|