@kaizen/components 1.58.2 → 1.60.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 (202) hide show
  1. package/codemods/README.md +15 -10
  2. package/codemods/migrateBrandMomentMoodToVariant/transformBrandMomentMoodToVariant.ts +1 -1
  3. package/codemods/migrateCardVariantToColor/transformCardVariantToColor.ts +1 -1
  4. package/codemods/migrateConfirmationModalMoodsToVariant/index.ts +3 -3
  5. package/codemods/migrateConfirmationModalMoodsToVariant/transformConfirmationModalMoodsToVariant.ts +25 -56
  6. package/codemods/migrateEmptyStateIllustrationTypeToVariant/transformEmptyStateIllustrationTypeToVariant.ts +1 -1
  7. package/codemods/migrateInformationTileMoodToVariant/transformInformationTileMoodToVariant.ts +1 -1
  8. package/codemods/migrateMultiActionTileMoodToVariant/transformMultiActionTileMoodToVariant.ts +1 -1
  9. package/codemods/migrateNotificationTypeToVariant/migrateNotificationTypeToVariant.ts +1 -1
  10. package/codemods/migrateProgressBarMoodToColor/transformProgressBarMoodToColor.ts +1 -1
  11. package/codemods/removeInputEditModalMood/index.ts +2 -2
  12. package/codemods/removeInputEditModalMood/removeInputEditModalMood.spec.ts +1 -31
  13. package/codemods/removeInputEditModalMood/removeInputEditModalMood.ts +2 -39
  14. package/codemods/removePopoverVariant/index.ts +15 -0
  15. package/codemods/removePopoverVariant/removePopoverVariant.spec.ts +65 -0
  16. package/codemods/removePopoverVariant/removePopoverVariant.ts +3 -0
  17. package/codemods/updateGuidanceBlockVariantProp/transformGuidanceBlockVariantProp.spec.ts +2 -2
  18. package/codemods/utils/removeProps.spec.ts +65 -0
  19. package/codemods/utils/removeProps.ts +30 -0
  20. package/dist/cjs/Avatar/Avatar.cjs +14 -12
  21. package/dist/cjs/Brand/Brand.cjs +1 -1
  22. package/dist/cjs/BrandMoment/BrandMoment.cjs +1 -1
  23. package/dist/cjs/Card/Card.cjs +1 -1
  24. package/dist/cjs/Card/Card.module.css.cjs +22 -0
  25. package/dist/cjs/Illustration/subcomponents/Base/Base.cjs +1 -1
  26. package/dist/cjs/Illustration/subcomponents/VideoPlayer/VideoPlayer.cjs +1 -1
  27. package/dist/cjs/Popover/Popover.module.scss.cjs +0 -7
  28. package/dist/cjs/index.cjs +2 -0
  29. package/dist/cjs/utils/hostedAssets.cjs +16 -0
  30. package/dist/cjs/utils/useResizeObserver.cjs +1 -0
  31. package/dist/esm/Avatar/Avatar.mjs +14 -12
  32. package/dist/esm/Brand/Brand.mjs +1 -1
  33. package/dist/esm/BrandMoment/BrandMoment.mjs +1 -1
  34. package/dist/esm/Card/Card.mjs +1 -1
  35. package/dist/esm/Card/Card.module.css.mjs +20 -0
  36. package/dist/esm/Illustration/subcomponents/Base/Base.mjs +1 -1
  37. package/dist/esm/Illustration/subcomponents/VideoPlayer/VideoPlayer.mjs +1 -1
  38. package/dist/esm/Popover/Popover.module.scss.mjs +0 -7
  39. package/dist/esm/index.mjs +1 -0
  40. package/dist/esm/utils/hostedAssets.mjs +14 -0
  41. package/dist/esm/utils/useResizeObserver.mjs +1 -0
  42. package/dist/styles.css +12983 -179
  43. package/dist/types/Avatar/Avatar.d.ts +6 -1
  44. package/dist/types/LikertScaleLegacy/index.d.ts +1 -0
  45. package/dist/types/Popover/Popover.d.ts +4 -2
  46. package/dist/types/utils/hostedAssets.d.ts +10 -0
  47. package/dist/types/utils/index.d.ts +1 -0
  48. package/dist/types/utils/useResizeObserver.d.ts +1 -0
  49. package/package.json +19 -11
  50. package/src/Avatar/Avatar.spec.tsx +63 -0
  51. package/src/Avatar/Avatar.tsx +16 -8
  52. package/src/AvatarGroup/AvatarGroup.tsx +1 -1
  53. package/src/Badge/Badge.tsx +1 -1
  54. package/src/Brand/Brand.tsx +2 -2
  55. package/src/BrandMoment/BrandMoment.tsx +3 -3
  56. package/src/BrandMoment/_docs/ExampleHeaders.tsx +2 -2
  57. package/src/ButtonGroup/ButtonGroup.tsx +1 -1
  58. package/src/Calendar/CalendarPopover/CalendarPopover.tsx +1 -1
  59. package/src/Calendar/CalendarRange/CalendarRange.tsx +1 -1
  60. package/src/Calendar/CalendarSingle/CalendarSingle.tsx +1 -1
  61. package/src/Card/{Card.module.scss → Card.module.css} +6 -14
  62. package/src/Card/Card.tsx +2 -2
  63. package/src/Checkbox/Checkbox/Checkbox.tsx +1 -1
  64. package/src/Checkbox/CheckboxGroup/CheckboxGroup.tsx +1 -1
  65. package/src/ClearButton/ClearButton.tsx +1 -1
  66. package/src/Collapsible/Collapsible/Collapsible.tsx +1 -1
  67. package/src/Collapsible/CollapsibleGroup/CollapsibleGroup.tsx +1 -1
  68. package/src/Content/Content.tsx +1 -1
  69. package/src/DateInput/DateInput/DateInput.tsx +1 -1
  70. package/src/DateInput/DateInputWithIconButton/DateInputWithIconButton.tsx +1 -1
  71. package/src/Divider/Divider.tsx +1 -1
  72. package/src/EmptyState/EmptyState.tsx +1 -1
  73. package/src/ErrorPage/ErrorPage.tsx +1 -1
  74. package/src/FieldGroup/FieldGroup.tsx +1 -1
  75. package/src/FieldMessage/FieldMessage.tsx +1 -1
  76. package/src/Filter/Filter/Filter.tsx +1 -1
  77. package/src/Filter/Filter/subcomponents/FilterContents/FilterContents.tsx +1 -1
  78. package/src/Filter/Filter/subcomponents/FilterPopover/FilterPopover.tsx +1 -1
  79. package/src/Filter/FilterBar/FilterBar.tsx +1 -1
  80. package/src/Filter/FilterButton/FilterButton/FilterButton.tsx +1 -1
  81. package/src/Filter/FilterButton/FilterButtonRemovable/FilterButtonRemovable.tsx +2 -2
  82. package/src/Filter/FilterButton/subcomponents/FilterButtonBase/FilterButtonBase.tsx +1 -1
  83. package/src/Filter/FilterDatePicker/hooks/useDateInputHandlers.spec.ts +1 -1
  84. package/src/Filter/FilterDatePicker/hooks/useDateValidation.spec.ts +1 -2
  85. package/src/Filter/FilterDatePicker/subcomponents/FilterDatePickerField/FilterDatePickerField.tsx +2 -2
  86. package/src/Filter/FilterDatePicker/utils/getDateValidationHandler.tsx +1 -1
  87. package/src/Filter/FilterDateRangePicker/subcomponents/DateRangeInputField/DateRangeInputField.tsx +2 -2
  88. package/src/Filter/FilterDateRangePicker/subcomponents/FilterDateRangePickerField/FilterDateRangePickerField.tsx +2 -2
  89. package/src/Filter/FilterDateRangePicker/subcomponents/FilterDateRangePickerField/hooks/useEndDateValidation.spec.ts +1 -2
  90. package/src/Filter/FilterDateRangePicker/subcomponents/FilterDateRangePickerField/hooks/useStartDateValidation.spec.ts +1 -2
  91. package/src/Filter/FilterDateRangePicker/subcomponents/FilterDateRangePickerField/utils/validateEndDateBeforeStartDate.tsx +1 -1
  92. package/src/Filter/FilterMultiSelect/_docs/FilterMultiSelect.stories.tsx +1 -1
  93. package/src/Filter/FilterSelect/FilterSelect.tsx +1 -1
  94. package/src/Heading/Heading.tsx +1 -1
  95. package/src/Icon/_docs/Icon.stories.tsx +1 -1
  96. package/src/Icon/subcomponents/SVG/SVG.tsx +1 -1
  97. package/src/Illustration/subcomponents/Base/Base.tsx +2 -2
  98. package/src/Illustration/subcomponents/VideoPlayer/VideoPlayer.tsx +1 -1
  99. package/src/Illustration/utils/usePausePlay.spec.tsx +1 -2
  100. package/src/Input/Input/Input.tsx +1 -1
  101. package/src/Input/InputRange/InputRange.tsx +1 -1
  102. package/src/Input/InputSearch/InputSearch.tsx +1 -1
  103. package/src/KaizenProvider/_docs/KaizenProvider.mdx +4 -4
  104. package/src/Label/Label.tsx +1 -1
  105. package/src/LabelledMessage/LabelledMessage.tsx +1 -1
  106. package/src/LikertScaleLegacy/index.ts +1 -0
  107. package/src/Loading/LoadingGraphic/LoadingGraphic.tsx +1 -1
  108. package/src/Loading/LoadingHeading/LoadingHeading.tsx +1 -1
  109. package/src/Loading/LoadingInput/LoadingInput.tsx +1 -1
  110. package/src/Loading/LoadingParagraph/LoadingParagraph.tsx +1 -1
  111. package/src/Loading/LoadingSpinner/LoadingSpinner.tsx +1 -1
  112. package/src/Modal/ConfirmationModal/ConfirmationModal.spec.tsx +1 -1
  113. package/src/Modal/ContextModal/ContextModal.spec.tsx +1 -1
  114. package/src/Modal/GenericModal/subcomponents/ModalFooter/ModalFooter.tsx +1 -1
  115. package/src/Modal/InputEditModal/InputEditModal.spec.tsx +1 -1
  116. package/src/MultiSelect/MultiSelect.tsx +1 -1
  117. package/src/MultiSelect/subcomponents/Checkbox/Checkbox.tsx +1 -1
  118. package/src/MultiSelect/subcomponents/MultiSelectOptionField/MultiSelectOptionField.tsx +1 -1
  119. package/src/MultiSelect/subcomponents/MultiSelectOptions/MultiSelectOptions.tsx +1 -1
  120. package/src/MultiSelect/subcomponents/MultiSelectToggle/MultiSelectToggle.tsx +1 -1
  121. package/src/MultiSelect/subcomponents/Popover/Popover.tsx +1 -1
  122. package/src/Notification/GlobalNotification/GlobalNotification.tsx +1 -1
  123. package/src/Notification/InlineNotification/InlineNotification.tsx +1 -1
  124. package/src/Notification/ToastNotification/ToastNotificationsList/subcomponents/ToastNotificationsMap/ToastNotificationsMap.tsx +1 -1
  125. package/src/Notification/ToastNotification/types.ts +1 -1
  126. package/src/Notification/subcomponents/GenericNotification/GenericNotification.tsx +1 -1
  127. package/src/Pagination/Pagination.tsx +1 -1
  128. package/src/Popover/Popover.module.scss +4 -26
  129. package/src/Popover/Popover.tsx +5 -3
  130. package/src/Popover/_docs/Popover.mdx +0 -3
  131. package/src/Popover/_docs/Popover.stickersheet.stories.tsx +1 -1
  132. package/src/Popover/_docs/Popover.stories.tsx +3 -42
  133. package/src/ProgressBar/ProgressBar.tsx +1 -1
  134. package/src/Radio/Radio/Radio.tsx +1 -1
  135. package/src/Radio/RadioGroup/RadioGroup.tsx +1 -1
  136. package/src/RichTextEditor/EditableRichTextContent/EditableRichTextContent.tsx +1 -1
  137. package/src/RichTextEditor/RichTextContent/RichTextContent.tsx +1 -1
  138. package/src/RichTextEditor/RichTextEditor/RichTextEditor.tsx +1 -1
  139. package/src/RichTextEditor/RichTextEditor/subcomponents/ToggleIconButton/ToggleIconButton.tsx +1 -1
  140. package/src/RichTextEditor/RichTextEditor/subcomponents/Toolbar/Toolbar.tsx +1 -1
  141. package/src/Skirt/Skirt.tsx +1 -1
  142. package/src/SplitButton/SplitButton.tsx +2 -2
  143. package/src/SplitButton/subcomponents/BaseButton/BaseButton.tsx +1 -1
  144. package/src/Table/Table.tsx +1 -1
  145. package/src/Tabs/subcomponents/Tab.tsx +1 -1
  146. package/src/Tabs/subcomponents/TabList.tsx +1 -1
  147. package/src/Tabs/subcomponents/TabPanel.tsx +1 -1
  148. package/src/Tabs/subcomponents/TabPanels.tsx +1 -1
  149. package/src/Text/Text.tsx +1 -1
  150. package/src/TextArea/TextArea.tsx +1 -1
  151. package/src/Tile/TileGrid/TileGrid.tsx +1 -1
  152. package/src/Tile/subcomponents/GenericTile/GenericTile.tsx +1 -1
  153. package/src/TimeField/TimeField.tsx +1 -1
  154. package/src/TitleBlockZen/TitleBlockZen.spec.tsx +1 -1
  155. package/src/TitleBlockZen/TitleBlockZen.tsx +1 -1
  156. package/src/TitleBlockZen/_docs/TitleBlockZen.stories.tsx +1 -1
  157. package/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.tsx +1 -1
  158. package/src/VisuallyHidden/VisuallyHidden.tsx +1 -1
  159. package/src/Well/Well.tsx +1 -1
  160. package/src/Workflow/Workflow.tsx +1 -1
  161. package/src/Workflow/subcomponents/Footer/Footer.tsx +1 -1
  162. package/src/Workflow/subcomponents/Footer/components/FooterActions/FooterActions.tsx +1 -1
  163. package/src/Workflow/subcomponents/Footer/components/Root/Root.tsx +1 -1
  164. package/src/Workflow/subcomponents/Header/components/Actions/Actions.tsx +1 -1
  165. package/src/Workflow/subcomponents/Header/components/Branding/Branding.tsx +1 -1
  166. package/src/Workflow/subcomponents/Header/components/Root/Root.tsx +1 -1
  167. package/src/Workflow/subcomponents/Header/components/Titles/Titles.tsx +1 -1
  168. package/src/Workflow/subcomponents/Main/Main.tsx +1 -1
  169. package/src/Workflow/subcomponents/Wrapper/Wrapper.tsx +1 -1
  170. package/src/__actions__/Button/v3/Button.tsx +1 -1
  171. package/src/__actions__/Menu/v1/subcomponents/MenuList/MenuList.tsx +1 -1
  172. package/src/__actions__/Menu/v3/Menu.tsx +1 -1
  173. package/src/__actions__/Menu/v3/MenuItem.tsx +1 -1
  174. package/src/__future__/Select/Select.tsx +1 -1
  175. package/src/__future__/Select/subcomponents/ListBox/ListBox.tsx +1 -1
  176. package/src/__future__/Select/subcomponents/Option/Option.tsx +1 -1
  177. package/src/__future__/Select/subcomponents/Overlay/Overlay.tsx +1 -1
  178. package/src/__future__/Select/subcomponents/SelectToggle/SelectToggle.tsx +1 -1
  179. package/src/__future__/Tag/RemovableTag/subcomponents/RemoveButton.tsx +1 -1
  180. package/src/__future__/Tag/Tag/Tag.tsx +1 -1
  181. package/src/__future__/Workflow/Workflow.tsx +1 -1
  182. package/src/__future__/Workflow/subcomponents/Footer/Footer.tsx +1 -1
  183. package/src/__future__/Workflow/subcomponents/Footer/components/FooterActions/FooterActions.tsx +1 -1
  184. package/src/__future__/Workflow/subcomponents/Footer/components/Root/Root.tsx +1 -1
  185. package/src/__future__/Workflow/subcomponents/Header/components/Actions/Actions.tsx +1 -1
  186. package/src/__future__/Workflow/subcomponents/Header/components/Branding/Branding.tsx +1 -1
  187. package/src/__future__/Workflow/subcomponents/Header/components/Root/Root.tsx +1 -1
  188. package/src/__future__/Workflow/subcomponents/Header/components/Titles/Titles.tsx +1 -1
  189. package/src/__future__/Workflow/subcomponents/Main/Main.tsx +1 -1
  190. package/src/__future__/Workflow/subcomponents/Wrapper/Wrapper.tsx +1 -1
  191. package/src/__overlays__/Tooltip/v3/OverlayArrow.tsx +1 -1
  192. package/src/__overlays__/Tooltip/v3/Tooltip.tsx +1 -1
  193. package/src/__overlays__/Tooltip/v3/_docs/Tooltip.stickersheet.stories.tsx +1 -1
  194. package/src/utils/hostedAssets.ts +13 -0
  195. package/src/utils/index.ts +1 -0
  196. package/src/utils/useResizeObserver.ts +1 -0
  197. package/dist/cjs/Card/Card.module.scss.cjs +0 -22
  198. package/dist/esm/Card/Card.module.scss.mjs +0 -20
  199. package/src/utils/useResizeObserver.spec.tsx +0 -49
  200. /package/src/BrandMoment/_docs/{ExampleHeaders.scss → ExampleHeaders.module.scss} +0 -0
  201. /package/src/Filter/FilterMultiSelect/_docs/{FilterMultiSelect.stories.scss → FilterMultiSelect.module.scss} +0 -0
  202. /package/src/Icon/_docs/{icon.stories.scss → icon.module.scss} +0 -0
