@televet/kibble-ui 1.6.0 → 1.6.1-beta.2vtj6g7.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.
Files changed (52) hide show
  1. package/build/components/Avatar/avatar.component.d.ts +26 -0
  2. package/build/components/Avatar/avatar.config.d.ts +2 -0
  3. package/build/components/Avatar/avatar.types.d.ts +1 -0
  4. package/build/components/Avatar/index.d.ts +3 -0
  5. package/build/components/AvatarGroup/avatarGroup.component.d.ts +13 -0
  6. package/build/components/AvatarGroup/avatarGroup.utilities.d.ts +6 -0
  7. package/build/components/AvatarGroup/index.d.ts +1 -0
  8. package/build/components/Button/button.component.d.ts +13 -0
  9. package/build/components/Button/button.config.d.ts +16 -0
  10. package/build/components/Button/button.model.d.ts +5 -0
  11. package/build/components/Button/button.records.d.ts +2 -0
  12. package/build/components/Button/button.types.d.ts +8 -0
  13. package/build/components/Button/index.d.ts +3 -0
  14. package/build/components/Drawer/drawer.config.d.ts +13 -0
  15. package/build/components/Drawer/drawer.records.d.ts +13 -0
  16. package/build/components/Drawer/index.d.ts +1 -0
  17. package/build/components/Icon/icon.component.d.ts +8 -0
  18. package/build/components/Icon/icon.records.d.ts +3 -0
  19. package/build/components/Icon/icon.types.d.ts +3 -0
  20. package/build/components/Icon/index.d.ts +2 -0
  21. package/build/components/Logo/index.d.ts +2 -0
  22. package/build/components/Logo/logo.component.d.ts +14 -0
  23. package/build/components/Logo/logo.config.d.ts +6 -0
  24. package/build/components/Logo/logo.types.d.ts +3 -0
  25. package/build/components/Logo/logos.d.ts +22 -0
  26. package/build/components/Modal/index.d.ts +2 -0
  27. package/build/components/Modal/modal-section.component.d.ts +7 -0
  28. package/build/components/Modal/modal.component.d.ts +24 -0
  29. package/build/components/Modal/modal.types.d.ts +1 -0
  30. package/build/components/Textarea/index.d.ts +3 -0
  31. package/build/components/Textarea/textarea.component.d.ts +5 -0
  32. package/build/components/Textarea/textarea.config.d.ts +2 -0
  33. package/build/components/Textarea/textarea.types.d.ts +2 -0
  34. package/build/components/Tooltip/index.d.ts +3 -0
  35. package/build/components/Tooltip/tooltip.component.d.ts +8 -0
  36. package/build/components/Tooltip/tooltip.config.d.ts +8 -0
  37. package/build/components/Tooltip/tooltip.model.d.ts +4 -0
  38. package/build/components/Tooltip/tooltip.records.d.ts +9 -0
  39. package/build/components/Tooltip/tooltip.types.d.ts +4 -0
  40. package/build/components/Typography/Heading/heading.component.d.ts +2 -2
  41. package/build/components/Typography/Heading/heading.records.d.ts +2 -0
  42. package/build/components/Typography/Text/text.component.d.ts +2 -2
  43. package/build/components/Typography/Text/text.records.d.ts +2 -0
  44. package/build/hooks/useAdaptiveColorMap.d.ts +2 -2
  45. package/build/index.js +15 -17
  46. package/build/index.js.map +1 -1
  47. package/build/theme/theme.model.d.ts +37 -0
  48. package/build/theme/theme.record.d.ts +2 -0
  49. package/build/theme/tokens/colors/color.model.d.ts +64 -0
  50. package/build/theme/tokens/colors/color.type.d.ts +9 -0
  51. package/build/utils/stories.d.ts +2 -0
  52. 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,2 @@
