Skip to content

Commit

Permalink
Add Progress to config
Browse files Browse the repository at this point in the history
  • Loading branch information
lialila committed Feb 28, 2024
1 parent 0786483 commit 57cfac5
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/constants/componentCustomizations.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import React from 'react';
import { CaretDown } from '@phosphor-icons/react';

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

export const CustomizedHeading = {
baseStyle: {
fontWeight: 'semibold',
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
42 changes: 42 additions & 0 deletions src/stories/components/Progress.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
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' } },
},
} as Meta<typeof Progress>;

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

// const defaultArgs = {
// value: 50,
// size: 'md',
// borderRadius: 'full',
// width: 'sm',
// };
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 57cfac5

Please sign in to comment.