mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-02 02:43:33 +00:00
Merge branch 'development' into react-image-lazy-loaded
This commit is contained in:
commit
1aac1a6361
193 changed files with 2003 additions and 2154 deletions
|
|
@ -17,12 +17,7 @@ export interface AccordionProps
|
|||
export const Accordion = ({ children, classNames, ...props }: AccordionProps) => {
|
||||
return (
|
||||
<MantineAccordion
|
||||
chevron={
|
||||
<Icon
|
||||
icon="arrowUpS"
|
||||
size="lg"
|
||||
/>
|
||||
}
|
||||
chevron={<Icon icon="arrowUpS" size="lg" />}
|
||||
classNames={{
|
||||
chevron: styles.chevron,
|
||||
control: styles.control,
|
||||
|
|
|
|||
|
|
@ -45,19 +45,9 @@ const _ActionIcon = forwardRef<HTMLButtonElement, ActionIconProps>(
|
|||
|
||||
if (tooltip && icon) {
|
||||
return (
|
||||
<Tooltip
|
||||
withinPortal
|
||||
{...tooltip}
|
||||
>
|
||||
<MantineActionIcon
|
||||
ref={ref}
|
||||
{...actionIconProps}
|
||||
>
|
||||
<Icon
|
||||
icon={icon}
|
||||
size={actionIconProps.size}
|
||||
{...iconProps}
|
||||
/>
|
||||
<Tooltip withinPortal {...tooltip}>
|
||||
<MantineActionIcon ref={ref} {...actionIconProps}>
|
||||
<Icon icon={icon} size={actionIconProps.size} {...iconProps} />
|
||||
</MantineActionIcon>
|
||||
</Tooltip>
|
||||
);
|
||||
|
|
@ -65,29 +55,16 @@ const _ActionIcon = forwardRef<HTMLButtonElement, ActionIconProps>(
|
|||
|
||||
if (icon) {
|
||||
return (
|
||||
<MantineActionIcon
|
||||
ref={ref}
|
||||
{...actionIconProps}
|
||||
>
|
||||
<Icon
|
||||
icon={icon}
|
||||
size={actionIconProps.size}
|
||||
{...iconProps}
|
||||
/>
|
||||
<MantineActionIcon ref={ref} {...actionIconProps}>
|
||||
<Icon icon={icon} size={actionIconProps.size} {...iconProps} />
|
||||
</MantineActionIcon>
|
||||
);
|
||||
}
|
||||
|
||||
if (tooltip) {
|
||||
return (
|
||||
<Tooltip
|
||||
withinPortal
|
||||
{...tooltip}
|
||||
>
|
||||
<MantineActionIcon
|
||||
ref={ref}
|
||||
{...actionIconProps}
|
||||
>
|
||||
<Tooltip withinPortal {...tooltip}>
|
||||
<MantineActionIcon ref={ref} {...actionIconProps}>
|
||||
{children}
|
||||
</MantineActionIcon>
|
||||
</Tooltip>
|
||||
|
|
@ -95,10 +72,7 @@ const _ActionIcon = forwardRef<HTMLButtonElement, ActionIconProps>(
|
|||
}
|
||||
|
||||
return (
|
||||
<MantineActionIcon
|
||||
ref={ref}
|
||||
{...actionIconProps}
|
||||
>
|
||||
<MantineActionIcon ref={ref} {...actionIconProps}>
|
||||
{children}
|
||||
</MantineActionIcon>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -44,10 +44,7 @@ export const _Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
|||
) => {
|
||||
if (tooltip) {
|
||||
return (
|
||||
<Tooltip
|
||||
withinPortal
|
||||
{...tooltip}
|
||||
>
|
||||
<Tooltip withinPortal {...tooltip}>
|
||||
<MantineButton
|
||||
autoContrast
|
||||
classNames={{
|
||||
|
|
@ -145,10 +142,7 @@ export const TimeoutButton = ({ timeoutProps, ...props }: TimeoutButtonProps) =>
|
|||
}, [clear, isRunning, start]);
|
||||
|
||||
return (
|
||||
<Button
|
||||
onClick={startTimeout}
|
||||
{...props}
|
||||
>
|
||||
<Button onClick={startTimeout} {...props}>
|
||||
{isRunning ? 'Cancel' : props.children}
|
||||
</Button>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -44,10 +44,7 @@ export const DropdownMenu = ({ children, ...props }: MenuProps) => {
|
|||
|
||||
const MenuLabel = ({ children, ...props }: MenuLabelProps) => {
|
||||
return (
|
||||
<MantineMenu.Label
|
||||
className={styles['menu-label']}
|
||||
{...props}
|
||||
>
|
||||
<MantineMenu.Label className={styles['menu-label']} {...props}>
|
||||
{children}
|
||||
</MantineMenu.Label>
|
||||
);
|
||||
|
|
@ -75,10 +72,7 @@ const pMenuItem = ({ children, isDanger, isSelected, ...props }: MenuItemProps)
|
|||
|
||||
const MenuDropdown = ({ children, ...props }: MenuDropdownProps) => {
|
||||
return (
|
||||
<MantineMenu.Dropdown
|
||||
className={styles['menu-dropdown']}
|
||||
{...props}
|
||||
>
|
||||
<MantineMenu.Dropdown className={styles['menu-dropdown']} {...props}>
|
||||
{children}
|
||||
</MantineMenu.Dropdown>
|
||||
);
|
||||
|
|
@ -87,12 +81,7 @@ const MenuDropdown = ({ children, ...props }: MenuDropdownProps) => {
|
|||
const MenuItem = createPolymorphicComponent<'button', MenuItemProps>(pMenuItem);
|
||||
|
||||
const MenuDivider = ({ ...props }: MenuDividerProps) => {
|
||||
return (
|
||||
<MantineMenu.Divider
|
||||
className={styles['menu-divider']}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
return <MantineMenu.Divider className={styles['menu-divider']} {...props} />;
|
||||
};
|
||||
|
||||
DropdownMenu.Label = MenuLabel;
|
||||
|
|
|
|||
|
|
@ -3,13 +3,7 @@ import { Grid as MantineGrid, GridProps as MantineGridProps } from '@mantine/cor
|
|||
export interface GridProps extends MantineGridProps {}
|
||||
|
||||
export const Grid = ({ classNames, style, ...props }: GridProps) => {
|
||||
return (
|
||||
<MantineGrid
|
||||
classNames={{ ...classNames }}
|
||||
style={{ ...style }}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
return <MantineGrid classNames={{ ...classNames }} style={{ ...style }} {...props} />;
|
||||
};
|
||||
|
||||
Grid.Col = MantineGrid.Col;
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ import {
|
|||
LuListPlus,
|
||||
LuLoader,
|
||||
LuLock,
|
||||
LuLockOpen,
|
||||
LuLogIn,
|
||||
LuLogOut,
|
||||
LuMenu,
|
||||
|
|
@ -163,6 +164,7 @@ export const AppIcon = {
|
|||
listInfinite: LuInfinity,
|
||||
listPaginated: LuArrowRightToLine,
|
||||
lock: LuLock,
|
||||
lockOpen: LuLockOpen,
|
||||
mediaNext: LuSkipForward,
|
||||
mediaPause: LuPause,
|
||||
mediaPlay: LuPlay,
|
||||
|
|
|
|||
|
|
@ -89,10 +89,7 @@ export function Image({
|
|||
function ImageContainer({ children, className, enableAnimation, ...props }: ImageContainerProps) {
|
||||
if (!enableAnimation) {
|
||||
return (
|
||||
<div
|
||||
className={clsx(styles.imageContainer, className)}
|
||||
{...props}
|
||||
>
|
||||
<div className={clsx(styles.imageContainer, className)} {...props}>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
|
|
@ -112,10 +109,7 @@ function ImageContainer({ children, className, enableAnimation, ...props }: Imag
|
|||
function ImageLoader({ className }: ImageLoaderProps) {
|
||||
return (
|
||||
<div className={clsx(styles.loader, className)}>
|
||||
<Skeleton
|
||||
className={clsx(styles.skeleton, className)}
|
||||
enableAnimation={true}
|
||||
/>
|
||||
<Skeleton className={clsx(styles.skeleton, className)} enableAnimation={true} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -123,10 +117,7 @@ function ImageLoader({ className }: ImageLoaderProps) {
|
|||
function ImageUnloader({ className }: ImageUnloaderProps) {
|
||||
return (
|
||||
<div className={clsx(styles.unloader, className)}>
|
||||
<Icon
|
||||
icon="emptyImage"
|
||||
size="xl"
|
||||
/>
|
||||
<Icon icon="emptyImage" size="xl" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,19 +93,10 @@ export const ConfirmModal = ({
|
|||
<Stack>
|
||||
<Flex>{children}</Flex>
|
||||
<Group justify="flex-end">
|
||||
<Button
|
||||
data-focus
|
||||
onClick={handleCancel}
|
||||
variant="default"
|
||||
>
|
||||
<Button data-focus onClick={handleCancel} variant="default">
|
||||
{labels?.cancel ? labels.cancel : 'Cancel'}
|
||||
</Button>
|
||||
<Button
|
||||
disabled={disabled}
|
||||
loading={loading}
|
||||
onClick={onConfirm}
|
||||
variant="filled"
|
||||
>
|
||||
<Button disabled={disabled} loading={loading} onClick={onConfirm} variant="filled">
|
||||
{labels?.confirm ? labels.confirm : 'Confirm'}
|
||||
</Button>
|
||||
</Group>
|
||||
|
|
|
|||
|
|
@ -12,11 +12,7 @@ interface OptionProps extends GroupProps {
|
|||
|
||||
export const Option = ({ children, ...props }: OptionProps) => {
|
||||
return (
|
||||
<Group
|
||||
classNames={{ root: styles.root }}
|
||||
grow
|
||||
{...props}
|
||||
>
|
||||
<Group classNames={{ root: styles.root }} grow {...props}>
|
||||
{children}
|
||||
</Group>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -16,20 +16,10 @@ export const Spinner = ({ ...props }: SpinnerProps) => {
|
|||
if (props.container) {
|
||||
return (
|
||||
<Center className={styles.container}>
|
||||
<SpinnerIcon
|
||||
className={styles.icon}
|
||||
color={props.color}
|
||||
size={props.size}
|
||||
/>
|
||||
<SpinnerIcon className={styles.icon} color={props.color} size={props.size} />
|
||||
</Center>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<SpinnerIcon
|
||||
className={styles.icon}
|
||||
color={props.color}
|
||||
size={props.size}
|
||||
/>
|
||||
);
|
||||
return <SpinnerIcon className={styles.icon} color={props.color} size={props.size} />;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue