@televet/kibble-ui 1.9.0 → 1.9.1-beta.2f7t8wk.1
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/components/Avatar/avatar.component.d.ts +26 -0
- package/build/components/Avatar/avatar.config.d.ts +2 -0
- package/build/components/Avatar/avatar.types.d.ts +1 -0
- package/build/components/Avatar/index.d.ts +3 -0
- package/build/components/AvatarGroup/avatarGroup.component.d.ts +13 -0
- package/build/components/AvatarGroup/avatarGroup.utilities.d.ts +6 -0
- package/build/components/AvatarGroup/index.d.ts +1 -0
- package/build/components/Button/button.component.d.ts +13 -0
- package/build/components/Button/button.config.d.ts +16 -0
- package/build/components/Button/button.model.d.ts +5 -0
- package/build/components/Button/button.records.d.ts +2 -0
- package/build/components/Button/button.types.d.ts +8 -0
- package/build/components/Button/index.d.ts +3 -0
- package/build/components/Drawer/drawer.config.d.ts +13 -0
- package/build/components/Drawer/drawer.records.d.ts +13 -0
- package/build/components/Drawer/index.d.ts +1 -0
- package/build/components/Icon/icon.component.d.ts +8 -0
- package/build/components/Icon/icon.records.d.ts +3 -0
- package/build/components/Icon/icon.types.d.ts +3 -0
- package/build/components/Icon/index.d.ts +2 -0
- package/build/components/Logo/index.d.ts +2 -0
- package/build/components/Logo/logo.component.d.ts +14 -0
- package/build/components/Logo/logo.config.d.ts +6 -0
- package/build/components/Logo/logo.types.d.ts +3 -0
- package/build/components/Logo/logos.d.ts +22 -0
- package/build/components/MediaAndIcons/AvatarGroup/avatarGroup.component.d.ts +12 -0
- package/build/components/MediaAndIcons/AvatarGroup/avatarGroup.utilities.d.ts +6 -0
- package/build/components/MediaAndIcons/AvatarGroup/index.d.ts +1 -0
- package/build/components/Modal/index.d.ts +2 -0
- package/build/components/Modal/modal-section.component.d.ts +7 -0
- package/build/components/Modal/modal.component.d.ts +24 -0
- package/build/components/Modal/modal.types.d.ts +1 -0
- package/build/components/Overlay/Modal/index.d.ts +7 -0
- package/build/components/Overlay/Modal/modal.component.d.ts +18 -0
- package/build/components/Overlay/Modal/modal.types.d.ts +1 -0
- package/build/components/Overlay/Modal/modalBody.component.d.ts +2 -0
- package/build/components/Overlay/Modal/modalCloseButton.component.d.ts +2 -0
- package/build/components/Overlay/Modal/modalFooter.component.d.ts +4 -0
- package/build/components/Overlay/Modal/modalFooterButtons.component.d.ts +10 -0
- package/build/components/Overlay/Modal/modalHeader.component.d.ts +6 -0
- package/build/components/Overlay/index.d.ts +1 -0
- package/build/components/Textarea/index.d.ts +3 -0
- package/build/components/Textarea/textarea.component.d.ts +5 -0
- package/build/components/Textarea/textarea.config.d.ts +2 -0
- package/build/components/Textarea/textarea.types.d.ts +2 -0
- package/build/components/Tooltip/index.d.ts +3 -0
- package/build/components/Tooltip/tooltip.component.d.ts +8 -0
- package/build/components/Tooltip/tooltip.config.d.ts +8 -0
- package/build/components/Tooltip/tooltip.model.d.ts +4 -0
- package/build/components/Tooltip/tooltip.records.d.ts +9 -0
- package/build/components/Tooltip/tooltip.types.d.ts +4 -0
- package/build/components/Typography/Heading/heading.records.d.ts +2 -0
- package/build/components/Typography/Text/text.records.d.ts +2 -0
- package/build/components/hocs/index.d.ts +1 -0
- package/build/components/hocs/withDarkMode.d.ts +2 -0
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/useDisclosure.d.ts +1 -0
- package/build/index.js +73 -1
- package/build/index.js.map +1 -1
- package/build/providers/ThemeProvider/index.d.ts +4 -0
- package/build/providers/index.d.ts +1 -0
- package/build/theme/theme.model.d.ts +37 -0
- package/build/theme/theme.record.d.ts +2 -0
- package/build/theme/tokens/blur.d.ts +3 -11
- package/build/theme/tokens/colors/color.model.d.ts +64 -0
- package/build/theme/tokens/colors/color.type.d.ts +9 -0
- package/build/theme/tokens/fontWeights.d.ts +1 -1
- package/build/theme/tokens/shadows.d.ts +14 -0
- package/package.json +1 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AvatarProps as CAvatarProps, Placement } from '@chakra-ui/react';
|
|
2
|
+
import { CSSProperties } from 'react';
|
|
3
|
+
import { AvatarSize } from './avatar.types';
|
|
4
|
+
export declare enum AvatarVariant {
|
|
5
|
+
Green = "green",
|
|
6
|
+
Red = "red",
|
|
7
|
+
Blue = "blue",
|
|
8
|
+
Comet = "comet",
|
|
9
|
+
Number = "number",
|
|
10
|
+
Dashed = "dashed",
|
|
11
|
+
Image = "image"
|
|
12
|
+
}
|
|
13
|
+
export interface AvatarProps extends CAvatarProps {
|
|
14
|
+
name: string;
|
|
15
|
+
size?: AvatarSize;
|
|
16
|
+
isClinic?: boolean;
|
|
17
|
+
showTooltip?: boolean;
|
|
18
|
+
tooltipPlacement?: Placement;
|
|
19
|
+
style?: CSSProperties;
|
|
20
|
+
handleClick?: () => void;
|
|
21
|
+
showRemoveButton?: boolean;
|
|
22
|
+
handleRemoveButtonClick?: () => void;
|
|
23
|
+
variant?: AvatarVariant;
|
|
24
|
+
tooltipText?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const Avatar: ({ name, src, isClinic, size, showTooltip, tooltipPlacement, style, handleClick, showRemoveButton, handleRemoveButtonClick, variant, tooltipText, ...rest }: AvatarProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type AvatarSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AvatarProps, AvatarSize } from 'components/Avatar';
|
|
3
|
+
export interface AvatarGroupProps {
|
|
4
|
+
avatars: AvatarProps[];
|
|
5
|
+
max?: number;
|
|
6
|
+
size?: AvatarSize;
|
|
7
|
+
handleAddButtonClick?: () => void;
|
|
8
|
+
showAddButton?: boolean;
|
|
9
|
+
addButtonTooltipText?: string;
|
|
10
|
+
showRemoveAvatarButton?: boolean;
|
|
11
|
+
handleRemoveButtonClick?: () => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const AvatarGroup: ({ avatars, max, size, handleAddButtonClick, showAddButton, addButtonTooltipText, showRemoveAvatarButton, handleRemoveButtonClick, }: AvatarGroupProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './avatarGroup.component';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { ButtonProps as ChakraButtonProps } from '@chakra-ui/react';
|
|
3
|
+
import { IconName } from '../Icon';
|
|
4
|
+
import { ButtonSizeType, ButtonVariantType } from './button.types';
|
|
5
|
+
export interface ButtonProps extends ChakraButtonProps {
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
variant?: ButtonVariantType;
|
|
8
|
+
size?: ButtonSizeType;
|
|
9
|
+
iconName?: IconName;
|
|
10
|
+
iconPosition?: 'left' | 'right';
|
|
11
|
+
darkMode?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ButtonStyleType } from './button.types';
|
|
2
|
+
export declare const ButtonVariantConfig: ButtonStyleType;
|
|
3
|
+
export declare const ButtonSizeConfig: {
|
|
4
|
+
lg: {
|
|
5
|
+
p: string;
|
|
6
|
+
};
|
|
7
|
+
md: {
|
|
8
|
+
p: string;
|
|
9
|
+
};
|
|
10
|
+
sm: {
|
|
11
|
+
p: string;
|
|
12
|
+
};
|
|
13
|
+
xs: {
|
|
14
|
+
p: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AdaptiveColorMap } from '../../theme/tokens';
|
|
2
|
+
export interface ButtonVariantConfigType extends AdaptiveColorMap<ButtonColorOptionsType> {
|
|
3
|
+
variant: 'solid' | 'outline' | 'ghost';
|
|
4
|
+
}
|
|
5
|
+
export declare type ButtonVariantType = 'primary' | 'primaryDestructive' | 'secondary' | 'secondaryDestructive' | 'secondarySubtle' | 'secondarySubtleDestructive' | 'tertiary' | 'tertiaryDestructive' | 'ghost' | 'ghostNeutral' | 'ghostDestructive';
|
|
6
|
+
export declare type ButtonColorOptionsType = 'content' | 'default' | 'hover' | 'active' | 'border';
|
|
7
|
+
export declare type ButtonSizeType = 'xs' | 'sm' | 'md' | 'lg';
|
|
8
|
+
export declare type ButtonStyleType = Record<ButtonVariantType, ButtonVariantConfigType>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './drawer.config';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconColor, IconName, IconsSize } from './icon.types';
|
|
3
|
+
export interface IconProps {
|
|
4
|
+
name: IconName;
|
|
5
|
+
size?: IconsSize;
|
|
6
|
+
color?: IconColor;
|
|
7
|
+
}
|
|
8
|
+
export declare const Icon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<any>>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare type IconName = 'alertCircle' | 'animalBird' | 'animalCat' | 'animalCow' | 'animalDog' | 'animalHorse' | 'arrowCircle' | 'arrowDown' | 'arrowDownRight' | 'arrowLeft' | 'arrowRight' | 'arrowUp' | 'arrowsIn' | 'arrowsOut' | 'article' | 'asterisk' | 'bell' | 'bellRinging' | 'bookmarkFilled' | 'bookmarkOutlined' | 'brush' | 'bulkSelect' | 'caduceus' | 'calendarDate' | 'calendarCheck' | 'calendarInfo' | 'calendarPen' | 'calendarOutlined' | 'camera' | 'cameraFlip' | 'cameraOff' | 'cancel' | 'cellphone' | 'cellphoneAlert' | 'chainLink' | 'chatBubbleFilled' | 'chatBubbleOutlined' | 'checkmark' | 'checkmarkBox' | 'checkmarkCircle' | 'checkmarkList' | 'chevronDown' | 'chevronLeft' | 'chevronRight' | 'chevronUp' | 'chevronUpDown' | 'circleDotted' | 'clock' | 'close' | 'closeCircle' | 'code' | 'conversation' | 'creditCardHand' | 'crossClipboard' | 'crossPaw' | 'crossHatPerson' | 'dogHouse' | 'dogHouseOutlined' | 'dollar' | 'dollarCircle' | 'dotsCircle' | 'dotsHorizontal' | 'dotsVertical' | 'doubleArrowCircle' | 'download' | 'dragDrop' | 'emailSend' | 'envelopeFilled' | 'envelopeOutlined' | 'eyedropper' | 'eyeOpen' | 'eyeSlash' | 'externalLink' | 'faceScreen' | 'formsFilled' | 'formsOutlined' | 'funnelFilled' | 'funnelOutlined' | 'gear' | 'grid' | 'horizontalLines' | 'house' | 'infoCircleFilled' | 'infoCircleOutlined' | 'input' | 'invoice' | 'invoiceOutlined' | 'kanbanBoard' | 'largeTextInput' | 'list' | 'locationMarker' | 'locationMarkerGround' | 'lockRectangle' | 'lockRound' | 'loudspeaker' | 'magnifyingGlass' | 'mailbox' | 'manHeadset' | 'message' | 'messages' | 'messageClipboard' | 'messageEllipses' | 'messageGear' | 'messageLink' | 'microphone' | 'microphoneMute' | 'minus' | 'moveLeft' | 'moveRight' | 'multipleChoice' | 'notification' | 'paperAirplane' | 'paperAirplane2' | 'paperAirplaneRight' | 'paperclip' | 'paperPen' | 'paw' | 'paw2' | 'pawMagnifyingGlass' | 'pawOutlined' | 'pdfLogo' | 'pen' | 'penSquare' | 'person' | 'personAdd' | 'phone' | 'phoneButtons' | 'phoneDown' | 'phoneRing' | 'pill' | 'pillHand' | 'playingCards' | 'plus' | 'questionMark' | 'questionMarkCircle' | 'quilInk' | 'reactLogo' | 'record' | 'report' | 'robot' | 'smileyFace' | 'smileyFacePlus' | 'star' | 'star2' | 'star2Outlined' | 'starCircle' | 'team' | 'textEdit' | 'thumbsUp' | 'trashcan' | 'twoSquares' | 'upload' | 'videoCamera' | 'warningSign' | 'website';
|
|
2
|
+
export declare type IconsSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
3
|
+
export declare type IconColor = 'default' | 'subtle' | 'inactive' | 'active' | 'success' | 'warning' | 'error' | 'currentColor';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { LogoHoliday, LogoType, LogoColor } from './logo.types';
|
|
3
|
+
export interface ILogoProps {
|
|
4
|
+
type?: LogoType;
|
|
5
|
+
color?: LogoColor;
|
|
6
|
+
holiday?: LogoHoliday;
|
|
7
|
+
height?: number;
|
|
8
|
+
width?: number;
|
|
9
|
+
handleClick?: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const Logo: {
|
|
12
|
+
({ type, color, holiday, height, width, handleClick, }: ILogoProps): JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Props } from 'framer-motion/types/types';
|
|
3
|
+
import { LogoColor, LogoHoliday } from './logo.types';
|
|
4
|
+
export declare const holidaysLogoIconMap: Record<LogoHoliday, React.FC<Props>>;
|
|
5
|
+
export declare const logoIconMap: Record<LogoColor, React.FC<Props>>;
|
|
6
|
+
export declare const fullLogoMap: Record<LogoColor, React.FC<Props>>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare type LogoHoliday = 'newYears' | 'valentines' | 'stPatricks' | 'easter1' | 'easter2' | 'easter3' | 'easter4' | 'easter5' | 'easter6' | 'mothersDay' | 'memorialDay' | 'fathersDay' | 'halloween' | 'thanksgiving' | 'christmas';
|
|
2
|
+
export declare type LogoType = 'full' | 'icon';
|
|
3
|
+
export declare type LogoColor = 'teal' | 'black' | 'white';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ReactComponent as TealLogo } from '../../assets/logos/teal.svg';
|
|
2
|
+
import { ReactComponent as TealLogoIcon } from '../../assets/logos/tealIcon.svg';
|
|
3
|
+
import { ReactComponent as BlackLogo } from '../../assets/logos/black.svg';
|
|
4
|
+
import { ReactComponent as BlackLogoIcon } from '../../assets/logos/blackIcon.svg';
|
|
5
|
+
import { ReactComponent as WhiteLogo } from '../../assets/logos/white.svg';
|
|
6
|
+
import { ReactComponent as WhiteLogoIcon } from '../../assets/logos/whiteIcon.svg';
|
|
7
|
+
import { ReactComponent as NewYearsLogoIcon } from '../../assets/logos/holidays/newYears.svg';
|
|
8
|
+
import { ReactComponent as ValentinesLogoIcon } from '../../assets/logos/holidays/valentines.svg';
|
|
9
|
+
import { ReactComponent as StPatricksLogoIcon } from '../../assets/logos/holidays/stPatricks.svg';
|
|
10
|
+
import { ReactComponent as Easter1LogoIcon } from '../../assets/logos/holidays/easter1.svg';
|
|
11
|
+
import { ReactComponent as Easter2LogoIcon } from '../../assets/logos/holidays/easter2.svg';
|
|
12
|
+
import { ReactComponent as Easter3LogoIcon } from '../../assets/logos/holidays/easter3.svg';
|
|
13
|
+
import { ReactComponent as Easter4LogoIcon } from '../../assets/logos/holidays/easter4.svg';
|
|
14
|
+
import { ReactComponent as Easter5LogoIcon } from '../../assets/logos/holidays/easter5.svg';
|
|
15
|
+
import { ReactComponent as Easter6LogoIcon } from '../../assets/logos/holidays/easter6.svg';
|
|
16
|
+
import { ReactComponent as MothersDayLogoIcon } from '../../assets/logos/holidays/mothersDay.svg';
|
|
17
|
+
import { ReactComponent as MemorialDayLogoIcon } from '../../assets/logos/holidays/memorialDay.svg';
|
|
18
|
+
import { ReactComponent as FathersDayLogoIcon } from '../../assets/logos/holidays/fathersDay.svg';
|
|
19
|
+
import { ReactComponent as HalloweenLogoIcon } from '../../assets/logos/holidays/halloween.svg';
|
|
20
|
+
import { ReactComponent as ThanksgivingLogoIcon } from '../../assets/logos/holidays/thanksgiving.svg';
|
|
21
|
+
import { ReactComponent as ChristmasLogoIcon } from '../../assets/logos/holidays/christmas.svg';
|
|
22
|
+
export { TealLogo, TealLogoIcon, BlackLogo, BlackLogoIcon, WhiteLogo, WhiteLogoIcon, NewYearsLogoIcon, ValentinesLogoIcon, StPatricksLogoIcon, Easter1LogoIcon, Easter2LogoIcon, Easter3LogoIcon, Easter4LogoIcon, Easter5LogoIcon, Easter6LogoIcon, MothersDayLogoIcon, MemorialDayLogoIcon, FathersDayLogoIcon, HalloweenLogoIcon, ThanksgivingLogoIcon, ChristmasLogoIcon, };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AvatarProps, AvatarSize } from 'components/MediaAndIcons/Avatar';
|
|
2
|
+
export interface AvatarGroupProps {
|
|
3
|
+
avatars: AvatarProps[];
|
|
4
|
+
max?: number;
|
|
5
|
+
size?: AvatarSize;
|
|
6
|
+
handleAddButtonClick?: () => void;
|
|
7
|
+
showAddButton?: boolean;
|
|
8
|
+
addButtonTooltipText?: string;
|
|
9
|
+
showRemoveAvatarButton?: boolean;
|
|
10
|
+
handleRemoveButtonClick?: () => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const AvatarGroup: ({ avatars, max, size, handleAddButtonClick, showAddButton, addButtonTooltipText, showRemoveAvatarButton, handleRemoveButtonClick, }: AvatarGroupProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './avatarGroup.component';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { ModalProps as ChakraModalProps } from '@chakra-ui/react';
|
|
3
|
+
import { BlurAmount } from '../../theme/tokens';
|
|
4
|
+
import { FocusableElement } from '@chakra-ui/utils';
|
|
5
|
+
import { ModalSize } from './modal.types';
|
|
6
|
+
declare type ResponsiveBreakpoints = 'base' | 'md';
|
|
7
|
+
export interface ModalProps extends ChakraModalProps {
|
|
8
|
+
title?: string;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
footer?: ReactNode;
|
|
11
|
+
isOpen: boolean;
|
|
12
|
+
onClose: () => void;
|
|
13
|
+
modalSize?: Partial<Record<ResponsiveBreakpoints, ModalSize>>;
|
|
14
|
+
allowEscape?: boolean;
|
|
15
|
+
useDefaultCloseButton?: boolean;
|
|
16
|
+
overlayBlur?: BlurAmount;
|
|
17
|
+
overlayHueShift?: number;
|
|
18
|
+
overlayBase?: 'whiteAlpha' | 'blackAlpha';
|
|
19
|
+
darkMode?: boolean;
|
|
20
|
+
initialFocusRef: React.RefObject<FocusableElement>;
|
|
21
|
+
scrollBehavior?: 'inside' | 'outside';
|
|
22
|
+
}
|
|
23
|
+
export declare const Modal: ({ title, children, footer, isOpen, onClose, modalSize, overlayBlur, allowEscape, useDefaultCloseButton, initialFocusRef, scrollBehavior, overlayHueShift, overlayBase, darkMode, ...rest }: ModalProps) => JSX.Element;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type ModalSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | 'full';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './modal.types';
|
|
2
|
+
export * as BetaModal from './modal.component';
|
|
3
|
+
export * from './modalHeader.component';
|
|
4
|
+
export * from './modalCloseButton.component';
|
|
5
|
+
export * from './modalBody.component';
|
|
6
|
+
export * from './modalFooter.component';
|
|
7
|
+
export * from './modalFooterButtons.component';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { ModalProps as ChakraModalProps } from '@chakra-ui/react';
|
|
3
|
+
import { FocusableElement } from '@chakra-ui/utils';
|
|
4
|
+
import { ModalSize } from './modal.types';
|
|
5
|
+
declare type ResponsiveBreakpoints = 'base' | 'md';
|
|
6
|
+
export interface ModalProps extends ChakraModalProps {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
isCentered?: boolean;
|
|
9
|
+
responsiveModalSizes?: Partial<Record<ResponsiveBreakpoints, ModalSize>>;
|
|
10
|
+
allowEscape?: boolean;
|
|
11
|
+
useFullScreenMobile?: boolean;
|
|
12
|
+
darkMode?: boolean;
|
|
13
|
+
initialFocusRef?: React.RefObject<FocusableElement>;
|
|
14
|
+
scrollBehavior?: 'inside' | 'outside';
|
|
15
|
+
size?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const Modal: ({ children, isOpen, onClose, isCentered, responsiveModalSizes, allowEscape, useFullScreenMobile, initialFocusRef, scrollBehavior, darkMode, size, ...rest }: ModalProps) => JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type ModalSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | 'full';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ModalFooterProps as ChakraModalFooterProps } from '@chakra-ui/react';
|
|
2
|
+
export interface ModalFooterButtonProps extends ChakraModalFooterProps {
|
|
3
|
+
submitText?: string;
|
|
4
|
+
isLoading?: boolean;
|
|
5
|
+
isDestructive?: boolean;
|
|
6
|
+
onSubmit?: () => void;
|
|
7
|
+
allowCancel?: boolean;
|
|
8
|
+
onCancel?: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const ModalFooterButtons: ({ submitText, isLoading, isDestructive, children, onSubmit, allowCancel, onCancel, ...rest }: ModalFooterButtonProps) => JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ModalHeaderProps as ChakraModalHeaderProps } from '@chakra-ui/react';
|
|
2
|
+
import { HeadingSize } from '../../Typography';
|
|
3
|
+
export interface ModalHeaderProps extends ChakraModalHeaderProps {
|
|
4
|
+
size?: HeadingSize;
|
|
5
|
+
}
|
|
6
|
+
export declare const ModalHeader: ({ size, children, ...rest }: ModalHeaderProps) => JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PlacementWithLogical, TooltipProps as ChakraTooltipProps } from '@chakra-ui/react';
|
|
3
|
+
export interface TooltipProps extends ChakraTooltipProps {
|
|
4
|
+
label: string;
|
|
5
|
+
placement?: PlacementWithLogical;
|
|
6
|
+
titleCaseLabel?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const Tooltip: ({ children, label, openDelay, placement, titleCaseLabel, ...rest }: TooltipProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './withDarkMode';
|
package/build/hooks/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useDisclosure } from '@chakra-ui/react';
|
package/build/index.js
CHANGED
|
@@ -115,7 +115,7 @@ var Tag = function (_a) {
|
|
|
115
115
|
};
|
|
116
116
|
|
|
117
117
|
var blur = {
|
|
118
|
-
none: 0,
|
|
118
|
+
none: '0',
|
|
119
119
|
sm: '4px',
|
|
120
120
|
base: '8px',
|
|
121
121
|
md: '12px',
|
|
@@ -6582,6 +6582,68 @@ var BetaMenu = function (_a) {
|
|
|
6582
6582
|
React__default["default"].createElement(MenuList, __assign({}, listConfig, { menuItems: menuItems })))));
|
|
6583
6583
|
};
|
|
6584
6584
|
|
|
6585
|
+
var withDarkMode$1 = function (children, darkMode) {
|
|
6586
|
+
return darkMode ? React__default["default"].createElement(react.DarkMode, null, children) : React__default["default"].createElement(React__default["default"].Fragment, null, children);
|
|
6587
|
+
};
|
|
6588
|
+
|
|
6589
|
+
var Modal = function (_a) {
|
|
6590
|
+
var children = _a.children, isOpen = _a.isOpen, onClose = _a.onClose, _b = _a.isCentered, isCentered = _b === void 0 ? true : _b; _a.responsiveModalSizes; var _c = _a.allowEscape, allowEscape = _c === void 0 ? true : _c, _d = _a.useFullScreenMobile, useFullScreenMobile = _d === void 0 ? true : _d, initialFocusRef = _a.initialFocusRef, scrollBehavior = _a.scrollBehavior, darkMode = _a.darkMode, _e = _a.size, size = _e === void 0 ? 'xl' : _e, rest = __rest(_a, ["children", "isOpen", "onClose", "isCentered", "responsiveModalSizes", "allowEscape", "useFullScreenMobile", "initialFocusRef", "scrollBehavior", "darkMode", "size"]);
|
|
6591
|
+
var _f = useTheme(), colors = _f.colors, radii = _f.radii;
|
|
6592
|
+
var adaptiveBackgroundColor = useAdaptiveColor(colors.background);
|
|
6593
|
+
var backgroundColor = !darkMode ? adaptiveBackgroundColor : colors.background.dark;
|
|
6594
|
+
// Responsive values for full screen modals on phones.
|
|
6595
|
+
var fullScreenMobileSize = react.useBreakpointValue({ base: 'full', md: size });
|
|
6596
|
+
var fullScreenMobileBorderRadius = react.useBreakpointValue({ base: 0, md: radii.xl });
|
|
6597
|
+
var fullScreenMobileContentMargin = react.useBreakpointValue({ base: 0, md: 16 });
|
|
6598
|
+
var Modal = (React__default["default"].createElement(react.Modal, __assign({ closeOnEsc: allowEscape, closeOnOverlayClick: allowEscape, autoFocus: !!initialFocusRef, isOpen: isOpen, onClose: onClose, scrollBehavior: scrollBehavior, isCentered: isCentered, size: useFullScreenMobile ? fullScreenMobileSize : size, motionPreset: "slideInBottom" }, rest),
|
|
6599
|
+
React__default["default"].createElement(react.ModalOverlay, null),
|
|
6600
|
+
React__default["default"].createElement(react.ModalContent, { backgroundColor: backgroundColor, m: useFullScreenMobile ? fullScreenMobileContentMargin : 16, borderRadius: useFullScreenMobile ? fullScreenMobileBorderRadius : radii.xl }, children)));
|
|
6601
|
+
return withDarkMode$1(Modal, !!darkMode);
|
|
6602
|
+
};
|
|
6603
|
+
|
|
6604
|
+
var modal_component = /*#__PURE__*/Object.freeze({
|
|
6605
|
+
__proto__: null,
|
|
6606
|
+
Modal: Modal
|
|
6607
|
+
});
|
|
6608
|
+
|
|
6609
|
+
var ModalHeader = function (_a) {
|
|
6610
|
+
var _b = _a.size, size = _b === void 0 ? 'md' : _b, children = _a.children, rest = __rest(_a, ["size", "children"]);
|
|
6611
|
+
return (React__default["default"].createElement(react.ModalHeader, __assign({ px: 6, pt: 6, pb: 2 }, rest),
|
|
6612
|
+
React__default["default"].createElement(Heading, { size: size }, children)));
|
|
6613
|
+
};
|
|
6614
|
+
|
|
6615
|
+
var ModalCloseButton = function (_a) {
|
|
6616
|
+
var _b = _a.right, right = _b === void 0 ? 2 : _b, _c = _a.left, left = _c === void 0 ? 2 : _c, _d = _a.size, size = _d === void 0 ? 'md' : _d, rest = __rest(_a, ["right", "left", "size"]);
|
|
6617
|
+
var onClose = react.useModalContext().onClose;
|
|
6618
|
+
return (React__default["default"].createElement(Button, __assign({ variant: "ghostNeutral", onClick: onClose, iconName: "close", position: "absolute", right: right, top: left, size: size }, rest)));
|
|
6619
|
+
};
|
|
6620
|
+
|
|
6621
|
+
var ModalBody = function (_a) {
|
|
6622
|
+
var children = _a.children, rest = __rest(_a, ["children"]);
|
|
6623
|
+
return (React__default["default"].createElement(react.ModalBody, __assign({ py: 1 }, rest), children));
|
|
6624
|
+
};
|
|
6625
|
+
|
|
6626
|
+
var ModalFooter = function (_a) {
|
|
6627
|
+
var children = _a.children, rest = __rest(_a, ["children"]);
|
|
6628
|
+
return (React__default["default"].createElement(react.ModalFooter, __assign({ pb: 6 }, rest), children));
|
|
6629
|
+
};
|
|
6630
|
+
|
|
6631
|
+
var ModalFooterButtons = function (_a) {
|
|
6632
|
+
var _b = _a.submitText, submitText = _b === void 0 ? 'Submit' : _b, isLoading = _a.isLoading, isDestructive = _a.isDestructive; _a.children; var onSubmit = _a.onSubmit, _c = _a.allowCancel, allowCancel = _c === void 0 ? true : _c, onCancel = _a.onCancel, rest = __rest(_a, ["submitText", "isLoading", "isDestructive", "children", "onSubmit", "allowCancel", "onCancel"]);
|
|
6633
|
+
var onClose = react.useModalContext().onClose;
|
|
6634
|
+
var handleCancel = function () {
|
|
6635
|
+
if (onCancel) {
|
|
6636
|
+
onCancel();
|
|
6637
|
+
}
|
|
6638
|
+
onClose();
|
|
6639
|
+
};
|
|
6640
|
+
return (React__default["default"].createElement(react.ModalFooter, __assign({}, rest, { pb: 6 }),
|
|
6641
|
+
React__default["default"].createElement(react.Flex, { w: "100%" },
|
|
6642
|
+
allowCancel && (React__default["default"].createElement(Button, { variant: "tertiary", onClick: handleCancel }, "Cancel")),
|
|
6643
|
+
React__default["default"].createElement(react.Spacer, null),
|
|
6644
|
+
React__default["default"].createElement(Button, { onClick: onSubmit, isLoading: isLoading, variant: isDestructive ? 'primaryDestructive' : 'primary' }, submitText))));
|
|
6645
|
+
};
|
|
6646
|
+
|
|
6585
6647
|
// @ts-ignore
|
|
6586
6648
|
var theme = react.extendTheme({
|
|
6587
6649
|
styles: {
|
|
@@ -9400,6 +9462,10 @@ Object.defineProperty(exports, 'WrapItem', {
|
|
|
9400
9462
|
enumerable: true,
|
|
9401
9463
|
get: function () { return react.WrapItem; }
|
|
9402
9464
|
});
|
|
9465
|
+
Object.defineProperty(exports, 'useDisclosure', {
|
|
9466
|
+
enumerable: true,
|
|
9467
|
+
get: function () { return react.useDisclosure; }
|
|
9468
|
+
});
|
|
9403
9469
|
Object.defineProperty(exports, 'useRadioGroup', {
|
|
9404
9470
|
enumerable: true,
|
|
9405
9471
|
get: function () { return react.useRadioGroup; }
|
|
@@ -9412,6 +9478,7 @@ exports.Avatar = Avatar;
|
|
|
9412
9478
|
exports.AvatarConfig = AvatarConfig;
|
|
9413
9479
|
exports.AvatarGroup = AvatarGroup;
|
|
9414
9480
|
exports.BetaMenu = BetaMenu;
|
|
9481
|
+
exports.BetaModal = modal_component;
|
|
9415
9482
|
exports.Button = Button;
|
|
9416
9483
|
exports.ButtonSizeConfig = ButtonSizeConfig;
|
|
9417
9484
|
exports.ButtonVariantConfig = ButtonVariantConfig;
|
|
@@ -9424,6 +9491,11 @@ exports.Logo = Logo;
|
|
|
9424
9491
|
exports.MenuConfig = MenuConfig;
|
|
9425
9492
|
exports.MenuContext = MenuContext;
|
|
9426
9493
|
exports.MenuItemConfig = MenuItemConfig;
|
|
9494
|
+
exports.ModalBody = ModalBody;
|
|
9495
|
+
exports.ModalCloseButton = ModalCloseButton;
|
|
9496
|
+
exports.ModalFooter = ModalFooter;
|
|
9497
|
+
exports.ModalFooterButtons = ModalFooterButtons;
|
|
9498
|
+
exports.ModalHeader = ModalHeader;
|
|
9427
9499
|
exports.NotificationCounter = NotificationCounter;
|
|
9428
9500
|
exports.Radio = Radio;
|
|
9429
9501
|
exports.RadioConfig = RadioConfig;
|