@@ -25,6 +25,11 @@ type BaseAvatarProps = {
25
25
  * Renders Company Avatar variant - If true `fullName` and `avatarSrc` will be strictly typed.
26
26
  */
27
27
  isCompany?: boolean;
28
+ /**
29
+ * Control of the alt property on the img (or title when initials are rendered)
30
+ * Defaults to the fullName if provided, otherwise an empty string
31
+ */
32
+ alt?: string;
28
33
  } & OverrideClassName<HTMLAttributes<HTMLSpanElement>>;
29
34
  export type GenericAvatarProps = BaseAvatarProps & {
30
35
  isCompany?: false;
@@ -46,5 +51,5 @@ export type AvatarProps = GenericAvatarProps | CompanyAvatarProps;
46
51
  * {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3064857475/Avatar Guidance} |
47
52
  * {@link https://cultureamp.design/?path=/docs/components-avatar-avatar--docs Storybook}
48
53
  */
49
- export declare const Avatar: ({ fullName, size, avatarSrc, disableInitials, isCompany, isCurrentUser, classNameOverride, ...restProps }: AvatarProps) => JSX.Element;
54
+ export declare const Avatar: ({ fullName, size, avatarSrc, disableInitials, isCompany, isCurrentUser, alt, classNameOverride, ...restProps }: AvatarProps) => JSX.Element;
50
55
  export {};
@@ -1 +1,2 @@
1
1
  export * from "./LikertScaleLegacy";
2
+ export * from "./types";
@@ -3,6 +3,9 @@ import { OverrideClassName } from "../types/OverrideClassName";
3
3
  import { Placement, PopoverSize, PopoverVariant } from "./types";
4
4
  export type PopoverProps = {
5
5
  children: React.ReactNode;
6
+ /**
7
+ * @deprecated We are no longer supporting different variants for Popover, instead there will only be a single default variant.
8
+ */
6
9
  variant?: PopoverVariant;
7
10
  placement?: Placement;
8
11
  size?: PopoverSize;
@@ -11,8 +14,7 @@ export type PopoverProps = {
11
14
  onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;
12
15
  singleLine?: boolean;
13
16
  /**
14
- * For almost all intents and purposes, you should be using a pre-defined variant.
15
- * Please avoid using a custom icon unless you have a very good reason to do so.
17
+ * @deprecated This was for customising the icon provided with variants.
16
18
  */
17
19
  customIcon?: JSX.Element;
18
20
  referenceElement: HTMLElement | null;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Returns the full URL of the asset at `path` managed by the
3
+ * `kaizen-design-system-assets` service.
4
+ *
5
+ * @example
6
+ * assetUrl("some/blob.png") -> "https://<origin>/some/blob.png"
7
+ *
8
+ * @see https://github.com/cultureamp/kaizen-design-system-assets/
9
+ */
10
+ export declare const assetUrl: (path: string) => string;
@@ -1 +1,2 @@
1
1
  export * from "./useMediaQueries";
2
+ export * from "./hostedAssets";
@@ -17,5 +17,6 @@ export interface DOMRectReadOnly {
17
17
  * @return {Array} An array containing a ref for binding to the observed DOM
18
18
  * element, and the current value of the callback-resolved ResizeObserverEntry
19
19
  * @callback resolveEntryCallback
20
+ * @deprecated use native `ResizeObserver` DOM API instead
20
21
  */
21
22
  export declare const useResizeObserver: <T, E extends Element = HTMLElement>(resolveEntry?: (entry: ResizeObserverEntry) => any) => [Ref<E>, T | undefined];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaizen/components",
3
- "version": "1.58.2",
3
+ "version": "1.60.0",
4
4
  "description": "Kaizen component library",
5
5
  "author": "Geoffrey Chong <geoff.chong@cultureamp.com>",
6
6
  "homepage": "https://cultureamp.design",
@@ -33,6 +33,7 @@
33
33
  "bin": {
34
34
  "kaizen-codemod": "./bin/codemod.sh"
35
35
  },
36
+ "type": "module",
36
37
  "dependencies": {
37
38
  "@floating-ui/react-dom": "^2.1.1",
38
39
  "@headlessui/react": "<=1.5.0",
@@ -80,10 +81,9 @@
80
81
  "react-select": "^5.8.0",
81
82
  "react-textfit": "^1.1.1",
82
83
  "resize-observer-polyfill": "^1.5.1",
83
- "use-debounce": "^10.0.2",
84
84
  "tsx": "^4.17.0",
85
- "uuid": "^10.0.0",
86
- "@kaizen/hosted-assets": "2.0.3"
85
+ "use-debounce": "^10.0.2",
86
+ "uuid": "^10.0.0"
87
87
  },
88
88
  "dependenciesComments": {
89
89
  "react-day-picker": "Version locked until a11y gets fixed (https://github.com/gpbl/react-day-picker/pull/1708)"
@@ -91,13 +91,25 @@
91
91
  "devDependencies": {
92
92
  "@cultureamp/frontend-apis": "^9.8.0",
93
93
  "@cultureamp/i18n-react-intl": "^2.6.0",
94
+ "@tanstack/react-query": "^5.51.23",
94
95
  "@types/lodash.debounce": "^4.0.9",
95
- "@types/react-dom": "^18.3.0",
96
+ "@types/react-highlight": "^0.12.8",
96
97
  "@types/react-textfit": "^1.1.4",
97
98
  "@types/uuid": "^10.0.0",
98
99
  "autoprefixer": "^10.4.20",
99
100
  "concat-cli": "^4.0.0",
101
+ "identity-obj-proxy": "^3.0.0",
102
+ "lodash.isempty": "^4.4.0",
103
+ "normalize.css": "^8.0.1",
104
+ "postcss": "^8.4.41",
105
+ "postcss-cli": "^11.0.0",
106
+ "postcss-import": "^16.1.0",
107
+ "postcss-preset-env": "^10.0.2",
108
+ "postcss-scss": "^4.0.9",
100
109
  "query-string": "^9.1.0",
110
+ "react": "^18.3.1",
111
+ "react-dom": "^18.3.1",
112
+ "react-highlight": "^0.15.0",
101
113
  "react-intl": "^6.6.8",
102
114
  "rollup": "^4.20.0",
103
115
  "sass": "^1.77.8",
@@ -106,17 +118,13 @@
106
118
  "ts-jest": "^29.2.4",
107
119
  "tslib": "^2.6.3",
108
120
  "tsx": "^4.17.0",
109
- "@kaizen/design-tokens": "10.5.3",
121
+ "@kaizen/design-tokens": "10.6.0",
110
122
  "@kaizen/package-bundler": "1.1.4"
111
123
  },
112
- "devDependenciesComments": {
113
- "postcss": "Installed in root",
114
- "postcss-cli": "Installed in root",
115
- "postcss-preset-env": "Installed in root"
116
- },
117
124
  "peerDependencies": {
118
125
  "@cultureamp/i18n-react-intl": "^2.5.9",
119
126
  "react": "^18.3.1",
127
+ "react-dom": "^18.3.1",
120
128
  "react-intl": "^6.6.8",
121
129
  "typescript": "^5.5.4"
122
130
  },
@@ -23,4 +23,67 @@ describe("<Avatar />", () => {
23
23
  expect(screen.getByText("JWAVLN")).toBeInTheDocument()
24
24
  })
25
25
  })
26
+
27
+ describe("alt text", () => {
28
+ describe("providing alt text, overriding fullName", () => {
29
+ it("uses alt prop over full name when using initials", () => {
30
+ render(<Avatar fullName="Jane Doe" alt="alt override" />)
31
+ expect(screen.getByTitle("alt override")).toBeInTheDocument()
32
+ })
33
+
34
+ it("uses alt prop over full name when using fallback img", () => {
35
+ render(
36
+ <Avatar fullName="Jane Doe" alt="alt override" disableInitials />
37
+ )
38
+ expect(screen.getByRole("img")).toHaveAccessibleName("alt override")
39
+ })
40
+
41
+ it("uses alt prop over full name when supplying an img", () => {
42
+ render(
43
+ <Avatar
44
+ fullName="Jane Doe"
45
+ alt="alt override"
46
+ avatarSrc="https://www.cultureampcom-preview-1.usw2.wp-dev-us.cultureamp-cdn.com/assets/slices/main/assets/public/media/chapters-card-1@2x.05e547444387f29f14df0b82634bf2b6.png"
47
+ />
48
+ )
49
+ expect(screen.getByRole("img")).toHaveAccessibleName("alt override")
50
+ })
51
+ })
52
+
53
+ describe("providing fullName, no alt prop", () => {
54
+ it("uses the fullName when using initials", () => {
55
+ render(<Avatar fullName="Jane Doe" />)
56
+ expect(screen.getByTitle("Jane Doe")).toBeInTheDocument()
57
+ })
58
+
59
+ it("uses the fullName when using fallback img", () => {
60
+ render(<Avatar fullName="Jane Doe" disableInitials />)
61
+ expect(screen.getByRole("img")).toHaveAccessibleName("Jane Doe")
62
+ })
63
+
64
+ it("uses alt prop over full name when supplying an img", () => {
65
+ render(
66
+ <Avatar
67
+ fullName="Jane Doe"
68
+ avatarSrc="https://www.cultureampcom-preview-1.usw2.wp-dev-us.cultureamp-cdn.com/assets/slices/main/assets/public/media/chapters-card-1@2x.05e547444387f29f14df0b82634bf2b6.png"
69
+ />
70
+ )
71
+ expect(screen.getByRole("img")).toHaveAccessibleName("Jane Doe")
72
+ })
73
+ })
74
+
75
+ describe("not providing fullName or alt text", () => {
76
+ it("makes the img presentational on the fallback img", () => {
77
+ render(<Avatar />)
78
+ expect(screen.queryByRole("img")).not.toBeInTheDocument()
79
+ })
80
+
81
+ it("has blank alt text when img provided", () => {
82
+ render(
83
+ <Avatar avatarSrc="https://www.cultureampcom-preview-1.usw2.wp-dev-us.cultureamp-cdn.com/assets/slices/main/assets/public/media/chapters-card-1@2x.05e547444387f29f14df0b82634bf2b6.png" />
84
+ )
85
+ expect(screen.queryByRole("img")).not.toBeInTheDocument()
86
+ })
87
+ })
88
+ })
26
89
  })
@@ -2,7 +2,7 @@ import React, { useState, useEffect, useRef, HTMLAttributes } from "react"
2
2
  import classnames from "classnames"
3
3
  import { Textfit } from "react-textfit"
4
4
  import { UserIcon } from "~components/Icon"
5
- import { OverrideClassName } from "~types/OverrideClassName"
5
+ import { OverrideClassName } from "~components/types/OverrideClassName"
6
6
  import styles from "./Avatar.module.scss"
7
7
 
8
8
  export type AvatarSizes = "small" | "medium" | "large" | "xlarge" | "xxlarge"
@@ -31,6 +31,11 @@ type BaseAvatarProps = {
31
31
  * Renders Company Avatar variant - If true `fullName` and `avatarSrc` will be strictly typed.
32
32
  */
33
33
  isCompany?: boolean
34
+ /**
35
+ * Control of the alt property on the img (or title when initials are rendered)
36
+ * Defaults to the fullName if provided, otherwise an empty string
37
+ */
38
+ alt?: string
34
39
  } & OverrideClassName<HTMLAttributes<HTMLSpanElement>>
35
40
 
36
41
  export type GenericAvatarProps = BaseAvatarProps & {
@@ -71,9 +76,9 @@ const getMaxFontSizePixels: (size: AvatarSizes) => number = size => {
71
76
  return 22
72
77
  }
73
78
 
74
- const fallbackIcon = (fullName: string): JSX.Element => {
75
- if (fullName) {
76
- return <UserIcon inheritSize role="img" aria-label={fullName} />
79
+ const fallbackIcon = (alt: string): JSX.Element => {
80
+ if (alt) {
81
+ return <UserIcon inheritSize role="img" aria-label={alt} />
77
82
  }
78
83
 
79
84
  return <UserIcon inheritSize role="presentation" />
@@ -81,6 +86,7 @@ const fallbackIcon = (fullName: string): JSX.Element => {
81
86
 
82
87
  const renderInitials = (
83
88
  fullName = "",
89
+ alt: string,
84
90
  size: AvatarSizes,
85
91
  disableInitials = false
86
92
  ): JSX.Element => {
@@ -89,11 +95,11 @@ const renderInitials = (
89
95
  const renderFallback = disableInitials || initials === ""
90
96
 
91
97
  return renderFallback ? (
92
- <span className={styles.fallbackIcon}>{fallbackIcon(fullName)}</span>
98
+ <span className={styles.fallbackIcon}>{fallbackIcon(alt)}</span>
93
99
  ) : (
94
100
  <abbr
95
101
  className={classnames(styles.initials, isLongName && styles.longName)}
96
- title={fullName || ""}
102
+ title={alt}
97
103
  >
98
104
  {isLongName ? (
99
105
  // Only called if 3 or more initials, fits text width for long names
@@ -118,6 +124,7 @@ export const Avatar = ({
118
124
  disableInitials = false,
119
125
  isCompany = false,
120
126
  isCurrentUser = true,
127
+ alt = fullName || "",
121
128
  classNameOverride,
122
129
  ...restProps
123
130
  }: AvatarProps): JSX.Element => {
@@ -167,10 +174,11 @@ export const Avatar = ({
167
174
  src={avatarSrc}
168
175
  onError={onImageFailure}
169
176
  onLoad={onImageSuccess}
170
- alt={fullName || ""}
177
+ alt={alt}
171
178
  />
172
179
  )}
173
- {renderInitialAvatar && renderInitials(fullName, size, disableInitials)}
180
+ {renderInitialAvatar &&
181
+ renderInitials(fullName, alt, size, disableInitials)}
174
182
  </span>
175
183
  )
176
184
  }
@@ -5,7 +5,7 @@ import {
5
5
  CompanyAvatarProps,
6
6
  GenericAvatarProps,
7
7
  } from "~components/Avatar"
8
- import { OverrideClassName } from "~types/OverrideClassName"
8
+ import { OverrideClassName } from "~components/types/OverrideClassName"
9
9
  import styles from "./AvatarGroup.module.scss"
10
10
 
11
11
  export type AvatarGroupAvatarProps =
@@ -1,6 +1,6 @@
1
1
  import React, { HTMLAttributes, useLayoutEffect, useState } from "react"
2
2
  import classnames from "classnames"
3
- import { OverrideClassName } from "~types/OverrideClassName"
3
+ import { OverrideClassName } from "~components/types/OverrideClassName"
4
4
  import styles from "./Badge.module.scss"
5
5
 
6
6
  type BadgeCommonProps = {
@@ -1,6 +1,6 @@
1
1
  import React, { HTMLAttributes, SVGAttributes } from "react"
2
- import { assetUrl } from "@kaizen/hosted-assets"
3
- import { OverrideClassName } from "~types/OverrideClassName"
2
+ import { OverrideClassName } from "~components/types/OverrideClassName"
3
+ import { assetUrl } from "~components/utils/hostedAssets"
4
4
  import { BrandCollectiveIntelligence } from "./BrandCollectiveIntelligence"
5
5
  import styles from "./Brand.module.scss"
6
6
 
@@ -1,12 +1,12 @@
1
1
  import React, { ReactNode, ReactElement, HTMLAttributes } from "react"
2
2
  import classnames from "classnames"
3
- import { assetUrl } from "@kaizen/hosted-assets"
4
3
  import { Heading } from "~components/Heading"
5
4
  import { SceneProps } from "~components/Illustration"
6
5
  import { Text } from "~components/Text"
7
6
  import { Button, ButtonProps } from "~components/__actions__/v2"
8
- import { OverrideClassName } from "~types/OverrideClassName"
9
- import { useMediaQueries } from "~utils/useMediaQueries"
7
+ import { OverrideClassName } from "~components/types/OverrideClassName"
8
+ import { assetUrl } from "~components/utils/hostedAssets"
9
+ import { useMediaQueries } from "~components/utils/useMediaQueries"
10
10
  import styles from "./BrandMoment.module.scss"
11
11
 
12
12
  type DeprecatedMoodProps = {
@@ -1,8 +1,8 @@
1
1
  import React from "react"
2
- import { assetUrl } from "@kaizen/hosted-assets"
3
2
  import { CloseIcon } from "~components/Icon"
4
3
  import { Button } from "~components/__actions__/v2"
5
- import styles from "./ExampleHeaders.scss"
4
+ import { assetUrl } from "~components/utils/hostedAssets"
5
+ import styles from "./ExampleHeaders.module.scss"
6
6
 
7
7
  export const MinimalBasic = (): JSX.Element => (
8
8
  <div className={styles.header}>
@@ -5,7 +5,7 @@ import {
5
5
  FilterButtonBaseProps,
6
6
  } from "~components/Filter/FilterButton/subcomponents/FilterButtonBase"
7
7
  import { Tooltip, TooltipProps } from "~components/__overlays__/Tooltip/v1"
8
- import { OverrideClassName } from "~types/OverrideClassName"
8
+ import { OverrideClassName } from "~components/types/OverrideClassName"
9
9
  import styles from "./ButtonGroup.module.scss"
10
10
 
11
11
  const isFilterButton = (
@@ -8,7 +8,7 @@ import {
8
8
  autoPlacement,
9
9
  } from "@floating-ui/react-dom"
10
10
  import classnames from "classnames"
11
- import { OverrideClassName } from "~types/OverrideClassName"
11
+ import { OverrideClassName } from "~components/types/OverrideClassName"
12
12
  import styles from "./CalendarPopover.module.scss"
13
13
 
14
14
  export type CalendarPopoverProps = {
@@ -2,7 +2,7 @@ import React, { useEffect, useRef } from "react"
2
2
  import { enAU } from "date-fns/locale"
3
3
  import { DayPicker, DayPickerRangeProps } from "react-day-picker"
4
4
  import { ArrowBackwardIcon, ArrowForwardIcon } from "~components/Icon"
5
- import { OverrideClassName } from "~types/OverrideClassName"
5
+ import { OverrideClassName } from "~components/types/OverrideClassName"
6
6
  import { baseCalendarClassNames } from "../baseCalendarClassNames"
7
7
  import { isInvalidDate } from "../utils"
8
8
  import styles from "./CalendarRange.module.scss"
@@ -2,7 +2,7 @@ import React, { useEffect, useRef } from "react"
2
2
  import { enAU } from "date-fns/locale"
3
3
  import { DayPicker, DayPickerSingleProps } from "react-day-picker"
4
4
  import { ArrowBackwardIcon, ArrowForwardIcon } from "~components/Icon"
5
- import { OverrideClassName } from "~types/OverrideClassName"
5
+ import { OverrideClassName } from "~components/types/OverrideClassName"
6
6
  import { baseCalendarClassNames } from "../baseCalendarClassNames"
7
7
  import { isInvalidDate, isValidWeekStartsOn } from "../utils"
8
8
  import styles from "./CalendarSingle.module.scss"
@@ -1,7 +1,3 @@
1
- @import "~@kaizen/design-tokens/sass/shadow";
2
- @import "~@kaizen/design-tokens/sass/border";
3
- @import "~@kaizen/design-tokens/sass/color";
4
-
5
1
  .wrapper {
6
2
  color: var(--color-purple-800);
7
3
  border: var(--border-width-1) solid var(--card-border-color);
@@ -18,7 +14,6 @@
18
14
  --card-box-shadow: var(--shadow-large-box-shadow);
19
15
  }
20
16
 
21
- // Color styles ---------------------------
22
17
  .blue {
23
18
  --card-background-color: var(--color-blue-100);
24
19
  --card-border-color: var(--color-blue-400);
@@ -59,7 +54,6 @@
59
54
  --card-border-color: var(--color-yellow-700);
60
55
  }
61
56
 
62
- // Deprecated Variant styles ----------------
63
57
  .default {
64
58
  border-color: var(--color-gray-500);
65
59
  background-color: var(--color-white);
@@ -67,32 +61,30 @@
67
61
 
68
62
  .informative {
69
63
  border-color: var(--color-blue-400);
70
- background-color: $color-blue-100;
64
+ background-color: var(--color-blue-100);
71
65
  }
72
66
 
73
67
  .positive {
74
68
  border-color: var(--color-green-500);
75
- background-color: $color-green-100;
69
+ background-color: var(--color-green-100);
76
70
  }
77
71
 
78
72
  .cautionary {
79
73
  border-color: var(--color-yellow-700);
80
- background-color: $color-yellow-100;
74
+ background-color: var(--color-yellow-100);
81
75
  }
82
76
 
83
77
  .destructive {
84
78
  border-color: var(--color-red-500);
85
- background-color: $color-red-100;
79
+ background-color: var(--color-red-100);
86
80
  }
87
81
 
88
82
  .assertive {
89
83
  border-color: var(--color-orange-600);
90
- background-color: $color-orange-100;
84
+ background-color: var(--color-orange-100);
91
85
  }
92
86
 
93
87
  .highlight {
94
88
  border-color: var(--color-purple-400);
95
- background-color: $color-purple-100;
89
+ background-color: var(--color-purple-100);
96
90
  }
97
-
98
- // --------------------------------------------
package/src/Card/Card.tsx CHANGED
@@ -1,7 +1,7 @@
1
1
  import React, { HTMLAttributes } from "react"
2
2
  import classnames from "classnames"
3
- import { OverrideClassName } from "~types/OverrideClassName"
4
- import styles from "./Card.module.scss"
3
+ import { OverrideClassName } from "~components/types/OverrideClassName"
4
+ import styles from "./Card.module.css"
5
5
 
6
6
  export type CardVariants =
7
7
  | "default"
@@ -1,7 +1,7 @@
1
1
  import React, { InputHTMLAttributes } from "react"
2
2
  import classnames from "classnames"
3
3
  import { CheckIcon, MinusIcon } from "~components/Icon"
4
- import { OverrideClassName } from "~types/OverrideClassName"
4
+ import { OverrideClassName } from "~components/types/OverrideClassName"
5
5
  import styles from "./Checkbox.module.scss"
6
6
 
7
7
  export type CheckedStatus = "on" | "off" | "mixed"
@@ -1,7 +1,7 @@
1
1
  import React, { HTMLAttributes, useId } from "react"
2
2
  import classnames from "classnames"
3
3
  import { Label } from "~components/Label"
4
- import { OverrideClassName } from "~types/OverrideClassName"
4
+ import { OverrideClassName } from "~components/types/OverrideClassName"
5
5
  import styles from "./CheckboxGroup.module.scss"
6
6
 
7
7
  export type CheckboxGroupProps = {
@@ -1,7 +1,7 @@
1
1
  import React, { ButtonHTMLAttributes } from "react"
2
2
  import classnames from "classnames"
3
3
  import { ClearIcon } from "~components/Icon"
4
- import { OverrideClassName } from "~types/OverrideClassName"
4
+ import { OverrideClassName } from "~components/types/OverrideClassName"
5
5
  import styles from "./ClearButton.module.scss"
6
6
 
7
7
  export type ClearButtonProps = {
@@ -4,7 +4,7 @@ import AnimateHeight from "react-animate-height"
4
4
  import { Heading } from "~components/Heading"
5
5
  import { ChevronUpIcon, ChevronDownIcon } from "~components/Icon"
6
6
  import { IconButton } from "~components/__actions__/v2"
7
- import { OverrideClassName } from "~types/OverrideClassName"
7
+ import { OverrideClassName } from "~components/types/OverrideClassName"
8
8
  import { Sticky } from "../types"
9
9
  import styles from "./Collapsible.module.scss"
10
10
 
@@ -2,7 +2,7 @@ import React, { HTMLAttributes } from "react"
2
2
  import classnames from "classnames"
3
3
  import { CollapsibleProps } from "~components/Collapsible/Collapsible"
4
4
  import { Sticky } from "~components/Collapsible/types"
5
- import { OverrideClassName } from "~types/OverrideClassName"
5
+ import { OverrideClassName } from "~components/types/OverrideClassName"
6
6
  import styles from "./CollapsibleGroup.module.scss"
7
7
 
8
8
  export type CollapsibleGroupProps = {
@@ -1,6 +1,6 @@
1
1
  import React, { HTMLAttributes } from "react"
2
2
  import classnames from "classnames"
3
- import { OverrideClassName } from "~types/OverrideClassName"
3
+ import { OverrideClassName } from "~components/types/OverrideClassName"
4
4
  import styles from "./Content.module.scss"
5
5
 
6
6
  export type ContentProps = {
@@ -2,7 +2,7 @@ import React from "react"
2
2
  import classnames from "classnames"
3
3
  import { Input, InputProps } from "~components/Input"
4
4
  import { Label } from "~components/Label"
5
- import { isRefObject } from "~utils/isRefObject"
5
+ import { isRefObject } from "~components/utils/isRefObject"
6
6
  import styles from "./DateInput.module.scss"
7
7
 
8
8
  type OmittedInputProps = "reversed" | "type" | "inputRef"
@@ -1,7 +1,7 @@
1
1
  import React from "react"
2
2
  import classnames from "classnames"
3
3
  import { DateStartIcon } from "~components/Icon"
4
- import { isRefObject } from "~utils/isRefObject"
4
+ import { isRefObject } from "~components/utils/isRefObject"
5
5
  import { DateInput, DateInputProps } from "../DateInput"
6
6
  import styles from "./DateInputWithIconButton.module.scss"
7
7
 
@@ -1,6 +1,6 @@
1
1
  import React, { HTMLAttributes } from "react"
2
2
  import classnames from "classnames"
3
- import { OverrideClassName } from "~types/OverrideClassName"
3
+ import { OverrideClassName } from "~components/types/OverrideClassName"
4
4
  import styles from "./Divider.module.scss"
5
5
 
6
6
  export type DividerProps = {
@@ -9,7 +9,7 @@ import {
9
9
  EmptyStatesPositive,
10
10
  } from "~components/Illustration"
11
11
  import { Text } from "~components/Text"
12
- import { OverrideClassName } from "~types/OverrideClassName"
12
+ import { OverrideClassName } from "~components/types/OverrideClassName"
13
13
  import styles from "./EmptyState.module.scss"
14
14
 
15
15
  const ILLUSTRATIONS: Record<
@@ -5,7 +5,7 @@ import { BrandMoment } from "~components/BrandMoment"
5
5
  import { ArrowRightIcon, EmailIcon } from "~components/Icon"
6
6
  import { BrandMomentError } from "~components/Illustration"
7
7
  import { Text } from "~components/Text"
8
- import { OverrideClassName } from "~types/OverrideClassName"
8
+ import { OverrideClassName } from "~components/types/OverrideClassName"
9
9
  import { ErrorStatuses, useErrorMessages } from "./hooks"
10
10
  import styles from "./ErrorPage.module.scss"
11
11
 
@@ -1,6 +1,6 @@
1
1
  import React, { HTMLAttributes } from "react"
2
2
  import classnames from "classnames"
3
- import { OverrideClassName } from "~types/OverrideClassName"
3
+ import { OverrideClassName } from "~components/types/OverrideClassName"
4
4
  import styles from "./FieldGroup.module.scss"
5
5
 
6
6
  export type FieldGroupProps = {
@@ -2,7 +2,7 @@ import React, { HTMLAttributes } from "react"
2
2
  import classnames from "classnames"
3
3
  import { CautionWhiteIcon, ExclamationWhiteIcon } from "~components/Icon"
4
4
  import { Text } from "~components/Text"
5
- import { OverrideClassName } from "~types/OverrideClassName"
5
+ import { OverrideClassName } from "~components/types/OverrideClassName"
6
6
  import styles from "./FieldMessage.module.scss"
7
7
 
8
8
  export type FieldMessageStatus = "default" | "success" | "error" | "caution"
@@ -6,7 +6,7 @@ import React, {
6
6
  useState,
7
7
  } from "react"
8
8
  import { FocusOn } from "react-focus-on"
9
- import { OverrideClassName } from "~types/OverrideClassName"
9
+ import { OverrideClassName } from "~components/types/OverrideClassName"
10
10
  import { FilterPopover } from "./subcomponents/FilterPopover"
11
11
  import { FilterTriggerRef } from "./types"
12
12
 
@@ -1,6 +1,6 @@
1
1
  import React, { HTMLAttributes } from "react"
2
2
  import classnames from "classnames"
3
- import { OverrideClassName } from "~types/OverrideClassName"
3
+ import { OverrideClassName } from "~components/types/OverrideClassName"
4
4
  import styles from "./FilterContents.module.scss"
5
5
 
6
6
  export type FilterContentsProps = {
@@ -2,7 +2,7 @@ import React, { HTMLAttributes, useState } from "react"
2
2
  import { Options } from "@popperjs/core"
3
3
  import classnames from "classnames"
4
4
  import { usePopper } from "react-popper"
5
- import { OverrideClassName } from "~types/OverrideClassName"
5
+ import { OverrideClassName } from "~components/types/OverrideClassName"
6
6
  import styles from "./FilterPopover.module.scss"
7
7
 
8
8
  export type FilterPopoverProps = {
@@ -1,6 +1,6 @@
1
1
  import React from "react"
2
2
  import classnames from "classnames"
3
- import { OverrideClassName } from "~types/OverrideClassName"
3
+ import { OverrideClassName } from "~components/types/OverrideClassName"
4
4
  import {
5
5
  FilterBarProvider,
6
6
  FilterBarProviderProps,
@@ -1,7 +1,7 @@
1
1
  import React, { forwardRef } from "react"
2
2
  import classnames from "classnames"
3
3
  import { ChevronDownIcon, ChevronUpIcon } from "~components/Icon"
4
- import { isRefObject } from "~utils/isRefObject"
4
+ import { isRefObject } from "~components/utils/isRefObject"
5
5
  import { FilterTriggerRef } from "../../Filter/types"
6
6
  import {
7
7
  FilterButtonBase,