@workday/canvas-kit-labs-react
Version:
Canvas Kit Labs is an incubator for new and experimental components. Since we have a rather rigorous process for getting components in at a production level, it can be valuable to make them available earlier while we continuously iterate on the API/functi
13 lines (12 loc) • 688 B
JavaScript
import React from 'react';
import { space } from '@workday/canvas-kit-react/tokens';
import { createSubcomponent } from '@workday/canvas-kit-react/common';
import { Box } from '@workday/canvas-kit-react/layout';
import { useExpandableContent } from './hooks/useExpandableContent';
import { useExpandableModel } from './hooks/useExpandableModel';
export const ExpandableContent = createSubcomponent('div')({
modelHook: useExpandableModel,
elemPropsHook: useExpandableContent,
})(({ children, ...elementProps }, Element) => {
return (React.createElement(Box, { as: Element, background: "none", padding: `${space.s} ${space.xxs} ${space.xxs}`, ...elementProps }, children));
});