-
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
38082d4
commit ba3b566
Showing
29 changed files
with
430 additions
and
75 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@saas-ui/react': patch | ||
--- | ||
|
||
Improved Sidebar contrast |
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,5 @@ | ||
--- | ||
'@saas-ui/react': patch | ||
--- | ||
|
||
Improved focusRing styles |
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,5 @@ | ||
--- | ||
'@saas-ui/react': patch | ||
--- | ||
|
||
Added SegmentControl stories and made sizing consistent with buttons |
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,5 @@ | ||
--- | ||
'@saas-ui/react': patch | ||
--- | ||
|
||
Sidebar.Button now renders a div with role="button" |
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
185 changes: 185 additions & 0 deletions
185
packages/saas-ui-react/src/components/card/card.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,185 @@ | ||
import React from 'react' | ||
|
||
import { | ||
Group, | ||
Heading, | ||
Icon, | ||
IconButton, | ||
Image, | ||
LinkBox, | ||
LinkOverlay, | ||
SimpleGrid, | ||
Spacer, | ||
Text, | ||
} from '@chakra-ui/react' | ||
import { Meta, StoryObj } from '@storybook/react' | ||
import { FaGithub, FaSlack, FaXTwitter } from 'react-icons/fa6' | ||
import { LuArrowRight, LuMoreVertical } from 'react-icons/lu' | ||
|
||
import { Avatar } from '#components/avatar/avatar.js' | ||
|
||
import { Button } from '../button/index.ts' | ||
import { Persona } from '../persona/index.ts' | ||
import { Card } from './index.ts' | ||
|
||
export default { | ||
title: 'Components/Card', | ||
component: Card.Root, | ||
tags: ['autodocs'], | ||
} satisfies Meta | ||
|
||
type Story = StoryObj<typeof Card> | ||
|
||
export const Media = () => ( | ||
<> | ||
<Card.Root maxW="400px" position="relative" overflow="clip"> | ||
<Card.Header | ||
flexDirection="row" | ||
position="absolute" | ||
top="0" | ||
left="0" | ||
right="0" | ||
backdropFilter="blur(10px)" | ||
className="dark" | ||
> | ||
<Persona | ||
name="Eelco Wiersma" | ||
secondaryLabel="South Tirol, Italy" | ||
size="sm" | ||
flex="1" | ||
/> | ||
<IconButton | ||
aria-label="More" | ||
size="sm" | ||
variant="ghost" | ||
alignSelf="flex-start" | ||
> | ||
<LuMoreVertical /> | ||
</IconButton> | ||
</Card.Header> | ||
<Image height="256px" src="/mountains.jpg" objectFit="cover" /> | ||
<Card.Body | ||
position="absolute" | ||
bottom="0" | ||
left="0" | ||
right="0" | ||
bgGradient="to-t" | ||
gradientFrom="black" | ||
gradientTo="transparent" | ||
height="140px" | ||
justifyContent="flex-end" | ||
> | ||
<Group> | ||
<Text flex="1" textStyle="sm" color="fg.inverted"> | ||
South Tirol | ||
</Text> | ||
<Button variant="solid" colorPalette="accent" size="sm"> | ||
Book now | ||
</Button> | ||
</Group> | ||
</Card.Body> | ||
</Card.Root> | ||
</> | ||
) | ||
|
||
export const Outline = () => ( | ||
<SimpleGrid columns={[1, null, 2]} gap="2"> | ||
<Card.Root variant="outline"> | ||
<Card.Header> | ||
<Icon me="2" boxSize="6"> | ||
<FaGithub /> | ||
</Icon> | ||
<Heading size="md">Github</Heading> | ||
</Card.Header> | ||
<Card.Body> | ||
<Text color="fg.muted" textStyle="md"> | ||
Link pull requests | ||
</Text> | ||
</Card.Body> | ||
<Card.Footer> | ||
<Group> | ||
<Button colorScheme="gray" variant="surface"> | ||
Enable | ||
</Button> | ||
<Button variant="ghost">Learn more</Button> | ||
</Group> | ||
</Card.Footer> | ||
</Card.Root> | ||
<Card.Root variant="outline"> | ||
<Card.Header> | ||
<Icon me="2" boxSize="6"> | ||
<FaSlack /> | ||
</Icon> | ||
<Heading size="md">Slack</Heading> | ||
</Card.Header> | ||
<Card.Body> | ||
<Text color="fg.muted" textStyle="md"> | ||
Send push notifications | ||
</Text> | ||
</Card.Body> | ||
<Card.Footer> | ||
<Group> | ||
<Button colorScheme="gray" variant="surface"> | ||
Enable | ||
</Button> | ||
<Button variant="ghost">Learn more</Button> | ||
</Group> | ||
</Card.Footer> | ||
</Card.Root> | ||
</SimpleGrid> | ||
) | ||
|
||
export const Footer = () => ( | ||
<Card.Root colorPalette="accent" variant="subtle" maxW="xl"> | ||
<Card.Header> | ||
<Card.Title>Getting started</Card.Title> | ||
</Card.Header> | ||
<Card.Body> | ||
<Text textStyle="md"> | ||
Welcome to Saas UI, in the next steps we will walk you through all the | ||
basic features of Saas UI. | ||
</Text> | ||
</Card.Body> | ||
<Card.Footer> | ||
<Group> | ||
<Button variant="solid" colorPalette="accent"> | ||
Continue | ||
</Button> | ||
<Button variant="ghost">Dismiss</Button> | ||
</Group> | ||
</Card.Footer> | ||
</Card.Root> | ||
) | ||
|
||
export const Interactive = () => ( | ||
<Card.Root asChild width="100%" maxW="400px" role="button" variant="elevated"> | ||
<LinkBox> | ||
<Card.Header> | ||
<Avatar src="/chakra-ui-logomark-colored.svg" size="sm" me="2" /> | ||
<LinkOverlay href="#"> | ||
<Heading size="sm">Chakra UI</Heading> | ||
</LinkOverlay> | ||
</Card.Header> | ||
<Card.Body> | ||
<Text fontSize="md" color="muted"> | ||
Chakra UI is a simple, modular and accessible component library that | ||
gives you the building blocks you need to build your React | ||
applications. | ||
</Text> | ||
</Card.Body> | ||
<Card.Footer> | ||
<Button variant="plain" _parentHover={{ colorPalette: 'teal' }}> | ||
Learn more | ||
<Icon | ||
transform="translateX(-5px)" | ||
transitionProperty="common" | ||
transitionDuration="moderate" | ||
css={{ _parentHover: { transform: 'translateX(0)' } }} | ||
> | ||
<LuArrowRight /> | ||
</Icon> | ||
</Button> | ||
</Card.Footer> | ||
</LinkBox> | ||
</Card.Root> | ||
) |
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 @@ | ||
export { Card } from '@chakra-ui/react' |
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
25 changes: 25 additions & 0 deletions
25
packages/saas-ui-react/src/components/segmented-control/segmented-control.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,25 @@ | ||
import { Meta, StoryObj } from '@storybook/react' | ||
|
||
import { SegmentedControl } from './index.ts' | ||
|
||
export default { | ||
title: 'Components/Segmented Control', | ||
component: SegmentedControl, | ||
} satisfies Meta | ||
|
||
type Story = StoryObj<typeof SegmentedControl> | ||
|
||
export const Default: Story = { | ||
args: { | ||
defaultValue: 'One', | ||
items: ['One', 'Two', 'Three'], | ||
}, | ||
} | ||
|
||
export const Small: Story = { | ||
args: { | ||
defaultValue: 'One', | ||
items: ['One', 'Two', 'Three'], | ||
size: 'sm', | ||
}, | ||
} |
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 |
---|---|---|
@@ -1,9 +1,18 @@ | ||
import { createSystem, defaultBaseConfig, mergeConfigs } from '@chakra-ui/react' | ||
|
||
import { defaultThemeConfig } from './theme' | ||
import { utilities } from './theme/utilities.ts' | ||
|
||
export const defaultConfig = mergeConfigs(defaultBaseConfig, defaultThemeConfig) | ||
const defaultConfig = mergeConfigs(defaultBaseConfig, defaultThemeConfig) | ||
|
||
/** | ||
* TODO: This is a temporary fix to add the utilities to the default config. | ||
*/ | ||
defaultConfig.utilities = Object.assign( | ||
defaultConfig.utilities ?? {}, | ||
utilities, | ||
) | ||
|
||
export const defaultSystem = createSystem(defaultConfig) | ||
|
||
export { defaultSystem as system } | ||
export { defaultSystem as system, defaultConfig } |
Oops, something went wrong.