@spark-ui/components 10.7.4 → 10.7.5
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/CHANGELOG.md +6 -0
- package/dist/alert-dialog/index.js +36 -5
- package/dist/alert-dialog/index.js.map +1 -1
- package/dist/alert-dialog/index.mjs +2 -2
- package/dist/avatar/index.js +3 -0
- package/dist/avatar/index.js.map +1 -1
- package/dist/avatar/index.mjs +3 -1
- package/dist/avatar/index.mjs.map +1 -1
- package/dist/breadcrumb/index.js +1 -0
- package/dist/breadcrumb/index.js.map +1 -1
- package/dist/breadcrumb/index.mjs +1 -1
- package/dist/carousel/index.js +9 -0
- package/dist/carousel/index.js.map +1 -1
- package/dist/carousel/index.mjs +9 -1
- package/dist/carousel/index.mjs.map +1 -1
- package/dist/{chunk-O42QOEJ6.mjs → chunk-ESSJY557.mjs} +2 -2
- package/dist/{chunk-73YYIDSP.mjs → chunk-OQ4ALBBN.mjs} +6 -1
- package/dist/chunk-OQ4ALBBN.mjs.map +1 -0
- package/dist/{chunk-SBJNVOF7.mjs → chunk-QNYSDG6F.mjs} +2 -1
- package/dist/{chunk-SBJNVOF7.mjs.map → chunk-QNYSDG6F.mjs.map} +1 -1
- package/dist/{chunk-TOKVRWXL.mjs → chunk-RKPP7ZOK.mjs} +2 -1
- package/dist/{chunk-TOKVRWXL.mjs.map → chunk-RKPP7ZOK.mjs.map} +1 -1
- package/dist/{chunk-3PRCMWLU.mjs → chunk-T26TYEWV.mjs} +37 -7
- package/dist/chunk-T26TYEWV.mjs.map +1 -0
- package/dist/combobox/index.js +1 -0
- package/dist/combobox/index.js.map +1 -1
- package/dist/combobox/index.mjs +2 -2
- package/dist/dialog/index.js +36 -5
- package/dist/dialog/index.js.map +1 -1
- package/dist/dialog/index.mjs +2 -2
- package/dist/divider/index.js +1 -0
- package/dist/divider/index.js.map +1 -1
- package/dist/divider/index.mjs +1 -0
- package/dist/divider/index.mjs.map +1 -1
- package/dist/drawer/index.js +36 -6
- package/dist/drawer/index.js.map +1 -1
- package/dist/drawer/index.mjs +36 -7
- package/dist/drawer/index.mjs.map +1 -1
- package/dist/dropdown/index.js +1 -0
- package/dist/dropdown/index.js.map +1 -1
- package/dist/dropdown/index.mjs +2 -2
- package/dist/icon-button/index.js +1 -0
- package/dist/icon-button/index.js.map +1 -1
- package/dist/icon-button/index.mjs +1 -1
- package/dist/input/index.js +5 -0
- package/dist/input/index.js.map +1 -1
- package/dist/input/index.mjs +1 -1
- package/dist/kbd/index.js +1 -0
- package/dist/kbd/index.js.map +1 -1
- package/dist/kbd/index.mjs +1 -0
- package/dist/kbd/index.mjs.map +1 -1
- package/dist/pagination/index.js +1 -0
- package/dist/pagination/index.js.map +1 -1
- package/dist/pagination/index.mjs +1 -1
- package/dist/popover/index.js +1 -0
- package/dist/popover/index.js.map +1 -1
- package/dist/popover/index.mjs +2 -2
- package/dist/progress/index.js +23 -2
- package/dist/progress/index.js.map +1 -1
- package/dist/progress/index.mjs +23 -2
- package/dist/progress/index.mjs.map +1 -1
- package/dist/progress-tracker/index.js +1 -0
- package/dist/progress-tracker/index.js.map +1 -1
- package/dist/progress-tracker/index.mjs +1 -0
- package/dist/progress-tracker/index.mjs.map +1 -1
- package/dist/radio-group/index.js +9 -1
- package/dist/radio-group/index.js.map +1 -1
- package/dist/radio-group/index.mjs +9 -1
- package/dist/radio-group/index.mjs.map +1 -1
- package/dist/rating/index.js +1 -0
- package/dist/rating/index.js.map +1 -1
- package/dist/rating/index.mjs +1 -0
- package/dist/rating/index.mjs.map +1 -1
- package/dist/scrolling-list/index.js +14 -1
- package/dist/scrolling-list/index.js.map +1 -1
- package/dist/scrolling-list/index.mjs +14 -2
- package/dist/scrolling-list/index.mjs.map +1 -1
- package/dist/slider/index.js +12 -1
- package/dist/slider/index.js.map +1 -1
- package/dist/slider/index.mjs +12 -1
- package/dist/slider/index.mjs.map +1 -1
- package/dist/snackbar/index.js +4 -0
- package/dist/snackbar/index.js.map +1 -1
- package/dist/snackbar/index.mjs +4 -1
- package/dist/snackbar/index.mjs.map +1 -1
- package/dist/stepper/index.js +8 -2
- package/dist/stepper/index.js.map +1 -1
- package/dist/stepper/index.mjs +4 -4
- package/dist/stepper/index.mjs.map +1 -1
- package/dist/switch/index.js +9 -1
- package/dist/switch/index.js.map +1 -1
- package/dist/switch/index.mjs +9 -1
- package/dist/switch/index.mjs.map +1 -1
- package/dist/tabs/index.js +3 -0
- package/dist/tabs/index.js.map +1 -1
- package/dist/tabs/index.mjs +3 -0
- package/dist/tabs/index.mjs.map +1 -1
- package/dist/text-link/index.js +1 -0
- package/dist/text-link/index.js.map +1 -1
- package/dist/text-link/index.mjs +1 -1
- package/dist/textarea/index.js +5 -0
- package/dist/textarea/index.js.map +1 -1
- package/dist/textarea/index.mjs +1 -1
- package/package.json +5 -5
- package/dist/chunk-3PRCMWLU.mjs.map +0 -1
- package/dist/chunk-73YYIDSP.mjs.map +0 -1
- /package/dist/{chunk-O42QOEJ6.mjs.map → chunk-ESSJY557.mjs.map} +0 -0
package/dist/avatar/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/avatar/index.ts","../../src/avatar/Avatar.tsx","../../src/slot/Slot.tsx","../../src/avatar/context.ts","../../src/avatar/AvatarImage.tsx","../../src/avatar/AvatarAction.tsx","../../src/icon/Icon.tsx","../../src/visually-hidden/VisuallyHidden.tsx","../../src/icon/Icon.styles.tsx","../../src/button/Button.tsx","../../src/spinner/Spinner.styles.tsx","../../src/spinner/Spinner.tsx","../../src/button/Button.styles.tsx","../../src/button/variants/filled.ts","../../src/button/variants/ghost.ts","../../src/button/variants/outlined.ts","../../src/button/variants/tinted.ts","../../src/button/variants/contrast.ts","../../src/icon-button/IconButton.styles.tsx","../../src/icon-button/IconButton.tsx","../../src/avatar/AvatarOnlineBadge.tsx","../../src/avatar/AvatarUser.tsx","../../src/avatar/AvatarPlaceholder.tsx"],"sourcesContent":["import { Avatar } from './Avatar'\nimport { AvatarImage } from './AvatarImage'\nimport { AvatarAction } from './AvatarAction'\nimport { AvatarOnlineBadge } from './AvatarOnlineBadge'\nimport { AvatarUser } from './AvatarUser'\nimport { AvatarPlaceholder } from './AvatarPlaceholder'\nimport type { AvatarProps } from './types'\n\nexport interface AvatarComponent\n extends React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLDivElement>> {\n Image: typeof AvatarImage\n Action: typeof AvatarAction\n OnlineBadge: typeof AvatarOnlineBadge\n User: typeof AvatarUser\n Placeholder: typeof AvatarPlaceholder\n}\n\nconst AvatarComponent = Avatar as AvatarComponent\n\nAvatarComponent.Image = AvatarImage\nAvatarComponent.Action = AvatarAction\nAvatarComponent.OnlineBadge = AvatarOnlineBadge\nAvatarComponent.User = AvatarUser\nAvatarComponent.Placeholder = AvatarPlaceholder\nexport { AvatarComponent as Avatar }\n","import { cx } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { Slot } from '../slot'\nimport { AvatarContext } from './context'\nimport type { AvatarProps } from './types'\n\nconst sizeMap = {\n xs: 24,\n sm: 32,\n md: 40,\n lg: 56,\n xl: 64, // default\n '2xl': 96,\n}\n\nexport const Avatar = React.forwardRef<HTMLDivElement, AvatarProps>(\n (\n {\n className,\n size = 'xl',\n isOnline = false,\n onlineText,\n username,\n asChild,\n children,\n design = 'circle',\n ...props\n },\n ref\n ) => {\n const Comp = asChild ? Slot : 'div'\n const contextValue = React.useMemo(\n () => ({\n size,\n isOnline,\n onlineText,\n username,\n design,\n pixelSize: sizeMap[size],\n }),\n [size, isOnline, username, design, onlineText]\n )\n\n return (\n <AvatarContext.Provider value={contextValue}>\n <Comp\n ref={ref}\n style={{\n width: sizeMap[size],\n height: sizeMap[size],\n }}\n data-spark-component=\"avatar\"\n className={cx('relative inline-flex items-center justify-center', className)}\n {...props}\n >\n {children}\n </Comp>\n </AvatarContext.Provider>\n )\n }\n)\n\nAvatar.displayName = 'Avatar'\n","import { Slot as RadixSlot } from 'radix-ui'\nimport {\n cloneElement,\n HTMLAttributes,\n isValidElement,\n PropsWithChildren,\n ReactNode,\n Ref,\n} from 'react'\n\nexport const Slottable: typeof RadixSlot.Slottable = RadixSlot.Slottable\n\nexport type SlotProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {\n ref?: Ref<HTMLElement>\n}\n\nexport const Slot = ({ ref, ...props }: SlotProps) => {\n return <RadixSlot.Root ref={ref} {...props} />\n}\n\n/**\n * When using Radix `Slot` component, it will consider its first child to merge its props with.\n * In some cases, you might need to wrap the top child with additional markup without breaking this behaviour.\n */\nexport const wrapPolymorphicSlot = (\n asChild: boolean | undefined,\n children: ReactNode,\n callback: (children: ReactNode) => ReactNode\n) => {\n if (!asChild) return callback(children) // If polymorphic behaviour is not used, we keep the original children\n\n return isValidElement(children)\n ? cloneElement(\n children,\n undefined,\n callback((children.props as { children: ReactNode }).children)\n )\n : null\n}\n","import * as React from 'react'\nimport type { AvatarContextValue } from './types'\n\nconst AvatarContext = React.createContext<AvatarContextValue | undefined>(undefined)\n\nexport const useAvatarContext = () => {\n const context = React.useContext(AvatarContext)\n if (!context) {\n throw new Error('useAvatarContext must be used within an Avatar component')\n }\n return context\n}\n\nexport { AvatarContext }\n","import { cx } from 'class-variance-authority'\nimport { useState } from 'react'\n\nimport { Slot } from '../slot'\nimport { useAvatarContext } from './context'\n\nexport interface AvatarImageProps extends React.ImgHTMLAttributes<HTMLImageElement> {\n asChild?: boolean\n}\n\nexport const AvatarImage = ({ className, asChild, src, ...props }: AvatarImageProps) => {\n const { username, isOnline, onlineText } = useAvatarContext()\n const Comp = asChild ? Slot : 'img'\n\n const [isVisible, setIsVisible] = useState(false)\n\n const accessibleName = isOnline && onlineText ? `${username} (${onlineText})` : username\n\n return (\n <Comp\n aria-hidden\n className={cx(\n 'absolute inset-0 size-full',\n 'object-cover',\n { 'transition-all duration-300 group-hover:scale-120': props.onClick },\n 'focus-visible:u-outline',\n isVisible ? 'block' : 'hidden',\n className\n )}\n alt={accessibleName}\n src={src}\n onLoad={() => {\n setIsVisible(true)\n }}\n {...props}\n />\n )\n}\n\nAvatarImage.displayName = 'AvatarImage'\n","import { PenOutline } from '@spark-ui/icons/PenOutline'\nimport { cx } from 'class-variance-authority'\n\nimport { Icon } from '../icon'\nimport { IconButton } from '../icon-button'\nimport { Slot } from '../slot'\nimport { useAvatarContext } from './context'\n\nexport interface AvatarActionProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n asChild?: boolean\n angle?: number\n ariaLabel: string\n}\n\nexport const AvatarAction = ({\n className,\n children,\n asChild,\n angle = 135,\n ariaLabel,\n ...props\n}: AvatarActionProps) => {\n const Comp = asChild ? Slot : IconButton\n const { pixelSize, design } = useAvatarContext()\n\n function getBadgePosition(circleSize: number) {\n const angleRad = ((90 - angle) * Math.PI) / 180\n const circleRadius = circleSize / 2\n\n return {\n x: circleRadius + circleRadius * Math.cos(angleRad),\n y: circleRadius - circleRadius * Math.sin(angleRad),\n }\n }\n\n const position = getBadgePosition(pixelSize)\n\n const isCustomElement = asChild\n\n return (\n <Comp\n style={{\n position: 'absolute',\n ...(design === 'circle' ? { left: `${position.x}px`, top: `${position.y}px` } : {}),\n ...(design === 'square' ? { right: '0px', bottom: '0px' } : {}),\n }}\n className={cx(\n 'z-raised',\n design === 'circle'\n ? '-translate-x-1/2 -translate-y-1/2'\n : 'translate-x-1/4 translate-y-1/4',\n { 'shadow-sm': !isCustomElement },\n className\n )}\n aria-label={ariaLabel}\n title={ariaLabel}\n {...(!isCustomElement ? { size: 'sm', intent: 'support', design: 'contrast' } : {})}\n {...props}\n >\n {children || (\n <Icon size=\"sm\">\n <PenOutline />\n </Icon>\n )}\n </Comp>\n )\n}\n\nAvatarAction.displayName = 'AvatarAction'\n","import { Children, cloneElement, ComponentPropsWithoutRef, ReactElement, ReactNode } from 'react'\n\nimport { VisuallyHidden } from '../visually-hidden'\nimport { iconStyles, IconVariantsProps } from './Icon.styles'\n\nexport interface IconProps extends IconVariantsProps, ComponentPropsWithoutRef<'svg'> {\n /**\n * The svg icon that will be wrapped\n */\n children: ReactNode\n /**\n * The accessible label for the icon. This label will be visually hidden but announced to screen\n * reader users, similar to `alt` text for `img` tags.\n */\n label?: string\n}\n\nexport const Icon = ({\n label,\n className,\n size = 'current',\n intent = 'current',\n children,\n ...others\n}: IconProps) => {\n const child = Children.only(children)\n\n return (\n <>\n {cloneElement(child as ReactElement<Record<string, any>>, {\n className: iconStyles({ className, size, intent }),\n 'data-spark-component': 'icon',\n 'aria-hidden': 'true',\n focusable: 'false',\n ...others,\n })}\n\n {label && <VisuallyHidden>{label}</VisuallyHidden>}\n </>\n )\n}\n\nIcon.displayName = 'Icon'\n","import { HTMLAttributes, PropsWithChildren, Ref } from 'react'\n\nimport { Slot } from '../slot'\n\nexport type VisuallyHiddenProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean\n ref?: Ref<HTMLElement>\n}\n\nexport const VisuallyHidden = ({ asChild = false, ref, ...props }: VisuallyHiddenProps) => {\n const Component = asChild ? Slot : 'span'\n\n return (\n <Component\n {...props}\n ref={ref}\n style={{\n // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss\n position: 'absolute',\n border: 0,\n width: 1,\n height: 1,\n padding: 0,\n margin: -1,\n overflow: 'hidden',\n clip: 'rect(0, 0, 0, 0)',\n whiteSpace: 'nowrap',\n wordWrap: 'normal',\n ...props.style,\n }}\n />\n )\n}\n\nVisuallyHidden.displayName = 'VisuallyHidden'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const iconStyles = cva(['fill-current shrink-0'], {\n variants: {\n /**\n * Color scheme of the icon.\n */\n intent: makeVariants<\n 'intent',\n [\n 'current',\n 'main',\n 'support',\n 'accent',\n 'basic',\n 'success',\n 'alert',\n 'error',\n 'info',\n 'neutral',\n ]\n >({\n current: ['text-current'],\n main: ['text-main'],\n support: ['text-support'],\n accent: ['text-accent'],\n basic: ['text-basic'],\n success: ['text-success'],\n alert: ['text-alert'],\n error: ['text-error'],\n info: ['text-info'],\n neutral: ['text-neutral'],\n }),\n /**\n * Sets the size of the icon.\n */\n size: makeVariants<'size', ['current', 'sm', 'md', 'lg', 'xl']>({\n current: ['u-current-font-size'],\n sm: ['w-sz-16', 'h-sz-16'],\n md: ['w-sz-24', 'h-sz-24'],\n lg: ['w-sz-32', 'h-sz-32'],\n xl: ['w-sz-40', 'h-sz-40'],\n }),\n },\n})\n\nexport type IconVariantsProps = VariantProps<typeof iconStyles>\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, type DOMAttributes, Ref, useMemo } from 'react'\n\nimport { Slot, wrapPolymorphicSlot } from '../slot'\nimport { Spinner, type SpinnerProps } from '../spinner'\nimport { buttonStyles, type ButtonStylesProps } from './Button.styles'\n\nexport interface ButtonProps\n extends Omit<ComponentPropsWithoutRef<'button'>, 'disabled'>,\n ButtonStylesProps {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n /**\n * Display a spinner to indicate to the user that the button is loading something after they interacted with it.\n */\n isLoading?: boolean\n /**\n * If your loading state should only display a spinner, it's better to specify a label for it (a11y).\n */\n loadingLabel?: string\n /**\n * If your loading state should also display a label, you can use this prop instead of `loadingLabel`.\n * **Please note that using this can result in layout shifting when the Button goes from loading state to normal state.**\n */\n loadingText?: string\n ref?: Ref<HTMLButtonElement>\n}\n\ntype DOMAttributesEventHandler = keyof Omit<\n DOMAttributes<HTMLButtonElement>,\n 'children' | 'dangerouslySetInnerHTML'\n>\n\nconst blockedEventHandlers: DOMAttributesEventHandler[] = [\n 'onClick',\n 'onMouseDown',\n 'onMouseUp',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseOver',\n 'onMouseOut',\n 'onKeyDown',\n 'onKeyPress',\n 'onKeyUp',\n 'onSubmit',\n]\n\nexport const Button = ({\n children,\n design = 'filled',\n disabled = false,\n intent = 'main',\n isLoading = false,\n loadingLabel,\n loadingText,\n shape = 'rounded',\n size = 'md',\n asChild,\n className,\n underline = false,\n ref,\n ...others\n}: ButtonProps) => {\n const Component = asChild ? Slot : 'button'\n\n const shouldNotInteract = !!disabled || isLoading\n\n const disabledEventHandlers = useMemo(() => {\n const result: Partial<Record<DOMAttributesEventHandler, () => void>> = {}\n\n if (shouldNotInteract) {\n blockedEventHandlers.forEach(eventHandler => (result[eventHandler] = undefined))\n }\n\n return result\n }, [shouldNotInteract])\n\n const spinnerProps = {\n size: 'current' as SpinnerProps['size'],\n className: loadingText ? 'inline-block' : 'absolute',\n ...(loadingLabel && { 'aria-label': loadingLabel }),\n }\n\n return (\n <Component\n data-spark-component=\"button\"\n {...(Component === 'button' && { type: 'button' })}\n ref={ref}\n className={buttonStyles({\n className,\n design,\n disabled: shouldNotInteract,\n intent,\n shape,\n size,\n underline,\n })}\n disabled={!!disabled}\n aria-busy={isLoading}\n aria-live={isLoading ? 'assertive' : 'off'}\n {...others}\n {...disabledEventHandlers}\n >\n {wrapPolymorphicSlot(asChild, children, slotted =>\n isLoading ? (\n <>\n <Spinner {...spinnerProps} />\n {loadingText && loadingText}\n\n <div\n aria-hidden\n className={cx('gap-md', loadingText ? 'hidden' : 'inline-flex opacity-0')}\n >\n {slotted}\n </div>\n </>\n ) : (\n slotted\n )\n )}\n </Component>\n )\n}\n\nButton.displayName = 'Button'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nconst defaultVariants = {\n intent: 'current',\n size: 'current',\n isBackgroundVisible: false,\n} as const\n\nexport const spinnerStyles = cva(\n ['inline-block', 'border-solid', 'rounded-full', 'border-md', 'animate-spin'],\n {\n variants: {\n /**\n * Use `size` prop to set the size of the spinner. If you want to set the full size for the spinner, don't forget to add a wrapping container with its own size.\n */\n size: {\n current: ['u-current-font-size'],\n sm: ['w-sz-20', 'h-sz-20'],\n md: ['w-sz-28', 'h-sz-28'],\n full: ['w-full', 'h-full'],\n },\n /**\n * Color scheme of the spinner.\n */\n intent: makeVariants<\n 'intent',\n [\n 'current',\n 'main',\n 'support',\n 'accent',\n 'basic',\n 'success',\n 'alert',\n 'error',\n 'info',\n 'neutral',\n ]\n >({\n current: ['border-current'],\n main: ['border-main'],\n support: ['border-support'],\n accent: ['border-accent'],\n basic: ['border-basic'],\n success: ['border-success'],\n alert: ['border-alert'],\n error: ['border-error'],\n info: ['border-info'],\n neutral: ['border-neutral'],\n }),\n /**\n * Size of the button.\n */\n isBackgroundVisible: {\n true: ['border-b-neutral-container', 'border-l-neutral-container'],\n false: ['border-b-transparent', 'border-l-transparent'],\n },\n },\n defaultVariants,\n }\n)\n\nexport type SpinnerStylesProps = VariantProps<typeof spinnerStyles>\n","import { ComponentPropsWithRef, PropsWithChildren } from 'react'\n\nimport { VisuallyHidden } from '../visually-hidden'\nimport { spinnerStyles, SpinnerStylesProps } from './Spinner.styles'\n\nexport interface SpinnerProps extends ComponentPropsWithRef<'div'>, SpinnerStylesProps {\n /**\n * Use `label` prop for accessibility, it is important to add a fallback loading text. This text will be visible to screen readers.\n */\n label?: string\n}\n\nexport const Spinner = ({\n className,\n size = 'current',\n intent = 'current',\n label,\n isBackgroundVisible,\n ref,\n ...others\n}: PropsWithChildren<SpinnerProps>) => {\n return (\n <span\n role=\"status\"\n data-spark-component=\"spinner\"\n ref={ref}\n className={spinnerStyles({ className, size, intent, isBackgroundVisible })}\n {...others}\n >\n {label && <VisuallyHidden>{label}</VisuallyHidden>}\n </span>\n )\n}\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nimport {\n contrastVariants,\n filledVariants,\n ghostVariants,\n outlinedVariants,\n tintedVariants,\n} from './variants'\n\nexport const buttonStyles = cva(\n [\n 'u-shadow-border-transition',\n 'box-border inline-flex items-center justify-center gap-md whitespace-nowrap',\n 'default:px-lg',\n 'text-body-1 font-bold',\n 'focus-visible:u-outline',\n ],\n {\n variants: {\n /**\n * Main style of the button.\n *\n * - `filled`: Button will be plain.\n *\n * - `outlined`: Button will be transparent with an outline.\n *\n * - `tinted`: Button will be filled but using a lighter color scheme.\n *\n * - `ghost`: Button will look like a link. No borders, plain text.\n *\n * - `contrast`: Button will be surface filled. No borders, plain text.\n *\n */\n design: makeVariants<'design', ['filled', 'outlined', 'tinted', 'ghost', 'contrast']>({\n filled: [],\n outlined: ['bg-transparent', 'border-sm', 'border-current'],\n tinted: [],\n ghost: ['default:-mx-md px-md hover:bg-main/dim-5'],\n contrast: ['bg-surface'],\n }),\n underline: {\n true: ['underline'],\n },\n /**\n * Color scheme of the button.\n */\n intent: makeVariants<\n 'intent',\n [\n 'main',\n 'support',\n 'accent',\n 'basic',\n 'success',\n 'alert',\n 'danger',\n 'info',\n 'neutral',\n 'surface',\n ]\n >({\n main: [],\n support: [],\n accent: [],\n basic: [],\n success: [],\n alert: [],\n danger: [],\n info: [],\n neutral: [],\n surface: [],\n }),\n /**\n * Size of the button.\n */\n size: makeVariants<'size', ['sm', 'md', 'lg']>({\n sm: ['min-w-sz-32', 'h-sz-32'],\n md: ['min-w-sz-44', 'h-sz-44'],\n lg: ['min-w-sz-56', 'h-sz-56'],\n }),\n /**\n * Shape of the button.\n */\n shape: makeVariants<'shape', ['rounded', 'square', 'pill']>({\n rounded: ['rounded-lg'],\n square: ['rounded-0'],\n pill: ['rounded-full'],\n }),\n /**\n * Disable the button, preventing user interaction and adding opacity.\n */\n disabled: {\n true: ['cursor-not-allowed', 'opacity-dim-3'],\n false: ['cursor-pointer'],\n },\n },\n compoundVariants: [\n ...filledVariants,\n ...outlinedVariants,\n ...tintedVariants,\n ...ghostVariants,\n ...contrastVariants,\n ],\n defaultVariants: {\n design: 'filled',\n intent: 'main',\n size: 'md',\n shape: 'rounded',\n },\n }\n)\n\nexport type ButtonStylesProps = VariantProps<typeof buttonStyles>\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const filledVariants = [\n // Main\n {\n intent: 'main',\n design: 'filled',\n class: tw([\n 'bg-main',\n 'text-on-main',\n 'hover:bg-main-hovered',\n 'enabled:active:bg-main-hovered',\n 'focus-visible:bg-main-hovered',\n ]),\n },\n // Support\n {\n intent: 'support',\n design: 'filled',\n class: tw([\n 'bg-support',\n 'text-on-support',\n 'hover:bg-support-hovered',\n 'enabled:active:bg-support-hovered',\n 'focus-visible:bg-support-hovered',\n ]),\n },\n // Accent\n {\n intent: 'accent',\n design: 'filled',\n class: tw([\n 'bg-accent',\n 'text-on-accent',\n 'hover:bg-accent-hovered',\n 'enabled:active:bg-accent-hovered',\n 'focus-visible:bg-accent-hovered',\n ]),\n },\n // Basic\n {\n intent: 'basic',\n design: 'filled',\n class: tw([\n 'bg-basic',\n 'text-on-basic',\n 'hover:bg-basic-hovered',\n 'enabled:active:bg-basic-hovered',\n 'focus-visible:bg-basic-hovered',\n ]),\n },\n // Success\n {\n intent: 'success',\n design: 'filled',\n class: tw([\n 'bg-success',\n 'text-on-success',\n 'hover:bg-success-hovered',\n 'enabled:active:bg-success-hovered',\n 'focus-visible:bg-success-hovered',\n ]),\n },\n // Alert\n {\n intent: 'alert',\n design: 'filled',\n class: tw([\n 'bg-alert',\n 'text-on-alert',\n 'hover:bg-alert-hovered',\n 'enabled:active:bg-alert-hovered',\n 'focus-visible:bg-alert-hovered',\n ]),\n },\n // Danger\n {\n intent: 'danger',\n design: 'filled',\n class: tw([\n 'text-on-error bg-error',\n 'hover:bg-error-hovered enabled:active:bg-error-hovered',\n 'focus-visible:bg-error-hovered',\n ]),\n },\n // Info\n {\n intent: 'info',\n design: 'filled',\n class: tw([\n 'text-on-error bg-info',\n 'hover:bg-info-hovered enabled:active:bg-info-hovered',\n 'focus-visible:bg-info-hovered',\n ]),\n },\n // Neutral\n {\n intent: 'neutral',\n design: 'filled',\n class: tw([\n 'bg-neutral',\n 'text-on-neutral',\n 'hover:bg-neutral-hovered',\n 'enabled:active:bg-neutral-hovered',\n 'focus-visible:bg-neutral-hovered',\n ]),\n },\n // Surface\n {\n intent: 'surface',\n design: 'filled',\n class: tw([\n 'bg-surface',\n 'text-on-surface',\n 'hover:bg-surface-hovered',\n 'enabled:active:bg-surface-hovered',\n 'focus-visible:bg-surface-hovered',\n ]),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const ghostVariants = [\n {\n intent: 'main',\n design: 'ghost',\n class: tw([\n 'text-main',\n 'hover:bg-main/dim-5',\n 'enabled:active:bg-main/dim-5',\n 'focus-visible:bg-main/dim-5',\n ]),\n },\n {\n intent: 'support',\n design: 'ghost',\n class: tw([\n 'text-support',\n 'hover:bg-support/dim-5',\n 'enabled:active:bg-support/dim-5',\n 'focus-visible:bg-support/dim-5',\n ]),\n },\n {\n intent: 'accent',\n design: 'ghost',\n class: tw([\n 'text-accent',\n 'hover:bg-accent/dim-5',\n 'enabled:active:bg-accent/dim-5',\n 'focus-visible:bg-accent/dim-5',\n ]),\n },\n {\n intent: 'basic',\n design: 'ghost',\n class: tw([\n 'text-basic',\n 'hover:bg-basic/dim-5',\n 'enabled:active:bg-basic/dim-5',\n 'focus-visible:bg-basic/dim-5',\n ]),\n },\n {\n intent: 'success',\n design: 'ghost',\n class: tw([\n 'text-success',\n 'hover:bg-success/dim-5',\n 'enabled:active:bg-success/dim-5',\n 'focus-visible:bg-success/dim-5',\n ]),\n },\n {\n intent: 'alert',\n design: 'ghost',\n class: tw([\n 'text-alert',\n 'hover:bg-alert/dim-5',\n 'enabled:active:bg-alert/dim-5',\n 'focus-visible:bg-alert/dim-5',\n ]),\n },\n {\n intent: 'danger',\n design: 'ghost',\n class: tw([\n 'text-error',\n 'hover:bg-error/dim-5',\n 'enabled:active:bg-error/dim-5',\n 'focus-visible:bg-error/dim-5',\n ]),\n },\n {\n intent: 'info',\n design: 'ghost',\n class: tw([\n 'text-info',\n 'hover:bg-info/dim-5',\n 'enabled:active:bg-info/dim-5',\n 'focus-visible:bg-info/dim-5',\n ]),\n },\n {\n intent: 'neutral',\n design: 'ghost',\n class: tw([\n 'text-neutral',\n 'hover:bg-neutral/dim-5',\n 'enabled:active:bg-neutral/dim-5',\n 'focus-visible:bg-neutral/dim-5',\n ]),\n },\n {\n intent: 'surface',\n design: 'ghost',\n class: tw([\n 'text-surface',\n 'hover:bg-surface/dim-5',\n 'enabled:active:bg-surface/dim-5',\n 'focus-visible:bg-surface/dim-5',\n ]),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const outlinedVariants = [\n {\n intent: 'main',\n design: 'outlined',\n class: tw([\n 'hover:bg-main/dim-5',\n 'enabled:active:bg-main/dim-5',\n 'focus-visible:bg-main/dim-5',\n 'text-main',\n ]),\n },\n {\n intent: 'support',\n design: 'outlined',\n class: tw([\n 'hover:bg-support/dim-5',\n 'enabled:active:bg-support/dim-5',\n 'focus-visible:bg-support/dim-5',\n 'text-support',\n ]),\n },\n {\n intent: 'accent',\n design: 'outlined',\n class: tw([\n 'hover:bg-accent/dim-5',\n 'enabled:active:bg-accent/dim-5',\n 'focus-visible:bg-accent/dim-5',\n 'text-accent',\n ]),\n },\n {\n intent: 'basic',\n design: 'outlined',\n class: tw([\n 'hover:bg-basic/dim-5',\n 'enabled:active:bg-basic/dim-5',\n 'focus-visible:bg-basic/dim-5',\n 'text-basic',\n ]),\n },\n {\n intent: 'success',\n design: 'outlined',\n class: tw([\n 'hover:bg-success/dim-5',\n 'enabled:active:bg-success/dim-5',\n 'focus-visible:bg-success/dim-5',\n 'text-success',\n ]),\n },\n {\n intent: 'alert',\n design: 'outlined',\n class: tw([\n 'hover:bg-alert/dim-5',\n 'enabled:active:bg-alert/dim-5',\n 'focus-visible:bg-alert/dim-5',\n 'text-alert',\n ]),\n },\n {\n intent: 'danger',\n design: 'outlined',\n class: tw([\n 'hover:bg-error/dim-5',\n 'enabled:active:bg-error/dim-5',\n 'focus-visible:bg-error/dim-5',\n 'text-error',\n ]),\n },\n {\n intent: 'info',\n design: 'outlined',\n class: tw([\n 'hover:bg-info/dim-5',\n 'enabled:active:bg-info/dim-5',\n 'focus-visible:bg-info/dim-5',\n 'text-info',\n ]),\n },\n {\n intent: 'neutral',\n design: 'outlined',\n class: tw([\n 'hover:bg-neutral/dim-5',\n 'enabled:active:bg-neutral/dim-5',\n 'focus-visible:bg-neutral/dim-5',\n 'text-neutral',\n ]),\n },\n {\n intent: 'surface',\n design: 'outlined',\n class: tw([\n 'hover:bg-surface/dim-5',\n 'enabled:active:bg-surface/dim-5',\n 'focus-visible:bg-surface/dim-5',\n 'text-surface',\n ]),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const tintedVariants = [\n {\n intent: 'main',\n design: 'tinted',\n class: tw([\n 'bg-main-container',\n 'text-on-main-container',\n 'hover:bg-main-container-hovered',\n 'enabled:active:bg-main-container-hovered',\n 'focus-visible:bg-main-container-hovered',\n ]),\n },\n {\n intent: 'support',\n design: 'tinted',\n class: tw([\n 'bg-support-container',\n 'text-on-support-container',\n 'hover:bg-support-container-hovered',\n 'enabled:active:bg-support-container-hovered',\n 'focus-visible:bg-support-container-hovered',\n ]),\n },\n {\n intent: 'accent',\n design: 'tinted',\n class: tw([\n 'bg-accent-container',\n 'text-on-accent-container',\n 'hover:bg-accent-container-hovered',\n 'enabled:active:bg-accent-container-hovered',\n 'focus-visible:bg-accent-container-hovered',\n ]),\n },\n {\n intent: 'basic',\n design: 'tinted',\n class: tw([\n 'bg-basic-container',\n 'text-on-basic-container',\n 'hover:bg-basic-container-hovered',\n 'enabled:active:bg-basic-container-hovered',\n 'focus-visible:bg-basic-container-hovered',\n ]),\n },\n {\n intent: 'success',\n design: 'tinted',\n class: tw([\n 'bg-success-container',\n 'text-on-success-container',\n 'hover:bg-success-container-hovered',\n 'enabled:active:bg-success-container-hovered',\n 'focus-visible:bg-success-container-hovered',\n ]),\n },\n {\n intent: 'alert',\n design: 'tinted',\n class: tw([\n 'bg-alert-container',\n 'text-on-alert-container',\n 'hover:bg-alert-container-hovered',\n 'enabled:active:bg-alert-container-hovered',\n 'focus-visible:bg-alert-container-hovered',\n ]),\n },\n {\n intent: 'danger',\n design: 'tinted',\n class: tw([\n 'bg-error-container',\n 'text-on-error-container',\n 'hover:bg-error-container-hovered',\n 'enabled:active:bg-error-container-hovered',\n 'focus-visible:bg-error-container-hovered',\n ]),\n },\n {\n intent: 'info',\n design: 'tinted',\n class: tw([\n 'bg-info-container',\n 'text-on-info-container',\n 'hover:bg-info-container-hovered',\n 'enabled:active:bg-info-container-hovered',\n 'focus-visible:bg-info-container-hovered',\n ]),\n },\n {\n intent: 'neutral',\n design: 'tinted',\n class: tw([\n 'bg-neutral-container',\n 'text-on-neutral-container',\n 'hover:bg-neutral-container-hovered',\n 'enabled:active:bg-neutral-container-hovered',\n 'focus-visible:bg-neutral-container-hovered',\n ]),\n },\n {\n intent: 'surface',\n design: 'tinted',\n class: tw([\n 'bg-surface',\n 'text-on-surface',\n 'hover:bg-surface-hovered',\n 'enabled:active:bg-surface-hovered',\n 'focus-visible:bg-surface-hovered',\n ]),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const contrastVariants = [\n {\n intent: 'main',\n design: 'contrast',\n class: tw([\n 'text-main',\n 'hover:bg-main-container-hovered',\n 'enabled:active:bg-main-container-hovered',\n 'focus-visible:bg-main-container-hovered',\n ]),\n },\n {\n intent: 'support',\n design: 'contrast',\n class: tw([\n 'text-support',\n 'hover:bg-support-container-hovered',\n 'enabled:active:bg-support-container-hovered',\n 'focus-visible:bg-support-container-hovered',\n ]),\n },\n {\n intent: 'accent',\n design: 'contrast',\n class: tw([\n 'text-accent',\n 'hover:bg-accent-container-hovered',\n 'enabled:active:bg-accent-container-hovered',\n 'focus-visible:bg-accent-container-hovered',\n ]),\n },\n {\n intent: 'basic',\n design: 'contrast',\n class: tw([\n 'text-basic',\n 'hover:bg-basic-container-hovered',\n 'enabled:active:bg-basic-container-hovered',\n 'focus-visible:bg-basic-container-hovered',\n ]),\n },\n {\n intent: 'success',\n design: 'contrast',\n class: tw([\n 'text-success',\n 'hover:bg-success-container-hovered',\n 'enabled:active:bg-success-container-hovered',\n 'focus-visible:bg-success-container-hovered',\n ]),\n },\n {\n intent: 'alert',\n design: 'contrast',\n class: tw([\n 'text-alert',\n 'hover:bg-alert-container-hovered',\n 'enabled:active:bg-alert-container-hovered',\n 'focus-visible:bg-alert-container-hovered',\n ]),\n },\n {\n intent: 'danger',\n design: 'contrast',\n class: tw([\n 'text-error',\n 'hover:bg-error-container-hovered',\n 'enabled:active:bg-error-container-hovered',\n 'focus-visible:bg-error-container-hovered',\n ]),\n },\n {\n intent: 'info',\n design: 'contrast',\n class: tw([\n 'text-info',\n 'hover:bg-info-container-hovered',\n 'enabled:active:bg-info-container-hovered',\n 'focus-visible:bg-info-container-hovered',\n ]),\n },\n {\n intent: 'neutral',\n design: 'contrast',\n class: tw([\n 'text-neutral',\n 'hover:bg-neutral-container-hovered',\n 'enabled:active:bg-neutral-container-hovered',\n 'focus-visible:bg-neutral-container-hovered',\n ]),\n },\n {\n intent: 'surface',\n design: 'contrast',\n class: tw([\n 'text-on-surface',\n 'hover:bg-surface-hovered',\n 'enabled:active:bg-surface-hovered',\n 'focus-visible:bg-surface-hovered',\n ]),\n },\n] as const\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\n// override the Button component's px-lg padding by using a more specific class selector (pl-0 pr-0)\nexport const iconButtonStyles = cva(['pl-0 pr-0'], {\n variants: {\n /**\n * Sets the size of the icon.\n */\n size: makeVariants<'size', ['sm', 'md', 'lg']>({\n sm: ['text-body-1'],\n md: ['text-body-1'],\n lg: ['text-display-3'],\n }),\n },\n})\n\nexport type IconButtonStylesProps = VariantProps<typeof iconButtonStyles>\n","import { Ref } from 'react'\n\nimport { Button, ButtonProps } from '../button'\nimport { iconButtonStyles } from './IconButton.styles'\n\nexport interface IconButtonProps extends Omit<ButtonProps, 'loadingText'> {\n 'aria-label': string\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const IconButton = ({\n design = 'filled',\n disabled = false,\n intent = 'main',\n shape = 'rounded',\n size = 'md',\n className,\n ref,\n ...others\n}: IconButtonProps) => {\n return (\n <Button\n ref={ref}\n className={iconButtonStyles({ size, className })}\n design={design}\n disabled={disabled}\n intent={intent}\n shape={shape}\n size={size}\n {...others}\n />\n )\n}\n\nIconButton.displayName = 'IconButton'\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef } from 'react'\n\nimport { useAvatarContext } from './context'\n\ninterface AvatarOnlineBadgeProps extends ComponentPropsWithoutRef<'div'> {\n angle?: number\n}\n\nexport const AvatarOnlineBadge = ({ angle = 135, ...props }: AvatarOnlineBadgeProps) => {\n const { isOnline, pixelSize, design, onlineText, size } = useAvatarContext()\n\n if (!isOnline) return null\n\n function getBadgePosition(circleSize: number) {\n const angleRad = ((90 - angle) * Math.PI) / 180\n const circleRadius = circleSize / 2\n\n return {\n x: circleRadius + circleRadius * Math.cos(angleRad),\n y: circleRadius - circleRadius * Math.sin(angleRad),\n }\n }\n\n const badgePosition = getBadgePosition(pixelSize)\n\n return (\n <div\n role=\"status\"\n aria-label={onlineText}\n style={{\n ...(design === 'circle'\n ? { left: `${badgePosition.x}px`, top: `${badgePosition.y}px` }\n : { right: '0px', bottom: '0px' }),\n }}\n className={cx(\n 'bg-success outline-surface absolute rounded-full',\n design === 'circle'\n ? '-translate-x-1/2 -translate-y-1/2'\n : 'translate-x-1/4 translate-y-1/4',\n ['lg', 'xl', '2xl'].includes(size) ? cx('size-sz-12 outline-4') : cx('size-sz-8 outline-2')\n )}\n {...props}\n />\n )\n}\n\nAvatarOnlineBadge.displayName = 'AvatarOnlineBadge'\n","import { cx } from 'class-variance-authority'\n\nimport { Slot } from '../slot'\nimport { useAvatarContext } from './context'\n\nexport interface AvatarImageProps extends React.ImgHTMLAttributes<HTMLDivElement> {\n asChild?: boolean\n}\n\nexport const AvatarUser = ({ asChild, children, className, ...props }: AvatarImageProps) => {\n const { design, isOnline, onlineText, username } = useAvatarContext()\n const Comp = asChild ? Slot : 'div'\n\n const accessibleName = isOnline && onlineText ? `${username} (${onlineText})` : username\n\n return (\n <Comp\n {...(!asChild && { role: 'img' })}\n aria-label={accessibleName}\n title={accessibleName}\n className={cx(\n 'group default:border-outline relative size-full overflow-hidden',\n 'focus-visible:u-outline',\n {\n 'default:rounded-full': design === 'circle',\n 'default:rounded-md': design === 'square',\n 'hover:opacity-dim-1 cursor-pointer': asChild || props.onClick,\n },\n className\n )}\n {...props}\n >\n {children}\n </Comp>\n )\n}\n\nAvatarUser.displayName = 'AvatarUser'\n","import { cx } from 'class-variance-authority'\n\nimport { useAvatarContext } from './context'\n\nexport interface AvatarPlaceholderProps extends React.ImgHTMLAttributes<HTMLDivElement> {\n className?: string\n children?: React.ReactNode\n}\n\nexport const AvatarPlaceholder = ({ className, children, ...props }: AvatarPlaceholderProps) => {\n const { size, username } = useAvatarContext()\n\n const firstLetter = username?.charAt(0)\n\n return (\n <div\n aria-hidden\n className={cx(\n 'absolute inset-0 flex size-full items-center justify-center',\n 'default:bg-neutral default:text-on-neutral',\n {\n 'text-display-1': size === '2xl',\n 'text-display-2': ['xl', 'lg'].includes(size),\n 'text-display-3': size === 'md',\n 'text-headline-2': size === 'sm',\n 'text-body-2 font-bold': size === 'xs',\n },\n className\n )}\n {...props}\n >\n {children || firstLetter}\n </div>\n )\n}\n\nAvatarPlaceholder.displayName = 'AvatarPlaceholder'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,sCAAmB;AACnB,IAAAA,SAAuB;;;ACDvB,sBAAkC;AAClC,mBAOO;AASE;AAPF,IAAM,YAAwC,gBAAAC,KAAU;AAMxD,IAAM,OAAO,CAAC,EAAE,KAAK,GAAG,MAAM,MAAiB;AACpD,SAAO,4CAAC,gBAAAA,KAAU,MAAV,EAAe,KAAW,GAAG,OAAO;AAC9C;AAMO,IAAM,sBAAsB,CACjC,SACA,UACA,aACG;AACH,MAAI,CAAC,QAAS,QAAO,SA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AAO,UAAU,OAAO;AAE9B,QAAM,iBAAiB,YAAY,aAAa,GAAG,QAAQ,KAAK,UAAU,MAAM;AAEhF,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAI,CAAC,WAAW,EAAE,MAAM,MAAM;AAAA,MAC/B,cAAY;AAAA,MACZ,OAAO;AAAA,MACP,eAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,UACE,wBAAwB,WAAW;AAAA,UACnC,sBAAsB,WAAW;AAAA,UACjC,sCAAsC,WAAW,MAAM;AAAA,QACzD;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;AAEA,WAAW,cAAc;;;ACrCzB,IAAAC,oCAAmB;AAef,IAAAC,uBAAA;AANG,IAAM,oBAAoB,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,MAA8B;AAC9F,QAAM,EAAE,MAAM,SAAS,IAAI,iBAAiB;AAE5C,QAAM,cAAc,UAAU,OAAO,CAAC;AAEtC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAW;AAAA,MACX,eAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,UACE,kBAAkB,SAAS;AAAA,UAC3B,kBAAkB,CAAC,MAAM,IAAI,EAAE,SAAS,IAAI;AAAA,UAC5C,kBAAkB,SAAS;AAAA,UAC3B,mBAAmB,SAAS;AAAA,UAC5B,yBAAyB,SAAS;AAAA,QACpC;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH,sBAAY;AAAA;AAAA,EACf;AAEJ;AAEA,kBAAkB,cAAc;;;AtBnBhC,IAAM,kBAAkB;AAExB,gBAAgB,QAAQ;AACxB,gBAAgB,SAAS;AACzB,gBAAgB,cAAc;AAC9B,gBAAgB,OAAO;AACvB,gBAAgB,cAAc;","names":["React","RadixSlot","import_jsx_runtime","import_class_variance_authority","import_react","import_jsx_runtime","import_class_variance_authority","import_react","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime","import_class_variance_authority","import_react","import_internal_utils","import_class_variance_authority","import_jsx_runtime","import_internal_utils","import_class_variance_authority","import_internal_utils","import_internal_utils","import_internal_utils","import_internal_utils","import_internal_utils","import_jsx_runtime","import_internal_utils","import_class_variance_authority","import_jsx_runtime","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime"]}
|
|
1
|
+
{"version":3,"sources":["../../src/avatar/index.ts","../../src/avatar/Avatar.tsx","../../src/slot/Slot.tsx","../../src/avatar/context.ts","../../src/avatar/AvatarImage.tsx","../../src/avatar/AvatarAction.tsx","../../src/icon/Icon.tsx","../../src/visually-hidden/VisuallyHidden.tsx","../../src/icon/Icon.styles.tsx","../../src/button/Button.tsx","../../src/spinner/Spinner.styles.tsx","../../src/spinner/Spinner.tsx","../../src/button/Button.styles.tsx","../../src/button/variants/filled.ts","../../src/button/variants/ghost.ts","../../src/button/variants/outlined.ts","../../src/button/variants/tinted.ts","../../src/button/variants/contrast.ts","../../src/icon-button/IconButton.styles.tsx","../../src/icon-button/IconButton.tsx","../../src/avatar/AvatarOnlineBadge.tsx","../../src/avatar/AvatarUser.tsx","../../src/avatar/AvatarPlaceholder.tsx"],"sourcesContent":["import { Avatar } from './Avatar'\nimport { AvatarImage } from './AvatarImage'\nimport { AvatarAction } from './AvatarAction'\nimport { AvatarOnlineBadge } from './AvatarOnlineBadge'\nimport { AvatarUser } from './AvatarUser'\nimport { AvatarPlaceholder } from './AvatarPlaceholder'\nimport type { AvatarProps } from './types'\n\nexport interface AvatarComponent\n extends React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLDivElement>> {\n Image: typeof AvatarImage\n Action: typeof AvatarAction\n OnlineBadge: typeof AvatarOnlineBadge\n User: typeof AvatarUser\n Placeholder: typeof AvatarPlaceholder\n}\n\nconst AvatarComponent = Avatar as AvatarComponent\n\nAvatarComponent.Image = AvatarImage\nAvatarComponent.Action = AvatarAction\nAvatarComponent.OnlineBadge = AvatarOnlineBadge\nAvatarComponent.User = AvatarUser\nAvatarComponent.Placeholder = AvatarPlaceholder\nexport { AvatarComponent as Avatar }\n","import { cx } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { Slot } from '../slot'\nimport { AvatarContext } from './context'\nimport type { AvatarProps } from './types'\n\nconst sizeMap = {\n xs: 24,\n sm: 32,\n md: 40,\n lg: 56,\n xl: 64, // default\n '2xl': 96,\n}\n\nexport const Avatar = React.forwardRef<HTMLDivElement, AvatarProps>(\n (\n {\n className,\n size = 'xl',\n isOnline = false,\n onlineText,\n username,\n asChild,\n children,\n design = 'circle',\n ...props\n },\n ref\n ) => {\n const Comp = asChild ? Slot : 'div'\n const contextValue = React.useMemo(\n () => ({\n size,\n isOnline,\n onlineText,\n username,\n design,\n pixelSize: sizeMap[size],\n }),\n [size, isOnline, username, design, onlineText]\n )\n\n return (\n <AvatarContext.Provider value={contextValue}>\n <Comp\n ref={ref}\n style={{\n width: sizeMap[size],\n height: sizeMap[size],\n }}\n data-spark-component=\"avatar\"\n className={cx('relative inline-flex items-center justify-center', className)}\n {...props}\n >\n {children}\n </Comp>\n </AvatarContext.Provider>\n )\n }\n)\n\nAvatar.displayName = 'Avatar'\n","import { Slot as RadixSlot } from 'radix-ui'\nimport {\n cloneElement,\n HTMLAttributes,\n isValidElement,\n PropsWithChildren,\n ReactNode,\n Ref,\n} from 'react'\n\nexport const Slottable: typeof RadixSlot.Slottable = RadixSlot.Slottable\n\nexport type SlotProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {\n ref?: Ref<HTMLElement>\n}\n\nexport const Slot = ({ ref, ...props }: SlotProps) => {\n return <RadixSlot.Root ref={ref} {...props} />\n}\n\n/**\n * When using Radix `Slot` component, it will consider its first child to merge its props with.\n * In some cases, you might need to wrap the top child with additional markup without breaking this behaviour.\n */\nexport const wrapPolymorphicSlot = (\n asChild: boolean | undefined,\n children: ReactNode,\n callback: (children: ReactNode) => ReactNode\n) => {\n if (!asChild) return callback(children) // If polymorphic behaviour is not used, we keep the original children\n\n return isValidElement(children)\n ? cloneElement(\n children,\n undefined,\n callback((children.props as { children: ReactNode }).children)\n )\n : null\n}\n","import * as React from 'react'\nimport type { AvatarContextValue } from './types'\n\nconst AvatarContext = React.createContext<AvatarContextValue | undefined>(undefined)\n\nexport const useAvatarContext = () => {\n const context = React.useContext(AvatarContext)\n if (!context) {\n throw new Error('useAvatarContext must be used within an Avatar component')\n }\n return context\n}\n\nexport { AvatarContext }\n","import { cx } from 'class-variance-authority'\nimport { useState } from 'react'\n\nimport { Slot } from '../slot'\nimport { useAvatarContext } from './context'\n\nexport interface AvatarImageProps extends React.ImgHTMLAttributes<HTMLImageElement> {\n asChild?: boolean\n}\n\nexport const AvatarImage = ({ className, asChild, src, ...props }: AvatarImageProps) => {\n const { username, isOnline, onlineText } = useAvatarContext()\n const Comp = asChild ? Slot : 'img'\n\n const [isVisible, setIsVisible] = useState(false)\n\n const accessibleName = isOnline && onlineText ? `${username} (${onlineText})` : username\n\n return (\n <Comp\n aria-hidden\n className={cx(\n 'absolute inset-0 size-full',\n 'object-cover',\n { 'transition-all duration-300 group-hover:scale-120': props.onClick },\n 'focus-visible:u-outline',\n isVisible ? 'block' : 'hidden',\n className\n )}\n alt={accessibleName}\n src={src}\n onLoad={() => {\n setIsVisible(true)\n }}\n {...props}\n />\n )\n}\n\nAvatarImage.displayName = 'AvatarImage'\n","import { PenOutline } from '@spark-ui/icons/PenOutline'\nimport { cx } from 'class-variance-authority'\n\nimport { Icon } from '../icon'\nimport { IconButton } from '../icon-button'\nimport { Slot } from '../slot'\nimport { useAvatarContext } from './context'\n\nexport interface AvatarActionProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n asChild?: boolean\n angle?: number\n ariaLabel: string\n}\n\nexport const AvatarAction = ({\n className,\n children,\n asChild,\n angle = 135,\n ariaLabel,\n ...props\n}: AvatarActionProps) => {\n const Comp = asChild ? Slot : IconButton\n const { pixelSize, design } = useAvatarContext()\n\n function getBadgePosition(circleSize: number) {\n const angleRad = ((90 - angle) * Math.PI) / 180\n const circleRadius = circleSize / 2\n\n return {\n x: circleRadius + circleRadius * Math.cos(angleRad),\n y: circleRadius - circleRadius * Math.sin(angleRad),\n }\n }\n\n const position = getBadgePosition(pixelSize)\n\n const isCustomElement = asChild\n\n return (\n <Comp\n data-spark-component=\"avatar-action\"\n style={{\n position: 'absolute',\n ...(design === 'circle' ? { left: `${position.x}px`, top: `${position.y}px` } : {}),\n ...(design === 'square' ? { right: '0px', bottom: '0px' } : {}),\n }}\n className={cx(\n 'z-raised',\n design === 'circle'\n ? '-translate-x-1/2 -translate-y-1/2'\n : 'translate-x-1/4 translate-y-1/4',\n { 'shadow-sm': !isCustomElement },\n className\n )}\n aria-label={ariaLabel}\n title={ariaLabel}\n {...(!isCustomElement ? { size: 'sm', intent: 'support', design: 'contrast' } : {})}\n {...props}\n >\n {children || (\n <Icon size=\"sm\">\n <PenOutline />\n </Icon>\n )}\n </Comp>\n )\n}\n\nAvatarAction.displayName = 'AvatarAction'\n","import { Children, cloneElement, ComponentPropsWithoutRef, ReactElement, ReactNode } from 'react'\n\nimport { VisuallyHidden } from '../visually-hidden'\nimport { iconStyles, IconVariantsProps } from './Icon.styles'\n\nexport interface IconProps extends IconVariantsProps, ComponentPropsWithoutRef<'svg'> {\n /**\n * The svg icon that will be wrapped\n */\n children: ReactNode\n /**\n * The accessible label for the icon. This label will be visually hidden but announced to screen\n * reader users, similar to `alt` text for `img` tags.\n */\n label?: string\n}\n\nexport const Icon = ({\n label,\n className,\n size = 'current',\n intent = 'current',\n children,\n ...others\n}: IconProps) => {\n const child = Children.only(children)\n\n return (\n <>\n {cloneElement(child as ReactElement<Record<string, any>>, {\n className: iconStyles({ className, size, intent }),\n 'data-spark-component': 'icon',\n 'aria-hidden': 'true',\n focusable: 'false',\n ...others,\n })}\n\n {label && <VisuallyHidden>{label}</VisuallyHidden>}\n </>\n )\n}\n\nIcon.displayName = 'Icon'\n","import { HTMLAttributes, PropsWithChildren, Ref } from 'react'\n\nimport { Slot } from '../slot'\n\nexport type VisuallyHiddenProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean\n ref?: Ref<HTMLElement>\n}\n\nexport const VisuallyHidden = ({ asChild = false, ref, ...props }: VisuallyHiddenProps) => {\n const Component = asChild ? Slot : 'span'\n\n return (\n <Component\n {...props}\n ref={ref}\n style={{\n // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss\n position: 'absolute',\n border: 0,\n width: 1,\n height: 1,\n padding: 0,\n margin: -1,\n overflow: 'hidden',\n clip: 'rect(0, 0, 0, 0)',\n whiteSpace: 'nowrap',\n wordWrap: 'normal',\n ...props.style,\n }}\n />\n )\n}\n\nVisuallyHidden.displayName = 'VisuallyHidden'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const iconStyles = cva(['fill-current shrink-0'], {\n variants: {\n /**\n * Color scheme of the icon.\n */\n intent: makeVariants<\n 'intent',\n [\n 'current',\n 'main',\n 'support',\n 'accent',\n 'basic',\n 'success',\n 'alert',\n 'error',\n 'info',\n 'neutral',\n ]\n >({\n current: ['text-current'],\n main: ['text-main'],\n support: ['text-support'],\n accent: ['text-accent'],\n basic: ['text-basic'],\n success: ['text-success'],\n alert: ['text-alert'],\n error: ['text-error'],\n info: ['text-info'],\n neutral: ['text-neutral'],\n }),\n /**\n * Sets the size of the icon.\n */\n size: makeVariants<'size', ['current', 'sm', 'md', 'lg', 'xl']>({\n current: ['u-current-font-size'],\n sm: ['w-sz-16', 'h-sz-16'],\n md: ['w-sz-24', 'h-sz-24'],\n lg: ['w-sz-32', 'h-sz-32'],\n xl: ['w-sz-40', 'h-sz-40'],\n }),\n },\n})\n\nexport type IconVariantsProps = VariantProps<typeof iconStyles>\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, type DOMAttributes, Ref, useMemo } from 'react'\n\nimport { Slot, wrapPolymorphicSlot } from '../slot'\nimport { Spinner, type SpinnerProps } from '../spinner'\nimport { buttonStyles, type ButtonStylesProps } from './Button.styles'\n\nexport interface ButtonProps\n extends Omit<ComponentPropsWithoutRef<'button'>, 'disabled'>,\n ButtonStylesProps {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n /**\n * Display a spinner to indicate to the user that the button is loading something after they interacted with it.\n */\n isLoading?: boolean\n /**\n * If your loading state should only display a spinner, it's better to specify a label for it (a11y).\n */\n loadingLabel?: string\n /**\n * If your loading state should also display a label, you can use this prop instead of `loadingLabel`.\n * **Please note that using this can result in layout shifting when the Button goes from loading state to normal state.**\n */\n loadingText?: string\n ref?: Ref<HTMLButtonElement>\n}\n\ntype DOMAttributesEventHandler = keyof Omit<\n DOMAttributes<HTMLButtonElement>,\n 'children' | 'dangerouslySetInnerHTML'\n>\n\nconst blockedEventHandlers: DOMAttributesEventHandler[] = [\n 'onClick',\n 'onMouseDown',\n 'onMouseUp',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseOver',\n 'onMouseOut',\n 'onKeyDown',\n 'onKeyPress',\n 'onKeyUp',\n 'onSubmit',\n]\n\nexport const Button = ({\n children,\n design = 'filled',\n disabled = false,\n intent = 'main',\n isLoading = false,\n loadingLabel,\n loadingText,\n shape = 'rounded',\n size = 'md',\n asChild,\n className,\n underline = false,\n ref,\n ...others\n}: ButtonProps) => {\n const Component = asChild ? Slot : 'button'\n\n const shouldNotInteract = !!disabled || isLoading\n\n const disabledEventHandlers = useMemo(() => {\n const result: Partial<Record<DOMAttributesEventHandler, () => void>> = {}\n\n if (shouldNotInteract) {\n blockedEventHandlers.forEach(eventHandler => (result[eventHandler] = undefined))\n }\n\n return result\n }, [shouldNotInteract])\n\n const spinnerProps = {\n size: 'current' as SpinnerProps['size'],\n className: loadingText ? 'inline-block' : 'absolute',\n ...(loadingLabel && { 'aria-label': loadingLabel }),\n }\n\n return (\n <Component\n data-spark-component=\"button\"\n {...(Component === 'button' && { type: 'button' })}\n ref={ref}\n className={buttonStyles({\n className,\n design,\n disabled: shouldNotInteract,\n intent,\n shape,\n size,\n underline,\n })}\n disabled={!!disabled}\n aria-busy={isLoading}\n aria-live={isLoading ? 'assertive' : 'off'}\n {...others}\n {...disabledEventHandlers}\n >\n {wrapPolymorphicSlot(asChild, children, slotted =>\n isLoading ? (\n <>\n <Spinner {...spinnerProps} />\n {loadingText && loadingText}\n\n <div\n aria-hidden\n className={cx('gap-md', loadingText ? 'hidden' : 'inline-flex opacity-0')}\n >\n {slotted}\n </div>\n </>\n ) : (\n slotted\n )\n )}\n </Component>\n )\n}\n\nButton.displayName = 'Button'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nconst defaultVariants = {\n intent: 'current',\n size: 'current',\n isBackgroundVisible: false,\n} as const\n\nexport const spinnerStyles = cva(\n ['inline-block', 'border-solid', 'rounded-full', 'border-md', 'animate-spin'],\n {\n variants: {\n /**\n * Use `size` prop to set the size of the spinner. If you want to set the full size for the spinner, don't forget to add a wrapping container with its own size.\n */\n size: {\n current: ['u-current-font-size'],\n sm: ['w-sz-20', 'h-sz-20'],\n md: ['w-sz-28', 'h-sz-28'],\n full: ['w-full', 'h-full'],\n },\n /**\n * Color scheme of the spinner.\n */\n intent: makeVariants<\n 'intent',\n [\n 'current',\n 'main',\n 'support',\n 'accent',\n 'basic',\n 'success',\n 'alert',\n 'error',\n 'info',\n 'neutral',\n ]\n >({\n current: ['border-current'],\n main: ['border-main'],\n support: ['border-support'],\n accent: ['border-accent'],\n basic: ['border-basic'],\n success: ['border-success'],\n alert: ['border-alert'],\n error: ['border-error'],\n info: ['border-info'],\n neutral: ['border-neutral'],\n }),\n /**\n * Size of the button.\n */\n isBackgroundVisible: {\n true: ['border-b-neutral-container', 'border-l-neutral-container'],\n false: ['border-b-transparent', 'border-l-transparent'],\n },\n },\n defaultVariants,\n }\n)\n\nexport type SpinnerStylesProps = VariantProps<typeof spinnerStyles>\n","import { ComponentPropsWithRef, PropsWithChildren } from 'react'\n\nimport { VisuallyHidden } from '../visually-hidden'\nimport { spinnerStyles, SpinnerStylesProps } from './Spinner.styles'\n\nexport interface SpinnerProps extends ComponentPropsWithRef<'div'>, SpinnerStylesProps {\n /**\n * Use `label` prop for accessibility, it is important to add a fallback loading text. This text will be visible to screen readers.\n */\n label?: string\n}\n\nexport const Spinner = ({\n className,\n size = 'current',\n intent = 'current',\n label,\n isBackgroundVisible,\n ref,\n ...others\n}: PropsWithChildren<SpinnerProps>) => {\n return (\n <span\n role=\"status\"\n data-spark-component=\"spinner\"\n ref={ref}\n className={spinnerStyles({ className, size, intent, isBackgroundVisible })}\n {...others}\n >\n {label && <VisuallyHidden>{label}</VisuallyHidden>}\n </span>\n )\n}\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nimport {\n contrastVariants,\n filledVariants,\n ghostVariants,\n outlinedVariants,\n tintedVariants,\n} from './variants'\n\nexport const buttonStyles = cva(\n [\n 'u-shadow-border-transition',\n 'box-border inline-flex items-center justify-center gap-md whitespace-nowrap',\n 'default:px-lg',\n 'text-body-1 font-bold',\n 'focus-visible:u-outline',\n ],\n {\n variants: {\n /**\n * Main style of the button.\n *\n * - `filled`: Button will be plain.\n *\n * - `outlined`: Button will be transparent with an outline.\n *\n * - `tinted`: Button will be filled but using a lighter color scheme.\n *\n * - `ghost`: Button will look like a link. No borders, plain text.\n *\n * - `contrast`: Button will be surface filled. No borders, plain text.\n *\n */\n design: makeVariants<'design', ['filled', 'outlined', 'tinted', 'ghost', 'contrast']>({\n filled: [],\n outlined: ['bg-transparent', 'border-sm', 'border-current'],\n tinted: [],\n ghost: ['default:-mx-md px-md hover:bg-main/dim-5'],\n contrast: ['bg-surface'],\n }),\n underline: {\n true: ['underline'],\n },\n /**\n * Color scheme of the button.\n */\n intent: makeVariants<\n 'intent',\n [\n 'main',\n 'support',\n 'accent',\n 'basic',\n 'success',\n 'alert',\n 'danger',\n 'info',\n 'neutral',\n 'surface',\n ]\n >({\n main: [],\n support: [],\n accent: [],\n basic: [],\n success: [],\n alert: [],\n danger: [],\n info: [],\n neutral: [],\n surface: [],\n }),\n /**\n * Size of the button.\n */\n size: makeVariants<'size', ['sm', 'md', 'lg']>({\n sm: ['min-w-sz-32', 'h-sz-32'],\n md: ['min-w-sz-44', 'h-sz-44'],\n lg: ['min-w-sz-56', 'h-sz-56'],\n }),\n /**\n * Shape of the button.\n */\n shape: makeVariants<'shape', ['rounded', 'square', 'pill']>({\n rounded: ['rounded-lg'],\n square: ['rounded-0'],\n pill: ['rounded-full'],\n }),\n /**\n * Disable the button, preventing user interaction and adding opacity.\n */\n disabled: {\n true: ['cursor-not-allowed', 'opacity-dim-3'],\n false: ['cursor-pointer'],\n },\n },\n compoundVariants: [\n ...filledVariants,\n ...outlinedVariants,\n ...tintedVariants,\n ...ghostVariants,\n ...contrastVariants,\n ],\n defaultVariants: {\n design: 'filled',\n intent: 'main',\n size: 'md',\n shape: 'rounded',\n },\n }\n)\n\nexport type ButtonStylesProps = VariantProps<typeof buttonStyles>\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const filledVariants = [\n // Main\n {\n intent: 'main',\n design: 'filled',\n class: tw([\n 'bg-main',\n 'text-on-main',\n 'hover:bg-main-hovered',\n 'enabled:active:bg-main-hovered',\n 'focus-visible:bg-main-hovered',\n ]),\n },\n // Support\n {\n intent: 'support',\n design: 'filled',\n class: tw([\n 'bg-support',\n 'text-on-support',\n 'hover:bg-support-hovered',\n 'enabled:active:bg-support-hovered',\n 'focus-visible:bg-support-hovered',\n ]),\n },\n // Accent\n {\n intent: 'accent',\n design: 'filled',\n class: tw([\n 'bg-accent',\n 'text-on-accent',\n 'hover:bg-accent-hovered',\n 'enabled:active:bg-accent-hovered',\n 'focus-visible:bg-accent-hovered',\n ]),\n },\n // Basic\n {\n intent: 'basic',\n design: 'filled',\n class: tw([\n 'bg-basic',\n 'text-on-basic',\n 'hover:bg-basic-hovered',\n 'enabled:active:bg-basic-hovered',\n 'focus-visible:bg-basic-hovered',\n ]),\n },\n // Success\n {\n intent: 'success',\n design: 'filled',\n class: tw([\n 'bg-success',\n 'text-on-success',\n 'hover:bg-success-hovered',\n 'enabled:active:bg-success-hovered',\n 'focus-visible:bg-success-hovered',\n ]),\n },\n // Alert\n {\n intent: 'alert',\n design: 'filled',\n class: tw([\n 'bg-alert',\n 'text-on-alert',\n 'hover:bg-alert-hovered',\n 'enabled:active:bg-alert-hovered',\n 'focus-visible:bg-alert-hovered',\n ]),\n },\n // Danger\n {\n intent: 'danger',\n design: 'filled',\n class: tw([\n 'text-on-error bg-error',\n 'hover:bg-error-hovered enabled:active:bg-error-hovered',\n 'focus-visible:bg-error-hovered',\n ]),\n },\n // Info\n {\n intent: 'info',\n design: 'filled',\n class: tw([\n 'text-on-error bg-info',\n 'hover:bg-info-hovered enabled:active:bg-info-hovered',\n 'focus-visible:bg-info-hovered',\n ]),\n },\n // Neutral\n {\n intent: 'neutral',\n design: 'filled',\n class: tw([\n 'bg-neutral',\n 'text-on-neutral',\n 'hover:bg-neutral-hovered',\n 'enabled:active:bg-neutral-hovered',\n 'focus-visible:bg-neutral-hovered',\n ]),\n },\n // Surface\n {\n intent: 'surface',\n design: 'filled',\n class: tw([\n 'bg-surface',\n 'text-on-surface',\n 'hover:bg-surface-hovered',\n 'enabled:active:bg-surface-hovered',\n 'focus-visible:bg-surface-hovered',\n ]),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const ghostVariants = [\n {\n intent: 'main',\n design: 'ghost',\n class: tw([\n 'text-main',\n 'hover:bg-main/dim-5',\n 'enabled:active:bg-main/dim-5',\n 'focus-visible:bg-main/dim-5',\n ]),\n },\n {\n intent: 'support',\n design: 'ghost',\n class: tw([\n 'text-support',\n 'hover:bg-support/dim-5',\n 'enabled:active:bg-support/dim-5',\n 'focus-visible:bg-support/dim-5',\n ]),\n },\n {\n intent: 'accent',\n design: 'ghost',\n class: tw([\n 'text-accent',\n 'hover:bg-accent/dim-5',\n 'enabled:active:bg-accent/dim-5',\n 'focus-visible:bg-accent/dim-5',\n ]),\n },\n {\n intent: 'basic',\n design: 'ghost',\n class: tw([\n 'text-basic',\n 'hover:bg-basic/dim-5',\n 'enabled:active:bg-basic/dim-5',\n 'focus-visible:bg-basic/dim-5',\n ]),\n },\n {\n intent: 'success',\n design: 'ghost',\n class: tw([\n 'text-success',\n 'hover:bg-success/dim-5',\n 'enabled:active:bg-success/dim-5',\n 'focus-visible:bg-success/dim-5',\n ]),\n },\n {\n intent: 'alert',\n design: 'ghost',\n class: tw([\n 'text-alert',\n 'hover:bg-alert/dim-5',\n 'enabled:active:bg-alert/dim-5',\n 'focus-visible:bg-alert/dim-5',\n ]),\n },\n {\n intent: 'danger',\n design: 'ghost',\n class: tw([\n 'text-error',\n 'hover:bg-error/dim-5',\n 'enabled:active:bg-error/dim-5',\n 'focus-visible:bg-error/dim-5',\n ]),\n },\n {\n intent: 'info',\n design: 'ghost',\n class: tw([\n 'text-info',\n 'hover:bg-info/dim-5',\n 'enabled:active:bg-info/dim-5',\n 'focus-visible:bg-info/dim-5',\n ]),\n },\n {\n intent: 'neutral',\n design: 'ghost',\n class: tw([\n 'text-neutral',\n 'hover:bg-neutral/dim-5',\n 'enabled:active:bg-neutral/dim-5',\n 'focus-visible:bg-neutral/dim-5',\n ]),\n },\n {\n intent: 'surface',\n design: 'ghost',\n class: tw([\n 'text-surface',\n 'hover:bg-surface/dim-5',\n 'enabled:active:bg-surface/dim-5',\n 'focus-visible:bg-surface/dim-5',\n ]),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const outlinedVariants = [\n {\n intent: 'main',\n design: 'outlined',\n class: tw([\n 'hover:bg-main/dim-5',\n 'enabled:active:bg-main/dim-5',\n 'focus-visible:bg-main/dim-5',\n 'text-main',\n ]),\n },\n {\n intent: 'support',\n design: 'outlined',\n class: tw([\n 'hover:bg-support/dim-5',\n 'enabled:active:bg-support/dim-5',\n 'focus-visible:bg-support/dim-5',\n 'text-support',\n ]),\n },\n {\n intent: 'accent',\n design: 'outlined',\n class: tw([\n 'hover:bg-accent/dim-5',\n 'enabled:active:bg-accent/dim-5',\n 'focus-visible:bg-accent/dim-5',\n 'text-accent',\n ]),\n },\n {\n intent: 'basic',\n design: 'outlined',\n class: tw([\n 'hover:bg-basic/dim-5',\n 'enabled:active:bg-basic/dim-5',\n 'focus-visible:bg-basic/dim-5',\n 'text-basic',\n ]),\n },\n {\n intent: 'success',\n design: 'outlined',\n class: tw([\n 'hover:bg-success/dim-5',\n 'enabled:active:bg-success/dim-5',\n 'focus-visible:bg-success/dim-5',\n 'text-success',\n ]),\n },\n {\n intent: 'alert',\n design: 'outlined',\n class: tw([\n 'hover:bg-alert/dim-5',\n 'enabled:active:bg-alert/dim-5',\n 'focus-visible:bg-alert/dim-5',\n 'text-alert',\n ]),\n },\n {\n intent: 'danger',\n design: 'outlined',\n class: tw([\n 'hover:bg-error/dim-5',\n 'enabled:active:bg-error/dim-5',\n 'focus-visible:bg-error/dim-5',\n 'text-error',\n ]),\n },\n {\n intent: 'info',\n design: 'outlined',\n class: tw([\n 'hover:bg-info/dim-5',\n 'enabled:active:bg-info/dim-5',\n 'focus-visible:bg-info/dim-5',\n 'text-info',\n ]),\n },\n {\n intent: 'neutral',\n design: 'outlined',\n class: tw([\n 'hover:bg-neutral/dim-5',\n 'enabled:active:bg-neutral/dim-5',\n 'focus-visible:bg-neutral/dim-5',\n 'text-neutral',\n ]),\n },\n {\n intent: 'surface',\n design: 'outlined',\n class: tw([\n 'hover:bg-surface/dim-5',\n 'enabled:active:bg-surface/dim-5',\n 'focus-visible:bg-surface/dim-5',\n 'text-surface',\n ]),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const tintedVariants = [\n {\n intent: 'main',\n design: 'tinted',\n class: tw([\n 'bg-main-container',\n 'text-on-main-container',\n 'hover:bg-main-container-hovered',\n 'enabled:active:bg-main-container-hovered',\n 'focus-visible:bg-main-container-hovered',\n ]),\n },\n {\n intent: 'support',\n design: 'tinted',\n class: tw([\n 'bg-support-container',\n 'text-on-support-container',\n 'hover:bg-support-container-hovered',\n 'enabled:active:bg-support-container-hovered',\n 'focus-visible:bg-support-container-hovered',\n ]),\n },\n {\n intent: 'accent',\n design: 'tinted',\n class: tw([\n 'bg-accent-container',\n 'text-on-accent-container',\n 'hover:bg-accent-container-hovered',\n 'enabled:active:bg-accent-container-hovered',\n 'focus-visible:bg-accent-container-hovered',\n ]),\n },\n {\n intent: 'basic',\n design: 'tinted',\n class: tw([\n 'bg-basic-container',\n 'text-on-basic-container',\n 'hover:bg-basic-container-hovered',\n 'enabled:active:bg-basic-container-hovered',\n 'focus-visible:bg-basic-container-hovered',\n ]),\n },\n {\n intent: 'success',\n design: 'tinted',\n class: tw([\n 'bg-success-container',\n 'text-on-success-container',\n 'hover:bg-success-container-hovered',\n 'enabled:active:bg-success-container-hovered',\n 'focus-visible:bg-success-container-hovered',\n ]),\n },\n {\n intent: 'alert',\n design: 'tinted',\n class: tw([\n 'bg-alert-container',\n 'text-on-alert-container',\n 'hover:bg-alert-container-hovered',\n 'enabled:active:bg-alert-container-hovered',\n 'focus-visible:bg-alert-container-hovered',\n ]),\n },\n {\n intent: 'danger',\n design: 'tinted',\n class: tw([\n 'bg-error-container',\n 'text-on-error-container',\n 'hover:bg-error-container-hovered',\n 'enabled:active:bg-error-container-hovered',\n 'focus-visible:bg-error-container-hovered',\n ]),\n },\n {\n intent: 'info',\n design: 'tinted',\n class: tw([\n 'bg-info-container',\n 'text-on-info-container',\n 'hover:bg-info-container-hovered',\n 'enabled:active:bg-info-container-hovered',\n 'focus-visible:bg-info-container-hovered',\n ]),\n },\n {\n intent: 'neutral',\n design: 'tinted',\n class: tw([\n 'bg-neutral-container',\n 'text-on-neutral-container',\n 'hover:bg-neutral-container-hovered',\n 'enabled:active:bg-neutral-container-hovered',\n 'focus-visible:bg-neutral-container-hovered',\n ]),\n },\n {\n intent: 'surface',\n design: 'tinted',\n class: tw([\n 'bg-surface',\n 'text-on-surface',\n 'hover:bg-surface-hovered',\n 'enabled:active:bg-surface-hovered',\n 'focus-visible:bg-surface-hovered',\n ]),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const contrastVariants = [\n {\n intent: 'main',\n design: 'contrast',\n class: tw([\n 'text-main',\n 'hover:bg-main-container-hovered',\n 'enabled:active:bg-main-container-hovered',\n 'focus-visible:bg-main-container-hovered',\n ]),\n },\n {\n intent: 'support',\n design: 'contrast',\n class: tw([\n 'text-support',\n 'hover:bg-support-container-hovered',\n 'enabled:active:bg-support-container-hovered',\n 'focus-visible:bg-support-container-hovered',\n ]),\n },\n {\n intent: 'accent',\n design: 'contrast',\n class: tw([\n 'text-accent',\n 'hover:bg-accent-container-hovered',\n 'enabled:active:bg-accent-container-hovered',\n 'focus-visible:bg-accent-container-hovered',\n ]),\n },\n {\n intent: 'basic',\n design: 'contrast',\n class: tw([\n 'text-basic',\n 'hover:bg-basic-container-hovered',\n 'enabled:active:bg-basic-container-hovered',\n 'focus-visible:bg-basic-container-hovered',\n ]),\n },\n {\n intent: 'success',\n design: 'contrast',\n class: tw([\n 'text-success',\n 'hover:bg-success-container-hovered',\n 'enabled:active:bg-success-container-hovered',\n 'focus-visible:bg-success-container-hovered',\n ]),\n },\n {\n intent: 'alert',\n design: 'contrast',\n class: tw([\n 'text-alert',\n 'hover:bg-alert-container-hovered',\n 'enabled:active:bg-alert-container-hovered',\n 'focus-visible:bg-alert-container-hovered',\n ]),\n },\n {\n intent: 'danger',\n design: 'contrast',\n class: tw([\n 'text-error',\n 'hover:bg-error-container-hovered',\n 'enabled:active:bg-error-container-hovered',\n 'focus-visible:bg-error-container-hovered',\n ]),\n },\n {\n intent: 'info',\n design: 'contrast',\n class: tw([\n 'text-info',\n 'hover:bg-info-container-hovered',\n 'enabled:active:bg-info-container-hovered',\n 'focus-visible:bg-info-container-hovered',\n ]),\n },\n {\n intent: 'neutral',\n design: 'contrast',\n class: tw([\n 'text-neutral',\n 'hover:bg-neutral-container-hovered',\n 'enabled:active:bg-neutral-container-hovered',\n 'focus-visible:bg-neutral-container-hovered',\n ]),\n },\n {\n intent: 'surface',\n design: 'contrast',\n class: tw([\n 'text-on-surface',\n 'hover:bg-surface-hovered',\n 'enabled:active:bg-surface-hovered',\n 'focus-visible:bg-surface-hovered',\n ]),\n },\n] as const\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\n// override the Button component's px-lg padding by using a more specific class selector (pl-0 pr-0)\nexport const iconButtonStyles = cva(['pl-0 pr-0'], {\n variants: {\n /**\n * Sets the size of the icon.\n */\n size: makeVariants<'size', ['sm', 'md', 'lg']>({\n sm: ['text-body-1'],\n md: ['text-body-1'],\n lg: ['text-display-3'],\n }),\n },\n})\n\nexport type IconButtonStylesProps = VariantProps<typeof iconButtonStyles>\n","import { Ref } from 'react'\n\nimport { Button, ButtonProps } from '../button'\nimport { iconButtonStyles } from './IconButton.styles'\n\nexport interface IconButtonProps extends Omit<ButtonProps, 'loadingText'> {\n 'aria-label': string\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const IconButton = ({\n design = 'filled',\n disabled = false,\n intent = 'main',\n shape = 'rounded',\n size = 'md',\n className,\n ref,\n ...others\n}: IconButtonProps) => {\n return (\n <Button\n data-spark-component=\"icon-button\"\n ref={ref}\n className={iconButtonStyles({ size, className })}\n design={design}\n disabled={disabled}\n intent={intent}\n shape={shape}\n size={size}\n {...others}\n />\n )\n}\n\nIconButton.displayName = 'IconButton'\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef } from 'react'\n\nimport { useAvatarContext } from './context'\n\ninterface AvatarOnlineBadgeProps extends ComponentPropsWithoutRef<'div'> {\n angle?: number\n}\n\nexport const AvatarOnlineBadge = ({ angle = 135, ...props }: AvatarOnlineBadgeProps) => {\n const { isOnline, pixelSize, design, onlineText, size } = useAvatarContext()\n\n if (!isOnline) return null\n\n function getBadgePosition(circleSize: number) {\n const angleRad = ((90 - angle) * Math.PI) / 180\n const circleRadius = circleSize / 2\n\n return {\n x: circleRadius + circleRadius * Math.cos(angleRad),\n y: circleRadius - circleRadius * Math.sin(angleRad),\n }\n }\n\n const badgePosition = getBadgePosition(pixelSize)\n\n return (\n <div\n data-spark-component=\"avatar-online-badge\"\n role=\"status\"\n aria-label={onlineText}\n style={{\n ...(design === 'circle'\n ? { left: `${badgePosition.x}px`, top: `${badgePosition.y}px` }\n : { right: '0px', bottom: '0px' }),\n }}\n className={cx(\n 'bg-success outline-surface absolute rounded-full',\n design === 'circle'\n ? '-translate-x-1/2 -translate-y-1/2'\n : 'translate-x-1/4 translate-y-1/4',\n ['lg', 'xl', '2xl'].includes(size) ? cx('size-sz-12 outline-4') : cx('size-sz-8 outline-2')\n )}\n {...props}\n />\n )\n}\n\nAvatarOnlineBadge.displayName = 'AvatarOnlineBadge'\n","import { cx } from 'class-variance-authority'\n\nimport { Slot } from '../slot'\nimport { useAvatarContext } from './context'\n\nexport interface AvatarImageProps extends React.ImgHTMLAttributes<HTMLDivElement> {\n asChild?: boolean\n}\n\nexport const AvatarUser = ({ asChild, children, className, ...props }: AvatarImageProps) => {\n const { design, isOnline, onlineText, username } = useAvatarContext()\n const Comp = asChild ? Slot : 'div'\n\n const accessibleName = isOnline && onlineText ? `${username} (${onlineText})` : username\n\n return (\n <Comp\n {...(!asChild && { role: 'img' })}\n aria-label={accessibleName}\n title={accessibleName}\n className={cx(\n 'group default:border-outline relative size-full overflow-hidden',\n 'focus-visible:u-outline',\n {\n 'default:rounded-full': design === 'circle',\n 'default:rounded-md': design === 'square',\n 'hover:opacity-dim-1 cursor-pointer': asChild || props.onClick,\n },\n className\n )}\n {...props}\n >\n {children}\n </Comp>\n )\n}\n\nAvatarUser.displayName = 'AvatarUser'\n","import { cx } from 'class-variance-authority'\n\nimport { useAvatarContext } from './context'\n\nexport interface AvatarPlaceholderProps extends React.ImgHTMLAttributes<HTMLDivElement> {\n className?: string\n children?: React.ReactNode\n}\n\nexport const AvatarPlaceholder = ({ className, children, ...props }: AvatarPlaceholderProps) => {\n const { size, username } = useAvatarContext()\n\n const firstLetter = username?.charAt(0)\n\n return (\n <div\n aria-hidden\n className={cx(\n 'absolute inset-0 flex size-full items-center justify-center',\n 'default:bg-neutral default:text-on-neutral',\n {\n 'text-display-1': size === '2xl',\n 'text-display-2': ['xl', 'lg'].includes(size),\n 'text-display-3': size === 'md',\n 'text-headline-2': size === 'sm',\n 'text-body-2 font-bold': size === 'xs',\n },\n className\n )}\n {...props}\n >\n {children || firstLetter}\n </div>\n )\n}\n\nAvatarPlaceholder.displayName = 'AvatarPlaceholder'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,sCAAmB;AACnB,IAAAA,SAAuB;;;ACDvB,sBAAkC;AAClC,mBAOO;AASE;AAPF,IAAM,YAAwC,gBAAAC,KAAU;AAMxD,IAAM,OAAO,CAAC,EAAE,KAAK,GAAG,MAAM,MAAiB;AACpD,SAAO,4CAAC,gBAAAA,KAAU,MAAV,EAAe,KAAW,GAAG,OAAO;AAC9C;AAMO,IAAM,sBAAsB,CACjC,SACA,UACA,aACG;AACH,MAAI,CAAC,QAAS,QAAO,SAAS,QAAQ;AAEtC,aAAO,6BAAe,QAAQ,QAC1B;AAAA,IACE;AAAA,IACA;AAAA,IACA,SAAU,SAAS,MAAkC,QAAQ;AAAA,EAC/D,IACA;AACN;;;ACtCA,YAAuB;AAGvB,IAAM,gBAAsB,oBAA8C,MAAS;AAE5E,IAAM,mBAAmB,MAAM;AACpC,QAAM,UAAgB,iBAAW,aAAa;AAC9C,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,0DAA0D;AAAA,EAC5E;AACA,SAAO;AACT;;;AFmCQ,IAAAC,sBAAA;AAvCR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AAA,UACjC,sCAAsC,WAAW,MAAM;AAAA,QACzD;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;AAEA,WAAW,cAAc;;;ACrCzB,IAAAC,oCAAmB;AAef,IAAAC,uBAAA;AANG,IAAM,oBAAoB,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,MAA8B;AAC9F,QAAM,EAAE,MAAM,SAAS,IAAI,iBAAiB;AAE5C,QAAM,cAAc,UAAU,OAAO,CAAC;AAEtC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAW;AAAA,MACX,eAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,UACE,kBAAkB,SAAS;AAAA,UAC3B,kBAAkB,CAAC,MAAM,IAAI,EAAE,SAAS,IAAI;AAAA,UAC5C,kBAAkB,SAAS;AAAA,UAC3B,mBAAmB,SAAS;AAAA,UAC5B,yBAAyB,SAAS;AAAA,QACpC;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH,sBAAY;AAAA;AAAA,EACf;AAEJ;AAEA,kBAAkB,cAAc;;;AtBnBhC,IAAM,kBAAkB;AAExB,gBAAgB,QAAQ;AACxB,gBAAgB,SAAS;AACzB,gBAAgB,cAAc;AAC9B,gBAAgB,OAAO;AACvB,gBAAgB,cAAc;","names":["React","RadixSlot","import_jsx_runtime","import_class_variance_authority","import_react","import_jsx_runtime","import_class_variance_authority","import_react","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime","import_class_variance_authority","import_react","import_internal_utils","import_class_variance_authority","import_jsx_runtime","import_internal_utils","import_class_variance_authority","import_internal_utils","import_internal_utils","import_internal_utils","import_internal_utils","import_internal_utils","import_jsx_runtime","import_internal_utils","import_class_variance_authority","import_jsx_runtime","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime"]}
|
package/dist/avatar/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
IconButton
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-QNYSDG6F.mjs";
|
|
4
4
|
import "../chunk-7A5MVJB3.mjs";
|
|
5
5
|
import "../chunk-GAK4SC2F.mjs";
|
|
6
6
|
import {
|
|
@@ -138,6 +138,7 @@ var AvatarAction = ({
|
|
|
138
138
|
return /* @__PURE__ */ jsx3(
|
|
139
139
|
Comp,
|
|
140
140
|
{
|
|
141
|
+
"data-spark-component": "avatar-action",
|
|
141
142
|
style: {
|
|
142
143
|
position: "absolute",
|
|
143
144
|
...design === "circle" ? { left: `${position.x}px`, top: `${position.y}px` } : {},
|
|
@@ -177,6 +178,7 @@ var AvatarOnlineBadge = ({ angle = 135, ...props }) => {
|
|
|
177
178
|
return /* @__PURE__ */ jsx4(
|
|
178
179
|
"div",
|
|
179
180
|
{
|
|
181
|
+
"data-spark-component": "avatar-online-badge",
|
|
180
182
|
role: "status",
|
|
181
183
|
"aria-label": onlineText,
|
|
182
184
|
style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/avatar/Avatar.tsx","../../src/avatar/context.ts","../../src/avatar/AvatarImage.tsx","../../src/avatar/AvatarAction.tsx","../../src/avatar/AvatarOnlineBadge.tsx","../../src/avatar/AvatarUser.tsx","../../src/avatar/AvatarPlaceholder.tsx","../../src/avatar/index.ts"],"sourcesContent":["import { cx } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { Slot } from '../slot'\nimport { AvatarContext } from './context'\nimport type { AvatarProps } from './types'\n\nconst sizeMap = {\n xs: 24,\n sm: 32,\n md: 40,\n lg: 56,\n xl: 64, // default\n '2xl': 96,\n}\n\nexport const Avatar = React.forwardRef<HTMLDivElement, AvatarProps>(\n (\n {\n className,\n size = 'xl',\n isOnline = false,\n onlineText,\n username,\n asChild,\n children,\n design = 'circle',\n ...props\n },\n ref\n ) => {\n const Comp = asChild ? Slot : 'div'\n const contextValue = React.useMemo(\n () => ({\n size,\n isOnline,\n onlineText,\n username,\n design,\n pixelSize: sizeMap[size],\n }),\n [size, isOnline, username, design, onlineText]\n )\n\n return (\n <AvatarContext.Provider value={contextValue}>\n <Comp\n ref={ref}\n style={{\n width: sizeMap[size],\n height: sizeMap[size],\n }}\n data-spark-component=\"avatar\"\n className={cx('relative inline-flex items-center justify-center', className)}\n {...props}\n >\n {children}\n </Comp>\n </AvatarContext.Provider>\n )\n }\n)\n\nAvatar.displayName = 'Avatar'\n","import * as React from 'react'\nimport type { AvatarContextValue } from './types'\n\nconst AvatarContext = React.createContext<AvatarContextValue | undefined>(undefined)\n\nexport const useAvatarContext = () => {\n const context = React.useContext(AvatarContext)\n if (!context) {\n throw new Error('useAvatarContext must be used within an Avatar component')\n }\n return context\n}\n\nexport { AvatarContext }\n","import { cx } from 'class-variance-authority'\nimport { useState } from 'react'\n\nimport { Slot } from '../slot'\nimport { useAvatarContext } from './context'\n\nexport interface AvatarImageProps extends React.ImgHTMLAttributes<HTMLImageElement> {\n asChild?: boolean\n}\n\nexport const AvatarImage = ({ className, asChild, src, ...props }: AvatarImageProps) => {\n const { username, isOnline, onlineText } = useAvatarContext()\n const Comp = asChild ? Slot : 'img'\n\n const [isVisible, setIsVisible] = useState(false)\n\n const accessibleName = isOnline && onlineText ? `${username} (${onlineText})` : username\n\n return (\n <Comp\n aria-hidden\n className={cx(\n 'absolute inset-0 size-full',\n 'object-cover',\n { 'transition-all duration-300 group-hover:scale-120': props.onClick },\n 'focus-visible:u-outline',\n isVisible ? 'block' : 'hidden',\n className\n )}\n alt={accessibleName}\n src={src}\n onLoad={() => {\n setIsVisible(true)\n }}\n {...props}\n />\n )\n}\n\nAvatarImage.displayName = 'AvatarImage'\n","import { PenOutline } from '@spark-ui/icons/PenOutline'\nimport { cx } from 'class-variance-authority'\n\nimport { Icon } from '../icon'\nimport { IconButton } from '../icon-button'\nimport { Slot } from '../slot'\nimport { useAvatarContext } from './context'\n\nexport interface AvatarActionProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n asChild?: boolean\n angle?: number\n ariaLabel: string\n}\n\nexport const AvatarAction = ({\n className,\n children,\n asChild,\n angle = 135,\n ariaLabel,\n ...props\n}: AvatarActionProps) => {\n const Comp = asChild ? Slot : IconButton\n const { pixelSize, design } = useAvatarContext()\n\n function getBadgePosition(circleSize: number) {\n const angleRad = ((90 - angle) * Math.PI) / 180\n const circleRadius = circleSize / 2\n\n return {\n x: circleRadius + circleRadius * Math.cos(angleRad),\n y: circleRadius - circleRadius * Math.sin(angleRad),\n }\n }\n\n const position = getBadgePosition(pixelSize)\n\n const isCustomElement = asChild\n\n return (\n <Comp\n style={{\n position: 'absolute',\n ...(design === 'circle' ? { left: `${position.x}px`, top: `${position.y}px` } : {}),\n ...(design === 'square' ? { right: '0px', bottom: '0px' } : {}),\n }}\n className={cx(\n 'z-raised',\n design === 'circle'\n ? '-translate-x-1/2 -translate-y-1/2'\n : 'translate-x-1/4 translate-y-1/4',\n { 'shadow-sm': !isCustomElement },\n className\n )}\n aria-label={ariaLabel}\n title={ariaLabel}\n {...(!isCustomElement ? { size: 'sm', intent: 'support', design: 'contrast' } : {})}\n {...props}\n >\n {children || (\n <Icon size=\"sm\">\n <PenOutline />\n </Icon>\n )}\n </Comp>\n )\n}\n\nAvatarAction.displayName = 'AvatarAction'\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef } from 'react'\n\nimport { useAvatarContext } from './context'\n\ninterface AvatarOnlineBadgeProps extends ComponentPropsWithoutRef<'div'> {\n angle?: number\n}\n\nexport const AvatarOnlineBadge = ({ angle = 135, ...props }: AvatarOnlineBadgeProps) => {\n const { isOnline, pixelSize, design, onlineText, size } = useAvatarContext()\n\n if (!isOnline) return null\n\n function getBadgePosition(circleSize: number) {\n const angleRad = ((90 - angle) * Math.PI) / 180\n const circleRadius = circleSize / 2\n\n return {\n x: circleRadius + circleRadius * Math.cos(angleRad),\n y: circleRadius - circleRadius * Math.sin(angleRad),\n }\n }\n\n const badgePosition = getBadgePosition(pixelSize)\n\n return (\n <div\n role=\"status\"\n aria-label={onlineText}\n style={{\n ...(design === 'circle'\n ? { left: `${badgePosition.x}px`, top: `${badgePosition.y}px` }\n : { right: '0px', bottom: '0px' }),\n }}\n className={cx(\n 'bg-success outline-surface absolute rounded-full',\n design === 'circle'\n ? '-translate-x-1/2 -translate-y-1/2'\n : 'translate-x-1/4 translate-y-1/4',\n ['lg', 'xl', '2xl'].includes(size) ? cx('size-sz-12 outline-4') : cx('size-sz-8 outline-2')\n )}\n {...props}\n />\n )\n}\n\nAvatarOnlineBadge.displayName = 'AvatarOnlineBadge'\n","import { cx } from 'class-variance-authority'\n\nimport { Slot } from '../slot'\nimport { useAvatarContext } from './context'\n\nexport interface AvatarImageProps extends React.ImgHTMLAttributes<HTMLDivElement> {\n asChild?: boolean\n}\n\nexport const AvatarUser = ({ asChild, children, className, ...props }: AvatarImageProps) => {\n const { design, isOnline, onlineText, username } = useAvatarContext()\n const Comp = asChild ? Slot : 'div'\n\n const accessibleName = isOnline && onlineText ? `${username} (${onlineText})` : username\n\n return (\n <Comp\n {...(!asChild && { role: 'img' })}\n aria-label={accessibleName}\n title={accessibleName}\n className={cx(\n 'group default:border-outline relative size-full overflow-hidden',\n 'focus-visible:u-outline',\n {\n 'default:rounded-full': design === 'circle',\n 'default:rounded-md': design === 'square',\n 'hover:opacity-dim-1 cursor-pointer': asChild || props.onClick,\n },\n className\n )}\n {...props}\n >\n {children}\n </Comp>\n )\n}\n\nAvatarUser.displayName = 'AvatarUser'\n","import { cx } from 'class-variance-authority'\n\nimport { useAvatarContext } from './context'\n\nexport interface AvatarPlaceholderProps extends React.ImgHTMLAttributes<HTMLDivElement> {\n className?: string\n children?: React.ReactNode\n}\n\nexport const AvatarPlaceholder = ({ className, children, ...props }: AvatarPlaceholderProps) => {\n const { size, username } = useAvatarContext()\n\n const firstLetter = username?.charAt(0)\n\n return (\n <div\n aria-hidden\n className={cx(\n 'absolute inset-0 flex size-full items-center justify-center',\n 'default:bg-neutral default:text-on-neutral',\n {\n 'text-display-1': size === '2xl',\n 'text-display-2': ['xl', 'lg'].includes(size),\n 'text-display-3': size === 'md',\n 'text-headline-2': size === 'sm',\n 'text-body-2 font-bold': size === 'xs',\n },\n className\n )}\n {...props}\n >\n {children || firstLetter}\n </div>\n )\n}\n\nAvatarPlaceholder.displayName = 'AvatarPlaceholder'\n","import { Avatar } from './Avatar'\nimport { AvatarImage } from './AvatarImage'\nimport { AvatarAction } from './AvatarAction'\nimport { AvatarOnlineBadge } from './AvatarOnlineBadge'\nimport { AvatarUser } from './AvatarUser'\nimport { AvatarPlaceholder } from './AvatarPlaceholder'\nimport type { AvatarProps } from './types'\n\nexport interface AvatarComponent\n extends React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLDivElement>> {\n Image: typeof AvatarImage\n Action: typeof AvatarAction\n OnlineBadge: typeof AvatarOnlineBadge\n User: typeof AvatarUser\n Placeholder: typeof AvatarPlaceholder\n}\n\nconst AvatarComponent = Avatar as AvatarComponent\n\nAvatarComponent.Image = AvatarImage\nAvatarComponent.Action = AvatarAction\nAvatarComponent.OnlineBadge = AvatarOnlineBadge\nAvatarComponent.User = AvatarUser\nAvatarComponent.Placeholder = AvatarPlaceholder\nexport { AvatarComponent as Avatar }\n"],"mappings":";;;;;;;;;;;;;;AAAA,SAAS,UAAU;AACnB,YAAYA,YAAW;;;ACDvB,YAAY,WAAW;AAGvB,IAAM,gBAAsB,oBAA8C,MAAS;AAE5E,IAAM,mBAAmB,MAAM;AACpC,QAAM,UAAgB,iBAAW,aAAa;AAC9C,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,0DAA0D;AAAA,EAC5E;AACA,SAAO;AACT;;;ADmCQ;AAvCR,IAAM,UAAU;AAAA,EACd,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA;AAAA,EACJ,OAAO;AAC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","cx","jsx","cx"]}
|
|
1
|
+
{"version":3,"sources":["../../src/avatar/Avatar.tsx","../../src/avatar/context.ts","../../src/avatar/AvatarImage.tsx","../../src/avatar/AvatarAction.tsx","../../src/avatar/AvatarOnlineBadge.tsx","../../src/avatar/AvatarUser.tsx","../../src/avatar/AvatarPlaceholder.tsx","../../src/avatar/index.ts"],"sourcesContent":["import { cx } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { Slot } from '../slot'\nimport { AvatarContext } from './context'\nimport type { AvatarProps } from './types'\n\nconst sizeMap = {\n xs: 24,\n sm: 32,\n md: 40,\n lg: 56,\n xl: 64, // default\n '2xl': 96,\n}\n\nexport const Avatar = React.forwardRef<HTMLDivElement, AvatarProps>(\n (\n {\n className,\n size = 'xl',\n isOnline = false,\n onlineText,\n username,\n asChild,\n children,\n design = 'circle',\n ...props\n },\n ref\n ) => {\n const Comp = asChild ? Slot : 'div'\n const contextValue = React.useMemo(\n () => ({\n size,\n isOnline,\n onlineText,\n username,\n design,\n pixelSize: sizeMap[size],\n }),\n [size, isOnline, username, design, onlineText]\n )\n\n return (\n <AvatarContext.Provider value={contextValue}>\n <Comp\n ref={ref}\n style={{\n width: sizeMap[size],\n height: sizeMap[size],\n }}\n data-spark-component=\"avatar\"\n className={cx('relative inline-flex items-center justify-center', className)}\n {...props}\n >\n {children}\n </Comp>\n </AvatarContext.Provider>\n )\n }\n)\n\nAvatar.displayName = 'Avatar'\n","import * as React from 'react'\nimport type { AvatarContextValue } from './types'\n\nconst AvatarContext = React.createContext<AvatarContextValue | undefined>(undefined)\n\nexport const useAvatarContext = () => {\n const context = React.useContext(AvatarContext)\n if (!context) {\n throw new Error('useAvatarContext must be used within an Avatar component')\n }\n return context\n}\n\nexport { AvatarContext }\n","import { cx } from 'class-variance-authority'\nimport { useState } from 'react'\n\nimport { Slot } from '../slot'\nimport { useAvatarContext } from './context'\n\nexport interface AvatarImageProps extends React.ImgHTMLAttributes<HTMLImageElement> {\n asChild?: boolean\n}\n\nexport const AvatarImage = ({ className, asChild, src, ...props }: AvatarImageProps) => {\n const { username, isOnline, onlineText } = useAvatarContext()\n const Comp = asChild ? Slot : 'img'\n\n const [isVisible, setIsVisible] = useState(false)\n\n const accessibleName = isOnline && onlineText ? `${username} (${onlineText})` : username\n\n return (\n <Comp\n aria-hidden\n className={cx(\n 'absolute inset-0 size-full',\n 'object-cover',\n { 'transition-all duration-300 group-hover:scale-120': props.onClick },\n 'focus-visible:u-outline',\n isVisible ? 'block' : 'hidden',\n className\n )}\n alt={accessibleName}\n src={src}\n onLoad={() => {\n setIsVisible(true)\n }}\n {...props}\n />\n )\n}\n\nAvatarImage.displayName = 'AvatarImage'\n","import { PenOutline } from '@spark-ui/icons/PenOutline'\nimport { cx } from 'class-variance-authority'\n\nimport { Icon } from '../icon'\nimport { IconButton } from '../icon-button'\nimport { Slot } from '../slot'\nimport { useAvatarContext } from './context'\n\nexport interface AvatarActionProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n asChild?: boolean\n angle?: number\n ariaLabel: string\n}\n\nexport const AvatarAction = ({\n className,\n children,\n asChild,\n angle = 135,\n ariaLabel,\n ...props\n}: AvatarActionProps) => {\n const Comp = asChild ? Slot : IconButton\n const { pixelSize, design } = useAvatarContext()\n\n function getBadgePosition(circleSize: number) {\n const angleRad = ((90 - angle) * Math.PI) / 180\n const circleRadius = circleSize / 2\n\n return {\n x: circleRadius + circleRadius * Math.cos(angleRad),\n y: circleRadius - circleRadius * Math.sin(angleRad),\n }\n }\n\n const position = getBadgePosition(pixelSize)\n\n const isCustomElement = asChild\n\n return (\n <Comp\n data-spark-component=\"avatar-action\"\n style={{\n position: 'absolute',\n ...(design === 'circle' ? { left: `${position.x}px`, top: `${position.y}px` } : {}),\n ...(design === 'square' ? { right: '0px', bottom: '0px' } : {}),\n }}\n className={cx(\n 'z-raised',\n design === 'circle'\n ? '-translate-x-1/2 -translate-y-1/2'\n : 'translate-x-1/4 translate-y-1/4',\n { 'shadow-sm': !isCustomElement },\n className\n )}\n aria-label={ariaLabel}\n title={ariaLabel}\n {...(!isCustomElement ? { size: 'sm', intent: 'support', design: 'contrast' } : {})}\n {...props}\n >\n {children || (\n <Icon size=\"sm\">\n <PenOutline />\n </Icon>\n )}\n </Comp>\n )\n}\n\nAvatarAction.displayName = 'AvatarAction'\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef } from 'react'\n\nimport { useAvatarContext } from './context'\n\ninterface AvatarOnlineBadgeProps extends ComponentPropsWithoutRef<'div'> {\n angle?: number\n}\n\nexport const AvatarOnlineBadge = ({ angle = 135, ...props }: AvatarOnlineBadgeProps) => {\n const { isOnline, pixelSize, design, onlineText, size } = useAvatarContext()\n\n if (!isOnline) return null\n\n function getBadgePosition(circleSize: number) {\n const angleRad = ((90 - angle) * Math.PI) / 180\n const circleRadius = circleSize / 2\n\n return {\n x: circleRadius + circleRadius * Math.cos(angleRad),\n y: circleRadius - circleRadius * Math.sin(angleRad),\n }\n }\n\n const badgePosition = getBadgePosition(pixelSize)\n\n return (\n <div\n data-spark-component=\"avatar-online-badge\"\n role=\"status\"\n aria-label={onlineText}\n style={{\n ...(design === 'circle'\n ? { left: `${badgePosition.x}px`, top: `${badgePosition.y}px` }\n : { right: '0px', bottom: '0px' }),\n }}\n className={cx(\n 'bg-success outline-surface absolute rounded-full',\n design === 'circle'\n ? '-translate-x-1/2 -translate-y-1/2'\n : 'translate-x-1/4 translate-y-1/4',\n ['lg', 'xl', '2xl'].includes(size) ? cx('size-sz-12 outline-4') : cx('size-sz-8 outline-2')\n )}\n {...props}\n />\n )\n}\n\nAvatarOnlineBadge.displayName = 'AvatarOnlineBadge'\n","import { cx } from 'class-variance-authority'\n\nimport { Slot } from '../slot'\nimport { useAvatarContext } from './context'\n\nexport interface AvatarImageProps extends React.ImgHTMLAttributes<HTMLDivElement> {\n asChild?: boolean\n}\n\nexport const AvatarUser = ({ asChild, children, className, ...props }: AvatarImageProps) => {\n const { design, isOnline, onlineText, username } = useAvatarContext()\n const Comp = asChild ? Slot : 'div'\n\n const accessibleName = isOnline && onlineText ? `${username} (${onlineText})` : username\n\n return (\n <Comp\n {...(!asChild && { role: 'img' })}\n aria-label={accessibleName}\n title={accessibleName}\n className={cx(\n 'group default:border-outline relative size-full overflow-hidden',\n 'focus-visible:u-outline',\n {\n 'default:rounded-full': design === 'circle',\n 'default:rounded-md': design === 'square',\n 'hover:opacity-dim-1 cursor-pointer': asChild || props.onClick,\n },\n className\n )}\n {...props}\n >\n {children}\n </Comp>\n )\n}\n\nAvatarUser.displayName = 'AvatarUser'\n","import { cx } from 'class-variance-authority'\n\nimport { useAvatarContext } from './context'\n\nexport interface AvatarPlaceholderProps extends React.ImgHTMLAttributes<HTMLDivElement> {\n className?: string\n children?: React.ReactNode\n}\n\nexport const AvatarPlaceholder = ({ className, children, ...props }: AvatarPlaceholderProps) => {\n const { size, username } = useAvatarContext()\n\n const firstLetter = username?.charAt(0)\n\n return (\n <div\n aria-hidden\n className={cx(\n 'absolute inset-0 flex size-full items-center justify-center',\n 'default:bg-neutral default:text-on-neutral',\n {\n 'text-display-1': size === '2xl',\n 'text-display-2': ['xl', 'lg'].includes(size),\n 'text-display-3': size === 'md',\n 'text-headline-2': size === 'sm',\n 'text-body-2 font-bold': size === 'xs',\n },\n className\n )}\n {...props}\n >\n {children || firstLetter}\n </div>\n )\n}\n\nAvatarPlaceholder.displayName = 'AvatarPlaceholder'\n","import { Avatar } from './Avatar'\nimport { AvatarImage } from './AvatarImage'\nimport { AvatarAction } from './AvatarAction'\nimport { AvatarOnlineBadge } from './AvatarOnlineBadge'\nimport { AvatarUser } from './AvatarUser'\nimport { AvatarPlaceholder } from './AvatarPlaceholder'\nimport type { AvatarProps } from './types'\n\nexport interface AvatarComponent\n extends React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLDivElement>> {\n Image: typeof AvatarImage\n Action: typeof AvatarAction\n OnlineBadge: typeof AvatarOnlineBadge\n User: typeof AvatarUser\n Placeholder: typeof AvatarPlaceholder\n}\n\nconst AvatarComponent = Avatar as AvatarComponent\n\nAvatarComponent.Image = AvatarImage\nAvatarComponent.Action = AvatarAction\nAvatarComponent.OnlineBadge = AvatarOnlineBadge\nAvatarComponent.User = AvatarUser\nAvatarComponent.Placeholder = AvatarPlaceholder\nexport { AvatarComponent as Avatar }\n"],"mappings":";;;;;;;;;;;;;;AAAA,SAAS,UAAU;AACnB,YAAYA,YAAW;;;ACDvB,YAAY,WAAW;AAGvB,IAAM,gBAAsB,oBAA8C,MAAS;AAE5E,IAAM,mBAAmB,MAAM;AACpC,QAAM,UAAgB,iBAAW,aAAa;AAC9C,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,0DAA0D;AAAA,EAC5E;AACA,SAAO;AACT;;;ADmCQ;AAvCR,IAAM,UAAU;AAAA,EACd,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA;AAAA,EACJ,OAAO;AACT;AAEO,IAAM,SAAe;AAAA,EAC1B,CACE;AAAA,IACE;AAAA,IACA,OAAO;AAAA,IACP,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,GAAG;AAAA,EACL,GACA,QACG;AACH,UAAM,OAAO,UAAU,OAAO;AAC9B,UAAM,eAAqB;AAAA,MACzB,OAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,WAAW,QAAQ,IAAI;AAAA,MACzB;AAAA,MACA,CAAC,MAAM,UAAU,UAAU,QAAQ,UAAU;AAAA,IAC/C;AAEA,WACE,oBAAC,cAAc,UAAd,EAAuB,OAAO,cAC7B;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,OAAO;AAAA,UACL,OAAO,QAAQ,IAAI;AAAA,UACnB,QAAQ,QAAQ,IAAI;AAAA,QACtB;AAAA,QACA,wBAAqB;AAAA,QACrB,WAAW,GAA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;AAC9F,QAAM,EAAE,MAAM,SAAS,IAAI,iBAAiB;AAE5C,QAAM,cAAc,UAAU,OAAO,CAAC;AAEtC,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC,eAAW;AAAA,MACX,WAAWC;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,UACE,kBAAkB,SAAS;AAAA,UAC3B,kBAAkB,CAAC,MAAM,IAAI,EAAE,SAAS,IAAI;AAAA,UAC5C,kBAAkB,SAAS;AAAA,UAC3B,mBAAmB,SAAS;AAAA,UAC5B,yBAAyB,SAAS;AAAA,QACpC;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH,sBAAY;AAAA;AAAA,EACf;AAEJ;AAEA,kBAAkB,cAAc;;;ACnBhC,IAAM,kBAAkB;AAExB,gBAAgB,QAAQ;AACxB,gBAAgB,SAAS;AACzB,gBAAgB,cAAc;AAC9B,gBAAgB,OAAO;AACvB,gBAAgB,cAAc;","names":["React","cx","jsx","cx","cx","jsx","cx","cx","jsx","cx","cx","jsx","cx","cx","jsx","cx"]}
|
package/dist/breadcrumb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/breadcrumb/index.ts","../../src/breadcrumb/Breadcrumb.tsx","../../src/breadcrumb/BreadcrumbCurrentPage.tsx","../../src/slot/Slot.tsx","../../src/breadcrumb/BreadcrumbItem.tsx","../../src/breadcrumb/BreadcrumbLink.tsx","../../src/text-link/TextLink.tsx","../../src/breadcrumb/BreadcrumbSeparator.tsx","../../src/icon/Icon.tsx","../../src/visually-hidden/VisuallyHidden.tsx","../../src/icon/Icon.styles.tsx"],"sourcesContent":["import { Breadcrumb as Root } from './Breadcrumb'\nimport { CurrentPage } from './BreadcrumbCurrentPage'\nimport { Item } from './BreadcrumbItem'\nimport { Link } from './BreadcrumbLink'\nimport { Separator } from './BreadcrumbSeparator'\n\nexport const Breadcrumb: typeof Root & {\n Item: typeof Item\n Link: typeof Link\n CurrentPage: typeof CurrentPage\n Separator: typeof Separator\n} = Object.assign(Root, {\n Item,\n Link,\n CurrentPage,\n Separator,\n})\n\nBreadcrumb.displayName = 'Breadcrumb'\nItem.displayName = 'Breadcrumb.Item'\nLink.displayName = 'Breadcrumb.Link'\nCurrentPage.displayName = 'Breadcrumb.CurrentPage'\nSeparator.displayName = 'Breadcrumb.Separator'\n\nexport type { BreadcrumbProps } from './Breadcrumb'\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, Ref } from 'react'\n\nexport interface BreadcrumbProps extends ComponentPropsWithoutRef<'nav'> {\n className?: string\n ['aria-label']: string\n ref?: Ref<HTMLElement>\n}\n\nexport const Breadcrumb = ({\n className,\n 'aria-label': ariaLabel,\n ref,\n ...rest\n}: BreadcrumbProps) => {\n return (\n <nav\n data-spark-component=\"breadcrumb\"\n ref={ref}\n aria-label={ariaLabel}\n className={cx('text-caption text-neutral', className)}\n >\n <ol className={cx('gap-sm flex flex-wrap items-center break-words')} {...rest} />\n </nav>\n )\n}\n\nBreadcrumb.displayName = 'Breadcrumb.Breadcrumb'\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, Ref } from 'react'\n\nimport { Slot } from '../slot'\nimport { TextLink } from '../text-link'\n\nexport interface CurrentPageProps extends ComponentPropsWithoutRef<typeof TextLink> {\n asChild?: boolean\n className?: string\n ref?: Ref<HTMLAnchorElement>\n}\n\nexport const CurrentPage = ({\n asChild = false,\n className,\n children,\n ...rest\n}: CurrentPageProps) => {\n const Component = asChild ? Slot : 'span'\n\n return (\n <Component\n data-spark-component=\"breadcrumb-current-page\"\n role=\"link\"\n aria-disabled\n aria-current=\"page\"\n className={cx(\n 'inline! overflow-hidden font-bold text-ellipsis whitespace-nowrap text-current',\n className\n )}\n {...rest}\n >\n {children}\n </Component>\n )\n}\n\nCurrentPage.displayName = 'Breadcrumb.CurrentPage'\n","import { Slot as RadixSlot } from 'radix-ui'\nimport {\n cloneElement,\n HTMLAttributes,\n isValidElement,\n PropsWithChildren,\n ReactNode,\n Ref,\n} from 'react'\n\nexport const Slottable: typeof RadixSlot.Slottable = RadixSlot.Slottable\n\nexport type SlotProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {\n ref?: Ref<HTMLElement>\n}\n\nexport const Slot = ({ ref, ...props }: SlotProps) => {\n return <RadixSlot.Root ref={ref} {...props} />\n}\n\n/**\n * When using Radix `Slot` component, it will consider its first child to merge its props with.\n * In some cases, you might need to wrap the top child with additional markup without breaking this behaviour.\n */\nexport const wrapPolymorphicSlot = (\n asChild: boolean | undefined,\n children: ReactNode,\n callback: (children: ReactNode) => ReactNode\n) => {\n if (!asChild) return callback(children) // If polymorphic behaviour is not used, we keep the original children\n\n return isValidElement(children)\n ? cloneElement(\n children,\n undefined,\n callback((children.props as { children: ReactNode }).children)\n )\n : null\n}\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, Ref } from 'react'\n\nexport interface ItemProps extends ComponentPropsWithoutRef<'li'> {\n className?: string\n ref?: Ref<HTMLLIElement>\n}\n\nexport const Item = ({ className, ...rest }: ItemProps) => {\n return (\n <li\n data-spark-component=\"breadcrumb-item\"\n className={cx('min-w-none gap-sm inline-flex items-center', className)}\n {...rest}\n />\n )\n}\n\nItem.displayName = 'Breadcrumb.Item'\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, Ref } from 'react'\n\nimport { Slot } from '../slot'\nimport { TextLink } from '../text-link'\n\nexport interface LinkProps extends ComponentPropsWithoutRef<typeof TextLink> {\n asChild?: boolean\n className?: string\n href?: string\n ref?: Ref<HTMLAnchorElement>\n}\n\nexport const Link = ({\n asChild = false,\n className,\n bold = true,\n intent = 'current',\n underline = true,\n href,\n ref,\n ...rest\n}: LinkProps) => {\n const Component = asChild ? Slot : TextLink\n\n return (\n <Component\n data-spark-component=\"breadcrumb-link\"\n href={href}\n ref={ref}\n className={cx('inline! overflow-hidden text-ellipsis whitespace-nowrap', className)}\n bold={bold}\n intent={intent}\n underline={underline}\n {...rest}\n />\n )\n}\n\nLink.displayName = 'Breadcrumb.Link'\n","import { cva, VariantProps } from 'class-variance-authority'\nimport { type ComponentPropsWithRef } from 'react'\n\nimport { Slot } from '../slot'\n\nconst textLinkStyles = cva(['inline-flex items-center focus-visible:u-outline'], {\n variants: {\n intent: {\n current: 'text-current hover:opacity-dim-1',\n main: 'text-main hover:text-main-hovered',\n support: 'text-support hover:text-support-hovered',\n accent: 'text-accent hover:text-accent-hovered',\n basic: 'text-basic hover:text-basic-hovered',\n success: 'text-success hover:text-success-hovered',\n alert: 'text-alert hover:text-alert-hovered',\n danger: 'text-error hover:text-error-hovered',\n info: 'text-info hover:text-info-hovered',\n neutral: 'text-neutral hover:text-neutral-hovered',\n },\n /** By default, TextLink inherits the current font weight. Use `bold` to highlight it. */\n bold: {\n true: 'font-bold',\n },\n /**\n * Underline is enabled by default.\n * You can remove it, but be careful about a11y, as you should make obvious to users what is a link or not.\n */\n underline: {\n true: 'underline',\n false: 'hover:underline focus:underline',\n },\n },\n defaultVariants: {\n intent: 'current',\n bold: false,\n underline: true,\n },\n})\n\nexport type StylesProps = VariantProps<typeof textLinkStyles>\n\nexport type TextLinkProps = ComponentPropsWithRef<'a'> &\n StylesProps & {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n }\n\nexport const TextLink = ({\n asChild = false,\n bold = false,\n children,\n className,\n intent = 'current',\n underline = true,\n ref,\n ...props\n}: TextLinkProps) => {\n const Component = asChild ? Slot : 'a'\n\n return (\n <Component\n ref={ref}\n className={textLinkStyles({ className, bold, intent, underline })}\n {...props}\n >\n {children}\n </Component>\n )\n}\n","import { ArrowVerticalRight } from '@spark-ui/icons/ArrowVerticalRight'\nimport { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, Ref } from 'react'\n\nimport { Icon } from '../icon'\nimport { Slot } from '../slot'\n\nexport interface SeparatorProps extends ComponentPropsWithoutRef<'li'> {\n asChild?: boolean\n className?: string\n ref?: Ref<HTMLLIElement>\n}\n\nexport const Separator = ({\n asChild = false,\n className,\n children,\n ref,\n ...rest\n}: SeparatorProps) => {\n const Component = asChild ? Slot : 'li'\n\n return (\n <Component\n role=\"presentation\"\n aria-hidden\n data-spark-component=\"breadcrumb-separator\"\n ref={ref}\n className={cx('gap-sm inline-flex items-center', className)}\n {...rest}\n >\n {children ?? (\n <Icon>\n <ArrowVerticalRight />\n </Icon>\n )}\n </Component>\n )\n}\n\nSeparator.displayName = 'Breadcrumb.Separator'\n","import { Children, cloneElement, ComponentPropsWithoutRef, ReactElement, ReactNode } from 'react'\n\nimport { VisuallyHidden } from '../visually-hidden'\nimport { iconStyles, IconVariantsProps } from './Icon.styles'\n\nexport interface IconProps extends IconVariantsProps, ComponentPropsWithoutRef<'svg'> {\n /**\n * The svg icon that will be wrapped\n */\n children: ReactNode\n /**\n * The accessible label for the icon. This label will be visually hidden but announced to screen\n * reader users, similar to `alt` text for `img` tags.\n */\n label?: string\n}\n\nexport const Icon = ({\n label,\n className,\n size = 'current',\n intent = 'current',\n children,\n ...others\n}: IconProps) => {\n const child = Children.only(children)\n\n return (\n <>\n {cloneElement(child as ReactElement<Record<string, any>>, {\n className: iconStyles({ className, size, intent }),\n 'data-spark-component': 'icon',\n 'aria-hidden': 'true',\n focusable: 'false',\n ...others,\n })}\n\n {label && <VisuallyHidden>{label}</VisuallyHidden>}\n </>\n )\n}\n\nIcon.displayName = 'Icon'\n","import { HTMLAttributes, PropsWithChildren, Ref } from 'react'\n\nimport { Slot } from '../slot'\n\nexport type VisuallyHiddenProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean\n ref?: Ref<HTMLElement>\n}\n\nexport const VisuallyHidden = ({ asChild = false, ref, ...props }: VisuallyHiddenProps) => {\n const Component = asChild ? Slot : 'span'\n\n return (\n <Component\n {...props}\n ref={ref}\n style={{\n // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss\n position: 'absolute',\n border: 0,\n width: 1,\n height: 1,\n padding: 0,\n margin: -1,\n overflow: 'hidden',\n clip: 'rect(0, 0, 0, 0)',\n whiteSpace: 'nowrap',\n wordWrap: 'normal',\n ...props.style,\n }}\n />\n )\n}\n\nVisuallyHidden.displayName = 'VisuallyHidden'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const iconStyles = cva(['fill-current shrink-0'], {\n variants: {\n /**\n * Color scheme of the icon.\n */\n intent: makeVariants<\n 'intent',\n [\n 'current',\n 'main',\n 'support',\n 'accent',\n 'basic',\n 'success',\n 'alert',\n 'error',\n 'info',\n 'neutral',\n ]\n >({\n current: ['text-current'],\n main: ['text-main'],\n support: ['text-support'],\n accent: ['text-accent'],\n basic: ['text-basic'],\n success: ['text-success'],\n alert: ['text-alert'],\n error: ['text-error'],\n info: ['text-info'],\n neutral: ['text-neutral'],\n }),\n /**\n * Sets the size of the icon.\n */\n size: makeVariants<'size', ['current', 'sm', 'md', 'lg', 'xl']>({\n current: ['u-current-font-size'],\n sm: ['w-sz-16', 'h-sz-16'],\n md: ['w-sz-24', 'h-sz-24'],\n lg: ['w-sz-32', 'h-sz-32'],\n xl: ['w-sz-40', 'h-sz-40'],\n }),\n },\n})\n\nexport type IconVariantsProps = VariantProps<typeof iconStyles>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,oBAAAA;AAAA;AAAA;;;ACAA,sCAAmB;AAsBb;AAbC,IAAM,aAAa,CAAC;AAAA,EACzB;AAAA,EACA,cAAc;AAAA,EACd;AAAA,EACA,GAAG;AACL,MAAuB;AACrB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,wBAAqB;AAAA,MACrB;AAAA,MACA,cAAY;AAAA,MACZ,eAAW,oCAAG,6BAA6B,SAAS;AAAA,MAEpD,sDAAC,QAAG,eAAW,oCAAG,gDAAgD,GAAI,GAAG,MAAM;AAAA;A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A,oCAAa,OAA4C;AAAA,MACxD,WAAW,WAAW,EAAE,WAAW,MAAM,OAAO,CAAC;AAAA,MACjD,wBAAwB;AAAA,MACxB,eAAe;AAAA,MACf,WAAW;AAAA,MACX,GAAG;AAAA,IACL,CAAC;AAAA,IAEA,SAAS,6CAAC,kBAAgB,iBAAM;AAAA,KACnC;AAEJ;AAEA,KAAK,cAAc;;;ADTT,IAAAC,sBAAA;AApBH,IAAM,YAAY,CAAC;AAAA,EACxB,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAsB;AACpB,QAAM,YAAY,UAAU,OAAO;AAEnC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,eAAW;AAAA,MACX,wBAAqB;AAAA,MACrB;AAAA,MACA,eAAW,qCAAG,mCAAmC,SAAS;AAAA,MACzD,GAAG;AAAA,MAEH,sBACC,6CAAC,QACC,uDAAC,gDAAmB,GACtB;AAAA;AAAA,EAEJ;AAEJ;AAEA,UAAU,cAAc;;;APlCjB,IAAMC,cAKT,OAAO,OAAO,YAAM;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEDA,YAAW,cAAc;AACzB,KAAK,cAAc;AACnB,KAAK,cAAc;AACnB,YAAY,cAAc;AAC1B,UAAU,cAAc;","names":["Breadcrumb","import_class_variance_authority","import_jsx_runtime","RadixSlot","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime","import_class_variance_authority","import_class_variance_authority","import_jsx_runtime","import_jsx_runtime","import_class_variance_authority","import_react","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime","import_jsx_runtime","Breadcrumb"]}
|
|
1
|
+
{"version":3,"sources":["../../src/breadcrumb/index.ts","../../src/breadcrumb/Breadcrumb.tsx","../../src/breadcrumb/BreadcrumbCurrentPage.tsx","../../src/slot/Slot.tsx","../../src/breadcrumb/BreadcrumbItem.tsx","../../src/breadcrumb/BreadcrumbLink.tsx","../../src/text-link/TextLink.tsx","../../src/breadcrumb/BreadcrumbSeparator.tsx","../../src/icon/Icon.tsx","../../src/visually-hidden/VisuallyHidden.tsx","../../src/icon/Icon.styles.tsx"],"sourcesContent":["import { Breadcrumb as Root } from './Breadcrumb'\nimport { CurrentPage } from './BreadcrumbCurrentPage'\nimport { Item } from './BreadcrumbItem'\nimport { Link } from './BreadcrumbLink'\nimport { Separator } from './BreadcrumbSeparator'\n\nexport const Breadcrumb: typeof Root & {\n Item: typeof Item\n Link: typeof Link\n CurrentPage: typeof CurrentPage\n Separator: typeof Separator\n} = Object.assign(Root, {\n Item,\n Link,\n CurrentPage,\n Separator,\n})\n\nBreadcrumb.displayName = 'Breadcrumb'\nItem.displayName = 'Breadcrumb.Item'\nLink.displayName = 'Breadcrumb.Link'\nCurrentPage.displayName = 'Breadcrumb.CurrentPage'\nSeparator.displayName = 'Breadcrumb.Separator'\n\nexport type { BreadcrumbProps } from './Breadcrumb'\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, Ref } from 'react'\n\nexport interface BreadcrumbProps extends ComponentPropsWithoutRef<'nav'> {\n className?: string\n ['aria-label']: string\n ref?: Ref<HTMLElement>\n}\n\nexport const Breadcrumb = ({\n className,\n 'aria-label': ariaLabel,\n ref,\n ...rest\n}: BreadcrumbProps) => {\n return (\n <nav\n data-spark-component=\"breadcrumb\"\n ref={ref}\n aria-label={ariaLabel}\n className={cx('text-caption text-neutral', className)}\n >\n <ol className={cx('gap-sm flex flex-wrap items-center break-words')} {...rest} />\n </nav>\n )\n}\n\nBreadcrumb.displayName = 'Breadcrumb.Breadcrumb'\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, Ref } from 'react'\n\nimport { Slot } from '../slot'\nimport { TextLink } from '../text-link'\n\nexport interface CurrentPageProps extends ComponentPropsWithoutRef<typeof TextLink> {\n asChild?: boolean\n className?: string\n ref?: Ref<HTMLAnchorElement>\n}\n\nexport const CurrentPage = ({\n asChild = false,\n className,\n children,\n ...rest\n}: CurrentPageProps) => {\n const Component = asChild ? Slot : 'span'\n\n return (\n <Component\n data-spark-component=\"breadcrumb-current-page\"\n role=\"link\"\n aria-disabled\n aria-current=\"page\"\n className={cx(\n 'inline! overflow-hidden font-bold text-ellipsis whitespace-nowrap text-current',\n className\n )}\n {...rest}\n >\n {children}\n </Component>\n )\n}\n\nCurrentPage.displayName = 'Breadcrumb.CurrentPage'\n","import { Slot as RadixSlot } from 'radix-ui'\nimport {\n cloneElement,\n HTMLAttributes,\n isValidElement,\n PropsWithChildren,\n ReactNode,\n Ref,\n} from 'react'\n\nexport const Slottable: typeof RadixSlot.Slottable = RadixSlot.Slottable\n\nexport type SlotProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {\n ref?: Ref<HTMLElement>\n}\n\nexport const Slot = ({ ref, ...props }: SlotProps) => {\n return <RadixSlot.Root ref={ref} {...props} />\n}\n\n/**\n * When using Radix `Slot` component, it will consider its first child to merge its props with.\n * In some cases, you might need to wrap the top child with additional markup without breaking this behaviour.\n */\nexport const wrapPolymorphicSlot = (\n asChild: boolean | undefined,\n children: ReactNode,\n callback: (children: ReactNode) => ReactNode\n) => {\n if (!asChild) return callback(children) // If polymorphic behaviour is not used, we keep the original children\n\n return isValidElement(children)\n ? cloneElement(\n children,\n undefined,\n callback((children.props as { children: ReactNode }).children)\n )\n : null\n}\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, Ref } from 'react'\n\nexport interface ItemProps extends ComponentPropsWithoutRef<'li'> {\n className?: string\n ref?: Ref<HTMLLIElement>\n}\n\nexport const Item = ({ className, ...rest }: ItemProps) => {\n return (\n <li\n data-spark-component=\"breadcrumb-item\"\n className={cx('min-w-none gap-sm inline-flex items-center', className)}\n {...rest}\n />\n )\n}\n\nItem.displayName = 'Breadcrumb.Item'\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, Ref } from 'react'\n\nimport { Slot } from '../slot'\nimport { TextLink } from '../text-link'\n\nexport interface LinkProps extends ComponentPropsWithoutRef<typeof TextLink> {\n asChild?: boolean\n className?: string\n href?: string\n ref?: Ref<HTMLAnchorElement>\n}\n\nexport const Link = ({\n asChild = false,\n className,\n bold = true,\n intent = 'current',\n underline = true,\n href,\n ref,\n ...rest\n}: LinkProps) => {\n const Component = asChild ? Slot : TextLink\n\n return (\n <Component\n data-spark-component=\"breadcrumb-link\"\n href={href}\n ref={ref}\n className={cx('inline! overflow-hidden text-ellipsis whitespace-nowrap', className)}\n bold={bold}\n intent={intent}\n underline={underline}\n {...rest}\n />\n )\n}\n\nLink.displayName = 'Breadcrumb.Link'\n","import { cva, VariantProps } from 'class-variance-authority'\nimport { type ComponentPropsWithRef } from 'react'\n\nimport { Slot } from '../slot'\n\nconst textLinkStyles = cva(['inline-flex items-center focus-visible:u-outline'], {\n variants: {\n intent: {\n current: 'text-current hover:opacity-dim-1',\n main: 'text-main hover:text-main-hovered',\n support: 'text-support hover:text-support-hovered',\n accent: 'text-accent hover:text-accent-hovered',\n basic: 'text-basic hover:text-basic-hovered',\n success: 'text-success hover:text-success-hovered',\n alert: 'text-alert hover:text-alert-hovered',\n danger: 'text-error hover:text-error-hovered',\n info: 'text-info hover:text-info-hovered',\n neutral: 'text-neutral hover:text-neutral-hovered',\n },\n /** By default, TextLink inherits the current font weight. Use `bold` to highlight it. */\n bold: {\n true: 'font-bold',\n },\n /**\n * Underline is enabled by default.\n * You can remove it, but be careful about a11y, as you should make obvious to users what is a link or not.\n */\n underline: {\n true: 'underline',\n false: 'hover:underline focus:underline',\n },\n },\n defaultVariants: {\n intent: 'current',\n bold: false,\n underline: true,\n },\n})\n\nexport type StylesProps = VariantProps<typeof textLinkStyles>\n\nexport type TextLinkProps = ComponentPropsWithRef<'a'> &\n StylesProps & {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n }\n\nexport const TextLink = ({\n asChild = false,\n bold = false,\n children,\n className,\n intent = 'current',\n underline = true,\n ref,\n ...props\n}: TextLinkProps) => {\n const Component = asChild ? Slot : 'a'\n\n return (\n <Component\n data-spark-component=\"text-link\"\n ref={ref}\n className={textLinkStyles({ className, bold, intent, underline })}\n {...props}\n >\n {children}\n </Component>\n )\n}\n","import { ArrowVerticalRight } from '@spark-ui/icons/ArrowVerticalRight'\nimport { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, Ref } from 'react'\n\nimport { Icon } from '../icon'\nimport { Slot } from '../slot'\n\nexport interface SeparatorProps extends ComponentPropsWithoutRef<'li'> {\n asChild?: boolean\n className?: string\n ref?: Ref<HTMLLIElement>\n}\n\nexport const Separator = ({\n asChild = false,\n className,\n children,\n ref,\n ...rest\n}: SeparatorProps) => {\n const Component = asChild ? Slot : 'li'\n\n return (\n <Component\n role=\"presentation\"\n aria-hidden\n data-spark-component=\"breadcrumb-separator\"\n ref={ref}\n className={cx('gap-sm inline-flex items-center', className)}\n {...rest}\n >\n {children ?? (\n <Icon>\n <ArrowVerticalRight />\n </Icon>\n )}\n </Component>\n )\n}\n\nSeparator.displayName = 'Breadcrumb.Separator'\n","import { Children, cloneElement, ComponentPropsWithoutRef, ReactElement, ReactNode } from 'react'\n\nimport { VisuallyHidden } from '../visually-hidden'\nimport { iconStyles, IconVariantsProps } from './Icon.styles'\n\nexport interface IconProps extends IconVariantsProps, ComponentPropsWithoutRef<'svg'> {\n /**\n * The svg icon that will be wrapped\n */\n children: ReactNode\n /**\n * The accessible label for the icon. This label will be visually hidden but announced to screen\n * reader users, similar to `alt` text for `img` tags.\n */\n label?: string\n}\n\nexport const Icon = ({\n label,\n className,\n size = 'current',\n intent = 'current',\n children,\n ...others\n}: IconProps) => {\n const child = Children.only(children)\n\n return (\n <>\n {cloneElement(child as ReactElement<Record<string, any>>, {\n className: iconStyles({ className, size, intent }),\n 'data-spark-component': 'icon',\n 'aria-hidden': 'true',\n focusable: 'false',\n ...others,\n })}\n\n {label && <VisuallyHidden>{label}</VisuallyHidden>}\n </>\n )\n}\n\nIcon.displayName = 'Icon'\n","import { HTMLAttributes, PropsWithChildren, Ref } from 'react'\n\nimport { Slot } from '../slot'\n\nexport type VisuallyHiddenProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean\n ref?: Ref<HTMLElement>\n}\n\nexport const VisuallyHidden = ({ asChild = false, ref, ...props }: VisuallyHiddenProps) => {\n const Component = asChild ? Slot : 'span'\n\n return (\n <Component\n {...props}\n ref={ref}\n style={{\n // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss\n position: 'absolute',\n border: 0,\n width: 1,\n height: 1,\n padding: 0,\n margin: -1,\n overflow: 'hidden',\n clip: 'rect(0, 0, 0, 0)',\n whiteSpace: 'nowrap',\n wordWrap: 'normal',\n ...props.style,\n }}\n />\n )\n}\n\nVisuallyHidden.displayName = 'VisuallyHidden'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const iconStyles = cva(['fill-current shrink-0'], {\n variants: {\n /**\n * Color scheme of the icon.\n */\n intent: makeVariants<\n 'intent',\n [\n 'current',\n 'main',\n 'support',\n 'accent',\n 'basic',\n 'success',\n 'alert',\n 'error',\n 'info',\n 'neutral',\n ]\n >({\n current: ['text-current'],\n main: ['text-main'],\n support: ['text-support'],\n accent: ['text-accent'],\n basic: ['text-basic'],\n success: ['text-success'],\n alert: ['text-alert'],\n error: ['text-error'],\n info: ['text-info'],\n neutral: ['text-neutral'],\n }),\n /**\n * Sets the size of the icon.\n */\n size: makeVariants<'size', ['current', 'sm', 'md', 'lg', 'xl']>({\n current: ['u-current-font-size'],\n sm: ['w-sz-16', 'h-sz-16'],\n md: ['w-sz-24', 'h-sz-24'],\n lg: ['w-sz-32', 'h-sz-32'],\n xl: ['w-sz-40', 'h-sz-40'],\n }),\n },\n})\n\nexport type IconVariantsProps = VariantProps<typeof iconStyles>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA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adixSlot","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime","import_class_variance_authority","import_class_variance_authority","import_jsx_runtime","import_jsx_runtime","import_class_variance_authority","import_react","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime","import_jsx_runtime","Breadcrumb"]}
|
package/dist/carousel/index.js
CHANGED
|
@@ -477,6 +477,7 @@ var Carousel = ({
|
|
|
477
477
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
478
478
|
"div",
|
|
479
479
|
{
|
|
480
|
+
"data-spark-component": "carousel",
|
|
480
481
|
className: (0, import_class_variance_authority.cx)("gap-lg relative box-border flex flex-col", className),
|
|
481
482
|
...carouselApi.getRootProps(),
|
|
482
483
|
children
|
|
@@ -502,6 +503,7 @@ var CarouselControls = ({ children, className, ...props }) => {
|
|
|
502
503
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
503
504
|
"div",
|
|
504
505
|
{
|
|
506
|
+
"data-spark-component": "carousel-controls",
|
|
505
507
|
className: (0, import_class_variance_authority2.cx)(
|
|
506
508
|
"default:px-lg pointer-events-none absolute inset-0 flex flex-row items-center justify-between",
|
|
507
509
|
className
|
|
@@ -1460,6 +1462,7 @@ var IconButton = ({
|
|
|
1460
1462
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1461
1463
|
Button,
|
|
1462
1464
|
{
|
|
1465
|
+
"data-spark-component": "icon-button",
|
|
1463
1466
|
ref,
|
|
1464
1467
|
className: iconButtonStyles({ size, className }),
|
|
1465
1468
|
design,
|
|
@@ -1483,6 +1486,7 @@ var CarouselNextButton = ({
|
|
|
1483
1486
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1484
1487
|
IconButton,
|
|
1485
1488
|
{
|
|
1489
|
+
"data-spark-component": "carousel-next-button",
|
|
1486
1490
|
...ctx.getNextTriggerProps(),
|
|
1487
1491
|
intent: "surface",
|
|
1488
1492
|
design: "filled",
|
|
@@ -1527,6 +1531,7 @@ var CarouselPageIndicator = ({
|
|
|
1527
1531
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1528
1532
|
"button",
|
|
1529
1533
|
{
|
|
1534
|
+
"data-spark-component": "carousel-page-indicator",
|
|
1530
1535
|
ref,
|
|
1531
1536
|
...ctx.getIndicatorProps({ index }),
|
|
1532
1537
|
"aria-label": ariaLabel,
|
|
@@ -1552,6 +1557,7 @@ var CarouselPagePicker = ({ children, className }) => {
|
|
|
1552
1557
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_jsx_runtime11.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1553
1558
|
"div",
|
|
1554
1559
|
{
|
|
1560
|
+
"data-spark-component": "carousel-page-picker",
|
|
1555
1561
|
...ctx.getIndicatorGroupProps(),
|
|
1556
1562
|
className: (0, import_class_variance_authority9.cx)(
|
|
1557
1563
|
"default:min-h-sz-16 flex w-full flex-wrap items-center justify-center",
|
|
@@ -1577,6 +1583,7 @@ var CarouselPrevButton = ({
|
|
|
1577
1583
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1578
1584
|
IconButton,
|
|
1579
1585
|
{
|
|
1586
|
+
"data-spark-component": "carousel-prev-button",
|
|
1580
1587
|
...ctx.getPrevTriggerProps(),
|
|
1581
1588
|
intent: "surface",
|
|
1582
1589
|
design: "filled",
|
|
@@ -1630,6 +1637,7 @@ var CarouselSlide = ({
|
|
|
1630
1637
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1631
1638
|
"div",
|
|
1632
1639
|
{
|
|
1640
|
+
"data-spark-component": "carousel-slide",
|
|
1633
1641
|
ref: itemRef,
|
|
1634
1642
|
...ctx.getSlideProps({ index, totalSlides }),
|
|
1635
1643
|
className: (0, import_class_variance_authority10.cx)("default:bg-surface relative overflow-hidden", className),
|
|
@@ -1652,6 +1660,7 @@ var CarouselSlides = ({ children, className = "" }) => {
|
|
|
1652
1660
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1653
1661
|
"div",
|
|
1654
1662
|
{
|
|
1663
|
+
"data-spark-component": "carousel-slides",
|
|
1655
1664
|
...ctx.getSlidesContainerProps(),
|
|
1656
1665
|
className: (0, import_class_variance_authority11.cx)(
|
|
1657
1666
|
"focus-visible:u-outline relative w-full",
|