UNPKG

@helpwave/hightide

Version:

helpwave's component and theming library

1 lines 46.7 kB
{"version":3,"sources":["../../../src/components/layout-and-navigation/Carousel.tsx","../../../src/util/array.ts","../../../src/util/math.ts","../../../src/util/easeFunctions.ts","../../../src/util/loopingArray.ts","../../../src/components/user-action/Button.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport clsx from 'clsx'\nimport { ChevronLeft, ChevronRight } from 'lucide-react'\nimport { createLoopingListWithIndex, range } from '../../util/array'\nimport { clamp } from '../../util/math'\nimport { EaseFunctions } from '../../util/easeFunctions'\nimport type { Direction } from '../../util/loopingArray'\nimport { LoopingArrayCalculator } from '../../util/loopingArray'\nimport { IconButton } from '../user-action/Button'\n\n\nexport type CarouselProps = {\n children: ReactNode[],\n animationTime?: number,\n isLooping?: boolean,\n isAutoLooping?: boolean,\n autoLoopingTimeOut?: number,\n autoLoopAnimationTime?: number,\n hintNext?: boolean,\n arrows?: boolean,\n dots?: boolean,\n /**\n * Percentage that is allowed to be scrolled further\n */\n overScrollThreshold?: number,\n blurColor?: string,\n className?: string,\n heightClassName?: string,\n widthClassName?: string,\n}\n\ntype ItemType = {\n item: ReactNode,\n index: number,\n}\n\ntype CarouselAnimationState = {\n targetPosition: number,\n /**\n * Value of either 1 or -1, 1 is forwards -1 is backwards\n */\n direction: Direction,\n startPosition: number,\n startTime?: number,\n lastUpdateTime?: number,\n isAutoLooping: boolean,\n}\n\ntype DragState = {\n startX: number,\n startTime: number,\n lastX: number,\n startIndex: number,\n}\n\ntype CarouselInformation = {\n currentPosition: number,\n dragState?: DragState,\n animationState?: CarouselAnimationState,\n}\n\nexport const Carousel = ({\n children,\n animationTime = 200,\n isLooping = false,\n isAutoLooping = false,\n autoLoopingTimeOut = 5000,\n autoLoopAnimationTime = 500,\n hintNext = false,\n arrows = false,\n dots = true,\n overScrollThreshold = 0.1,\n blurColor = 'from-background',\n className = '',\n heightClassName = 'h-96',\n widthClassName = 'w-[70%] desktop:w-1/2',\n }: CarouselProps) => {\n if (isAutoLooping && !isLooping) {\n console.error('When isAutoLooping is true, isLooping should also be true')\n isLooping = true\n }\n\n const [{\n currentPosition,\n dragState,\n animationState,\n }, setCarouselInformation] = useState<CarouselInformation>({\n currentPosition: 0,\n })\n const animationId = useRef<number | undefined>(undefined)\n const timeOut = useRef<NodeJS.Timeout | undefined>(undefined)\n autoLoopingTimeOut = Math.max(0, autoLoopingTimeOut)\n\n const length = children.length\n const paddingItemCount = 3 // The number of items to append left and right of the list to allow for clean transition when looping\n\n const util = useMemo(() => new LoopingArrayCalculator(length, isLooping, overScrollThreshold), [length, isLooping, overScrollThreshold])\n const currentIndex = util.getCorrectedPosition(LoopingArrayCalculator.withoutOffset(currentPosition))\n animationTime = Math.max(200, animationTime) // in ms, must be > 0\n autoLoopAnimationTime = Math.max(200, autoLoopAnimationTime)\n\n const getStyleOffset = (index: number) => {\n const baseOffset = -50 + (index - currentPosition) * 100\n return `${baseOffset}%`\n }\n\n const animation = useCallback((time: number) => {\n let keepAnimating: boolean = true\n\n // Other calculation in the setState call to avoid updating the useCallback to often\n setCarouselInformation((state) => {\n const {\n animationState,\n dragState\n } = state\n if (animationState === undefined || dragState !== undefined) {\n keepAnimating = false\n return state\n }\n if (!animationState.startTime || !animationState.lastUpdateTime) {\n return {\n ...state,\n animationState: {\n ...animationState,\n startTime: time,\n lastUpdateTime: time\n }\n }\n }\n const useAnimationTime = animationState.isAutoLooping ? autoLoopAnimationTime : animationTime\n const progress = clamp((time - animationState.startTime) / useAnimationTime) // progress\n const easedProgress = EaseFunctions.easeInEaseOut(progress)\n const distance = util.getDistanceDirectional(animationState.startPosition, animationState.targetPosition, animationState.direction)\n const newPosition = util.getCorrectedPosition(easedProgress * distance * animationState.direction + animationState.startPosition)\n\n if (animationState.targetPosition === newPosition || progress === 1) {\n keepAnimating = false\n return ({\n currentPosition: LoopingArrayCalculator.withoutOffset(newPosition),\n animationState: undefined\n })\n }\n return ({\n currentPosition: newPosition,\n animationState: {\n ...animationState!,\n lastUpdateTime: time\n }\n })\n })\n if (keepAnimating) {\n animationId.current = requestAnimationFrame(time1 => animation(time1))\n }\n }, [animationTime, autoLoopAnimationTime, util])\n\n useEffect(() => {\n if (animationState) {\n animationId.current = requestAnimationFrame(animation)\n }\n return () => {\n if (animationId.current) {\n cancelAnimationFrame(animationId.current)\n animationId.current = 0\n }\n }\n }, [animationState]) // eslint-disable-line react-hooks/exhaustive-deps\n\n const startAutoLoop = () => setCarouselInformation(prevState => ({\n ...prevState,\n dragState: prevState.dragState,\n animationState: prevState.animationState || prevState.dragState ? prevState.animationState : {\n startPosition: currentPosition,\n targetPosition: (currentPosition + 1) % length,\n direction: 1, // always move forward\n isAutoLooping: true\n }\n }))\n\n useEffect(() => {\n if (!animationId.current && !animationState && !dragState && !timeOut.current) {\n if (autoLoopingTimeOut > 0) {\n timeOut.current = setTimeout(() => {\n startAutoLoop()\n timeOut.current = undefined\n }, autoLoopingTimeOut)\n } else {\n startAutoLoop()\n }\n }\n }, [animationState, dragState, animationId.current, timeOut.current]) // eslint-disable-line react-hooks/exhaustive-deps\n\n const startAnimation = (targetPosition?: number) => {\n if (targetPosition === undefined) {\n targetPosition = LoopingArrayCalculator.withoutOffset(currentPosition)\n }\n if (targetPosition === currentPosition) {\n return // we are exactly where we want to be\n }\n\n // find target index and fastest path to it\n const direction = util.getBestDirection(currentPosition, targetPosition)\n clearTimeout(timeOut.current)\n timeOut.current = undefined\n if (animationId.current) {\n cancelAnimationFrame(animationId.current)\n animationId.current = undefined\n }\n\n setCarouselInformation(prevState => ({\n ...prevState,\n dragState: undefined,\n animationState: {\n targetPosition: targetPosition!,\n direction,\n startPosition: currentPosition,\n isAutoLooping: false\n },\n timeOut: undefined\n }))\n }\n\n const canGoLeft = () => {\n return isLooping || currentPosition !== 0\n }\n\n const canGoRight = () => {\n return isLooping || currentPosition !== length - 1\n }\n\n const left = () => {\n if (canGoLeft()) {\n startAnimation(currentPosition === 0 ? length - 1 : LoopingArrayCalculator.withoutOffset(currentPosition - 1))\n }\n }\n\n const right = () => {\n if (canGoRight()) {\n startAnimation(LoopingArrayCalculator.withoutOffset((currentPosition + 1) % length))\n }\n }\n\n let items: ItemType[] = children.map((item, index) => ({\n index,\n item\n }))\n\n if (isLooping) {\n const before = createLoopingListWithIndex(children, length - 1, paddingItemCount, false).reverse().map(([index, item]) => ({\n index,\n item\n }))\n const after = createLoopingListWithIndex(children, 0, paddingItemCount).map(([index, item]) => ({\n index,\n item\n }))\n items = [\n ...before,\n ...items,\n ...after\n ]\n }\n\n const onDragStart = (x: number) => setCarouselInformation(prevState => ({\n ...prevState,\n dragState: {\n lastX: x,\n startX: x,\n startTime: Date.now(),\n startIndex: currentPosition,\n },\n animationState: undefined // cancel animation\n }))\n\n const onDrag = (x: number, width: number) => {\n // For some weird reason the clientX is 0 on the last dragUpdate before drag end causing issues\n if (!dragState || x === 0) {\n return\n }\n const offsetUpdate = (dragState.lastX - x) / width\n const newPosition = util.getCorrectedPosition(currentPosition + offsetUpdate)\n\n setCarouselInformation(prevState => ({\n ...prevState,\n currentPosition: newPosition,\n dragState: {\n ...dragState,\n lastX: x\n },\n }))\n }\n\n const onDragEnd = (x: number, width: number) => {\n if (!dragState) {\n return\n }\n const distance = dragState.startX - x\n const relativeDistance = distance / width\n const duration = (Date.now() - dragState.startTime) // in milliseconds\n const velocity = distance / (Date.now() - dragState.startTime)\n\n const isSlide = Math.abs(velocity) > 2 || (duration < 200 && (Math.abs(relativeDistance) > 0.2 || Math.abs(distance) > 50))\n if (isSlide) {\n if (distance > 0 && canGoRight()) {\n right()\n return\n } else if (distance < 0 && canGoLeft()) {\n left()\n return\n }\n }\n startAnimation()\n }\n\n const dragHandlers = {\n draggable: true,\n onDragStart: (event: React.DragEvent<HTMLDivElement>) => {\n onDragStart(event.clientX)\n event.dataTransfer.setDragImage(document.createElement('div'), 0, 0)\n },\n onDrag: (event: React.DragEvent<HTMLDivElement>) => onDrag(event.clientX, (event.target as HTMLDivElement).getBoundingClientRect().width),\n onDragEnd: (event: React.DragEvent<HTMLDivElement>) => onDragEnd(event.clientX, (event.target as HTMLDivElement).getBoundingClientRect().width),\n onTouchStart: (event: React.TouchEvent<HTMLDivElement>) => onDragStart(event.touches[0]!.clientX),\n onTouchMove: (event: React.TouchEvent<HTMLDivElement>) => onDrag(event.touches[0]!.clientX, (event.target as HTMLDivElement).getBoundingClientRect().width),\n onTouchEnd: (event: React.TouchEvent<HTMLDivElement>) => onDragEnd(event.changedTouches[0]!.clientX, (event.target as HTMLDivElement).getBoundingClientRect().width),\n onTouchCancel: (event: React.TouchEvent<HTMLDivElement>) => onDragEnd(event.changedTouches[0]!.clientX, (event.target as HTMLDivElement).getBoundingClientRect().width),\n }\n\n return (\n <div className=\"flex-col-2 items-center w-full\">\n <div className={clsx(`relative w-full overflow-hidden`, heightClassName, className)}>\n {arrows && (\n <>\n <IconButton\n color=\"neutral\"\n className={clsx('absolute z-10 left-0 top-1/2 -translate-y-1/2 shadow-md', { hidden: !canGoLeft() })}\n disabled={!canGoLeft()}\n onClick={() => left()}\n >\n <ChevronLeft size={24}/>\n </IconButton>\n <IconButton\n color=\"neutral\"\n className={clsx('absolute z-10 right-0 top-1/2 -translate-y-1/2 shadow-md', { hidden: !canGoRight() })}\n disabled={!canGoRight()}\n onClick={() => right()}\n >\n <ChevronRight size={24}/>\n </IconButton>\n </>\n )}\n {hintNext ? (\n <div className={clsx(`flex-row-2 relative h-full`, heightClassName)}>\n <div className=\"flex-row-2 relative h-full w-full px-2 overflow-hidden\">\n {items.map(({\n item,\n index\n }, listIndex) => (\n <div\n key={listIndex}\n className={clsx(`absolute left-[50%] h-full overflow-hidden`, widthClassName, { '!cursor-grabbing': !!dragState })}\n style={{ translate: getStyleOffset(listIndex - (isLooping ? paddingItemCount : 0)) }}\n {...dragHandlers}\n onClick={() => startAnimation(index)}\n >\n {item}\n </div>\n ))}\n </div>\n <div\n className={clsx(`hidden pointer-events-none desktop:block absolute left-0 h-full w-[20%] bg-gradient-to-r to-transparent`, blurColor)}\n />\n <div\n className={clsx(`hidden pointer-events-none desktop:block absolute right-0 h-full w-[20%] bg-gradient-to-l to-transparent`, blurColor)}\n />\n </div>\n ) : (\n <div className={clsx('px-16 h-full', { '!cursor-grabbing': !!dragState })} {...dragHandlers}>\n {children[currentIndex]}\n </div>\n )}\n </div>\n {dots && (\n <div\n className=\"flex-row-2 items-center justify-center w-full my-2\">\n {range(length).map(index => (\n <button\n key={index}\n className={clsx('w-8 min-w-8 h-3 min-h-3 first:rounded-l-md last:rounded-r-md', {\n 'bg-carousel-dot-disabled hover:bg-carousel-dot-active': currentIndex !== index,\n 'bg-carousel-dot-active hover:brightness-90': currentIndex === index\n })}\n onClick={() => startAnimation(index)}\n />\n ))}\n </div>\n )}\n </div>\n )\n}\n","export const equalSizeGroups = <T>(array: T[], groupSize: number): T[][] => {\n if (groupSize <= 0) {\n console.warn(`group size should be greater than 0: groupSize = ${groupSize}`)\n return [[...array]]\n }\n\n const groups = []\n for (let i = 0; i < array.length; i += groupSize) {\n groups.push(array.slice(i, Math.min(i + groupSize, array.length)))\n }\n return groups\n}\n\nexport type RangeOptions = {\n /** Whether the range can be defined empty via end < start without a warning */\n allowEmptyRange: boolean,\n stepSize: number,\n exclusiveStart: boolean,\n exclusiveEnd: boolean,\n}\n\nconst defaultRangeOptions: RangeOptions = {\n allowEmptyRange: false,\n stepSize: 1,\n exclusiveStart: false,\n exclusiveEnd: true,\n}\n\n/**\n * @param endOrRange The end value or a range [start, end], end is exclusive\n * @param options the options for defining the range\n */\nexport const range = (endOrRange: number | [number, number], options?: Partial<RangeOptions>): number[] => {\n const { allowEmptyRange, stepSize, exclusiveStart, exclusiveEnd } = { ...defaultRangeOptions, ...options }\n let start = 0\n let end: number\n if (typeof endOrRange === 'number') {\n end = endOrRange\n } else {\n start = endOrRange[0]\n end = endOrRange[1]\n }\n if (!exclusiveEnd) {\n end -= 1\n }\n if (exclusiveStart) {\n start += 1\n }\n\n if (end - 1 < start) {\n if (!allowEmptyRange) {\n console.warn(`range: end (${end}) < start (${start}) should be allowed explicitly, set options.allowEmptyRange to true`)\n }\n return []\n }\n return Array.from({ length: end - start }, (_, index) => index * stepSize + start)\n}\n\n/** Finds the closest match\n * @param list The list of all possible matches\n * @param firstCloser Return whether item1 is closer than item2\n */\nexport const closestMatch = <T>(list: T[], firstCloser: (item1: T, item2: T) => boolean) => {\n return list.reduce((item1, item2) => {\n return firstCloser(item1, item2) ? item1 : item2\n })\n}\n\n/**\n * returns the item in middle of a list and its neighbours before and after\n * e.g. [1,2,3,4,5,6] for item = 1 would return [5,6,1,2,3]\n */\nexport const getNeighbours = <T>(list: T[], item: T, neighbourDistance: number = 2) => {\n const index = list.indexOf(item)\n const totalItems = neighbourDistance * 2 + 1\n if (list.length < totalItems) {\n console.warn('List is to short')\n return list\n }\n\n if (index === -1) {\n console.error('item not found in list')\n return list.splice(0, totalItems)\n }\n\n let start = index - neighbourDistance\n if (start < 0) {\n start += list.length\n }\n const end = (index + neighbourDistance + 1) % list.length\n\n const result: T[] = []\n let ignoreOnce = list.length === totalItems\n for (let i = start; i !== end || ignoreOnce; i = (i + 1) % list.length) {\n result.push(list[i]!)\n if (end === i && ignoreOnce) {\n ignoreOnce = false\n }\n }\n return result\n}\n\nexport const createLoopingListWithIndex = <T>(list: T[], startIndex: number = 0, length: number = 0, forwards: boolean = true) => {\n if (length < 0) {\n console.warn(`createLoopingList: length must be >= 0, given ${length}`)\n } else if (length === 0) {\n length = list.length\n }\n\n const returnList: [number, T][] = []\n\n if (forwards) {\n for (let i = startIndex; returnList.length < length; i = (i + 1) % list.length) {\n returnList.push([i, list[i]!])\n }\n } else {\n for (let i = startIndex; returnList.length < length; i = i === 0 ? i = list.length - 1 : i - 1) {\n returnList.push([i, list[i]!])\n }\n }\n\n return returnList\n}\n\nexport const createLoopingList = <T>(list: T[], startIndex: number = 0, length: number = 0, forwards: boolean = true) => {\n return createLoopingListWithIndex(list, startIndex, length, forwards).map(([_, item]) => item)\n}\n\nexport const ArrayUtil = {\n unique: <T>(list: T[]): T[] => {\n const seen = new Set<T>()\n return list.filter((item) => {\n if (seen.has(item)) {\n return false\n }\n seen.add(item)\n return true\n })\n },\n\n difference: <T>(list: T[], removeList: T[]): T[] => {\n const remove = new Set<T>(removeList)\n return list.filter((item) => !remove.has(item))\n }\n}\n","export const clamp = (value: number, min: number = 0, max: number = 1): number => {\n return Math.min(Math.max(value, min), max)\n}\n","import { clamp } from './math'\n\nexport type EaseFunction = (t: number) => number\n\nexport class EaseFunctions {\n static cubicBezierGeneric(x1: number, y1: number, x2: number, y2: number): { x: EaseFunction, y: EaseFunction } {\n // Calculate the x and y coordinates using the cubic Bézier formula\n const cx = 3 * x1\n const bx = 3 * (x2 - x1) - cx\n const ax = 1 - cx - bx\n\n const cy = 3 * y1\n const by = 3 * (y2 - y1) - cy\n const ay = 1 - cy - by\n\n // Compute x and y values at parameter t\n const x = (t: number) => ((ax * t + bx) * t + cx) * t\n const y = (t: number) => ((ay * t + by) * t + cy) * t\n\n return {\n x,\n y\n }\n }\n\n static cubicBezier(x1: number, y1: number, x2: number, y2: number): EaseFunction {\n const { y } = EaseFunctions.cubicBezierGeneric(x1, y1, x2, y2)\n return (t: number) => {\n t = clamp(t)\n return y(t) // <= equal to x(t) * 0 + y(t) * 1\n }\n }\n\n static easeInEaseOut(t: number): number {\n return EaseFunctions.cubicBezier(0.65, 0, 0.35, 1)(t)\n };\n}\n","/**\n * 1 is forwards\n *\n * -1 is backwards\n */\nexport type Direction = 1 | -1\n\nexport class LoopingArrayCalculator {\n length: number\n isLooping: boolean\n allowedOverScroll: number\n\n constructor(length: number, isLooping: boolean = true, allowedOverScroll: number = 0.1) {\n if (allowedOverScroll < 0 || length < 1) {\n throw new Error('Invalid parameters: allowedOverScroll >= 0 and length >= 1 must be true')\n }\n\n this.length = length\n this.isLooping = isLooping\n this.allowedOverScroll = allowedOverScroll\n }\n\n getCorrectedPosition(position: number): number {\n if (!this.isLooping) {\n return Math.max(-this.allowedOverScroll, Math.min(this.allowedOverScroll + this.length - 1, position))\n }\n if (position >= this.length) {\n return position % this.length\n }\n if (position < 0) {\n return this.length - (Math.abs(position) % this.length)\n }\n return position\n }\n\n static withoutOffset(position: number): number {\n return position + LoopingArrayCalculator.getOffset(position)\n }\n\n static getOffset(position: number): number {\n return Math.round(position) - position // For example: 45.5 => 46 - 45.5 = 0.5\n }\n\n /**\n * @return absolute distance forwards or Infinity when the target cannot be reached (only possible when not isLooping)\n */\n getDistanceDirectional(position: number, target: number, direction: Direction): number {\n if (!this.isLooping && (position < -this.allowedOverScroll || position > this.allowedOverScroll + this.length - 1)) {\n throw new Error('Invalid parameters: position is out of bounds.')\n }\n\n const isForwardInvalid = (direction === 1 && position > target)\n const isBackwardInvalid = (direction === -1 && target < position)\n\n if (!this.isLooping && (isForwardInvalid || isBackwardInvalid)) {\n return Infinity\n }\n\n if (direction === -1) {\n return this.getDistanceDirectional(target, position, 1)\n }\n\n position = this.getCorrectedPosition(position)\n target = this.getCorrectedPosition(target)\n\n let distance = (target - position) * direction\n if (distance < 0) {\n distance = this.length - (Math.abs(position) % this.length) + target\n }\n\n return distance\n }\n\n getDistanceForward(position: number, target: number): number {\n return this.getDistanceDirectional(position, target, 1)\n }\n\n getDistanceBackward(position: number, target: number): number {\n return this.getDistanceDirectional(position, target, -1)\n }\n\n getDistance(position: number, target: number): number {\n const forwardDistance = this.getDistanceForward(position, target)\n const backwardDistance = this.getDistanceBackward(position, target)\n\n return Math.min(forwardDistance, backwardDistance)\n }\n\n getBestDirection(position: number, target: number): Direction {\n const forwardDistance = this.getDistanceForward(position, target)\n const backwardDistance = this.getDistanceBackward(position, target)\n return forwardDistance < backwardDistance ? 1 : -1\n }\n}\n","import type { ButtonHTMLAttributes, PropsWithChildren, ReactNode } from 'react'\nimport { forwardRef } from 'react'\nimport clsx from 'clsx'\n\n\nexport const ButtonColorUtil = {\n solid: ['primary', 'secondary', 'tertiary', 'positive', 'warning', 'negative', 'neutral'] as const,\n text: ['primary', 'negative', 'neutral'] as const,\n outline: ['primary'] as const,\n}\n\nexport const IconButtonUtil = {\n icon: [...ButtonColorUtil.solid, 'transparent'] as const,\n}\n\n\n/**\n * The allowed colors for the SolidButton and IconButton\n */\nexport type SolidButtonColor = typeof ButtonColorUtil.solid[number]\n/**\n * The allowed colors for the OutlineButton\n */\nexport type OutlineButtonColor = typeof ButtonColorUtil.outline[number]\n/**\n * The allowed colors for the TextButton\n */\nexport type TextButtonColor = typeof ButtonColorUtil.text[number]\n/**\n * The allowed colors for the IconButton\n */\nexport type IconButtonColor = typeof IconButtonUtil.icon[number]\n\n\n/**\n * The different sizes for a button\n */\ntype ButtonSizes = 'small' | 'medium' | 'large'\n\ntype IconButtonSize = 'tiny' | 'small' | 'medium' | 'large'\n\n/**\n * The shard properties between all button types\n */\nexport type ButtonProps = PropsWithChildren<{\n /**\n * @default 'medium'\n */\n size?: ButtonSizes,\n}> & ButtonHTMLAttributes<Element>\n\nconst paddingMapping: Record<ButtonSizes, string> = {\n small: 'btn-sm',\n medium: 'btn-md',\n large: 'btn-lg'\n}\n\nconst iconPaddingMapping: Record<IconButtonSize, string> = {\n tiny: 'icon-btn-xs',\n small: 'icon-btn-sm',\n medium: 'icon-btn-md',\n large: 'icon-btn-lg'\n}\n\nexport const ButtonUtil = {\n paddingMapping,\n iconPaddingMapping\n}\n\ntype ButtonWithIconsProps = ButtonProps & {\n startIcon?: ReactNode,\n endIcon?: ReactNode,\n}\n\nexport type SolidButtonProps = ButtonWithIconsProps & {\n color?: SolidButtonColor,\n}\n\nexport type OutlineButtonProps = ButtonWithIconsProps & {\n color?: OutlineButtonColor,\n}\n\nexport type TextButtonProps = ButtonWithIconsProps & {\n color?: TextButtonColor,\n coloredHoverBackground?: boolean,\n}\n\n/**\n * The shard properties between all button types\n */\nexport type IconButtonProps = PropsWithChildren<{\n /**\n * @default 'medium'\n */\n size?: IconButtonSize,\n color?: IconButtonColor,\n}> & ButtonHTMLAttributes<Element>\n\n/**\n * A button with a solid background and different sizes\n */\nconst SolidButton = forwardRef<HTMLButtonElement, SolidButtonProps>(function SolidButton({\n children,\n color = 'primary',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }, ref) {\n const colorClasses = {\n primary: 'not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text',\n secondary: 'not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text',\n tertiary: 'not-disabled:bg-button-solid-tertiary-background not-disabled:text-button-solid-tertiary-text',\n positive: 'not-disabled:bg-button-solid-positive-background not-disabled:text-button-solid-positive-text',\n warning: 'not-disabled:bg-button-solid-warning-background not-disabled:text-button-solid-warning-text',\n negative: 'not-disabled:bg-button-solid-negative-background not-disabled:text-button-solid-negative-text',\n neutral: 'not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'not-group-disabled:text-button-solid-primary-icon',\n secondary: 'not-group-disabled:text-button-solid-secondary-icon',\n tertiary: 'not-group-disabled:text-button-solid-tertiary-icon',\n positive: 'not-group-disabled:text-button-solid-positive-icon',\n warning: 'not-group-disabled:text-button-solid-warning-icon',\n negative: 'not-group-disabled:text-button-solid-negative-icon',\n neutral: 'not-group-disabled:text-button-solid-neutral-icon',\n }[color]\n\n return (\n <button\n ref={ref}\n onClick={onClick}\n className={clsx(\n 'group font-semibold',\n colorClasses,\n 'not-disabled:hover:brightness-90',\n 'disabled:text-disabled-text disabled:bg-disabled-background',\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx(\n iconColorClasses,\n 'group-disabled:text-disabled-icon'\n )}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx(\n iconColorClasses,\n 'group-disabled:text-disabled-icon'\n )}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n})\n\n/**\n * A button with an outline border and different sizes\n */\nconst OutlineButton = ({\n children,\n color = 'primary',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }: OutlineButtonProps) => {\n const colorClasses = {\n primary: 'not-disabled:border-button-outline-primary-text not-disabled:text-button-outline-primary-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'not-group-disabled:text-button-outline-primary-icon',\n }[color]\n return (\n <button\n onClick={onClick}\n className={clsx(\n 'group font-semibold bg-transparent border-2 ',\n 'not-disabled:hover:brightness-80',\n colorClasses,\n 'disabled:text-disabled-text disabled:border-disabled-outline',\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx(\n iconColorClasses,\n 'group-disabled:text-disabled-icon'\n )}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx(\n iconColorClasses,\n 'group-disabled:text-disabled-icon'\n )}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n/**\n * A text that is a button that can have different sizes\n */\nconst TextButton = ({\n children,\n color = 'neutral',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n coloredHoverBackground = true,\n className,\n ...restProps\n }: TextButtonProps) => {\n const colorClasses = {\n primary: 'not-disabled:bg-transparent not-disabled:text-button-text-primary-text',\n negative: 'not-disabled:bg-transparent not-disabled:text-button-text-negative-text',\n neutral: 'not-disabled:bg-transparent not-disabled:text-button-text-neutral-text',\n }[color]\n\n const backgroundColor = {\n primary: 'not-disabled:hover:bg-button-text-primary-text/20',\n negative: 'not-disabled:hover:bg-button-text-negative-text/20',\n neutral: 'not-disabled:hover:bg-button-text-neutral-text/20',\n }[color]\n\n const iconColorClasses = {\n primary: 'not-group-disabled:text-button-text-primary-icon',\n negative: 'not-group-disabled:text-button-text-negative-icon',\n neutral: 'not-group-disabled:text-button-text-neutral-icon',\n }[color]\n\n return (\n <button\n onClick={onClick}\n className={clsx(\n 'group font-semibold',\n 'disabled:text-disabled-text',\n colorClasses,\n {\n [backgroundColor]: coloredHoverBackground,\n 'not-disabled:hover:bg-button-text-hover-background': !coloredHoverBackground,\n },\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx(\n iconColorClasses,\n 'group-disabled:text-disabled-icon'\n )}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx(\n iconColorClasses,\n 'group-disabled:text-disabled-icon'\n )}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n\n/**\n * A button for icons with a solid background and different sizes\n */\nconst IconButton = ({\n children,\n color = 'primary',\n size = 'medium',\n className,\n ...restProps\n }: IconButtonProps) => {\n const colorClasses = {\n primary: 'not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text',\n secondary: 'not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text',\n tertiary: 'not-disabled:bg-button-solid-tertiary-background not-disabled:text-button-solid-tertiary-text',\n positive: 'not-disabled:bg-button-solid-positive-background not-disabled:text-button-solid-positive-text',\n warning: 'not-disabled:bg-button-solid-warning-background not-disabled:text-button-solid-warning-text',\n negative: 'not-disabled:bg-button-solid-negative-background not-disabled:text-button-solid-negative-text',\n neutral: 'not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text',\n transparent: 'not-disabled:bg-transparent',\n }[color]\n\n return (\n <button\n className={clsx(\n colorClasses,\n 'not-disabled:hover:brightness-90',\n 'disabled:text-disabled-text',\n {\n 'disabled:bg-disabled-background': color !== 'transparent',\n 'disabled:opacity-70': color === 'transparent',\n 'not-disabled:hover:bg-button-text-hover-background': color === 'transparent',\n },\n ButtonUtil.iconPaddingMapping[size],\n className\n )}\n {...restProps}\n >\n {children}\n </button>\n )\n}\n\nexport { SolidButton, OutlineButton, TextButton, IconButton }\n"],"mappings":";AACA,SAAgB,aAAa,WAAW,SAAS,QAAQ,gBAAgB;AACzE,OAAOA,WAAU;AACjB,SAAS,aAAa,oBAAoB;;;ACkB1C,IAAM,sBAAoC;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