-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(examples): update design-system
- Loading branch information
Showing
38 changed files
with
6,308 additions
and
6,845 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
auto-install-peers = true | ||
node-linker=hoisted | ||
public-hoist-pattern[]=*storybook* |
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
module.exports = { | ||
root: true, | ||
extends: ["acme"], | ||
extends: ["custom/storybook"], | ||
}; |
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 |
---|---|---|
@@ -1,27 +1,42 @@ | ||
const path = require("path"); | ||
import { dirname, join, resolve } from "path"; | ||
|
||
module.exports = { | ||
stories: ["../stories/**/*.stories.mdx", "../stories/**/*.stories.tsx"], | ||
addons: ["@storybook/addon-links", "@storybook/addon-essentials"], | ||
framework: "@storybook/react", | ||
core: { | ||
builder: "@storybook/builder-vite", | ||
function getAbsolutePath(value) { | ||
return dirname(require.resolve(join(value, "package.json"))); | ||
} | ||
|
||
const config = { | ||
stories: ["../stories/*.stories.tsx", "../stories/**/*.stories.tsx"], | ||
addons: [ | ||
getAbsolutePath("@storybook/addon-links"), | ||
getAbsolutePath("@storybook/addon-essentials"), | ||
getAbsolutePath("@storybook/addon-docs"), | ||
], | ||
framework: { | ||
name: getAbsolutePath("@storybook/react-vite"), | ||
options: {}, | ||
}, | ||
|
||
core: {}, | ||
|
||
async viteFinal(config, { configType }) { | ||
// customize the Vite config here | ||
return { | ||
...config, | ||
define: { "process.env": {} }, | ||
resolve: { | ||
alias: [ | ||
{ | ||
find: "@acme/core", | ||
replacement: path.resolve( | ||
__dirname, | ||
"../../../packages/acme-core/" | ||
), | ||
find: "ui", | ||
replacement: resolve(__dirname, "../../../packages/ui/"), | ||
}, | ||
], | ||
}, | ||
}; | ||
}, | ||
|
||
docs: { | ||
autodocs: true, | ||
}, | ||
}; | ||
|
||
export default config; |
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
20 changes: 0 additions & 20 deletions
20
examples/design-system/apps/docs/stories/button.stories.mdx
This file was deleted.
Oops, something went wrong.
46 changes: 46 additions & 0 deletions
46
examples/design-system/apps/docs/stories/button.stories.tsx
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,46 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
import { Button } from "ui"; | ||
|
||
const meta: Meta<typeof Button> = { | ||
component: Button, | ||
argTypes: { | ||
type: { | ||
control: { type: "radio" }, | ||
options: ["button", "submit", "reset"], | ||
}, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof Button>; | ||
|
||
/* | ||
*👇 Render functions are a framework specific feature to allow you control on how the component renders. | ||
* See https://storybook.js.org/docs/react/api/csf | ||
* to learn how to use render functions. | ||
*/ | ||
export const Primary: Story = { | ||
render: (props) => ( | ||
<Button | ||
{...props} | ||
onClick={(): void => { | ||
// eslint-disable-next-line no-alert -- alert for demo | ||
alert("Hello from Turborepo!"); | ||
}} | ||
> | ||
Hello | ||
</Button> | ||
), | ||
name: "Button", | ||
args: { | ||
children: "Hello", | ||
type: "button", | ||
style: { | ||
color: "blue", | ||
border: "1px solid gray", | ||
padding: 10, | ||
borderRadius: 10, | ||
}, | ||
}, | ||
}; |
2 changes: 1 addition & 1 deletion
2
...-system/packages/acme-utils/tsconfig.json → ...les/design-system/apps/docs/tsconfig.json
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"extends": "@acme/tsconfig/react-library.json", | ||
"extends": "tsconfig/react-app.json", | ||
"include": ["."], | ||
"exclude": ["dist", "build", "node_modules"] | ||
} |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
examples/design-system/packages/acme-utils/src/useIsomorphicLayoutEffect.tsx
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
examples/design-system/packages/acme-utils/src/usePrevious.tsx
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
examples/design-system/packages/eslint-config-acme/index.js
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
examples/design-system/packages/eslint-config-acme/package.json
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
examples/design-system/packages/eslint-config-custom/README.md
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 @@ | ||
# `@turbo/eslint-config` | ||
|
||
Collection of internal eslint configurations. |
Oops, something went wrong.