@kaizen/components 1.52.1 → 1.53.0

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.
Files changed (218) hide show
  1. package/dist/cjs/DatePicker/DatePicker.cjs +8 -1
  2. package/dist/cjs/DatePicker/utils/getLocale.cjs +2 -0
  3. package/dist/cjs/DatePicker/utils/validateDate.cjs +28 -2
  4. package/dist/cjs/Filter/FilterBar/subcomponents/AddFiltersMenu/AddFiltersMenu.cjs +8 -1
  5. package/dist/cjs/Filter/FilterBar/subcomponents/ClearAllButton/ClearAllButton.cjs +14 -2
  6. package/dist/cjs/Filter/FilterBar/subcomponents/FilterBarDatePicker/FilterBarDatePicker.cjs +1 -0
  7. package/dist/cjs/Filter/FilterButton/FilterButtonRemovable/FilterButtonRemovable.cjs +10 -1
  8. package/dist/cjs/Filter/FilterDatePicker/subcomponents/DateInputField/DateInputField.cjs +8 -1
  9. package/dist/cjs/Filter/FilterDateRangePicker/subcomponents/FilterDateRangePickerField/FilterDateRangePickerField.cjs +5 -1
  10. package/dist/cjs/Filter/FilterDateRangePicker/subcomponents/FilterDateRangePickerField/hooks/useEndDateValidation.cjs +1 -0
  11. package/dist/cjs/Filter/FilterDateRangePicker/subcomponents/FilterDateRangePickerField/hooks/useStartDateValidation.cjs +1 -0
  12. package/dist/cjs/Filter/FilterDateRangePicker/subcomponents/FilterDateRangePickerField/utils/validateEndDateBeforeStartDate.cjs +16 -1
  13. package/dist/esm/DatePicker/DatePicker.mjs +8 -1
  14. package/dist/esm/DatePicker/utils/getLocale.mjs +3 -1
  15. package/dist/esm/DatePicker/utils/validateDate.mjs +22 -2
  16. package/dist/esm/Filter/FilterBar/subcomponents/AddFiltersMenu/AddFiltersMenu.mjs +8 -1
  17. package/dist/esm/Filter/FilterBar/subcomponents/ClearAllButton/ClearAllButton.mjs +14 -2
  18. package/dist/esm/Filter/FilterBar/subcomponents/FilterBarDatePicker/FilterBarDatePicker.mjs +1 -0
  19. package/dist/esm/Filter/FilterButton/FilterButtonRemovable/FilterButtonRemovable.mjs +10 -1
  20. package/dist/esm/Filter/FilterDatePicker/subcomponents/DateInputField/DateInputField.mjs +8 -1
  21. package/dist/esm/Filter/FilterDateRangePicker/subcomponents/FilterDateRangePickerField/FilterDateRangePickerField.mjs +5 -1
  22. package/dist/esm/Filter/FilterDateRangePicker/subcomponents/FilterDateRangePickerField/hooks/useEndDateValidation.mjs +1 -0
  23. package/dist/esm/Filter/FilterDateRangePicker/subcomponents/FilterDateRangePickerField/hooks/useStartDateValidation.mjs +1 -0
  24. package/dist/esm/Filter/FilterDateRangePicker/subcomponents/FilterDateRangePickerField/utils/validateEndDateBeforeStartDate.mjs +10 -1
  25. package/dist/styles.css +2 -2
  26. package/dist/types/AvatarGroup/_docs/example-data.d.ts +8 -0
  27. package/dist/types/BrandMoment/_docs/ExampleHeaders.d.ts +3 -0
  28. package/dist/types/Calendar/_docs/controls/defaultMonthControls.d.ts +2 -0
  29. package/dist/types/Calendar/_docs/controls/weekStartsOnControls.d.ts +2 -0
  30. package/dist/types/Container/Container.d.ts +1 -1
  31. package/dist/types/Content/Content.d.ts +1 -1
  32. package/dist/types/DateInput/DateInput/DateInput.d.ts +1 -1
  33. package/dist/types/DatePicker/DatePicker.d.ts +1 -1
  34. package/dist/types/DatePicker/_docs/controls/datePickerLocaleControls.d.ts +2 -0
  35. package/dist/types/DatePicker/_docs/controls/disabledDayMatchersControls.d.ts +2 -0
  36. package/dist/types/DatePicker/subcomponents/DateInputField/DateInputField.d.ts +1 -1
  37. package/dist/types/DatePicker/types.d.ts +2 -1
  38. package/dist/types/DatePicker/utils/getLocale.d.ts +1 -1
  39. package/dist/types/Filter/FilterBar/context/types.d.ts +28 -0
  40. package/dist/types/Filter/FilterButton/subcomponents/FilterButtonBase/FilterButtonBase.d.ts +1 -1
  41. package/dist/types/Filter/FilterDatePicker/_docs/controls/disabledDaysControls.d.ts +2 -0
  42. package/dist/types/Filter/FilterDatePicker/_docs/controls/validationControls.d.ts +2 -0
  43. package/dist/types/Filter/FilterDatePicker/subcomponents/DateInputField/DateInputField.d.ts +1 -1
  44. package/dist/types/Filter/FilterDateRangePicker/_docs/controls/disabledDaysControls.d.ts +2 -0
  45. package/dist/types/Filter/FilterDateRangePicker/_docs/controls/validationControls.d.ts +2 -0
  46. package/dist/types/Filter/FilterMultiSelect/_docs/MockData.d.ts +10 -0
  47. package/dist/types/Filter/FilterSelect/_docs/mockData.d.ts +6 -0
  48. package/dist/types/Filter/_docs/controls/renderTriggerControls.d.ts +2 -0
  49. package/dist/types/Menu/_docs/MenuContentExample.d.ts +8 -0
  50. package/dist/types/Menu/_docs/examples.d.ts +11 -0
  51. package/dist/types/Modal/_docs/controls.d.ts +11 -0
  52. package/dist/types/MultiSelect/MultiSelect.d.ts +23 -0
  53. package/dist/types/MultiSelect/subcomponents/MultiSelectOptions/MultiSelectOptions.d.ts +13 -0
  54. package/dist/types/Select/Select.d.ts +3 -3
  55. package/dist/types/Workflow/_docs/controls/controls.d.ts +2 -0
  56. package/dist/types/Workflow/_docs/controls/index.d.ts +1 -0
  57. package/dist/types/__future__/Select/Select.d.ts +2 -2
  58. package/dist/types/__future__/Select/_docs/mockData.d.ts +6 -0
  59. package/dist/types/__future__/Select/subcomponents/SelectToggle/SelectToggle.d.ts +2 -2
  60. package/dist/types/__future__/Select/types.d.ts +22 -0
  61. package/dist/types/__future__/Workflow/_docs/controls/controls.d.ts +2 -0
  62. package/dist/types/__future__/Workflow/_docs/controls/index.d.ts +1 -0
  63. package/dist/types/__overlays__/Tooltip/v1/utils/isSemanticElement.d.ts +2 -2
  64. package/dist/types/utils/getNodeText.d.ts +2 -1
  65. package/locales/en.json +40 -0
  66. package/package.json +1 -1
  67. package/src/Avatar/_docs/Avatar.mdx +1 -1
  68. package/src/AvatarGroup/_docs/AvatarGroup.mdx +1 -1
  69. package/src/Badge/_docs/Badge.mdx +1 -1
  70. package/src/Brand/_docs/Brand.mdx +1 -1
  71. package/src/BrandMoment/_docs/BrandMoment.mdx +1 -1
  72. package/src/Button/Button/_docs/Button.mdx +1 -1
  73. package/src/Button/IconButton/_docs/IconButton.mdx +1 -1
  74. package/src/ButtonGroup/_docs/ButtonGroup.mdx +1 -1
  75. package/src/Calendar/CalendarRange/_docs/CalendarRange.mdx +1 -1
  76. package/src/Calendar/CalendarSingle/_docs/CalendarSingle.mdx +1 -1
  77. package/src/Card/_docs/Card.mdx +1 -1
  78. package/src/Checkbox/Checkbox/_docs/Checkbox.mdx +1 -1
  79. package/src/Checkbox/CheckboxField/_docs/CheckboxField.mdx +1 -1
  80. package/src/Checkbox/CheckboxGroup/_docs/CheckboxGroup.mdx +1 -1
  81. package/src/Collapsible/Collapsible/_docs/Collapsible.mdx +1 -1
  82. package/src/Collapsible/CollapsibleGroup/_docs/CollapsibleGroup.mdx +1 -1
  83. package/src/Collapsible/ExpertAdviceCollapsible/_docs/ExpertAdviceCollapsible.mdx +1 -1
  84. package/src/Container/_docs/Container.mdx +1 -1
  85. package/src/Content/_docs/Content.mdx +1 -1
  86. package/src/DateInput/DateInputDescription/DateInputDescription.spec.tsx +26 -18
  87. package/src/DatePicker/DatePicker.spec.tsx +100 -69
  88. package/src/DatePicker/DatePicker.tsx +13 -5
  89. package/src/DatePicker/_docs/DatePicker.mdx +1 -1
  90. package/src/DatePicker/_docs/DatePicker.stickersheet.stories.tsx +57 -21
  91. package/src/DatePicker/_docs/DatePicker.stories.tsx +2 -3
  92. package/src/DatePicker/_docs/controls/datePickerLocaleControls.ts +1 -1
  93. package/src/DatePicker/subcomponents/DateInputField/DateInputField.spec.tsx +49 -36
  94. package/src/DatePicker/types.ts +2 -1
  95. package/src/DatePicker/utils/getLocale.ts +6 -2
  96. package/src/DatePicker/utils/validateDate.spec.ts +40 -16
  97. package/src/DatePicker/utils/{validateDate.ts → validateDate.tsx} +24 -4
  98. package/src/DateRangePicker/_docs/DateRangePicker.mdx +1 -1
  99. package/src/Divider/_docs/Divider.mdx +1 -1
  100. package/src/EmptyState/_docs/EmptyState.mdx +1 -1
  101. package/src/ErrorPage/_docs/ErrorPage.mdx +1 -1
  102. package/src/FieldGroup/_docs/FieldGroup.mdx +1 -1
  103. package/src/FieldMessage/_docs/FieldMessage.mdx +1 -1
  104. package/src/Filter/Filter/_docs/Filter.mdx +1 -1
  105. package/src/Filter/FilterBar/FilterBar.spec.tsx +56 -25
  106. package/src/Filter/FilterBar/_docs/FilterBar.mdx +1 -1
  107. package/src/Filter/FilterBar/subcomponents/AddFiltersMenu/AddFiltersMenu.spec.tsx +21 -13
  108. package/src/Filter/FilterBar/subcomponents/AddFiltersMenu/AddFiltersMenu.tsx +11 -1
  109. package/src/Filter/FilterBar/subcomponents/ClearAllButton/ClearAllButton.tsx +17 -2
  110. package/src/Filter/FilterBar/subcomponents/FilterBarButton/FilterBarButton.spec.tsx +17 -8
  111. package/src/Filter/FilterBar/subcomponents/FilterBarDatePicker/FilterBarDatePicker.spec.tsx +37 -23
  112. package/src/Filter/FilterBar/subcomponents/FilterBarDateRangePicker/FilterBarDateRangePicker.spec.tsx +35 -23
  113. package/src/Filter/FilterBar/subcomponents/FilterBarMultiSelect/FilterBarMultiSelect.spec.tsx +42 -26
  114. package/src/Filter/FilterBar/subcomponents/FilterBarSelect/FilterBarSelect.spec.tsx +37 -24
  115. package/src/Filter/FilterButton/FilterButtonRemovable/FilterButtonRemovable.spec.tsx +12 -12
  116. package/src/Filter/FilterButton/FilterButtonRemovable/FilterButtonRemovable.tsx +15 -2
  117. package/src/Filter/FilterButton/_docs/filter-buttons.mdx +1 -1
  118. package/src/Filter/FilterDatePicker/FilterDatePicker.spec.tsx +21 -16
  119. package/src/Filter/FilterDatePicker/_docs/FilterDatePicker.mdx +1 -1
  120. package/src/Filter/FilterDatePicker/_docs/FilterDatePicker.stickersheet.stories.tsx +50 -1
  121. package/src/Filter/FilterDatePicker/hooks/useDateInputHandlers.spec.ts +3 -3
  122. package/src/Filter/FilterDatePicker/hooks/{useDateValidation.spec.tsx → useDateValidation.spec.ts} +13 -12
  123. package/src/Filter/FilterDatePicker/subcomponents/DateInputField/DateInputField.tsx +10 -1
  124. package/src/Filter/FilterDatePicker/subcomponents/FilterDatePickerField/FilterDatePickerField.spec.tsx +57 -36
  125. package/src/Filter/FilterDatePicker/utils/validateDate.spec.ts +52 -28
  126. package/src/Filter/FilterDateRangePicker/FilterDateRangePicker.spec.tsx +3 -2
  127. package/src/Filter/FilterDateRangePicker/_docs/FilterDateRangePicker.mdx +1 -1
  128. package/src/Filter/FilterDateRangePicker/_docs/FilterDateRangePicker.stickersheet.stories.tsx +55 -24
  129. package/src/Filter/FilterDateRangePicker/subcomponents/DateRangeInputField/DateRangeInputField.spec.tsx +43 -28
  130. package/src/Filter/FilterDateRangePicker/subcomponents/FilterDateRangePickerField/FilterDateRangePickerField.spec.tsx +82 -48
  131. package/src/Filter/FilterDateRangePicker/subcomponents/FilterDateRangePickerField/FilterDateRangePickerField.tsx +6 -1
  132. package/src/Filter/FilterDateRangePicker/subcomponents/FilterDateRangePickerField/hooks/{useEndDateValidation.spec.tsx → useEndDateValidation.spec.ts} +23 -20
  133. package/src/Filter/FilterDateRangePicker/subcomponents/FilterDateRangePickerField/hooks/{useStartDateValidation.spec.tsx → useStartDateValidation.spec.ts} +13 -11
  134. package/src/Filter/FilterDateRangePicker/subcomponents/FilterDateRangePickerField/utils/validateEndDateBeforeStartDate.spec.ts +17 -6
  135. package/src/Filter/FilterDateRangePicker/subcomponents/FilterDateRangePickerField/utils/{validateEndDateBeforeStartDate.ts → validateEndDateBeforeStartDate.tsx} +9 -3
  136. package/src/Filter/FilterMultiSelect/FilterMultiSelect.spec.tsx +10 -14
  137. package/src/Filter/FilterMultiSelect/_docs/FilterMultiSelect.mdx +1 -1
  138. package/src/Filter/FilterMultiSelect/context/SelectionProvider/SelectionProvider.spec.tsx +392 -372
  139. package/src/Filter/FilterMultiSelect/subcomponents/SearchInput/SearchInput.spec.tsx +9 -6
  140. package/src/Filter/FilterSelect/_docs/FilterSelect.mdx +1 -1
  141. package/src/GuidanceBlock/_docs/GuidanceBlock.mdx +1 -1
  142. package/src/Heading/_docs/Heading.mdx +1 -1
  143. package/src/Icon/_docs/Icon.mdx +1 -1
  144. package/src/Illustration/Scene/BrandMomentCaptureIntro/_docs/BrandMomentCaptureIntro.mdx +1 -1
  145. package/src/Illustration/Scene/_docs/Scene.mdx +1 -1
  146. package/src/Illustration/Spot/_docs/Spot.mdx +1 -1
  147. package/src/Input/Input/_docs/Input.mdx +1 -1
  148. package/src/Input/InputRange/_docs/InputRange.mdx +1 -1
  149. package/src/Input/InputSearch/InputSearch.spec.tsx +15 -14
  150. package/src/Input/InputSearch/_docs/InputSearch.mdx +1 -1
  151. package/src/Label/_docs/Label.mdx +1 -1
  152. package/src/LabelledMessage/_docs/LabelledMessage.mdx +1 -1
  153. package/src/LikertScaleLegacy/_docs/LikertScaleLegacy.mdx +1 -1
  154. package/src/Loading/LoadingGraphic/_docs/LoadingGraphic.mdx +1 -1
  155. package/src/Loading/LoadingHeading/_docs/LoadingHeading.mdx +1 -1
  156. package/src/Loading/LoadingInput/_docs/LoadingInput.mdx +1 -1
  157. package/src/Loading/LoadingParagraph/_docs/LoadingParagraph.mdx +1 -1
  158. package/src/Loading/LoadingSpinner/_docs/LoadingSpinner.mdx +1 -1
  159. package/src/Menu/_docs/Menu.mdx +1 -1
  160. package/src/Modal/ConfirmationModal/_docs/ConfirmationModal.mdx +1 -1
  161. package/src/Modal/ContextModal/_docs/ContextModal.mdx +1 -1
  162. package/src/Modal/GenericModal/_docs/GenericModal.mdx +1 -1
  163. package/src/Modal/InputEditModal/_docs/InputEditModal.mdx +1 -1
  164. package/src/MultiSelect/_docs/MultiSelect.mdx +1 -1
  165. package/src/Notification/GlobalNotification/_docs/GlobalNotification.mdx +1 -1
  166. package/src/Notification/InlineNotification/_docs/InlineNotification.mdx +1 -1
  167. package/src/Notification/ToastNotification/_docs/ToastNotification.mdx +1 -1
  168. package/src/Pagination/_docs/Pagination.mdx +1 -1
  169. package/src/Pagination/subcomponents/DirectionalLink/_docs/DirectionalLink.mdx +1 -1
  170. package/src/Pagination/subcomponents/PaginationLink/_docs/PaginationLink.mdx +1 -1
  171. package/src/Popover/_docs/Popover.mdx +1 -1
  172. package/src/ProgressBar/_docs/ProgressBar.mdx +1 -1
  173. package/src/Radio/Radio/_docs/Radio.mdx +1 -1
  174. package/src/Radio/RadioField/_docs/RadioField.mdx +1 -1
  175. package/src/Radio/RadioGroup/_docs/RadioGroup.mdx +1 -1
  176. package/src/RichTextEditor/EditableRichTextContent/_docs/EditableRichTextContent.mdx +1 -1
  177. package/src/RichTextEditor/RichTextContent/_docs/RichTextContent.mdx +1 -1
  178. package/src/RichTextEditor/RichTextEditor/_docs/RichTextEditor.mdx +1 -1
  179. package/src/RichTextEditor/RichTextEditor/subcomponents/ToggleIconButton/_docs/ToggleIconButton.mdx +1 -1
  180. package/src/RichTextEditor/RichTextEditor/subcomponents/Toolbar/_docs/Toolbar.mdx +1 -1
  181. package/src/SearchField/_docs/SearchField.mdx +1 -1
  182. package/src/Select/_docs/Select.mdx +1 -1
  183. package/src/Skirt/_docs/Skirt.mdx +1 -1
  184. package/src/Slider/_docs/Slider.mdx +1 -1
  185. package/src/SplitButton/SplitButton.spec.tsx +11 -6
  186. package/src/SplitButton/_docs/SplitButton.mdx +1 -1
  187. package/src/SplitButton/subcomponents/DropdownButton/DropdownButton.spec.tsx +15 -10
  188. package/src/Table/_docs/Table.mdx +1 -1
  189. package/src/Tabs/_docs/Tabs.mdx +1 -1
  190. package/src/Tag/_docs/Tag.mdx +1 -1
  191. package/src/Text/_docs/Text.mdx +1 -1
  192. package/src/TextArea/_docs/TextArea.mdx +1 -1
  193. package/src/TextAreaField/_docs/TextAreaField.mdx +1 -1
  194. package/src/TextField/_docs/TextField.mdx +1 -1
  195. package/src/Tile/InformationTile/_docs/InformationTile.mdx +1 -1
  196. package/src/Tile/MultiActionTile/_docs/MultiActionTile.mdx +1 -1
  197. package/src/Tile/TileGrid/_docs/TileGrid.mdx +1 -1
  198. package/src/TimeField/_docs/TimeField.mdx +1 -1
  199. package/src/TitleBlockZen/_docs/TitleBlockZen.mdx +1 -1
  200. package/src/ToggleSwitch/ToggleSwitch/_docs/ToggleSwitch.mdx +1 -1
  201. package/src/ToggleSwitch/ToggleSwitchField/_docs/ToggleSwitchField.mdx +1 -1
  202. package/src/VisuallyHidden/_docs/VisuallyHidden.mdx +1 -1
  203. package/src/Well/_docs/Well.mdx +1 -1
  204. package/src/Workflow/_docs/ProgressStepper.mdx +1 -1
  205. package/src/Workflow/_docs/Workflow.mdx +1 -1
  206. package/src/Workflow/_docs/WorkflowFooter.mdx +1 -1
  207. package/src/Workflow/_docs/WorkflowHeader.mdx +1 -1
  208. package/src/__future__/Select/_docs/Select.mdx +1 -1
  209. package/src/__future__/Tag/Tag/_docs/Tag.mdx +1 -1
  210. package/src/__future__/Workflow/_docs/ProgressStepper.mdx +1 -1
  211. package/src/__future__/Workflow/_docs/Workflow.mdx +1 -1
  212. package/src/__future__/Workflow/_docs/WorkflowFooter.mdx +1 -1
  213. package/src/__future__/Workflow/_docs/WorkflowHeader.mdx +1 -1
  214. package/src/__overlays__/Tooltip/v1/_docs/Tooltip.mdx +1 -1
  215. package/src/__overlays__/Tooltip/v3/_docs/ApiSpecification.mdx +0 -1
  216. package/src/__overlays__/Tooltip/v3/_docs/Tooltip.docs.stories.tsx +52 -0
  217. package/src/__overlays__/Tooltip/v3/_docs/Tooltip.mdx +40 -61
  218. package/src/__overlays__/Tooltip/v3/_docs/assets/tooltip_spec.png +0 -0
