@kaizen/components 1.68.2 → 1.68.3

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 (105) hide show
  1. package/dist/cjs/Tile/subcomponents/GenericTile/GenericTile.cjs +16 -3
  2. package/dist/esm/Tile/subcomponents/GenericTile/GenericTile.mjs +16 -3
  3. package/dist/styles.css +112 -112
  4. package/dist/types/Tile/subcomponents/GenericTile/GenericTile.d.ts +3 -1
  5. package/locales/en.json +8 -0
  6. package/package.json +1 -1
  7. package/src/Avatar/_docs/Avatar.stickersheet.stories.tsx +30 -32
  8. package/src/AvatarGroup/_docs/AvatarGroup.stickersheet.stories.tsx +14 -16
  9. package/src/Badge/_docs/Badge.stickersheet.stories.tsx +22 -22
  10. package/src/Brand/_docs/Brand.stickersheet.stories.tsx +24 -26
  11. package/src/BrandMoment/_docs/BrandMoment.stickersheet.stories.tsx +35 -39
  12. package/src/ButtonGroup/_docs/ButtonGroup.stickersheet.stories.tsx +117 -122
  13. package/src/Calendar/CalendarPopover/_docs/CalendarPopover.stickersheet.stories.tsx +4 -4
  14. package/src/Calendar/CalendarRange/_docs/CalendarRange.stickersheet.stories.tsx +22 -30
  15. package/src/Calendar/CalendarSingle/_docs/CalendarSingle.stickersheet.stories.tsx +58 -58
  16. package/src/Card/_docs/Card.stickersheet.stories.tsx +12 -16
  17. package/src/Checkbox/Checkbox/_docs/Checkbox.stickersheet.stories.tsx +24 -27
  18. package/src/Checkbox/CheckboxField/_docs/CheckboxField.stickersheet.stories.tsx +31 -34
  19. package/src/Checkbox/CheckboxGroup/_docs/CheckboxGroup.stickersheet.stories.tsx +25 -29
  20. package/src/ClearButton/_docs/ClearButton.stickersheet.stories.tsx +9 -9
  21. package/src/Collapsible/Collapsible/_docs/Collapsible.stickersheet.stories.tsx +56 -62
  22. package/src/Collapsible/CollapsibleGroup/_docs/CollapsibleGroup.stickersheet.stories.tsx +19 -21
  23. package/src/Collapsible/ExpertAdviceCollapsible/_docs/ExpertAdviceCollapsible.stickersheets.stories.tsx +6 -8
  24. package/src/DatePicker/_docs/DatePicker.stickersheet.stories.tsx +129 -144
  25. package/src/DatePicker/_docs/getLocale.stickersheet.stories.tsx +9 -11
  26. package/src/DateRangePicker/_docs/DateRangePicker.stickersheet.stories.tsx +26 -28
  27. package/src/Divider/_docs/Divider.stickersheet.stories.tsx +13 -10
  28. package/src/EmptyState/_docs/EmptyState.stickersheet.stories.tsx +7 -2
  29. package/src/ErrorPage/_docs/ErrorPage.stickersheet.stories.tsx +16 -20
  30. package/src/FieldGroup/_docs/FieldGroup.stickersheet.stories.tsx +5 -8
  31. package/src/FieldMessage/_docs/FieldMessage.stickersheet.stories.tsx +10 -20
  32. package/src/Filter/Filter/_docs/Filter.stickersheet.stories.tsx +13 -15
  33. package/src/Filter/FilterBar/_docs/FilterBar.stickersheet.stories.tsx +33 -47
  34. package/src/Filter/FilterButton/_docs/filter-buttons.stickersheet.stories.tsx +45 -51
  35. package/src/Filter/FilterDatePicker/_docs/FilterDatePicker.stickersheet.stories.tsx +74 -93
  36. package/src/Filter/FilterDateRangePicker/_docs/FilterDateRangePicker.stickersheet.stories.tsx +110 -128
  37. package/src/Filter/FilterSelect/_docs/FilterSelect.stickersheet.stories.tsx +239 -249
  38. package/src/GuidanceBlock/_docs/GuidanceBlock.stickersheet.stories.tsx +38 -40
  39. package/src/Heading/_docs/Heading.stickersheet.stories.tsx +101 -111
  40. package/src/Icon/_docs/Icon.stickersheet.stories.tsx +13 -19
  41. package/src/Illustration/Scene/BrandMomentCaptureIntro/_docs/BrandMomentCaptureIntro.stickersheet.stories.tsx +8 -8
  42. package/src/Illustration/Scene/_docs/Scene.stickersheet.stories.tsx +139 -185
  43. package/src/Illustration/subcomponents/VideoPlayer/VideoPlayer.stickersheet.stories.tsx +39 -41
  44. package/src/Input/Input/_docs/Input.stickersheet.stories.tsx +30 -33
  45. package/src/Input/InputRange/_docs/InputRange.stickersheet.stories.tsx +21 -20
  46. package/src/Input/InputSearch/_docs/InputSearch.stickersheet.stories.tsx +137 -144
  47. package/src/Label/_docs/Label.stickersheet.stories.tsx +78 -85
  48. package/src/LabelledMessage/_docs/LabelledMessage.stickersheet.stories.tsx +3 -5
  49. package/src/LikertScaleLegacy/_docs/LikertScaleLegacy.stickersheet.stories.tsx +82 -82
  50. package/src/Loading/LoadingGraphic/_docs/LoadingGraphic.stickersheet.stories.tsx +18 -20
  51. package/src/Loading/LoadingGraphic/_docs/LoadingGraphic.stories.tsx +46 -52
  52. package/src/Loading/LoadingHeading/_docs/LoadingHeading.stickersheet.stories.tsx +14 -18
  53. package/src/Loading/LoadingHeading/_docs/LoadingHeading.stories.tsx +7 -13
  54. package/src/Loading/LoadingParagraph/_docs/LoadingParagraph.stickersheet.stories.tsx +14 -16
  55. package/src/Loading/LoadingSpinner/_docs/LoadingSpinner.stickersheet.stories.tsx +13 -15
  56. package/src/MultiSelect/_docs/MultiSelect.stickersheet.stories.tsx +69 -74
  57. package/src/MultiSelect/subcomponents/Checkbox/_docs/Checkbox.stickersheet.stories.tsx +22 -28
  58. package/src/MultiSelect/subcomponents/MultiSelectOptionField/_docs/MultiSelectOptionField.stickersheet.stories.tsx +62 -67
  59. package/src/MultiSelect/subcomponents/MultiSelectOptions/_docs/MultiSelectOptions.stickersheet.stories.tsx +21 -28
  60. package/src/MultiSelect/subcomponents/MultiSelectToggle/_docs/MultiSelectToggle.stickersheet.stories.tsx +69 -93
  61. package/src/Notification/GlobalNotification/_docs/GlobalNotification.stickersheet.stories.tsx +13 -16
  62. package/src/Notification/InlineNotification/_docs/InlineNotification.stickersheet.stories.tsx +13 -16
  63. package/src/Pagination/_docs/Pagination.stickersheet.stories.tsx +60 -74
  64. package/src/Pagination/subcomponents/DirectionalLink/_docs/DirectionalLink.stickersheet.stories.tsx +21 -23
  65. package/src/Pagination/subcomponents/PaginationLink/_docs/PaginationLink.stickersheet.stories.tsx +24 -28
  66. package/src/Popover/_docs/Popover.stickersheet.stories.tsx +33 -45
  67. package/src/ProgressBar/_docs/ProgressBar.stickersheet.stories.tsx +15 -26
  68. package/src/Radio/Radio/_docs/Radio.stickersheet.stories.tsx +46 -54
  69. package/src/Radio/RadioField/_docs/RadioField.stickersheet.stories.tsx +51 -54
  70. package/src/Radio/RadioGroup/_docs/RadioGroup.stickersheet.stories.tsx +80 -86
  71. package/src/RichTextEditor/EditableRichTextContent/_docs/EditableRichTextContent.stickersheet.stories.tsx +42 -58
  72. package/src/RichTextEditor/RichTextEditor/subcomponents/ToggleIconButton/_docs/ToggleIconButton.stickersheet.stories.tsx +34 -57
  73. package/src/SearchField/_docs/SearchField.stickersheet.stories.tsx +32 -31
  74. package/src/Select/_docs/Select.stickersheet.stories.tsx +128 -127
  75. package/src/Slider/_docs/Slider.stickersheet.stories.tsx +85 -96
  76. package/src/SplitButton/_docs/SplitButton.stickersheet.stories.tsx +62 -68
  77. package/src/Tag/_docs/Tag.stickersheet.stories.tsx +49 -57
  78. package/src/Text/_docs/Text.stickersheet.stories.tsx +43 -47
  79. package/src/TextArea/_docs/TextArea.stickersheet.stories.tsx +28 -31
  80. package/src/TextAreaField/_docs/TextAreaField.stickersheet.stories.tsx +71 -89
  81. package/src/TextField/_docs/TextField.stickersheet.stories.tsx +47 -50
  82. package/src/Tile/InformationTile/_docs/InformationTile.mdx +4 -0
  83. package/src/Tile/InformationTile/_docs/InformationTile.stickersheet.stories.tsx +15 -21
  84. package/src/Tile/InformationTile/_docs/InformationTile.stories.tsx +7 -0
  85. package/src/Tile/MultiActionTile/_docs/MultiActionTile.stickersheet.stories.tsx +15 -21
  86. package/src/Tile/TileGrid/_docs/TileGrid.stickersheet.stories.tsx +91 -99
  87. package/src/Tile/subcomponents/GenericTile/GenericTile.spec.stories.tsx +65 -5
  88. package/src/Tile/subcomponents/GenericTile/GenericTile.tsx +20 -2
  89. package/src/Tile/subcomponents/GenericTile/_docs/GenericTile.stickersheet.stories.tsx +15 -21
  90. package/src/TimeField/_docs/TimeField.stickersheet.stories.tsx +74 -83
  91. package/src/TitleBlockZen/_docs/TitleBlockZen.stories.tsx +73 -75
  92. package/src/ToggleSwitch/ToggleSwitch/_docs/ToggleSwitch.stickersheet.stories.tsx +24 -27
  93. package/src/ToggleSwitch/ToggleSwitchField/_docs/ToggleSwitchField.stickersheet.stories.tsx +47 -50
  94. package/src/Well/_docs/Well.stickersheet.stories.tsx +31 -41
  95. package/src/__actions__/Button/v1/Button/_docs/Button.stickersheet.stories.tsx +107 -146
  96. package/src/__actions__/Button/v1/IconButton/_docs/IconButton.stickersheet.stories.tsx +26 -29
  97. package/src/__actions__/Button/v3/_docs/Button.stickersheet.stories.tsx +141 -159
  98. package/src/__actions__/Menu/v1/_docs/Menu.stickersheet.stories.tsx +33 -36
  99. package/src/__future__/Icon/_docs/Icon.docs.stories.tsx +17 -23
  100. package/src/__future__/Icon/_docs/Icon.stickersheet.stories.tsx +63 -72
  101. package/src/__future__/Select/_docs/Select.stickersheet.stories.tsx +287 -309
  102. package/src/__future__/Tag/RemovableTag/_docs/RemovableTag.stickersheet.stories.tsx +42 -46
  103. package/src/__future__/Tag/Tag/_docs/Tag.stickersheet.stories.tsx +14 -17
  104. package/src/__overlays__/Tooltip/v1/_docs/Tooltip.stickersheet.stories.tsx +101 -103
  105. package/src/__overlays__/Tooltip/v3/_docs/Tooltip.stickersheet.stories.tsx +3 -4
