-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add playroom and storybook-addon-playroom dependencies
Co-Authored-By: [email protected] <[email protected]>
- Loading branch information
1 parent
3955bd7
commit 1b9e1de
Showing
9 changed files
with
2,946 additions
and
1,106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
const path = require("path"); | ||
const { defaultFoundation } = require("@kiwicom/orbit-design-tokens"); | ||
|
||
module.exports = { | ||
title: "Orbit Playroom", | ||
components: require.resolve("./playroomComponents.tsx"), | ||
outputPath: "./.playroom", | ||
frameComponent: "./playroom/FrameComponent.tsx", | ||
snippets: "./playroom/snippets.ts", | ||
port: 9000, | ||
openBrowser: false, | ||
widths: Object.values(defaultFoundation.breakpoint), | ||
baseUrl: "/", | ||
webpackConfig: () => ({ | ||
resolve: { | ||
extensions: [".js", ".jsx", ".ts", ".tsx", ".css"], | ||
modules: [ | ||
"node_modules", | ||
path.resolve(__dirname), | ||
path.resolve(__dirname, "src"), | ||
path.resolve(__dirname, "lib"), | ||
path.resolve(__dirname, "node_modules"), | ||
path.resolve(__dirname, "../.."), | ||
], | ||
alias: { | ||
"@kiwicom/orbit-components": path.resolve(__dirname), | ||
}, | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.css$/i, | ||
sideEffects: true, | ||
exclude: /node_modules/, | ||
use: [ | ||
require.resolve("style-loader"), | ||
require.resolve("css-loader"), | ||
{ | ||
loader: require.resolve("postcss-loader"), | ||
options: { | ||
postcssOptions: { | ||
plugins: [require.resolve("tailwindcss"), require.resolve("autoprefixer")], | ||
}, | ||
}, | ||
}, | ||
], | ||
}, | ||
{ | ||
test: /\.(js|jsx|ts|tsx)$/, | ||
exclude: /node_modules/, | ||
use: { | ||
loader: "babel-loader", | ||
options: { | ||
presets: ["@babel/preset-env", "@babel/preset-react", "@babel/preset-typescript"], | ||
}, | ||
}, | ||
}, | ||
], | ||
}, | ||
}), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import * as React from "react"; | ||
import "./index.css"; | ||
|
||
import { OrbitProvider } from "../src"; | ||
import defaultTheme from "../src/defaultTheme"; | ||
|
||
// Wrap all examples in OrbitProvider for proper theming | ||
const FrameComponent = ({ children }) => { | ||
return ( | ||
<OrbitProvider theme={defaultTheme} useId={React.useId}> | ||
<div style={{ padding: "20px" }}>{children}</div> | ||
</OrbitProvider> | ||
); | ||
}; | ||
export default FrameComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
interface Snippet { | ||
group: string; | ||
name: string; | ||
code: string; | ||
} | ||
|
||
const snippets: Snippet[] = [ | ||
{ | ||
group: "Basic Components", | ||
name: "Button Primary", | ||
code: `<Button>Click me</Button>`, | ||
}, | ||
{ | ||
group: "Basic Components", | ||
name: "Alert Info", | ||
code: `<Alert type="info">This is an informational message</Alert>`, | ||
}, | ||
{ | ||
group: "Forms", | ||
name: "Input Field", | ||
code: `<InputField label="Username" placeholder="Enter your username" />`, | ||
}, | ||
{ | ||
group: "Layout", | ||
name: "Card with Content", | ||
code: ` | ||
<Card> | ||
<CardSection> | ||
<Stack> | ||
<Heading type="title3">Card Title</Heading> | ||
<Text>This is some content inside a card.</Text> | ||
<Button>Learn More</Button> | ||
</Stack> | ||
</CardSection> | ||
</Card>`, | ||
}, | ||
]; | ||
|
||
export default snippets; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Re-export components from Orbit | ||
export * from "@kiwicom/orbit-components"; |
Oops, something went wrong.