1
+ import { ComponentStyleConfig } from '@chakra-ui/react';
2
+ export declare const AvatarConfig: ComponentStyleConfig;
@@ -0,0 +1 @@
1
+ export declare type AvatarSize = 'xs' | 'sm' | 'md' | 'lg';
@@ -0,0 +1,3 @@
1
+ export * from './avatar.component';
2
+ export * from './avatar.types';
3
+ export * from './avatar.config';
@@ -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,6 @@
1
+ export declare const avatarSizeMap: {
2
+ xs: string;
3
+ sm: string;
4
+ md: string;
5
+ lg: string;
6
+ };
@@ -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,5 @@
1
+ import { ButtonColorOptions } from './button.types';
2
+ import { AdaptiveColorMap } from '../../theme/tokens';
3
+ export interface ButtonVariantConfig extends AdaptiveColorMap<ButtonColorOptions> {
4
+ variant: 'solid' | 'outline' | 'ghost';
5
+ }
@@ -0,0 +1,2 @@
1
+ import { ButtonStyleConfig } from './button.types';
2
+ export declare const ButtonConfig: ButtonStyleConfig;
@@ -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,3 @@
1
+ export * from './button.component';
2
+ export * from './button.types';
3
+ export * from './button.config';
@@ -0,0 +1,13 @@
1
+ export declare const DrawerConfig: {
2
+ variants: {
3
+ alwaysOpen: {
4
+ parts: string[];
5
+ dialog: {
6
+ pointerEvents: string;
7
+ };
8
+ dialogContainer: {
9
+ pointerEvents: string;
10
+ };
11
+ };
12
+ };
13
+ };
@@ -0,0 +1,13 @@
1
+ export declare const DrawerConfig: {
2
+ variants: {
3
+ alwaysOpen: {
4
+ parts: string[];
5
+ dialog: {
6
+ pointerEvents: string;
7
+ };
8
+ dialogContainer: {
9
+ pointerEvents: string;
10
+ };
11
+ };
12
+ };
13
+ };
@@ -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
+ import { IconName, IconsSize } from './icon.types';
2
+ export declare const IconMap: Record<IconName, any>;
3
+ export declare const IconSizeMap: Record<IconsSize, number>;
@@ -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,2 @@
1
+ export * from './icon.component';
2
+ export * from './icon.types';
@@ -0,0 +1,2 @@
1
+ export * from './logo.component';
2
+ export * from './logo.types';
@@ -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,2 @@
1
+ export * from './modal.component';
2
+ export * from './modal.types';
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from 'react';
2
+ interface props {
3
+ children: ReactNode;
4
+ alignContent?: 'left' | 'right';
5
+ }
6
+ export declare const ModalSection: ({ children, alignContent }: props) => JSX.Element;
7
+ export {};
@@ -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,3 @@
1
+ export * from './textarea.component';
2
+ export * from './textarea.types';
3
+ export * from './textarea.config';
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { TextareaProps as CTextareaProps } from '@chakra-ui/react';
3
+ export interface TextareaProps extends CTextareaProps {
4
+ }
5
+ export declare const Textarea: (props: TextareaProps) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { ComponentStyleConfig } from '@chakra-ui/react';
2
+ export declare const TextareaConfig: ComponentStyleConfig;
@@ -0,0 +1,2 @@
1
+ export declare type TextareaSize = 'sm' | 'md' | 'lg';
2
+ export declare type TextareaResizeOrientation = 'horizontal' | 'vertical' | 'none';
@@ -0,0 +1,3 @@
1
+ export * from './tooltip.component';
2
+ export * from './tooltip.types';
3
+ export * from './tooltip.config';
@@ -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,8 @@
1
+ import { TooltipStyleConfig } from './tooltip.types';
2
+ export declare const TooltipGlobalStyle: {
3
+ '[id^=tooltip]': {
4
+ padding: string;
5
+ borderRadius: string;
6
+ };
7
+ };
8
+ export declare const TooltipConfig: TooltipStyleConfig;
@@ -0,0 +1,4 @@
1
+ import { AdaptiveColor } from '../../theme/tokens';
2
+ export interface TooltipStyleConfig {
3
+ color: AdaptiveColor;
4
+ }
@@ -0,0 +1,9 @@
1
+ import { TooltipStyleConfig } from './tooltip.model';
2
+ export declare const TooltipGlobalStyle: {
3
+ '[id^=tooltip]': {
4
+ padding: string;
5
+ borderRadius: string;
6
+ textTransform: string;
7
+ };
8
+ };
9
+ export declare const TooltipConfig: TooltipStyleConfig;
@@ -0,0 +1,4 @@
1
+ import { AdaptiveColor } from '../../theme/tokens';
2
+ export interface TooltipStyleConfig {
3
+ color: AdaptiveColor;
4
+ }
@@ -5,7 +5,7 @@ import { TextColor } from '../typography.types';
5
5
  export interface HeadingProps extends ChakraHeadingProps {
6
6
  children: ReactNode;
7
7
  size?: HeadingSize;
8
- color?: TextColor;
8
+ colorToken?: TextColor;
9
9
  darkMode?: boolean;
10
10
  }
