@workday/canvas-kit-react 5.3.0-next.9 → 5.3.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 (99) hide show
  1. package/common/lib/styles/accessibleHide.ts +2 -2
  2. package/cookie-banner/README.md +10 -15
  3. package/cookie-banner/index.ts +3 -3
  4. package/cookie-banner/lib/CookieBanner.tsx +4 -29
  5. package/dist/commonjs/common/lib/styles/accessibleHide.d.ts +2 -2
  6. package/dist/commonjs/common/lib/styles/accessibleHide.d.ts.map +1 -1
  7. package/dist/commonjs/cookie-banner/index.d.ts +3 -3
  8. package/dist/commonjs/cookie-banner/index.d.ts.map +1 -1
  9. package/dist/commonjs/cookie-banner/index.js +1 -1
  10. package/dist/commonjs/cookie-banner/lib/CookieBanner.d.ts +2 -19
  11. package/dist/commonjs/cookie-banner/lib/CookieBanner.d.ts.map +1 -1
  12. package/dist/commonjs/cookie-banner/lib/CookieBanner.js +8 -19
  13. package/dist/commonjs/page-header/index.d.ts +3 -3
  14. package/dist/commonjs/page-header/index.d.ts.map +1 -1
  15. package/dist/commonjs/page-header/index.js +1 -1
  16. package/dist/commonjs/page-header/lib/PageHeader.d.ts +2 -19
  17. package/dist/commonjs/page-header/lib/PageHeader.d.ts.map +1 -1
  18. package/dist/commonjs/page-header/lib/PageHeader.js +7 -18
  19. package/dist/commonjs/pagination/lib/Pagination/GoTo/Label.d.ts +3 -0
  20. package/dist/commonjs/pagination/lib/Pagination/GoTo/Label.d.ts.map +1 -1
  21. package/dist/commonjs/pagination/lib/Pagination/types.d.ts +39 -0
  22. package/dist/commonjs/pagination/lib/Pagination/types.d.ts.map +1 -1
  23. package/dist/commonjs/pagination/lib/Pagination/usePaginationModel.d.ts +19 -0
  24. package/dist/commonjs/pagination/lib/Pagination/usePaginationModel.d.ts.map +1 -1
  25. package/dist/commonjs/tabs/lib/Tab.d.ts.map +1 -1
  26. package/dist/commonjs/tabs/lib/Tab.js +18 -24
  27. package/dist/commonjs/tooltip/lib/OverflowTooltip.d.ts +10 -0
  28. package/dist/commonjs/tooltip/lib/OverflowTooltip.d.ts.map +1 -1
  29. package/dist/commonjs/tooltip/lib/OverflowTooltip.js +8 -6
  30. package/dist/commonjs/tooltip/lib/Tooltip.d.ts +9 -1
  31. package/dist/commonjs/tooltip/lib/Tooltip.d.ts.map +1 -1
  32. package/dist/commonjs/tooltip/lib/Tooltip.js +7 -2
  33. package/dist/commonjs/tooltip/lib/useTooltip.d.ts +9 -1
  34. package/dist/commonjs/tooltip/lib/useTooltip.d.ts.map +1 -1
  35. package/dist/commonjs/tooltip/lib/useTooltip.js +13 -8
  36. package/dist/es6/common/lib/styles/accessibleHide.d.ts +2 -2
  37. package/dist/es6/common/lib/styles/accessibleHide.d.ts.map +1 -1
  38. package/dist/es6/cookie-banner/index.d.ts +3 -3
  39. package/dist/es6/cookie-banner/index.d.ts.map +1 -1
  40. package/dist/es6/cookie-banner/index.js +3 -3
  41. package/dist/es6/cookie-banner/lib/CookieBanner.d.ts +2 -19
  42. package/dist/es6/cookie-banner/lib/CookieBanner.d.ts.map +1 -1
  43. package/dist/es6/cookie-banner/lib/CookieBanner.js +8 -19
  44. package/dist/es6/page-header/index.d.ts +3 -3
  45. package/dist/es6/page-header/index.d.ts.map +1 -1
  46. package/dist/es6/page-header/index.js +3 -3
  47. package/dist/es6/page-header/lib/PageHeader.d.ts +2 -19
  48. package/dist/es6/page-header/lib/PageHeader.d.ts.map +1 -1
  49. package/dist/es6/page-header/lib/PageHeader.js +7 -18
  50. package/dist/es6/pagination/lib/Pagination/GoTo/Label.d.ts +3 -0
  51. package/dist/es6/pagination/lib/Pagination/GoTo/Label.d.ts.map +1 -1
  52. package/dist/es6/pagination/lib/Pagination/types.d.ts +39 -0
  53. package/dist/es6/pagination/lib/Pagination/types.d.ts.map +1 -1
  54. package/dist/es6/pagination/lib/Pagination/usePaginationModel.d.ts +19 -0
  55. package/dist/es6/pagination/lib/Pagination/usePaginationModel.d.ts.map +1 -1
  56. package/dist/es6/tabs/lib/Tab.d.ts.map +1 -1
  57. package/dist/es6/tabs/lib/Tab.js +18 -24
  58. package/dist/es6/tooltip/lib/OverflowTooltip.d.ts +10 -0
  59. package/dist/es6/tooltip/lib/OverflowTooltip.d.ts.map +1 -1
  60. package/dist/es6/tooltip/lib/OverflowTooltip.js +5 -3
  61. package/dist/es6/tooltip/lib/Tooltip.d.ts +9 -1
  62. package/dist/es6/tooltip/lib/Tooltip.d.ts.map +1 -1
  63. package/dist/es6/tooltip/lib/Tooltip.js +7 -2
  64. package/dist/es6/tooltip/lib/useTooltip.d.ts +9 -1
  65. package/dist/es6/tooltip/lib/useTooltip.d.ts.map +1 -1
  66. package/dist/es6/tooltip/lib/useTooltip.js +13 -8
  67. package/package.json +5 -5
  68. package/page-header/README.md +6 -11
  69. package/page-header/index.ts +3 -3
  70. package/page-header/lib/PageHeader.tsx +3 -28
  71. package/pagination/lib/Pagination/GoTo/Label.tsx +3 -0
  72. package/pagination/lib/Pagination/types.ts +44 -5
  73. package/pagination/lib/Pagination/usePaginationModel.ts +19 -0
  74. package/tabs/lib/Tab.tsx +53 -59
  75. package/tooltip/lib/OverflowTooltip.tsx +5 -3
  76. package/tooltip/lib/Tooltip.tsx +16 -1
  77. package/tooltip/lib/useTooltip.tsx +21 -6
  78. package/ts3.5/dist/commonjs/common/lib/styles/accessibleHide.d.ts +2 -2
  79. package/ts3.5/dist/commonjs/cookie-banner/index.d.ts +3 -3
  80. package/ts3.5/dist/commonjs/cookie-banner/lib/CookieBanner.d.ts +2 -19
  81. package/ts3.5/dist/commonjs/page-header/index.d.ts +3 -3
  82. package/ts3.5/dist/commonjs/page-header/lib/PageHeader.d.ts +2 -19
  83. package/ts3.5/dist/commonjs/pagination/lib/Pagination/GoTo/Label.d.ts +3 -0
  84. package/ts3.5/dist/commonjs/pagination/lib/Pagination/types.d.ts +39 -0
  85. package/ts3.5/dist/commonjs/pagination/lib/Pagination/usePaginationModel.d.ts +19 -0
  86. package/ts3.5/dist/commonjs/tooltip/lib/OverflowTooltip.d.ts +10 -0
  87. package/ts3.5/dist/commonjs/tooltip/lib/Tooltip.d.ts +9 -1
  88. package/ts3.5/dist/commonjs/tooltip/lib/useTooltip.d.ts +9 -1
  89. package/ts3.5/dist/es6/common/lib/styles/accessibleHide.d.ts +2 -2
  90. package/ts3.5/dist/es6/cookie-banner/index.d.ts +3 -3
  91. package/ts3.5/dist/es6/cookie-banner/lib/CookieBanner.d.ts +2 -19
  92. package/ts3.5/dist/es6/page-header/index.d.ts +3 -3
  93. package/ts3.5/dist/es6/page-header/lib/PageHeader.d.ts +2 -19
  94. package/ts3.5/dist/es6/pagination/lib/Pagination/GoTo/Label.d.ts +3 -0
  95. package/ts3.5/dist/es6/pagination/lib/Pagination/types.d.ts +39 -0
  96. package/ts3.5/dist/es6/pagination/lib/Pagination/usePaginationModel.d.ts +19 -0
  97. package/ts3.5/dist/es6/tooltip/lib/OverflowTooltip.d.ts +10 -0
  98. package/ts3.5/dist/es6/tooltip/lib/Tooltip.d.ts +9 -1
  99. package/ts3.5/dist/es6/tooltip/lib/useTooltip.d.ts +9 -1
