Skip to content

Commit

Permalink
Merge pull request #908 from mperrando/diclosure-title-spacing-in-config
Browse files Browse the repository at this point in the history
Disclosure: config title spacing.
  • Loading branch information
veej authored Sep 19, 2024
2 parents bf9b4d8 + 6d35202 commit d0c2ed5
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/bento-design-system/src/Disclosure/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Children } from "../util/Children";
import { DisclosureProps } from "./Disclosure";

export type DisclosureConfig = {
titleSpacing: BentoSprinkles["gap"];
internalSpacing: BentoSprinkles["gap"];
titleSize: {
1: TitleProps["size"];
Expand Down
2 changes: 1 addition & 1 deletion packages/bento-design-system/src/Disclosure/Disclosure.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function Disclosure({
const icon = open ? config.icons.open : config.icons.closed;

return (
<Stack space={16}>
<Stack space={config.titleSpacing}>
<Box
{...focusProps}
{...pressProps}
Expand Down
1 change: 1 addition & 0 deletions packages/bento-design-system/src/util/defaultConfigs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ export const decorativeDivider: DecorativeDividerConfig = {
};

export const disclosure: DisclosureConfig = {
titleSpacing: 16,
internalSpacing: 16,
titleSize: {
1: "medium",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { DesignSystemProvider, Modal as BentoModal, withBentoConfig } from "..";
import {
DesignSystemProvider,
Modal as BentoModal,
withBentoConfig,
Disclosure as BentoDisclosure,
Placeholder,
} from "..";
import { action } from "@storybook/addon-actions";
import { defaultMessages } from "../../src/defaultMessages/en";

Expand Down Expand Up @@ -45,3 +51,20 @@ export const ConfiguredModal = () => {
</DesignSystemProvider>
);
};

export const ConfiguredDisclosure = () => {
const Disclosure = withBentoConfig(
{
disclosure: {
titleSpacing: 0,
},
},
BentoDisclosure
);

return (
<Disclosure title="Title">
<Placeholder />
</Disclosure>
);
};

0 comments on commit d0c2ed5

Please sign in to comment.