diff --git a/README.md b/README.md index b980398..3a435f8 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ Below is a list of the components available in this library. Each component has - [BBBAccordion](./src/components/Accordion/README.md) - [BBBAvatar](./src/components/Avatar/README.md) - [BBButton](./src/components/Button/README.md) +- [BBBButtonGroup](./src/components/ButtonGroup/README.md) - [BBBCheckbox](./src/components/Checkbox/README.md) - [BBBDivider](./src/components/Divider/README.md) - [BBBHint](./src/components/Hint/README.md) @@ -17,6 +18,7 @@ Below is a list of the components available in this library. Each component has - [BBBNavigation](./src/components/Navigation/README.md) - [BBBScrollArea](./src/components/ScrollArea/README.md) - [BBBSearch](./src/components/Search/README.md) +- [BBBSegmentedControl](./src/components/SegmentedControl/README.md) - [BBBSelect](./src/components/Select/README.md) - [BBBSlider](./src/components/Slider/README.md) - [BBBSpinner](./src/components/Spinner//README.md) diff --git a/package.json b/package.json index 45125f4..d5997da 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,13 @@ "require": "./dist/components/Button.js", "default": "./dist/components/Button.js" }, + "./ButtonGroup": { + "types": "./dist/types/components/ButtonGroup/index.d.ts", + "node": "./dist/components/ButtonGroup.js", + "import": "./dist/esm/components/ButtonGroup/index.js", + "require": "./dist/components/ButtonGroup.js", + "default": "./dist/components/ButtonGroup.js" + }, "./Checkbox": { "types": "./dist/types/components/Checkbox/index.d.ts", "node": "./dist/components/Checkbox.js", @@ -92,6 +99,13 @@ "require": "./dist/components/Search.js", "default": "./dist/components/Search.js" }, + "./SegmentedControl": { + "types": "./dist/types/components/SegmentedControl/index.d.ts", + "node": "./dist/components/SegmentedControl.js", + "import": "./dist/esm/components/SegmentedControl/index.js", + "require": "./dist/components/SegmentedControl.js", + "default": "./dist/components/SegmentedControl.js" + }, "./Select": { "types": "./dist/types/components/Select/index.d.ts", "node": "./dist/components/Select.js", diff --git a/src/components/Button/README.md b/src/components/Button/README.md index 674953b..7eddfd2 100644 --- a/src/components/Button/README.md +++ b/src/components/Button/README.md @@ -71,6 +71,25 @@ import { BBButton } from 'bbb-ui-components-react'; (console.log('clicked'))}/> ``` +### Toggle Button + +Set `pressed` to make the button a toggle. It renders `aria-pressed`, and while `true` the button keeps a selected fill through hover and press. Leave it unset for a plain button. For a set of options where exactly one is selected, use [`BBBSegmentedControl`](../SegmentedControl/README.md). + +```jsx +import { BBButton } from 'bbb-ui-components-react'; +import { MdMic, MdMicOff } from 'react-icons/md'; + +const [muted, setMuted] = useState(false); + + : } + onClick={() => setMuted(!muted)} +/> +``` + ### Long Labels `labelOverflow` sets what happens when the label doesn't fit the button's available width, for example a `fullWidth` button in a narrow container or a row of equal-width buttons. It has no visible effect while the label fits. @@ -124,6 +143,7 @@ const FooterButton = styled(BBButton)` | `layout` | `keyof typeof LAYOUTS` | `'default'` | The layout of the button. | | `type` | `'button' \| 'submit' \| 'reset'` | `'button'` | The native `type` attribute of the `