@workday/canvas-kit-react 12.3.5 → 12.4.0-1015-next.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 (151) hide show
  1. package/dist/commonjs/avatar/lib/Avatar.js +21 -21
  2. package/dist/commonjs/badge/lib/CountBadge.js +3 -3
  3. package/dist/commonjs/button/lib/BaseButton.js +21 -21
  4. package/dist/commonjs/button/lib/DeleteButton.js +1 -1
  5. package/dist/commonjs/button/lib/Hyperlink.js +2 -2
  6. package/dist/commonjs/button/lib/PrimaryButton.js +2 -2
  7. package/dist/commonjs/button/lib/SecondaryButton.js +2 -2
  8. package/dist/commonjs/button/lib/TertiaryButton.js +18 -18
  9. package/dist/commonjs/card/lib/Card.js +1 -1
  10. package/dist/commonjs/card/lib/CardBody.js +1 -1
  11. package/dist/commonjs/card/lib/CardHeading.js +1 -1
  12. package/dist/commonjs/checkbox/lib/CheckBackground.js +3 -3
  13. package/dist/commonjs/checkbox/lib/CheckboxCheck.js +5 -5
  14. package/dist/commonjs/checkbox/lib/CheckboxContainer.js +1 -1
  15. package/dist/commonjs/checkbox/lib/CheckboxInput.js +5 -5
  16. package/dist/commonjs/checkbox/lib/CheckboxRipple.js +1 -1
  17. package/dist/commonjs/collection/lib/ListBox.js +3 -3
  18. package/dist/commonjs/combobox/lib/ComboboxMenuList.js +1 -1
  19. package/dist/commonjs/common/lib/AccessibleHide.js +1 -1
  20. package/dist/commonjs/common/lib/CanvasProvider.js +1 -1
  21. package/dist/commonjs/form-field/lib/FormFieldContainer.js +1 -1
  22. package/dist/commonjs/form-field/lib/FormFieldField.js +1 -1
  23. package/dist/commonjs/form-field/lib/FormFieldGroupLabel.js +5 -5
  24. package/dist/commonjs/form-field/lib/FormFieldGroupList.js +3 -3
  25. package/dist/commonjs/form-field/lib/FormFieldHint.js +3 -3
  26. package/dist/commonjs/form-field/lib/FormFieldLabel.js +6 -6
  27. package/dist/commonjs/form-field/lib/formFieldStencil.js +8 -8
  28. package/dist/commonjs/icon/lib/AccentIcon.js +2 -2
  29. package/dist/commonjs/icon/lib/AppletIcon.js +1 -1
  30. package/dist/commonjs/icon/lib/Graphic.js +2 -2
  31. package/dist/commonjs/icon/lib/Svg.js +2 -2
  32. package/dist/commonjs/icon/lib/SystemIcon.js +1 -1
  33. package/dist/commonjs/icon/lib/SystemIconCircle.js +1 -1
  34. package/dist/commonjs/loading-dots/lib/LoadingDots.js +2 -2
  35. package/dist/commonjs/menu/lib/MenuCard.js +1 -1
  36. package/dist/commonjs/menu/lib/MenuItem.js +1 -1
  37. package/dist/commonjs/menu/lib/MenuList.js +3 -3
  38. package/dist/commonjs/menu/lib/MenuOption.js +1 -1
  39. package/dist/commonjs/modal/lib/ModalBody.js +1 -1
  40. package/dist/commonjs/modal/lib/ModalCard.js +1 -1
  41. package/dist/commonjs/modal/lib/ModalHeading.js +1 -1
  42. package/dist/commonjs/modal/lib/ModalOverflowOverlay.js +1 -1
  43. package/dist/commonjs/modal/lib/ModalOverlay.js +2 -2
  44. package/dist/commonjs/popup/lib/PopupBody.js +1 -1
  45. package/dist/commonjs/popup/lib/PopupCard.js +2 -2
  46. package/dist/commonjs/popup/lib/PopupCloseIcon.js +1 -1
  47. package/dist/commonjs/popup/lib/PopupHeading.js +1 -1
  48. package/dist/commonjs/select/lib/SelectCard.js +1 -1
  49. package/dist/commonjs/select/lib/SelectInput.js +3 -3
  50. package/dist/commonjs/switch/lib/Switch.js +7 -7
  51. package/dist/commonjs/table/lib/Table.js +1 -1
  52. package/dist/commonjs/table/lib/TableBody.js +1 -1
  53. package/dist/commonjs/table/lib/TableCaption.js +1 -1
  54. package/dist/commonjs/table/lib/TableCell.js +1 -1
  55. package/dist/commonjs/table/lib/TableFooter.js +1 -1
  56. package/dist/commonjs/table/lib/TableHead.js +1 -1
  57. package/dist/commonjs/table/lib/TableHeader.js +1 -1
  58. package/dist/commonjs/table/lib/TableRow.js +1 -1
  59. package/dist/commonjs/text/lib/LabelText.js +6 -6
  60. package/dist/commonjs/text/lib/Text.js +16 -16
  61. package/dist/commonjs/text/lib/TypeLevelComponents.js +4 -4
  62. package/dist/commonjs/text-area/lib/TextArea.js +5 -5
  63. package/dist/commonjs/text-input/lib/InputGroup.js +6 -6
  64. package/dist/commonjs/text-input/lib/TextInput.js +5 -5
  65. package/dist/commonjs/toast/lib/Toast.js +1 -1
  66. package/dist/commonjs/toast/lib/ToastBody.js +1 -1
  67. package/dist/commonjs/toast/lib/ToastCloseIcon.js +1 -1
  68. package/dist/commonjs/toast/lib/ToastIcon.js +1 -1
  69. package/dist/commonjs/toast/lib/ToastMessage.js +1 -1
  70. package/dist/commonjs/tooltip/lib/Tooltip.d.ts +13 -2
  71. package/dist/commonjs/tooltip/lib/Tooltip.d.ts.map +1 -1
  72. package/dist/commonjs/tooltip/lib/useTooltip.d.ts +4 -3
  73. package/dist/commonjs/tooltip/lib/useTooltip.d.ts.map +1 -1
  74. package/dist/commonjs/tooltip/lib/useTooltip.js +1 -0
  75. package/dist/es6/avatar/lib/Avatar.js +21 -21
  76. package/dist/es6/badge/lib/CountBadge.js +3 -3
  77. package/dist/es6/button/lib/BaseButton.js +21 -21
  78. package/dist/es6/button/lib/DeleteButton.js +1 -1
  79. package/dist/es6/button/lib/Hyperlink.js +2 -2
  80. package/dist/es6/button/lib/PrimaryButton.js +2 -2
  81. package/dist/es6/button/lib/SecondaryButton.js +2 -2
  82. package/dist/es6/button/lib/TertiaryButton.js +18 -18
  83. package/dist/es6/card/lib/Card.js +1 -1
  84. package/dist/es6/card/lib/CardBody.js +1 -1
  85. package/dist/es6/card/lib/CardHeading.js +1 -1
  86. package/dist/es6/checkbox/lib/CheckBackground.js +3 -3
  87. package/dist/es6/checkbox/lib/CheckboxCheck.js +5 -5
  88. package/dist/es6/checkbox/lib/CheckboxContainer.js +1 -1
  89. package/dist/es6/checkbox/lib/CheckboxInput.js +5 -5
  90. package/dist/es6/checkbox/lib/CheckboxRipple.js +1 -1
  91. package/dist/es6/collection/lib/ListBox.js +3 -3
  92. package/dist/es6/combobox/lib/ComboboxMenuList.js +1 -1
  93. package/dist/es6/common/lib/AccessibleHide.js +1 -1
  94. package/dist/es6/common/lib/CanvasProvider.js +1 -1
  95. package/dist/es6/form-field/lib/FormFieldContainer.js +1 -1
  96. package/dist/es6/form-field/lib/FormFieldField.js +1 -1
  97. package/dist/es6/form-field/lib/FormFieldGroupLabel.js +5 -5
  98. package/dist/es6/form-field/lib/FormFieldGroupList.js +3 -3
  99. package/dist/es6/form-field/lib/FormFieldHint.js +3 -3
  100. package/dist/es6/form-field/lib/FormFieldLabel.js +6 -6
  101. package/dist/es6/form-field/lib/formFieldStencil.js +8 -8
  102. package/dist/es6/icon/lib/AccentIcon.js +2 -2
  103. package/dist/es6/icon/lib/AppletIcon.js +1 -1
  104. package/dist/es6/icon/lib/Graphic.js +2 -2
  105. package/dist/es6/icon/lib/Svg.js +2 -2
  106. package/dist/es6/icon/lib/SystemIcon.js +1 -1
  107. package/dist/es6/icon/lib/SystemIconCircle.js +1 -1
  108. package/dist/es6/loading-dots/lib/LoadingDots.js +2 -2
  109. package/dist/es6/menu/lib/MenuCard.js +1 -1
  110. package/dist/es6/menu/lib/MenuItem.js +1 -1
  111. package/dist/es6/menu/lib/MenuList.js +3 -3
  112. package/dist/es6/menu/lib/MenuOption.js +1 -1
  113. package/dist/es6/modal/lib/ModalBody.js +1 -1
  114. package/dist/es6/modal/lib/ModalCard.js +1 -1
  115. package/dist/es6/modal/lib/ModalHeading.js +1 -1
  116. package/dist/es6/modal/lib/ModalOverflowOverlay.js +1 -1
  117. package/dist/es6/modal/lib/ModalOverlay.js +2 -2
  118. package/dist/es6/popup/lib/PopupBody.js +1 -1
  119. package/dist/es6/popup/lib/PopupCard.js +2 -2
  120. package/dist/es6/popup/lib/PopupCloseIcon.js +1 -1
  121. package/dist/es6/popup/lib/PopupHeading.js +1 -1
  122. package/dist/es6/select/lib/SelectCard.js +1 -1
  123. package/dist/es6/select/lib/SelectInput.js +3 -3
  124. package/dist/es6/switch/lib/Switch.js +7 -7
  125. package/dist/es6/table/lib/Table.js +1 -1
  126. package/dist/es6/table/lib/TableBody.js +1 -1
  127. package/dist/es6/table/lib/TableCaption.js +1 -1
  128. package/dist/es6/table/lib/TableCell.js +1 -1
  129. package/dist/es6/table/lib/TableFooter.js +1 -1
  130. package/dist/es6/table/lib/TableHead.js +1 -1
  131. package/dist/es6/table/lib/TableHeader.js +1 -1
  132. package/dist/es6/table/lib/TableRow.js +1 -1
  133. package/dist/es6/text/lib/LabelText.js +6 -6
  134. package/dist/es6/text/lib/Text.js +16 -16
  135. package/dist/es6/text/lib/TypeLevelComponents.js +4 -4
  136. package/dist/es6/text-area/lib/TextArea.js +5 -5
  137. package/dist/es6/text-input/lib/InputGroup.js +6 -6
  138. package/dist/es6/text-input/lib/TextInput.js +5 -5
  139. package/dist/es6/toast/lib/Toast.js +1 -1
  140. package/dist/es6/toast/lib/ToastBody.js +1 -1
  141. package/dist/es6/toast/lib/ToastCloseIcon.js +1 -1
  142. package/dist/es6/toast/lib/ToastIcon.js +1 -1
  143. package/dist/es6/toast/lib/ToastMessage.js +1 -1
  144. package/dist/es6/tooltip/lib/Tooltip.d.ts +13 -2
  145. package/dist/es6/tooltip/lib/Tooltip.d.ts.map +1 -1
  146. package/dist/es6/tooltip/lib/useTooltip.d.ts +4 -3
  147. package/dist/es6/tooltip/lib/useTooltip.d.ts.map +1 -1
  148. package/dist/es6/tooltip/lib/useTooltip.js +1 -0
  149. package/package.json +4 -4
  150. package/tooltip/lib/Tooltip.tsx +13 -2
  151. package/tooltip/lib/useTooltip.tsx +4 -3
