@spark-ui/components 11.1.0 → 11.1.2
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/DialogTrigger-woU7vsJi.d.ts +142 -0
- package/dist/Input-N8AWWSmt.d.ts +41 -0
- package/dist/InputTrailingIcon-ZZx8PoJy.d.ts +20 -0
- package/dist/LabelRequiredIndicator-DRnCzHMU.d.ts +19 -0
- package/dist/accordion/index.d.ts +73 -0
- package/dist/accordion/index.js +325 -0
- package/dist/accordion/index.js.map +1 -0
- package/dist/alert-dialog/index.d.ts +119 -0
- package/dist/alert-dialog/index.js +1554 -0
- package/dist/alert-dialog/index.js.map +1 -0
- package/dist/avatar/index.d.ts +66 -0
- package/dist/avatar/index.js +1303 -0
- package/dist/avatar/index.js.map +1 -0
- package/dist/badge/index.d.ts +47 -0
- package/dist/badge/index.js +122 -0
- package/dist/badge/index.js.map +1 -0
- package/dist/breadcrumb/index.d.ts +64 -0
- package/dist/breadcrumb/index.js +327 -0
- package/dist/breadcrumb/index.js.map +1 -0
- package/dist/button/index.d.ts +41 -0
- package/dist/button/index.js +935 -0
- package/dist/button/index.js.map +1 -0
- package/dist/card/index.d.ts +61 -0
- package/dist/card/index.js +502 -0
- package/dist/card/index.js.map +1 -0
- package/dist/carousel/index.d.ts +261 -0
- package/dist/carousel/index.js +1801 -0
- package/dist/carousel/index.js.map +1 -0
- package/dist/checkbox/index.d.ts +120 -0
- package/dist/checkbox/index.js +511 -0
- package/dist/checkbox/index.js.map +1 -0
- package/dist/chip/index.d.ts +97 -0
- package/dist/chip/index.js +908 -0
- package/dist/chip/index.js.map +1 -0
- package/dist/collapsible/index.d.ts +43 -0
- package/dist/collapsible/index.js +109 -0
- package/dist/collapsible/index.js.map +1 -0
- package/dist/combobox/index.d.ts +287 -0
- package/dist/combobox/index.js +2588 -0
- package/dist/combobox/index.js.map +1 -0
- package/dist/dialog/index.d.ts +33 -0
- package/dist/dialog/index.js +1389 -0
- package/dist/dialog/index.js.map +1 -0
- package/dist/divider/index.d.ts +61 -0
- package/dist/divider/index.js +224 -0
- package/dist/divider/index.js.map +1 -0
- package/dist/drawer/index.d.ts +152 -0
- package/dist/drawer/index.js +1400 -0
- package/dist/drawer/index.js.map +1 -0
- package/dist/dropdown/index.d.ts +233 -0
- package/dist/dropdown/index.js +2051 -0
- package/dist/dropdown/index.js.map +1 -0
- package/dist/form-field/index.d.ts +186 -0
- package/dist/form-field/index.js +553 -0
- package/dist/form-field/index.js.map +1 -0
- package/dist/icon/index.d.ts +28 -0
- package/dist/icon/index.js +127 -0
- package/dist/icon/index.js.map +1 -0
- package/dist/icon-button/index.d.ts +16 -0
- package/dist/icon-button/index.js +980 -0
- package/dist/icon-button/index.js.map +1 -0
- package/dist/input/index.d.ts +78 -0
- package/dist/input/index.js +724 -0
- package/dist/input/index.js.map +1 -0
- package/dist/kbd/index.d.ts +9 -0
- package/dist/kbd/index.js +47 -0
- package/dist/kbd/index.js.map +1 -0
- package/dist/label/index.d.ts +11 -0
- package/dist/label/index.js +78 -0
- package/dist/label/index.js.map +1 -0
- package/dist/link-box/index.d.ts +34 -0
- package/dist/link-box/index.js +92 -0
- package/dist/link-box/index.js.map +1 -0
- package/dist/pagination/index.d.ts +143 -0
- package/dist/pagination/index.js +1353 -0
- package/dist/pagination/index.js.map +1 -0
- package/dist/popover/index.d.ts +93 -0
- package/dist/popover/index.js +1339 -0
- package/dist/popover/index.js.map +1 -0
- package/dist/portal/index.d.ts +13 -0
- package/dist/portal/index.js +37 -0
- package/dist/portal/index.js.map +1 -0
- package/dist/progress/index.d.ts +48 -0
- package/dist/progress/index.js +223 -0
- package/dist/progress/index.js.map +1 -0
- package/dist/progress-tracker/index.d.ts +80 -0
- package/dist/progress-tracker/index.js +571 -0
- package/dist/progress-tracker/index.js.map +1 -0
- package/dist/radio-group/index.d.ts +100 -0
- package/dist/radio-group/index.js +318 -0
- package/dist/radio-group/index.js.map +1 -0
- package/dist/rating/index.d.ts +78 -0
- package/dist/rating/index.js +363 -0
- package/dist/rating/index.js.map +1 -0
- package/dist/scrolling-list/index.d.ts +118 -0
- package/dist/scrolling-list/index.js +1426 -0
- package/dist/scrolling-list/index.js.map +1 -0
- package/dist/segmented-gauge/index.d.ts +100 -0
- package/dist/segmented-gauge/index.js +277 -0
- package/dist/segmented-gauge/index.js.map +1 -0
- package/dist/select/index.d.ts +167 -0
- package/dist/select/index.js +581 -0
- package/dist/select/index.js.map +1 -0
- package/dist/skeleton/index.d.ts +67 -0
- package/dist/skeleton/index.js +206 -0
- package/dist/skeleton/index.js.map +1 -0
- package/dist/slider/index.d.ts +97 -0
- package/dist/slider/index.js +220 -0
- package/dist/slider/index.js.map +1 -0
- package/dist/slot/index.d.ts +16 -0
- package/dist/slot/index.js +51 -0
- package/dist/slot/index.js.map +1 -0
- package/dist/snackbar/index.d.ts +158 -0
- package/dist/snackbar/index.js +1756 -0
- package/dist/snackbar/index.js.map +1 -0
- package/dist/spinner/index.d.mts +1 -1
- package/dist/spinner/index.d.ts +21 -0
- package/dist/spinner/index.js +139 -0
- package/dist/spinner/index.js.map +1 -0
- package/dist/stepper/index.d.ts +81 -0
- package/dist/stepper/index.js +1847 -0
- package/dist/stepper/index.js.map +1 -0
- package/dist/switch/index.d.ts +64 -0
- package/dist/switch/index.js +327 -0
- package/dist/switch/index.js.map +1 -0
- package/dist/tabs/index.d.ts +103 -0
- package/dist/tabs/index.js +1376 -0
- package/dist/tabs/index.js.map +1 -0
- package/dist/tag/index.d.ts +29 -0
- package/dist/tag/index.js +283 -0
- package/dist/tag/index.js.map +1 -0
- package/dist/text-link/index.d.ts +20 -0
- package/dist/text-link/index.js +100 -0
- package/dist/text-link/index.js.map +1 -0
- package/dist/textarea/index.d.ts +57 -0
- package/dist/textarea/index.js +797 -0
- package/dist/textarea/index.js.map +1 -0
- package/dist/toast/index.d.ts +56 -0
- package/dist/toast/index.js +1412 -0
- package/dist/toast/index.js.map +1 -0
- package/dist/toast/index.mjs +1 -1
- package/dist/toast/index.mjs.map +1 -1
- package/dist/visually-hidden/index.d.ts +16 -0
- package/dist/visually-hidden/index.js +67 -0
- package/dist/visually-hidden/index.js.map +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { Dialog as Dialog$1 } from 'radix-ui';
|
|
2
|
+
import { ReactElement, ReactNode, Ref } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
5
|
+
import { VariantProps } from 'class-variance-authority';
|
|
6
|
+
|
|
7
|
+
interface DialogProps {
|
|
8
|
+
/**
|
|
9
|
+
* Children of the component.
|
|
10
|
+
*/
|
|
11
|
+
children?: Dialog$1.DialogProps['children'];
|
|
12
|
+
/**
|
|
13
|
+
* Specifies if the dialog is open or not.
|
|
14
|
+
*/
|
|
15
|
+
open?: Dialog$1.DialogProps['open'];
|
|
16
|
+
/**
|
|
17
|
+
* Default open state.
|
|
18
|
+
*/
|
|
19
|
+
defaultOpen?: Dialog$1.DialogProps['defaultOpen'];
|
|
20
|
+
/**
|
|
21
|
+
* Handler executen on every dialog open state change.
|
|
22
|
+
*/
|
|
23
|
+
onOpenChange?: Dialog$1.DialogProps['onOpenChange'];
|
|
24
|
+
/**
|
|
25
|
+
* Specifies if the dialog is a modal.
|
|
26
|
+
*/
|
|
27
|
+
modal?: Dialog$1.DialogProps['modal'];
|
|
28
|
+
/**
|
|
29
|
+
* Specifies if the dialog should have a fade animation on its body (in case it is scrollable).
|
|
30
|
+
*/
|
|
31
|
+
withFade?: boolean;
|
|
32
|
+
}
|
|
33
|
+
declare const Dialog: {
|
|
34
|
+
({ children, withFade, ...rest }: DialogProps): ReactElement;
|
|
35
|
+
displayName: string;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
interface BodyProps {
|
|
39
|
+
children: ReactNode;
|
|
40
|
+
className?: string;
|
|
41
|
+
tabIndex?: number;
|
|
42
|
+
ref?: Ref<HTMLDivElement>;
|
|
43
|
+
inset?: boolean;
|
|
44
|
+
}
|
|
45
|
+
declare const Body: {
|
|
46
|
+
({ children, className, inset, ref: forwardedRef, ...rest }: BodyProps): ReactElement;
|
|
47
|
+
displayName: string;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
type CloseProps = Dialog$1.DialogCloseProps & {
|
|
51
|
+
ref?: Ref<HTMLButtonElement>;
|
|
52
|
+
};
|
|
53
|
+
declare const Close: {
|
|
54
|
+
(props: CloseProps): react_jsx_runtime.JSX.Element;
|
|
55
|
+
displayName: string;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
declare const dialogContentStyles: (props?: ({
|
|
59
|
+
size?: "fullscreen" | "sm" | "md" | "lg" | null | undefined;
|
|
60
|
+
isNarrow?: boolean | null | undefined;
|
|
61
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
62
|
+
type DialogContentStylesProps = VariantProps<typeof dialogContentStyles>;
|
|
63
|
+
|
|
64
|
+
interface ContentProps extends Dialog$1.DialogContentProps, DialogContentStylesProps {
|
|
65
|
+
/**
|
|
66
|
+
* When set to true, the content will adjust its width to fit the content rather than taking up the full available width.
|
|
67
|
+
*/
|
|
68
|
+
isNarrow?: boolean;
|
|
69
|
+
ref?: Ref<HTMLDivElement>;
|
|
70
|
+
}
|
|
71
|
+
declare const Content: {
|
|
72
|
+
({ children, className, isNarrow, size, onInteractOutside, ref, ...rest }: ContentProps): ReactElement;
|
|
73
|
+
displayName: string;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
type DescriptionProps = Dialog$1.DialogDescriptionProps & {
|
|
77
|
+
ref?: Ref<HTMLParagraphElement>;
|
|
78
|
+
};
|
|
79
|
+
declare const Description: {
|
|
80
|
+
(props: DescriptionProps): react_jsx_runtime.JSX.Element;
|
|
81
|
+
displayName: string;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
interface FooterProps {
|
|
85
|
+
children: ReactNode;
|
|
86
|
+
className?: string;
|
|
87
|
+
ref?: Ref<HTMLDivElement>;
|
|
88
|
+
}
|
|
89
|
+
declare const Footer: {
|
|
90
|
+
({ children, className, ref, ...rest }: FooterProps): ReactElement;
|
|
91
|
+
displayName: string;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
interface HeaderProps {
|
|
95
|
+
children: ReactNode;
|
|
96
|
+
className?: string;
|
|
97
|
+
ref?: Ref<HTMLDivElement>;
|
|
98
|
+
}
|
|
99
|
+
declare const Header: {
|
|
100
|
+
({ children, className, ref, ...rest }: HeaderProps): ReactElement;
|
|
101
|
+
displayName: string;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
type OverlayProps = Dialog$1.DialogOverlayProps & {
|
|
105
|
+
ref?: Ref<HTMLDivElement>;
|
|
106
|
+
};
|
|
107
|
+
declare const Overlay: {
|
|
108
|
+
({ className, ref, ...rest }: OverlayProps): ReactElement | null;
|
|
109
|
+
displayName: string;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
type PortalProps = Dialog$1.DialogPortalProps;
|
|
113
|
+
declare const Portal: {
|
|
114
|
+
({ children, ...rest }: PortalProps): ReactElement;
|
|
115
|
+
displayName: string;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
type TitleProps = Dialog$1.DialogTitleProps & {
|
|
119
|
+
ref?: Ref<HTMLHeadingElement>;
|
|
120
|
+
};
|
|
121
|
+
declare const Title: {
|
|
122
|
+
({ className, ref, ...others }: TitleProps): react_jsx_runtime.JSX.Element;
|
|
123
|
+
displayName: string;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
interface TriggerProps {
|
|
127
|
+
/**
|
|
128
|
+
* Children of the component.
|
|
129
|
+
*/
|
|
130
|
+
children?: ReactNode;
|
|
131
|
+
/**
|
|
132
|
+
* Change the component to the HTML tag or custom component of the only child.
|
|
133
|
+
*/
|
|
134
|
+
asChild?: Dialog$1.DialogTriggerProps['asChild'];
|
|
135
|
+
ref?: Ref<HTMLButtonElement>;
|
|
136
|
+
}
|
|
137
|
+
declare const Trigger: {
|
|
138
|
+
(props: TriggerProps): ReactElement;
|
|
139
|
+
displayName: string;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export { Body as B, type CloseProps as C, Dialog as D, Footer as F, Header as H, Overlay as O, Portal as P, Trigger as T, Content as a, Close as b, Title as c, Description as d, type DialogProps as e, type ContentProps as f, type HeaderProps as g, type BodyProps as h, type FooterProps as i, type TriggerProps as j, type OverlayProps as k, type PortalProps as l, type TitleProps as m, type DescriptionProps as n };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { PropsWithChildren, ComponentPropsWithoutRef, Ref } from 'react';
|
|
3
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
|
|
6
|
+
declare const inputGroupStyles: (props?: ({
|
|
7
|
+
disabled?: boolean | null | undefined;
|
|
8
|
+
readOnly?: boolean | null | undefined;
|
|
9
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
|
+
type InputGroupStylesProps = VariantProps<typeof inputGroupStyles>;
|
|
11
|
+
|
|
12
|
+
interface InputGroupProps extends ComponentPropsWithoutRef<'div'>, InputGroupStylesProps {
|
|
13
|
+
/**
|
|
14
|
+
* Use `state` prop to assign a specific state to the group, choosing from: `error`, `alert` and `success`. By doing so, the outline styles will be updated.
|
|
15
|
+
*/
|
|
16
|
+
state?: 'error' | 'alert' | 'success';
|
|
17
|
+
/**
|
|
18
|
+
* Function handler to be executed after the input has been cleared.
|
|
19
|
+
*/
|
|
20
|
+
onClear?: () => void;
|
|
21
|
+
ref?: Ref<HTMLDivElement>;
|
|
22
|
+
}
|
|
23
|
+
declare const InputGroup: {
|
|
24
|
+
({ className, children: childrenProp, state: stateProp, disabled: disabledProp, readOnly: readOnlyProp, onClear, ref: forwardedRef, ...others }: PropsWithChildren<InputGroupProps>): react_jsx_runtime.JSX.Element;
|
|
25
|
+
displayName: string;
|
|
26
|
+
};
|
|
27
|
+
|
|
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 };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { IconProps } from './icon/index.js';
|
|
3
|
+
|
|
4
|
+
type InputIconProps = IconProps;
|
|
5
|
+
|
|
6
|
+
type InputLeadingIconProps = InputIconProps;
|
|
7
|
+
declare const InputLeadingIcon: {
|
|
8
|
+
({ className, ...others }: InputLeadingIconProps): react_jsx_runtime.JSX.Element;
|
|
9
|
+
id: string;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
type InputTrailingIconProps = InputIconProps;
|
|
14
|
+
declare const InputTrailingIcon: {
|
|
15
|
+
({ className, ...others }: InputTrailingIconProps): react_jsx_runtime.JSX.Element;
|
|
16
|
+
id: string;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { type InputLeadingIconProps as I, type InputTrailingIconProps as a, InputLeadingIcon as b, InputTrailingIcon as c };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { Label as Label$1 } from 'radix-ui';
|
|
3
|
+
import { Ref, ComponentPropsWithRef } from 'react';
|
|
4
|
+
|
|
5
|
+
type LabelProps = Label$1.LabelProps & {
|
|
6
|
+
ref?: Ref<HTMLLabelElement>;
|
|
7
|
+
};
|
|
8
|
+
declare const Label: {
|
|
9
|
+
({ className, ref, ...others }: LabelProps): react_jsx_runtime.JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
type LabelRequiredIndicatorProps = ComponentPropsWithRef<'span'>;
|
|
14
|
+
declare const LabelRequiredIndicator: {
|
|
15
|
+
({ className, children, ref, ...others }: LabelRequiredIndicatorProps): react_jsx_runtime.JSX.Element;
|
|
16
|
+
displayName: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { Label as L, LabelRequiredIndicator as a, type LabelProps as b, type LabelRequiredIndicatorProps as c };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { Accordion as Accordion$2 } from '@base-ui-components/react/accordion';
|
|
3
|
+
import { ComponentProps, Ref } from 'react';
|
|
4
|
+
|
|
5
|
+
type ExtentedZagInterface$3 = Omit<ComponentProps<typeof Accordion$2.Root>, 'openMultiple' | 'render'>;
|
|
6
|
+
interface AccordionProps extends ExtentedZagInterface$3 {
|
|
7
|
+
/**
|
|
8
|
+
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
9
|
+
*/
|
|
10
|
+
asChild?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the accordion items are disabled
|
|
13
|
+
*/
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Whether multiple items can be open at the same time.
|
|
17
|
+
*/
|
|
18
|
+
multiple?: boolean;
|
|
19
|
+
design?: 'filled' | 'outlined';
|
|
20
|
+
ref?: Ref<HTMLDivElement>;
|
|
21
|
+
}
|
|
22
|
+
declare const Accordion$1: {
|
|
23
|
+
({ asChild, children, design, hiddenUntilFound, multiple, className, ref, ...props }: AccordionProps): react_jsx_runtime.JSX.Element;
|
|
24
|
+
displayName: string;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
type ExtentedZagInterface$2 = Omit<ComponentProps<typeof Accordion$2.Item>, 'render'>;
|
|
28
|
+
interface AccordionItemProps extends ExtentedZagInterface$2 {
|
|
29
|
+
asChild?: boolean;
|
|
30
|
+
ref?: Ref<HTMLDivElement>;
|
|
31
|
+
}
|
|
32
|
+
declare const Item: {
|
|
33
|
+
({ asChild, className, children, ref, ...props }: AccordionItemProps): react_jsx_runtime.JSX.Element;
|
|
34
|
+
displayName: string;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
type ExtentedZagInterface$1 = Omit<ComponentProps<typeof Accordion$2.Panel>, 'render'>;
|
|
38
|
+
interface AccordionItemContentProps extends ExtentedZagInterface$1 {
|
|
39
|
+
asChild?: boolean;
|
|
40
|
+
ref?: Ref<HTMLDivElement>;
|
|
41
|
+
}
|
|
42
|
+
declare const ItemContent: {
|
|
43
|
+
({ asChild, className, children, ref, ...props }: AccordionItemContentProps): react_jsx_runtime.JSX.Element;
|
|
44
|
+
displayName: string;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
interface AccordionItemHeaderProps extends ComponentProps<'h3'> {
|
|
48
|
+
asChild?: boolean;
|
|
49
|
+
ref?: Ref<HTMLHeadingElement>;
|
|
50
|
+
}
|
|
51
|
+
declare const ItemHeader: {
|
|
52
|
+
({ asChild, children, className, ref, }: AccordionItemHeaderProps): react_jsx_runtime.JSX.Element;
|
|
53
|
+
displayName: string;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
type ExtentedZagInterface = Omit<ComponentProps<typeof Accordion$2.Trigger>, 'render'>;
|
|
57
|
+
interface AccordionItemTriggerProps extends ExtentedZagInterface {
|
|
58
|
+
asChild?: boolean;
|
|
59
|
+
ref?: Ref<HTMLButtonElement>;
|
|
60
|
+
}
|
|
61
|
+
declare const ItemTrigger: {
|
|
62
|
+
({ asChild, children, className, ref, ...props }: AccordionItemTriggerProps): react_jsx_runtime.JSX.Element;
|
|
63
|
+
displayName: string;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
declare const Accordion: typeof Accordion$1 & {
|
|
67
|
+
Item: typeof Item;
|
|
68
|
+
ItemHeader: typeof ItemHeader;
|
|
69
|
+
ItemTrigger: typeof ItemTrigger;
|
|
70
|
+
ItemContent: typeof ItemContent;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export { Accordion, type AccordionItemContentProps, type AccordionItemHeaderProps, type AccordionItemTriggerProps, type AccordionProps };
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/accordion/index.ts
|
|
21
|
+
var accordion_exports = {};
|
|
22
|
+
__export(accordion_exports, {
|
|
23
|
+
Accordion: () => Accordion2
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(accordion_exports);
|
|
26
|
+
|
|
27
|
+
// src/accordion/Accordion.tsx
|
|
28
|
+
var import_accordion = require("@base-ui-components/react/accordion");
|
|
29
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
30
|
+
var import_react2 = require("react");
|
|
31
|
+
|
|
32
|
+
// src/slot/Slot.tsx
|
|
33
|
+
var import_radix_ui = require("radix-ui");
|
|
34
|
+
var import_react = require("react");
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var Slottable = import_radix_ui.Slot.Slottable;
|
|
37
|
+
var Slot = ({ ref, ...props }) => {
|
|
38
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_radix_ui.Slot.Root, { ref, ...props });
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// src/accordion/useRenderSlot.tsx
|
|
42
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
43
|
+
function useRenderSlot(asChild, defaultTag) {
|
|
44
|
+
const Component = asChild ? Slot : defaultTag;
|
|
45
|
+
return asChild ? ({ ...props }) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Component, { ...props }) : void 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// src/accordion/Accordion.tsx
|
|
49
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
50
|
+
var AccordionContext = (0, import_react2.createContext)(null);
|
|
51
|
+
var Accordion = ({
|
|
52
|
+
asChild = false,
|
|
53
|
+
children,
|
|
54
|
+
design = "outlined",
|
|
55
|
+
hiddenUntilFound = true,
|
|
56
|
+
multiple = false,
|
|
57
|
+
className,
|
|
58
|
+
ref,
|
|
59
|
+
...props
|
|
60
|
+
}) => {
|
|
61
|
+
const renderSlot = useRenderSlot(asChild, "div");
|
|
62
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(AccordionContext.Provider, { value: { design }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
63
|
+
import_accordion.Accordion.Root,
|
|
64
|
+
{
|
|
65
|
+
"data-spark-component": "accordion",
|
|
66
|
+
ref,
|
|
67
|
+
openMultiple: multiple,
|
|
68
|
+
hiddenUntilFound,
|
|
69
|
+
className: (0, import_class_variance_authority.cx)("bg-surface h-fit rounded-lg", className),
|
|
70
|
+
render: renderSlot,
|
|
71
|
+
...props,
|
|
72
|
+
children
|
|
73
|
+
}
|
|
74
|
+
) });
|
|
75
|
+
};
|
|
76
|
+
Accordion.displayName = "Accordion";
|
|
77
|
+
var useAccordionContext = () => {
|
|
78
|
+
const context = (0, import_react2.useContext)(AccordionContext);
|
|
79
|
+
if (!context) {
|
|
80
|
+
throw Error("useAccordionContext must be used within a Accordion provider");
|
|
81
|
+
}
|
|
82
|
+
return context;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
// src/accordion/AccordionItem.tsx
|
|
86
|
+
var import_accordion2 = require("@base-ui-components/react/accordion");
|
|
87
|
+
var import_class_variance_authority2 = require("class-variance-authority");
|
|
88
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
89
|
+
var Item = ({
|
|
90
|
+
asChild = false,
|
|
91
|
+
className,
|
|
92
|
+
children,
|
|
93
|
+
ref,
|
|
94
|
+
...props
|
|
95
|
+
}) => {
|
|
96
|
+
const accordion = useAccordionContext();
|
|
97
|
+
const renderSlot = useRenderSlot(asChild, "div");
|
|
98
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
99
|
+
import_accordion2.Accordion.Item,
|
|
100
|
+
{
|
|
101
|
+
ref,
|
|
102
|
+
"data-spark-component": "accordion-item",
|
|
103
|
+
render: renderSlot,
|
|
104
|
+
className: (0, import_class_variance_authority2.cx)(
|
|
105
|
+
"relative first:rounded-t-lg last:rounded-b-lg",
|
|
106
|
+
"not-last:border-b-0",
|
|
107
|
+
{ "border-sm border-outline": accordion.design === "outlined" },
|
|
108
|
+
className
|
|
109
|
+
),
|
|
110
|
+
...props,
|
|
111
|
+
children
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
};
|
|
115
|
+
Item.displayName = "Accordion.Item";
|
|
116
|
+
|
|
117
|
+
// src/accordion/AccordionItemContent.tsx
|
|
118
|
+
var import_accordion3 = require("@base-ui-components/react/accordion");
|
|
119
|
+
var import_class_variance_authority3 = require("class-variance-authority");
|
|
120
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
121
|
+
var ItemContent = ({
|
|
122
|
+
asChild = false,
|
|
123
|
+
className,
|
|
124
|
+
children,
|
|
125
|
+
ref,
|
|
126
|
+
...props
|
|
127
|
+
}) => {
|
|
128
|
+
const renderSlot = useRenderSlot(asChild, "div");
|
|
129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
130
|
+
import_accordion3.Accordion.Panel,
|
|
131
|
+
{
|
|
132
|
+
ref,
|
|
133
|
+
"data-spark-component": "accordion-item-content",
|
|
134
|
+
className: (0, import_class_variance_authority3.cx)(
|
|
135
|
+
"[&>:first-child]:p-lg overflow-hidden",
|
|
136
|
+
"h-[var(--accordion-panel-height)] transition-all duration-200 data-[ending-style]:h-0 data-[starting-style]:h-0",
|
|
137
|
+
"text-body-1 text-on-surface",
|
|
138
|
+
className
|
|
139
|
+
),
|
|
140
|
+
render: renderSlot,
|
|
141
|
+
...props,
|
|
142
|
+
children
|
|
143
|
+
}
|
|
144
|
+
);
|
|
145
|
+
};
|
|
146
|
+
ItemContent.displayName = "Accordion.ItemContent";
|
|
147
|
+
|
|
148
|
+
// src/accordion/AccordionItemHeader.tsx
|
|
149
|
+
var import_class_variance_authority4 = require("class-variance-authority");
|
|
150
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
151
|
+
var ItemHeader = ({
|
|
152
|
+
asChild = false,
|
|
153
|
+
children,
|
|
154
|
+
className,
|
|
155
|
+
ref
|
|
156
|
+
}) => {
|
|
157
|
+
const Component = asChild ? Slot : "h3";
|
|
158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
159
|
+
Component,
|
|
160
|
+
{
|
|
161
|
+
ref,
|
|
162
|
+
"data-spark-component": "accordion-item-header",
|
|
163
|
+
className: (0, import_class_variance_authority4.cx)("rounded-[inherit]", className),
|
|
164
|
+
children
|
|
165
|
+
}
|
|
166
|
+
);
|
|
167
|
+
};
|
|
168
|
+
ItemHeader.displayName = "Accordion.ItemHeader";
|
|
169
|
+
|
|
170
|
+
// src/accordion/AccordionItemTrigger.tsx
|
|
171
|
+
var import_accordion4 = require("@base-ui-components/react/accordion");
|
|
172
|
+
var import_ArrowHorizontalDown = require("@spark-ui/icons/ArrowHorizontalDown");
|
|
173
|
+
var import_class_variance_authority6 = require("class-variance-authority");
|
|
174
|
+
|
|
175
|
+
// src/icon/Icon.tsx
|
|
176
|
+
var import_react3 = require("react");
|
|
177
|
+
|
|
178
|
+
// src/visually-hidden/VisuallyHidden.tsx
|
|
179
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
180
|
+
var VisuallyHidden = ({ asChild = false, ref, ...props }) => {
|
|
181
|
+
const Component = asChild ? Slot : "span";
|
|
182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
183
|
+
Component,
|
|
184
|
+
{
|
|
185
|
+
...props,
|
|
186
|
+
ref,
|
|
187
|
+
style: {
|
|
188
|
+
// See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
|
|
189
|
+
position: "absolute",
|
|
190
|
+
border: 0,
|
|
191
|
+
width: 1,
|
|
192
|
+
height: 1,
|
|
193
|
+
padding: 0,
|
|
194
|
+
margin: -1,
|
|
195
|
+
overflow: "hidden",
|
|
196
|
+
clip: "rect(0, 0, 0, 0)",
|
|
197
|
+
whiteSpace: "nowrap",
|
|
198
|
+
wordWrap: "normal",
|
|
199
|
+
...props.style
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
);
|
|
203
|
+
};
|
|
204
|
+
VisuallyHidden.displayName = "VisuallyHidden";
|
|
205
|
+
|
|
206
|
+
// src/icon/Icon.styles.tsx
|
|
207
|
+
var import_internal_utils = require("@spark-ui/internal-utils");
|
|
208
|
+
var import_class_variance_authority5 = require("class-variance-authority");
|
|
209
|
+
var iconStyles = (0, import_class_variance_authority5.cva)(["fill-current shrink-0"], {
|
|
210
|
+
variants: {
|
|
211
|
+
/**
|
|
212
|
+
* Color scheme of the icon.
|
|
213
|
+
*/
|
|
214
|
+
intent: (0, import_internal_utils.makeVariants)({
|
|
215
|
+
current: ["text-current"],
|
|
216
|
+
main: ["text-main"],
|
|
217
|
+
support: ["text-support"],
|
|
218
|
+
accent: ["text-accent"],
|
|
219
|
+
basic: ["text-basic"],
|
|
220
|
+
success: ["text-success"],
|
|
221
|
+
alert: ["text-alert"],
|
|
222
|
+
error: ["text-error"],
|
|
223
|
+
info: ["text-info"],
|
|
224
|
+
neutral: ["text-neutral"]
|
|
225
|
+
}),
|
|
226
|
+
/**
|
|
227
|
+
* Sets the size of the icon.
|
|
228
|
+
*/
|
|
229
|
+
size: (0, import_internal_utils.makeVariants)({
|
|
230
|
+
current: ["u-current-font-size"],
|
|
231
|
+
sm: ["w-sz-16", "h-sz-16"],
|
|
232
|
+
md: ["w-sz-24", "h-sz-24"],
|
|
233
|
+
lg: ["w-sz-32", "h-sz-32"],
|
|
234
|
+
xl: ["w-sz-40", "h-sz-40"]
|
|
235
|
+
})
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
// src/icon/Icon.tsx
|
|
240
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
241
|
+
var Icon = ({
|
|
242
|
+
label,
|
|
243
|
+
className,
|
|
244
|
+
size = "current",
|
|
245
|
+
intent = "current",
|
|
246
|
+
children,
|
|
247
|
+
...others
|
|
248
|
+
}) => {
|
|
249
|
+
const child = import_react3.Children.only(children);
|
|
250
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
251
|
+
(0, import_react3.cloneElement)(child, {
|
|
252
|
+
className: iconStyles({ className, size, intent }),
|
|
253
|
+
"data-spark-component": "icon",
|
|
254
|
+
"aria-hidden": "true",
|
|
255
|
+
focusable: "false",
|
|
256
|
+
...others
|
|
257
|
+
}),
|
|
258
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(VisuallyHidden, { children: label })
|
|
259
|
+
] });
|
|
260
|
+
};
|
|
261
|
+
Icon.displayName = "Icon";
|
|
262
|
+
|
|
263
|
+
// src/accordion/AccordionItemTrigger.tsx
|
|
264
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
265
|
+
var ItemTrigger = ({
|
|
266
|
+
asChild = false,
|
|
267
|
+
children,
|
|
268
|
+
className,
|
|
269
|
+
ref,
|
|
270
|
+
...props
|
|
271
|
+
}) => {
|
|
272
|
+
const renderSlot = useRenderSlot(asChild, "button");
|
|
273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
274
|
+
import_accordion4.Accordion.Trigger,
|
|
275
|
+
{
|
|
276
|
+
ref,
|
|
277
|
+
"data-spark-component": "accordion-item-trigger",
|
|
278
|
+
render: renderSlot,
|
|
279
|
+
className: (0, import_class_variance_authority6.cx)(
|
|
280
|
+
"group",
|
|
281
|
+
"gap-lg min-h-sz-48 relative flex items-center justify-between",
|
|
282
|
+
"px-lg py-md text-headline-2 text-on-surface data-[panel-open]:rounded-b-0 w-full rounded-[inherit] text-left",
|
|
283
|
+
"hover:enabled:bg-surface-hovered focus:bg-surface-hovered",
|
|
284
|
+
"focus-visible:u-outline focus-visible:z-raised focus-visible:outline-hidden",
|
|
285
|
+
"disabled:opacity-dim-3 cursor-pointer disabled:cursor-not-allowed",
|
|
286
|
+
className
|
|
287
|
+
),
|
|
288
|
+
...props,
|
|
289
|
+
children: [
|
|
290
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "gap-lg flex grow items-center", children }),
|
|
291
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
292
|
+
Icon,
|
|
293
|
+
{
|
|
294
|
+
intent: "neutral",
|
|
295
|
+
className: (0, import_class_variance_authority6.cx)(
|
|
296
|
+
"shrink-0 rotate-0 duration-100 ease-in motion-reduce:transition-none",
|
|
297
|
+
"group-data-[panel-open]:rotate-180"
|
|
298
|
+
),
|
|
299
|
+
size: "sm",
|
|
300
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_ArrowHorizontalDown.ArrowHorizontalDown, {})
|
|
301
|
+
}
|
|
302
|
+
)
|
|
303
|
+
]
|
|
304
|
+
}
|
|
305
|
+
);
|
|
306
|
+
};
|
|
307
|
+
ItemTrigger.displayName = "Accordion.ItemTrigger";
|
|
308
|
+
|
|
309
|
+
// src/accordion/index.ts
|
|
310
|
+
var Accordion2 = Object.assign(Accordion, {
|
|
311
|
+
Item,
|
|
312
|
+
ItemHeader,
|
|
313
|
+
ItemTrigger,
|
|
314
|
+
ItemContent
|
|
315
|
+
});
|
|
316
|
+
Accordion2.displayName = "Accordion";
|
|
317
|
+
Item.displayName = "Item";
|
|
318
|
+
ItemHeader.displayName = "ItemHeader";
|
|
319
|
+
ItemTrigger.displayName = "Accordion.Trigger";
|
|
320
|
+
ItemContent.displayName = "Accordion.Content";
|
|
321
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
322
|
+
0 && (module.exports = {
|
|
323
|
+
Accordion
|
|
324
|
+
});
|
|
325
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/accordion/index.ts","../../src/accordion/Accordion.tsx","../../src/slot/Slot.tsx","../../src/accordion/useRenderSlot.tsx","../../src/accordion/AccordionItem.tsx","../../src/accordion/AccordionItemContent.tsx","../../src/accordion/AccordionItemHeader.tsx","../../src/accordion/AccordionItemTrigger.tsx","../../src/icon/Icon.tsx","../../src/visually-hidden/VisuallyHidden.tsx","../../src/icon/Icon.styles.tsx"],"sourcesContent":["import { Accordion as Root } from './Accordion'\nimport { Item } from './AccordionItem'\nimport { ItemContent } from './AccordionItemContent'\nimport { ItemHeader } from './AccordionItemHeader'\nimport { ItemTrigger } from './AccordionItemTrigger'\n\nexport const Accordion: typeof Root & {\n Item: typeof Item\n ItemHeader: typeof ItemHeader\n ItemTrigger: typeof ItemTrigger\n ItemContent: typeof ItemContent\n} = Object.assign(Root, {\n Item,\n ItemHeader,\n ItemTrigger,\n ItemContent,\n})\n\nAccordion.displayName = 'Accordion'\nItem.displayName = 'Item'\nItemHeader.displayName = 'ItemHeader'\nItemTrigger.displayName = 'Accordion.Trigger'\nItemContent.displayName = 'Accordion.Content'\n\nexport { type AccordionProps } from './Accordion'\nexport { type AccordionItemHeaderProps } from './AccordionItemHeader'\nexport { type AccordionItemContentProps } from './AccordionItemContent'\nexport { type AccordionItemTriggerProps } from './AccordionItemTrigger'\n","import { Accordion as BaseAccordion } from '@base-ui-components/react/accordion'\nimport { cx } from 'class-variance-authority'\nimport { ComponentProps, createContext, Ref, useContext } from 'react'\n\nimport { useRenderSlot } from './useRenderSlot'\n\ntype ExtentedZagInterface = Omit<\n ComponentProps<typeof BaseAccordion.Root>,\n 'openMultiple' | 'render'\n>\n\nexport interface AccordionProps extends ExtentedZagInterface {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean\n /**\n * Whether the accordion items are disabled\n */\n disabled?: boolean\n /**\n * Whether multiple items can be open at the same time.\n */\n multiple?: boolean\n design?: 'filled' | 'outlined'\n ref?: Ref<HTMLDivElement>\n}\n\nconst AccordionContext = createContext<{\n design: 'filled' | 'outlined'\n} | null>(null)\n\nexport const Accordion = ({\n asChild = false,\n children,\n design = 'outlined',\n hiddenUntilFound = true,\n multiple = false,\n className,\n ref,\n ...props\n}: AccordionProps) => {\n const renderSlot = useRenderSlot(asChild, 'div')\n\n return (\n <AccordionContext.Provider value={{ design }}>\n <BaseAccordion.Root\n data-spark-component=\"accordion\"\n ref={ref}\n openMultiple={multiple}\n hiddenUntilFound={hiddenUntilFound}\n className={cx('bg-surface h-fit rounded-lg', className)}\n render={renderSlot}\n {...props}\n >\n {children}\n </BaseAccordion.Root>\n </AccordionContext.Provider>\n )\n}\n\nAccordion.displayName = 'Accordion'\n\nexport const useAccordionContext = () => {\n const context = useContext(AccordionContext)\n\n if (!context) {\n throw Error('useAccordionContext must be used within a Accordion provider')\n }\n\n return context\n}\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 { Slot } from '../slot'\n\nexport function useRenderSlot(asChild: boolean, defaultTag: string) {\n const Component = asChild ? Slot : defaultTag\n\n return asChild ? ({ ...props }) => <Component {...props} /> : undefined\n}\n","import { Accordion as BaseAccordion } from '@base-ui-components/react/accordion'\nimport { cx } from 'class-variance-authority'\nimport { type ComponentProps, Ref } from 'react'\n\nimport { useAccordionContext } from './Accordion'\nimport { useRenderSlot } from './useRenderSlot'\n\ntype ExtentedZagInterface = Omit<ComponentProps<typeof BaseAccordion.Item>, 'render'>\n\nexport interface AccordionItemProps extends ExtentedZagInterface {\n asChild?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Item = ({\n asChild = false,\n className,\n children,\n ref,\n ...props\n}: AccordionItemProps) => {\n const accordion = useAccordionContext()\n\n const renderSlot = useRenderSlot(asChild, 'div')\n\n return (\n <BaseAccordion.Item\n ref={ref}\n data-spark-component=\"accordion-item\"\n render={renderSlot}\n className={cx(\n 'relative first:rounded-t-lg last:rounded-b-lg',\n 'not-last:border-b-0',\n { 'border-sm border-outline': accordion.design === 'outlined' },\n className\n )}\n {...props}\n >\n {children}\n </BaseAccordion.Item>\n )\n}\n\nItem.displayName = 'Accordion.Item'\n","import { Accordion as BaseAccordion } from '@base-ui-components/react/accordion'\nimport { cx } from 'class-variance-authority'\nimport { type ComponentProps, Ref } from 'react'\n\nimport { useRenderSlot } from './useRenderSlot'\n\ntype ExtentedZagInterface = Omit<ComponentProps<typeof BaseAccordion.Panel>, 'render'>\n\nexport interface AccordionItemContentProps extends ExtentedZagInterface {\n asChild?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\nexport const ItemContent = ({\n asChild = false,\n className,\n children,\n ref,\n ...props\n}: AccordionItemContentProps) => {\n const renderSlot = useRenderSlot(asChild, 'div')\n\n return (\n <BaseAccordion.Panel\n ref={ref}\n data-spark-component=\"accordion-item-content\"\n className={cx(\n '[&>:first-child]:p-lg overflow-hidden',\n 'h-[var(--accordion-panel-height)] transition-all duration-200 data-[ending-style]:h-0 data-[starting-style]:h-0',\n 'text-body-1 text-on-surface',\n className\n )}\n render={renderSlot}\n {...props}\n >\n {children}\n </BaseAccordion.Panel>\n )\n}\n\nItemContent.displayName = 'Accordion.ItemContent'\n","import { cx } from 'class-variance-authority'\nimport { type ComponentProps, Ref } from 'react'\n\nimport { Slot } from '../slot'\n\nexport interface AccordionItemHeaderProps extends ComponentProps<'h3'> {\n asChild?: boolean\n ref?: Ref<HTMLHeadingElement>\n}\n\nexport const ItemHeader = ({\n asChild = false,\n children,\n className,\n ref,\n}: AccordionItemHeaderProps) => {\n const Component = asChild ? Slot : 'h3'\n\n return (\n <Component\n ref={ref}\n data-spark-component=\"accordion-item-header\"\n className={cx('rounded-[inherit]', className)}\n >\n {children}\n </Component>\n )\n}\n\nItemHeader.displayName = 'Accordion.ItemHeader'\n","import { Accordion as BaseAccordion } from '@base-ui-components/react/accordion'\nimport { ArrowHorizontalDown } from '@spark-ui/icons/ArrowHorizontalDown'\nimport { cx } from 'class-variance-authority'\nimport { type ComponentProps, Ref } from 'react'\n\nimport { Icon } from '../icon'\nimport { useRenderSlot } from './useRenderSlot'\n\ntype ExtentedZagInterface = Omit<ComponentProps<typeof BaseAccordion.Trigger>, 'render'>\n\nexport interface AccordionItemTriggerProps extends ExtentedZagInterface {\n asChild?: boolean\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const ItemTrigger = ({\n asChild = false,\n children,\n className,\n ref,\n ...props\n}: AccordionItemTriggerProps) => {\n const renderSlot = useRenderSlot(asChild, 'button')\n\n return (\n <BaseAccordion.Trigger\n ref={ref}\n data-spark-component=\"accordion-item-trigger\"\n render={renderSlot}\n className={cx(\n 'group',\n 'gap-lg min-h-sz-48 relative flex items-center justify-between',\n 'px-lg py-md text-headline-2 text-on-surface data-[panel-open]:rounded-b-0 w-full rounded-[inherit] text-left',\n 'hover:enabled:bg-surface-hovered focus:bg-surface-hovered',\n 'focus-visible:u-outline focus-visible:z-raised focus-visible:outline-hidden',\n 'disabled:opacity-dim-3 cursor-pointer disabled:cursor-not-allowed',\n className\n )}\n {...props}\n >\n <div className=\"gap-lg flex grow items-center\">{children}</div>\n <Icon\n intent=\"neutral\"\n className={cx(\n 'shrink-0 rotate-0 duration-100 ease-in motion-reduce:transition-none',\n 'group-data-[panel-open]:rotate-180'\n )}\n size=\"sm\"\n >\n <ArrowHorizontalDown />\n </Icon>\n </BaseAccordion.Trigger>\n )\n}\n\nItemTrigger.displayName = 'Accordion.ItemTrigger'\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,mBAAAA;AAAA;AAAA;;;ACAA,uBAA2C;AAC3C,sCAAmB;AACnB,IAAAC,gBAA+D;;;ACF/D,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;;;ACbqC,IAAAC,sBAAA;AAH9B,SAAS,cAAc,SAAkB,YAAoB;AAClE,QAAM,YAAY,UAAU,OAAO;AAEnC,SAAO,UAAU,CAAC,EAAE,GAAG,MAAM,MAAM,6CAAC,aAAW,GAAG,OAAO,IAAK;AAChE;;;AFwCM,IAAAC,sBAAA;AAlBN,IAAM,uBAAmB,6BAEf,IAAI;AAEP,IAAM,YAAY,CAAC;AAAA,EACxB,UAAU;AAAA,EACV;AAAA,EACA,SAAS;AAAA,EACT,mBAAmB;AAAA,EACnB,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAsB;AACpB,QAAM,aAAa,cAAc,SAAS,KAAK;AAE/C,SACE,6CAAC,iBAAiB,UAAjB,EAA0B,OAAO,EAAE,OAAO,GACzC;A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,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,qDAAC,SAAI,WAAU,iCAAiC,UAAS;AAAA,QACzD;AAAA,UAAC;AAAA;AAAA,YACC,QAAO;AAAA,YACP,eAAW;AAAA,cACT;AAAA,cACA;AAAA,YACF;AAAA,YACA,MAAK;AAAA,YAEL,uDAAC,kDAAoB;AAAA;AAAA,QACvB;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,YAAY,cAAc;;;APjDnB,IAAMC,aAKT,OAAO,OAAO,WAAM;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEDA,WAAU,cAAc;AACxB,KAAK,cAAc;AACnB,WAAW,cAAc;AACzB,YAAY,cAAc;AAC1B,YAAY,cAAc;","names":["Accordion","import_react","RadixSlot","import_jsx_runtime","import_jsx_runtime","BaseAccordion","import_accordion","import_class_variance_authority","import_jsx_runtime","BaseAccordion","import_accordion","import_class_variance_authority","import_jsx_runtime","BaseAccordion","import_class_variance_authority","import_jsx_runtime","import_accordion","import_class_variance_authority","import_react","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime","import_jsx_runtime","BaseAccordion","Accordion"]}
|