@conveyorhq/arrow-ds 1.122.0 → 1.123.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/package.json
CHANGED
|
@@ -35,8 +35,9 @@ export declare type AccordionContentProps = {
|
|
|
35
35
|
maxHeight?: string;
|
|
36
36
|
style?: React.CSSProperties;
|
|
37
37
|
className?: string;
|
|
38
|
+
scrollClassName?: string;
|
|
38
39
|
};
|
|
39
|
-
export declare const AccordionContent: ({ children, maxHeight, style, className, ...rest }: AccordionContentProps) => JSX.Element;
|
|
40
|
+
export declare const AccordionContent: ({ children, maxHeight, style, className, scrollClassName, ...rest }: AccordionContentProps) => JSX.Element;
|
|
40
41
|
export declare type AccordionProps = AccordionOwnProps & BoxProps;
|
|
41
42
|
export declare const Accordion: {
|
|
42
43
|
(props: AccordionProps): JSX.Element;
|
|
@@ -44,6 +45,6 @@ export declare const Accordion: {
|
|
|
44
45
|
Item: ({ value, defaultIsOpen: defaultIsOpenProp, children, className, ...rest }: AccordionItemProps) => JSX.Element;
|
|
45
46
|
Button: React.ForwardRefExoticComponent<AccordionButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
46
47
|
Icon: ({ className, direction, color, }: AccordionIconProps) => JSX.Element;
|
|
47
|
-
Content: ({ children, maxHeight, style, className, ...rest }: AccordionContentProps) => JSX.Element;
|
|
48
|
+
Content: ({ children, maxHeight, style, className, scrollClassName, ...rest }: AccordionContentProps) => JSX.Element;
|
|
48
49
|
};
|
|
49
50
|
export {};
|
|
@@ -111,7 +111,7 @@ const AccordionIcon = ({ className, direction = "down", color, }) => {
|
|
|
111
111
|
return (react_1.default.createElement(Icon_1.Icon, { className: classnames_1.default([cn({ e: "icon" }), className]), "data-direction": direction, icon: icon[direction], color: color }));
|
|
112
112
|
};
|
|
113
113
|
exports.AccordionIcon = AccordionIcon;
|
|
114
|
-
const AccordionContent = ({ children, maxHeight, style, className, ...rest }) => {
|
|
114
|
+
const AccordionContent = ({ children, maxHeight, style, className, scrollClassName, ...rest }) => {
|
|
115
115
|
const { disableAnimation } = context_1.useAccordionGroupContext();
|
|
116
116
|
const { buttonId, contentId, defaultIsOpen, isOpen, } = context_1.useAccordionItemContext();
|
|
117
117
|
const [childrenRef, setChildrenRef] = react_1.default.useState({ current: null });
|
|
@@ -129,7 +129,7 @@ const AccordionContent = ({ children, maxHeight, style, className, ...rest }) =>
|
|
|
129
129
|
}
|
|
130
130
|
}, immediate: disableAnimation || !enableTransition }, (show) => show
|
|
131
131
|
? (styles) => (react_1.default.createElement(Box_1.Box, Object.assign({ className: classnames_1.default("overflow-hidden box-content", className), style: { ...styles, ...style }, "aria-labelledby": buttonId, id: contentId, role: "region" }, rest),
|
|
132
|
-
react_1.default.createElement(Box_1.Box, { ref: onRefChange, className: classnames_1.default(maxHeight && "overflow-y-auto"), style: maxHeight ? { maxHeight } : undefined }, children)))
|
|
132
|
+
react_1.default.createElement(Box_1.Box, { ref: onRefChange, className: classnames_1.default(maxHeight && "overflow-y-auto", scrollClassName), style: maxHeight ? { maxHeight } : undefined }, children)))
|
|
133
133
|
: null));
|
|
134
134
|
};
|
|
135
135
|
exports.AccordionContent = AccordionContent;
|
|
@@ -276,6 +276,7 @@ export type AccordionContentProps = {
|
|
|
276
276
|
maxHeight?: string;
|
|
277
277
|
style?: React.CSSProperties;
|
|
278
278
|
className?: string;
|
|
279
|
+
scrollClassName?: string;
|
|
279
280
|
};
|
|
280
281
|
|
|
281
282
|
export const AccordionContent = ({
|
|
@@ -283,6 +284,7 @@ export const AccordionContent = ({
|
|
|
283
284
|
maxHeight,
|
|
284
285
|
style,
|
|
285
286
|
className,
|
|
287
|
+
scrollClassName,
|
|
286
288
|
...rest
|
|
287
289
|
}: AccordionContentProps) => {
|
|
288
290
|
const { disableAnimation } = useAccordionGroupContext();
|
|
@@ -336,7 +338,10 @@ export const AccordionContent = ({
|
|
|
336
338
|
>
|
|
337
339
|
<Box
|
|
338
340
|
ref={onRefChange}
|
|
339
|
-
className={classNames(
|
|
341
|
+
className={classNames(
|
|
342
|
+
maxHeight && "overflow-y-auto",
|
|
343
|
+
scrollClassName,
|
|
344
|
+
)}
|
|
340
345
|
style={maxHeight ? { maxHeight } : undefined}
|
|
341
346
|
>
|
|
342
347
|
{children}
|