@kaizen/components 1.70.0 → 1.70.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Filter/FilterBar/subcomponents/AddFiltersMenu/AddFiltersMenu.cjs +1 -1
- package/dist/esm/Filter/FilterBar/subcomponents/AddFiltersMenu/AddFiltersMenu.mjs +1 -1
- package/dist/styles.css +8589 -8589
- package/package.json +1 -1
- package/src/Filter/FilterBar/FilterBar.spec.tsx +10 -10
- package/src/Filter/FilterBar/subcomponents/AddFiltersMenu/AddFiltersMenu.spec.tsx +3 -3
- package/src/Filter/FilterBar/subcomponents/AddFiltersMenu/AddFiltersMenu.tsx +1 -1
- package/src/Notification/subcomponents/GenericNotification/GenericNotification.module.scss +2 -2
- package/src/Tag/_docs/Tag.mdx +1 -1
- package/src/__rc__/Menu/_docs/{Menu.mdx → Menu--usage-guidelines.mdx} +9 -6
- package/src/__rc__/Tooltip/_docs/Tooltip.mdx +2 -2
- /package/src/__rc__/Menu/_docs/{ApiSpecification.mdx → Menu--api-specification.mdx} +0 -0
package/package.json
CHANGED
|
@@ -196,7 +196,7 @@ describe('<FilterBar />', () => {
|
|
|
196
196
|
|
|
197
197
|
expect(queryByText('Topping')).not.toBeInTheDocument()
|
|
198
198
|
|
|
199
|
-
const addFiltersButton = getByRole('button', { name: 'Add
|
|
199
|
+
const addFiltersButton = getByRole('button', { name: 'Add filters' })
|
|
200
200
|
await user.click(addFiltersButton)
|
|
201
201
|
|
|
202
202
|
const list = getByRole('list')
|
|
@@ -228,7 +228,7 @@ describe('<FilterBar />', () => {
|
|
|
228
228
|
)
|
|
229
229
|
await waitForI18nContent()
|
|
230
230
|
|
|
231
|
-
const addFiltersButton = getByRole('button', { name: 'Add
|
|
231
|
+
const addFiltersButton = getByRole('button', { name: 'Add filters' })
|
|
232
232
|
await user.click(addFiltersButton)
|
|
233
233
|
|
|
234
234
|
const list = getByRole('list')
|
|
@@ -255,7 +255,7 @@ describe('<FilterBar />', () => {
|
|
|
255
255
|
expect(filterButton).not.toBeInTheDocument()
|
|
256
256
|
})
|
|
257
257
|
|
|
258
|
-
const addFiltersButton = getByRole('button', { name: 'Add
|
|
258
|
+
const addFiltersButton = getByRole('button', { name: 'Add filters' })
|
|
259
259
|
await user.click(addFiltersButton)
|
|
260
260
|
|
|
261
261
|
const list = getByRole('list')
|
|
@@ -282,7 +282,7 @@ describe('<FilterBar />', () => {
|
|
|
282
282
|
)
|
|
283
283
|
await waitForI18nContent()
|
|
284
284
|
|
|
285
|
-
const addFiltersButton = getByRole('button', { name: 'Add
|
|
285
|
+
const addFiltersButton = getByRole('button', { name: 'Add filters' })
|
|
286
286
|
await user.click(addFiltersButton)
|
|
287
287
|
|
|
288
288
|
const menuOptionIceLevel = getByRole('button', { name: 'Ice Level' })
|
|
@@ -314,7 +314,7 @@ describe('<FilterBar />', () => {
|
|
|
314
314
|
)
|
|
315
315
|
await waitForI18nContent()
|
|
316
316
|
|
|
317
|
-
const addFiltersButton = getByRole('button', { name: 'Add
|
|
317
|
+
const addFiltersButton = getByRole('button', { name: 'Add filters' })
|
|
318
318
|
await user.click(addFiltersButton)
|
|
319
319
|
|
|
320
320
|
const menuOptionIceLevel = getByRole('button', { name: 'Ice Level' })
|
|
@@ -327,7 +327,7 @@ describe('<FilterBar />', () => {
|
|
|
327
327
|
const { getByRole } = render(<FilterBarWrapper<ValuesRemovable> filters={filtersRemovable} />)
|
|
328
328
|
await waitForI18nContent()
|
|
329
329
|
|
|
330
|
-
const addFiltersButton = getByRole('button', { name: 'Add
|
|
330
|
+
const addFiltersButton = getByRole('button', { name: 'Add filters' })
|
|
331
331
|
await user.click(addFiltersButton)
|
|
332
332
|
|
|
333
333
|
const menuOptionOthers = getByRole('button', { name: 'Others' })
|
|
@@ -353,7 +353,7 @@ describe('<FilterBar />', () => {
|
|
|
353
353
|
expect(filterButton).not.toBeInTheDocument()
|
|
354
354
|
})
|
|
355
355
|
|
|
356
|
-
expect(getByRole('button', { name: 'Add
|
|
356
|
+
expect(getByRole('button', { name: 'Add filters' })).toHaveFocus()
|
|
357
357
|
})
|
|
358
358
|
})
|
|
359
359
|
|
|
@@ -363,7 +363,7 @@ describe('<FilterBar />', () => {
|
|
|
363
363
|
const { queryByRole, getByRole } = render(<FilterBarWrapper filters={filtersDependent} />)
|
|
364
364
|
await waitForI18nContent()
|
|
365
365
|
expect(queryByRole('button', { name: 'Topping' })).not.toBeInTheDocument()
|
|
366
|
-
expect(getByRole('button', { name: 'Add
|
|
366
|
+
expect(getByRole('button', { name: 'Add filters' })).toBeDisabled()
|
|
367
367
|
})
|
|
368
368
|
|
|
369
369
|
it('clears the value if the filter is not usable', async () => {
|
|
@@ -426,7 +426,7 @@ describe('<FilterBar />', () => {
|
|
|
426
426
|
)
|
|
427
427
|
await waitForI18nContent()
|
|
428
428
|
|
|
429
|
-
const addFiltersButton = getByRole('button', { name: 'Add
|
|
429
|
+
const addFiltersButton = getByRole('button', { name: 'Add filters' })
|
|
430
430
|
expect(addFiltersButton).toBeDisabled()
|
|
431
431
|
|
|
432
432
|
const flavourButton = getByRole('button', { name: 'Flavour' })
|
|
@@ -612,7 +612,7 @@ describe('<FilterBar />', () => {
|
|
|
612
612
|
expect(queryByRole('button', { name: 'Sugar' })).not.toBeInTheDocument()
|
|
613
613
|
expect(queryByRole('button', { name: 'Ice' })).not.toBeInTheDocument()
|
|
614
614
|
|
|
615
|
-
const addFiltersButton = getByRole('button', { name: 'Add
|
|
615
|
+
const addFiltersButton = getByRole('button', { name: 'Add filters' })
|
|
616
616
|
expect(addFiltersButton).toBeDisabled()
|
|
617
617
|
|
|
618
618
|
await user.click(coffeeButton)
|
|
@@ -48,9 +48,9 @@ describe('<AddFiltersMenu />', () => {
|
|
|
48
48
|
render(<AddFiltersMenuWrapper filters={filters} />)
|
|
49
49
|
|
|
50
50
|
await waitFor(() => {
|
|
51
|
-
expect(screen.getByRole('button', { name: 'Add
|
|
51
|
+
expect(screen.getByRole('button', { name: 'Add filters' })).toBeVisible()
|
|
52
52
|
})
|
|
53
|
-
const addFiltersButton = screen.getByRole('button', { name: 'Add
|
|
53
|
+
const addFiltersButton = screen.getByRole('button', { name: 'Add filters' })
|
|
54
54
|
await user.click(addFiltersButton)
|
|
55
55
|
|
|
56
56
|
await waitFor(() => {
|
|
@@ -74,7 +74,7 @@ describe('<AddFiltersMenu />', () => {
|
|
|
74
74
|
|
|
75
75
|
await waitFor(() => {
|
|
76
76
|
const addFiltersButton = screen.getByRole('button', {
|
|
77
|
-
name: 'Add
|
|
77
|
+
name: 'Add filters',
|
|
78
78
|
})
|
|
79
79
|
expect(addFiltersButton).toBeDisabled()
|
|
80
80
|
})
|
|
@@ -11,7 +11,7 @@ export const AddFiltersMenu = (): JSX.Element => {
|
|
|
11
11
|
|
|
12
12
|
const menuButtonLabel = formatMessage({
|
|
13
13
|
id: 'filterBar.addFiltersMenu.buttonLabel',
|
|
14
|
-
defaultMessage: 'Add
|
|
14
|
+
defaultMessage: 'Add filters',
|
|
15
15
|
description: 'Menu button label to show additional available filter options',
|
|
16
16
|
})
|
|
17
17
|
|
|
@@ -121,10 +121,10 @@
|
|
|
121
121
|
|
|
122
122
|
.informative {
|
|
123
123
|
background: $color-blue-100;
|
|
124
|
-
border-color: var(--color-blue-
|
|
124
|
+
border-color: var(--color-blue-500);
|
|
125
125
|
color: $color-purple-800;
|
|
126
126
|
|
|
127
|
-
--icon-color: var(--color-blue-
|
|
127
|
+
--icon-color: var(--color-blue-500);
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
.cautionary {
|
package/src/Tag/_docs/Tag.mdx
CHANGED
|
@@ -17,7 +17,7 @@ import * as TagStories from './Tag.stories'
|
|
|
17
17
|
<Unstyled>
|
|
18
18
|
<InlineNotification type="cautionary" persistent>
|
|
19
19
|
{`This version of the Tag will soon be deprecated and will be removed in the next major release.
|
|
20
|
-
Import Tag from "@kaizen/components/future" for the latest version and
|
|
20
|
+
Import Tag from "@kaizen/components/future" for the latest version and view our migration guide in the Future folder`}
|
|
21
21
|
</InlineNotification>
|
|
22
22
|
</Unstyled>
|
|
23
23
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Canvas, Meta, Controls } from '@storybook/blocks'
|
|
2
|
-
import { ResourceLinks,
|
|
2
|
+
import { ResourceLinks, KAIOInstallation, DosAndDonts, DoOrDont } from '~storybook/components'
|
|
3
3
|
import * as MenuDocsStories from './Menu.docs.stories'
|
|
4
4
|
import * as MenuStories from './Menu.stories'
|
|
5
5
|
|
|
@@ -16,9 +16,10 @@ Updated July 6, 2024
|
|
|
16
16
|
apiSpecification="/?path=/docs/actions-menu-v3-api-specification--docs"
|
|
17
17
|
/>
|
|
18
18
|
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
<KAIOInstallation
|
|
20
|
+
exportNames={['Menu', 'MenuTrigger', 'MenuItem', 'MenuPopover', 'MenuSection', 'MenuHeader']}
|
|
21
|
+
family="actions"
|
|
22
|
+
version="3"
|
|
22
23
|
/>
|
|
23
24
|
|
|
24
25
|
## Overview
|
|
@@ -55,12 +56,12 @@ A menu displays a list of actions in a popover, toggled opened with a button.
|
|
|
55
56
|
- Menu items may be organised into sections, with a heading for each section.
|
|
56
57
|
- The menu trigger button, which may be any variation of a button.
|
|
57
58
|
|
|
58
|
-
|
|
59
|
+
### When to use
|
|
59
60
|
|
|
60
61
|
- When you have a group of related actions for a page or item on the page.
|
|
61
62
|
- The actions either: - Cause an action on the page (e.g. delete), or - Navigate somewhere
|
|
62
63
|
|
|
63
|
-
|
|
64
|
+
### When not to use
|
|
64
65
|
|
|
65
66
|
- When you want to persist a user selection.
|
|
66
67
|
- Use a Select/Multi-Select or Combobox/Multi-Combobox component instead.
|
|
@@ -69,6 +70,8 @@ A menu displays a list of actions in a popover, toggled opened with a button.
|
|
|
69
70
|
- It's recommended that you avoid this because of the complexity it adds for accessibility.
|
|
70
71
|
- Inside a navigation bar - Different DOM elements and behaviour is required for a dropdown menu in a navigation bar.
|
|
71
72
|
|
|
73
|
+
### Specs
|
|
74
|
+
|
|
72
75
|
#### Do use a menu for an overflow of actions
|
|
73
76
|
|
|
74
77
|
Menus work well as an overflow for a list of actions on a page or section. Try to avoid using menus for a single action, favouring an inline button/link instead.
|
|
@@ -87,7 +87,7 @@ Tooltips should never stop a user (or be a gate) from completing a task or perfo
|
|
|
87
87
|
|
|
88
88
|
#### Do be concise
|
|
89
89
|
|
|
90
|
-
Good tooltips contain concise and helpful information, keep it short. If you need more space, consider using a Popover. Don
|
|
90
|
+
Good tooltips contain concise and helpful information, keep it short. If you need more space, consider using a Popover. Don't use it to duplicate information that already exists on the page. Instead, closely consider its placement and whether the disclosed copy will inform the action the user is about to perform.
|
|
91
91
|
|
|
92
92
|
<DosAndDonts>
|
|
93
93
|
<DoOrDont story={TooltipStories.DoConcise} />
|
|
@@ -107,7 +107,7 @@ Good tooltips contain concise and helpful information, keep it short. If you nee
|
|
|
107
107
|
### Trigger
|
|
108
108
|
|
|
109
109
|
- A tooltip trigger needs to be discoverable:
|
|
110
|
-
- E.g. something like an icon to suggest there
|
|
110
|
+
- E.g. something like an icon to suggest there's a tooltip.
|
|
111
111
|
- Avoid triggering tooltips from text that excludes a visual indicator (e.g. underline)
|
|
112
112
|
- A tooltip should be shown and accessible on hover, click or on focus events.
|
|
113
113
|
|
|
File without changes
|