11
- export declare const Heading: ({ children, size, color, darkMode, ...rest }: HeadingProps) => JSX.Element;
11
+ export declare const Heading: ({ children, size, color, colorToken, darkMode, ...rest }: HeadingProps) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { HeadingStyleConfig } from './heading.types';
2
+ export declare const HeadingConfig: HeadingStyleConfig;
@@ -6,7 +6,7 @@ export interface TextProps extends ChakraTextProps {
6
6
  children: ReactNode;
7
7
  as?: HTMLTagName;
8
8
  variant?: TextVariant;
9
- color?: TextColor;
9
+ colorToken?: TextColor;
10
10
  darkMode?: boolean;
11
11
  }
12
- export declare const Text: ({ children, variant, as, color, darkMode, ...rest }: TextProps) => JSX.Element;
12
+ export declare const Text: ({ children, variant, as, color, colorToken, darkMode, ...rest }: TextProps) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { ComponentStyleConfig } from '@chakra-ui/theme';
2
+ export declare const TextConfig: ComponentStyleConfig;
@@ -1,2 +1,2 @@
1
- import { AdaptiveColorMap } from '../theme/tokens/colors';
2
- export declare const useAdaptiveColorMap: <T extends string | number | symbol>(map: AdaptiveColorMap<T>, token: T) => string;
1
+ import { AdaptiveColorMap } from '../theme/tokens';
2
+ export declare const useAdaptiveColorMap: <T extends string | number | symbol>(map: AdaptiveColorMap<T>, token: T, darkMode?: boolean | undefined) => string;
package/build/index.js CHANGED
@@ -1464,9 +1464,7 @@ var IconSizeMap = {
1464
1464
  '2xl': 38,
1465
1465
  };
1466
1466
 
1467
- var useAdaptiveColorMap = function (map, token) {
1468
- return react.useColorModeValue(map.light[token], map.dark[token]);
1469
- };
1467
+ var useAdaptiveColorMap = function (map, token, darkMode) { return react.useColorModeValue(map[darkMode ? 'dark' : 'light'][token], map.dark[token]); };
1470
1468
 
