Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
samithaf committed Jan 31, 2024
2 parents 59d3008 + 782a8de commit 623add0
Show file tree
Hide file tree
Showing 52 changed files with 1,144 additions and 706 deletions.
7 changes: 7 additions & 0 deletions apps/site/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# site

## 0.1.2

### Patch Changes

- Updated dependencies [e3e94d1]
- @westpac/ui@0.15.0

## 0.1.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/site/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "site",
"version": "0.1.1",
"version": "0.1.2",
"private": true,
"scripts": {
"build": "next build",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,23 @@ The button dropdown menus come in three sizes or widths. They are triggered by t
<div className="flex gap-1">
<ButtonDropdown text="Checkboxes" look="primary">
<ButtonDropdownHeading>Checkboxes</ButtonDropdownHeading>
<CheckboxGroup defaultValue={['Option 1']}>
<CheckboxGroupCheckbox value="Option 1">Option 1</CheckboxGroupCheckbox>
<CheckboxGroupCheckbox value="Option 2">Option 2</CheckboxGroupCheckbox>
<CheckboxGroupCheckbox value="Option 3">Option 3</CheckboxGroupCheckbox>
</CheckboxGroup>
<CheckboxGroup
defaultValue={['Option 1']}
checkboxes={[
{ value: "Option 1", label: "Option 1" },
{ value: "Option 2", label: "Option 2" },
{ value: "Option 3", label: "Option 3" },
]}
/>
<ButtonDropdownHeading>Options</ButtonDropdownHeading>
<CheckboxGroup defaultValue={['Option 1']}>
<CheckboxGroupCheckbox value="Option 1">Option 1</CheckboxGroupCheckbox>
<CheckboxGroupCheckbox value="Option 2">Option 2</CheckboxGroupCheckbox>
<CheckboxGroupCheckbox value="Option 3">Option 3</CheckboxGroupCheckbox>
</CheckboxGroup>
<CheckboxGroup
defaultValue={['Option 1']}
checkboxes={[
{ value: "Option 1", label: "Option 1" },
{ value: "Option 2", label: "Option 2" },
{ value: "Option 3", label: "Option 3" },
]}
/>
</ButtonDropdown>

<ButtonDropdown text="Switches" look="primary">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
### ButtonGroup sizes

```jsx
<ButtonGroup>
<ButtonGroupButton value="Left">Left</ButtonGroupButton>
<ButtonGroupButton value="Middle">Middle</ButtonGroupButton>
<ButtonGroupButton value="Right">Right</ButtonGroupButton>
</ButtonGroup>
<ButtonGroup
buttons={[
{ value: "Left", label: "Left"},
{ value: "Middle", label: "Middle" },
{ value: "Right", label: "Right"}
]}
/>

```

### ButtonGroup looks
Expand All @@ -15,19 +18,21 @@
<ButtonGroup
defaultValue={0}
label={<p className="typography-body-10 text-muted italic mb-[0.875rem]">Index (integer)</p>}
>
<ButtonGroupButton value={0}>Left</ButtonGroupButton>
<ButtonGroupButton value={1}>Middle</ButtonGroupButton>
<ButtonGroupButton value={2}>Right</ButtonGroupButton>
</ButtonGroup>
buttons={[
{ value: 0, label: "Left" },
{ value: 1, label: "Middle" },
{ value: 2, label: "Right"}
]}
/>
<ButtonGroup
defaultValue="right"
label={<p className="typography-body-10 text-muted italic mb-[0.875rem]">Key (string)</p>}
>
<ButtonGroupButton value="left">Left</ButtonGroupButton>
<ButtonGroupButton value="middle">Middle</ButtonGroupButton>
<ButtonGroupButton value="right">Right</ButtonGroupButton>
</ButtonGroup>
buttons={[
{ value: "left", label: "Left" },
{ value: "middle", label: "Middle" },
{ value: "right", label: "Right"}
]}
/>
</div>
```

Expand All @@ -53,11 +58,15 @@
reset
</Button>
</div>
<ButtonGroup look="hero" value={controlled}>
<ButtonGroupButton value="yes">Yes</ButtonGroupButton>
<ButtonGroupButton value="maybe">Maybe</ButtonGroupButton>
<ButtonGroupButton value="no">No</ButtonGroupButton>
</ButtonGroup>
<ButtonGroup
look="hero"
value={controlled}
buttons={[
{ value: "yes", label: "Yes"},
{ value: "maybe", label: "Maybe" },
{ value: "no", label: "No"}
]}
/>
</div>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,72 @@

```tsx
<div className="grid gap-3">
<ButtonGroup size="small">
<ButtonGroupButton value="sm">Sm - 30px</ButtonGroupButton>
<ButtonGroupButton value="Label">Label</ButtonGroupButton>
</ButtonGroup>
<ButtonGroup size="medium">
<ButtonGroupButton value="md">Md - 36px</ButtonGroupButton>
<ButtonGroupButton value="Label">Label</ButtonGroupButton>
</ButtonGroup>
<ButtonGroup size="large">
<ButtonGroupButton value="lg">Lg - 42px</ButtonGroupButton>
<ButtonGroupButton value="Label">Label</ButtonGroupButton>
</ButtonGroup>
<ButtonGroup size="xlarge">
<ButtonGroupButton value="xl">Xl - 48px</ButtonGroupButton>
<ButtonGroupButton value="Label">Label</ButtonGroupButton>
</ButtonGroup>
<ButtonGroup
size="small"
buttons={[
{ value: "sm", label: "Sm - 30px"},
{ value: "Label", label: "Label" }
]}
/>
<ButtonGroup
size="medium"
buttons={[
{ value: "md", label: "Md - 36px"},
{ value: "Label", label: "Label" }
]}
/>
<ButtonGroup
size="large"
buttons={[
{ value: "lg", label: "Lg - 42px"},
{ value: "Label", label: "Label" }
]}
/>
<ButtonGroup
size="xlarge"
buttons={[
{ value: "xl", label: "Xl - 48px"},
{ value: "Label", label: "Label" }
]}
/>
</div>
```

**Multiple items:** We recommend only using up to 3 items in a button group, any more can become too difficult to scan and can become problematic at smaller viewports. Is also best to keep the labels short.

```tsx
<div className="grid gap-3">
<ButtonGroup look="hero">
<ButtonGroupButton value="Yes">Yes</ButtonGroupButton>
<ButtonGroupButton value="No">No</ButtonGroupButton>
</ButtonGroup>
<ButtonGroup look="hero">
<ButtonGroupButton value="Email">Email</ButtonGroupButton>
<ButtonGroupButton value="Phone">Phone</ButtonGroupButton>
<ButtonGroupButton value="SMS">SMS</ButtonGroupButton>
</ButtonGroup>
<ButtonGroup
look="hero"
buttons={[
{ value: "Yes", label: "Yes"},
{ value: "No", label: "No" }
]}
/>

<ButtonGroup
look="hero"
buttons={[
{ value: "Email", label: "Email"},
{ value: "Phone", label: "Phone" },
{ value: "SMS", label: "SMS" }
]}
/>
</div>
```

**Block level:** Using block level button groups will allow the group to stretch the full width of the view port. This is useful for smaller viewports.

```jsx
<div className="grid gap-3">
<ButtonGroup look="hero" block>
<ButtonGroupButton value="Email">Email</ButtonGroupButton>
<ButtonGroupButton value="Phone">Phone</ButtonGroupButton>
<ButtonGroupButton value="Label">Label</ButtonGroupButton>
</ButtonGroup>
<ButtonGroup
look="hero"
block
buttons={[
{ value: "Email", label: "Email"},
{ value: "Phone", label: "Phone" },
{ value: "SMS", label: "SMS" }
]}
/>
</div>
```
Loading

0 comments on commit 623add0

Please sign in to comment.