Skip to content

Commit

Permalink
feat(Progress): Export Progress from chakra-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
lialila committed Feb 28, 2024
1 parent 0786483 commit 3f91329
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/constants/componentCustomizations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,14 @@ export const CustomizedPinInput = {
},
};

export const CustomizedProgress = {
baseStyle: {
track: {
borderRadius: 'full',
},
},
};

export const CustomizedTextarea = {
sizes: {
xl: {
Expand Down
1 change: 1 addition & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export {
MenuButton,
MenuList,
MenuItem,
Progress,
Select,
SimpleGrid,
Spacer,
Expand Down
40 changes: 40 additions & 0 deletions src/stories/components/Progress.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import React from 'react';
import { Meta, StoryFn } from '@storybook/react';

import { Progress } from '../..';
import { COLOR_SCHEMES } from '../../constants/colorSchemes';

export default {
title: 'Components/Progress',
component: Progress,
argTypes: {
size: { options: ['xs', 'sm', 'md', 'lg'], control: { type: 'radio' } },
colorScheme: {
options: COLOR_SCHEMES,
control: { type: 'radio' },
},
hasStripe: { control: { type: 'boolean' } },
},
args: {
width: 'sm',
value: 60,
},
} as Meta<typeof Progress>;

const Template: StoryFn<typeof Progress> = (args) => <Progress {...args} />;

export const Primary = Template.bind({});
Primary.args = {
colorScheme: 'primary',
};

export const ColorScheme = Template.bind({});
ColorScheme.args = {
colorScheme: 'red',
};

export const WithStripe = Template.bind({});
WithStripe.args = {
colorScheme: 'primary',
hasStripe: true,
};
2 changes: 2 additions & 0 deletions src/utils/getTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
CustomizedList,
CustomizedNumberInput,
CustomizedPinInput,
CustomizedProgress,
CustomizedSelect,
CustomizedTable,
CustomizedText,
Expand Down Expand Up @@ -62,6 +63,7 @@ const getTheme = ({ customColors, customFonts, customRadii }: Options) => {
List: CustomizedList,
NumberInput: CustomizedNumberInput,
PinInput: CustomizedPinInput,
Progress: CustomizedProgress,
Select: CustomizedSelect,
Table: CustomizedTable,
Text: CustomizedText,
Expand Down

0 comments on commit 3f91329

Please sign in to comment.