diff --git a/packages/core/.storybook/preview.tsx b/packages/core/.storybook/preview.tsx index d537553e3d..ce0c0462e5 100644 --- a/packages/core/.storybook/preview.tsx +++ b/packages/core/.storybook/preview.tsx @@ -3,6 +3,7 @@ import * as VibeComponents from "../src/components"; import * as VibeComponentsNext from "../src/components/next"; import * as VibeHooks from "../src/hooks"; import * as VibeIcons from "@vibe/icons"; +import vibeLogo from "./logo.svg"; import { Preview } from "@storybook/react"; import isChromatic from "chromatic/isChromatic"; import { DocsContainer, DocsPage, Unstyled } from "@storybook/blocks"; @@ -117,7 +118,18 @@ const preview: Preview = { }, playground: { storyId: "playground", - components: { ...VibeComponents, VibeIcons, VibeNext: VibeComponentsNext, ...VibeHooks }, + components: { + vibeLogo, + ...VibeComponents, + VibeIcons, + VibeNext: VibeComponentsNext, + ...VibeHooks, + useState: React.useState, + useEffect: React.useEffect, + useCallback: React.useCallback, + useMemo: React.useMemo, + useRef: React.useRef + }, introCode, autocompletions: generateAutocompletion(reactDocgenOutput) } diff --git a/packages/core/.storybook/tsconfig.json b/packages/core/.storybook/tsconfig.json index 6b21f65983..51921f065d 100644 --- a/packages/core/.storybook/tsconfig.json +++ b/packages/core/.storybook/tsconfig.json @@ -1,7 +1,8 @@ { "extends": "../tsconfig.base.json", "compilerOptions": { - "resolveJsonModule": true + "resolveJsonModule": true, + "types": ["./types.ts"] }, "include": ["**/*.ts", "**/*.tsx", "**/*.json"] } diff --git a/packages/core/.storybook/types.ts b/packages/core/.storybook/types.ts new file mode 100644 index 0000000000..2ff147833c --- /dev/null +++ b/packages/core/.storybook/types.ts @@ -0,0 +1,4 @@ +declare module "*.svg" { + const content: React.FunctionComponent>; + export default content; +} diff --git a/packages/core/src/storybook/stand-alone-documentaion/playground/playground-helpers.ts b/packages/core/src/storybook/stand-alone-documentaion/playground/playground-helpers.ts index dd8c66e107..b5785866e8 100644 --- a/packages/core/src/storybook/stand-alone-documentaion/playground/playground-helpers.ts +++ b/packages/core/src/storybook/stand-alone-documentaion/playground/playground-helpers.ts @@ -1,47 +1,48 @@ export const jsx = `() => { - const [timesClicked, setTimesClicked] = React.useState(0); + const [timesClicked, setTimesClicked] = useState(0); function onButtonClick(): void { - if (timesClicked === 0) { - alert("isn't that nice?"); - } setTimesClicked(prev => prev + 1); } return ( - -
- Online Playground - - Prototype with actual components + + Vibe Logo +
+ + Playground -
-
- Can't see the code editor? - - Click on the button on the left panel and - select the{" "} + + Craft, Experiment, and Innovate with Vibe. - - "Change Addons Orientation" + + + + + Tip: Can't see the editor? Click 'D' on your keyboard -
- - Button has been clicked {timesClicked} times +
); }`; -export const css = `.container { - display: flex; - flex-direction: column; - gap: var(--spacing-medium); +export const css = `.playground { + padding-block-start: 40px; + margin: 0; + width: 100vw; } -.action-button { - align-self: flex-start; -}`; +.vibe-logo { + width: 150px; + transition: transform 0.3s ease, filter 0.3s ease; +} + +.vibe-logo:hover { + transform: scale(1.02); + filter: drop-shadow(0 0 32px rgba(80, 52, 255, 0.3)); +} +`; export default { jsx, css };