Skip to content

Commit

Permalink
add .
Browse files Browse the repository at this point in the history
  • Loading branch information
marcustisater-kivra committed Jun 24, 2024
1 parent aa1ffbb commit 1e60876
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 12 deletions.
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const config: Config = {
module.exports = config;
```

You are now ready to start Toybox: `npx run start`.
You are now ready to start Toybox: `pnpm run start`.

### 🤩 Creating a story

Expand Down Expand Up @@ -78,7 +78,7 @@ header: {
<Button${props}>
${children}
</Button>`,
variant: "filled", // Optionally, you can switch to another background on the codeTemplate.
variant: "filled" | "transparent", // Optionally, you can switch to another background on the codeTemplate.
render({ boolean, text, segment, button }, action) {
// This will add a control button but will not add any extra props in `codeTemplate`
button('Click on me', () => alert('Hello!'));
Expand Down
6 changes: 3 additions & 3 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ export interface StoryRoute {
headName: string;
}

export type StatusVariants = "core" | "lab" | "deprecated" | "notSupported";
export type StatusVariants = "core" | "deprecated" | "notSupported";
export type StoryButtonTypes = "github" | "figma" | "import" | "status";

export type StoryButtonType =
| {
type: Exclude<StoryButtonTypes, "status" | "import">;
type: "figma" | "github";
url?: string;
}
| {
Expand Down Expand Up @@ -66,7 +66,7 @@ export interface Story {
type?: "fullsize" | "configurator";
center?: boolean;
information?: string;
variant?: "filled";
variant?: "filled" | "transparent";
codeTemplate?: CodeTemplateFn;
hideControls?: boolean;
render?: (
Expand Down
4 changes: 2 additions & 2 deletions src/webapp/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ function App() {
component: () =>
import("__STARTPAGE_COMPONENT_PATH__" as string),
urlPath: "/",
name: "release",
headName: "release",
name: "startpage",
headName: "startpage",
}}
/>
}
Expand Down
3 changes: 2 additions & 1 deletion src/webapp/layout/story/Button.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const story: Story = {
},
{
type: "figma",
url: "",
url: "#",
},
],
},
Expand Down Expand Up @@ -53,6 +53,7 @@ export const story: Story = {
{
name: "Displaying examples",
center: true,
variant: "transparent",
hideControls: true,
information: `
In your story, you could showcase various examples of the button component without showing the property toolbar.
Expand Down
7 changes: 5 additions & 2 deletions src/webapp/layout/story/Story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,16 @@ const Preview = styled.div<{
flex: "1",
padding: "16px",
background:
variant === "filled" ? "var(--surface-200)" : "var(--surface-100)",
variant === "filled"
? "var(--surface-200)"
: variant === "transparent"
? "transparent"
: "var(--surface-100)",
borderTopLeftRadius: "12px",
borderTopRightRadius: hideControls ? "12px" : 0,
borderBottomLeftRadius: codeTemplate ? 0 : "12px",
borderBottomRightRadius: hideControls ? "12px" : 0,
border: "1px solid var(--border)",
borderRight: hideControls ? 0 : undefined,
borderBottom: hideControls ? 0 : undefined,
minHeight: "270px",
}));
Expand Down
1 change: 0 additions & 1 deletion src/webapp/layout/story/story-button/StoryButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export const StoryHeaderButton: React.FC<Props> = ({
const Status = ({ type }: { type: StatusVariants }) => {
const statusStyles = {
core: { color: "var(--green-primary)", variant: "outline" },
lab: { color: "#BD500C", variant: "outline" },
notSupported: {
color: "#B50019",
variant: "outline",
Expand Down
2 changes: 1 addition & 1 deletion startpage.story.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const story: Story = {
<Button${props}>
${children}
</Button>`,
variant: "filled", // Optionally, you can switch to another background on the codeTemplate.
variant: "filled" | "transparent", // Optionally, you can switch to another background on the codeTemplate.
render({ boolean, text, segment, button }, action) {
// This will add a control button but will not add any extra props in `codeTemplate`
button('Click on me', () => alert('Hello!'));
Expand Down

0 comments on commit 1e60876

Please sign in to comment.