Skip to content

Commit

Permalink
Merge branch 'main' into refactor/12555-select-typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] committed Mar 6, 2023
2 parents 5acfa7f + 2e528c0 commit 090b73d
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 20 deletions.
12 changes: 2 additions & 10 deletions packages/react/src/components/Dropdown/Dropdown.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Playground.argTypes = {
control: {
type: 'text',
},
defaultValue: 'this is an example label',
defaultValue: 'This is an example label',
},
warn: {
control: {
Expand All @@ -139,7 +139,7 @@ Playground.argTypes = {
control: {
type: 'text',
},
defaultValue: 'this is an example title',
defaultValue: 'This is an example title',
},
size: {
options: ['sm', 'md', 'lg'],
Expand All @@ -158,7 +158,6 @@ export const Default = () => (
id="default"
titleText="Dropdown label"
helperText="This is some helper text"
initialSelectedItem={items[0]}
label="Dropdown menu options"
items={items}
itemToString={(item) => (item ? item.text : '')}
Expand All @@ -171,7 +170,6 @@ export const Inline = () => (
<Dropdown
id="inline"
titleText="Inline dropdown label"
initialSelectedItem={items[0]}
label="Dropdown menu options"
type="inline"
items={items}
Expand All @@ -186,7 +184,6 @@ export const WithLayer = () => (
id="default"
titleText="First Layer"
helperText="This is some helper text"
initialSelectedItem={items[0]}
label="Dropdown menu options"
items={items}
itemToString={(item) => (item ? item.text : '')}
Expand All @@ -196,7 +193,6 @@ export const WithLayer = () => (
id="default"
titleText="Second Layer"
helperText="This is some helper text"
initialSelectedItem={items[0]}
label="Dropdown menu options"
items={items}
itemToString={(item) => (item ? item.text : '')}
Expand All @@ -206,7 +202,6 @@ export const WithLayer = () => (
id="default"
titleText="Third Layer"
helperText="This is some helper text"
initialSelectedItem={items[0]}
label="Dropdown menu options"
items={items}
itemToString={(item) => (item ? item.text : '')}
Expand All @@ -221,7 +216,6 @@ export const InlineWithLayer = () => (
<Dropdown
id="inline"
titleText="First Layer"
initialSelectedItem={items[0]}
label="Dropdown menu options"
type="inline"
items={items}
Expand All @@ -231,7 +225,6 @@ export const InlineWithLayer = () => (
<Dropdown
id="inline"
titleText="Second Layer"
initialSelectedItem={items[0]}
label="Dropdown menu options"
type="inline"
items={items}
Expand All @@ -241,7 +234,6 @@ export const InlineWithLayer = () => (
<Dropdown
id="inline"
titleText="Third Layer"
initialSelectedItem={items[0]}
label="Dropdown menu options"
type="inline"
items={items}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,10 @@ const FilterableMultiSelect = React.forwardRef(function FilterableMultiSelect(
event.stopPropagation();
}

if (match(event, keys.Enter)) {
handleOnMenuChange(true);
}

if (!disabled) {
if (match(event, keys.Delete) || match(event, keys.Escape)) {
if (isOpen) {
Expand Down
4 changes: 4 additions & 0 deletions packages/react/src/components/MultiSelect/MultiSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,10 @@ const MultiSelect = React.forwardRef(function MultiSelect<ItemType>(
clearSelection();
e.stopPropagation();
}

if (match(e, keys.Space) || match(e, keys.ArrowDown)) {
setIsOpenWrapper(true);
}
}
};

Expand Down
21 changes: 19 additions & 2 deletions packages/react/src/components/Tabs/Tabs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@ import { Tabs, TabList, Tab, TabPanels, TabPanel } from './Tabs';

- [Overview](#overview)
- [Line Tabs](#line-tabs)
- [Container Tabs](#container-tabs)
- [Contained Tabs](#contained-tabs)
- [Icon Tabs](#icon-tabs)
- [Component API](#component-api)
- [Tab `renderContent`](#tab-rendercontent)
- [Tab - render content on click](#tab---render-content-on-click)
- [V11](#v11)
- [Tabs composition](#tabs-composition)
- [Various updates](#various-updates)
- [Max width](#max-width)
- [Feedback](#feedback)

## Overview
Expand Down Expand Up @@ -144,6 +149,18 @@ minor tweaks in naming or implementation.
- Because `renderButton` is no longer needed, the associated `tabIndex` prop has
also been deprecated.

### Max width

In V11, tabs no longer have a max-width property set. Which means a tab title
can span as wide as long it's title is. To override this behavior, you may use
some style rules:

```css
.cds--tabs__nav-link {
max-width: 10rem;
}
```

## Feedback

Help us improve this component by providing feedback, asking questions on Slack,
Expand Down
10 changes: 3 additions & 7 deletions packages/react/src/components/Tabs/Tabs.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const Default = () => (
<Tab>Tab Label 1</Tab>
<Tab>Tab Label 2</Tab>
<Tab disabled>Tab Label 3</Tab>
<Tab>Tab Label 4 with a very long long label</Tab>
<Tab>Tab Label 4</Tab>
</TabList>
<TabPanels>
<TabPanel>Tab Panel 1</TabPanel>
Expand Down Expand Up @@ -77,9 +77,7 @@ export const Manual = () => (
<Tab>Tab Label 1</Tab>
<Tab>Tab Label 2</Tab>
<Tab disabled>Tab Label 3</Tab>
<Tab title="Tab Label 4 with a very long long label">
Tab Label 4 with a very long long label
</Tab>
<Tab title="Tab Label 4">Tab Label 4</Tab>
<Tab>Tab Label 5</Tab>
</TabList>
<TabPanels>
Expand Down Expand Up @@ -156,9 +154,7 @@ export const Contained = () => (
<Tab>Tab Label 1</Tab>
<Tab>Tab Label 2</Tab>
<Tab disabled>Tab Label 3</Tab>
<Tab title="Tab Label 4 with a very long long title">
Tab Label 4 with a very long long title
</Tab>
<Tab title="Tab Label 4">Tab Label 4</Tab>
<Tab>Tab Label 5</Tab>
</TabList>
<TabPanels>
Expand Down
1 change: 0 additions & 1 deletion packages/styles/scss/components/tabs/_tabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ $icon-tab-size: custom-property.get-var('icon-tab-size', rem(40px));
}

overflow: hidden;
max-width: 10rem;
padding: $spacing-04 $spacing-05 $spacing-03;
border-bottom: $tab-underline-color;
color: $text-secondary;
Expand Down

0 comments on commit 090b73d

Please sign in to comment.