-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ProgressBottomBar): new component
fix(TextEditor): readOnly refresh feat(ComputerKeyboardNext): change SVG fix(Accordion): set hover color to transparent
- Loading branch information
1 parent
fdbee7f
commit 1b25ecc
Showing
13 changed files
with
247 additions
and
26 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
40 changes: 40 additions & 0 deletions
40
packages/components/src/informative/ProgressBottomBar/ProgressBottomBar.constants.js
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,40 @@ | ||
import propTypes from 'prop-types'; | ||
|
||
export const PROGRESSBOTTOMBAR_RADIUS = ['xs', 'sm', 'md', 'lg', 'xl']; | ||
export const PROGRESSBOTTOMBAR_SIZES = ['xs', 'sm', 'md', 'lg', 'xl']; | ||
|
||
// SECTIONS PROP EXAMPLE | ||
// If you want to use sections prop, you need to pass an array of objects with value, color and label keys. | ||
// only value and color keys are required. | ||
// | ||
// sections={[ | ||
// { value: 33, color: 'pink', label: 'Documents', tooltip: 'Document – 33 Gb' }, | ||
// { value: 28, color: 'grape', label: 'Apps', tooltip: 'Apps – 28 Gb' }, | ||
// { value: 25, color: 'violet', label: 'Other', tooltip: 'Other – 25 Gb' }, | ||
// ]} | ||
|
||
export const PROGRESSBOTTOMBAR_DEFAULT_PROPS = { | ||
animate: false, | ||
color: 'orange', | ||
label: '', | ||
labelLeft: 'labelLeft', | ||
labelRight: 'LabelRight', | ||
radius: 'lg', | ||
sections: null, | ||
size: 'sm', | ||
striped: false, | ||
value: 100, | ||
}; | ||
|
||
export const PROGRESSBOTTOMBAR_PROP_TYPES = { | ||
animate: propTypes.bool, | ||
color: propTypes.string, | ||
label: propTypes.string, | ||
labelLeft: propTypes.string, | ||
labelRight: propTypes.string, | ||
radius: propTypes.oneOf(PROGRESSBOTTOMBAR_RADIUS), | ||
sections: propTypes.array, | ||
size: propTypes.oneOf(PROGRESSBOTTOMBAR_SIZES), | ||
striped: propTypes.bool, | ||
value: propTypes.number, | ||
}; |
48 changes: 48 additions & 0 deletions
48
packages/components/src/informative/ProgressBottomBar/ProgressBottomBar.js
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,48 @@ | ||
import React from 'react'; | ||
import { Progress as MantineProgress } from '@mantine/core'; | ||
import { Box, Text } from '@bubbles-ui/components'; | ||
import { | ||
PROGRESSBOTTOMBAR_DEFAULT_PROPS, | ||
PROGRESSBOTTOMBAR_PROP_TYPES, | ||
} from './ProgressBottomBar.constants'; | ||
import { ProgressBottomBarStyles } from './ProgressBottomBar.styles'; | ||
|
||
const ProgressBottomBar = ({ | ||
animate, | ||
label, | ||
labelTop, | ||
color, | ||
radius, | ||
sections, | ||
size, | ||
striped, | ||
value, | ||
}) => { | ||
const { classes, theme } = ProgressBottomBarStyles(); | ||
return ( | ||
<Box> | ||
{labelTop && ( | ||
<Box className={classes.topLabelContainer}> | ||
<Text className={classes.labelTop}>{labelTop}</Text> | ||
</Box> | ||
)} | ||
<MantineProgress | ||
value={value} | ||
label={label} | ||
color={'#4D5358'} | ||
animate={animate} | ||
radius={radius} | ||
sections={sections} | ||
size={size} | ||
striped={striped} | ||
/> | ||
</Box> | ||
); | ||
}; | ||
|
||
ProgressBottomBar.propTypes = PROGRESSBOTTOMBAR_PROP_TYPES; | ||
ProgressBottomBar.defaultProps = PROGRESSBOTTOMBAR_DEFAULT_PROPS; | ||
ProgressBottomBar.displayName = 'ProgressBottomBar'; | ||
|
||
export { ProgressBottomBar }; | ||
export default ProgressBottomBar; |
32 changes: 32 additions & 0 deletions
32
packages/components/src/informative/ProgressBottomBar/ProgressBottomBar.mdx
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,32 @@ | ||
import { Story, Props, Source, Preview } from '@storybook/addon-docs'; | ||
import * as stories from './ProgressBottomBar.stories.js'; | ||
import { ProgressBottomBar } from './ProgressBottomBar.js'; | ||
import { ThemeProvider } from './../../ThemeProvider'; | ||
|
||
# ChatMessage | ||
|
||
[Source code](https://github.com/leemonade/bubbles/tree/main/packages/components/src/informative/ChatMessage/ChatMessage.js) | ||
|
||
## Table of Contents | ||
|
||
<!-- START doctoc generated TOC please keep comment here to allow auto update --> | ||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | ||
|
||
- [Overview](#overview) | ||
{/* - [ProgessColorBar options](#ProgessColorBar-options) */} | ||
- [Component API](#component-api) | ||
- [Feedback](#feedback) | ||
|
||
## Overview | ||
|
||
ChatMessage is a component used to display a message from an user. | ||
|
||
|
||
## ChatMessage options | ||
|
||
|
||
|
||
## Feedback | ||
|
||
Help us improve this component by providing feedback, asking questions on Slack, or updating this file on | ||
[GitHub](https://github.com/leemonade/bubbles/edit/main/packages/components/src/informative/ProgressBottomBar/ProgressBottomBar.mdx) |
82 changes: 82 additions & 0 deletions
82
packages/components/src/informative/ProgressBottomBar/ProgressBottomBar.stories.js
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,82 @@ | ||
import React from 'react'; | ||
import { ProgressBottomBar } from './ProgressBottomBar'; | ||
import mdx from './ProgressBottomBar.mdx'; | ||
import { Box } from '../../layout'; | ||
import { PROGRESSBOTTOMBAR_RADIUS, PROGRESSBOTTOMBAR_SIZES } from './ProgressBottomBar.constants'; | ||
|
||
export default { | ||
title: 'Atoms/Informative/ProgressBottomBar', | ||
parameters: { | ||
component: ProgressBottomBar, | ||
docs: { | ||
page: mdx, | ||
}, | ||
design: { | ||
type: 'figma', | ||
// url: 'https://www.figma.com/file/c3MWm2gVHU4JfYlVfr5VvB/🍋💧-Bubbles-SD-v2?node-id=3639%3A28963', | ||
}, | ||
}, | ||
argTypes: { | ||
animate: { | ||
control: { | ||
type: 'boolean', | ||
}, | ||
}, | ||
color: { | ||
control: { | ||
type: 'color', | ||
}, | ||
}, | ||
radius: { | ||
control: { | ||
type: 'select', | ||
options: PROGRESSBOTTOMBAR_RADIUS, | ||
}, | ||
}, | ||
size: { | ||
control: { | ||
type: 'select', | ||
options: PROGRESSBOTTOMBAR_SIZES, | ||
}, | ||
}, | ||
striped: { | ||
control: { | ||
type: 'boolean', | ||
}, | ||
}, | ||
label: { | ||
control: { | ||
type: 'text', | ||
}, | ||
}, | ||
labelLeft: { | ||
control: { | ||
type: 'text', | ||
}, | ||
}, | ||
labelRight: { | ||
control: { | ||
type: 'text', | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
const Template = ({ ...props }) => ( | ||
<Box style={{ maxWidth: '300px' }}> | ||
<ProgressBottomBar {...props} /> | ||
</Box> | ||
); | ||
|
||
export const Playground = Template.bind({}); | ||
|
||
Playground.args = { | ||
animate: false, | ||
value: 50, | ||
size: 'lg', | ||
radius: 'lg', | ||
striped: false, | ||
color: 'orange', | ||
label: '', | ||
labelTop: 'labelTop', | ||
}; |
16 changes: 16 additions & 0 deletions
16
packages/components/src/informative/ProgressBottomBar/ProgressBottomBar.styles.js
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,16 @@ | ||
import { createStyles } from '@mantine/styles'; | ||
import { pxToRem } from '../../theme.mixins'; | ||
|
||
const ProgressBottomBarStyles = createStyles((theme) => ({ | ||
topLabelContainer: { | ||
display: 'flex', | ||
justifyContent: 'center', | ||
marginBottom: pxToRem(8), | ||
}, | ||
labelTop: { | ||
color: theme.other.progress.content.color.text, | ||
...theme.other.progress.content.typo, | ||
}, | ||
})); | ||
|
||
export { ProgressBottomBarStyles }; |
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 * from './ProgressBottomBar'; |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.