Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit ae43d39

Browse files
committed
storybook: fix imports and required types
- update import of main styles to use in storybook; - update components with required types in stories;
1 parent 980f786 commit ae43d39

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,13 @@ package | source
1010
[@cockroachlabs/design-tokens](https://www.npmjs.com/package/@cockroachlabs/design-tokens) | [`/packages/design-tokens`](https://github.com/cockroachdb/ui/tree/master/packages/design-tokens)
1111
[@cockroachlabs/icons](https://www.npmjs.com/package/@cockroachlabs/icons) | [`/packages/icons`](https://github.com/cockroachdb/ui/tree/master/packages/icons)
1212
[@cockroachlabs/ui-components](https://www.npmjs.com/package/@cockroachlabs/ui-components) | [`/packages/ui-components`](https://github.com/cockroachdb/ui/tree/master/packages/ui-components)
13+
14+
## storybook-ui-components
15+
To run storybook locally, it's required to build all dependent packages and then run Storybook itself:
16+
```
17+
pnpm install # install dependencies
18+
pnpm build # run `build` scrips for all workspaces
19+
pnpm --dir packages/storybook-ui-components start # run storybooks
20+
# -or-
21+
pnpm --dir packages/storybook-ui-components build-storybook # build a static version of storybooks
22+
```

packages/storybook-ui-components/.storybook/preview.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// .storybook/preview.ts
2-
import "@cockroachlabs/ui-components/dist/main.css"
2+
import "@cockroachlabs/ui-components/dist/cjs/index.css"
33

44
const preview = {
55
parameters: {},

packages/storybook-ui-components/stories/ExpandableText.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default {
1212

1313
export const Default = () => (
1414
<div style={{ width: divWidth }}>
15-
<ExpandableText text={fourLinetext} />
15+
<ExpandableText text={fourLinetext} maxLine={4} />
1616
</div>
1717
);
1818

packages/storybook-ui-components/stories/Input.stories.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const Number = () => {
1818
<h1>Number Input</h1>
1919

2020
<NumberInput
21-
initialValue={number("Initial value", 0)}
21+
defaultValue={number("Initial value", 0)}
2222
value={value}
2323
disabled={boolean("disabled", false)}
2424
invalid={boolean("invalid", false)}
@@ -40,7 +40,7 @@ export const Text = () => {
4040
</StoryDescription>
4141

4242
<TextInput
43-
initialValue={text("Initial value", "some text")}
43+
defaultValue={text("Initial value", "some text")}
4444
disabled={boolean("disabled", false)}
4545
invalid={boolean("invalid", false)}
4646
/>
@@ -77,6 +77,7 @@ export const Email = () => {
7777
</StoryDescription>
7878

7979
<EmailInput
80+
validatorLabel={text("validatorLabel", "validate email")}
8081
disabled={boolean("disabled", false)}
8182
invalid={boolean("invalid", false)}
8283
/>
@@ -94,6 +95,7 @@ export const NewPassword = () => {
9495
</StoryDescription>
9596

9697
<NewPasswordInput
98+
validatorLabel={text("validatorLabel", "validate password")}
9799
disabled={boolean("disabled", false)}
98100
invalid={boolean("invalid", false)}
99101
required={boolean("required", true)}

0 commit comments

Comments
 (0)