docs: collapsible
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: base(.75) base(1);
|
||||
padding: base(.5) base(1);
|
||||
|
||||
&:hover {
|
||||
background: var(--theme-elevation-100);
|
||||
|
||||
@@ -20,7 +20,7 @@ export const Collapsible: React.FC<Props> = ({ children, onToggle, className, he
|
||||
isNested && `${baseClass}--nested`,
|
||||
].filter(Boolean).join(' ')}
|
||||
>
|
||||
<CollapsibleProvider withinCollapsible>
|
||||
<CollapsibleProvider>
|
||||
<button
|
||||
type="button"
|
||||
className={`${baseClass}__toggle ${baseClass}__toggle--${collapsed ? 'collapsed' : 'open'}`}
|
||||
|
||||
@@ -4,7 +4,7 @@ import React, {
|
||||
|
||||
const Context = createContext(false);
|
||||
|
||||
export const CollapsibleProvider: React.FC<{ children?: React.ReactNode, withinCollapsible: boolean }> = ({ children, withinCollapsible }) => {
|
||||
export const CollapsibleProvider: React.FC<{ children?: React.ReactNode, withinCollapsible?: boolean }> = ({ children, withinCollapsible = true }) => {
|
||||
return (
|
||||
<Context.Provider value={withinCollapsible}>
|
||||
{children}
|
||||
|
||||
Reference in New Issue
Block a user