1471
1469
  var Icon = React.forwardRef(function (_a, ref) {
1472
1470
  var name = _a.name, _b = _a.size, size = _b === void 0 ? 'lg' : _b, _c = _a.color, color = _c === void 0 ? 'currentColor' : _c;
@@ -5773,22 +5771,14 @@ var DrawerConfig = {
5773
5771
  },
5774
5772
  };
5775
5773
 
5776
- var withDarkMode = function (children, darkMode) {
5777
- return darkMode ? React__default["default"].createElement(react.DarkMode, null, children) : React__default["default"].createElement(React__default["default"].Fragment, null, children);
5778
- };
5779
-
5780
- var withTheme = function (children, theme) {
5781
- return theme ? React__default["default"].createElement(react.ChakraProvider, { theme: theme }, children) : React__default["default"].createElement(React__default["default"].Fragment, null, children);
5782
- };
5783
-
5784
5774
  var Heading = function (_a) {
5785
- var children = _a.children, _b = _a.size, size = _b === void 0 ? 'lg' : _b, _c = _a.color, color = _c === void 0 ? 'headline' : _c, darkMode = _a.darkMode, rest = __rest(_a, ["children", "size", "color", "darkMode"]);
5775
+ var children = _a.children, _b = _a.size, size = _b === void 0 ? 'lg' : _b, color = _a.color, _c = _a.colorToken, colorToken = _c === void 0 ? 'headline' : _c, darkMode = _a.darkMode, rest = __rest(_a, ["children", "size", "color", "colorToken", "darkMode"]);
5786
5776
  var _d = useTheme(), components = _d.components, colors = _d.colors;
5787
- var adaptiveColor = useAdaptiveColorMap(colors.text, color);
5777
+ var adaptiveColor = useAdaptiveColorMap(colors.text, colorToken, darkMode);
5788
5778
  var variant = react.useBreakpointValue({ base: 'small', md: 'large' }) || 'small';
5789
5779
  var sizes = components.Heading.variants[variant].sizes;
5790
5780
  var sizeProps = !sizes ? undefined : sizes[size];
5791
- return withDarkMode(React__default["default"].createElement(react.Heading, __assign({ variant: variant }, sizeProps, { color: adaptiveColor }, rest), children), !!darkMode);
5781
+ return (React__default["default"].createElement(react.Heading, __assign({ variant: variant }, sizeProps, { color: color || adaptiveColor }, rest), children));
5792
5782
  };
5793
5783
 
5794
5784
  var HeadingConfig = {
@@ -5885,10 +5875,10 @@ var HeadingConfig = {
5885
5875
  };
5886
5876
 
5887
5877
  var Text = function (_a) {
5888
- var children = _a.children, _b = _a.variant, variant = _b === void 0 ? 'regular' : _b, _c = _a.as, as = _c === void 0 ? 'span' : _c, _d = _a.color, color = _d === void 0 ? 'default' : _d, darkMode = _a.darkMode, rest = __rest(_a, ["children", "variant", "as", "color", "darkMode"]);
5878
+ var children = _a.children, _b = _a.variant, variant = _b === void 0 ? 'regular' : _b, _c = _a.as, as = _c === void 0 ? 'span' : _c, color = _a.color, _d = _a.colorToken, colorToken = _d === void 0 ? 'default' : _d, darkMode = _a.darkMode, rest = __rest(_a, ["children", "variant", "as", "color", "colorToken", "darkMode"]);
5889
5879
  var colors = useTheme().colors;
5890
- var adaptiveColor = useAdaptiveColorMap(colors.text, color);
5891
- return withDarkMode(React__default["default"].createElement(react.Text, __assign({ variant: variant, as: as, color: adaptiveColor }, rest), children), !!darkMode);
5880
+ var adaptiveColor = useAdaptiveColorMap(colors.text, colorToken, darkMode);
5881
+ return (React__default["default"].createElement(react.Text, __assign({ variant: variant, as: as, color: color || adaptiveColor }, rest), children));
5892
5882
  };
5893
5883
 
5894
5884
  var TextConfig = {
@@ -5989,6 +5979,14 @@ var KibbleThemeProvider = function (_a) {
5989
5979
  React__default["default"].createElement(styledComponents.ThemeProvider, { theme: theme }, children)));
5990
5980
  };
5991
5981
 
5982
+ var withDarkMode = function (children, darkMode) {
5983
+ return darkMode ? React__default["default"].createElement(react.DarkMode, null, children) : React__default["default"].createElement(React__default["default"].Fragment, null, children);
5984
+ };
5985
+
5986
+ var withTheme = function (children, theme) {
5987
+ return theme ? React__default["default"].createElement(react.ChakraProvider, { theme: theme }, children) : React__default["default"].createElement(React__default["default"].Fragment, null, children);
5988
+ };
5989
+
5992
5990
  Object.defineProperty(exports, 'Box', {
5993
5991
  enumerable: true,
5994
5992
  get: function () { return react.Box; }