@kaizen/components 1.78.1 → 1.79.1
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/src/__next__/Select/Select.cjs +6 -2
- package/dist/esm/src/__next__/Select/Select.mjs +6 -2
- package/dist/styles.css +10589 -10782
- package/dist/types/__next__/Select/Select.d.ts +6 -2
- package/package.json +1 -1
- package/src/Avatar/Avatar.module.css +137 -135
- package/src/AvatarGroup/AvatarGroup.module.css +58 -56
- package/src/Badge/Badge.module.css +98 -96
- package/src/Brand/Brand.module.css +5 -3
- package/src/BrandMoment/BrandMoment.module.css +147 -145
- package/src/BrandMoment/_docs/ExampleHeaders.module.scss +68 -66
- package/src/Button/Button/Button.module.scss +135 -133
- package/src/Button/GenericButton/GenericButton.module.scss +81 -79
- package/src/Button/IconButton/IconButton.module.scss +20 -18
- package/src/ButtonGroup/ButtonGroup.module.css +38 -36
- package/src/ButtonGroup/ButtonGroup.module.scss +41 -39
- package/src/Calendar/CalendarPopover/CalendarPopover.module.scss +19 -17
- package/src/Calendar/CalendarRange/CalendarRange.module.scss +48 -46
- package/src/Calendar/CalendarSingle/CalendarSingle.module.scss +12 -10
- package/src/Calendar/LegacyCalendarRange/LegacyCalendarRange.module.scss +20 -18
- package/src/Calendar/baseCalendarClassNames.module.scss +148 -146
- package/src/Card/Card.module.css +91 -89
- package/src/Checkbox/Checkbox/Checkbox.module.scss +89 -87
- package/src/Checkbox/CheckboxField/CheckboxField.module.scss +32 -30
- package/src/Checkbox/CheckboxGroup/CheckboxGroup.module.scss +11 -9
- package/src/ClearButton/ClearButton.module.scss +32 -30
- package/src/Collapsible/Collapsible/Collapsible.module.scss +87 -85
- package/src/Collapsible/CollapsibleGroup/CollapsibleGroup.module.scss +9 -7
- package/src/Collapsible/ExpertAdviceCollapsible/ExpertAdviceCollapsible.module.scss +35 -33
- package/src/Container/Container.module.scss +11 -9
- package/src/Content/Content.module.scss +10 -8
- package/src/DateInput/DateInput/DateInput.module.scss +7 -5
- package/src/DateInput/DateInputDescription/DateInputDescription.module.scss +15 -13
- package/src/DateInput/DateInputWithIconButton/DateInputWithIconButton.module.scss +32 -30
- package/src/DatePicker/DatePicker.module.scss +7 -5
- package/src/DatePicker/subcomponents/DateInputField/DateInputField.module.scss +5 -3
- package/src/DateRangePicker/DateRangePicker.module.scss +75 -73
- package/src/Divider/Divider.module.scss +35 -33
- package/src/EmptyState/EmptyState.module.css +95 -93
- package/src/ErrorPage/ErrorPage.module.scss +4 -2
- package/src/FieldGroup/FieldGroup.module.scss +8 -6
- package/src/FieldMessage/FieldMessage.module.scss +53 -51
- package/src/Filter/Filter/Filter.module.css +5 -3
- package/src/Filter/Filter/subcomponents/FilterContents/FilterContents.module.css +4 -2
- package/src/Filter/Filter/subcomponents/FilterPopover/FilterPopover.module.css +8 -6
- package/src/Filter/FilterBar/FilterBar.module.css +17 -15
- package/src/Filter/FilterBar/subcomponents/ClearAllButton/ClearAllButton.module.css +7 -5
- package/src/Filter/FilterBar/subcomponents/FilterBarButton/FilterBarButton.module.css +4 -2
- package/src/Filter/FilterBar/subcomponents/FilterBarMultiSelect/FilterBarMultiSelect.module.css +5 -3
- package/src/Filter/FilterButton/FilterButton/FilterButton.module.css +19 -17
- package/src/Filter/FilterButton/FilterButtonRemovable/FilterButtonRemovable.module.css +4 -2
- package/src/Filter/FilterButton/subcomponents/FilterButtonBase/FilterButtonBase.module.scss +42 -40
- package/src/Filter/FilterDatePicker/subcomponents/DateInputField/DateInputField.module.scss +4 -2
- package/src/Filter/FilterDatePicker/subcomponents/FilterDatePickerField/FilterDatePickerField.module.scss +6 -4
- package/src/Filter/FilterDateRangePicker/FilterDateRangePicker.module.css +7 -5
- package/src/Filter/FilterDateRangePicker/subcomponents/DateRangeDisplayLabel/DateRangeDisplayLabel.module.scss +5 -3
- package/src/Filter/FilterDateRangePicker/subcomponents/DateRangeInputField/DateRangeInputField.module.scss +36 -34
- package/src/Filter/FilterDateRangePicker/subcomponents/DateRangeValidationMessage/DateRangeValidationMessage.module.scss +5 -3
- package/src/Filter/FilterDateRangePicker/subcomponents/FilterDateRangePickerField/FilterDateRangePickerField.module.scss +7 -5
- package/src/Filter/FilterMultiSelect/subcomponents/ListBox/ListBox.module.scss +19 -17
- package/src/Filter/FilterMultiSelect/subcomponents/ListBoxSection/ListBoxSection.module.scss +14 -12
- package/src/Filter/FilterMultiSelect/subcomponents/LoadMoreButton/LoadMoreButton.module.scss +4 -2
- package/src/Filter/FilterMultiSelect/subcomponents/MenuLayout/MenuFooter/MenuFooter.module.scss +7 -5
- package/src/Filter/FilterMultiSelect/subcomponents/MenuLayout/MenuLoadingSkeleton/MenuLoadingSkeleton.module.scss +8 -6
- package/src/Filter/FilterMultiSelect/subcomponents/MenuPopup/MenuPopup.module.scss +17 -15
- package/src/Filter/FilterMultiSelect/subcomponents/MultiSelectOption/MultiSelectOption.module.scss +90 -88
- package/src/Filter/FilterMultiSelect/subcomponents/NoResults/NoResults.module.scss +4 -2
- package/src/Filter/FilterMultiSelect/subcomponents/SearchInput/SearchInput.module.scss +5 -3
- package/src/Filter/FilterMultiSelect/subcomponents/SectionDivider/SectionDivider.module.scss +4 -2
- package/src/Filter/FilterMultiSelect/subcomponents/SelectionControlButton/SelectionControlButton.module.scss +52 -50
- package/src/Filter/FilterMultiSelect/subcomponents/Trigger/RemovableFilterTrigger/RemovableFilterTrigger.module.css +4 -2
- package/src/Filter/FilterSelect/FilterSelect.module.css +9 -7
- package/src/Focusable/Focusable.module.scss +4 -2
- package/src/GuidanceBlock/GuidanceBlock.module.css +212 -210
- package/src/Heading/Heading.module.scss +87 -85
- package/src/Icon/_docs/icon.module.scss +35 -33
- package/src/Icon/subcomponents/SVG/SVG.module.scss +26 -24
- package/src/Illustration/subcomponents/Base/Base.module.scss +100 -98
- package/src/Input/Input/Input.module.scss +217 -215
- package/src/Input/InputRange/InputRange.module.scss +138 -136
- package/src/Input/InputSearch/InputSearch.module.scss +155 -152
- package/src/Label/Label.module.scss +82 -80
- package/src/LabelledMessage/LabelledMessage.module.scss +8 -6
- package/src/LikertScaleLegacy/LikertScaleLegacy.module.scss +266 -264
- package/src/Link/Link.module.css +115 -113
- package/src/LinkButton/LinkButton.module.css +5 -3
- package/src/Loading/LoadingGraphic/LoadingGraphic.module.scss +12 -10
- package/src/Loading/LoadingHeading/LoadingHeading.module.scss +44 -42
- package/src/Loading/LoadingInput/LoadingInput.module.scss +11 -9
- package/src/Loading/LoadingParagraph/LoadingParagraph.module.scss +47 -45
- package/src/Loading/LoadingSpinner/LoadingSpinner.module.css +22 -20
- package/src/Loading/_mixins.scss +11 -9
- package/src/Menu/subcomponents/MenuDropdown/MenuDropdown.module.scss +18 -16
- package/src/Menu/subcomponents/MenuHeading/MenuHeading.module.scss +8 -6
- package/src/Menu/subcomponents/MenuItem/MenuItem.module.scss +74 -72
- package/src/Menu/subcomponents/MenuList/MenuList.module.scss +14 -12
- package/src/Menu/subcomponents/StatelessMenu/StatelessMenu.module.scss +4 -2
- package/src/Modal/ConfirmationModal/ConfirmationModal.module.scss +126 -124
- package/src/Modal/ContextModal/ContextModal.module.scss +72 -70
- package/src/Modal/GenericModal/GenericModal.module.scss +92 -90
- package/src/Modal/GenericModal/subcomponents/ModalAccessibleDescription/ModalAccessibleDescription.module.scss +4 -2
- package/src/Modal/GenericModal/subcomponents/ModalAccessibleLabel/ModalAccessibleLabel.module.scss +25 -23
- package/src/Modal/GenericModal/subcomponents/ModalBody/ModalBody.module.scss +5 -3
- package/src/Modal/GenericModal/subcomponents/ModalFooter/ModalFooter.module.scss +55 -53
- package/src/Modal/GenericModal/subcomponents/ModalHeader/ModalHeader.module.scss +17 -15
- package/src/Modal/InputEditModal/InputEditModal.module.scss +32 -30
- package/src/MultiSelect/MultiSelect.module.scss +7 -5
- package/src/MultiSelect/subcomponents/Checkbox/Checkbox.module.scss +59 -57
- package/src/MultiSelect/subcomponents/MultiSelectOptionField/MultiSelectOptionField.module.scss +55 -53
- package/src/MultiSelect/subcomponents/MultiSelectOptions/MultiSelectOptions.module.scss +8 -6
- package/src/MultiSelect/subcomponents/MultiSelectToggle/MultiSelectToggle.module.scss +66 -64
- package/src/MultiSelect/subcomponents/Popover/Popover.module.scss +15 -13
- package/src/Notification/ToastNotification/ToastNotificationsList/ToastNotificationsList.module.scss +21 -19
- package/src/Notification/subcomponents/GenericNotification/GenericNotification.module.scss +112 -110
- package/src/Notification/subcomponents/GenericNotification/_mixins.scss +278 -276
- package/src/Notification/subcomponents/NotificationIcon/NotificationIcon.module.css +4 -2
- package/src/Pagination/Pagination.module.scss +39 -37
- package/src/Pagination/subcomponents/DirectionalLink/DirectionalLink.module.scss +11 -9
- package/src/Pagination/subcomponents/PaginationLink/PaginationLink.module.scss +53 -51
- package/src/Pagination/subcomponents/TruncateIndicator/TruncateIndicator.module.css +10 -8
- package/src/Popover/Popover.module.scss +187 -185
- package/src/ProgressBar/ProgressBar.module.scss +75 -73
- package/src/ProgressBar/subcomponents/Label/Label.module.scss +6 -4
- package/src/Radio/Radio/Radio.module.scss +60 -58
- package/src/Radio/RadioField/RadioField.module.scss +33 -31
- package/src/Radio/RadioGroup/RadioGroup.module.scss +18 -16
- package/src/RichTextEditor/EditableRichTextContent/EditableRichTextContent.module.scss +32 -30
- package/src/RichTextEditor/RichTextContent/RichTextContent.module.scss +4 -2
- package/src/RichTextEditor/RichTextEditor/RichTextEditor.module.scss +76 -74
- package/src/RichTextEditor/RichTextEditor/subcomponents/ToggleIconButton/ToggleIconButton.module.scss +92 -90
- package/src/RichTextEditor/RichTextEditor/subcomponents/Toolbar/Toolbar.module.scss +5 -3
- package/src/RichTextEditor/RichTextEditor/subcomponents/ToolbarSection/ToolbarSection.module.scss +12 -10
- package/src/RichTextEditor/_mixins.scss +1 -1
- package/src/RichTextEditor/utils/plugins/LinkManager/components/LinkModal/LinkModal.module.scss +5 -3
- package/src/RichTextEditor/utils/plugins/LinkManager/components/LinkPopover/LinkPopover.module.scss +22 -20
- package/src/SearchField/SearchField.module.scss +5 -3
- package/src/Select/Select.module.scss +17 -0
- package/src/Skirt/Skirt.module.scss +24 -22
- package/src/Skirt/subcomponents/SkirtCard/SkirtCard.module.scss +13 -11
- package/src/Slider/Slider.module.scss +34 -32
- package/src/SplitButton/SplitButton.module.scss +5 -3
- package/src/SplitButton/subcomponents/ActionButton/ActionButton.module.scss +7 -5
- package/src/SplitButton/subcomponents/BaseButton/BaseButton.module.scss +65 -63
- package/src/SplitButton/subcomponents/DropdownButton/DropdownButton.module.scss +19 -17
- package/src/Table/Table.module.scss +251 -249
- package/src/Tabs/subcomponents/Tab.module.scss +81 -79
- package/src/Tabs/subcomponents/TabList.module.scss +8 -6
- package/src/Tabs/subcomponents/TabPanel.module.scss +10 -8
- package/src/Tag/Tag.module.scss +166 -164
- package/src/Tag/subcomponents/LiveIcon/LiveIcon.module.css +42 -40
- package/src/Text/Text.module.scss +57 -55
- package/src/TextArea/TextArea.module.css +102 -99
- package/src/TextAreaField/TextAreaField.module.scss +14 -12
- package/src/TextField/TextField.module.scss +16 -14
- package/src/Tile/MultiActionTile/MultiActionTile.module.scss +7 -5
- package/src/Tile/TileGrid/TileGrid.module.scss +18 -16
- package/src/Tile/subcomponents/GenericTile/GenericTile.module.scss +123 -121
- package/src/TimeField/TimeField.module.scss +57 -55
- package/src/TimeField/subcomponents/TimeSegment/TimeSegment.module.scss +37 -35
- package/src/TitleBlockZen/TitleBlockZen.module.scss +507 -505
- package/src/TitleBlockZen/subcomponents/MainActions.module.scss +11 -9
- package/src/TitleBlockZen/subcomponents/MobileActions.module.scss +146 -144
- package/src/TitleBlockZen/subcomponents/NavigationTabs.module.scss +105 -103
- package/src/TitleBlockZen/subcomponents/TitleBlockMenuItem.module.scss +74 -72
- package/src/TitleBlockZen/subcomponents/Toolbar.module.scss +28 -26
- package/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.module.scss +105 -103
- package/src/ToggleSwitch/ToggleSwitchField/ToggleSwitchField.module.scss +11 -9
- package/src/Tooltip/Tooltip.module.scss +139 -137
- package/src/VisuallyHidden/VisuallyHidden.module.scss +10 -8
- package/src/Well/Well.module.css +104 -102
- package/src/Workflow/subcomponents/Footer/components/FooterActions/FooterActions.module.css +14 -12
- package/src/Workflow/subcomponents/Footer/components/ProgressStepper/ProgressStepper.module.css +101 -99
- package/src/Workflow/subcomponents/Footer/components/Root/FooterRoot.module.css +19 -17
- package/src/Workflow/subcomponents/Header/components/Actions/Actions.module.css +14 -12
- package/src/Workflow/subcomponents/Header/components/Branding/Branding.module.css +12 -10
- package/src/Workflow/subcomponents/Header/components/Root/Root.module.css +19 -17
- package/src/Workflow/subcomponents/Header/components/Titles/Titles.module.css +19 -17
- package/src/Workflow/subcomponents/Main/Main.module.css +5 -3
- package/src/Workflow/subcomponents/Wrapper/Wrapper.module.css +8 -6
- package/src/__next__/Button/Button.module.css +220 -218
- package/src/__next__/Button/subcomponents/ButtonContent/ButtonContent.module.css +17 -15
- package/src/__next__/Button/subcomponents/PendingContent/PendingContent.module.css +15 -13
- package/src/__next__/Icon/Icon.module.css +40 -38
- package/src/__next__/Icon/_docs/Icon.docs.module.css +13 -11
- package/src/__next__/Menu/Menu.module.css +30 -28
- package/src/__next__/Menu/MenuItem.module.css +41 -39
- package/src/__next__/Select/Select.module.scss +8 -6
- package/src/__next__/Select/Select.tsx +7 -1
- package/src/__next__/Select/subcomponents/ListBox/ListBox.module.scss +12 -10
- package/src/__next__/Select/subcomponents/ListBoxSection/ListBoxSection.module.scss +15 -13
- package/src/__next__/Select/subcomponents/Option/Option.module.scss +53 -51
- package/src/__next__/Select/subcomponents/SectionDivider/SectionDivider.module.scss +8 -6
- package/src/__next__/Select/subcomponents/SelectPopoverContents/SelectPopoverContents.module.scss +4 -2
- package/src/__next__/Select/subcomponents/SelectToggle/SelectToggle.module.scss +105 -103
- package/src/__next__/Tabs/subcomponents/Tab/Tab.module.css +81 -79
- package/src/__next__/Tabs/subcomponents/TabList/TabList.module.css +56 -54
- package/src/__next__/Tabs/subcomponents/TabPanel/TabPanel.module.css +10 -8
- package/src/__next__/Tag/RemovableTag/RemovableTag.module.scss +6 -4
- package/src/__next__/Tag/RemovableTag/subcomponents/RemoveButton.module.scss +26 -24
- package/src/__next__/Tag/Tag/Tag.module.scss +56 -54
- package/src/__next__/Tooltip/OverlayArrow.module.scss +40 -38
- package/src/__next__/Tooltip/Tooltip.module.scss +39 -37
- package/src/__next__/Tooltip/_docs/ApiSpecification.mdx +2 -2
- package/src/__next__/Tooltip/_docs/Tooltip.docs.stories.tsx +15 -30
- package/src/__next__/Tooltip/_docs/Tooltip.mdx +1 -1
- package/src/__next__/Tooltip/_docs/Tooltip.spec.stories.tsx +29 -60
- package/src/__next__/Tooltip/_docs/Tooltip.stories.tsx +2 -2
- package/src/utils/AppearanceAnim.module.scss +14 -12
|
@@ -5,51 +5,53 @@
|
|
|
5
5
|
@import '~@kaizen/design-tokens/sass/typography';
|
|
6
6
|
@import '~@kaizen/design-tokens/sass/spacing';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
8
|
+
@layer kz-components {
|
|
9
|
+
.tooltip {
|
|
10
|
+
max-width: 200px;
|
|
11
|
+
padding: $spacing-8 $spacing-12;
|
|
12
|
+
color: $color-white;
|
|
13
|
+
text-align: center;
|
|
14
|
+
font-family: $typography-paragraph-extra-small-font-family;
|
|
15
|
+
font-size: $typography-paragraph-extra-small-font-size;
|
|
16
|
+
font-weight: $typography-paragraph-extra-small-font-weight;
|
|
17
|
+
letter-spacing: $typography-paragraph-extra-small-letter-spacing;
|
|
18
|
+
line-height: $typography-paragraph-extra-small-line-height;
|
|
19
|
+
border-radius: $border-solid-border-radius;
|
|
20
|
+
box-shadow: $shadow-small-box-shadow;
|
|
21
|
+
background-color: $color-purple-800;
|
|
22
|
+
text-wrap: pretty;
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
/* fixes FF gap */
|
|
25
|
+
transform: translate3d(0, 0, 0);
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
&.reversed {
|
|
28
|
+
background-color: $color-white;
|
|
29
|
+
color: $color-purple-800;
|
|
30
|
+
}
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
&[data-placement='top'] {
|
|
33
|
+
--origin: translateY(4px);
|
|
34
|
+
}
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
&[data-placement='bottom'] {
|
|
37
|
+
--origin: translateY(-4px);
|
|
38
|
+
}
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
&[data-placement='right'] {
|
|
41
|
+
--origin: translateX(-4px);
|
|
42
|
+
}
|
|
42
43
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
&[data-placement='left'] {
|
|
45
|
+
--origin: translateX(4px);
|
|
46
|
+
}
|
|
46
47
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
&[data-entering] {
|
|
49
|
+
animation: slide $animation-duration-fast;
|
|
50
|
+
}
|
|
50
51
|
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
&[data-exiting] {
|
|
53
|
+
animation: slide $animation-duration-fast reverse $animation-easing-function-ease-in;
|
|
54
|
+
}
|
|
53
55
|
}
|
|
54
56
|
}
|
|
55
57
|
|
|
@@ -28,7 +28,7 @@ Tooltips are brief floating labels used to add additional contextual information
|
|
|
28
28
|
source={{
|
|
29
29
|
code: `
|
|
30
30
|
<TooltipTrigger>
|
|
31
|
-
<Button
|
|
31
|
+
<Button>Button</Button>
|
|
32
32
|
<Tooltip>Tooltip content</Tooltip>
|
|
33
33
|
</TooltipTrigger>
|
|
34
34
|
`,
|
|
@@ -75,7 +75,7 @@ The `TooltipTrigger` wraps both the `Tooltip` and its trigger element, controlli
|
|
|
75
75
|
```jsx
|
|
76
76
|
<TooltipTrigger>
|
|
77
77
|
/* In this case the trigger element is the Button */
|
|
78
|
-
<Button
|
|
78
|
+
<Button>Button</Button>
|
|
79
79
|
/* The Tooltip and its content is a child of the trigger */
|
|
80
80
|
<Tooltip>Tooltip content</Tooltip>
|
|
81
81
|
</TooltipTrigger>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { type Meta, type StoryObj } from '@storybook/react'
|
|
3
3
|
import isChromatic from 'chromatic'
|
|
4
|
-
import { Button, IconButton } from '~components/Button'
|
|
5
4
|
import { FieldMessage } from '~components/FieldMessage'
|
|
6
5
|
import { Focusable } from '~components/Focusable'
|
|
7
6
|
import { Input } from '~components/Input'
|
|
8
7
|
import { Label } from '~components/Label'
|
|
9
8
|
import { Text } from '~components/Text'
|
|
9
|
+
import { Button } from '~components/__next__/Button'
|
|
10
10
|
import { Icon } from '~components/__next__/Icon'
|
|
11
11
|
import { Tooltip, TooltipTrigger } from '../index'
|
|
12
12
|
import * as TestStories from './Tooltip.spec.stories'
|
|
@@ -37,7 +37,7 @@ type Story = StoryObj<typeof meta>
|
|
|
37
37
|
export const Playground: Story = {
|
|
38
38
|
render: ({ defaultOpen: _, isOpen, ...args }) => (
|
|
39
39
|
<TooltipTrigger defaultOpen={true} isOpen={isOpen}>
|
|
40
|
-
<Button
|
|
40
|
+
<Button>Button</Button>
|
|
41
41
|
<Tooltip {...args}>Tooltip content</Tooltip>
|
|
42
42
|
</TooltipTrigger>
|
|
43
43
|
),
|
|
@@ -46,14 +46,9 @@ export const Playground: Story = {
|
|
|
46
46
|
export const Primary: Story = {
|
|
47
47
|
render: () => (
|
|
48
48
|
<TooltipTrigger>
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
primary
|
|
53
|
-
// Negate the aria description (added by RAC) as it should be the
|
|
54
|
-
// same as the accessible name, therefore no need to duplicate it
|
|
55
|
-
aria-describedby={null}
|
|
56
|
-
/>
|
|
49
|
+
<Button icon={<Icon name="add" isPresentational />} hasHiddenLabel>
|
|
50
|
+
Add something
|
|
51
|
+
</Button>
|
|
57
52
|
<Tooltip>Add something</Tooltip>
|
|
58
53
|
</TooltipTrigger>
|
|
59
54
|
),
|
|
@@ -105,14 +100,9 @@ export const DoConcise: Story = {
|
|
|
105
100
|
render: () => (
|
|
106
101
|
<div>
|
|
107
102
|
<TooltipTrigger>
|
|
108
|
-
<
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
primary
|
|
112
|
-
// Negate the aria description (added by RAC) as it should be the
|
|
113
|
-
// same as the accessible name, therefore no need to duplicate it
|
|
114
|
-
aria-describedby={null}
|
|
115
|
-
/>
|
|
103
|
+
<Button icon={<Icon name="add" isPresentational />} hasHiddenLabel>
|
|
104
|
+
Add topic
|
|
105
|
+
</Button>
|
|
116
106
|
<Tooltip>Add topic to agenda</Tooltip>
|
|
117
107
|
</TooltipTrigger>
|
|
118
108
|
</div>
|
|
@@ -128,17 +118,12 @@ export const DontConcise: Story = {
|
|
|
128
118
|
render: () => (
|
|
129
119
|
<div>
|
|
130
120
|
<TooltipTrigger>
|
|
131
|
-
<
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
primary
|
|
135
|
-
// Negate the aria description (added by RAC) as it should be the
|
|
136
|
-
// same as the accessible name, therefore no need to duplicate it
|
|
137
|
-
aria-describedby={null}
|
|
138
|
-
/>
|
|
121
|
+
<Button icon={<Icon name="add" isPresentational />} hasHiddenLabel>
|
|
122
|
+
Add something
|
|
123
|
+
</Button>
|
|
139
124
|
<Tooltip>
|
|
140
125
|
Add Topic to agenda. This will create a new topic where you can discuss recent work with
|
|
141
|
-
your manager.
|
|
126
|
+
your manager.
|
|
142
127
|
</Tooltip>
|
|
143
128
|
</TooltipTrigger>
|
|
144
129
|
</div>
|
|
@@ -150,11 +135,11 @@ export const ShouldFlip: Story = {
|
|
|
150
135
|
render: () => (
|
|
151
136
|
<div className="flex flex-col gap-8 pl-96 overflow-hidden max-w-[250px]">
|
|
152
137
|
<TooltipTrigger>
|
|
153
|
-
<Button
|
|
138
|
+
<Button>Should flip</Button>
|
|
154
139
|
<Tooltip placement="end">Tooltip content</Tooltip>
|
|
155
140
|
</TooltipTrigger>
|
|
156
141
|
<TooltipTrigger>
|
|
157
|
-
<Button
|
|
142
|
+
<Button>Won't flip</Button>
|
|
158
143
|
<Tooltip placement="end" shouldFlip={false}>
|
|
159
144
|
Tooltip content
|
|
160
145
|
</Tooltip>
|
|
@@ -188,7 +173,7 @@ export const UncontrolledState: Story = {
|
|
|
188
173
|
Toggle open
|
|
189
174
|
</button>
|
|
190
175
|
<TooltipTrigger isOpen={isOpen}>
|
|
191
|
-
<Button
|
|
176
|
+
<Button>Button</Button>
|
|
192
177
|
<Tooltip>Tooltip content</Tooltip>
|
|
193
178
|
</TooltipTrigger>
|
|
194
179
|
</div>
|
|
@@ -2,11 +2,12 @@ import React from 'react'
|
|
|
2
2
|
import { type Meta, type StoryObj } from '@storybook/react'
|
|
3
3
|
import { expect, userEvent, waitFor, within } from '@storybook/test'
|
|
4
4
|
import isChromatic from 'chromatic'
|
|
5
|
-
import { Button, IconButton } from '~components/Button'
|
|
6
5
|
import { Focusable } from '~components/Focusable'
|
|
7
|
-
import {
|
|
6
|
+
import { LinkButton } from '~components/LinkButton'
|
|
8
7
|
import { Text } from '~components/Text'
|
|
8
|
+
import { Button } from '~components/__next__/Button'
|
|
9
9
|
import { Icon } from '~components/__next__/Icon'
|
|
10
|
+
import { Tab, TabList, TabPanel, Tabs } from '~components/__next__/Tabs'
|
|
10
11
|
import { Tag } from '~components/__next__/Tag'
|
|
11
12
|
import { Tooltip, TooltipTrigger } from '../index'
|
|
12
13
|
|
|
@@ -32,12 +33,10 @@ export default meta
|
|
|
32
33
|
|
|
33
34
|
type Story = StoryObj<typeof meta>
|
|
34
35
|
|
|
35
|
-
// TODO: update this to use the new `next` button component
|
|
36
|
-
|
|
37
36
|
export const OnButton: Story = {
|
|
38
37
|
render: ({ defaultOpen, isOpen, ...args }) => (
|
|
39
38
|
<TooltipTrigger defaultOpen={defaultOpen} isOpen={isOpen}>
|
|
40
|
-
<Button
|
|
39
|
+
<Button>Button</Button>
|
|
41
40
|
<Tooltip {...args}>Tooltip content</Tooltip>
|
|
42
41
|
</TooltipTrigger>
|
|
43
42
|
),
|
|
@@ -46,21 +45,29 @@ export const OnButton: Story = {
|
|
|
46
45
|
const button = canvas.queryByRole('button') ?? canvas.getByRole('link')
|
|
47
46
|
|
|
48
47
|
await step('Hover shows', async () => {
|
|
49
|
-
await userEvent.
|
|
48
|
+
await waitFor(() => userEvent.click(canvasElement)) // needed to refocus the browser window
|
|
49
|
+
|
|
50
50
|
await userEvent.hover(button)
|
|
51
|
-
await
|
|
52
|
-
expect(
|
|
51
|
+
await expect(await canvas.findByRole('tooltip')).toBeInTheDocument()
|
|
52
|
+
await expect((await canvas.findByRole('tooltip')).checkVisibility()).toBe(true)
|
|
53
|
+
await expect(button).toHaveAttribute('aria-describedby', canvas.getByRole('tooltip').id)
|
|
53
54
|
await userEvent.unhover(button)
|
|
54
55
|
})
|
|
55
56
|
|
|
56
57
|
await step('Focus shows', async () => {
|
|
58
|
+
await waitFor(() => userEvent.click(canvasElement)) // needed to refocus the browser window
|
|
59
|
+
|
|
57
60
|
await userEvent.tab() // focus
|
|
58
|
-
await
|
|
61
|
+
await expect((await canvas.findByRole('tooltip')).checkVisibility()).toBe(true)
|
|
62
|
+
await expect(await canvas.findByRole('tooltip')).toBeInTheDocument()
|
|
59
63
|
await userEvent.tab() // unfocus
|
|
60
|
-
|
|
64
|
+
waitFor(() => expect(canvas.queryByRole('tooltip')).toBeNull())
|
|
65
|
+
waitFor(async () => expect(await canvas.queryByText('Tooltip content')).toBeNull())
|
|
61
66
|
})
|
|
62
67
|
|
|
63
68
|
await step('Escape closes', async () => {
|
|
69
|
+
await waitFor(() => userEvent.click(canvasElement)) // needed to refocus the browser window
|
|
70
|
+
|
|
64
71
|
await userEvent.tab() // focus
|
|
65
72
|
await waitFor(() => expect(canvas.getByRole('tooltip')).toBeVisible())
|
|
66
73
|
await userEvent.keyboard('{Escape}')
|
|
@@ -76,7 +83,7 @@ export const OnLink: Story = {
|
|
|
76
83
|
...OnButton,
|
|
77
84
|
render: ({ defaultOpen, isOpen, ...args }) => (
|
|
78
85
|
<TooltipTrigger defaultOpen={defaultOpen} isOpen={isOpen}>
|
|
79
|
-
<
|
|
86
|
+
<LinkButton href="#">Button</LinkButton>
|
|
80
87
|
<Tooltip {...args}>Tooltip content</Tooltip>
|
|
81
88
|
</TooltipTrigger>
|
|
82
89
|
),
|
|
@@ -86,12 +93,9 @@ export const OnButtonWithDesc: Story = {
|
|
|
86
93
|
render: ({ defaultOpen, isOpen, ...args }) => (
|
|
87
94
|
<>
|
|
88
95
|
<TooltipTrigger defaultOpen={defaultOpen} isOpen={isOpen}>
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
primary
|
|
93
|
-
aria-describedby="blah"
|
|
94
|
-
/>
|
|
96
|
+
<Button icon={<Icon name="add" isPresentational />} aria-describedby="blah" hasHiddenLabel>
|
|
97
|
+
(TESTING) Add label
|
|
98
|
+
</Button>
|
|
95
99
|
<Tooltip {...args}>Tooltip content</Tooltip>
|
|
96
100
|
</TooltipTrigger>
|
|
97
101
|
<Text variant="body" id="blah" classNameOverride="p-4">
|
|
@@ -104,14 +108,9 @@ export const OnButtonWithDesc: Story = {
|
|
|
104
108
|
export const OnIconButton: Story = {
|
|
105
109
|
render: ({ defaultOpen, isOpen, ...args }) => (
|
|
106
110
|
<TooltipTrigger defaultOpen={defaultOpen} isOpen={isOpen}>
|
|
107
|
-
<
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
primary
|
|
111
|
-
// Negate the aria description (added by RAC) as it should be the
|
|
112
|
-
// same as the accessible name, therefore no need to duplicate it
|
|
113
|
-
aria-describedby={null}
|
|
114
|
-
/>
|
|
111
|
+
<Button icon={<Icon name="add" isPresentational />} hasHiddenLabel>
|
|
112
|
+
Add something
|
|
113
|
+
</Button>
|
|
115
114
|
<Tooltip {...args}>Add something</Tooltip>
|
|
116
115
|
</TooltipTrigger>
|
|
117
116
|
),
|
|
@@ -120,36 +119,7 @@ export const OnIconButton: Story = {
|
|
|
120
119
|
export const OnDisabledButton: Story = {
|
|
121
120
|
render: ({ defaultOpen, isOpen, ...args }) => (
|
|
122
121
|
<TooltipTrigger defaultOpen={defaultOpen} isOpen={isOpen}>
|
|
123
|
-
<Button
|
|
124
|
-
<Tooltip {...args}>Tooltip content</Tooltip>
|
|
125
|
-
</TooltipTrigger>
|
|
126
|
-
),
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export const OnCustomButtonAnchor: Story = {
|
|
130
|
-
name: 'On Button with custom <a>',
|
|
131
|
-
render: ({ defaultOpen, isOpen, ...args }) => (
|
|
132
|
-
<TooltipTrigger defaultOpen={defaultOpen} isOpen={isOpen}>
|
|
133
|
-
<Button
|
|
134
|
-
label="Button"
|
|
135
|
-
component={(props) => (
|
|
136
|
-
// eslint-disable-next-line jsx-a11y/anchor-is-valid
|
|
137
|
-
<a {...props} href="#" style={{ padding: '0 1rem' }}>
|
|
138
|
-
Custom Link
|
|
139
|
-
</a>
|
|
140
|
-
)}
|
|
141
|
-
/>
|
|
142
|
-
<Tooltip {...args}>Tooltip content</Tooltip>
|
|
143
|
-
</TooltipTrigger>
|
|
144
|
-
),
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
export const OnCustomButton: Story = {
|
|
148
|
-
...OnButton,
|
|
149
|
-
name: 'On Button with custom <button>',
|
|
150
|
-
render: ({ defaultOpen, isOpen, ...args }) => (
|
|
151
|
-
<TooltipTrigger defaultOpen={defaultOpen} isOpen={isOpen}>
|
|
152
|
-
<Button label="Button" component={(props) => <button type="button" {...props} />} />
|
|
122
|
+
<Button isDisabled>Button</Button>
|
|
153
123
|
<Tooltip {...args}>Tooltip content</Tooltip>
|
|
154
124
|
</TooltipTrigger>
|
|
155
125
|
),
|
|
@@ -175,9 +145,8 @@ export const OnTabs: Story = {
|
|
|
175
145
|
<Tooltip {...args}>Tooltip content</Tooltip>
|
|
176
146
|
</TooltipTrigger>
|
|
177
147
|
</TabList>
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
</TabPanels>
|
|
148
|
+
|
|
149
|
+
<TabPanel className="p-24 font-family-paragraph">Tab content</TabPanel>
|
|
181
150
|
</Tabs>
|
|
182
151
|
),
|
|
183
152
|
}
|
|
@@ -185,7 +154,7 @@ export const OnTabs: Story = {
|
|
|
185
154
|
export const Placement: Story = {
|
|
186
155
|
render: ({ defaultOpen, isOpen, ...args }) => (
|
|
187
156
|
<TooltipTrigger defaultOpen={defaultOpen} isOpen={isOpen}>
|
|
188
|
-
<Button
|
|
157
|
+
<Button>Button</Button>
|
|
189
158
|
<Tooltip {...args} placement="top" shouldFlip={false}>
|
|
190
159
|
Placement top
|
|
191
160
|
</Tooltip>
|
|
@@ -205,7 +174,7 @@ export const Placement: Story = {
|
|
|
205
174
|
export const ReversedColors: Story = {
|
|
206
175
|
render: ({ defaultOpen, isOpen, ...args }) => (
|
|
207
176
|
<TooltipTrigger defaultOpen={defaultOpen} isOpen={isOpen}>
|
|
208
|
-
<Button
|
|
177
|
+
<Button>Button</Button>
|
|
209
178
|
<Tooltip {...args}>Tooltip content</Tooltip>
|
|
210
179
|
</TooltipTrigger>
|
|
211
180
|
),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { type FunctionComponent } from 'react'
|
|
2
2
|
import { type Meta, type StoryObj } from '@storybook/react'
|
|
3
3
|
import isChromatic from 'chromatic'
|
|
4
|
-
import { Button } from '~components/Button'
|
|
5
4
|
import { Focusable } from '~components/Focusable'
|
|
6
5
|
import { Tag } from '~components/__next__'
|
|
6
|
+
import { Button } from '~components/__next__/Button'
|
|
7
7
|
import { Tooltip, TooltipTrigger } from '../index'
|
|
8
8
|
import * as testStories from './Tooltip.spec.stories'
|
|
9
9
|
|
|
@@ -33,7 +33,7 @@ type Story = StoryObj<typeof meta>
|
|
|
33
33
|
export const Playground: Story = {
|
|
34
34
|
render: ({ defaultOpen: _, isOpen, ...args }) => (
|
|
35
35
|
<TooltipTrigger defaultOpen={true} isOpen={isOpen}>
|
|
36
|
-
<Button
|
|
36
|
+
<Button>Button</Button>
|
|
37
37
|
<Tooltip {...args}>Tooltip content</Tooltip>
|
|
38
38
|
</TooltipTrigger>
|
|
39
39
|
),
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
@layer kz-components {
|
|
2
|
+
// Sync with ./AppearanceAnim.tsx
|
|
3
|
+
$anim-duration-ms: 0.2s;
|
|
3
4
|
|
|
4
|
-
.defaultHiddenState {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
5
|
+
.defaultHiddenState {
|
|
6
|
+
opacity: 0%;
|
|
7
|
+
pointer-events: none;
|
|
8
|
+
transition: opacity $anim-duration-ms ease-out;
|
|
9
|
+
will-change: opacity;
|
|
10
|
+
display: inline;
|
|
11
|
+
}
|
|
11
12
|
|
|
12
|
-
.visibleState {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
.visibleState {
|
|
14
|
+
opacity: 100%;
|
|
15
|
+
pointer-events: initial;
|
|
16
|
+
}
|
|
15
17
|
}
|