@@ -37,6 +37,14 @@ export interface TooltipProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
37
37
  * @default 'label'
38
38
  */
39
39
  type?: 'label' | 'describe' | 'muted';
40
+ /**
41
+ * Amount of time (in ms) to delay before showing the tooltip
42
+ */
43
+ showDelay?: number;
44
+ /**
45
+ * Amount of time (in ms) to delay before hiding the tooltip
46
+ */
47
+ hideDelay?: number;
40
48
  }
41
- export declare const Tooltip: ({ type, placement, title, children, ...elemProps }: TooltipProps) => JSX.Element;
49
+ export declare const Tooltip: ({ type, placement, title, children, showDelay, hideDelay, ...elemProps }: TooltipProps) => JSX.Element;
42
50
  //# sourceMappingURL=Tooltip.d.ts.map
@@ -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,EAA4B,SAAS,EAAS,MAAM,iCAAiC,CAAC;AAM7F,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;;;;;;;;;;;;;;;OAeG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,OAAO,CAAC;CACvC;AAiBD,eAAO,MAAM,OAAO,mFA+BnB,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,EAA4B,SAAS,EAAS,MAAM,iCAAiC,CAAC;AAM7F,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;;;;;;;;;;;;;;;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,yGAsCnB,CAAC"}
@@ -51,9 +51,14 @@ function mergeCallbacks(elemProps, componentProps, keys) {
51
51
  }, {});
52
52
  }
