Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
sebald committed Dec 11, 2024
1 parent 03b5d09 commit b6acc40
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 86 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"lint": "eslint . --ignore-pattern node_modules --ignore-pattern dist --ignore-pattern packages/types/src/index.ts --ignore-pattern \".cache\" --ignore-pattern public",
"format": "prettier --write \"**/*\"",
"format:fix": "prettier --write \"**/*\" --fix",
"typecheck": "pnpm --filter @marigold/docs build && tsc --noEmit --resolveJsonModule --project tsconfig.check.json",
"typecheck": "tsc --noEmit --resolveJsonModule --project tsconfig.check.json",
"contributor": "all-contributors",
"changeset": "changeset",
"release:notification": "zx scripts/create-slack-notification.mjs",
Expand Down
61 changes: 29 additions & 32 deletions packages/components/src/Autocomplete/Autocomplete.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Meta, StoryObj } from '@storybook/react';
import { Key, useState } from 'react';
import { Text } from 'react-aria-components';
import { useAsyncList } from '@react-stately/data';
import { Container } from '../Container';
import { Stack } from '../Stack';
import { Autocomplete } from './Autocomplete';

Expand Down Expand Up @@ -120,38 +119,36 @@ export const Controlled: Story = {
const keyToRender = submitted[0] !== null ? submitted[0].toString() : null;

return (
<Container size="large">
<Stack space={4}>
<Autocomplete
{...args}
value={current}
onChange={setCurrent}
onSubmit={(key, val) => setSubmitted([key, val])}
disabledKeys={['star-trek']}
<Stack space={4}>
<Autocomplete
{...args}
value={current}
onChange={setCurrent}
onSubmit={(key, val) => setSubmitted([key, val])}
disabledKeys={['star-trek']}
>
<Autocomplete.Option id="harry-potter" textValue="Harry Potter">
Harry Potter
</Autocomplete.Option>
<Autocomplete.Option
id="lord-of-the-rings"
textValue="Lord of the Rings"
>
<Autocomplete.Option id="harry-potter" textValue="Harry Potter">
Harry Potter
</Autocomplete.Option>
<Autocomplete.Option
id="lord-of-the-rings"
textValue="Lord of the Rings"
>
Lord of the Rings
</Autocomplete.Option>
<Autocomplete.Option id="star-wars" textValue="Star Wars">
Star Wars
</Autocomplete.Option>
<Autocomplete.Option id="star-trek" textValue="Star Trek">
Star Trek
</Autocomplete.Option>
<Autocomplete.Option id="firefly">Firefly</Autocomplete.Option>
</Autocomplete>
<pre>current: {current}</pre>
<pre>
submitted: (key: {keyToRender}, value: {submitted[1]})
</pre>
</Stack>
</Container>
Lord of the Rings
</Autocomplete.Option>
<Autocomplete.Option id="star-wars" textValue="Star Wars">
Star Wars
</Autocomplete.Option>
<Autocomplete.Option id="star-trek" textValue="Star Trek">
Star Trek
</Autocomplete.Option>
<Autocomplete.Option id="firefly">Firefly</Autocomplete.Option>
</Autocomplete>
<pre>current: {current}</pre>
<pre>
submitted: (key: {keyToRender}, value: {submitted[1]})
</pre>
</Stack>
);
},
};
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/Body/Body.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type Story = StoryObj<typeof meta>;

export const Basic: Story = {
render: args => (
<Container contentType="content" size="medium">
<Container>
<Body {...args}>
<strong>Professor Severus Snape</strong> (9 January, 1960[1] - 2 May,
1998)[2] was an English half-blood[3] wizard serving as Potions Master
Expand Down
2 changes: 0 additions & 2 deletions packages/components/src/Breakout/Breakout.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import type { Meta, StoryObj } from '@storybook/react';
import React from 'react';
import { Aspect } from '../Aspect';
import { Container } from '../Container';
import { Image } from '../Image';
import { Text } from '../Text';
import { Breakout } from './Breakout';

Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/Card/Card.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ type Story = StoryObj<typeof meta>;

export const Basic: Story = {
render: args => (
<Container contentType="content" size="medium">
<Container>
<Card {...args}>
<h2>Professor Severus Snape</h2>
<section>
Expand Down
7 changes: 1 addition & 6 deletions packages/components/src/Header/Header.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { Meta, StoryObj } from '@storybook/react';
import { Container } from '../Container';
import { Header } from './Header';

const meta = {
Expand All @@ -24,9 +23,5 @@ export default meta;
type Story = StoryObj<typeof meta>;

export const Basic: Story = {
render: args => (
<Container contentType="content" size="medium">
<Header {...args}>Awsome Header</Header>
</Container>
),
render: args => <Header {...args}>Awsome Header</Header>,
};
82 changes: 39 additions & 43 deletions packages/components/src/Slider/Slider.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,27 +164,25 @@ export const Forms: Story = {
};

return (
<Container size={'large'}>
<Form onSubmit={handleSubmit}>
<FieldGroup labelWidth={'100px'}>
<Stack space={2}>
<FieldBase label="Choose opacity:">
<Slider
{...args}
maxValue={100}
thumbLabels={['opacity']}
width={48}
/>
</FieldBase>
</Stack>
</FieldGroup>
<Inline space={4} alignX={'right'}>
<Button variant="primary" type="submit">
Submit
</Button>
</Inline>
</Form>
</Container>
<Form onSubmit={handleSubmit}>
<FieldGroup labelWidth={'100px'}>
<Stack space={2}>
<FieldBase label="Choose opacity:">
<Slider
{...args}
maxValue={100}
thumbLabels={['opacity']}
width={48}
/>
</FieldBase>
</Stack>
</FieldGroup>
<Inline space={4} alignX={'right'}>
<Button variant="primary" type="submit">
Submit
</Button>
</Inline>
</Form>
);
},
};
Expand All @@ -200,28 +198,26 @@ export const MultiThumbsForm: Story = {
};

return (
<Container size={'large'}>
<Form onSubmit={handleSubmit}>
<FieldGroup labelWidth={'100px'}>
<Stack space={2}>
<FieldBase label="Age">
<Slider
{...args}
defaultValue={[20, 30]}
maxValue={100}
thumbLabels={['start', 'end']}
width={60}
/>
</FieldBase>
</Stack>
</FieldGroup>
<Inline space={4} alignX={'right'}>
<Button variant="primary" type="submit">
Submit
</Button>
</Inline>
</Form>
</Container>
<Form onSubmit={handleSubmit}>
<FieldGroup labelWidth={'100px'}>
<Stack space={2}>
<FieldBase label="Age">
<Slider
{...args}
defaultValue={[20, 30]}
maxValue={100}
thumbLabels={['start', 'end']}
width={60}
/>
</FieldBase>
</Stack>
</FieldGroup>
<Inline space={4} alignX={'right'}>
<Button variant="primary" type="submit">
Submit
</Button>
</Inline>
</Form>
);
},
};
Expand Down

0 comments on commit b6acc40

Please sign in to comment.