@@ -1,5 +1,6 @@
1
1
  import React from "react"
2
- import { render, screen } from "@testing-library/react"
2
+ import { screen, waitFor } from "@testing-library/react"
3
+ import { renderWithIntl } from "~tests"
3
4
  import { DropdownButton, DropdownButtonProps } from "./DropdownButton"
4
5
 
5
6
  const DropdownButtonWrapper = (
@@ -7,16 +8,20 @@ const DropdownButtonWrapper = (
7
8
  ): JSX.Element => <DropdownButton {...props} />
8
9
 
9
10
  describe("<DropdownButton />", () => {
10
- it("renders icon with default aria-label", () => {
11
- render(<DropdownButtonWrapper />)
12
- const button = screen.getByRole("button", { name: "Additional actions" })
13
- expect(button.getAttribute("aria-label")).toBe("Additional actions")
14
- expect(button.firstChild?.nodeName).toEqual("svg")
11
+ it("renders icon with default aria-label", async () => {
12
+ renderWithIntl(<DropdownButtonWrapper />)
13
+ await waitFor(() => {
14
+ const button = screen.getByRole("button", { name: "Additional actions" })
15
+ expect(button.getAttribute("aria-label")).toBe("Additional actions")
16
+ expect(button.firstChild?.nodeName).toEqual("svg")
17
+ })
15
18
  })
16
19
 
17
- it("renders custom aria-label", () => {
18
- render(<DropdownButtonWrapper aria-label="Custom aria label" />)
19
- const button = screen.getByRole("button", { name: "Custom aria label" })
20
- expect(button.getAttribute("aria-label")).toBe("Custom aria label")
20
+ it("renders custom aria-label", async () => {
21
+ renderWithIntl(<DropdownButtonWrapper aria-label="Custom aria label" />)
22
+ await waitFor(() => {
23
+ const button = screen.getByRole("button", { name: "Custom aria label" })
24
+ expect(button.getAttribute("aria-label")).toBe("Custom aria label")
25
+ })
21
26
  })
22
27
  })
@@ -10,7 +10,7 @@ import * as TableStories from "./Table.stories"
10
10
  sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/Table"
11
11
  figma="https://www.figma.com/file/ZRfnoNUXbGZv4eVWLbF4Az/%EF%B8%8F%F0%9F%96%BC%EF%B8%8F-Component-Gallery?node-id=9%3A37841&t=P1w10jr2cpPuaayw-1"
12
12
  designGuidelines="https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3081929256/Table"
13
- className="!mb-8"
13
+
14
14
  />
15
15
 
16
16
  <KAIOInstallation
@@ -10,7 +10,7 @@ import * as TabsStories from "./Tabs.stories"
10
10
  sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/Tabs"
11
11
  figma="https://www.figma.com/file/eZKEE5kXbEMY3lx84oz8iN/%F0%9F%92%9C-UI-Kit%3A-Heart?type=design&node-id=1929%3A28886&mode=design&t=AGMmnoJia9RscurE-1"
12
12
  designGuidelines="https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3081929117/Tabs"
13
- className="!mb-8"
13
+
14
14
  />
15
15
 
16
16
  <KAIOInstallation
@@ -11,7 +11,7 @@ import * as TagStories from "./Tag.stories"
11
11
  sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/Tag"
12
12
  figma="https://www.figma.com/file/ZRfnoNUXbGZv4eVWLbF4Az/%EF%B8%8F%F0%9F%96%BC%EF%B8%8F-Component-Gallery?node-id=9%3A37843&t=zlNKMVZd1i6MB4db-1"
13
13
  designGuidelines="https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3081928978/Tags"
14
- className="!mb-8"
14
+
15
15
  />
16
16
 
17
17
 
@@ -9,7 +9,7 @@ import * as TextStories from "./Text.stories"
9
9
  <ResourceLinks
10
10
  sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/Text"
11
11
  designGuidelines="https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3074885298/Typography#Paragraph"
12
- className="!mb-8"
12
+
13
13
  />
14
14
 
15
15
  <KAIOInstallation exportNames="Text" />
@@ -9,7 +9,7 @@ import * as TextAreaStories from "./TextArea.stories"
9
9
 
10
10
  <ResourceLinks
11
11
  sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/TextArea"
12
- className="!mb-8"
12
+
13
13
  />
14
14
 
15
15
  <KAIOInstallation exportNames="TextArea" />
@@ -10,7 +10,7 @@ import * as TextAreaFieldStories from "./TextAreaField.stories"
10
10
  sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/TextAreaField"
11
11
  figma="https://www.figma.com/file/ZRfnoNUXbGZv4eVWLbF4Az/%EF%B8%8F%F0%9F%96%BC%EF%B8%8F-Component-Gallery?node-id=891%3A179030&t=zlNKMVZd1i6MB4db-1"
12
12
  designGuidelines="https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3081895966/Text+Area+Field"
13
- className="!mb-8"
13
+
14
14
  />
15
15
 
16
16
  <KAIOInstallation exportNames="TextAreaField" />
@@ -11,7 +11,7 @@ import * as TextFieldStories from "./TextField.stories"
11
11
  sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/TextField"
12
12
  figma="https://www.figma.com/file/ZRfnoNUXbGZv4eVWLbF4Az/%EF%B8%8F%F0%9F%96%BC%EF%B8%8F-Component-Gallery?node-id=893%3A155422&t=zlNKMVZd1i6MB4db-1"
13
13
  designGuidelines="https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3081928705/Text+Field"
14
- className="!mb-8"
14
+
15
15
  />
16
16
 
17
17
  <KAIOInstallation exportNames="TextField" />
@@ -10,7 +10,7 @@ import * as InformationTileStories from "./InformationTile.stories"
10
10
  sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/Tile/InformationTile"
11
11
  figma="https://www.figma.com/file/ZRfnoNUXbGZv4eVWLbF4Az/%EF%B8%8F%F0%9F%96%BC%EF%B8%8F-Component-Gallery?node-id=9%3A37846&t=QliptwSIGF2YVAnx-1"
12
12
  designGuidelines="https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3079077889/Tile#InformationTile%3A"
13
- className="!mb-8"
13
+
14
14
  />
15
15
 
16
16
  <KAIOInstallation exportNames="InformationTile" />
@@ -10,7 +10,7 @@ import * as MultiActionTileStories from "./MultiActionTile.stories"
10
10
  sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/Tile/MultiActionTile"
11
11
  figma="https://www.figma.com/file/ZRfnoNUXbGZv4eVWLbF4Az/%EF%B8%8F%F0%9F%96%BC%EF%B8%8F-Component-Gallery?node-id=9%3A37846&t=QliptwSIGF2YVAnx-1"
12
12
  designGuidelines="https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3079077889/Tile#MultiActionTile.1"
13
- className="!mb-8"
13
+
14
14
  />
15
15
 
16
16
  <KAIOInstallation exportNames="MultiActionTile" />
@@ -9,7 +9,7 @@ import * as TileGridStories from "./TileGrid.stories"
9
9
  <ResourceLinks
10
10
  sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/Tile/TileGrid"
11
11
  designGuidelines="https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3079077889/Tile#TileGrid"
12
- className="!mb-8"
12
+
13
13
  />
14
14
 
15
15
  <KAIOInstallation exportNames="TileGrid" />
@@ -10,7 +10,7 @@ import * as TimeFieldStories from "./TimeField.stories"
10
10
  sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/TimeField"
11
11
  figma="https://www.figma.com/file/ZRfnoNUXbGZv4eVWLbF4Az/%F0%9F%96%BC%EF%B8%8F-Component-Gallery?type=design&node-id=9%3A37847&mode=design&t=tmk2yNQC5xRRlaQF-1"
12
12
  designGuidelines="https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3078095243/Time+Field"
13
- className="!mb-8"
13
+
14
14
  />
15
15
 
16
16
  <KAIOInstallation exportNames="TimeField" />
@@ -9,7 +9,7 @@ import * as TitleBlockZenStories from "./TitleBlockZen.stories"
9
9
  <ResourceLinks
10
10
  sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/TitleBlockZen"
11
11
  designGuidelines="https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3075605782/Title+Block"
12
- className="!mb-8"
12
+
13
13
  />
14
14
 
15
15
  <KAIOInstallation exportNames="TitleBlockZen" />
@@ -8,7 +8,7 @@ import * as ToggleSwitchStories from "./ToggleSwitch.stories"
8
8
 
9
9
  <ResourceLinks
10
10
  sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/ToggleSwitch/ToggleSwitch"
11
- className="!mb-8"
11
+
12
12
  />
13
13
 
14
14
  <KAIOInstallation exportNames="ToggleSwitch" />
@@ -9,7 +9,7 @@ import * as ToggleSwitchFieldStories from "./ToggleSwitchField.stories"
9
9
  <ResourceLinks
10
10
  sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/ToggleSwitch/ToggleSwitchField"
11
11
  designGuidelines="https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3075638160/Toggle+Switch"
12
- className="!mb-8"
12
+
13
13
  />
14
14
 
15
15
  <KAIOInstallation exportNames="ToggleSwitchField" />
@@ -8,7 +8,7 @@ import * as VisuallyHiddenStories from "./VisuallyHidden.stories"
8
8
 
9
9
  <ResourceLinks
10
10
  sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/VisuallyHidden"
11
- className="!mb-8"
11
+
12
12
  />
13
13
 
14
14
  <KAIOInstallation exportNames="VisuallyHidden" />
@@ -10,7 +10,7 @@ import * as WellStories from "./Well.stories"
10
10
  sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/Well"
11
11
  figma="https://www.figma.com/file/eZKEE5kXbEMY3lx84oz8iN/%E2%9D%A4%EF%B8%8F-UI-Kit%3A-Heart?node-id=1929%3A14167&t=1IXoBrHg5uK6MAJp-1"
12
12
  designGuidelines="https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3075604733/Well"
13
- className="!mb-8"
13
+
14
14
  />
15
15
 
16
16
  <KAIOInstallation exportNames="Well" />
@@ -11,7 +11,7 @@ import * as ProgressStepperStories from "./ProgressStepper.stories"
11
11
  sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/Workflow"
12
12
  figma="https://www.figma.com/file/IJTy1JpS4Xyop5cQwroRje/%F0%9F%9B%A0%EF%B8%8F-Self-reflection%3A-Build-Handoff?node-id=188%3A62005&t=x4zyx07E2G3BmKGw-1"
13
13
  designGuidelines="https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3064989884/Documentation"
14
- className="!mb-8"
14
+
15
15
  />
16
16
 
17
17
  <InlineNotification type="negative" persistent>
@@ -11,7 +11,7 @@ import * as WorkflowHeader from "./WorkflowHeader.stories"
11
11
 
12
12
  <ResourceLinks
13
13
  sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/Workflow"
14
- className="!mb-8"
14
+
15
15
  />
16
16
 
17
17
  <InlineNotification type="negative" persistent>
@@ -11,7 +11,7 @@ import * as WorkflowFooterStories from "./WorkflowFooter.stories"
11
11
  sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/Workflow"
12
12
  figma="https://www.figma.com/file/IJTy1JpS4Xyop5cQwroRje/%F0%9F%9B%A0%EF%B8%8F-Self-reflection%3A-Build-Handoff?node-id=188%3A62005&t=x4zyx07E2G3BmKGw-1"
13
13
  designGuidelines="https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3064989884/Documentation"
14
- className="!mb-8"
14
+
15
15
  />
16
16
 
17
17
  <InlineNotification type="negative" persistent>
@@ -11,7 +11,7 @@ import * as WorkflowHeaderStories from "./WorkflowHeader.stories"
11
11
  sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/Workflow"
12
12
  figma="https://www.figma.com/file/IJTy1JpS4Xyop5cQwroRje/%F0%9F%9B%A0%EF%B8%8F-Self-reflection%3A-Build-Handoff?node-id=188%3A62005&t=x4zyx07E2G3BmKGw-1"
13
13
  designGuidelines="https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3064989884/Documentation"
14
- className="!mb-8"
14
+
15
15
  />
16
16
 
17
17
  <InlineNotification type="negative" persistent>
@@ -10,7 +10,7 @@ import * as SelectStories from "./Select.stories"
10
10
  sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/Select"
11
11
  figma="https://www.figma.com/file/ZRfnoNUXbGZv4eVWLbF4Az/%F0%9F%96%BC%EF%B8%8F-Component-Gallery?node-id=9%3A37837&mode=dev"
12
12
  designGuidelines="https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3081896474/Select"
13
- className="!mb-8"
13
+
14
14
  />
15
15
 
16
16
  <KAIOInstallation exportNames="Select" isFuture />
@@ -9,7 +9,7 @@ import * as TagStories from "./Tag.stories"
9
9
  <ResourceLinks
10
10
  sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/__future__/Tag"
11
11
  designGuidelines="https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3293283155/Tag"
12
- className="!mb-8"
12
+
13
13
  />
14
14
 
15
15
  <KAIOInstallation exportNames="Tag" isFuture />
@@ -10,7 +10,7 @@ import * as ProgressStepperStories from "./ProgressStepper.stories"
10
10
  sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/Workflow"
11
11
  figma="https://www.figma.com/file/IJTy1JpS4Xyop5cQwroRje/%F0%9F%9B%A0%EF%B8%8F-Self-reflection%3A-Build-Handoff?node-id=188%3A62005&t=x4zyx07E2G3BmKGw-1"
12
12
  designGuidelines="https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3064989884/Documentation"
13
- className="!mb-8"
13
+
14
14
  />
15
15
 
16
16
  <KaioLegacyDocsNotification version="1.16.0" />
@@ -10,7 +10,7 @@ import * as WorkflowHeader from "./WorkflowHeader.stories"
10
10
 
11
11
  <ResourceLinks
12
12
  sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/Workflow"
13
- className="!mb-8"
13
+
14
14
  />
15
15
 
16
16
 
@@ -10,7 +10,7 @@ import * as WorkflowFooterStories from "./WorkflowFooter.stories"
10
10
  sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/Workflow"
11
11
  figma="https://www.figma.com/file/IJTy1JpS4Xyop5cQwroRje/%F0%9F%9B%A0%EF%B8%8F-Self-reflection%3A-Build-Handoff?node-id=188%3A62005&t=x4zyx07E2G3BmKGw-1"
12
12
  designGuidelines="https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3064989884/Documentation"
13
- className="!mb-8"
13
+
14
14
  />
15
15
 
16
16
 
@@ -10,7 +10,7 @@ import * as WorkflowHeaderStories from "./WorkflowHeader.stories"
10
10
  sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/Workflow"
11
11
  figma="https://www.figma.com/file/IJTy1JpS4Xyop5cQwroRje/%F0%9F%9B%A0%EF%B8%8F-Self-reflection%3A-Build-Handoff?node-id=188%3A62005&t=x4zyx07E2G3BmKGw-1"
12
12
  designGuidelines="https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3064989884/Documentation"
13
- className="!mb-8"
13
+
14
14
  />
15
15
 
16
16
 
@@ -10,7 +10,7 @@ import * as TooltipStories from "./Tooltip.stories"
10
10
  sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/Tooltip"
11
11
  figma="https://www.figma.com/file/eZKEE5kXbEMY3lx84oz8iN/%F0%9F%92%9C-UI-Kit%3A-Heart?type=design&node-id=1929%3A32006&mode=design&t=LwTCBZ5E1uRvOA1l-1"
12
12
  designGuidelines="https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3075604978/Tooltip"
13
- className="!mb-8"
13
+
14
14
  />
15
15
 
16
16
  <Installation
@@ -16,7 +16,6 @@ import * as exampleStories from "./Tooltip.stories"
16
16
  figma="https://www.figma.com/file/eZKEE5kXbEMY3lx84oz8iN/%F0%9F%92%9C-UI-Kit%3A-Heart?type=design&node-id=1929%3A32006&mode=design&t=LwTCBZ5E1uRvOA1l-1"
17
17
  designGuidelines="/?path=/docs/overlays-tooltip-v3-usage-guidelines--docs"
18
18
  ariaComponentPage="https://react-spectrum.adobe.com/react-aria/Tooltip.html"
19
- className="mt-16 !mb-8"
20
19
  />
21
20
 
22
21
  <SbContent className="mb-24">
@@ -6,6 +6,7 @@ import { FieldMessage } from "~components/FieldMessage"
6
6
  import { AddIcon, QuestionIcon } from "~components/Icon"
7
7
  import { Input } from "~components/Input"
8
8
  import { Label } from "~components/Label"
9
+ import { Text } from "~components/Text"
9
10
  import { Focusable } from "~components/__overlays__/v3"
10
11
  import { Tooltip, TooltipTrigger } from "../index"
11
12
  import * as TestStories from "./Tooltip.spec.stories"
@@ -201,3 +202,54 @@ export const UncontrolledState: Story = {
201
202
  )
202
203
  },
203
204
  }
205
+
206
+ export const TriggerDo: Story = {
207
+ play: undefined,
208
+ args: { placement: "end", shouldFlip: false },
209
+ render: () => (
210
+ <Text variant="body" classNameOverride="bg-white p-12 rounded">
211
+ This is an example of an inline{" "}
212
+ <TooltipTrigger>
213
+ <Focusable>
214
+ <a href="#inline-test" className="text-inherit">
215
+ tooltip
216
+ </a>
217
+ </Focusable>
218
+ <Tooltip>Tooltip label</Tooltip>
219
+ </TooltipTrigger>
220
+ </Text>
221
+ ),
222
+ }
223
+ export const TriggerDont: Story = {
224
+ play: undefined,
225
+ args: { placement: "end", shouldFlip: false },
226
+ render: () => (
227
+ <Text variant="body" classNameOverride="bg-white p-12 rounded">
228
+ This is an example of an inline{" "}
229
+ <TooltipTrigger>
230
+ <Focusable>
231
+ <span>tooltip</span>
232
+ </Focusable>
233
+ <Tooltip>Tooltip label</Tooltip>
234
+ </TooltipTrigger>
235
+ </Text>
236
+ ),
237
+ }
238
+ export const TriggerLinkDescription: Story = {
239
+ play: undefined,
240
+ args: { placement: "end", shouldFlip: false },
241
+ render: () => (
242
+ <Text variant="body" classNameOverride="bg-white p-12 rounded">
243
+ Use tooltips inline when you want to{" "}
244
+ <TooltipTrigger>
245
+ <Focusable>
246
+ <a href="#describe-link" className="text-inherit">
247
+ describe a link
248
+ </a>
249
+ </Focusable>
250
+ <Tooltip>Tooltip label</Tooltip>
251
+ </TooltipTrigger>
252
+ .
253
+ </Text>
254
+ ),
255
+ }
@@ -1,12 +1,9 @@
1
1
  import { Canvas, Meta, Controls } from "@storybook/blocks"
2
- import { CheckIcon, ClearIcon } from "~components/Icon"
3
- import { ResourceLinks, SbContent, Installation } from "~storybook/components"
2
+ import { ResourceLinks, SbContent, Installation, DosAndDonts, DoOrDont } from "~storybook/components"
4
3
  import * as TooltipStories from "./Tooltip.docs.stories"
5
4
  import AnatomyPng from "./assets/tooltip_anatomy.png"
6
5
  import PlacementPng from "./assets/tooltip_placement.png"
7
- import Trigger1Png from "./assets/tooltip_trigger_1.png"
8
- import Trigger2Png from "./assets/tooltip_trigger_2.png"
9
- import Trigger3Png from "./assets/tooltip_trigger_3.png"
6
+ import DesignSpecPng from "./assets/tooltip_spec.png"
10
7
  import WhenToUsePng from "./assets/tooltip_variant.png"
11
8
 
12
9
  <Meta title="Overlays/Tooltip/v3/Usage Guidelines" />
@@ -24,7 +21,6 @@ import WhenToUsePng from "./assets/tooltip_variant.png"
24
21
  designGuidelines="/?path=/docs/overlays-tooltip-v3-usage-guidelines--docs"
25
22
  ariaComponentPage="https://react-spectrum.adobe.com/react-aria/Tooltip.html"
26
23
  apiSpecification="/?path=/docs/overlays-tooltip-v3-api-specifications--docs"
27
- className="!mb-8"
28
24
  />
29
25
 
30
26
  <SbContent>
@@ -70,76 +66,47 @@ import WhenToUsePng from "./assets/tooltip_variant.png"
70
66
  - Trigger tooltips from Interactive elements (Buttons, Links, Icon buttons) or Non-interactive elements (Icons, Abbreviations Truncated text)—be mindful of keyboard accessibility
71
67
  - **Never include any kind of error messages** in a tooltip
72
68
 
73
- <img src={WhenToUsePng} alt="Illustration of when to use the Tooltip component" className="mt-24"/>
69
+ <img src={WhenToUsePng} className="mt-32" alt="Illustration of when to use the Tooltip component" />
74
70
  </ SbContent>
75
71
 
76
- <SbContent >
77
- ### Dos and don'ts
78
- </SbContent >
72
+ <SbContent className="mb-64">
73
+ ### Specs
74
+ <img src={DesignSpecPng} alt="" />
75
+ </ SbContent>
79
76
 
80
77
  <div className="flex flex-col mt-16 gap-40 mb-64">
81
78
  <div className="flex flex-col m-0 gap-16">
82
- <SbContent variant="heading-4">
79
+ <SbContent>
83
80
  #### Do use tooltips to describe icons
84
81
  Icons are not always easy to identify on their own. When you use components that don&apos;t have labels — for example, icon-only action buttons and tabs — make sure to use tooltips to provide context for the icons.
85
82
  </SbContent>
86
- <div className="grid grid-cols-2 gap-16">
87
- <div className="relative [&>*]:m-0">
88
- <div className="bg-green-500 absolute top-6 left-6 z-10 py-4 px-6 font-bold text-white rounded flex gap-2 items-center justify-center">
89
- <CheckIcon role="presentation" />
90
- <SbContent ><span className="text-white"><strong>Do</strong></span></SbContent>
91
- </div>
92
- <Canvas of={TooltipStories.Primary} className="border-green-500 !rounded" />
93
- </div>
94
- </div>
83
+ <DosAndDonts>
84
+ <DoOrDont story={TooltipStories.Primary} />
85
+ </DosAndDonts>
95
86
  </div>
96
87
 
97
88
  <div className="flex flex-col gap-16">
98
- <SbContent variant="heading-4">
89
+ <SbContent>
99
90
  #### Don&apos;t use tooltips to communicate crucial information
100
91
 
101
92
  Tooltips should never stop a user (or be a gate) from completing a task or performing an action. They disappear so they should never contain critical information that a user would absolutely need to proceed, or information without which a user may cause errors. If the information is crucial for a user to proceed, consider using a modal or inline notification instead.
102
93
  </SbContent>
103
- <div className="grid grid-cols-2 gap-16">
104
- <div className="relative [&>*]:m-0">
105
- <div className="bg-green-500 absolute top-6 left-6 z-10 py-4 px-6 font-bold text-white rounded flex gap-2 items-center justify-center">
106
- <CheckIcon role="presentation" />
107
- <SbContent ><span className="text-white"><strong>Do</strong></span></SbContent>
108
- </div>
109
- <Canvas of={TooltipStories.DoFieldTooltip} className="border-green-500 !rounded-[10px]" />
110
- </div>
111
- <div className="relative [&>*]:m-0">
112
- <div className="bg-gray-500 absolute top-6 left-6 z-10 py-4 px-6 font-bold text-white rounded flex gap-2 items-center justify-center">
113
- <ClearIcon role="presentation" />
114
- <SbContent ><span className="text-white"><strong>Don&apos;t</strong></span></SbContent>
115
- </div>
116
- <Canvas of={TooltipStories.DontFieldTooltip} className="border-gray-500 !rounded-[10px]" />
117
- </div>
118
- </div>
94
+ <DosAndDonts>
95
+ <DoOrDont story={TooltipStories.DoFieldTooltip} />
96
+ <DoOrDont story={TooltipStories.DontFieldTooltip} isDont />
97
+ </DosAndDonts>
119
98
  </div>
120
99
 
121
100
  <div className="flex flex-col m-0 gap-16">
122
- <SbContent variant="heading-4">
101
+ <SbContent>
123
102
  #### Do be concise
124
103
 
125
104
  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.
126
105
  </SbContent>
127
- <div className="grid grid-cols-2 gap-16">
128
- <div className="relative [&>*]:m-0">
129
- <div className="bg-green-500 absolute top-6 left-6 z-10 py-4 px-6 font-bold text-white rounded flex gap-2 items-center justify-center">
130
- <CheckIcon role="presentation" />
131
- <SbContent ><span className="text-white"><strong>Do</strong></span></SbContent>
132
- </div>
133
- <Canvas of={TooltipStories.DoConcise} className="border-green-500 !rounded-[10px]" />
134
- </div>
135
- <div className="relative [&>*]:m-0">
136
- <div className="bg-gray-500 absolute top-6 left-6 z-10 py-4 px-6 font-bold text-white rounded flex gap-2 items-center justify-center">
137
- <ClearIcon role="presentation" />
138
- <SbContent ><span className="text-white"><strong>Don&apos;t</strong></span></SbContent>
139
- </div>
140
- <Canvas of={TooltipStories.DontConcise} className="border-gray-500 !rounded-[10px]" />
141
- </div>
142
- </div>
106
+ <DosAndDonts>
107
+ <DoOrDont story={TooltipStories.DoConcise}/>
108
+ <DoOrDont story={TooltipStories.DontConcise} isDont />
109
+ </DosAndDonts>
143
110
  </div>
144
111
  </div>
145
112
 
@@ -155,28 +122,40 @@ import WhenToUsePng from "./assets/tooltip_variant.png"
155
122
  - The proximity of tooltips is always paired to the element with which they are associated.
156
123
  </SbContent>
157
124
 
158
- <SbContent className="mb-64">
125
+ <SbContent className="mb-24">
159
126
  ### Trigger
160
127
 
161
- - Should be shown on hover, click or on focus events
162
- - Needs to be discoverable:
128
+ - A tooltip trigger needs to be discoverable:
163
129
  - E.g. something like an icon to suggest there’s a tooltip.
164
130
  - Avoid triggering tooltips from text that excludes a visual indicator (e.g. underline)
131
+ - A tooltip should be shown and accessible on hover, click or on focus events.
132
+ </SbContent>
165
133
 
166
- <img src={Trigger1Png} alt="" className="my-24" />
134
+ <div className="mb-32">
135
+ <DosAndDonts>
136
+ <DoOrDont story={TooltipStories.TriggerDo} />
137
+ <DoOrDont story={TooltipStories.TriggerDont} isDont/>
138
+ </DosAndDonts>
139
+ </div>
167
140
 
141
+ <SbContent className="mb-24">
168
142
  - Only trigger tooltips from interactive elements, such as:
169
143
  - Buttons
170
144
  - Links
171
145
  - Icon buttons
146
+ </SbContent>
172
147
 
173
- <img src={Trigger2Png} alt="" className="my-24" />
148
+ <div className="mb-32">
149
+ <DosAndDonts>
150
+ <DoOrDont story={TooltipStories.Primary} />
151
+ <DoOrDont story={TooltipStories.TriggerLinkDescription} />
152
+ </DosAndDonts>
153
+ </div>
174
154
 
155
+ <SbContent>
175
156
  - Non-interactive elements (be mindful of keyboard accessibility):
176
157
  - Icons
177
158
  - Abbreviations (e.g. dashed underlined text for HRIS that shows a tooltip that says Human Resource Information System)
178
159
  - Truncated text
179
160
  - For interactive elements that trigger tooltips, only have optional information in the tooltip because it could be missed when the user clicks
180
-
181
- <img src={Trigger3Png} alt="" className="my-24" />
182
161
  </SbContent>