53
53
  exports.Tooltip = function (_a) {
54
- var _b = _a.type, type = _b === void 0 ? 'label' : _b, _c = _a.placement, placement = _c === void 0 ? 'top' : _c, title = _a.title, children = _a.children, elemProps = __rest(_a, ["type", "placement", "title", "children"]);
54
+ var _b = _a.type, type = _b === void 0 ? 'label' : _b, _c = _a.placement, placement = _c === void 0 ? 'top' : _c, title = _a.title, children = _a.children, _d = _a.showDelay, showDelay = _d === void 0 ? 300 : _d, _e = _a.hideDelay, hideDelay = _e === void 0 ? 100 : _e, elemProps = __rest(_a, ["type", "placement", "title", "children", "showDelay", "hideDelay"]);
55
55
  var titleText = react_innertext_1.default(title);
56
- var _d = useTooltip_1.useTooltip({ type: type, titleText: titleText }), targetProps = _d.targetProps, popperProps = _d.popperProps, tooltipProps = _d.tooltipProps;
56
+ var _f = useTooltip_1.useTooltip({
57
+ type: type,
58
+ titleText: titleText,
59
+ showDelay: showDelay,
60
+ hideDelay: hideDelay,
61
+ }), targetProps = _f.targetProps, popperProps = _f.popperProps, tooltipProps = _f.tooltipProps;
57
62
  return (React.createElement(React.Fragment, null,
58
63
  React.cloneElement(children, __assign(__assign(__assign({}, targetProps), mergeCallbacks(children.props, targetProps)), (type === 'muted' && children.props['aria-label']
59
64
  ? { 'aria-label': children.props['aria-label'] }
@@ -3,7 +3,7 @@ import * as React from 'react';
3
3
  * Convenience hook for creating components with tooltips. It will return an object of properties to mix
4
4
  * into a target, popper and tooltip
5
5
  */
6
- export declare function useTooltip<T extends Element = Element>({ type, titleText, }?: {
6
+ export declare function useTooltip<T extends Element = Element>({ type, titleText, showDelay, hideDelay, }?: {
7
7
  /**
8
8
  * Determines the tooltip type for accessibility.
9
9
  *
@@ -25,6 +25,14 @@ export declare function useTooltip<T extends Element = Element>({ type, titleTex
25
25
  * The content of the `aria-label` if `type` is `label.
26
26
  */
27
27
  titleText?: string;
28
+ /**
29
+ * Amount of time (in ms) to delay before showing the tooltip
30
+ */
31
+ showDelay?: number;
32
+ /**
33
+ * Amount of time (in ms) to delay before hiding the tooltip
34
+ */
35
+ hideDelay?: number;
28
36
  }): {
29
37
  /** Mix these properties into the target element. **Must be an Element** */
30
38
  targetProps: {
@@ -1 +1 @@
1
- {"version":3,"file":"useTooltip.d.ts","sourceRoot":"","sources":["../../../../tooltip/lib/useTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAiD/B;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,EAAE,EACtD,IAAc,EACd,SAAc,GACf,GAAE;IACD;;;;;;;;;;;;;;;OAeG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,OAAO,CAAC;IACtC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACf;IAuCF,2EAA2E;;;;;;;;;;IAY3E,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;AAiD/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;IA4CF,2EAA2E;;;;;;;;;;IAY3E,uDAAuD;;;;;;IAMvD,iEAAiE;;;;;;;EAQpE"}
@@ -53,15 +53,20 @@ var isInteractiveElement = function (element) {
53
53
  * into a target, popper and tooltip
54
54
  */
55
55
  function useTooltip(_a) {
56
- var _b = _a === void 0 ? {} : _a, _c = _b.type, type = _c === void 0 ? 'label' : _c, _d = _b.titleText, titleText = _d === void 0 ? '' : _d;
56
+ var _b = _a === void 0 ? {} : _a, _c = _b.type, type = _c === void 0 ? 'label' : _c, _d = _b.titleText, titleText = _d === void 0 ? '' : _d, _e = _b.showDelay, showDelay = _e === void 0 ? 300 : _e, _f = _b.hideDelay, hideDelay = _f === void 0 ? 100 : _f;
57
57
  var mouseDownRef = React.useRef(false); // use to prevent newly focused from making tooltip flash
58
58
  var popupModel = popup_1.usePopupModel();
59
- var _e = React.useState(null), anchorElement = _e[0], setAnchorElement = _e[1];
59
+ var _g = React.useState(null), anchorElement = _g[0], setAnchorElement = _g[1];
60
60
  var id = React.useState(function () { return v4_1.default(); })[0];
61
- var intentTimer = useIntentTimer(popupModel.events.hide, 100);
61
+ var intentTimerHide = useIntentTimer(popupModel.events.hide, hideDelay);
62
+ var intentTimerShow = useIntentTimer(popupModel.events.show, showDelay);
63
+ var onHide = function () {
64
+ intentTimerHide.start();
65
+ intentTimerShow.clear();
66
+ };
62
67
  var onOpen = function () {
63
- popupModel.events.show();
64
- intentTimer.clear();
68
+ intentTimerShow.start();
69
+ intentTimerHide.clear();
65
70
  };
66
71
  var onOpenFromTarget = function (event) {
67
72
  setAnchorElement(event.currentTarget);
@@ -90,10 +95,10 @@ function useTooltip(_a) {
90
95
  // This will replace the accessible name of the target element
91
96
  'aria-label': type === 'label' ? titleText : undefined,
92
97
  onMouseEnter: onOpenFromTarget,
93
- onMouseLeave: intentTimer.start,
98
+ onMouseLeave: onHide,
94
99
  onMouseDown: onMouseDown,
95
100
  onFocus: onFocus,
96
- onBlur: intentTimer.start,
101
+ onBlur: onHide,
97
102
  },
98
103
  /** Mix these properties into the `Popper` component */
99
104
  popperProps: {
@@ -106,7 +111,7 @@ function useTooltip(_a) {
106
111
  id: type === 'describe' && visible ? id : undefined,
107
112
  role: 'tooltip',
108
113
  onMouseEnter: onOpen,
109
- onMouseLeave: intentTimer.start,
114
+ onMouseLeave: onHide,
110
115
  },
111
116
  };
112
117
  }
@@ -1,7 +1,7 @@
1
- import { CSSProperties } from '@workday/canvas-kit-react/tokens';
1
+ import { CSSObject } from '@emotion/core';
2
2
  /**
3
3
  * A utility to hide content normal users while still making accessible to screenreaders
4
4
  * See https://a11y-101.com/development/skip-link
5
5
  */
6
- export declare const accessibleHide: CSSProperties;
6
+ export declare const accessibleHide: CSSObject;
7
7
  //# sourceMappingURL=accessibleHide.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"accessibleHide.d.ts","sourceRoot":"","sources":["../../../../../common/lib/styles/accessibleHide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,kCAAkC,CAAC;AAE/D;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,aAW5B,CAAC"}
1
+ {"version":3,"file":"accessibleHide.d.ts","sourceRoot":"","sources":["../../../../../common/lib/styles/accessibleHide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AAExC;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,SAW5B,CAAC"}
@@ -1,5 +1,5 @@
1
- import DeprecatedCookieBanner from './lib/CookieBanner';
2
- export default DeprecatedCookieBanner;
3
- export { DeprecatedCookieBanner };
1
+ import CookieBanner from './lib/CookieBanner';
2
+ export default CookieBanner;
3
+ export { CookieBanner };
4
4
  export * from './lib/CookieBanner';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../cookie-banner/index.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,MAAM,oBAAoB,CAAC;AAExD,eAAe,sBAAsB,CAAC;AACtC,OAAO,EAAC,sBAAsB,EAAC,CAAC;AAChC,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../cookie-banner/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAE9C,eAAe,YAAY,CAAC;AAC5B,OAAO,EAAC,YAAY,EAAC,CAAC;AACtB,cAAc,oBAAoB,CAAC"}
@@ -1,4 +1,4 @@
1
- import DeprecatedCookieBanner from './lib/CookieBanner';
2
- export default DeprecatedCookieBanner;
3
- export { DeprecatedCookieBanner };
1
+ import CookieBanner from './lib/CookieBanner';
2
+ export default CookieBanner;
3
+ export { CookieBanner };
4
4
  export * from './lib/CookieBanner';
@@ -1,13 +1,5 @@
1
1
  import * as React from 'react';
2
- /**
3
- * ### Deprecated Cookie Banner Props
4
- *
5
- * As of Canvas Kit v6, CookieBanner is being soft-deprecated.
6
- * It will be hard-deprecated (completely removed) in v7. Please see the
7
- * [migration guide](https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page)
8
- * for more information.
9
- */
10
- export interface DeprecatedCookieBannerProps {
2
+ export interface CookieBannerProps {
11
3
  /**
12
4
  * If true, set the CookieBanner to the closed state.
13
5
  * @default false
@@ -32,16 +24,7 @@ export interface DeprecatedCookieBannerProps {
32
24
  */
33
25
  settingsLabel?: string;
34
26
  }
35
- /**
36
- * ### Deprecated Cookie Banner
37
- *
38
- * As of Canvas Kit v6, this component is being soft-deprecated.
39
- * It will be hard-deprecated (completely removed) in v7. Please see the
40
- * [migration guide](https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page)
41
- * for more information.
42
- */
43
- export default class DeprecatedCookieBanner extends React.Component<DeprecatedCookieBannerProps> {
44
- componentDidMount(): void;
27
+ export default class CookieBanner extends React.Component<CookieBannerProps> {
45
28
  static DefaultNotice: string;
46
29
  render(): React.ReactNode;
47
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CookieBanner.d.ts","sourceRoot":"","sources":["../../../../cookie-banner/lib/CookieBanner.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B;;;;;;;GAOG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,QAAQ,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAE3D;;OAEG;IACH,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAEnE;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAElC;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AA8DD;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,KAAK,CAAC,SAAS,CAAC,2BAA2B,CAAC;IAC9F,iBAAiB;IASjB,OAAc,aAAa,SAC6J;IAEjL,MAAM,IAAI,KAAK,CAAC,SAAS;CAwBjC"}
1
+ {"version":3,"file":"CookieBanner.d.ts","sourceRoot":"","sources":["../../../../cookie-banner/lib/CookieBanner.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,QAAQ,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAE3D;;OAEG;IACH,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAEnE;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAElC;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AA8DD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC;IAC1E,OAAc,aAAa,SAC6J;IAEjL,MAAM,IAAI,KAAK,CAAC,SAAS;CAwBjC"}
@@ -88,31 +88,20 @@ var cookieSettingsStyles = css({
88
88
  var CookieSettings = function (props) {
89
89
  return jsx(Hyperlink, __assign({ as: "button", css: cookieSettingsStyles }, props));
90
90
  };
91
- /**
92
- * ### Deprecated Cookie Banner
93
- *
94
- * As of Canvas Kit v6, this component is being soft-deprecated.
95
- * It will be hard-deprecated (completely removed) in v7. Please see the
96
- * [migration guide](https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page)
97
- * for more information.
98
- */
99
- var DeprecatedCookieBanner = /** @class */ (function (_super) {
100
- __extends(DeprecatedCookieBanner, _super);
101
- function DeprecatedCookieBanner() {
91
+ var CookieBanner = /** @class */ (function (_super) {
92
+ __extends(CookieBanner, _super);
93
+ function CookieBanner() {
102
94
  return _super !== null && _super.apply(this, arguments) || this;
103
95
  }
104
- DeprecatedCookieBanner.prototype.componentDidMount = function () {
105
- console.warn("This component is being deprecated and will be removed in Canvas Kit V7.\n\n For more information, please see the V6 migration guide:\n\n https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page\n ");
106
- };
107
- DeprecatedCookieBanner.prototype.render = function () {
108
- var _a = this.props, _b = _a.notice, notice = _b === void 0 ? DeprecatedCookieBanner.DefaultNotice : _b, _c = _a.settingsLabel, settingsLabel = _c === void 0 ? 'Cookie Settings' : _c, isClosed = _a.isClosed, onAccept = _a.onAccept, onClickSettings = _a.onClickSettings, elemProps = __rest(_a, ["notice", "settingsLabel", "isClosed", "onAccept", "onClickSettings"]);
96
+ CookieBanner.prototype.render = function () {
97
+ var _a = this.props, _b = _a.notice, notice = _b === void 0 ? CookieBanner.DefaultNotice : _b, _c = _a.settingsLabel, settingsLabel = _c === void 0 ? 'Cookie Settings' : _c, isClosed = _a.isClosed, onAccept = _a.onAccept, onClickSettings = _a.onClickSettings, elemProps = __rest(_a, ["notice", "settingsLabel", "isClosed", "onAccept", "onClickSettings"]);
109
98
  return (jsx(Banner, __assign({ isClosed: isClosed }, elemProps),
110
99
  jsx(BannerItem, null, notice),
111
100
  jsx(BannerItem, { css: rowStyle },
112
101
  onClickSettings && (jsx(CookieSettings, { onClick: onClickSettings }, settingsLabel)),
113
102
  jsx(PrimaryButton, { onClick: onAccept, grow: true }, "Continue"))));
114
103
  };
115
- DeprecatedCookieBanner.DefaultNotice = 'We use cookies to ensure that we give you the best experience on our website. If you continue without changing your settings, we’ll assume that you are willing to receive cookies.';
116
- return DeprecatedCookieBanner;
104
+ CookieBanner.DefaultNotice = 'We use cookies to ensure that we give you the best experience on our website. If you continue without changing your settings, we’ll assume that you are willing to receive cookies.';
105
+ return CookieBanner;
117
106
  }(React.Component));
118
- export default DeprecatedCookieBanner;
107
+ export default CookieBanner;
@@ -1,5 +1,5 @@
1
- import DeprecatedPageHeader from './lib/PageHeader';
2
- export default DeprecatedPageHeader;
3
- export { DeprecatedPageHeader };
1
+ import PageHeader from './lib/PageHeader';
2
+ export default PageHeader;
3
+ export { PageHeader };
4
4
  export * from './lib/PageHeader';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../page-header/index.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,MAAM,kBAAkB,CAAC;AAEpD,eAAe,oBAAoB,CAAC;AACpC,OAAO,EAAC,oBAAoB,EAAC,CAAC;AAC9B,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../page-header/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAE1C,eAAe,UAAU,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAC,CAAC;AACpB,cAAc,kBAAkB,CAAC"}
@@ -1,4 +1,4 @@
1
- import DeprecatedPageHeader from './lib/PageHeader';
2
- export default DeprecatedPageHeader;
3
- export { DeprecatedPageHeader };
1
+ import PageHeader from './lib/PageHeader';
2
+ export default PageHeader;
3
+ export { PageHeader };
4
4
  export * from './lib/PageHeader';
@@ -1,13 +1,5 @@
1
1
  import * as React from 'react';
2
- /**
3
- * ### Deprecated Page Header Props
4
- *
5
- * As of Canvas Kit v6, PageHeader is being soft-deprecated.
6
- * It will be hard-deprecated (completely removed) in v7. Please see the
7
- * [migration guide](https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page)
8
- * for more information.
9
- */
10
- export interface DeprecatedPageHeaderProps {
2
+ export interface PageHeaderProps {
11
3
  /**
12
4
  * The text of the PageHeader title.
13
5
  */
@@ -23,16 +15,7 @@ export interface DeprecatedPageHeaderProps {
23
15
  */
24
16
  breakpoint?: number;
25
17
  }
26
- /**
27
- * ### Deprecated Page Header
28
- *
29
- * As of Canvas Kit v6, this component is being soft-deprecated.
30
- * It will be hard-deprecated (completely removed) in v7. Please see the
31
- * [migration guide](https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page)
32
- * for more information.
33
- */
34
- export default class DeprecatedPageHeader extends React.Component<DeprecatedPageHeaderProps> {
35
- componentDidMount(): void;
18
+ export default class PageHeader extends React.Component<PageHeaderProps> {
36
19
  private renderChildren;
37
20
  render(): JSX.Element;
38
21
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PageHeader.d.ts","sourceRoot":"","sources":["../../../../page-header/lib/PageHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B;;;;;;;GAOG;AACH,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAkDD;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,KAAK,CAAC,SAAS,CAAC,yBAAyB,CAAC;IAC1F,iBAAiB;IASjB,OAAO,CAAC,cAAc;IAgBf,MAAM;CAad"}
1
+ {"version":3,"file":"PageHeader.d.ts","sourceRoot":"","sources":["../../../../page-header/lib/PageHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAkDD,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,KAAK,CAAC,SAAS,CAAC,eAAe,CAAC;IACtE,OAAO,CAAC,cAAc;IAgBf,MAAM;CAad"}
@@ -76,23 +76,12 @@ var IconList = styled('div')({
76
76
  marginRight: space.xxs,
77
77
  },
78
78
  });
79
- /**
80
- * ### Deprecated Page Header
81
- *
82
- * As of Canvas Kit v6, this component is being soft-deprecated.
83
- * It will be hard-deprecated (completely removed) in v7. Please see the
84
- * [migration guide](https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page)
85
- * for more information.
86
- */
87
- var DeprecatedPageHeader = /** @class */ (function (_super) {
88
- __extends(DeprecatedPageHeader, _super);
89
- function DeprecatedPageHeader() {
79
+ var PageHeader = /** @class */ (function (_super) {
80
+ __extends(PageHeader, _super);
81
+ function PageHeader() {
90
82
  return _super !== null && _super.apply(this, arguments) || this;
91
83
  }
92
- DeprecatedPageHeader.prototype.componentDidMount = function () {
93
- console.warn("This component is being deprecated and will be removed in Canvas Kit V7.\n\n For more information, please see the V6 migration guide:\n\n https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page\n ");
94
- };
95
- DeprecatedPageHeader.prototype.renderChildren = function (children) {
84
+ PageHeader.prototype.renderChildren = function (children) {
96
85
  return React.Children.map(children, function (child) {
97
86
  if (!React.isValidElement(child)) {
98
87
  return child;
@@ -105,7 +94,7 @@ var DeprecatedPageHeader = /** @class */ (function (_super) {
105
94
  return child;
106
95
  });
107
96
  };
108
- DeprecatedPageHeader.prototype.render = function () {
97
+ PageHeader.prototype.render = function () {
109
98
  // TODO: Standardize on prop spread location (see #150)
110
99
  var _a = this.props, _b = _a.title, title = _b === void 0 ? '' : _b, _c = _a.breakpoint, breakpoint = _c === void 0 ? 768 : _c, _d = _a.capWidth, capWidth = _d === void 0 ? false : _d, children = _a.children, elemProps = __rest(_a, ["title", "breakpoint", "capWidth", "children"]);
111
100
  return (React.createElement(Header, null,
@@ -113,6 +102,6 @@ var DeprecatedPageHeader = /** @class */ (function (_super) {
113
102
  React.createElement(Title, null, title),
114
103
  React.createElement(IconList, null, this.renderChildren(children)))));
115
104
  };
116
- return DeprecatedPageHeader;
105
+ return PageHeader;
117
106
  }(React.Component));
118
- export default DeprecatedPageHeader;
107
+ export default PageHeader;
@@ -3,6 +3,9 @@ import * as React from 'react';
3
3
  import { PaginationModel } from '../types';
4
4
  export interface GoToLabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
5
5
  model: PaginationModel;
6
+ /**
7
+ * Accepts child elements or a render prop.
8
+ */
6
9
  children?: (model: PaginationModel) => React.ReactNode | React.ReactNode;
7
10
  }
8
11
  export declare const GoToLabel: ({ css: cssProp, model, children, ...elemProps }: GoToLabelProps) => JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../../../../../pagination/lib/Pagination/GoTo/Label.tsx"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAC,eAAe,EAAC,MAAM,UAAU,CAAC;AAEzC,MAAM,WAAW,cAAe,SAAQ,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC;IACjF,KAAK,EAAE,eAAe,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;CAC1E;AAQD,eAAO,MAAM,SAAS,kFAMrB,CAAC"}
1
+ {"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../../../../../pagination/lib/Pagination/GoTo/Label.tsx"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAC,eAAe,EAAC,MAAM,UAAU,CAAC;AAEzC,MAAM,WAAW,cAAe,SAAQ,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC;IACjF,KAAK,EAAE,eAAe,CAAC;IACvB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;CAC1E;AAQD,eAAO,MAAM,SAAS,kFAMrB,CAAC"}
@@ -1,16 +1,55 @@
1
1
  export interface PaginationState {
2
+ /**
3
+ * The page number for the current page
4
+ */
2
5
  currentPage: number;
6
+ /**
7
+ * The page number for the first page
8
+ */
3
9
  firstPage: number;
10
+ /**
11
+ * The page number for the last page (it can also be used as a total page
12
+ * count)
13
+ */
4
14
  lastPage: number;
15
+ /**
16
+ * An array of page numbers included in the pagination range
17
+ */
5
18
  range: number[];
19
+ /**
20
+ * The size of the pagination range
21
+ */
6
22
  rangeSize: number;
7
23
  }
8
24
  export interface PaginationEvents {
25
+ /**
26
+ * Sets the current page to a given page number (no safeguards)
27
+ */
9
28
  setCurrentPage: (page: number) => void;
29
+ /**
30
+ * Sets the current page to the first page
31
+ */
10
32
  first: () => void;
33
+ /**
34
+ * Sets the current page to the last page
35
+ */
11
36
  last: () => void;
37
+ /**
38
+ * Increments the current page by 1
39
+ */
12
40
  next: () => void;
41
+ /**
42
+ * Decrements the current page by 1
43
+ */
13
44
  previous: () => void;
45
+ /**
46
+ * Sets the current page to a given page number (with safeguards). `goTo`
47
+ * is very similar to `setCurrentPage`, but it has some built-in safeguards.
48
+ * If the page number provided is below the first page (e.g: `0`),
49
+ * `currentPage` will be set to the `firstPage`. Similarly, if the number
50
+ * provided is larger than the `lastPage`, it will set `currentPage` to the
51
+ * `lastPage`.
52
+ */
14
53
  goTo: (page: number) => void;
15
54
  }
16
55
  export interface PaginationModel {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../pagination/lib/Pagination/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,eAAe,CAAC;IACvB,MAAM,EAAE,gBAAgB,CAAC;CAC1B"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../pagination/lib/Pagination/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC;;OAEG;IACH,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB;;OAEG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB;;OAEG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB;;OAEG;IACH,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB;;;;;;;OAOG;IACH,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,eAAe,CAAC;IACvB,MAAM,EAAE,gBAAgB,CAAC;CAC1B"}
@@ -1,9 +1,28 @@
1
1
  import { PaginationModel } from './types';
2
2
  export declare type UsePaginationModelConfig = {
3
+ /**
4
+ * The page number for the last page (it can also be used as a total page
5
+ * count)
6
+ */
3
7
  lastPage: number;
8
+ /**
9
+ * The page number for the first page
10
+ * @default 1
11
+ */
4
12
  firstPage?: number;
13
+ /**
14
+ * The initial current page
15
+ * @default 1
16
+ */
5
17
  initialCurrentPage?: number;
18
+ /**
19
+ * The function called when the page changes
20
+ */
6
21
  onPageChange?: (pageNumber: number) => void;
22
+ /**
23
+ * The size of the pagination range
24
+ * @default 5
25
+ */
7
26
  rangeSize?: number;
8
27
  };
9
28
  export declare const usePaginationModel: ({ firstPage, initialCurrentPage, lastPage, rangeSize, onPageChange, }: UsePaginationModelConfig) => PaginationModel;
@@ -1 +1 @@
1
- {"version":3,"file":"usePaginationModel.d.ts","sourceRoot":"","sources":["../../../../../pagination/lib/Pagination/usePaginationModel.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,eAAe,EAAC,MAAM,SAAS,CAAC;AAExC,oBAAY,wBAAwB,GAAG;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,kBAAkB,sHAsE9B,CAAC"}
1
+ {"version":3,"file":"usePaginationModel.d.ts","sourceRoot":"","sources":["../../../../../pagination/lib/Pagination/usePaginationModel.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,eAAe,EAAC,MAAM,SAAS,CAAC;AAExC,oBAAY,wBAAwB,GAAG;IACrC;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,kBAAkB,sHAsE9B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Tab.d.ts","sourceRoot":"","sources":["../../../../tabs/lib/Tab.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAe/B,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAIzC,MAAM,WAAW,QAAQ;IACvB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAmGD,eAAO,MAAM,GAAG,6DAad,CAAC"}
1
+ {"version":3,"file":"Tab.d.ts","sourceRoot":"","sources":["../../../../tabs/lib/Tab.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAe/B,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAIzC,MAAM,WAAW,QAAQ;IACvB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AA6FD,eAAO,MAAM,GAAG,6DAad,CAAC"}
@@ -37,31 +37,25 @@ var StyledButton = styled('button')(__assign(__assign(__assign(__assign({}, type
37
37
  cursor: 'auto',
38
38
  backgroundColor: "transparent",
39
39
  },
40
- } }), function (_a) {
41
- var isSelected = _a.isSelected;
42
- if (isSelected) {
43
- return {
40
+ }, '&[aria-selected=true]': {
41
+ color: colors.blueberry400,
42
+ cursor: 'default',
43
+ '&:after': {
44
+ position: 'absolute',
45
+ height: space.xxxs,
46
+ borderRadius: borderRadius.m + " " + borderRadius.m + " 0px 0px",
47
+ backgroundColor: colors.blueberry400,
48
+ bottom: 0,
49
+ content: "''",
50
+ left: 0,
51
+ marginTop: '-2px',
52
+ width: '100%',
53
+ },
54
+ '&:hover, &:focus': {
55
+ backgroundColor: "transparent",
44
56
  color: colors.blueberry400,
45
- cursor: 'default',
46
- '&:after': {
47
- position: 'absolute',
48
- height: space.xxxs,
49
- borderRadius: borderRadius.m + " " + borderRadius.m + " 0px 0px",
50
- backgroundColor: colors.blueberry400,
51
- bottom: 0,
52
- content: "''",
53
- left: 0,
54
- marginTop: '-2px',
55
- width: '100%',
56
- },
57
- '&:hover, &:focus': {
58
- backgroundColor: "transparent",
59
- color: colors.blueberry400,
60
- },
61
- };
62
- }
63
- return {};
64
- });
57
+ },
58
+ } }));
65
59
  var useTab = function (model, elemProps, ref) {
66
60
  if (elemProps === void 0) { elemProps = {}; }
67
61
  var _a = useLocalRef(ref), localRef = _a.localRef, elementRef = _a.elementRef;
@@ -1,5 +1,15 @@
1
1
  import * as React from 'react';
2
2
  import { Placement } from '@workday/canvas-kit-react/popup';
3
+ /**
4
+ * Look for an element within the tree for an overflow element (auto, scroll, clip, or hidden).
5
+ * This could be the passed element, or a descendant. If no element is found, `null` is returned.
6
+ */
7
+ export declare const findOverflowElement: (element: Element) => Element | null;
8
+ /**
9
+ * Look for an element within the tree for a `text-overflow` CSS property of `ellipsis`.
10
+ * This could be the passed element, or a descendant. If no element is found, `null` is returned.
11
+ */
12
+ export declare const findEllipsisElement: (element: Element) => Element | null;
3
13
  export interface OverflowTooltipProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
4
14
  /**
5
15
  * The target (anchor element) for the Tooltip.
@@ -1 +1 @@
1
- {"version":3,"file":"OverflowTooltip.d.ts","sourceRoot":"","sources":["../../../../tooltip/lib/OverflowTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAA4B,SAAS,EAAS,MAAM,iCAAiC,CAAC;AA+D7F,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAC/F;;;;;;;OAOG;IACH,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAClC;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAiBD,eAAO,MAAM,eAAe,8EA4C3B,CAAC"}
1
+ {"version":3,"file":"OverflowTooltip.d.ts","sourceRoot":"","sources":["../../../../tooltip/lib/OverflowTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAA4B,SAAS,EAAS,MAAM,iCAAiC,CAAC;AAM7F;;;GAGG;AACH,eAAO,MAAM,mBAAmB,sCAoB/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,sCAe/B,CAAC;AAcF,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAC/F;;;;;;;OAOG;IACH,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAClC;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAiBD,eAAO,MAAM,eAAe,8EA4C3B,CAAC"}
@@ -29,7 +29,7 @@ import { useTooltip } from './useTooltip';
29
29
  * Look for an element within the tree for an overflow element (auto, scroll, clip, or hidden).
30
30
  * This could be the passed element, or a descendant. If no element is found, `null` is returned.
31
31
  */
32
- var findOverflowElement = function (element) {
32
+ export var findOverflowElement = function (element) {
33
33
  var style = getComputedStyle(element);
34
34
  if (style.overflow === 'auto' ||
35
35
  style.overflow === 'scroll' ||
@@ -53,12 +53,13 @@ var findOverflowElement = function (element) {
53
53
  * Look for an element within the tree for a `text-overflow` CSS property of `ellipsis`.
54
54
  * This could be the passed element, or a descendant. If no element is found, `null` is returned.
55
55
  */
56
- var findEllipsisElement = function (element) {
56
+ export var findEllipsisElement = function (element) {
57
57
  var style = getComputedStyle(element);
58
58
  if (style.textOverflow === 'ellipsis' || Number(style.webkitLineClamp) > 0) {
59
59
  return element;
60
60
  }
61
- else {
61
+ else if (element.children) {
62
+ // `children` is not defined for SVGElement in IE11
62
63
  for (var i = 0; i < element.children.length; i++) {
63
64
  var overflowElement = findEllipsisElement(element.children[i]);
64
65
  if (overflowElement) {
@@ -67,6 +68,7 @@ var findEllipsisElement = function (element) {
67
68
  }
68
69
  return null;
69
70
  }
71
+ return null;
70
72
  };
71
73
  var isOverflowed = function (element) {
72
74
  var overflowElement = findEllipsisElement(element) || findOverflowElement(element);
@@ -37,6 +37,14 @@ export interface TooltipProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
37
37
  * @default 'label'
38
38
  */
39
39
  type?: 'label' | 'describe' | 'muted';
40
+ /**
41
+ * Amount of time (in ms) to delay before showing the tooltip
42
+ */
43
+ showDelay?: number;
44
+ /**
45
+ * Amount of time (in ms) to delay before hiding the tooltip
46
+ */
47
+ hideDelay?: number;
40
48
  }
41
- export declare const Tooltip: ({ type, placement, title, children, ...elemProps }: TooltipProps) => JSX.Element;
49
+ export declare const Tooltip: ({ type, placement, title, children, showDelay, hideDelay, ...elemProps }: TooltipProps) => JSX.Element;
42
50
  //# sourceMappingURL=Tooltip.d.ts.map
@@ -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,EAA4B,SAAS,EAAS,MAAM,iCAAiC,CAAC;AAM7F,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;;;;;;;;;;;;;;;OAeG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,OAAO,CAAC;CACvC;AAiBD,eAAO,MAAM,OAAO,mFA+BnB,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,EAA4B,SAAS,EAAS,MAAM,iCAAiC,CAAC;AAM7F,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;;;;;;;;;;;;;;;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,yGAsCnB,CAAC"}
@@ -39,9 +39,14 @@ function mergeCallbacks(elemProps, componentProps, keys) {
39
39
  }, {});
40
40
  }
41
41
  export var Tooltip = function (_a) {
42
- var _b = _a.type, type = _b === void 0 ? 'label' : _b, _c = _a.placement, placement = _c === void 0 ? 'top' : _c, title = _a.title, children = _a.children, elemProps = __rest(_a, ["type", "placement", "title", "children"]);
42
+ var _b = _a.type, type = _b === void 0 ? 'label' : _b, _c = _a.placement, placement = _c === void 0 ? 'top' : _c, title = _a.title, children = _a.children, _d = _a.showDelay, showDelay = _d === void 0 ? 300 : _d, _e = _a.hideDelay, hideDelay = _e === void 0 ? 100 : _e, elemProps = __rest(_a, ["type", "placement", "title", "children", "showDelay", "hideDelay"]);
43
43
  var titleText = innerText(title);
44
- var _d = useTooltip({ type: type, titleText: titleText }), targetProps = _d.targetProps, popperProps = _d.popperProps, tooltipProps = _d.tooltipProps;
44
+ var _f = useTooltip({
45
+ type: type,
46
+ titleText: titleText,
47
+ showDelay: showDelay,
48
+ hideDelay: hideDelay,
49
+ }), targetProps = _f.targetProps, popperProps = _f.popperProps, tooltipProps = _f.tooltipProps;
45
50
  return (React.createElement(React.Fragment, null,
46
51
  React.cloneElement(children, __assign(__assign(__assign({}, targetProps), mergeCallbacks(children.props, targetProps)), (type === 'muted' && children.props['aria-label']
47
52
  ? { 'aria-label': children.props['aria-label'] }