@fountain-ui/core 3.0.0-alpha.10 → 3.0.0-alpha.12
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/build/commonjs/AppBar/AppBar.js +6 -1
- package/build/commonjs/AppBar/AppBar.js.map +1 -1
- package/build/commonjs/Badge/Badge.js +4 -3
- package/build/commonjs/Badge/Badge.js.map +1 -1
- package/build/commonjs/Badge/BadgeProps.js.map +1 -1
- package/build/commonjs/ButtonBase/index.js +2 -2
- package/build/commonjs/ButtonBase/index.js.map +1 -1
- package/build/commonjs/Chip/Chip.js +21 -14
- package/build/commonjs/Chip/Chip.js.map +1 -1
- package/build/commonjs/Chip/ChipProps.js +3 -1
- package/build/commonjs/Chip/ChipProps.js.map +1 -1
- package/build/commonjs/Chip/index.js +6 -0
- package/build/commonjs/Chip/index.js.map +1 -1
- package/build/commonjs/Chip/useChipStyle.js +29 -19
- package/build/commonjs/Chip/useChipStyle.js.map +1 -1
- package/build/commonjs/Dialog/Dialog.js +7 -8
- package/build/commonjs/Dialog/Dialog.js.map +1 -1
- package/build/commonjs/Dialog/DialogProps.js +1 -1
- package/build/commonjs/Dialog/DialogProps.js.map +1 -1
- package/build/commonjs/Dialog/useDialogSectionStyle.js +6 -4
- package/build/commonjs/Dialog/useDialogSectionStyle.js.map +1 -1
- package/build/commonjs/Dialog/useDialogStyle.js +9 -8
- package/build/commonjs/Dialog/useDialogStyle.js.map +1 -1
- package/build/commonjs/DialogTitle/DialogLargeTitle.js +80 -0
- package/build/commonjs/DialogTitle/DialogLargeTitle.js.map +1 -0
- package/build/commonjs/DialogTitle/DialogTitle.js +8 -4
- package/build/commonjs/DialogTitle/DialogTitle.js.map +1 -1
- package/build/commonjs/Divider/Divider.js +17 -9
- package/build/commonjs/Divider/Divider.js.map +1 -1
- package/build/commonjs/Divider/DividerProps.js +1 -1
- package/build/commonjs/Divider/DividerProps.js.map +1 -1
- package/build/commonjs/ListItem/ListItem.js +3 -13
- package/build/commonjs/ListItem/ListItem.js.map +1 -1
- package/build/commonjs/Pagination/Pagination.js +2 -0
- package/build/commonjs/Pagination/Pagination.js.map +1 -1
- package/build/commonjs/Pagination/PaginationProps.js +3 -1
- package/build/commonjs/Pagination/PaginationProps.js.map +1 -1
- package/build/commonjs/Pagination/index.js +6 -0
- package/build/commonjs/Pagination/index.js.map +1 -1
- package/build/commonjs/PaginationItem/PaginationItem.js +32 -22
- package/build/commonjs/PaginationItem/PaginationItem.js.map +1 -1
- package/build/commonjs/PaginationItem/PaginationItemProps.js.map +1 -1
- package/build/commonjs/Tab/Tab.js +11 -3
- package/build/commonjs/Tab/Tab.js.map +1 -1
- package/build/commonjs/Tabs/useTabsStyle.js +7 -4
- package/build/commonjs/Tabs/useTabsStyle.js.map +1 -1
- package/build/commonjs/Toolbar/BackButton/BackButton.js +47 -0
- package/build/commonjs/Toolbar/BackButton/BackButton.js.map +1 -0
- package/build/commonjs/Toolbar/BackButton/BackButtonProps.js +2 -0
- package/build/commonjs/Toolbar/BackButton/BackButtonProps.js.map +1 -0
- package/build/commonjs/Toolbar/BackButton/index.js +16 -0
- package/build/commonjs/Toolbar/BackButton/index.js.map +1 -0
- package/build/commonjs/Toolbar/Toolbar.js +8 -4
- package/build/commonjs/Toolbar/Toolbar.js.map +1 -1
- package/build/commonjs/internal/icons/ChevronLeft.js +4 -2
- package/build/commonjs/internal/icons/ChevronLeft.js.map +1 -1
- package/build/commonjs/internal/icons/ChevronRight.js +4 -2
- package/build/commonjs/internal/icons/ChevronRight.js.map +1 -1
- package/build/commonjs/internal/icons/Close.js +4 -2
- package/build/commonjs/internal/icons/Close.js.map +1 -1
- package/build/module/AppBar/AppBar.js +5 -1
- package/build/module/AppBar/AppBar.js.map +1 -1
- package/build/module/Badge/Badge.js +4 -3
- package/build/module/Badge/Badge.js.map +1 -1
- package/build/module/Badge/BadgeProps.js.map +1 -1
- package/build/module/ButtonBase/index.js +1 -1
- package/build/module/ButtonBase/index.js.map +1 -1
- package/build/module/Chip/Chip.js +17 -13
- package/build/module/Chip/Chip.js.map +1 -1
- package/build/module/Chip/ChipProps.js +1 -0
- package/build/module/Chip/ChipProps.js.map +1 -1
- package/build/module/Chip/index.js +1 -1
- package/build/module/Chip/index.js.map +1 -1
- package/build/module/Chip/useChipStyle.js +29 -19
- package/build/module/Chip/useChipStyle.js.map +1 -1
- package/build/module/Dialog/Dialog.js +7 -8
- package/build/module/Dialog/Dialog.js.map +1 -1
- package/build/module/Dialog/DialogProps.js +1 -1
- package/build/module/Dialog/DialogProps.js.map +1 -1
- package/build/module/Dialog/useDialogSectionStyle.js +6 -4
- package/build/module/Dialog/useDialogSectionStyle.js.map +1 -1
- package/build/module/Dialog/useDialogStyle.js +9 -8
- package/build/module/Dialog/useDialogStyle.js.map +1 -1
- package/build/module/DialogTitle/DialogLargeTitle.js +65 -0
- package/build/module/DialogTitle/DialogLargeTitle.js.map +1 -0
- package/build/module/DialogTitle/DialogTitle.js +6 -3
- package/build/module/DialogTitle/DialogTitle.js.map +1 -1
- package/build/module/Divider/Divider.js +7 -0
- package/build/module/Divider/Divider.js.map +1 -1
- package/build/module/Divider/DividerProps.js +1 -1
- package/build/module/Divider/DividerProps.js.map +1 -1
- package/build/module/ListItem/ListItem.js +3 -13
- package/build/module/ListItem/ListItem.js.map +1 -1
- package/build/module/Pagination/Pagination.js +2 -0
- package/build/module/Pagination/Pagination.js.map +1 -1
- package/build/module/Pagination/PaginationProps.js +1 -0
- package/build/module/Pagination/PaginationProps.js.map +1 -1
- package/build/module/Pagination/index.js +1 -1
- package/build/module/Pagination/index.js.map +1 -1
- package/build/module/PaginationItem/PaginationItem.js +28 -21
- package/build/module/PaginationItem/PaginationItem.js.map +1 -1
- package/build/module/PaginationItem/PaginationItemProps.js.map +1 -1
- package/build/module/Tab/Tab.js +11 -3
- package/build/module/Tab/Tab.js.map +1 -1
- package/build/module/Tabs/useTabsStyle.js +6 -4
- package/build/module/Tabs/useTabsStyle.js.map +1 -1
- package/build/module/Toolbar/BackButton/BackButton.js +32 -0
- package/build/module/Toolbar/BackButton/BackButton.js.map +1 -0
- package/build/module/Toolbar/BackButton/BackButtonProps.js +2 -0
- package/build/module/Toolbar/BackButton/BackButtonProps.js.map +1 -0
- package/build/module/Toolbar/BackButton/index.js +2 -0
- package/build/module/Toolbar/BackButton/index.js.map +1 -0
- package/build/module/Toolbar/Toolbar.js +7 -3
- package/build/module/Toolbar/Toolbar.js.map +1 -1
- package/build/module/internal/icons/ChevronLeft.js +4 -2
- package/build/module/internal/icons/ChevronLeft.js.map +1 -1
- package/build/module/internal/icons/ChevronRight.js +4 -2
- package/build/module/internal/icons/ChevronRight.js.map +1 -1
- package/build/module/internal/icons/Close.js +4 -2
- package/build/module/internal/icons/Close.js.map +1 -1
- package/build/typescript/Badge/BadgeProps.d.ts +10 -5
- package/build/typescript/ButtonBase/index.d.ts +1 -1
- package/build/typescript/Chip/ChipProps.d.ts +11 -4
- package/build/typescript/Chip/index.d.ts +1 -1
- package/build/typescript/Chip/useChipStyle.d.ts +4 -3
- package/build/typescript/Dialog/DialogProps.d.ts +1 -6
- package/build/typescript/Dialog/useDialogStyle.d.ts +1 -1
- package/build/typescript/DialogTitle/DialogLargeTitle.d.ts +9 -0
- package/build/typescript/DialogTitle/DialogTitle.d.ts +6 -1
- package/build/typescript/Divider/DividerProps.d.ts +1 -1
- package/build/typescript/Pagination/PaginationProps.d.ts +12 -0
- package/build/typescript/Pagination/index.d.ts +2 -2
- package/build/typescript/PaginationItem/PaginationItemProps.d.ts +6 -0
- package/build/typescript/Toolbar/BackButton/BackButton.d.ts +3 -0
- package/build/typescript/Toolbar/BackButton/BackButtonProps.d.ts +4 -0
- package/build/typescript/Toolbar/BackButton/index.d.ts +2 -0
- package/build/typescript/Toolbar/Toolbar.d.ts +6 -1
- package/package.json +3 -3
- package/src/AppBar/AppBar.tsx +4 -0
- package/src/Badge/Badge.tsx +4 -3
- package/src/Badge/BadgeProps.ts +12 -6
- package/src/ButtonBase/index.ts +1 -1
- package/src/Chip/Chip.tsx +20 -13
- package/src/Chip/ChipProps.ts +13 -4
- package/src/Chip/index.ts +1 -1
- package/src/Chip/useChipStyle.ts +34 -17
- package/src/Dialog/Dialog.tsx +7 -8
- package/src/Dialog/DialogProps.ts +1 -7
- package/src/Dialog/useDialogSectionStyle.ts +6 -4
- package/src/Dialog/useDialogStyle.ts +9 -7
- package/src/DialogTitle/DialogLargeTitle.tsx +95 -0
- package/src/DialogTitle/DialogTitle.tsx +6 -1
- package/src/Divider/Divider.tsx +5 -0
- package/src/Divider/DividerProps.ts +1 -1
- package/src/ListItem/ListItem.tsx +3 -13
- package/src/Pagination/Pagination.tsx +3 -2
- package/src/Pagination/PaginationProps.ts +15 -0
- package/src/Pagination/index.ts +2 -2
- package/src/PaginationItem/PaginationItem.tsx +31 -24
- package/src/PaginationItem/PaginationItemProps.ts +7 -0
- package/src/Tab/Tab.tsx +20 -6
- package/src/Tabs/useTabsStyle.ts +7 -4
- package/src/Toolbar/BackButton/BackButton.tsx +42 -0
- package/src/Toolbar/BackButton/BackButtonProps.ts +4 -0
- package/src/Toolbar/BackButton/index.ts +2 -0
- package/src/Toolbar/Toolbar.tsx +6 -1
- package/src/internal/icons/ChevronLeft.tsx +4 -1
- package/src/internal/icons/ChevronRight.tsx +4 -1
- package/src/internal/icons/Close.tsx +4 -1
- package/build/commonjs/ButtonBase/LegacyButtonBase.js +0 -126
- package/build/commonjs/ButtonBase/LegacyButtonBase.js.map +0 -1
- package/build/module/ButtonBase/LegacyButtonBase.js +0 -106
- package/build/module/ButtonBase/LegacyButtonBase.js.map +0 -1
- package/build/typescript/ButtonBase/LegacyButtonBase.d.ts +0 -5
- package/src/ButtonBase/LegacyButtonBase.tsx +0 -135
|
@@ -2,6 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import { Path } from 'react-native-svg';
|
|
3
3
|
import { createSvgIcon } from '../../utils';
|
|
4
4
|
export default createSvgIcon( /*#__PURE__*/React.createElement(Path, {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
fillRule: "evenodd",
|
|
6
|
+
clipRule: "evenodd",
|
|
7
|
+
d: "M0.292893 5.29289C0.683417 4.90237 1.31658 4.90237 1.70711 5.29289L7 10.5858L12.2929 5.29289C12.6834 4.90237 13.3166 4.90237 13.7071 5.29289C14.0976 5.68342 14.0976 6.31658 13.7071 6.70711L8.41421 12L13.7071 17.2929C14.0976 17.6834 14.0976 18.3166 13.7071 18.7071C13.3166 19.0976 12.6834 19.0976 12.2929 18.7071L7 13.4142L1.70711 18.7071C1.31658 19.0976 0.683417 19.0976 0.292893 18.7071C-0.0976311 18.3166 -0.0976311 17.6834 0.292893 17.2929L5.58579 12L0.292893 6.70711C-0.0976311 6.31658 -0.0976311 5.68342 0.292893 5.29289Z"
|
|
8
|
+
}), 'Close', '0 0 14 24');
|
|
7
9
|
//# sourceMappingURL=Close.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Path","createSvgIcon"],"sources":["Close.tsx"],"sourcesContent":["import React from 'react';\nimport { Path } from 'react-native-svg';\nimport { createSvgIcon } from '../../utils';\n\nexport default createSvgIcon(\n <Path\n d=\"
|
|
1
|
+
{"version":3,"names":["React","Path","createSvgIcon"],"sources":["Close.tsx"],"sourcesContent":["import React from 'react';\nimport { Path } from 'react-native-svg';\nimport { createSvgIcon } from '../../utils';\n\nexport default createSvgIcon(\n <Path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M0.292893 5.29289C0.683417 4.90237 1.31658 4.90237 1.70711 5.29289L7 10.5858L12.2929 5.29289C12.6834 4.90237 13.3166 4.90237 13.7071 5.29289C14.0976 5.68342 14.0976 6.31658 13.7071 6.70711L8.41421 12L13.7071 17.2929C14.0976 17.6834 14.0976 18.3166 13.7071 18.7071C13.3166 19.0976 12.6834 19.0976 12.2929 18.7071L7 13.4142L1.70711 18.7071C1.31658 19.0976 0.683417 19.0976 0.292893 18.7071C-0.0976311 18.3166 -0.0976311 17.6834 0.292893 17.2929L5.58579 12L0.292893 6.70711C-0.0976311 6.31658 -0.0976311 5.68342 0.292893 5.29289Z\"\n />,\n 'Close',\n '0 0 14 24',\n);\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,QAAqB,kBAArB;AACA,SAASC,aAAT,QAA8B,aAA9B;AAEA,eAAeA,aAAa,eACxB,oBAAC,IAAD;EACI,QAAQ,EAAC,SADb;EAEI,QAAQ,EAAC,SAFb;EAGI,CAAC,EAAC;AAHN,EADwB,EAMxB,OANwB,EAOxB,WAPwB,CAA5B"}
|
|
@@ -29,6 +29,11 @@ export default interface BadgeProps extends OverridableComponentProps<ViewProps,
|
|
|
29
29
|
* (only number variant)
|
|
30
30
|
*/
|
|
31
31
|
content?: number;
|
|
32
|
+
/**
|
|
33
|
+
* The horizontal offset of the badge.
|
|
34
|
+
* @default 0
|
|
35
|
+
*/
|
|
36
|
+
horizontalOffset?: number;
|
|
32
37
|
/**
|
|
33
38
|
* If `true`, the badge is invisible.
|
|
34
39
|
* @default false
|
|
@@ -42,11 +47,6 @@ export default interface BadgeProps extends OverridableComponentProps<ViewProps,
|
|
|
42
47
|
* }
|
|
43
48
|
*/
|
|
44
49
|
position?: BadgePosition;
|
|
45
|
-
/**
|
|
46
|
-
* The offset of the badge.
|
|
47
|
-
* @default 0
|
|
48
|
-
*/
|
|
49
|
-
offset?: number;
|
|
50
50
|
/**
|
|
51
51
|
*
|
|
52
52
|
*/
|
|
@@ -56,5 +56,10 @@ export default interface BadgeProps extends OverridableComponentProps<ViewProps,
|
|
|
56
56
|
* @default 'dot'
|
|
57
57
|
*/
|
|
58
58
|
variant?: BadgeVariant;
|
|
59
|
+
/**
|
|
60
|
+
* The vertical offset of the badge.
|
|
61
|
+
* @default 0
|
|
62
|
+
*/
|
|
63
|
+
verticalOffset?: number;
|
|
59
64
|
}> {
|
|
60
65
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from './
|
|
1
|
+
export { default } from './ButtonBase';
|
|
2
2
|
export type { default as ButtonBaseProps } from './ButtonBaseProps';
|
|
@@ -1,23 +1,30 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { OverridableComponentProps } from '../types';
|
|
3
3
|
import type { ButtonBaseProps } from '../ButtonBase';
|
|
4
|
+
export declare const chipColors: readonly ["default", "white"];
|
|
5
|
+
export declare type ChipColor = typeof chipColors[number];
|
|
4
6
|
export declare const chipSizes: readonly ["large", "small"];
|
|
5
7
|
export declare type ChipSize = typeof chipSizes[number];
|
|
6
8
|
export declare const chipStartElementVariants: readonly ["default", "avatar", "image", "icon"];
|
|
7
9
|
export declare type ChipStartElementVariant = typeof chipStartElementVariants[number];
|
|
8
10
|
export default interface ChipProps extends OverridableComponentProps<ButtonBaseProps, {
|
|
9
|
-
/**
|
|
10
|
-
* Element placed after the children.
|
|
11
|
-
*/
|
|
12
|
-
endElement?: React.ReactElement;
|
|
13
11
|
/**
|
|
14
12
|
* The content of the component.
|
|
15
13
|
*/
|
|
16
14
|
children: string;
|
|
15
|
+
/**
|
|
16
|
+
* Set backgroundColor of the component.
|
|
17
|
+
* @default 'default'
|
|
18
|
+
*/
|
|
19
|
+
color?: ChipColor;
|
|
17
20
|
/**
|
|
18
21
|
* Number of lines of children.
|
|
19
22
|
*/
|
|
20
23
|
numberOfLines?: number;
|
|
24
|
+
/**
|
|
25
|
+
* If `true`, showing a close icon and applying a highlighted style.
|
|
26
|
+
*/
|
|
27
|
+
selected?: boolean;
|
|
21
28
|
/**
|
|
22
29
|
* Determines size of component.
|
|
23
30
|
* @default 'small'
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { TextStyle } from 'react-native';
|
|
2
2
|
import type { FountainUiStyle } from '@fountain-ui/styles';
|
|
3
|
-
import type { ChipSize, ChipStartElementVariant } from './ChipProps';
|
|
3
|
+
import type { ChipColor, ChipSize, ChipStartElementVariant } from './ChipProps';
|
|
4
4
|
interface ChipStyle {
|
|
5
5
|
container: FountainUiStyle;
|
|
6
|
-
|
|
6
|
+
closeButton?: FountainUiStyle;
|
|
7
7
|
label: TextStyle;
|
|
8
8
|
startElement?: FountainUiStyle;
|
|
9
|
+
startElementContainer?: FountainUiStyle;
|
|
9
10
|
}
|
|
10
|
-
export default function useChipStyle(size: ChipSize, startElementVariant: ChipStartElementVariant,
|
|
11
|
+
export default function useChipStyle(size: ChipSize, startElementVariant: ChipStartElementVariant, color: ChipColor, selected: boolean): ChipStyle;
|
|
11
12
|
export {};
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { ModalProps } from '../Modal';
|
|
3
3
|
import type { OverridableComponentProps } from '../types';
|
|
4
4
|
import { ANIMATION_TYPE } from '../Modal';
|
|
5
|
-
export declare const dialogSizes: readonly ["small", "medium", "large"];
|
|
5
|
+
export declare const dialogSizes: readonly ["small", "medium", "large", "full"];
|
|
6
6
|
export declare type DialogSize = typeof dialogSizes[number];
|
|
7
7
|
export default interface DialogProps extends OverridableComponentProps<ModalProps, {
|
|
8
8
|
/**
|
|
@@ -14,11 +14,6 @@ export default interface DialogProps extends OverridableComponentProps<ModalProp
|
|
|
14
14
|
* Dialog children, usually the included sub-components.
|
|
15
15
|
*/
|
|
16
16
|
children?: React.ReactNode;
|
|
17
|
-
/**
|
|
18
|
-
* If `true`, the dialog is full-screen.
|
|
19
|
-
* @default false
|
|
20
|
-
*/
|
|
21
|
-
fullScreen?: boolean;
|
|
22
17
|
/**
|
|
23
18
|
* Determines the minWidth of the Dialog.
|
|
24
19
|
* @default 'medium'
|
|
@@ -2,5 +2,5 @@ import type { NamedStylesStringUnion } from '@fountain-ui/styles';
|
|
|
2
2
|
import type { DialogSize } from './DialogProps';
|
|
3
3
|
declare type DialogStyleKeys = 'root' | 'container' | 'paper' | 'topElementContainer' | 'topElementContent';
|
|
4
4
|
declare type DialogStyles = NamedStylesStringUnion<DialogStyleKeys>;
|
|
5
|
-
export default function useDialogStyle(size: DialogSize
|
|
5
|
+
export default function useDialogStyle(size: DialogSize): DialogStyles;
|
|
6
6
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { DialogProps } from '../Dialog';
|
|
3
|
+
import type DialogTitleProps from './DialogTitleProps';
|
|
4
|
+
interface DialogLargeTitleProps extends DialogTitleProps {
|
|
5
|
+
closeButtonType?: 'back' | 'close';
|
|
6
|
+
onClose: DialogProps['onClose'];
|
|
7
|
+
}
|
|
8
|
+
export default function DialogLargeTitle(props: DialogLargeTitleProps): JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import DialogLargeTitle from './DialogLargeTitle';
|
|
2
3
|
import type DialogTitleProps from './DialogTitleProps';
|
|
3
|
-
|
|
4
|
+
declare const DialogTitle: {
|
|
5
|
+
(props: DialogTitleProps): JSX.Element;
|
|
6
|
+
Large: typeof DialogLargeTitle;
|
|
7
|
+
};
|
|
8
|
+
export default DialogTitle;
|
|
@@ -3,7 +3,7 @@ import type { ViewProps } from 'react-native';
|
|
|
3
3
|
import type { OverridableComponentProps } from '../types';
|
|
4
4
|
export declare const dividerElementAligns: readonly ["start", "center", "end"];
|
|
5
5
|
export declare type DividerElementAlign = typeof dividerElementAligns[number];
|
|
6
|
-
export declare const dividerVariants: readonly ["base", "strong"];
|
|
6
|
+
export declare const dividerVariants: readonly ["base", "strong", "baseStatic", "strongStatic"];
|
|
7
7
|
export declare type DividerVariant = typeof dividerVariants[number];
|
|
8
8
|
export default interface DividerProps extends OverridableComponentProps<ViewProps, {
|
|
9
9
|
/**
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ViewProps } from 'react-native';
|
|
3
3
|
import type { OverridableComponentProps } from '../types';
|
|
4
|
+
export declare const paginationColors: readonly ["base", "static"];
|
|
5
|
+
export declare type PaginationColor = typeof paginationColors[number];
|
|
4
6
|
export declare const paginationVariants: readonly ["dot", "number"];
|
|
5
7
|
export declare type PaginationVariant = typeof paginationVariants[number];
|
|
6
8
|
export interface PaginationRenderItemParams {
|
|
9
|
+
/**
|
|
10
|
+
* Set color of dot.
|
|
11
|
+
* @default 'base'
|
|
12
|
+
*/
|
|
13
|
+
color?: PaginationColor;
|
|
7
14
|
/**
|
|
8
15
|
* Index of the pagination item.
|
|
9
16
|
*/
|
|
@@ -27,6 +34,11 @@ export default interface PaginationProps extends OverridableComponentProps<ViewP
|
|
|
27
34
|
* The pagination will be added relative to this node.
|
|
28
35
|
*/
|
|
29
36
|
children?: React.ReactNode;
|
|
37
|
+
/**
|
|
38
|
+
* Set color of dot.
|
|
39
|
+
* @default 'base'
|
|
40
|
+
*/
|
|
41
|
+
color?: PaginationColor;
|
|
30
42
|
/**
|
|
31
43
|
* The total number of pages.
|
|
32
44
|
*/
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { default } from './Pagination';
|
|
2
|
-
export type { default as PaginationProps } from './PaginationProps';
|
|
3
|
-
export { paginationVariants } from './PaginationProps';
|
|
2
|
+
export type { default as PaginationProps, PaginationColor, PaginationVariant } from './PaginationProps';
|
|
3
|
+
export { paginationColors, paginationVariants } from './PaginationProps';
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import type { ViewProps } from 'react-native';
|
|
2
2
|
import type { OverridableComponentProps } from '../types';
|
|
3
|
+
import { PaginationColor } from '../Pagination';
|
|
3
4
|
export default interface PaginationItemProps extends OverridableComponentProps<ViewProps, {
|
|
5
|
+
/**
|
|
6
|
+
* Set color of dot.
|
|
7
|
+
* @default 'base'
|
|
8
|
+
*/
|
|
9
|
+
color?: PaginationColor;
|
|
4
10
|
/**
|
|
5
11
|
* If `true`, the pagination item is disabled.
|
|
6
12
|
* @default false
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import BackButton from './BackButton';
|
|
2
3
|
import type ToolbarProps from './ToolbarProps';
|
|
3
|
-
|
|
4
|
+
declare const Toolbar: {
|
|
5
|
+
(props: ToolbarProps): JSX.Element;
|
|
6
|
+
BackButton: typeof BackButton;
|
|
7
|
+
};
|
|
8
|
+
export default Toolbar;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fountain-ui/core",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.12",
|
|
4
4
|
"author": "Fountain-UI Team",
|
|
5
5
|
"description": "React components that implement Tappytoon's Fountain Design.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"prepare": "bob build"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@fountain-ui/styles": "^3.0.0-alpha.
|
|
17
|
+
"@fountain-ui/styles": "^3.0.0-alpha.8",
|
|
18
18
|
"@fountain-ui/utils": "^3.0.0-alpha.1"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"publishConfig": {
|
|
68
68
|
"access": "public"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "41dd1275144940053eca67f53504c81eee6eac2b"
|
|
71
71
|
}
|
package/src/AppBar/AppBar.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';
|
|
4
|
+
import { useBreakpointUp } from '../hooks';
|
|
4
5
|
import { css, useTheme } from '../styles';
|
|
5
6
|
import type AppBarProps from './AppBarProps';
|
|
6
7
|
import type { AppBarColor } from './AppBarProps';
|
|
@@ -31,6 +32,8 @@ const AppBar = React.forwardRef<View, AppBarProps>(function AppBar(props, ref) {
|
|
|
31
32
|
|
|
32
33
|
const theme = useTheme();
|
|
33
34
|
|
|
35
|
+
const isDesktop = useBreakpointUp('md', true, false);
|
|
36
|
+
|
|
34
37
|
const styles = useStyles();
|
|
35
38
|
|
|
36
39
|
const backgroundColorMap: Record<AppBarColor, string> = {
|
|
@@ -41,6 +44,7 @@ const AppBar = React.forwardRef<View, AppBarProps>(function AppBar(props, ref) {
|
|
|
41
44
|
const paperStyle = css([
|
|
42
45
|
styles.root,
|
|
43
46
|
{ backgroundColor: backgroundColorMap[color] },
|
|
47
|
+
isDesktop ? { paddingHorizontal: 8 } : undefined,
|
|
44
48
|
style,
|
|
45
49
|
]);
|
|
46
50
|
|
package/src/Badge/Badge.tsx
CHANGED
|
@@ -15,12 +15,13 @@ export default function Badge(props: BadgeProps) {
|
|
|
15
15
|
children,
|
|
16
16
|
color = 'accent' as BadgeColor,
|
|
17
17
|
content,
|
|
18
|
+
horizontalOffset = 0,
|
|
18
19
|
invisible = false,
|
|
19
20
|
position = defaultPosition,
|
|
20
21
|
size = 'medium' as BadgeSize,
|
|
21
22
|
style: styleProp,
|
|
22
|
-
offset = 0,
|
|
23
23
|
variant = 'dot' as BadgeVariant,
|
|
24
|
+
verticalOffset = 0,
|
|
24
25
|
...otherProps
|
|
25
26
|
} = props;
|
|
26
27
|
|
|
@@ -36,8 +37,8 @@ export default function Badge(props: BadgeProps) {
|
|
|
36
37
|
const badgeStyle = css([
|
|
37
38
|
baseBadgeStyle,
|
|
38
39
|
{
|
|
39
|
-
[position.vertical]:
|
|
40
|
-
[position.horizontal]:
|
|
40
|
+
[position.vertical]: verticalOffset,
|
|
41
|
+
[position.horizontal]: horizontalOffset,
|
|
41
42
|
},
|
|
42
43
|
]);
|
|
43
44
|
|
package/src/Badge/BadgeProps.ts
CHANGED
|
@@ -39,6 +39,12 @@ export default interface BadgeProps extends OverridableComponentProps<ViewProps,
|
|
|
39
39
|
*/
|
|
40
40
|
content?: number;
|
|
41
41
|
|
|
42
|
+
/**
|
|
43
|
+
* The horizontal offset of the badge.
|
|
44
|
+
* @default 0
|
|
45
|
+
*/
|
|
46
|
+
horizontalOffset?: number;
|
|
47
|
+
|
|
42
48
|
/**
|
|
43
49
|
* If `true`, the badge is invisible.
|
|
44
50
|
* @default false
|
|
@@ -54,12 +60,6 @@ export default interface BadgeProps extends OverridableComponentProps<ViewProps,
|
|
|
54
60
|
*/
|
|
55
61
|
position?: BadgePosition;
|
|
56
62
|
|
|
57
|
-
/**
|
|
58
|
-
* The offset of the badge.
|
|
59
|
-
* @default 0
|
|
60
|
-
*/
|
|
61
|
-
offset?: number;
|
|
62
|
-
|
|
63
63
|
/**
|
|
64
64
|
*
|
|
65
65
|
*/
|
|
@@ -70,4 +70,10 @@ export default interface BadgeProps extends OverridableComponentProps<ViewProps,
|
|
|
70
70
|
* @default 'dot'
|
|
71
71
|
*/
|
|
72
72
|
variant?: BadgeVariant;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* The vertical offset of the badge.
|
|
76
|
+
* @default 0
|
|
77
|
+
*/
|
|
78
|
+
verticalOffset?: number;
|
|
73
79
|
}> {}
|
package/src/ButtonBase/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from './
|
|
1
|
+
export { default } from './ButtonBase';
|
|
2
2
|
export type { default as ButtonBaseProps } from './ButtonBaseProps';
|
package/src/Chip/Chip.tsx
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Text, View } from 'react-native';
|
|
3
|
+
import ButtonBase from '../ButtonBase';
|
|
4
|
+
import { Close } from '../internal';
|
|
3
5
|
import { css } from '../styles';
|
|
4
6
|
import { cloneElementSafely } from '../utils';
|
|
5
|
-
import ButtonBase from '../ButtonBase/ButtonBase';
|
|
6
7
|
import type ChipProps from './ChipProps';
|
|
7
|
-
import type { ChipSize } from './ChipProps';
|
|
8
|
+
import type { ChipColor, ChipSize } from './ChipProps';
|
|
8
9
|
import useChipStyle from './useChipStyle';
|
|
9
10
|
|
|
10
11
|
export default function Chip(props: ChipProps) {
|
|
11
12
|
const {
|
|
12
13
|
children,
|
|
13
|
-
|
|
14
|
+
color = 'default' as ChipColor,
|
|
14
15
|
numberOfLines,
|
|
15
16
|
onPress,
|
|
17
|
+
selected = false,
|
|
16
18
|
size = 'small' as ChipSize,
|
|
17
19
|
startElement: startElementProp,
|
|
18
20
|
startElementVariant = 'default',
|
|
@@ -22,26 +24,26 @@ export default function Chip(props: ChipProps) {
|
|
|
22
24
|
|
|
23
25
|
const {
|
|
24
26
|
container: containerStyle,
|
|
25
|
-
|
|
27
|
+
closeButton: closeButtonStyle,
|
|
26
28
|
label: labelStyle,
|
|
27
29
|
startElement: startElementStyle,
|
|
28
|
-
|
|
30
|
+
startElementContainer: startElementContainerStyle,
|
|
31
|
+
} = useChipStyle(size, startElementVariant, color, selected);
|
|
29
32
|
|
|
30
33
|
const chipStyle = css([
|
|
31
34
|
containerStyle,
|
|
32
35
|
styleProp,
|
|
33
36
|
]);
|
|
34
37
|
|
|
35
|
-
const startElement =
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
) : cloneElementSafely(startElementProp, { style: startElementStyle });
|
|
41
|
-
const endElement = cloneElementSafely(endElementProp, { style: endElementStyle });
|
|
38
|
+
const startElement = (
|
|
39
|
+
<View style={startElementContainerStyle}>
|
|
40
|
+
{cloneElementSafely(startElementProp, { style: startElementStyle })}
|
|
41
|
+
</View>
|
|
42
|
+
);
|
|
42
43
|
|
|
43
44
|
return (
|
|
44
45
|
<ButtonBase
|
|
46
|
+
disabled={!onPress}
|
|
45
47
|
onPress={onPress}
|
|
46
48
|
style={chipStyle}
|
|
47
49
|
{...otherProps}
|
|
@@ -54,7 +56,12 @@ export default function Chip(props: ChipProps) {
|
|
|
54
56
|
style={labelStyle}
|
|
55
57
|
/>
|
|
56
58
|
|
|
57
|
-
{
|
|
59
|
+
{selected ? (
|
|
60
|
+
<Close
|
|
61
|
+
color={'baseInverse'}
|
|
62
|
+
style={closeButtonStyle}
|
|
63
|
+
/>
|
|
64
|
+
) : null}
|
|
58
65
|
</ButtonBase>
|
|
59
66
|
);
|
|
60
67
|
}
|
package/src/Chip/ChipProps.ts
CHANGED
|
@@ -2,6 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import { OverridableComponentProps } from '../types';
|
|
3
3
|
import type { ButtonBaseProps } from '../ButtonBase';
|
|
4
4
|
|
|
5
|
+
export const chipColors = ['default', 'white'] as const;
|
|
6
|
+
export type ChipColor = typeof chipColors[number];
|
|
7
|
+
|
|
5
8
|
export const chipSizes = ['large', 'small'] as const;
|
|
6
9
|
export type ChipSize = typeof chipSizes[number];
|
|
7
10
|
|
|
@@ -10,20 +13,26 @@ export type ChipStartElementVariant = typeof chipStartElementVariants[number];
|
|
|
10
13
|
|
|
11
14
|
export default interface ChipProps extends OverridableComponentProps<ButtonBaseProps, {
|
|
12
15
|
/**
|
|
13
|
-
*
|
|
16
|
+
* The content of the component.
|
|
14
17
|
*/
|
|
15
|
-
|
|
18
|
+
children: string;
|
|
16
19
|
|
|
17
20
|
/**
|
|
18
|
-
*
|
|
21
|
+
* Set backgroundColor of the component.
|
|
22
|
+
* @default 'default'
|
|
19
23
|
*/
|
|
20
|
-
|
|
24
|
+
color?: ChipColor;
|
|
21
25
|
|
|
22
26
|
/**
|
|
23
27
|
* Number of lines of children.
|
|
24
28
|
*/
|
|
25
29
|
numberOfLines?: number;
|
|
26
30
|
|
|
31
|
+
/**
|
|
32
|
+
* If `true`, showing a close icon and applying a highlighted style.
|
|
33
|
+
*/
|
|
34
|
+
selected?: boolean;
|
|
35
|
+
|
|
27
36
|
/**
|
|
28
37
|
* Determines size of component.
|
|
29
38
|
* @default 'small'
|
package/src/Chip/index.ts
CHANGED
package/src/Chip/useChipStyle.ts
CHANGED
|
@@ -2,13 +2,14 @@ import { useMemo } from 'react';
|
|
|
2
2
|
import type { TextStyle } from 'react-native';
|
|
3
3
|
import type { FountainUiStyle } from '@fountain-ui/styles';
|
|
4
4
|
import { createFontStyle, useTheme } from '../styles';
|
|
5
|
-
import type { ChipSize, ChipStartElementVariant } from './ChipProps';
|
|
5
|
+
import type { ChipColor, ChipSize, ChipStartElementVariant } from './ChipProps';
|
|
6
6
|
|
|
7
7
|
interface ChipStyle {
|
|
8
8
|
container: FountainUiStyle;
|
|
9
|
-
|
|
9
|
+
closeButton?: FountainUiStyle;
|
|
10
10
|
label: TextStyle;
|
|
11
11
|
startElement?: FountainUiStyle;
|
|
12
|
+
startElementContainer?: FountainUiStyle;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
type VariantStyleMap = Record<ChipStartElementVariant, Partial<ChipStyle>>;
|
|
@@ -17,7 +18,8 @@ type VariantStyleMap = Record<ChipStartElementVariant, Partial<ChipStyle>>;
|
|
|
17
18
|
export default function useChipStyle(
|
|
18
19
|
size: ChipSize,
|
|
19
20
|
startElementVariant: ChipStartElementVariant,
|
|
20
|
-
|
|
21
|
+
color: ChipColor,
|
|
22
|
+
selected: boolean,
|
|
21
23
|
): ChipStyle {
|
|
22
24
|
const theme = useTheme();
|
|
23
25
|
|
|
@@ -25,22 +27,22 @@ export default function useChipStyle(
|
|
|
25
27
|
const fontStyleMap: Record<ChipSize, TextStyle> = {
|
|
26
28
|
small: createFontStyle(theme, {
|
|
27
29
|
selector: (typography) => typography.caption1.medium,
|
|
28
|
-
color: theme.palette.text.strong,
|
|
30
|
+
color: selected ? theme.palette.text.strongInverse : theme.palette.text.strong,
|
|
29
31
|
}),
|
|
30
32
|
large: createFontStyle(theme, {
|
|
31
33
|
selector: (typography) => typography.body2.medium,
|
|
32
|
-
color: theme.palette.text.strong,
|
|
34
|
+
color: selected ? theme.palette.text.strongInverse : theme.palette.text.strong,
|
|
33
35
|
}),
|
|
34
36
|
};
|
|
35
37
|
|
|
36
|
-
const
|
|
38
|
+
const closeButtonStyleMap: Record<ChipSize, FountainUiStyle> = {
|
|
37
39
|
small: {
|
|
38
40
|
height: 14,
|
|
39
41
|
marginLeft: theme.spacing(2),
|
|
40
42
|
width: 8.17,
|
|
41
43
|
},
|
|
42
44
|
large: {
|
|
43
|
-
height:
|
|
45
|
+
height: 17,
|
|
44
46
|
marginLeft: theme.spacing(2.5),
|
|
45
47
|
width: 9,
|
|
46
48
|
},
|
|
@@ -48,7 +50,10 @@ export default function useChipStyle(
|
|
|
48
50
|
|
|
49
51
|
const baseContainerStyle: FountainUiStyle = {
|
|
50
52
|
alignItems: 'center',
|
|
51
|
-
backgroundColor: theme.palette.fill.
|
|
53
|
+
backgroundColor: selected ? theme.palette.fill.base
|
|
54
|
+
: color === 'white'
|
|
55
|
+
? theme.palette.surface.base
|
|
56
|
+
: theme.palette.fill.weaker,
|
|
52
57
|
borderRadius: theme.shape.radius.full,
|
|
53
58
|
flexDirection: 'row',
|
|
54
59
|
overflow: 'hidden',
|
|
@@ -65,9 +70,11 @@ export default function useChipStyle(
|
|
|
65
70
|
},
|
|
66
71
|
startElement: {
|
|
67
72
|
borderRadius: theme.shape.radius.full,
|
|
68
|
-
height: isLarge ?
|
|
73
|
+
height: isLarge ? 26 : 23,
|
|
74
|
+
width: isLarge ? 26 : 23,
|
|
75
|
+
},
|
|
76
|
+
startElementContainer: {
|
|
69
77
|
marginRight: theme.spacing(isLarge ? 1.5 : 1.25),
|
|
70
|
-
width: isLarge ? 24 : 22,
|
|
71
78
|
},
|
|
72
79
|
},
|
|
73
80
|
icon: {
|
|
@@ -77,11 +84,18 @@ export default function useChipStyle(
|
|
|
77
84
|
paddingVertical: theme.spacing(isLarge ? 1.5 : 1.25),
|
|
78
85
|
},
|
|
79
86
|
startElement: {
|
|
87
|
+
color: selected
|
|
88
|
+
? theme.palette.icon.strongInverse
|
|
89
|
+
: theme.palette.icon.strong,
|
|
90
|
+
height: isLarge ? 17 : 16,
|
|
91
|
+
width: isLarge ? 17 : 16,
|
|
92
|
+
},
|
|
93
|
+
startElementContainer: {
|
|
80
94
|
alignItems: 'center',
|
|
81
|
-
height: isLarge ?
|
|
95
|
+
height: isLarge ? 24 : 21,
|
|
82
96
|
justifyContent: 'center',
|
|
83
97
|
marginRight: theme.spacing(isLarge ? 1 : 0.75),
|
|
84
|
-
width: isLarge ?
|
|
98
|
+
width: isLarge ? 24 : 21,
|
|
85
99
|
},
|
|
86
100
|
},
|
|
87
101
|
image: {
|
|
@@ -91,9 +105,11 @@ export default function useChipStyle(
|
|
|
91
105
|
},
|
|
92
106
|
startElement: {
|
|
93
107
|
borderRadius: theme.shape.radius.full,
|
|
94
|
-
height: isLarge ?
|
|
108
|
+
height: isLarge ? 36 : 31,
|
|
109
|
+
width: isLarge ? 48 : 40,
|
|
110
|
+
},
|
|
111
|
+
startElementContainer: {
|
|
95
112
|
marginRight: theme.spacing(1.5),
|
|
96
|
-
width: isLarge ? 45 : 40,
|
|
97
113
|
},
|
|
98
114
|
},
|
|
99
115
|
default: {
|
|
@@ -109,11 +125,12 @@ export default function useChipStyle(
|
|
|
109
125
|
container: {
|
|
110
126
|
...baseContainerStyle,
|
|
111
127
|
...variantStyleMap[startElementVariant]?.container,
|
|
112
|
-
...(
|
|
128
|
+
...(selected ? { paddingRight: theme.spacing(isLarge ? 2.5 : 2.25) } : {}),
|
|
113
129
|
},
|
|
114
|
-
|
|
130
|
+
closeButton: closeButtonStyleMap[size],
|
|
115
131
|
label: fontStyleMap[size],
|
|
116
132
|
startElement: variantStyleMap[startElementVariant]?.startElement,
|
|
133
|
+
startElementContainer: variantStyleMap[startElementVariant]?.startElementContainer,
|
|
117
134
|
};
|
|
118
|
-
}, [theme, size, startElementVariant]);
|
|
135
|
+
}, [theme, size, startElementVariant, color, selected]);
|
|
119
136
|
}
|