@@ -7,15 +7,15 @@ export const textInputStencil = createStencil({
7
7
  vars: {
8
8
  width: '',
9
9
  },
10
- base: { name: "x0713x", styles: "box-sizing:border-box;font-family:var(--cnvs-sys-font-family-default);font-weight:var(--cnvs-sys-font-weight-normal);line-height:var(--cnvs-sys-line-height-subtext-large);font-size:var(--cnvs-sys-font-size-subtext-large);letter-spacing:var(--cnvs-base-letter-spacing-150);display:block;border:0.0625rem solid var(--cnvs-sys-color-border-input-default);background-color:var(--cnvs-sys-color-bg-default);border-radius:var(--cnvs-sys-shape-x1);height:var(--cnvs-sys-space-x10);transition:0.2s box-shadow, 0.2s border-color;padding:var(--cnvs-sys-space-x2);margin:0rem;width:var(--width-text-input-d81f49);min-width:var(--width-text-input-d81f49, calc(calc(var(--cnvs-sys-space-x20) * 3) + var(--cnvs-sys-space-x10)));color:var(--cnvs-sys-color-text-default);text-overflow:ellipsis;::-ms-clear{display:none;}&::placeholder{color:var(--cnvs-sys-color-text-hint);}&:is(:hover, .hover){border-color:var(--cnvs-sys-color-border-input-strong);}&:is(:focus-visible, .focus):where(:not([disabled])){border-color:var(--cnvs-brand-common-focus-outline);box-shadow:inset 0 0 0 1px var(--cnvs-brand-common-focus-outline);outline:none;}&:is(:disabled, .disabled){background-color:var(--cnvs-sys-color-bg-alt-softer);border-color:var(--cnvs-sys-color-border-input-disabled);color:var(--cnvs-sys-color-text-disabled);&::placeholder{color:var(--cnvs-sys-color-text-disabled);}}" },
10
+ base: { name: "lqrz3x", styles: "box-sizing:border-box;font-family:var(--cnvs-sys-font-family-default);font-weight:var(--cnvs-sys-font-weight-normal);line-height:var(--cnvs-sys-line-height-subtext-large);font-size:var(--cnvs-sys-font-size-subtext-large);letter-spacing:var(--cnvs-base-letter-spacing-150);display:block;border:0.0625rem solid var(--cnvs-sys-color-border-input-default);background-color:var(--cnvs-sys-color-bg-default);border-radius:var(--cnvs-sys-shape-x1);height:var(--cnvs-sys-space-x10);transition:0.2s box-shadow, 0.2s border-color;padding:var(--cnvs-sys-space-x2);margin:0rem;width:var(--width-text-input-d81f49);min-width:var(--width-text-input-d81f49, calc(calc(var(--cnvs-sys-space-x20) * 3) + var(--cnvs-sys-space-x10)));color:var(--cnvs-sys-color-text-default);text-overflow:ellipsis;::-ms-clear{display:none;}&::placeholder{color:var(--cnvs-sys-color-text-hint);}&:is(:hover, .hover){border-color:var(--cnvs-sys-color-border-input-strong);}&:is(:focus-visible, .focus):where(:not([disabled])){border-color:var(--cnvs-brand-common-focus-outline);box-shadow:inset 0 0 0 1px var(--cnvs-brand-common-focus-outline);outline:none;}&:is(:disabled, .disabled){background-color:var(--cnvs-sys-color-bg-alt-softer);border-color:var(--cnvs-sys-color-border-input-disabled);color:var(--cnvs-sys-color-text-disabled);&::placeholder{color:var(--cnvs-sys-color-text-disabled);}}" },
11
11
  modifiers: {
12
12
  grow: {
13
- true: { name: "x0713y", styles: "width:100%;resize:vertical;" },
14
- false: { name: "x0713z", styles: "width:initial;" }
13
+ true: { name: "lqrz3y", styles: "width:100%;resize:vertical;" },
14
+ false: { name: "lqrz3z", styles: "width:initial;" }
15
15
  },
16
16
  error: {
17
- error: { name: "x07140", styles: "border-color:var(--cnvs-brand-error-base);box-shadow:inset 0 0 0 0.0625rem var(--cnvs-brand-error-base);&:is(:hover, .hover, :disabled, .disabled, :focus-visible:not([disabled]), .focus:not([disabled])){border-color:var(--cnvs-brand-error-base);}&:is(:focus-visible, .focus):not([disabled]){box-shadow:inset 0 0 0 0.0625rem var(--cnvs-brand-error-base), 0 0 0 2px var(--cnvs-sys-color-border-inverse), 0 0 0 4px var(--cnvs-brand-common-focus-outline);}" },
18
- alert: { name: "x07141", styles: "border-color:var(--cnvs-brand-alert-darkest);box-shadow:inset 0 0 0 0.125rem var(--cnvs-brand-alert-base);&:is(:hover, .hover, :disabled, .disabled, :focus-visible:not([disabled]), .focus:not([disabled])){border-color:var(--cnvs-brand-alert-darkest);}&:is(:focus-visible, .focus):not([disabled]){box-shadow:inset 0 0 0 0.125rem var(--cnvs-brand-alert-base),\n 0 0 0 2px var(--cnvs-sys-color-border-inverse),\n 0 0 0 4px var(--cnvs-brand-common-focus-outline);}" }
17
+ error: { name: "lqrz40", styles: "border-color:var(--cnvs-brand-error-base);box-shadow:inset 0 0 0 0.0625rem var(--cnvs-brand-error-base);&:is(:hover, .hover, :disabled, .disabled, :focus-visible:not([disabled]), .focus:not([disabled])){border-color:var(--cnvs-brand-error-base);}&:is(:focus-visible, .focus):not([disabled]){box-shadow:inset 0 0 0 0.0625rem var(--cnvs-brand-error-base), 0 0 0 2px var(--cnvs-sys-color-border-inverse), 0 0 0 4px var(--cnvs-brand-common-focus-outline);}" },
18
+ alert: { name: "lqrz41", styles: "border-color:var(--cnvs-brand-alert-darkest);box-shadow:inset 0 0 0 0.125rem var(--cnvs-brand-alert-base);&:is(:hover, .hover, :disabled, .disabled, :focus-visible:not([disabled]), .focus:not([disabled])){border-color:var(--cnvs-brand-alert-darkest);}&:is(:focus-visible, .focus):not([disabled]){box-shadow:inset 0 0 0 0.125rem var(--cnvs-brand-alert-base),\n 0 0 0 2px var(--cnvs-sys-color-border-inverse),\n 0 0 0 4px var(--cnvs-brand-common-focus-outline);}" }
19
19
  }
20
20
  },
21
21
  defaultModifiers: {
@@ -42,7 +42,7 @@ const getAriaAttributes = (mode, id) => {
42
42
  }
43
43
  };
44
44
  const toastStencil = createStencil({
45
- base: { name: "x07160", styles: "box-sizing:border-box;display:flex;flex-direction:row;width:calc(calc(var(--cnvs-sys-space-x20) * 4) + var(--cnvs-sys-space-x10));padding:var(--cnvs-sys-space-zero);gap:var(--cnvs-sys-space-x1);" }
45
+ base: { name: "lqrz60", styles: "box-sizing:border-box;display:flex;flex-direction:row;width:calc(calc(var(--cnvs-sys-space-x20) * 4) + var(--cnvs-sys-space-x10));padding:var(--cnvs-sys-space-zero);gap:var(--cnvs-sys-space-x1);" }
46
46
  }, "toast-55513d");
47
47
  /**
48
48
  * Toast is a compound component that has different modes based on its contents. The modes add the proper aria attributes for accessibility
@@ -4,7 +4,7 @@ import { Flex, mergeStyles } from '@workday/canvas-kit-react/layout';
4
4
  import { createStencil } from '@workday/canvas-kit-styling';
5
5
  import { system } from '@workday/canvas-tokens-web';
6
6
  export const toastBodyStencil = createStencil({
7
- base: { name: "x0715z", styles: "box-sizing:border-box;align-items:flex-start;flex-direction:column;justify-content:center;padding-top:var(--cnvs-sys-space-x4);padding-bottom:var(--cnvs-sys-space-x4);flex-grow:1;gap:var(--cnvs-sys-space-x1);" }
7
+ base: { name: "lqrz5z", styles: "box-sizing:border-box;align-items:flex-start;flex-direction:column;justify-content:center;padding-top:var(--cnvs-sys-space-x4);padding-bottom:var(--cnvs-sys-space-x4);flex-grow:1;gap:var(--cnvs-sys-space-x1);" }
8
8
  }, "toast-body-7d81ac");
9
9
  export const ToastBody = createComponent('div')({
10
10
  displayName: 'Toast.Body',
@@ -4,7 +4,7 @@ import { Popup } from '@workday/canvas-kit-react/popup';
4
4
  import { createStencil } from '@workday/canvas-kit-styling';
5
5
  import { mergeStyles } from '@workday/canvas-kit-react/layout';
6
6
  export const toastCloseIconStencil = createStencil({
7
- base: { name: "x0715w", styles: "box-sizing:border-box;position:relative;" }
7
+ base: { name: "lqrz5w", styles: "box-sizing:border-box;position:relative;" }
8
8
  }, "toast-close-icon-be7e9f");
9
9
  export const ToastCloseIcon = createComponent('button')({
10
10
  displayName: 'Toast.CloseIcon',
@@ -4,7 +4,7 @@ import { SystemIcon } from '@workday/canvas-kit-react/icon';
4
4
  import { createStencil, handleCsProp } from '@workday/canvas-kit-styling';
5
5
  import { system } from '@workday/canvas-tokens-web';
6
6
  export const toastIconStencil = createStencil({
7
- base: { name: "x0715x", styles: "box-sizing:border-box;align-self:start;margin:var(--cnvs-sys-space-x4) var(--cnvs-sys-space-x3);" }
7
+ base: { name: "lqrz5x", styles: "box-sizing:border-box;align-self:start;margin:var(--cnvs-sys-space-x4) var(--cnvs-sys-space-x3);" }
8
8
  }, "toast-icon-4b0701");
9
9
  export const ToastIcon = createComponent('div')({
10
10
  displayName: 'Toast.Icon',
@@ -6,7 +6,7 @@ import { createStencil } from '@workday/canvas-kit-styling';
6
6
  import { mergeStyles } from '@workday/canvas-kit-react/layout';
7
7
  import { system } from '@workday/canvas-tokens-web';
8
8
  export const toastMessageStencil = createStencil({
9
- base: { name: "x0715y", styles: "box-sizing:border-box;word-break:break-word;margin-block-start:var(--cnvs-sys-space-zero);margin-block-end:var(--cnvs-sys-space-zero);" }
9
+ base: { name: "lqrz5y", styles: "box-sizing:border-box;word-break:break-word;margin-block-start:var(--cnvs-sys-space-zero);margin-block-end:var(--cnvs-sys-space-zero);" }
10
10
  }, "toast-message-759382");
11
11
  export const ToastMessage = createSubcomponent('p')({
12
12
  modelHook: useToastModel,
@@ -4,6 +4,17 @@ export interface TooltipProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
4
4
  /**
5
5
  * This should be a string in most cases. HTML is supported, but only text is understood
6
6
  * by assistive technology. This is true for both `label` and `describe` modes.
7
+ *
8
+ * **Note:** If you use `description` type and want to pass `jsx`, it **must* be inline and **not** a component to ensure the inner text is properly translated.
9
+ *
10
+ * ```jsx
11
+ * // The text will be understood as: You must accept terms and conditions
12
+ * <Tooltip type="description" title={<span>You<i>must</i> accept terms and conditions</span>}/>
13
+ *
14
+ * // This will render a string including the html and will not be properly understood by voice over.
15
+ * const MyComponent = () => <span>You<i>must</i> accept terms and conditions</span>
16
+ * <Tooltip type="description" title={MyComponent/>
17
+ * ```
7
18
  */
8
19
  title: React.ReactNode;
9
20
  /**
@@ -33,7 +44,7 @@ export interface TooltipProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
33
44
  * - `label`: Sets the accessible name for the wrapped element. Use for icons or if tooltip
34
45
  * `title` prop is the same as the text content of the wrapped element. E.g. TertiaryButtons that render an icon or
35
46
  * Ellipsis tooltips.
36
- * - `describe`: Sets `aria-describedby` of the wrapped element. Use if the tooltip has additional
47
+ * - **Deprecated: `describe` is deprecated, please use `description`**.`describe`: Sets `aria-describedby` of the wrapped element. Use if the tooltip has additional
37
48
  * information about the target.
38
49
  * - `muted`: No effort is made to make the tooltip accessible to screen readers. Use if the
39
50
  * tooltip contents are not useful to a screen reader or if you have handled accessibility of
@@ -43,7 +54,7 @@ export interface TooltipProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
43
54
  * Consider an alternate way to inform a user of additional important information.
44
55
  * @default 'label'
45
56
  */
46
- type?: 'label' | 'describe' | 'muted';
57
+ type?: 'label' | 'describe' | 'muted' | 'description';
47
58
  /**
48
59
  * Amount of time (in ms) to delay before showing the tooltip
49
60
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../../tooltip/lib/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAEL,SAAS,EAGV,MAAM,iCAAiC,CAAC;AAMzC,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IACvF;;;OAGG;IACH,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB;;;;;;;OAOG;IACH,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAClC;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,SAAS,EAAE,CAAC;IACjC;;;;;;;;;;;;;;;OAeG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,OAAO,CAAC;IACtC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAiBD,eAAO,MAAM,OAAO,kFA0ClB,CAAC"}
1
+ {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../../tooltip/lib/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAEL,SAAS,EAGV,MAAM,iCAAiC,CAAC;AAMzC,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IACvF;;;;;;;;;;;;;;OAcG;IACH,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB;;;;;;;OAOG;IACH,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAClC;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,SAAS,EAAE,CAAC;IACjC;;;;;;;;;;;;;;;OAeG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,OAAO,GAAG,aAAa,CAAC;IACtD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAiBD,eAAO,MAAM,OAAO,kFA0ClB,CAAC"}
@@ -10,17 +10,17 @@ export declare function useTooltip<T extends Element = Element>({ type, titleTex
10
10
  * - `label`: Sets the accessible name for the wrapped element. Use for icons or if tooltip
11
11
  * `title` prop is the same as the text content of the wrapped element. E.g. TertiaryButton that renders an icon or
12
12
  * Ellipsis tooltips.
13
- * - `describe`: Sets `aria-describedby` of the wrapped element. Use if the tooltip has additional
14
- * information about the target.
13
+ * - **Deprecated: `describe` is deprecated, please use `description`.**`describe`: Sets `aria-describedby` of the wrapped element. Use if the tooltip has additional information about the target
15
14
  * - `muted`: No effort is made to make the tooltip accessible to screen readers. Use if the
16
15
  * tooltip contents are not useful to a screen reader or if you have handled accessibility of
17
16
  * the tooltip yourself.
17
+ * - `description`: Sets `aria-description` strings for the wrapped element. Use if the tooltip has additional about the target
18
18
  *
19
19
  * **Note**: Assistive technology may ignore `describe` techniques based on verbosity settings.
20
20
  * Consider an alternate way to inform a user of additional important information.
21
21
  * @default 'label'
22
22
  */
23
- type?: 'label' | 'describe' | 'muted';
23
+ type?: 'label' | 'describe' | 'muted' | 'description';
24
24
  /**
25
25
  * The content of the `aria-label` if `type` is `label.
26
26
  */
@@ -37,6 +37,7 @@ export declare function useTooltip<T extends Element = Element>({ type, titleTex
37
37
  /** Mix these properties into the target element. **Must be an Element** */
38
38
  targetProps: {
39
39
  'aria-describedby': string | undefined;
40
+ 'aria-description': string | undefined;
40
41
  'aria-label': string | undefined;
41
42
  onMouseEnter: (event: React.SyntheticEvent) => void;
42
43
  onMouseLeave: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"useTooltip.d.ts","sourceRoot":"","sources":["../../../../tooltip/lib/useTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAmD/B;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,EAAE,EACtD,IAAc,EACd,SAAc,EACd,SAAe,EACf,SAAe,GAChB,GAAE;IACD;;;;;;;;;;;;;;;OAeG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,OAAO,CAAC;IACtC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACf;IA+DF,2EAA2E;;;;8BA7C5C,MAAM,cAAc;;6BAazB,gBAAgB;yBARpB,gBAAgB;;;IA0CtC,uDAAuD;;;;;;IAMvD,iEAAiE;;;;;;;EAQpE"}
1
+ {"version":3,"file":"useTooltip.d.ts","sourceRoot":"","sources":["../../../../tooltip/lib/useTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAmD/B;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,EAAE,EACtD,IAAc,EACd,SAAc,EACd,SAAe,EACf,SAAe,GAChB,GAAE;IACD;;;;;;;;;;;;;;;OAeG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,OAAO,GAAG,aAAa,CAAC;IACtD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACf;IAgEF,2EAA2E;;;;;8BA9C5C,MAAM,cAAc;;6BAazB,gBAAgB;yBARpB,gBAAgB;;;IA2CtC,uDAAuD;;;;;;IAMvD,iEAAiE;;;;;;;EAQpE"}
@@ -78,6 +78,7 @@ export function useTooltip({ type = 'label', titleText = '', showDelay = 300, hi
78
78
  const targetProps = {
79
79
  // extra description of the target element for assistive technology
80
80
  'aria-describedby': type === 'describe' && visible ? id : undefined,
81
+ 'aria-description': type === 'description' ? titleText : undefined,
81
82
  // This will replace the accessible name of the target element
82
83
  'aria-label': type === 'label' ? titleText : undefined,
83
84
  onMouseEnter: onOpenFromTarget,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-react",
3
- "version": "12.3.5",
3
+ "version": "12.4.0-1015-next.0",
4
4
  "description": "The parent module that contains all Workday Canvas Kit React components",
5
5
  "author": "Workday, Inc. (https://www.workday.com)",
6
6
  "license": "Apache-2.0",
@@ -49,8 +49,8 @@
49
49
  "@emotion/styled": "^11.6.0",
50
50
  "@popperjs/core": "^2.5.4",
51
51
  "@workday/canvas-colors-web": "^2.0.0",
52
- "@workday/canvas-kit-popup-stack": "^12.3.5",
53
- "@workday/canvas-kit-styling": "^12.3.5",
52
+ "@workday/canvas-kit-popup-stack": "^12.4.0-1015-next.0",
53
+ "@workday/canvas-kit-styling": "^12.4.0-1015-next.0",
54
54
  "@workday/canvas-system-icons-web": "^3.0.0",
55
55
  "@workday/canvas-tokens-web": "^2.1.0",
56
56
  "@workday/design-assets-types": "^0.2.8",
@@ -66,5 +66,5 @@
66
66
  "@workday/canvas-accent-icons-web": "^3.0.0",
67
67
  "@workday/canvas-applet-icons-web": "^2.0.0"
68
68
  },
69
- "gitHead": "36cb5e3cb24c43de85acf72a534c9a8a8b2499bf"
69
+ "gitHead": "d2351f7f9b4ef85afeaaf40ce7100fefb9f2d27b"
70
70
  }
@@ -16,6 +16,17 @@ export interface TooltipProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
16
16
  /**
17
17
  * This should be a string in most cases. HTML is supported, but only text is understood
18
18
  * by assistive technology. This is true for both `label` and `describe` modes.
19
+ *
20
+ * **Note:** If you use `description` type and want to pass `jsx`, it **must* be inline and **not** a component to ensure the inner text is properly translated.
21
+ *
22
+ * ```jsx
23
+ * // The text will be understood as: You must accept terms and conditions
24
+ * <Tooltip type="description" title={<span>You<i>must</i> accept terms and conditions</span>}/>
25
+ *
26
+ * // This will render a string including the html and will not be properly understood by voice over.
27
+ * const MyComponent = () => <span>You<i>must</i> accept terms and conditions</span>
28
+ * <Tooltip type="description" title={MyComponent/>
29
+ * ```
19
30
  */
20
31
  title: React.ReactNode;
21
32
  /**
@@ -45,7 +56,7 @@ export interface TooltipProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
45
56
  * - `label`: Sets the accessible name for the wrapped element. Use for icons or if tooltip
46
57
  * `title` prop is the same as the text content of the wrapped element. E.g. TertiaryButtons that render an icon or
47
58
  * Ellipsis tooltips.
48
- * - `describe`: Sets `aria-describedby` of the wrapped element. Use if the tooltip has additional
59
+ * - **Deprecated: `describe` is deprecated, please use `description`**.`describe`: Sets `aria-describedby` of the wrapped element. Use if the tooltip has additional
49
60
  * information about the target.
50
61
  * - `muted`: No effort is made to make the tooltip accessible to screen readers. Use if the
51
62
  * tooltip contents are not useful to a screen reader or if you have handled accessibility of
@@ -55,7 +66,7 @@ export interface TooltipProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
55
66
  * Consider an alternate way to inform a user of additional important information.
56
67
  * @default 'label'
57
68
  */
58
- type?: 'label' | 'describe' | 'muted';
69
+ type?: 'label' | 'describe' | 'muted' | 'description';
59
70
  /**
60
71
  * Amount of time (in ms) to delay before showing the tooltip
61
72
  */
@@ -65,17 +65,17 @@ export function useTooltip<T extends Element = Element>({
65
65
  * - `label`: Sets the accessible name for the wrapped element. Use for icons or if tooltip
66
66
  * `title` prop is the same as the text content of the wrapped element. E.g. TertiaryButton that renders an icon or
67
67
  * Ellipsis tooltips.
68
- * - `describe`: Sets `aria-describedby` of the wrapped element. Use if the tooltip has additional
69
- * information about the target.
68
+ * - **Deprecated: `describe` is deprecated, please use `description`.**`describe`: Sets `aria-describedby` of the wrapped element. Use if the tooltip has additional information about the target
70
69
  * - `muted`: No effort is made to make the tooltip accessible to screen readers. Use if the
71
70
  * tooltip contents are not useful to a screen reader or if you have handled accessibility of
72
71
  * the tooltip yourself.
72
+ * - `description`: Sets `aria-description` strings for the wrapped element. Use if the tooltip has additional about the target
73
73
  *
74
74
  * **Note**: Assistive technology may ignore `describe` techniques based on verbosity settings.
75
75
  * Consider an alternate way to inform a user of additional important information.
76
76
  * @default 'label'
77
77
  */
78
- type?: 'label' | 'describe' | 'muted';
78
+ type?: 'label' | 'describe' | 'muted' | 'description';
79
79
  /**
80
80
  * The content of the `aria-label` if `type` is `label.
81
81
  */
@@ -136,6 +136,7 @@ export function useTooltip<T extends Element = Element>({
136
136
  const targetProps = {
137
137
  // extra description of the target element for assistive technology
138
138
  'aria-describedby': type === 'describe' && visible ? id : undefined,
139
+ 'aria-description': type === 'description' ? titleText : undefined,
139
140
  // This will replace the accessible name of the target element
140
141
  'aria-label': type === 'label' ? titleText : undefined,
141
142
  onMouseEnter: onOpenFromTarget,