Skip to content

Commit a733cfd

Browse files
authored
Merge pull request #136 from buildo/showcase
Add utility for creating a showcase
2 parents 3efb8dc + e47d695 commit a733cfd

File tree

9 files changed

+709
-2
lines changed

9 files changed

+709
-2
lines changed

Diff for: packages/bento-design-system/src/AreaLoader/createAreaLoader.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ type Props = {
3333
message?: LocalizedString;
3434
};
3535

36+
export type { Props as AreaLoaderProps };
37+
3638
export function createAreaLoader(config: AreaLoaderConfig) {
3739
/**
3840
* `Loader` fills the parent container with an overlay and renders an animated indefinite loader

Diff for: packages/bento-design-system/src/Avatar/createAvatar.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ type Props = {
1818
| "pink";
1919
};
2020

21+
export type { Props as AvatarProps };
22+
2123
export function createAvatar(config: AvatarConfig) {
2224
return function Avatar({ color, name }: Props) {
2325
const initial = name?.trim()[0];

Diff for: packages/bento-design-system/src/DisclosureGroup/createDisclosureGroup.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ function isLeaf(item: NodeItem | LeafItem): item is LeafItem {
1414
return !("items" in item);
1515
}
1616

17+
export type { Props as DisclosureGroupProps };
18+
1719
export function createDisclosureGroup(
1820
config: DisclosureGroupConfig,
1921
{

Diff for: packages/bento-design-system/src/Field/createFormFields.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,4 @@ export type {
7575
} from "../CheckboxGroupField/createCheckboxGroupField";
7676
export type { NumberFieldProps } from "../NumberField/createNumberField";
7777
export type { SliderFieldProps } from "../SliderField/createSliderField";
78+
export type { CheckboxFieldProps } from "../CheckboxField/createCheckboxField";

Diff for: packages/bento-design-system/src/Stepper/createStepper.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ type Props = {
1414

1515
type StepStatus = "todo" | "inProgress" | "done";
1616

17+
export type { Props as StepperProps };
18+
1719
export function createStepper(config: StepperConfig) {
1820
return function Stepper({ currentStep, steps }: Props) {
1921
return (

Diff for: packages/bento-design-system/src/createBentoComponents.ts

+10-2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ import { bentoSprinkles } from "./internal";
6262
import { createProgressBar } from "./ProgressBar/createProgressBar";
6363
import merge from "ts-deepmerge";
6464
import { createSwitch } from "./Switch/createSwitch";
65+
import { createUseComponentsShowcase } from "./createUseComponentsShowcase";
6566

6667
export function createBentoComponents<
6768
AtomsFn extends typeof bentoSprinkles,
@@ -100,7 +101,7 @@ export function createBentoComponents<
100101

101102
const Card = createCard(merge(defaultConfigs.card, config.card ?? {}));
102103

103-
// TODO(gabro): investigate as any here
104+
// NOTE(gabro): as any here because merge chokes up on the ChipConfig generic
104105
const Chip = createChip(merge(defaultConfigs.chip, config.chip ?? {}) as any, {
105106
Box,
106107
IconButton,
@@ -212,7 +213,7 @@ export function createBentoComponents<
212213
IllustrationSearch,
213214
};
214215

215-
return {
216+
const components = {
216217
...icons,
217218
...illustrations,
218219
Actions,
@@ -275,4 +276,11 @@ export function createBentoComponents<
275276
Tooltip,
276277
TextField,
277278
};
279+
280+
const useComponentsShowcase = createUseComponentsShowcase(components);
281+
282+
return {
283+
...components,
284+
useComponentsShowcase,
285+
};
278286
}

0 commit comments

Comments
 (0)