@spark-ui/components 10.15.0 → 10.16.0
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/dist/{InputGroup-aoaZxCLk.d.mts → Input-N8AWWSmt.d.mts} +14 -1
- package/dist/{InputGroup-aoaZxCLk.d.ts → Input-N8AWWSmt.d.ts} +14 -1
- package/dist/card/index.d.mts +1 -1
- package/dist/card/index.d.ts +1 -1
- package/dist/card/index.js +2 -2
- package/dist/card/index.js.map +1 -1
- package/dist/card/index.mjs +2 -2
- package/dist/card/index.mjs.map +1 -1
- package/dist/docgen.json +47 -9
- package/dist/drawer/index.js +3 -3
- package/dist/drawer/index.js.map +1 -1
- package/dist/drawer/index.mjs +3 -3
- package/dist/drawer/index.mjs.map +1 -1
- package/dist/input/index.d.mts +2 -3
- package/dist/input/index.d.ts +2 -3
- package/dist/snackbar/index.js +3 -2
- package/dist/snackbar/index.js.map +1 -1
- package/dist/snackbar/index.mjs +3 -2
- package/dist/snackbar/index.mjs.map +1 -1
- package/dist/stepper/index.d.mts +1 -2
- package/dist/stepper/index.d.ts +1 -2
- package/dist/textarea/index.d.mts +7 -8
- package/dist/textarea/index.d.ts +7 -8
- package/dist/textarea/index.js.map +1 -1
- package/dist/textarea/index.mjs.map +1 -1
- package/package.json +5 -5
- package/dist/Input-g0LpWuv0.d.mts +0 -17
- package/dist/Input-g0LpWuv0.d.ts +0 -17
|
@@ -25,4 +25,17 @@ declare const InputGroup: {
|
|
|
25
25
|
displayName: string;
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
type InputPrimitiveProps = ComponentPropsWithoutRef<'input'>;
|
|
29
|
+
interface InputProps extends InputPrimitiveProps {
|
|
30
|
+
asChild?: boolean;
|
|
31
|
+
onValueChange?: (value: string) => void;
|
|
32
|
+
ref?: Ref<HTMLInputElement>;
|
|
33
|
+
}
|
|
34
|
+
declare const Input: {
|
|
35
|
+
({ className, asChild, onValueChange, onChange, onKeyDown, disabled: disabledProp, readOnly: readOnlyProp, ref, ...others }: InputProps): react_jsx_runtime.JSX.Element;
|
|
36
|
+
displayName: string;
|
|
37
|
+
} & {
|
|
38
|
+
id: string;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export { type InputGroupProps as I, type InputProps as a, InputGroup as b, Input as c };
|
|
@@ -25,4 +25,17 @@ declare const InputGroup: {
|
|
|
25
25
|
displayName: string;
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
type InputPrimitiveProps = ComponentPropsWithoutRef<'input'>;
|
|
29
|
+
interface InputProps extends InputPrimitiveProps {
|
|
30
|
+
asChild?: boolean;
|
|
31
|
+
onValueChange?: (value: string) => void;
|
|
32
|
+
ref?: Ref<HTMLInputElement>;
|
|
33
|
+
}
|
|
34
|
+
declare const Input: {
|
|
35
|
+
({ className, asChild, onValueChange, onChange, onKeyDown, disabled: disabledProp, readOnly: readOnlyProp, ref, ...others }: InputProps): react_jsx_runtime.JSX.Element;
|
|
36
|
+
displayName: string;
|
|
37
|
+
} & {
|
|
38
|
+
id: string;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export { type InputGroupProps as I, type InputProps as a, InputGroup as b, Input as c };
|
package/dist/card/index.d.mts
CHANGED
|
@@ -4,7 +4,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
4
4
|
import { ComponentProps } from 'react';
|
|
5
5
|
|
|
6
6
|
declare const backdropStyles: (props?: ({
|
|
7
|
-
animation?: "none" | "
|
|
7
|
+
animation?: "none" | "pulse" | null | undefined;
|
|
8
8
|
intent?: "main" | "support" | "accent" | "basic" | "success" | "alert" | "danger" | "info" | "neutral" | "surface" | "surfaceInverse" | null | undefined;
|
|
9
9
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
10
|
type BackdropStylesProps = VariantProps<typeof backdropStyles>;
|
package/dist/card/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
4
4
|
import { ComponentProps } from 'react';
|
|
5
5
|
|
|
6
6
|
declare const backdropStyles: (props?: ({
|
|
7
|
-
animation?: "none" | "
|
|
7
|
+
animation?: "none" | "pulse" | null | undefined;
|
|
8
8
|
intent?: "main" | "support" | "accent" | "basic" | "success" | "alert" | "danger" | "info" | "neutral" | "surface" | "surfaceInverse" | null | undefined;
|
|
9
9
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
10
|
type BackdropStylesProps = VariantProps<typeof backdropStyles>;
|
package/dist/card/index.js
CHANGED
|
@@ -33,13 +33,13 @@ var backdropStyles = (0, import_class_variance_authority.cva)(
|
|
|
33
33
|
"default:bg-surface default:bg-gradient-to-r absolute inset-x-0 top-0",
|
|
34
34
|
"h-sz-16",
|
|
35
35
|
"default:rounded-t-lg",
|
|
36
|
-
"bg-[length:200%_100%]"
|
|
36
|
+
"bg-[length:200%_100%] bg-position-[0%_0%]"
|
|
37
37
|
],
|
|
38
38
|
{
|
|
39
39
|
variants: {
|
|
40
40
|
animation: {
|
|
41
41
|
none: "",
|
|
42
|
-
|
|
42
|
+
pulse: "animate-standalone-backdrop-pulse"
|
|
43
43
|
},
|
|
44
44
|
intent: (0, import_internal_utils.makeVariants)({
|
|
45
45
|
main: ["default:from-main/dim-4 default:via-main/dim-2 default:to-main/dim-4"],
|
package/dist/card/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/card/index.ts","../../src/card/Backdrop.tsx","../../src/slot/Slot.tsx","../../src/card/Card.styles.tsx","../../src/card/context.tsx","../../src/card/utils.ts","../../src/card/Card.tsx","../../src/card/Content.styles.tsx","../../src/card/Content.tsx"],"sourcesContent":["import { Backdrop } from './Backdrop'\nimport { Card as Root } from './Card'\nimport { Content } from './Content'\n\nexport const Card: typeof Root & {\n Content: typeof Content\n Backdrop: typeof Backdrop\n} = Object.assign(Root, {\n Content,\n Backdrop,\n})\n\nCard.displayName = 'Card'\nContent.displayName = 'Card.Content'\nBackdrop.displayName = 'Card.Backdrop'\n\nexport { type CardProps } from './Card'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const backdropStyles = cva(\n [\n 'default:bg-surface default:bg-gradient-to-r absolute inset-x-0 top-0',\n 'h-sz-16',\n 'default:rounded-t-lg',\n 'bg-[length:200%_100%]',\n ],\n {\n variants: {\n animation: {\n none: '',\n slideRight: 'animate-slide-bg-right',\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 'surfaceInverse',\n ]\n >({\n main: ['default:from-main/dim-4 default:via-main/dim-2 default:to-main/dim-4'],\n support: ['default:from-support/dim-4 default:via-support/dim-2 default:to-support/dim-4'],\n accent: ['default:from-accent/dim-4 default:via-accent/dim-2 default:to-accent/dim-4'],\n basic: ['default:from-basic/dim-4 default:via-basic/dim-2 default:to-basic/dim-4'],\n success: ['default:from-success/dim-4 default:via-success/dim-2 default:to-success/dim-4'],\n alert: ['default:from-alert/dim-4 default:via-alert/dim-2 default:to-alert/dim-4'],\n danger: ['default:from-error/dim-4 default:via-error/dim-2 default:to-error/dim-4'],\n info: ['default:from-info/dim-4 default:via-info/dim-2 default:to-info/dim-4'],\n neutral: ['default:from-neutral/dim-4 default:via-neutral/dim-2 default:to-neutral/dim-4'],\n surface: ['default:from-outline/dim-4 default:via-outline/dim-2 default:to-outline/dim-4'],\n surfaceInverse: [\n 'default:from-surface/dim-4 default:via-surface/dim-2 default:to-surface/dim-4',\n ],\n }),\n },\n defaultVariants: {\n intent: 'main',\n animation: 'none',\n },\n }\n)\n\nexport type BackdropStylesProps = VariantProps<typeof backdropStyles>\n\ninterface BackdropProps extends BackdropStylesProps {\n className?: string\n}\n\nexport const Backdrop = ({ intent = 'main', animation = 'none', ...props }: BackdropProps) => {\n return <div className={backdropStyles({ intent, animation })} {...props} />\n}\n\nBackdrop.displayName = 'Card.Backdrop'\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 { makeVariants, tw } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const cardStyles = cva(\n [\n 'group relative bg-clip-padding default:rounded-lg focus-visible:u-outline',\n 'disabled:opacity-dim-3 disabled:cursor-not-allowed',\n ],\n {\n variants: {\n design: {\n filled: [],\n outlined: ['border-sm'],\n tinted: [],\n },\n hasBackdrop: {\n true: ['pt-md'],\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 'surfaceInverse',\n ]\n >({\n main: [],\n support: [],\n accent: [],\n basic: [],\n success: [],\n alert: [],\n danger: [],\n info: [],\n neutral: [],\n surface: [],\n surfaceInverse: [],\n }),\n },\n compoundVariants: [\n // OUTLINED\n { intent: 'main', design: 'outlined', class: tw(['border-main']) },\n { intent: 'support', design: 'outlined', class: tw(['border-support']) },\n { intent: 'accent', design: 'outlined', class: tw(['border-accent']) },\n { intent: 'basic', design: 'outlined', class: tw(['border-basic']) },\n { intent: 'success', design: 'outlined', class: tw(['border-success']) },\n { intent: 'alert', design: 'outlined', class: tw(['border-alert']) },\n { intent: 'danger', design: 'outlined', class: tw(['border-error']) },\n { intent: 'info', design: 'outlined', class: tw(['border-info']) },\n { intent: 'neutral', design: 'outlined', class: tw(['border-neutral']) },\n { intent: 'surface', design: 'outlined', class: tw(['border-outline']) },\n ],\n defaultVariants: {\n design: 'filled',\n intent: 'surface',\n },\n }\n)\n\nexport type CardStylesProps = VariantProps<typeof cardStyles>\n","import { createContext, useContext } from 'react'\n\nimport type { CardStylesProps } from './Card.styles'\n\nexport interface CardContextValue {\n design: CardStylesProps['design']\n intent: CardStylesProps['intent']\n hasBackdrop: boolean\n inset: boolean\n isInteractive: boolean\n}\n\nconst CardContext = createContext<CardContextValue | undefined>(undefined)\n\nexport const useCardContext = () => {\n const context = useContext(CardContext)\n if (!context) {\n throw new Error('useCardContext must be used within a Card component')\n }\n\n return context\n}\n\nexport { CardContext }\n","import { Children, isValidElement, ReactNode } from 'react'\n\nconst MOUSE_EVENTS = [\n 'onClick',\n 'onMouseDown',\n 'onMouseUp',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseMove',\n 'onMouseOver',\n 'onMouseOut',\n 'onDoubleClick',\n 'onContextMenu',\n] as const\n\nexport const hasBackdrop = (children: ReactNode): boolean => {\n let backdropFound = false\n\n const searchForBackdrop = (node: ReactNode): void => {\n if (backdropFound) return\n\n Children.forEach(node, child => {\n if (backdropFound) return\n\n if (isValidElement(child)) {\n const isBackdropComponent =\n typeof child.type === 'function' &&\n (child.type as { displayName?: string }).displayName === 'Card.Backdrop'\n\n if (isBackdropComponent) {\n backdropFound = true\n\n return\n }\n\n const hasChildren =\n child.props && typeof child.props === 'object' && 'children' in child.props\n\n if (hasChildren) {\n const childChildren = (child.props as { children: ReactNode }).children\n if (childChildren !== undefined && childChildren !== null) {\n searchForBackdrop(childChildren)\n }\n }\n }\n })\n }\n\n searchForBackdrop(children)\n\n return backdropFound\n}\n\nexport const isInteractive = (\n children: ReactNode,\n asChild: boolean | undefined,\n props: Record<string, any>\n): boolean => {\n const hasMouseEventHandlers = MOUSE_EVENTS.some(event => event in props)\n\n if (hasMouseEventHandlers) {\n return true\n }\n\n if (!asChild) {\n return false\n }\n\n const child = Children.only(children)\n\n if (!isValidElement(child)) {\n return false\n }\n\n const interactiveElements = ['a', 'button']\n const isInteractiveElement =\n typeof child.type === 'string' && interactiveElements.includes(child.type)\n\n if (isInteractiveElement) {\n return true\n }\n\n const childProps = child.props as Record<string, any>\n const hasChildEventHandlers = MOUSE_EVENTS.some(event => event in childProps)\n\n return hasChildEventHandlers\n}\n","import { ComponentProps } from 'react'\n\nimport { Slot } from '../slot'\nimport { cardStyles, type CardStylesProps } from './Card.styles'\nimport { CardContext } from './context'\nimport { hasBackdrop, isInteractive } from './utils'\n\nexport interface CardProps extends ComponentProps<'div'>, CardStylesProps {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n /**\n * Whether the card should have an inset padding.\n */\n inset?: boolean\n}\n\nexport const Card = ({\n children,\n design = 'filled',\n intent = 'surface',\n inset = false,\n asChild,\n className,\n ref,\n ...props\n}: CardProps) => {\n const Component = asChild ? Slot : 'div'\n const backdropDetected = hasBackdrop(children)\n const interactiveDetected = isInteractive(children, asChild, props)\n\n return (\n <CardContext.Provider\n value={{\n design,\n intent,\n hasBackdrop: backdropDetected,\n inset,\n isInteractive: interactiveDetected,\n }}\n >\n <Component\n data-spark-component=\"card\"\n data-interactive={interactiveDetected}\n ref={ref}\n className={cardStyles({\n className,\n design,\n intent,\n hasBackdrop: backdropDetected,\n })}\n {...props}\n >\n {children}\n </Component>\n </CardContext.Provider>\n )\n}\n\nCard.displayName = 'Card'\n","import { makeVariants, tw } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const contentStyles = cva(\n [\n 'relative h-full default:rounded-lg w-full focus-visible:u-outline',\n 'default:transition-colors default:duration-200 ease-linear',\n ],\n {\n variants: {\n inset: {\n false: ['default:p-lg'],\n },\n design: {\n filled: [],\n outlined: [\n 'default:bg-surface group-focus:bg-surface-hovered group-not-disabled:group-data-[interactive=true]:group-hover:bg-surface-hovered',\n ],\n tinted: [],\n },\n hasBackdrop: {\n true: ['rounded-t-[16px_8px] '],\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 'surfaceInverse',\n ]\n >({\n main: [],\n support: [],\n accent: [],\n basic: [],\n success: [],\n alert: [],\n danger: [],\n info: [],\n neutral: [],\n surface: [],\n surfaceInverse: [],\n }),\n },\n compoundVariants: [\n // FILLED\n {\n intent: 'main',\n design: 'filled',\n class: tw([\n 'bg-main text-on-main group-focus:bg-main-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-main-hovered',\n ]),\n },\n {\n intent: 'support',\n design: 'filled',\n class: tw([\n 'bg-support text-on-support group-focus:bg-support-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-support-hovered',\n ]),\n },\n {\n intent: 'accent',\n design: 'filled',\n class: tw([\n 'bg-accent text-on-accent group-focus:bg-accent-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-accent-hovered',\n ]),\n },\n {\n intent: 'basic',\n design: 'filled',\n class: tw([\n 'bg-basic text-on-basic group-focus:bg-basic-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-basic-hovered',\n ]),\n },\n {\n intent: 'success',\n design: 'filled',\n class: tw([\n 'bg-success text-on-success group-focus:bg-success-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-success-hovered',\n ]),\n },\n {\n intent: 'alert',\n design: 'filled',\n class: tw([\n 'bg-alert text-on-alert group-focus:bg-alert-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-alert-hovered',\n ]),\n },\n {\n intent: 'danger',\n design: 'filled',\n class: tw([\n 'text-on-error bg-error group-focus:bg-error-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-error-hovered',\n ]),\n },\n {\n intent: 'info',\n design: 'filled',\n class: tw([\n 'text-on-error bg-info group-focus:bg-info-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-info-hovered',\n ]),\n },\n {\n intent: 'neutral',\n design: 'filled',\n class: tw([\n 'bg-neutral text-on-neutral group-focus:bg-neutral-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-neutral-hovered',\n ]),\n },\n {\n intent: 'surface',\n design: 'filled',\n class: tw([\n 'bg-surface text-on-surface group-focus:bg-surface-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-surface-hovered',\n ]),\n },\n // OUTLINED\n /**\n * Outlined styles are handled by the Card component (parent)\n */\n // TINTED\n {\n intent: 'main',\n design: 'tinted',\n class: tw([\n 'bg-main-container text-on-main-container group-focus:bg-main-container-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-main-container-hovered',\n ]),\n },\n {\n intent: 'support',\n design: 'tinted',\n class: tw([\n 'bg-support-container text-on-support-container group-focus:bg-support-container-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-support-container-hovered',\n ]),\n },\n {\n intent: 'accent',\n design: 'tinted',\n class: tw([\n 'bg-accent-container text-on-accent-container group-focus:bg-accent-container-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-accent-container-hovered',\n ]),\n },\n {\n intent: 'basic',\n design: 'tinted',\n class: tw([\n 'bg-basic-container text-on-basic-container group-focus:bg-basic-container-hovered',\n ]),\n },\n {\n intent: 'success',\n design: 'tinted',\n class: tw([\n 'bg-success-container text-on-success-container group-focus:bg-success-container-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-success-container-hovered',\n ]),\n },\n {\n intent: 'alert',\n design: 'tinted',\n class: tw([\n 'bg-alert-container text-on-alert-container group-focus:bg-alert-container-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-alert-container-hovered',\n ]),\n },\n {\n intent: 'danger',\n design: 'tinted',\n class: tw([\n 'bg-error-container text-on-error-container group-focus:bg-error-container-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-error-container-hovered',\n ]),\n },\n {\n intent: 'info',\n design: 'tinted',\n class: tw([\n 'bg-info-container text-on-info-container group-focus:bg-info-container-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-info-container-hovered',\n ]),\n },\n {\n intent: 'neutral',\n design: 'tinted',\n class: tw([\n 'bg-neutral-container text-on-neutral-container group-focus:bg-neutral-container-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-neutral-container-hovered',\n ]),\n },\n {\n intent: 'surface',\n design: 'tinted',\n class: tw([\n 'bg-surface text-on-surface group-focus:bg-surface-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-surface-hovered',\n ]),\n },\n ],\n defaultVariants: {\n design: 'filled',\n intent: 'surface',\n inset: false,\n hasBackdrop: true,\n },\n }\n)\n\nexport type ContentStylesProps = VariantProps<typeof contentStyles>\n","import { ComponentProps } from 'react'\n\nimport { Slot } from '../slot'\nimport { contentStyles } from './Content.styles'\nimport { useCardContext } from './context'\n\nexport interface ContentProps extends ComponentProps<'div'> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n /**\n * Whether the card should have an inset padding.\n */\n inset?: boolean\n}\n\nexport const Content = ({ children, inset, asChild, className, ref, ...props }: ContentProps) => {\n const Component = asChild ? Slot : 'div'\n const { design, intent, hasBackdrop } = useCardContext()\n\n return (\n <Component\n data-spark-component=\"card-content\"\n ref={ref}\n className={contentStyles({\n className,\n design,\n intent,\n inset,\n hasBackdrop,\n })}\n {...props}\n >\n {children}\n </Component>\n )\n}\n\nContent.displayName = 'Content'\n"],"mappings":";;;;;;;;;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IAAMC,QAGT,OAAO,OAAO,MAAM;AAAA,EACtB;AAAA,EACA;AACF,CAAC;AAEDA,MAAK,cAAc;AACnB,QAAQ,cAAc;AACtB,SAAS,cAAc;","names":["Card","import_jsx_runtime","RadixSlot","import_internal_utils","import_class_variance_authority","import_react","import_react","import_jsx_runtime","import_internal_utils","import_class_variance_authority","import_jsx_runtime","hasBackdrop","Card"]}
|
|
1
|
+
{"version":3,"sources":["../../src/card/index.ts","../../src/card/Backdrop.tsx","../../src/slot/Slot.tsx","../../src/card/Card.styles.tsx","../../src/card/context.tsx","../../src/card/utils.ts","../../src/card/Card.tsx","../../src/card/Content.styles.tsx","../../src/card/Content.tsx"],"sourcesContent":["import { Backdrop } from './Backdrop'\nimport { Card as Root } from './Card'\nimport { Content } from './Content'\n\nexport const Card: typeof Root & {\n Content: typeof Content\n Backdrop: typeof Backdrop\n} = Object.assign(Root, {\n Content,\n Backdrop,\n})\n\nCard.displayName = 'Card'\nContent.displayName = 'Card.Content'\nBackdrop.displayName = 'Card.Backdrop'\n\nexport { type CardProps } from './Card'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const backdropStyles = cva(\n [\n 'default:bg-surface default:bg-gradient-to-r absolute inset-x-0 top-0',\n 'h-sz-16',\n 'default:rounded-t-lg',\n 'bg-[length:200%_100%] bg-position-[0%_0%]',\n ],\n {\n variants: {\n animation: {\n none: '',\n pulse: 'animate-standalone-backdrop-pulse',\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 'surfaceInverse',\n ]\n >({\n main: ['default:from-main/dim-4 default:via-main/dim-2 default:to-main/dim-4'],\n support: ['default:from-support/dim-4 default:via-support/dim-2 default:to-support/dim-4'],\n accent: ['default:from-accent/dim-4 default:via-accent/dim-2 default:to-accent/dim-4'],\n basic: ['default:from-basic/dim-4 default:via-basic/dim-2 default:to-basic/dim-4'],\n success: ['default:from-success/dim-4 default:via-success/dim-2 default:to-success/dim-4'],\n alert: ['default:from-alert/dim-4 default:via-alert/dim-2 default:to-alert/dim-4'],\n danger: ['default:from-error/dim-4 default:via-error/dim-2 default:to-error/dim-4'],\n info: ['default:from-info/dim-4 default:via-info/dim-2 default:to-info/dim-4'],\n neutral: ['default:from-neutral/dim-4 default:via-neutral/dim-2 default:to-neutral/dim-4'],\n surface: ['default:from-outline/dim-4 default:via-outline/dim-2 default:to-outline/dim-4'],\n surfaceInverse: [\n 'default:from-surface/dim-4 default:via-surface/dim-2 default:to-surface/dim-4',\n ],\n }),\n },\n defaultVariants: {\n intent: 'main',\n animation: 'none',\n },\n }\n)\n\nexport type BackdropStylesProps = VariantProps<typeof backdropStyles>\n\ninterface BackdropProps extends BackdropStylesProps {\n className?: string\n}\n\nexport const Backdrop = ({ intent = 'main', animation = 'none', ...props }: BackdropProps) => {\n return <div className={backdropStyles({ intent, animation })} {...props} />\n}\n\nBackdrop.displayName = 'Card.Backdrop'\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 { makeVariants, tw } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const cardStyles = cva(\n [\n 'group relative bg-clip-padding default:rounded-lg focus-visible:u-outline',\n 'disabled:opacity-dim-3 disabled:cursor-not-allowed',\n ],\n {\n variants: {\n design: {\n filled: [],\n outlined: ['border-sm'],\n tinted: [],\n },\n hasBackdrop: {\n true: ['pt-md'],\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 'surfaceInverse',\n ]\n >({\n main: [],\n support: [],\n accent: [],\n basic: [],\n success: [],\n alert: [],\n danger: [],\n info: [],\n neutral: [],\n surface: [],\n surfaceInverse: [],\n }),\n },\n compoundVariants: [\n // OUTLINED\n { intent: 'main', design: 'outlined', class: tw(['border-main']) },\n { intent: 'support', design: 'outlined', class: tw(['border-support']) },\n { intent: 'accent', design: 'outlined', class: tw(['border-accent']) },\n { intent: 'basic', design: 'outlined', class: tw(['border-basic']) },\n { intent: 'success', design: 'outlined', class: tw(['border-success']) },\n { intent: 'alert', design: 'outlined', class: tw(['border-alert']) },\n { intent: 'danger', design: 'outlined', class: tw(['border-error']) },\n { intent: 'info', design: 'outlined', class: tw(['border-info']) },\n { intent: 'neutral', design: 'outlined', class: tw(['border-neutral']) },\n { intent: 'surface', design: 'outlined', class: tw(['border-outline']) },\n ],\n defaultVariants: {\n design: 'filled',\n intent: 'surface',\n },\n }\n)\n\nexport type CardStylesProps = VariantProps<typeof cardStyles>\n","import { createContext, useContext } from 'react'\n\nimport type { CardStylesProps } from './Card.styles'\n\nexport interface CardContextValue {\n design: CardStylesProps['design']\n intent: CardStylesProps['intent']\n hasBackdrop: boolean\n inset: boolean\n isInteractive: boolean\n}\n\nconst CardContext = createContext<CardContextValue | undefined>(undefined)\n\nexport const useCardContext = () => {\n const context = useContext(CardContext)\n if (!context) {\n throw new Error('useCardContext must be used within a Card component')\n }\n\n return context\n}\n\nexport { CardContext }\n","import { Children, isValidElement, ReactNode } from 'react'\n\nconst MOUSE_EVENTS = [\n 'onClick',\n 'onMouseDown',\n 'onMouseUp',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseMove',\n 'onMouseOver',\n 'onMouseOut',\n 'onDoubleClick',\n 'onContextMenu',\n] as const\n\nexport const hasBackdrop = (children: ReactNode): boolean => {\n let backdropFound = false\n\n const searchForBackdrop = (node: ReactNode): void => {\n if (backdropFound) return\n\n Children.forEach(node, child => {\n if (backdropFound) return\n\n if (isValidElement(child)) {\n const isBackdropComponent =\n typeof child.type === 'function' &&\n (child.type as { displayName?: string }).displayName === 'Card.Backdrop'\n\n if (isBackdropComponent) {\n backdropFound = true\n\n return\n }\n\n const hasChildren =\n child.props && typeof child.props === 'object' && 'children' in child.props\n\n if (hasChildren) {\n const childChildren = (child.props as { children: ReactNode }).children\n if (childChildren !== undefined && childChildren !== null) {\n searchForBackdrop(childChildren)\n }\n }\n }\n })\n }\n\n searchForBackdrop(children)\n\n return backdropFound\n}\n\nexport const isInteractive = (\n children: ReactNode,\n asChild: boolean | undefined,\n props: Record<string, any>\n): boolean => {\n const hasMouseEventHandlers = MOUSE_EVENTS.some(event => event in props)\n\n if (hasMouseEventHandlers) {\n return true\n }\n\n if (!asChild) {\n return false\n }\n\n const child = Children.only(children)\n\n if (!isValidElement(child)) {\n return false\n }\n\n const interactiveElements = ['a', 'button']\n const isInteractiveElement =\n typeof child.type === 'string' && interactiveElements.includes(child.type)\n\n if (isInteractiveElement) {\n return true\n }\n\n const childProps = child.props as Record<string, any>\n const hasChildEventHandlers = MOUSE_EVENTS.some(event => event in childProps)\n\n return hasChildEventHandlers\n}\n","import { ComponentProps } from 'react'\n\nimport { Slot } from '../slot'\nimport { cardStyles, type CardStylesProps } from './Card.styles'\nimport { CardContext } from './context'\nimport { hasBackdrop, isInteractive } from './utils'\n\nexport interface CardProps extends ComponentProps<'div'>, CardStylesProps {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n /**\n * Whether the card should have an inset padding.\n */\n inset?: boolean\n}\n\nexport const Card = ({\n children,\n design = 'filled',\n intent = 'surface',\n inset = false,\n asChild,\n className,\n ref,\n ...props\n}: CardProps) => {\n const Component = asChild ? Slot : 'div'\n const backdropDetected = hasBackdrop(children)\n const interactiveDetected = isInteractive(children, asChild, props)\n\n return (\n <CardContext.Provider\n value={{\n design,\n intent,\n hasBackdrop: backdropDetected,\n inset,\n isInteractive: interactiveDetected,\n }}\n >\n <Component\n data-spark-component=\"card\"\n data-interactive={interactiveDetected}\n ref={ref}\n className={cardStyles({\n className,\n design,\n intent,\n hasBackdrop: backdropDetected,\n })}\n {...props}\n >\n {children}\n </Component>\n </CardContext.Provider>\n )\n}\n\nCard.displayName = 'Card'\n","import { makeVariants, tw } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const contentStyles = cva(\n [\n 'relative h-full default:rounded-lg w-full focus-visible:u-outline',\n 'default:transition-colors default:duration-200 ease-linear',\n ],\n {\n variants: {\n inset: {\n false: ['default:p-lg'],\n },\n design: {\n filled: [],\n outlined: [\n 'default:bg-surface group-focus:bg-surface-hovered group-not-disabled:group-data-[interactive=true]:group-hover:bg-surface-hovered',\n ],\n tinted: [],\n },\n hasBackdrop: {\n true: ['rounded-t-[16px_8px] '],\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 'surfaceInverse',\n ]\n >({\n main: [],\n support: [],\n accent: [],\n basic: [],\n success: [],\n alert: [],\n danger: [],\n info: [],\n neutral: [],\n surface: [],\n surfaceInverse: [],\n }),\n },\n compoundVariants: [\n // FILLED\n {\n intent: 'main',\n design: 'filled',\n class: tw([\n 'bg-main text-on-main group-focus:bg-main-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-main-hovered',\n ]),\n },\n {\n intent: 'support',\n design: 'filled',\n class: tw([\n 'bg-support text-on-support group-focus:bg-support-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-support-hovered',\n ]),\n },\n {\n intent: 'accent',\n design: 'filled',\n class: tw([\n 'bg-accent text-on-accent group-focus:bg-accent-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-accent-hovered',\n ]),\n },\n {\n intent: 'basic',\n design: 'filled',\n class: tw([\n 'bg-basic text-on-basic group-focus:bg-basic-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-basic-hovered',\n ]),\n },\n {\n intent: 'success',\n design: 'filled',\n class: tw([\n 'bg-success text-on-success group-focus:bg-success-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-success-hovered',\n ]),\n },\n {\n intent: 'alert',\n design: 'filled',\n class: tw([\n 'bg-alert text-on-alert group-focus:bg-alert-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-alert-hovered',\n ]),\n },\n {\n intent: 'danger',\n design: 'filled',\n class: tw([\n 'text-on-error bg-error group-focus:bg-error-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-error-hovered',\n ]),\n },\n {\n intent: 'info',\n design: 'filled',\n class: tw([\n 'text-on-error bg-info group-focus:bg-info-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-info-hovered',\n ]),\n },\n {\n intent: 'neutral',\n design: 'filled',\n class: tw([\n 'bg-neutral text-on-neutral group-focus:bg-neutral-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-neutral-hovered',\n ]),\n },\n {\n intent: 'surface',\n design: 'filled',\n class: tw([\n 'bg-surface text-on-surface group-focus:bg-surface-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-surface-hovered',\n ]),\n },\n // OUTLINED\n /**\n * Outlined styles are handled by the Card component (parent)\n */\n // TINTED\n {\n intent: 'main',\n design: 'tinted',\n class: tw([\n 'bg-main-container text-on-main-container group-focus:bg-main-container-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-main-container-hovered',\n ]),\n },\n {\n intent: 'support',\n design: 'tinted',\n class: tw([\n 'bg-support-container text-on-support-container group-focus:bg-support-container-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-support-container-hovered',\n ]),\n },\n {\n intent: 'accent',\n design: 'tinted',\n class: tw([\n 'bg-accent-container text-on-accent-container group-focus:bg-accent-container-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-accent-container-hovered',\n ]),\n },\n {\n intent: 'basic',\n design: 'tinted',\n class: tw([\n 'bg-basic-container text-on-basic-container group-focus:bg-basic-container-hovered',\n ]),\n },\n {\n intent: 'success',\n design: 'tinted',\n class: tw([\n 'bg-success-container text-on-success-container group-focus:bg-success-container-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-success-container-hovered',\n ]),\n },\n {\n intent: 'alert',\n design: 'tinted',\n class: tw([\n 'bg-alert-container text-on-alert-container group-focus:bg-alert-container-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-alert-container-hovered',\n ]),\n },\n {\n intent: 'danger',\n design: 'tinted',\n class: tw([\n 'bg-error-container text-on-error-container group-focus:bg-error-container-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-error-container-hovered',\n ]),\n },\n {\n intent: 'info',\n design: 'tinted',\n class: tw([\n 'bg-info-container text-on-info-container group-focus:bg-info-container-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-info-container-hovered',\n ]),\n },\n {\n intent: 'neutral',\n design: 'tinted',\n class: tw([\n 'bg-neutral-container text-on-neutral-container group-focus:bg-neutral-container-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-neutral-container-hovered',\n ]),\n },\n {\n intent: 'surface',\n design: 'tinted',\n class: tw([\n 'bg-surface text-on-surface group-focus:bg-surface-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-surface-hovered',\n ]),\n },\n ],\n defaultVariants: {\n design: 'filled',\n intent: 'surface',\n inset: false,\n hasBackdrop: true,\n },\n }\n)\n\nexport type ContentStylesProps = VariantProps<typeof contentStyles>\n","import { ComponentProps } from 'react'\n\nimport { Slot } from '../slot'\nimport { contentStyles } from './Content.styles'\nimport { useCardContext } from './context'\n\nexport interface ContentProps extends ComponentProps<'div'> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n /**\n * Whether the card should have an inset padding.\n */\n inset?: boolean\n}\n\nexport const Content = ({ children, inset, asChild, className, ref, ...props }: ContentProps) => {\n const Component = asChild ? Slot : 'div'\n const { design, intent, hasBackdrop } = useCardContext()\n\n return (\n <Component\n data-spark-component=\"card-content\"\n ref={ref}\n className={contentStyles({\n className,\n design,\n intent,\n inset,\n hasBackdrop,\n })}\n {...props}\n >\n {children}\n </Component>\n )\n}\n\nContent.displayName = 'Content'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,cAAAA;AAAA;AAAA;;;ACAA,4BAA6B;AAC7B,sCAAkC;AA4DzB;AA1DF,IAAM,qBAAiB;AAAA,EAC5B;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,WAAW;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MACT;AAAA,MACA,YAAQ,oCAeN;AAAA,QACA,MAAM,CAAC,sEAAsE;AAAA,QAC7E,SAAS,CAAC,+EAA+E;AAAA,QACzF,QAAQ,CAAC,4EAA4E;AAAA,QACrF,OAAO,CAAC,yEAAyE;AAAA,QACjF,SAAS,CAAC,+EAA+E;AAAA,QACzF,OAAO,CAAC,yEAAyE;AAAA,QACjF,QAAQ,CAAC,yEAAyE;AAAA,QAClF,MAAM,CAAC,sEAAsE;AAAA,QAC7E,SAAS,CAAC,+EAA+E;AAAA,QACzF,SA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,WAAO,2BAAG;AAAA,UACR;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,aAAa;AAAA,IACf;AAAA,EACF;AACF;;;AC5MI,IAAAC,sBAAA;AALG,IAAM,UAAU,CAAC,EAAE,UAAU,OAAO,SAAS,WAAW,KAAK,GAAG,MAAM,MAAoB;AAC/F,QAAM,YAAY,UAAU,OAAO;AACnC,QAAM,EAAE,QAAQ,QAAQ,aAAAC,aAAY,IAAI,eAAe;AAEvD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,wBAAqB;AAAA,MACrB;AAAA,MACA,WAAW,cAAc;AAAA,QACvB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,aAAAA;AAAA,MACF,CAAC;AAAA,MACA,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;AAEA,QAAQ,cAAc;;;ARnCf,IAAMC,QAGT,OAAO,OAAO,MAAM;AAAA,EACtB;AAAA,EACA;AACF,CAAC;AAEDA,MAAK,cAAc;AACnB,QAAQ,cAAc;AACtB,SAAS,cAAc;","names":["Card","import_jsx_runtime","RadixSlot","import_internal_utils","import_class_variance_authority","import_react","import_react","import_jsx_runtime","import_internal_utils","import_class_variance_authority","import_jsx_runtime","hasBackdrop","Card"]}
|
package/dist/card/index.mjs
CHANGED
|
@@ -11,13 +11,13 @@ var backdropStyles = cva(
|
|
|
11
11
|
"default:bg-surface default:bg-gradient-to-r absolute inset-x-0 top-0",
|
|
12
12
|
"h-sz-16",
|
|
13
13
|
"default:rounded-t-lg",
|
|
14
|
-
"bg-[length:200%_100%]"
|
|
14
|
+
"bg-[length:200%_100%] bg-position-[0%_0%]"
|
|
15
15
|
],
|
|
16
16
|
{
|
|
17
17
|
variants: {
|
|
18
18
|
animation: {
|
|
19
19
|
none: "",
|
|
20
|
-
|
|
20
|
+
pulse: "animate-standalone-backdrop-pulse"
|
|
21
21
|
},
|
|
22
22
|
intent: makeVariants({
|
|
23
23
|
main: ["default:from-main/dim-4 default:via-main/dim-2 default:to-main/dim-4"],
|
package/dist/card/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/card/Backdrop.tsx","../../src/card/Card.styles.tsx","../../src/card/context.tsx","../../src/card/utils.ts","../../src/card/Card.tsx","../../src/card/Content.styles.tsx","../../src/card/Content.tsx","../../src/card/index.ts"],"sourcesContent":["import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const backdropStyles = cva(\n [\n 'default:bg-surface default:bg-gradient-to-r absolute inset-x-0 top-0',\n 'h-sz-16',\n 'default:rounded-t-lg',\n 'bg-[length:200%_100%]',\n ],\n {\n variants: {\n animation: {\n none: '',\n slideRight: 'animate-slide-bg-right',\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 'surfaceInverse',\n ]\n >({\n main: ['default:from-main/dim-4 default:via-main/dim-2 default:to-main/dim-4'],\n support: ['default:from-support/dim-4 default:via-support/dim-2 default:to-support/dim-4'],\n accent: ['default:from-accent/dim-4 default:via-accent/dim-2 default:to-accent/dim-4'],\n basic: ['default:from-basic/dim-4 default:via-basic/dim-2 default:to-basic/dim-4'],\n success: ['default:from-success/dim-4 default:via-success/dim-2 default:to-success/dim-4'],\n alert: ['default:from-alert/dim-4 default:via-alert/dim-2 default:to-alert/dim-4'],\n danger: ['default:from-error/dim-4 default:via-error/dim-2 default:to-error/dim-4'],\n info: ['default:from-info/dim-4 default:via-info/dim-2 default:to-info/dim-4'],\n neutral: ['default:from-neutral/dim-4 default:via-neutral/dim-2 default:to-neutral/dim-4'],\n surface: ['default:from-outline/dim-4 default:via-outline/dim-2 default:to-outline/dim-4'],\n surfaceInverse: [\n 'default:from-surface/dim-4 default:via-surface/dim-2 default:to-surface/dim-4',\n ],\n }),\n },\n defaultVariants: {\n intent: 'main',\n animation: 'none',\n },\n }\n)\n\nexport type BackdropStylesProps = VariantProps<typeof backdropStyles>\n\ninterface BackdropProps extends BackdropStylesProps {\n className?: string\n}\n\nexport const Backdrop = ({ intent = 'main', animation = 'none', ...props }: BackdropProps) => {\n return <div className={backdropStyles({ intent, animation })} {...props} />\n}\n\nBackdrop.displayName = 'Card.Backdrop'\n","import { makeVariants, tw } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const cardStyles = cva(\n [\n 'group relative bg-clip-padding default:rounded-lg focus-visible:u-outline',\n 'disabled:opacity-dim-3 disabled:cursor-not-allowed',\n ],\n {\n variants: {\n design: {\n filled: [],\n outlined: ['border-sm'],\n tinted: [],\n },\n hasBackdrop: {\n true: ['pt-md'],\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 'surfaceInverse',\n ]\n >({\n main: [],\n support: [],\n accent: [],\n basic: [],\n success: [],\n alert: [],\n danger: [],\n info: [],\n neutral: [],\n surface: [],\n surfaceInverse: [],\n }),\n },\n compoundVariants: [\n // OUTLINED\n { intent: 'main', design: 'outlined', class: tw(['border-main']) },\n { intent: 'support', design: 'outlined', class: tw(['border-support']) },\n { intent: 'accent', design: 'outlined', class: tw(['border-accent']) },\n { intent: 'basic', design: 'outlined', class: tw(['border-basic']) },\n { intent: 'success', design: 'outlined', class: tw(['border-success']) },\n { intent: 'alert', design: 'outlined', class: tw(['border-alert']) },\n { intent: 'danger', design: 'outlined', class: tw(['border-error']) },\n { intent: 'info', design: 'outlined', class: tw(['border-info']) },\n { intent: 'neutral', design: 'outlined', class: tw(['border-neutral']) },\n { intent: 'surface', design: 'outlined', class: tw(['border-outline']) },\n ],\n defaultVariants: {\n design: 'filled',\n intent: 'surface',\n },\n }\n)\n\nexport type CardStylesProps = VariantProps<typeof cardStyles>\n","import { createContext, useContext } from 'react'\n\nimport type { CardStylesProps } from './Card.styles'\n\nexport interface CardContextValue {\n design: CardStylesProps['design']\n intent: CardStylesProps['intent']\n hasBackdrop: boolean\n inset: boolean\n isInteractive: boolean\n}\n\nconst CardContext = createContext<CardContextValue | undefined>(undefined)\n\nexport const useCardContext = () => {\n const context = useContext(CardContext)\n if (!context) {\n throw new Error('useCardContext must be used within a Card component')\n }\n\n return context\n}\n\nexport { CardContext }\n","import { Children, isValidElement, ReactNode } from 'react'\n\nconst MOUSE_EVENTS = [\n 'onClick',\n 'onMouseDown',\n 'onMouseUp',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseMove',\n 'onMouseOver',\n 'onMouseOut',\n 'onDoubleClick',\n 'onContextMenu',\n] as const\n\nexport const hasBackdrop = (children: ReactNode): boolean => {\n let backdropFound = false\n\n const searchForBackdrop = (node: ReactNode): void => {\n if (backdropFound) return\n\n Children.forEach(node, child => {\n if (backdropFound) return\n\n if (isValidElement(child)) {\n const isBackdropComponent =\n typeof child.type === 'function' &&\n (child.type as { displayName?: string }).displayName === 'Card.Backdrop'\n\n if (isBackdropComponent) {\n backdropFound = true\n\n return\n }\n\n const hasChildren =\n child.props && typeof child.props === 'object' && 'children' in child.props\n\n if (hasChildren) {\n const childChildren = (child.props as { children: ReactNode }).children\n if (childChildren !== undefined && childChildren !== null) {\n searchForBackdrop(childChildren)\n }\n }\n }\n })\n }\n\n searchForBackdrop(children)\n\n return backdropFound\n}\n\nexport const isInteractive = (\n children: ReactNode,\n asChild: boolean | undefined,\n props: Record<string, any>\n): boolean => {\n const hasMouseEventHandlers = MOUSE_EVENTS.some(event => event in props)\n\n if (hasMouseEventHandlers) {\n return true\n }\n\n if (!asChild) {\n return false\n }\n\n const child = Children.only(children)\n\n if (!isValidElement(child)) {\n return false\n }\n\n const interactiveElements = ['a', 'button']\n const isInteractiveElement =\n typeof child.type === 'string' && interactiveElements.includes(child.type)\n\n if (isInteractiveElement) {\n return true\n }\n\n const childProps = child.props as Record<string, any>\n const hasChildEventHandlers = MOUSE_EVENTS.some(event => event in childProps)\n\n return hasChildEventHandlers\n}\n","import { ComponentProps } from 'react'\n\nimport { Slot } from '../slot'\nimport { cardStyles, type CardStylesProps } from './Card.styles'\nimport { CardContext } from './context'\nimport { hasBackdrop, isInteractive } from './utils'\n\nexport interface CardProps extends ComponentProps<'div'>, CardStylesProps {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n /**\n * Whether the card should have an inset padding.\n */\n inset?: boolean\n}\n\nexport const Card = ({\n children,\n design = 'filled',\n intent = 'surface',\n inset = false,\n asChild,\n className,\n ref,\n ...props\n}: CardProps) => {\n const Component = asChild ? Slot : 'div'\n const backdropDetected = hasBackdrop(children)\n const interactiveDetected = isInteractive(children, asChild, props)\n\n return (\n <CardContext.Provider\n value={{\n design,\n intent,\n hasBackdrop: backdropDetected,\n inset,\n isInteractive: interactiveDetected,\n }}\n >\n <Component\n data-spark-component=\"card\"\n data-interactive={interactiveDetected}\n ref={ref}\n className={cardStyles({\n className,\n design,\n intent,\n hasBackdrop: backdropDetected,\n })}\n {...props}\n >\n {children}\n </Component>\n </CardContext.Provider>\n )\n}\n\nCard.displayName = 'Card'\n","import { makeVariants, tw } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const contentStyles = cva(\n [\n 'relative h-full default:rounded-lg w-full focus-visible:u-outline',\n 'default:transition-colors default:duration-200 ease-linear',\n ],\n {\n variants: {\n inset: {\n false: ['default:p-lg'],\n },\n design: {\n filled: [],\n outlined: [\n 'default:bg-surface group-focus:bg-surface-hovered group-not-disabled:group-data-[interactive=true]:group-hover:bg-surface-hovered',\n ],\n tinted: [],\n },\n hasBackdrop: {\n true: ['rounded-t-[16px_8px] '],\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 'surfaceInverse',\n ]\n >({\n main: [],\n support: [],\n accent: [],\n basic: [],\n success: [],\n alert: [],\n danger: [],\n info: [],\n neutral: [],\n surface: [],\n surfaceInverse: [],\n }),\n },\n compoundVariants: [\n // FILLED\n {\n intent: 'main',\n design: 'filled',\n class: tw([\n 'bg-main text-on-main group-focus:bg-main-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-main-hovered',\n ]),\n },\n {\n intent: 'support',\n design: 'filled',\n class: tw([\n 'bg-support text-on-support group-focus:bg-support-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-support-hovered',\n ]),\n },\n {\n intent: 'accent',\n design: 'filled',\n class: tw([\n 'bg-accent text-on-accent group-focus:bg-accent-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-accent-hovered',\n ]),\n },\n {\n intent: 'basic',\n design: 'filled',\n class: tw([\n 'bg-basic text-on-basic group-focus:bg-basic-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-basic-hovered',\n ]),\n },\n {\n intent: 'success',\n design: 'filled',\n class: tw([\n 'bg-success text-on-success group-focus:bg-success-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-success-hovered',\n ]),\n },\n {\n intent: 'alert',\n design: 'filled',\n class: tw([\n 'bg-alert text-on-alert group-focus:bg-alert-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-alert-hovered',\n ]),\n },\n {\n intent: 'danger',\n design: 'filled',\n class: tw([\n 'text-on-error bg-error group-focus:bg-error-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-error-hovered',\n ]),\n },\n {\n intent: 'info',\n design: 'filled',\n class: tw([\n 'text-on-error bg-info group-focus:bg-info-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-info-hovered',\n ]),\n },\n {\n intent: 'neutral',\n design: 'filled',\n class: tw([\n 'bg-neutral text-on-neutral group-focus:bg-neutral-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-neutral-hovered',\n ]),\n },\n {\n intent: 'surface',\n design: 'filled',\n class: tw([\n 'bg-surface text-on-surface group-focus:bg-surface-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-surface-hovered',\n ]),\n },\n // OUTLINED\n /**\n * Outlined styles are handled by the Card component (parent)\n */\n // TINTED\n {\n intent: 'main',\n design: 'tinted',\n class: tw([\n 'bg-main-container text-on-main-container group-focus:bg-main-container-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-main-container-hovered',\n ]),\n },\n {\n intent: 'support',\n design: 'tinted',\n class: tw([\n 'bg-support-container text-on-support-container group-focus:bg-support-container-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-support-container-hovered',\n ]),\n },\n {\n intent: 'accent',\n design: 'tinted',\n class: tw([\n 'bg-accent-container text-on-accent-container group-focus:bg-accent-container-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-accent-container-hovered',\n ]),\n },\n {\n intent: 'basic',\n design: 'tinted',\n class: tw([\n 'bg-basic-container text-on-basic-container group-focus:bg-basic-container-hovered',\n ]),\n },\n {\n intent: 'success',\n design: 'tinted',\n class: tw([\n 'bg-success-container text-on-success-container group-focus:bg-success-container-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-success-container-hovered',\n ]),\n },\n {\n intent: 'alert',\n design: 'tinted',\n class: tw([\n 'bg-alert-container text-on-alert-container group-focus:bg-alert-container-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-alert-container-hovered',\n ]),\n },\n {\n intent: 'danger',\n design: 'tinted',\n class: tw([\n 'bg-error-container text-on-error-container group-focus:bg-error-container-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-error-container-hovered',\n ]),\n },\n {\n intent: 'info',\n design: 'tinted',\n class: tw([\n 'bg-info-container text-on-info-container group-focus:bg-info-container-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-info-container-hovered',\n ]),\n },\n {\n intent: 'neutral',\n design: 'tinted',\n class: tw([\n 'bg-neutral-container text-on-neutral-container group-focus:bg-neutral-container-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-neutral-container-hovered',\n ]),\n },\n {\n intent: 'surface',\n design: 'tinted',\n class: tw([\n 'bg-surface text-on-surface group-focus:bg-surface-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-surface-hovered',\n ]),\n },\n ],\n defaultVariants: {\n design: 'filled',\n intent: 'surface',\n inset: false,\n hasBackdrop: true,\n },\n }\n)\n\nexport type ContentStylesProps = VariantProps<typeof contentStyles>\n","import { ComponentProps } from 'react'\n\nimport { Slot } from '../slot'\nimport { contentStyles } from './Content.styles'\nimport { useCardContext } from './context'\n\nexport interface ContentProps extends ComponentProps<'div'> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n /**\n * Whether the card should have an inset padding.\n */\n inset?: boolean\n}\n\nexport const Content = ({ children, inset, asChild, className, ref, ...props }: ContentProps) => {\n const Component = asChild ? Slot : 'div'\n const { design, intent, hasBackdrop } = useCardContext()\n\n return (\n <Component\n data-spark-component=\"card-content\"\n ref={ref}\n className={contentStyles({\n className,\n design,\n intent,\n inset,\n hasBackdrop,\n })}\n {...props}\n >\n {children}\n </Component>\n )\n}\n\nContent.displayName = 'Content'\n","import { Backdrop } from './Backdrop'\nimport { Card as Root } from './Card'\nimport { Content } from './Content'\n\nexport const Card: typeof Root & {\n Content: typeof Content\n Backdrop: typeof Backdrop\n} = Object.assign(Root, {\n Content,\n Backdrop,\n})\n\nCard.displayName = 'Card'\nContent.displayName = 'Card.Content'\nBackdrop.displayName = 'Card.Backdrop'\n\nexport { type CardProps } from './Card'\n"],"mappings":";;;;;AAAA,SAAS,oBAAoB;AAC7B,SAAS,WAAyB;AA4DzB;AA1DF,IAAM,iBAAiB;AAAA,EAC5B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AC;AAAA,MACH;AAAA,MACA;AAAA,QACE,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR,OAAOA,IAAG;AAAA,UACR;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA,MACA;AAAA,QACE,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR,OAAOA,IAAG;AAAA,UACR;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA,MACA;AAAA,QACE,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR,OAAOA,IAAG;AAAA,UACR;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,aAAa;AAAA,IACf;AAAA,EACF;AACF;;;AC5MI,gBAAAE,YAAA;AALG,IAAM,UAAU,CAAC,EAAE,UAAU,OAAO,SAAS,WAAW,KAAK,GAAG,MAAM,MAAoB;AAC/F,QAAM,YAAY,UAAU,OAAO;AACnC,QAAM,EAAE,QAAQ,QAAQ,aAAAC,aAAY,IAAI,eAAe;AAEvD,SACE,gBAAAD;AAAA,IAAC;AAAA;AAAA,MACC,wBAAqB;AAAA,MACrB;AAAA,MACA,WAAW,cAAc;AAAA,QACvB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,aAAAC;AAAA,MACF,CAAC;AAAA,MACA,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;AAEA,QAAQ,cAAc;;;ACnCf,IAAMC,QAGT,OAAO,OAAO,MAAM;AAAA,EACtB;AAAA,EACA;AACF,CAAC;AAEDA,MAAK,cAAc;AACnB,QAAQ,cAAc;AACtB,SAAS,cAAc;","names":["makeVariants","cva","jsx","makeVariants","tw","cva","jsx","hasBackdrop","Card"]}
|
|
1
|
+
{"version":3,"sources":["../../src/card/Backdrop.tsx","../../src/card/Card.styles.tsx","../../src/card/context.tsx","../../src/card/utils.ts","../../src/card/Card.tsx","../../src/card/Content.styles.tsx","../../src/card/Content.tsx","../../src/card/index.ts"],"sourcesContent":["import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const backdropStyles = cva(\n [\n 'default:bg-surface default:bg-gradient-to-r absolute inset-x-0 top-0',\n 'h-sz-16',\n 'default:rounded-t-lg',\n 'bg-[length:200%_100%] bg-position-[0%_0%]',\n ],\n {\n variants: {\n animation: {\n none: '',\n pulse: 'animate-standalone-backdrop-pulse',\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 'surfaceInverse',\n ]\n >({\n main: ['default:from-main/dim-4 default:via-main/dim-2 default:to-main/dim-4'],\n support: ['default:from-support/dim-4 default:via-support/dim-2 default:to-support/dim-4'],\n accent: ['default:from-accent/dim-4 default:via-accent/dim-2 default:to-accent/dim-4'],\n basic: ['default:from-basic/dim-4 default:via-basic/dim-2 default:to-basic/dim-4'],\n success: ['default:from-success/dim-4 default:via-success/dim-2 default:to-success/dim-4'],\n alert: ['default:from-alert/dim-4 default:via-alert/dim-2 default:to-alert/dim-4'],\n danger: ['default:from-error/dim-4 default:via-error/dim-2 default:to-error/dim-4'],\n info: ['default:from-info/dim-4 default:via-info/dim-2 default:to-info/dim-4'],\n neutral: ['default:from-neutral/dim-4 default:via-neutral/dim-2 default:to-neutral/dim-4'],\n surface: ['default:from-outline/dim-4 default:via-outline/dim-2 default:to-outline/dim-4'],\n surfaceInverse: [\n 'default:from-surface/dim-4 default:via-surface/dim-2 default:to-surface/dim-4',\n ],\n }),\n },\n defaultVariants: {\n intent: 'main',\n animation: 'none',\n },\n }\n)\n\nexport type BackdropStylesProps = VariantProps<typeof backdropStyles>\n\ninterface BackdropProps extends BackdropStylesProps {\n className?: string\n}\n\nexport const Backdrop = ({ intent = 'main', animation = 'none', ...props }: BackdropProps) => {\n return <div className={backdropStyles({ intent, animation })} {...props} />\n}\n\nBackdrop.displayName = 'Card.Backdrop'\n","import { makeVariants, tw } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const cardStyles = cva(\n [\n 'group relative bg-clip-padding default:rounded-lg focus-visible:u-outline',\n 'disabled:opacity-dim-3 disabled:cursor-not-allowed',\n ],\n {\n variants: {\n design: {\n filled: [],\n outlined: ['border-sm'],\n tinted: [],\n },\n hasBackdrop: {\n true: ['pt-md'],\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 'surfaceInverse',\n ]\n >({\n main: [],\n support: [],\n accent: [],\n basic: [],\n success: [],\n alert: [],\n danger: [],\n info: [],\n neutral: [],\n surface: [],\n surfaceInverse: [],\n }),\n },\n compoundVariants: [\n // OUTLINED\n { intent: 'main', design: 'outlined', class: tw(['border-main']) },\n { intent: 'support', design: 'outlined', class: tw(['border-support']) },\n { intent: 'accent', design: 'outlined', class: tw(['border-accent']) },\n { intent: 'basic', design: 'outlined', class: tw(['border-basic']) },\n { intent: 'success', design: 'outlined', class: tw(['border-success']) },\n { intent: 'alert', design: 'outlined', class: tw(['border-alert']) },\n { intent: 'danger', design: 'outlined', class: tw(['border-error']) },\n { intent: 'info', design: 'outlined', class: tw(['border-info']) },\n { intent: 'neutral', design: 'outlined', class: tw(['border-neutral']) },\n { intent: 'surface', design: 'outlined', class: tw(['border-outline']) },\n ],\n defaultVariants: {\n design: 'filled',\n intent: 'surface',\n },\n }\n)\n\nexport type CardStylesProps = VariantProps<typeof cardStyles>\n","import { createContext, useContext } from 'react'\n\nimport type { CardStylesProps } from './Card.styles'\n\nexport interface CardContextValue {\n design: CardStylesProps['design']\n intent: CardStylesProps['intent']\n hasBackdrop: boolean\n inset: boolean\n isInteractive: boolean\n}\n\nconst CardContext = createContext<CardContextValue | undefined>(undefined)\n\nexport const useCardContext = () => {\n const context = useContext(CardContext)\n if (!context) {\n throw new Error('useCardContext must be used within a Card component')\n }\n\n return context\n}\n\nexport { CardContext }\n","import { Children, isValidElement, ReactNode } from 'react'\n\nconst MOUSE_EVENTS = [\n 'onClick',\n 'onMouseDown',\n 'onMouseUp',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseMove',\n 'onMouseOver',\n 'onMouseOut',\n 'onDoubleClick',\n 'onContextMenu',\n] as const\n\nexport const hasBackdrop = (children: ReactNode): boolean => {\n let backdropFound = false\n\n const searchForBackdrop = (node: ReactNode): void => {\n if (backdropFound) return\n\n Children.forEach(node, child => {\n if (backdropFound) return\n\n if (isValidElement(child)) {\n const isBackdropComponent =\n typeof child.type === 'function' &&\n (child.type as { displayName?: string }).displayName === 'Card.Backdrop'\n\n if (isBackdropComponent) {\n backdropFound = true\n\n return\n }\n\n const hasChildren =\n child.props && typeof child.props === 'object' && 'children' in child.props\n\n if (hasChildren) {\n const childChildren = (child.props as { children: ReactNode }).children\n if (childChildren !== undefined && childChildren !== null) {\n searchForBackdrop(childChildren)\n }\n }\n }\n })\n }\n\n searchForBackdrop(children)\n\n return backdropFound\n}\n\nexport const isInteractive = (\n children: ReactNode,\n asChild: boolean | undefined,\n props: Record<string, any>\n): boolean => {\n const hasMouseEventHandlers = MOUSE_EVENTS.some(event => event in props)\n\n if (hasMouseEventHandlers) {\n return true\n }\n\n if (!asChild) {\n return false\n }\n\n const child = Children.only(children)\n\n if (!isValidElement(child)) {\n return false\n }\n\n const interactiveElements = ['a', 'button']\n const isInteractiveElement =\n typeof child.type === 'string' && interactiveElements.includes(child.type)\n\n if (isInteractiveElement) {\n return true\n }\n\n const childProps = child.props as Record<string, any>\n const hasChildEventHandlers = MOUSE_EVENTS.some(event => event in childProps)\n\n return hasChildEventHandlers\n}\n","import { ComponentProps } from 'react'\n\nimport { Slot } from '../slot'\nimport { cardStyles, type CardStylesProps } from './Card.styles'\nimport { CardContext } from './context'\nimport { hasBackdrop, isInteractive } from './utils'\n\nexport interface CardProps extends ComponentProps<'div'>, CardStylesProps {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n /**\n * Whether the card should have an inset padding.\n */\n inset?: boolean\n}\n\nexport const Card = ({\n children,\n design = 'filled',\n intent = 'surface',\n inset = false,\n asChild,\n className,\n ref,\n ...props\n}: CardProps) => {\n const Component = asChild ? Slot : 'div'\n const backdropDetected = hasBackdrop(children)\n const interactiveDetected = isInteractive(children, asChild, props)\n\n return (\n <CardContext.Provider\n value={{\n design,\n intent,\n hasBackdrop: backdropDetected,\n inset,\n isInteractive: interactiveDetected,\n }}\n >\n <Component\n data-spark-component=\"card\"\n data-interactive={interactiveDetected}\n ref={ref}\n className={cardStyles({\n className,\n design,\n intent,\n hasBackdrop: backdropDetected,\n })}\n {...props}\n >\n {children}\n </Component>\n </CardContext.Provider>\n )\n}\n\nCard.displayName = 'Card'\n","import { makeVariants, tw } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const contentStyles = cva(\n [\n 'relative h-full default:rounded-lg w-full focus-visible:u-outline',\n 'default:transition-colors default:duration-200 ease-linear',\n ],\n {\n variants: {\n inset: {\n false: ['default:p-lg'],\n },\n design: {\n filled: [],\n outlined: [\n 'default:bg-surface group-focus:bg-surface-hovered group-not-disabled:group-data-[interactive=true]:group-hover:bg-surface-hovered',\n ],\n tinted: [],\n },\n hasBackdrop: {\n true: ['rounded-t-[16px_8px] '],\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 'surfaceInverse',\n ]\n >({\n main: [],\n support: [],\n accent: [],\n basic: [],\n success: [],\n alert: [],\n danger: [],\n info: [],\n neutral: [],\n surface: [],\n surfaceInverse: [],\n }),\n },\n compoundVariants: [\n // FILLED\n {\n intent: 'main',\n design: 'filled',\n class: tw([\n 'bg-main text-on-main group-focus:bg-main-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-main-hovered',\n ]),\n },\n {\n intent: 'support',\n design: 'filled',\n class: tw([\n 'bg-support text-on-support group-focus:bg-support-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-support-hovered',\n ]),\n },\n {\n intent: 'accent',\n design: 'filled',\n class: tw([\n 'bg-accent text-on-accent group-focus:bg-accent-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-accent-hovered',\n ]),\n },\n {\n intent: 'basic',\n design: 'filled',\n class: tw([\n 'bg-basic text-on-basic group-focus:bg-basic-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-basic-hovered',\n ]),\n },\n {\n intent: 'success',\n design: 'filled',\n class: tw([\n 'bg-success text-on-success group-focus:bg-success-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-success-hovered',\n ]),\n },\n {\n intent: 'alert',\n design: 'filled',\n class: tw([\n 'bg-alert text-on-alert group-focus:bg-alert-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-alert-hovered',\n ]),\n },\n {\n intent: 'danger',\n design: 'filled',\n class: tw([\n 'text-on-error bg-error group-focus:bg-error-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-error-hovered',\n ]),\n },\n {\n intent: 'info',\n design: 'filled',\n class: tw([\n 'text-on-error bg-info group-focus:bg-info-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-info-hovered',\n ]),\n },\n {\n intent: 'neutral',\n design: 'filled',\n class: tw([\n 'bg-neutral text-on-neutral group-focus:bg-neutral-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-neutral-hovered',\n ]),\n },\n {\n intent: 'surface',\n design: 'filled',\n class: tw([\n 'bg-surface text-on-surface group-focus:bg-surface-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-surface-hovered',\n ]),\n },\n // OUTLINED\n /**\n * Outlined styles are handled by the Card component (parent)\n */\n // TINTED\n {\n intent: 'main',\n design: 'tinted',\n class: tw([\n 'bg-main-container text-on-main-container group-focus:bg-main-container-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-main-container-hovered',\n ]),\n },\n {\n intent: 'support',\n design: 'tinted',\n class: tw([\n 'bg-support-container text-on-support-container group-focus:bg-support-container-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-support-container-hovered',\n ]),\n },\n {\n intent: 'accent',\n design: 'tinted',\n class: tw([\n 'bg-accent-container text-on-accent-container group-focus:bg-accent-container-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-accent-container-hovered',\n ]),\n },\n {\n intent: 'basic',\n design: 'tinted',\n class: tw([\n 'bg-basic-container text-on-basic-container group-focus:bg-basic-container-hovered',\n ]),\n },\n {\n intent: 'success',\n design: 'tinted',\n class: tw([\n 'bg-success-container text-on-success-container group-focus:bg-success-container-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-success-container-hovered',\n ]),\n },\n {\n intent: 'alert',\n design: 'tinted',\n class: tw([\n 'bg-alert-container text-on-alert-container group-focus:bg-alert-container-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-alert-container-hovered',\n ]),\n },\n {\n intent: 'danger',\n design: 'tinted',\n class: tw([\n 'bg-error-container text-on-error-container group-focus:bg-error-container-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-error-container-hovered',\n ]),\n },\n {\n intent: 'info',\n design: 'tinted',\n class: tw([\n 'bg-info-container text-on-info-container group-focus:bg-info-container-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-info-container-hovered',\n ]),\n },\n {\n intent: 'neutral',\n design: 'tinted',\n class: tw([\n 'bg-neutral-container text-on-neutral-container group-focus:bg-neutral-container-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-neutral-container-hovered',\n ]),\n },\n {\n intent: 'surface',\n design: 'tinted',\n class: tw([\n 'bg-surface text-on-surface group-focus:bg-surface-hovered',\n 'group-not-disabled:group-data-[interactive=true]:group-hover:bg-surface-hovered',\n ]),\n },\n ],\n defaultVariants: {\n design: 'filled',\n intent: 'surface',\n inset: false,\n hasBackdrop: true,\n },\n }\n)\n\nexport type ContentStylesProps = VariantProps<typeof contentStyles>\n","import { ComponentProps } from 'react'\n\nimport { Slot } from '../slot'\nimport { contentStyles } from './Content.styles'\nimport { useCardContext } from './context'\n\nexport interface ContentProps extends ComponentProps<'div'> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n /**\n * Whether the card should have an inset padding.\n */\n inset?: boolean\n}\n\nexport const Content = ({ children, inset, asChild, className, ref, ...props }: ContentProps) => {\n const Component = asChild ? Slot : 'div'\n const { design, intent, hasBackdrop } = useCardContext()\n\n return (\n <Component\n data-spark-component=\"card-content\"\n ref={ref}\n className={contentStyles({\n className,\n design,\n intent,\n inset,\n hasBackdrop,\n })}\n {...props}\n >\n {children}\n </Component>\n )\n}\n\nContent.displayName = 'Content'\n","import { Backdrop } from './Backdrop'\nimport { Card as Root } from './Card'\nimport { Content } from './Content'\n\nexport const Card: typeof Root & {\n Content: typeof Content\n Backdrop: typeof Backdrop\n} = Object.assign(Root, {\n Content,\n Backdrop,\n})\n\nCard.displayName = 'Card'\nContent.displayName = 'Card.Content'\nBackdrop.displayName = 'Card.Backdrop'\n\nexport { type CardProps } from './Card'\n"],"mappings":";;;;;AAAA,SAAS,oBAAoB;AAC7B,SAAS,WAAyB;AA4DzB;AA1DF,IAAM,iBAAiB;AAAA,EAC5B;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,WAAW;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MACT;AAAA,MACA,QAAQ,aAeN;AAAA,QACA,MAAM,CAAC,sEAAsE;AAAA,QAC7E,SAAS,CAAC,+EAA+E;AAAA,QACzF,QA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A,MACH;AAAA,MACA;AAAA,QACE,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR,OAAOA,IAAG;AAAA,UACR;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,aAAa;AAAA,IACf;AAAA,EACF;AACF;;;AC5MI,gBAAAE,YAAA;AALG,IAAM,UAAU,CAAC,EAAE,UAAU,OAAO,SAAS,WAAW,KAAK,GAAG,MAAM,MAAoB;AAC/F,QAAM,YAAY,UAAU,OAAO;AACnC,QAAM,EAAE,QAAQ,QAAQ,aAAAC,aAAY,IAAI,eAAe;AAEvD,SACE,gBAAAD;AAAA,IAAC;AAAA;AAAA,MACC,wBAAqB;AAAA,MACrB;AAAA,MACA,WAAW,cAAc;AAAA,QACvB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,aAAAC;AAAA,MACF,CAAC;AAAA,MACA,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;AAEA,QAAQ,cAAc;;;ACnCf,IAAMC,QAGT,OAAO,OAAO,MAAM;AAAA,EACtB;AAAA,EACA;AACF,CAAC;AAEDA,MAAK,cAAc;AACnB,QAAQ,cAAc;AACtB,SAAS,cAAc;","names":["makeVariants","cva","jsx","makeVariants","tw","cva","jsx","hasBackdrop","Card"]}
|
package/dist/docgen.json
CHANGED
|
@@ -2890,13 +2890,13 @@
|
|
|
2890
2890
|
"required": false,
|
|
2891
2891
|
"type": {
|
|
2892
2892
|
"name": "enum",
|
|
2893
|
-
"raw": "\"none\" | \"
|
|
2893
|
+
"raw": "\"none\" | \"pulse\"",
|
|
2894
2894
|
"value": [
|
|
2895
2895
|
{
|
|
2896
2896
|
"value": "\"none\""
|
|
2897
2897
|
},
|
|
2898
2898
|
{
|
|
2899
|
-
"value": "\"
|
|
2899
|
+
"value": "\"pulse\""
|
|
2900
2900
|
}
|
|
2901
2901
|
]
|
|
2902
2902
|
}
|
|
@@ -3080,13 +3080,13 @@
|
|
|
3080
3080
|
"required": false,
|
|
3081
3081
|
"type": {
|
|
3082
3082
|
"name": "enum",
|
|
3083
|
-
"raw": "\"none\" | \"
|
|
3083
|
+
"raw": "\"none\" | \"pulse\"",
|
|
3084
3084
|
"value": [
|
|
3085
3085
|
{
|
|
3086
3086
|
"value": "\"none\""
|
|
3087
3087
|
},
|
|
3088
3088
|
{
|
|
3089
|
-
"value": "\"
|
|
3089
|
+
"value": "\"pulse\""
|
|
3090
3090
|
}
|
|
3091
3091
|
]
|
|
3092
3092
|
}
|
|
@@ -6059,10 +6059,10 @@
|
|
|
6059
6059
|
"name": "string"
|
|
6060
6060
|
}
|
|
6061
6061
|
},
|
|
6062
|
-
"__@hasInstance@
|
|
6062
|
+
"__@hasInstance@3205": {
|
|
6063
6063
|
"defaultValue": null,
|
|
6064
6064
|
"description": "Determines whether the given value inherits from this function if this function was used\nas a constructor function.\n\nA constructor function can control which objects are recognized as its instances by\n'instanceof' by overriding this method.",
|
|
6065
|
-
"name": "__@hasInstance@
|
|
6065
|
+
"name": "__@hasInstance@3205",
|
|
6066
6066
|
"parent": {
|
|
6067
6067
|
"fileName": "spark-web/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts",
|
|
6068
6068
|
"name": "Function"
|
|
@@ -6078,10 +6078,10 @@
|
|
|
6078
6078
|
"name": "(value: any) => boolean"
|
|
6079
6079
|
}
|
|
6080
6080
|
},
|
|
6081
|
-
"__@metadata@
|
|
6081
|
+
"__@metadata@3207": {
|
|
6082
6082
|
"defaultValue": null,
|
|
6083
6083
|
"description": "",
|
|
6084
|
-
"name": "__@metadata@
|
|
6084
|
+
"name": "__@metadata@3207",
|
|
6085
6085
|
"parent": {
|
|
6086
6086
|
"fileName": "spark-web/node_modules/typescript/lib/lib.esnext.decorators.d.ts",
|
|
6087
6087
|
"name": "Function"
|
|
@@ -43804,7 +43804,7 @@
|
|
|
43804
43804
|
"defaultValue": {
|
|
43805
43805
|
"value": true
|
|
43806
43806
|
},
|
|
43807
|
-
"description": "
|
|
43807
|
+
"description": "",
|
|
43808
43808
|
"name": "isResizable",
|
|
43809
43809
|
"parent": {
|
|
43810
43810
|
"fileName": "src/textarea/Textarea.tsx",
|
|
@@ -43820,6 +43820,44 @@
|
|
|
43820
43820
|
"type": {
|
|
43821
43821
|
"name": "boolean"
|
|
43822
43822
|
}
|
|
43823
|
+
},
|
|
43824
|
+
"ref": {
|
|
43825
|
+
"defaultValue": null,
|
|
43826
|
+
"description": "",
|
|
43827
|
+
"name": "ref",
|
|
43828
|
+
"parent": {
|
|
43829
|
+
"fileName": "src/textarea/Textarea.tsx",
|
|
43830
|
+
"name": "TextareaProps"
|
|
43831
|
+
},
|
|
43832
|
+
"declarations": [
|
|
43833
|
+
{
|
|
43834
|
+
"fileName": "src/textarea/Textarea.tsx",
|
|
43835
|
+
"name": "TextareaProps"
|
|
43836
|
+
}
|
|
43837
|
+
],
|
|
43838
|
+
"required": false,
|
|
43839
|
+
"type": {
|
|
43840
|
+
"name": "Ref<HTMLTextAreaElement>"
|
|
43841
|
+
}
|
|
43842
|
+
},
|
|
43843
|
+
"onValueChange": {
|
|
43844
|
+
"defaultValue": null,
|
|
43845
|
+
"description": "",
|
|
43846
|
+
"name": "onValueChange",
|
|
43847
|
+
"parent": {
|
|
43848
|
+
"fileName": "src/input/Input.tsx",
|
|
43849
|
+
"name": "InputProps"
|
|
43850
|
+
},
|
|
43851
|
+
"declarations": [
|
|
43852
|
+
{
|
|
43853
|
+
"fileName": "src/input/Input.tsx",
|
|
43854
|
+
"name": "InputProps"
|
|
43855
|
+
}
|
|
43856
|
+
],
|
|
43857
|
+
"required": false,
|
|
43858
|
+
"type": {
|
|
43859
|
+
"name": "(value: string) => void"
|
|
43860
|
+
}
|
|
43823
43861
|
}
|
|
43824
43862
|
}
|
|
43825
43863
|
},
|
package/dist/drawer/index.js
CHANGED
|
@@ -1164,8 +1164,8 @@ var import_radix_ui4 = require("radix-ui");
|
|
|
1164
1164
|
var import_class_variance_authority8 = require("class-variance-authority");
|
|
1165
1165
|
var drawerContentStyles = (0, import_class_variance_authority8.cva)(
|
|
1166
1166
|
[
|
|
1167
|
-
|
|
1168
|
-
|
|
1167
|
+
"fixed z-modal flex flex-col bg-surface shadow-md",
|
|
1168
|
+
"data-[state=open]:animation-duration-400 data-[state=closed]:animation-duration-200"
|
|
1169
1169
|
],
|
|
1170
1170
|
{
|
|
1171
1171
|
variants: {
|
|
@@ -1179,7 +1179,7 @@ var drawerContentStyles = (0, import_class_variance_authority8.cva)(
|
|
|
1179
1179
|
side: {
|
|
1180
1180
|
right: [
|
|
1181
1181
|
"inset-y-0 right-0",
|
|
1182
|
-
"data-[state=open]:animate-slide-in-right",
|
|
1182
|
+
"data-[state=open]:animate-slide-in-right ",
|
|
1183
1183
|
"data-[state=closed]:animate-slide-out-right"
|
|
1184
1184
|
],
|
|
1185
1185
|
left: [
|