@@ -32,56 +32,53 @@ const TextFieldExampleGroup = (props: TextFieldProps): JSX.Element => (
32
32
 
33
33
  const StickerSheetTemplate: StickerSheetStory = {
34
34
  render: ({ isReversed }) => (
35
- <StickerSheet isReversed={isReversed}>
36
- <StickerSheet.Header
37
- headings={["Default", "Hover", "Active", "Focus", "Disabled"]}
38
- hasVerticalHeadings
39
- />
40
- <StickerSheet.Body>
41
- {InputStatus.map(status => (
42
- <StickerSheet.Row key={status} rowTitle={status}>
43
- <TextFieldExampleGroup
44
- reversed={isReversed}
45
- labelText="TextField"
46
- description="A short description"
47
- status={status}
48
- validationMessage="A valid question"
49
- />
50
- <TextFieldExampleGroup
51
- reversed={isReversed}
52
- labelText="TextField"
53
- description="A short description"
54
- status={status}
55
- validationMessage="A valid question"
56
- data-sb-pseudo-styles="hover"
57
- />
58
- <TextFieldExampleGroup
59
- reversed={isReversed}
60
- labelText="TextField"
61
- description="A short description"
62
- status={status}
63
- validationMessage="A valid question"
64
- data-sb-pseudo-styles="active"
65
- />
66
- <TextFieldExampleGroup
67
- reversed={isReversed}
68
- labelText="TextField"
69
- description="A short description"
70
- status={status}
71
- validationMessage="A valid question"
72
- data-sb-pseudo-styles="focus"
73
- />
74
- <TextFieldExampleGroup
75
- reversed={isReversed}
76
- labelText="TextField"
77
- description="A short description"
78
- status={status}
79
- validationMessage="A valid question"
80
- disabled
81
- />
82
- </StickerSheet.Row>
83
- ))}
84
- </StickerSheet.Body>
35
+ <StickerSheet
36
+ isReversed={isReversed}
37
+ headers={["Default", "Hover", "Active", "Focus", "Disabled"]}
38
+ >
39
+ {InputStatus.map(status => (
40
+ <StickerSheet.Row key={status} header={status}>
41
+ <TextFieldExampleGroup
42
+ reversed={isReversed}
43
+ labelText="TextField"
44
+ description="A short description"
45
+ status={status}
46
+ validationMessage="A valid question"
47
+ />
48
+ <TextFieldExampleGroup
49
+ reversed={isReversed}
50
+ labelText="TextField"
51
+ description="A short description"
52
+ status={status}
53
+ validationMessage="A valid question"
54
+ data-sb-pseudo-styles="hover"
55
+ />
56
+ <TextFieldExampleGroup
57
+ reversed={isReversed}
58
+ labelText="TextField"
59
+ description="A short description"
60
+ status={status}
61
+ validationMessage="A valid question"
62
+ data-sb-pseudo-styles="active"
63
+ />
64
+ <TextFieldExampleGroup
65
+ reversed={isReversed}
66
+ labelText="TextField"
67
+ description="A short description"
68
+ status={status}
69
+ validationMessage="A valid question"
70
+ data-sb-pseudo-styles="focus"
71
+ />
72
+ <TextFieldExampleGroup
73
+ reversed={isReversed}
74
+ labelText="TextField"
75
+ description="A short description"
76
+ status={status}
77
+ validationMessage="A valid question"
78
+ disabled
79
+ />
80
+ </StickerSheet.Row>
81
+ ))}
85
82
  </StickerSheet>
86
83
  ),
87
84
  parameters: {
@@ -30,3 +30,7 @@ A visually interesting item in a list consisting of a card, visual, title, metad
30
30
 
31
31
  ### Information
32
32
  <Canvas of={InformationTileStories.Information} />
33
+
34
+
35
+ ### Information Button Label
36
+ <Canvas of={InformationTileStories.TileWithCustomInfoLabel} />
@@ -38,29 +38,23 @@ const StickerSheetTemplate: StickerSheetStory = {
38
38
 
39
39
  return (
40
40
  <>
41
- <StickerSheet heading="InformationTile">
42
- <StickerSheet.Body>
43
- {variants.map(variant => (
44
- <StickerSheet.Row key={variant} rowTitle={variant}>
45
- <InformationTile {...defaultProps} variant={variant} />
46
- </StickerSheet.Row>
47
- ))}
48
- </StickerSheet.Body>
41
+ <StickerSheet title="InformationTile">
42
+ {variants.map(variant => (
43
+ <StickerSheet.Row key={variant} header={variant}>
44
+ <InformationTile {...defaultProps} variant={variant} />
45
+ </StickerSheet.Row>
46
+ ))}
49
47
  </StickerSheet>
50
48
 
51
- <StickerSheet heading="Mood (deprecated)">
52
- <StickerSheet.Body>
53
- <>
54
- <StickerSheet.Row rowTitle="default">
55
- <InformationTile {...defaultProps} />
56
- </StickerSheet.Row>
57
- {moods.map(mood => (
58
- <StickerSheet.Row key={mood} rowTitle={mood}>
59
- <InformationTile {...defaultProps} mood={mood} />
60
- </StickerSheet.Row>
61
- ))}
62
- </>
63
- </StickerSheet.Body>
49
+ <StickerSheet title="Mood (deprecated)">
50
+ <StickerSheet.Row header="default">
51
+ <InformationTile {...defaultProps} />
52
+ </StickerSheet.Row>
53
+ {moods.map(mood => (
54
+ <StickerSheet.Row key={mood} header={mood}>
55
+ <InformationTile {...defaultProps} mood={mood} />
56
+ </StickerSheet.Row>
57
+ ))}
64
58
  </StickerSheet>
65
59
  </>
66
60
  )
@@ -54,3 +54,10 @@ export const Information: Story = {
54
54
  information: "Side B",
55
55
  },
56
56
  }
57
+
58
+ export const TileWithCustomInfoLabel: Story = {
59
+ args: {
60
+ infoButtonLabel: "Test",
61
+ information: "Side B",
62
+ },
63
+ }
@@ -43,29 +43,23 @@ const StickerSheetTemplate: StickerSheetStory = {
43
43
 
44
44
  return (
45
45
  <>
46
- <StickerSheet heading="MultiActionTile">
47
- <StickerSheet.Body>
48
- {variants.map(variant => (
49
- <StickerSheet.Row key={variant} rowTitle={variant}>
50
- <MultiActionTile {...defaultProps} variant={variant} />
51
- </StickerSheet.Row>
52
- ))}
53
- </StickerSheet.Body>
46
+ <StickerSheet title="MultiActionTile">
47
+ {variants.map(variant => (
48
+ <StickerSheet.Row key={variant} header={variant}>
49
+ <MultiActionTile {...defaultProps} variant={variant} />
50
+ </StickerSheet.Row>
51
+ ))}
54
52
  </StickerSheet>
55
53
 
56
- <StickerSheet heading="Mood (deprecated)">
57
- <StickerSheet.Body>
58
- <>
59
- <StickerSheet.Row rowTitle="default">
60
- <MultiActionTile {...defaultProps} />
61
- </StickerSheet.Row>
62
- {moods.map(mood => (
63
- <StickerSheet.Row key={mood} rowTitle={mood}>
64
- <MultiActionTile {...defaultProps} mood={mood} />
65
- </StickerSheet.Row>
66
- ))}
67
- </>
68
- </StickerSheet.Body>
54
+ <StickerSheet title="Mood (deprecated)">
55
+ <StickerSheet.Row header="default">
56
+ <MultiActionTile {...defaultProps} />
57
+ </StickerSheet.Row>
58
+ {moods.map(mood => (
59
+ <StickerSheet.Row key={mood} header={mood}>
60
+ <MultiActionTile {...defaultProps} mood={mood} />
61
+ </StickerSheet.Row>
62
+ ))}
69
63
  </StickerSheet>
70
64
  </>
71
65
  )
@@ -17,105 +17,97 @@ export default {
17
17
 
18
18
  const StickerSheetTemplate: StickerSheetStory = {
19
19
  render: () => (
20
- <StickerSheet>
21
- <StickerSheet.Body>
22
- <StickerSheet.Row rowTitle="One row">
23
- <StickerSheet.Cell width={1000}>
24
- <TileGrid>
25
- <InformationTile
26
- title="Title"
27
- metadata="Side A"
28
- information="Side B"
29
- footer={<>Footer</>}
30
- />
31
- <InformationTile
32
- title="Title"
33
- metadata="Side A"
34
- information="Side B"
35
- footer={<>Footer</>}
36
- />
37
- <InformationTile
38
- title="Title"
39
- metadata="Side A"
40
- information="Side B"
41
- footer={<>Footer</>}
42
- />
43
- </TileGrid>
44
- </StickerSheet.Cell>
45
- </StickerSheet.Row>
46
- <StickerSheet.Row rowTitle="Two rows">
47
- <StickerSheet.Cell width={1000}>
48
- <TileGrid>
49
- <InformationTile
50
- title="Title"
51
- metadata="Side A"
52
- information="Side B"
53
- footer={<>Footer</>}
54
- />
55
- <InformationTile
56
- title="Title"
57
- metadata="Side A"
58
- information="Side B"
59
- footer={<>Footer</>}
60
- />
61
- <InformationTile
62
- title="Title"
63
- metadata="Side A"
64
- information="Side B"
65
- footer={<>Footer</>}
66
- />
67
- <InformationTile
68
- title="Title"
69
- metadata="Side A"
70
- information="Side B"
71
- footer={<>Footer</>}
72
- />
73
- <InformationTile
74
- title="Title"
75
- metadata="Side A"
76
- information="Side B"
77
- footer={<>Footer</>}
78
- />
79
- <InformationTile
80
- title="Title"
81
- metadata="Side A"
82
- information="Side B"
83
- footer={<>Footer</>}
84
- />
85
- </TileGrid>
86
- </StickerSheet.Cell>
87
- </StickerSheet.Row>
88
- <StickerSheet.Row rowTitle="Partial complete rows">
89
- <StickerSheet.Cell width={1000}>
90
- <TileGrid>
91
- <InformationTile
92
- title="Title"
93
- metadata="Side A"
94
- information="Side B"
95
- footer={<>Footer</>}
96
- />
97
- <InformationTile
98
- title="Title"
99
- metadata="Side A"
100
- information="Side B"
101
- footer={<>Footer</>}
102
- />
103
- <InformationTile
104
- title="Title"
105
- metadata="Side A"
106
- information="Side B"
107
- footer={<>Footer</>}
108
- />
109
- <InformationTile
110
- title="Title"
111
- metadata="Side A"
112
- information="Side B"
113
- footer={<>Footer</>}
114
- />
115
- </TileGrid>
116
- </StickerSheet.Cell>
117
- </StickerSheet.Row>
118
- </StickerSheet.Body>
20
+ <StickerSheet layout="stretch">
21
+ <StickerSheet.Row header="One row">
22
+ <TileGrid>
23
+ <InformationTile
24
+ title="Title"
25
+ metadata="Side A"
26
+ information="Side B"
27
+ footer={<>Footer</>}
28
+ />
29
+ <InformationTile
30
+ title="Title"
31
+ metadata="Side A"
32
+ information="Side B"
33
+ footer={<>Footer</>}
34
+ />
35
+ <InformationTile
36
+ title="Title"
37
+ metadata="Side A"
38
+ information="Side B"
39
+ footer={<>Footer</>}
40
+ />
41
+ </TileGrid>
42
+ </StickerSheet.Row>
43
+ <StickerSheet.Row header="Two rows">
44
+ <TileGrid>
45
+ <InformationTile
46
+ title="Title"
47
+ metadata="Side A"
48
+ information="Side B"
49
+ footer={<>Footer</>}
50
+ />
51
+ <InformationTile
52
+ title="Title"
53
+ metadata="Side A"
54
+ information="Side B"
55
+ footer={<>Footer</>}
56
+ />
57
+ <InformationTile
58
+ title="Title"
59
+ metadata="Side A"
60
+ information="Side B"
61
+ footer={<>Footer</>}
62
+ />
63
+ <InformationTile
64
+ title="Title"
65
+ metadata="Side A"
66
+ information="Side B"
67
+ footer={<>Footer</>}
68
+ />
69
+ <InformationTile
70
+ title="Title"
71
+ metadata="Side A"
72
+ information="Side B"
73
+ footer={<>Footer</>}
74
+ />
75
+ <InformationTile
76
+ title="Title"
77
+ metadata="Side A"
78
+ information="Side B"
79
+ footer={<>Footer</>}
80
+ />
81
+ </TileGrid>
82
+ </StickerSheet.Row>
83
+ <StickerSheet.Row header="Partial complete rows">
84
+ <TileGrid>
85
+ <InformationTile
86
+ title="Title"
87
+ metadata="Side A"
88
+ information="Side B"
89
+ footer={<>Footer</>}
90
+ />
91
+ <InformationTile
92
+ title="Title"
93
+ metadata="Side A"
94
+ information="Side B"
95
+ footer={<>Footer</>}
96
+ />
97
+ <InformationTile
98
+ title="Title"
99
+ metadata="Side A"
100
+ information="Side B"
101
+ footer={<>Footer</>}
102
+ />
103
+ <InformationTile
104
+ title="Title"
105
+ metadata="Side A"
106
+ information="Side B"
107
+ footer={<>Footer</>}
108
+ />
109
+ </TileGrid>
110
+ </StickerSheet.Row>
119
111
  </StickerSheet>
120
112
  ),
121
113
  }
@@ -1,7 +1,6 @@
1
1
  import React from "react"
2
2
  import type { Meta, StoryObj } from "@storybook/react"
3
- import { expect, within, userEvent } from "@storybook/test"
4
-
3
+ import { expect, within, waitFor } from "@storybook/test"
5
4
  import { GenericTile } from "./GenericTile"
6
5
 
7
6
  const meta: Meta<typeof GenericTile> = {
@@ -19,11 +18,72 @@ export default meta
19
18
  type Story = StoryObj<typeof GenericTile>
20
19
 
21
20
  export const Flip: Story = {
22
- play: async ({ canvasElement }) => {
21
+ play: async ({ canvasElement, step }) => {
22
+ const canvas = within(canvasElement)
23
+
24
+ await step("initial render complete", async () => {
25
+ await waitFor(() => {
26
+ canvas.getByRole("button", {
27
+ name: "View more information: Title",
28
+ })
29
+ })
30
+ })
31
+
32
+ await step("Can focus to tile", async () => {
33
+ await waitFor(() => {
34
+ expect(canvas.getByText("Side B")).toBeInTheDocument()
35
+ })
36
+ })
37
+ },
38
+ }
39
+
40
+ export const InfoButtonLabelDefault: Story = {
41
+ play: async ({ canvasElement, step }) => {
42
+ const canvas = within(canvasElement)
43
+
44
+ await step("initial render complete", async () => {
45
+ await waitFor(() => {
46
+ canvas.getByRole("button", {
47
+ name: "View more information: Title",
48
+ })
49
+ })
50
+ })
51
+
52
+ await step("Can focus to button", async () => {
53
+ await waitFor(() => {
54
+ const buttonWithInfoLabel = canvas.getByRole("button", {
55
+ name: "View more information: Title",
56
+ })
57
+ buttonWithInfoLabel.focus()
58
+ expect(buttonWithInfoLabel).toHaveFocus()
59
+ })
60
+ })
61
+ },
62
+ }
63
+
64
+ export const InfoButtonLabel: Story = {
65
+ args: {
66
+ infoButtonLabel: "Test Label",
67
+ },
68
+ play: async ({ canvasElement, step }) => {
23
69
  const canvas = within(canvasElement)
24
70
 
25
- await userEvent.click(canvas.getByRole("button", { name: "Information" }))
71
+ await step("initial render complete", async () => {
72
+ await waitFor(() => {
73
+ canvas.getByRole("button", {
74
+ name: "Test Label",
75
+ })
76
+ })
77
+ })
26
78
 
27
- await expect(canvas.getByText("Side B")).toBeInTheDocument()
79
+ await step("Can focus to button", async () => {
80
+ await waitFor(() => {
81
+ const buttonWithInfoLabel = canvas.getByRole("button", {
82
+ name: "Test Label",
83
+ })
84
+ buttonWithInfoLabel.focus()
85
+ expect(buttonWithInfoLabel).toHaveFocus()
86
+ })
87
+ })
28
88
  },
29
89
  }
@@ -1,4 +1,5 @@
1
1
  import React, { HTMLAttributes, useState } from "react"
2
+ import { useIntl } from "@cultureamp/i18n-react-intl"
2
3
  import classnames from "classnames"
3
4
  import { AllowedHeadingTags, Heading } from "~components/Heading"
4
5
  import { Text } from "~components/Text"
@@ -22,6 +23,8 @@ export type GenericTileProps = {
22
23
  titleTag?: AllowedHeadingTags
23
24
  metadata?: string
24
25
  information?: TileInformation | React.ReactNode
26
+ /** Provides accessible label for the title's info button @default "View more information: [title]" */
27
+ infoButtonLabel?: string
25
28
  /** @deprecated Use `variant` instead */
26
29
  mood?:
27
30
  | "positive"
@@ -46,6 +49,7 @@ export const GenericTile = ({
46
49
  titleTag = "h3",
47
50
  metadata,
48
51
  information,
52
+ infoButtonLabel,
49
53
  mood,
50
54
  variant = "default",
51
55
  footer,
@@ -53,6 +57,14 @@ export const GenericTile = ({
53
57
  ...restProps
54
58
  }: GenericTileProps): JSX.Element => {
55
59
  const [isFlipped, setIsFlipped] = useState<boolean>(false)
60
+ const { formatMessage } = useIntl()
61
+
62
+ const translatedInfoLabel = formatMessage({
63
+ id: "kzGenericTile.infoButtonLabel",
64
+ defaultMessage: "View more information:",
65
+ description:
66
+ "Prompts user to interact with button to reveal more information",
67
+ })
56
68
 
57
69
  const renderTitle = (): JSX.Element => (
58
70
  <div className={styles.title}>
@@ -80,7 +92,7 @@ export const GenericTile = ({
80
92
  {information && (
81
93
  <div className={styles.informationBtn}>
82
94
  <IconButton
83
- label="Information"
95
+ label={infoButtonLabel || `${translatedInfoLabel} ${title}`}
84
96
  icon={<Icon name="info" isPresentational isFilled />}
85
97
  onClick={(): void => setIsFlipped(true)}
86
98
  disabled={isFlipped}
@@ -135,11 +147,17 @@ export const GenericTile = ({
135
147
  const renderBack = (): JSX.Element | void => {
136
148
  if (!information) return
137
149
 
150
+ const returnButtonLabel = formatMessage({
151
+ id: "kzGenericTile.infoButtonReturnLabel",
152
+ defaultMessage: "Hide information:",
153
+ description: "Prompts user to interact with button to hide information",
154
+ })
155
+
138
156
  return (
139
157
  <div className={classnames(styles.face, styles.faceBack)}>
140
158
  <div className={styles.informationBtn}>
141
159
  <IconButton
142
- label="Information"
160
+ label={`${returnButtonLabel} ${title}`}
143
161
  icon={<Icon name="arrow_back" isPresentational />}
144
162
  onClick={(): void => setIsFlipped(false)}
145
163
  disabled={!isFlipped}
@@ -38,29 +38,23 @@ const StickerSheetTemplate: StickerSheetStory = {
38
38
 
39
39
  return (
40
40
  <>
41
- <StickerSheet heading="GenericTile">
42
- <StickerSheet.Body>
43
- {variants.map(variant => (
44
- <StickerSheet.Row key={variant} rowTitle={variant}>
45
- <GenericTile {...defaultProps} variant={variant} />
46
- </StickerSheet.Row>
47
- ))}
48
- </StickerSheet.Body>
41
+ <StickerSheet title="GenericTile">
42
+ {variants.map(variant => (
43
+ <StickerSheet.Row key={variant} header={variant}>
44
+ <GenericTile {...defaultProps} variant={variant} />
45
+ </StickerSheet.Row>
46
+ ))}
49
47
  </StickerSheet>
50
48
 
51
- <StickerSheet heading="Mood (deprecated)">
52
- <StickerSheet.Body>
53
- <>
54
- <StickerSheet.Row rowTitle="default">
55
- <GenericTile {...defaultProps} />
56
- </StickerSheet.Row>
57
- {moods.map(mood => (
58
- <StickerSheet.Row key={mood} rowTitle={mood}>
59
- <GenericTile {...defaultProps} mood={mood} />
60
- </StickerSheet.Row>
61
- ))}
62
- </>
63
- </StickerSheet.Body>
49
+ <StickerSheet title="Mood (deprecated)">
50
+ <StickerSheet.Row header="default">
51
+ <GenericTile {...defaultProps} />
52
+ </StickerSheet.Row>
53
+ {moods.map(mood => (
54
+ <StickerSheet.Row key={mood} header={mood}>
55
+ <GenericTile {...defaultProps} mood={mood} />
56
+ </StickerSheet.Row>
57
+ ))}
64
58
  </StickerSheet>
65
59
  </>
66
60
  )