@workday/canvas-kit-react 11.0.0-alpha.726-next.0 → 11.0.0-alpha.760-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 (205) hide show
  1. package/breadcrumbs/lib/BreadcrumbsItem.tsx +1 -1
  2. package/breadcrumbs/lib/BreadcrumbsOverflowButton.tsx +1 -1
  3. package/button/lib/BaseButton.tsx +16 -1
  4. package/button/lib/DeleteButton.tsx +12 -11
  5. package/button/lib/ExternalHyperlink.tsx +1 -1
  6. package/button/lib/PrimaryButton.tsx +52 -45
  7. package/button/lib/SecondaryButton.tsx +58 -75
  8. package/button/lib/TertiaryButton.tsx +63 -54
  9. package/card/index.ts +3 -1
  10. package/card/lib/Card.tsx +12 -9
  11. package/card/lib/CardBody.tsx +12 -4
  12. package/card/lib/CardHeading.tsx +14 -17
  13. package/collection/lib/ListBox.tsx +9 -3
  14. package/combobox/lib/ComboboxMenuList.tsx +3 -4
  15. package/dist/commonjs/badge/lib/CountBadge.js +6 -6
  16. package/dist/commonjs/breadcrumbs/lib/BreadcrumbsItem.js +1 -1
  17. package/dist/commonjs/breadcrumbs/lib/BreadcrumbsOverflowButton.js +1 -1
  18. package/dist/commonjs/button/lib/BaseButton.d.ts.map +1 -1
  19. package/dist/commonjs/button/lib/BaseButton.js +18 -17
  20. package/dist/commonjs/button/lib/DeleteButton.d.ts.map +1 -1
  21. package/dist/commonjs/button/lib/DeleteButton.js +2 -1
  22. package/dist/commonjs/button/lib/ExternalHyperlink.js +1 -1
  23. package/dist/commonjs/button/lib/PrimaryButton.d.ts.map +1 -1
  24. package/dist/commonjs/button/lib/PrimaryButton.js +3 -2
  25. package/dist/commonjs/button/lib/SecondaryButton.d.ts.map +1 -1
  26. package/dist/commonjs/button/lib/SecondaryButton.js +3 -2
  27. package/dist/commonjs/button/lib/TertiaryButton.d.ts.map +1 -1
  28. package/dist/commonjs/button/lib/TertiaryButton.js +16 -15
  29. package/dist/commonjs/card/index.d.ts +3 -1
  30. package/dist/commonjs/card/index.d.ts.map +1 -1
  31. package/dist/commonjs/card/index.js +6 -1
  32. package/dist/commonjs/card/lib/Card.d.ts +1 -0
  33. package/dist/commonjs/card/lib/Card.d.ts.map +1 -1
  34. package/dist/commonjs/card/lib/Card.js +6 -3
  35. package/dist/commonjs/card/lib/CardBody.d.ts +103 -0
  36. package/dist/commonjs/card/lib/CardBody.d.ts.map +1 -1
  37. package/dist/commonjs/card/lib/CardBody.js +10 -2
  38. package/dist/commonjs/card/lib/CardHeading.d.ts +103 -0
  39. package/dist/commonjs/card/lib/CardHeading.d.ts.map +1 -1
  40. package/dist/commonjs/card/lib/CardHeading.js +8 -3
  41. package/dist/commonjs/checkbox/lib/CheckBackground.js +5 -5
  42. package/dist/commonjs/checkbox/lib/CheckboxCheck.js +9 -9
  43. package/dist/commonjs/checkbox/lib/CheckboxContainer.js +1 -1
  44. package/dist/commonjs/checkbox/lib/CheckboxInput.js +11 -11
  45. package/dist/commonjs/checkbox/lib/CheckboxRipple.js +1 -1
  46. package/dist/commonjs/collection/lib/ListBox.d.ts.map +1 -1
  47. package/dist/commonjs/collection/lib/ListBox.js +14 -8
  48. package/dist/commonjs/combobox/lib/ComboboxMenuItem.js +4 -4
  49. package/dist/commonjs/combobox/lib/ComboboxMenuList.d.ts.map +1 -1
  50. package/dist/commonjs/combobox/lib/ComboboxMenuList.js +4 -5
  51. package/dist/commonjs/common/lib/AccessibleHide.js +1 -1
  52. package/dist/commonjs/common/lib/CanvasProvider.js +1 -1
  53. package/dist/commonjs/icon/index.d.ts +1 -1
  54. package/dist/commonjs/icon/index.d.ts.map +1 -1
  55. package/dist/commonjs/icon/index.js +4 -1
  56. package/dist/commonjs/icon/lib/AccentIcon.d.ts +30 -4
  57. package/dist/commonjs/icon/lib/AccentIcon.d.ts.map +1 -1
  58. package/dist/commonjs/icon/lib/AccentIcon.js +28 -4
  59. package/dist/commonjs/icon/lib/AppletIcon.d.ts +31 -2
  60. package/dist/commonjs/icon/lib/AppletIcon.d.ts.map +1 -1
  61. package/dist/commonjs/icon/lib/AppletIcon.js +27 -4
  62. package/dist/commonjs/icon/lib/Graphic.d.ts +20 -1
  63. package/dist/commonjs/icon/lib/Graphic.d.ts.map +1 -1
  64. package/dist/commonjs/icon/lib/Graphic.js +25 -3
  65. package/dist/commonjs/icon/lib/Svg.d.ts +12 -2
  66. package/dist/commonjs/icon/lib/Svg.d.ts.map +1 -1
  67. package/dist/commonjs/icon/lib/Svg.js +25 -10
  68. package/dist/commonjs/icon/lib/SystemIcon.d.ts +79 -16
  69. package/dist/commonjs/icon/lib/SystemIcon.d.ts.map +1 -1
  70. package/dist/commonjs/icon/lib/SystemIcon.js +51 -14
  71. package/dist/commonjs/icon/lib/SystemIconCircle.d.ts +2 -3
  72. package/dist/commonjs/icon/lib/SystemIconCircle.d.ts.map +1 -1
  73. package/dist/commonjs/icon/lib/SystemIconCircle.js +20 -30
  74. package/dist/commonjs/loading-dots/lib/LoadingDots.js +3 -3
  75. package/dist/commonjs/menu/lib/MenuCard.js +2 -2
  76. package/dist/commonjs/menu/lib/MenuList.js +5 -5
  77. package/dist/commonjs/select/lib/Select.js +7 -7
  78. package/dist/commonjs/select/lib/hooks/useSelectInput.d.ts +4 -1
  79. package/dist/commonjs/select/lib/hooks/useSelectInput.d.ts.map +1 -1
  80. package/dist/commonjs/select/lib/hooks/useSelectInput.js +14 -5
  81. package/dist/commonjs/switch/lib/Switch.js +13 -13
  82. package/dist/commonjs/table/lib/Table.js +2 -2
  83. package/dist/commonjs/table/lib/TableBody.js +2 -2
  84. package/dist/commonjs/table/lib/TableCaption.js +2 -2
  85. package/dist/commonjs/table/lib/TableCell.js +2 -2
  86. package/dist/commonjs/table/lib/TableFooter.js +2 -2
  87. package/dist/commonjs/table/lib/TableHead.js +2 -2
  88. package/dist/commonjs/table/lib/TableHeader.js +2 -2
  89. package/dist/commonjs/table/lib/TableRow.js +2 -2
  90. package/dist/commonjs/tabs/lib/TabsItem.d.ts.map +1 -1
  91. package/dist/commonjs/tabs/lib/TabsItem.js +4 -12
  92. package/dist/commonjs/tabs/lib/useTabsModel.d.ts.map +1 -1
  93. package/dist/commonjs/text/lib/LabelText.d.ts.map +1 -1
  94. package/dist/commonjs/text/lib/LabelText.js +11 -27
  95. package/dist/commonjs/text/lib/Text.d.ts +103 -0
  96. package/dist/commonjs/text/lib/Text.d.ts.map +1 -1
  97. package/dist/commonjs/text/lib/Text.js +30 -27
  98. package/dist/commonjs/tooltip/lib/OverflowTooltip.d.ts.map +1 -1
  99. package/dist/commonjs/tooltip/lib/OverflowTooltip.js +2 -3
  100. package/dist/es6/badge/lib/CountBadge.js +6 -6
  101. package/dist/es6/breadcrumbs/lib/BreadcrumbsItem.js +1 -1
  102. package/dist/es6/breadcrumbs/lib/BreadcrumbsOverflowButton.js +1 -1
  103. package/dist/es6/button/lib/BaseButton.d.ts.map +1 -1
  104. package/dist/es6/button/lib/BaseButton.js +18 -17
  105. package/dist/es6/button/lib/DeleteButton.d.ts.map +1 -1
  106. package/dist/es6/button/lib/DeleteButton.js +2 -1
  107. package/dist/es6/button/lib/ExternalHyperlink.js +1 -1
  108. package/dist/es6/button/lib/PrimaryButton.d.ts.map +1 -1
  109. package/dist/es6/button/lib/PrimaryButton.js +3 -2
  110. package/dist/es6/button/lib/SecondaryButton.d.ts.map +1 -1
  111. package/dist/es6/button/lib/SecondaryButton.js +3 -2
  112. package/dist/es6/button/lib/TertiaryButton.d.ts.map +1 -1
  113. package/dist/es6/button/lib/TertiaryButton.js +16 -15
  114. package/dist/es6/card/index.d.ts +3 -1
  115. package/dist/es6/card/index.d.ts.map +1 -1
  116. package/dist/es6/card/index.js +3 -1
  117. package/dist/es6/card/lib/Card.d.ts +1 -0
  118. package/dist/es6/card/lib/Card.d.ts.map +1 -1
  119. package/dist/es6/card/lib/Card.js +7 -4
  120. package/dist/es6/card/lib/CardBody.d.ts +103 -0
  121. package/dist/es6/card/lib/CardBody.d.ts.map +1 -1
  122. package/dist/es6/card/lib/CardBody.js +10 -2
  123. package/dist/es6/card/lib/CardHeading.d.ts +103 -0
  124. package/dist/es6/card/lib/CardHeading.d.ts.map +1 -1
  125. package/dist/es6/card/lib/CardHeading.js +9 -4
  126. package/dist/es6/checkbox/lib/CheckBackground.js +5 -5
  127. package/dist/es6/checkbox/lib/CheckboxCheck.js +9 -9
  128. package/dist/es6/checkbox/lib/CheckboxContainer.js +1 -1
  129. package/dist/es6/checkbox/lib/CheckboxInput.js +11 -11
  130. package/dist/es6/checkbox/lib/CheckboxRipple.js +1 -1
  131. package/dist/es6/collection/lib/ListBox.d.ts.map +1 -1
  132. package/dist/es6/collection/lib/ListBox.js +15 -9
  133. package/dist/es6/combobox/lib/ComboboxMenuItem.js +4 -4
  134. package/dist/es6/combobox/lib/ComboboxMenuList.d.ts.map +1 -1
  135. package/dist/es6/combobox/lib/ComboboxMenuList.js +5 -6
  136. package/dist/es6/common/lib/AccessibleHide.js +1 -1
  137. package/dist/es6/common/lib/CanvasProvider.js +1 -1
  138. package/dist/es6/icon/index.d.ts +1 -1
  139. package/dist/es6/icon/index.d.ts.map +1 -1
  140. package/dist/es6/icon/index.js +1 -1
  141. package/dist/es6/icon/lib/AccentIcon.d.ts +30 -4
  142. package/dist/es6/icon/lib/AccentIcon.d.ts.map +1 -1
  143. package/dist/es6/icon/lib/AccentIcon.js +27 -3
  144. package/dist/es6/icon/lib/AppletIcon.d.ts +31 -2
  145. package/dist/es6/icon/lib/AppletIcon.d.ts.map +1 -1
  146. package/dist/es6/icon/lib/AppletIcon.js +26 -3
  147. package/dist/es6/icon/lib/Graphic.d.ts +20 -1
  148. package/dist/es6/icon/lib/Graphic.d.ts.map +1 -1
  149. package/dist/es6/icon/lib/Graphic.js +24 -2
  150. package/dist/es6/icon/lib/Svg.d.ts +12 -2
  151. package/dist/es6/icon/lib/Svg.d.ts.map +1 -1
  152. package/dist/es6/icon/lib/Svg.js +25 -11
  153. package/dist/es6/icon/lib/SystemIcon.d.ts +79 -16
  154. package/dist/es6/icon/lib/SystemIcon.d.ts.map +1 -1
  155. package/dist/es6/icon/lib/SystemIcon.js +50 -13
  156. package/dist/es6/icon/lib/SystemIconCircle.d.ts +2 -3
  157. package/dist/es6/icon/lib/SystemIconCircle.d.ts.map +1 -1
  158. package/dist/es6/icon/lib/SystemIconCircle.js +23 -30
  159. package/dist/es6/loading-dots/lib/LoadingDots.js +3 -3
  160. package/dist/es6/menu/lib/MenuCard.js +2 -2
  161. package/dist/es6/menu/lib/MenuList.js +5 -5
  162. package/dist/es6/select/lib/Select.js +7 -7
  163. package/dist/es6/select/lib/hooks/useSelectInput.d.ts +4 -1
  164. package/dist/es6/select/lib/hooks/useSelectInput.d.ts.map +1 -1
  165. package/dist/es6/select/lib/hooks/useSelectInput.js +14 -5
  166. package/dist/es6/switch/lib/Switch.js +13 -13
  167. package/dist/es6/table/lib/Table.js +2 -2
  168. package/dist/es6/table/lib/TableBody.js +2 -2
  169. package/dist/es6/table/lib/TableCaption.js +2 -2
  170. package/dist/es6/table/lib/TableCell.js +2 -2
  171. package/dist/es6/table/lib/TableFooter.js +2 -2
  172. package/dist/es6/table/lib/TableHead.js +2 -2
  173. package/dist/es6/table/lib/TableHeader.js +2 -2
  174. package/dist/es6/table/lib/TableRow.js +2 -2
  175. package/dist/es6/tabs/lib/TabsItem.d.ts.map +1 -1
  176. package/dist/es6/tabs/lib/TabsItem.js +5 -13
  177. package/dist/es6/tabs/lib/useTabsModel.d.ts.map +1 -1
  178. package/dist/es6/text/lib/LabelText.d.ts.map +1 -1
  179. package/dist/es6/text/lib/LabelText.js +12 -28
  180. package/dist/es6/text/lib/Text.d.ts +103 -0
  181. package/dist/es6/text/lib/Text.d.ts.map +1 -1
  182. package/dist/es6/text/lib/Text.js +31 -28
  183. package/dist/es6/tooltip/lib/OverflowTooltip.d.ts.map +1 -1
  184. package/dist/es6/tooltip/lib/OverflowTooltip.js +2 -3
  185. package/icon/index.ts +1 -1
  186. package/icon/lib/AccentIcon.tsx +48 -10
  187. package/icon/lib/AppletIcon.tsx +53 -12
  188. package/icon/lib/Graphic.tsx +43 -10
  189. package/icon/lib/Svg.tsx +36 -19
  190. package/icon/lib/SystemIcon.tsx +134 -39
  191. package/icon/lib/SystemIconCircle.tsx +42 -47
  192. package/package.json +5 -5
  193. package/select/lib/hooks/useSelectInput.ts +24 -8
  194. package/tabs/lib/TabsItem.tsx +6 -13
  195. package/tabs/lib/useTabsModel.tsx +0 -1
  196. package/text/lib/LabelText.tsx +11 -63
  197. package/text/lib/Text.tsx +65 -62
  198. package/tooltip/lib/OverflowTooltip.tsx +2 -3
  199. package/dist/commonjs/icon/lib/Icon.d.ts +0 -9
  200. package/dist/commonjs/icon/lib/Icon.d.ts.map +0 -1
  201. package/dist/commonjs/icon/lib/Icon.js +0 -40
  202. package/dist/es6/icon/lib/Icon.d.ts +0 -9
  203. package/dist/es6/icon/lib/Icon.d.ts.map +0 -1
  204. package/dist/es6/icon/lib/Icon.js +0 -18
  205. package/icon/lib/Icon.tsx +0 -38
@@ -1,20 +1,24 @@
1
1
  import { CanvasAccentIcon } from '@workday/design-assets-types';
2
2
  import { CSSObject } from '@emotion/styled';
3
- import { IconProps } from './Icon';
4
3
  import { SystemPropValues } from '@workday/canvas-kit-react/layout';
4
+ import { SvgProps } from './Svg';
5
+ /**
6
+ * @deprecated Interface `AccentIconStyles` will be removed in a future version. All props will be moved inside `AccentIconProps`. Consider to use the new tokens set to set `color` prop: `color={base.blueberry500}`.
7
+ */
5
8
  export interface AccentIconStyles {
6
9
  /**
7
10
  * The fill color of the AccentIcon.
8
- * @default colors.blueberry500
11
+ * @default base.blueberry500
9
12
  */
10
13
  color?: SystemPropValues['color'];
11
14
  /**
12
- * If true, set the background fill of the AccentIcon to `transparent`. If false, set the background fill of the AccentIcon to `colors.frenchVanilla100`.
15
+ * If true, set the background fill of the AccentIcon to `transparent`.
16
+ * If false, set the background fill of the AccentIcon to `base.frenchVanilla100`.
13
17
  * @default false
14
18
  */
15
19
  transparent?: boolean;
16
20
  }
17
- export interface AccentIconProps extends AccentIconStyles, Omit<IconProps, 'src' | 'type'> {
21
+ export interface AccentIconProps extends AccentIconStyles, Omit<SvgProps, 'src' | 'type'> {
18
22
  /**
19
23
  * The icon to display from `@workday/canvas-accent-icons-web`.
20
24
  */
@@ -25,6 +29,28 @@ export interface AccentIconProps extends AccentIconStyles, Omit<IconProps, 'src'
25
29
  */
26
30
  size?: number;
27
31
  }
32
+ /**
33
+ * @deprecated `accentIconStyles` will be removed in in a future version as a part of implementation of stencils and new tokens. Consider to use `accentIconStencil` instead.
34
+ */
28
35
  export declare const accentIconStyles: ({ color, transparent, }: AccentIconStyles) => CSSObject;
36
+ export declare const accentIconStencil: import("@workday/canvas-kit-styling").Stencil<{
37
+ transparent: {
38
+ true: {
39
+ '& .french-vanilla-100': {
40
+ fill: "transparent";
41
+ };
42
+ };
43
+ };
44
+ }, {
45
+ color: string;
46
+ }, import("@workday/canvas-kit-styling").Stencil<{
47
+ shouldMirror: {
48
+ true: {
49
+ transform: "scaleX(-1)";
50
+ };
51
+ };
52
+ }, {
53
+ size: string;
54
+ }, never, never>, never>;
29
55
  export declare const AccentIcon: import("@workday/canvas-kit-react/common").ElementComponent<"span", AccentIconProps>;
30
56
  //# sourceMappingURL=AccentIcon.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AccentIcon.d.ts","sourceRoot":"","sources":["../../../../icon/lib/AccentIcon.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAC,gBAAgB,EAAkB,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAO,SAAS,EAAC,MAAM,QAAQ,CAAC;AAEvC,OAAO,EAAC,gBAAgB,EAAC,MAAM,kCAAkC,CAAC;AAElE,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAClC;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,eAAgB,SAAQ,gBAAgB,EAAE,IAAI,CAAC,SAAS,EAAE,KAAK,GAAG,MAAM,CAAC;IACxF;;OAEG;IACH,IAAI,EAAE,gBAAgB,CAAC;IACvB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,gBAAgB,4BAG1B,gBAAgB,KAAG,SAOpB,CAAC;AAEH,eAAO,MAAM,UAAU,sFAoBrB,CAAC"}
1
+ {"version":3,"file":"AccentIcon.d.ts","sourceRoot":"","sources":["../../../../icon/lib/AccentIcon.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAC,gBAAgB,EAAkB,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,kCAAkC,CAAC;AAGlE,OAAO,EAAM,QAAQ,EAAwC,MAAM,OAAO,CAAC;AAE3E;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAClC;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,eAAgB,SAAQ,gBAAgB,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,GAAG,MAAM,CAAC;IACvF;;OAEG;IACH,IAAI,EAAE,gBAAgB,CAAC;IACvB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,4BAG1B,gBAAgB,KAAG,SAOpB,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;wBAuB5B,CAAC;AAEH,eAAO,MAAM,UAAU,sFAwBrB,CAAC"}
@@ -19,12 +19,17 @@ var __importStar = (this && this.__importStar) || function (mod) {
19
19
  return result;
20
20
  };
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.AccentIcon = exports.accentIconStyles = void 0;
22
+ exports.AccentIcon = exports.accentIconStencil = exports.accentIconStyles = void 0;
23
23
  const React = __importStar(require("react"));
24
24
  const tokens_1 = require("@workday/canvas-kit-react/tokens");
25
25
  const design_assets_types_1 = require("@workday/design-assets-types");
26
- const Icon_1 = require("./Icon");
27
26
  const common_1 = require("@workday/canvas-kit-react/common");
27
+ const canvas_kit_styling_1 = require("@workday/canvas-kit-styling");
28
+ const canvas_tokens_web_1 = require("@workday/canvas-tokens-web");
29
+ const Svg_1 = require("./Svg");
30
+ /**
31
+ * @deprecated `accentIconStyles` will be removed in in a future version as a part of implementation of stencils and new tokens. Consider to use `accentIconStencil` instead.
32
+ */
28
33
  const accentIconStyles = ({ color = tokens_1.colors.blueberry500, transparent = false, }) => ({
29
34
  '& .color-500': {
30
35
  fill: common_1.getColor(color),
@@ -34,9 +39,28 @@ const accentIconStyles = ({ color = tokens_1.colors.blueberry500, transparent =
34
39
  },
35
40
  });
36
41
  exports.accentIconStyles = accentIconStyles;
42
+ exports.accentIconStencil = canvas_kit_styling_1.createStencil({
43
+ extends: Svg_1.svgStencil,
44
+ vars: {
45
+ color: '',
46
+ },
47
+ base: { name: "8ab799", styles: "--cnvs-svg-size:3.5rem;& .color-500{fill:var(--cnvs-accent-icon-color, var(--cnvs-base-palette-blueberry-500));}& .french-vanilla-100{fill:var(--cnvs-base-palette-french-vanilla-100);}" },
48
+ modifiers: {
49
+ transparent: {
50
+ true: { name: "0b6c92", styles: "& .french-vanilla-100{fill:transparent;}" }
51
+ }
52
+ }
53
+ }, "cnvs-accent-icon");
37
54
  exports.AccentIcon = common_1.createComponent('span')({
38
55
  displayName: 'AccentIcon',
39
- Component: ({ transparent = false, size = 56, icon, color, shouldMirror, ...elemProps }, ref, Element) => {
40
- return (React.createElement(Icon_1.Icon, Object.assign({ src: icon, type: design_assets_types_1.CanvasIconTypes.Accent, styles: exports.accentIconStyles({ color, transparent }), size: size, as: Element, ref: ref, shouldMirror: shouldMirror }, elemProps)));
56
+ Component: ({ transparent, size, icon, color, shouldMirror, ...elemProps }, ref, Element) => {
57
+ return (React.createElement(Svg_1.Svg, Object.assign({ src: icon, type: design_assets_types_1.CanvasIconTypes.Accent, as: Element, ref: ref }, canvas_kit_styling_1.handleCsProp(elemProps, [
58
+ exports.accentIconStencil({
59
+ color: Svg_1.transformColorNameToToken(color),
60
+ size: typeof size === 'number' ? canvas_kit_styling_1.px2rem(size) : undefined,
61
+ shouldMirror,
62
+ transparent,
63
+ }),
64
+ ]))));
41
65
  },
42
66
  });
@@ -1,7 +1,10 @@
1
1
  import { BrandingColor } from '@workday/canvas-kit-react/tokens';
2
2
  import { CanvasAppletIcon } from '@workday/design-assets-types';
3
3
  import { CSSObject } from '@emotion/styled';
4
- import { IconProps } from './Icon';
4
+ import { SvgProps } from './Svg';
5
+ /**
6
+ * @deprecated Interface `AppletIconStyles` will be removed in a future version. All props will be moved inside `AppletIconProps`.
7
+ */
5
8
  export interface AppletIconStyles {
6
9
  /**
7
10
  * The icon color hue. Must use a member of the `AppletIcon.Colors` static enum.
@@ -9,8 +12,11 @@ export interface AppletIconStyles {
9
12
  */
10
13
  color?: BrandingColor;
11
14
  }
15
+ /**
16
+ * @deprecated `appletIconStyles` will be removed in in a future version as a part of implementation of stencils and new tokens. Consider to use `appletIconStencil` instead.
17
+ */
12
18
  export declare const appletIconStyles: ({ color, }: AppletIconStyles) => CSSObject;
13
- export interface AppletIconProps extends AppletIconStyles, Pick<IconProps, 'shouldMirror'> {
19
+ export interface AppletIconProps extends AppletIconStyles, Pick<SvgProps, 'shouldMirror' | 'cs'> {
14
20
  /**
15
21
  * The icon to display from `@workday/canvas-applet-icons-web`.
16
22
  */
@@ -21,6 +27,29 @@ export interface AppletIconProps extends AppletIconStyles, Pick<IconProps, 'shou
21
27
  */
22
28
  size?: number;
23
29
  }
30
+ export declare const appletIconStencil: import("@workday/canvas-kit-styling").Stencil<import("@workday/canvas-kit-styling").StencilModifierConfig<{
31
+ color200: string;
32
+ color300: string;
33
+ color400: string;
34
+ color500: string;
35
+ }, never>, {
36
+ color200: string;
37
+ color300: string;
38
+ color400: string;
39
+ color500: string;
40
+ }, import("@workday/canvas-kit-styling").Stencil<{
41
+ shouldMirror: {
42
+ true: {
43
+ transform: "scaleX(-1)";
44
+ };
45
+ };
46
+ }, {
47
+ /**
48
+ * The icon color hue. Must use a member of the `AppletIcon.Colors` static enum.
49
+ * @default AppletIcon.Colors.Blueberry
50
+ */
51
+ size: string;
52
+ }, never, never>, never>;
24
53
  export declare const AppletIcon: import("@workday/canvas-kit-react/common").ElementComponent<"span", AppletIconProps> & {
25
54
  Colors: typeof BrandingColor;
26
55
  };
@@ -1 +1 @@
1
- {"version":3,"file":"AppletIcon.d.ts","sourceRoot":"","sources":["../../../../icon/lib/AppletIcon.tsx"],"names":[],"mappings":"AACA,OAAO,EAAS,aAAa,EAAc,MAAM,kCAAkC,CAAC;AACpF,OAAO,EAAC,gBAAgB,EAAkB,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAO,SAAS,EAAC,MAAM,QAAQ,CAAC;AAGvC,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,eAAO,MAAM,gBAAgB,eAE1B,gBAAgB,KAAG,SAsCrB,CAAC;AAEF,MAAM,WAAW,eAAgB,SAAQ,gBAAgB,EAAE,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC;IACxF;;OAEG;IACH,IAAI,EAAE,gBAAgB,CAAC;IACvB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,UAAU;;CAuBrB,CAAC"}
1
+ {"version":3,"file":"AppletIcon.d.ts","sourceRoot":"","sources":["../../../../icon/lib/AppletIcon.tsx"],"names":[],"mappings":"AACA,OAAO,EAAS,aAAa,EAAc,MAAM,kCAAkC,CAAC;AACpF,OAAO,EAAC,gBAAgB,EAAkB,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAM,QAAQ,EAAa,MAAM,OAAO,CAAC;AAKhD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,eAE1B,gBAAgB,KAAG,SAsCrB,CAAC;AAEF,MAAM,WAAW,eAAgB,SAAQ,gBAAgB,EAAE,IAAI,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IAC9F;;OAEG;IACH,IAAI,EAAE,gBAAgB,CAAC;IACvB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;IAhE5B;;;OAGG;;wBA0FH,CAAC;AAEH,eAAO,MAAM,UAAU;;CAyBrB,CAAC"}
@@ -19,12 +19,17 @@ var __importStar = (this && this.__importStar) || function (mod) {
19
19
  return result;
20
20
  };
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.AppletIcon = exports.appletIconStyles = void 0;
22
+ exports.AppletIcon = exports.appletIconStencil = exports.appletIconStyles = void 0;
23
23
  const React = __importStar(require("react"));
24
24
  const tokens_1 = require("@workday/canvas-kit-react/tokens");
25
25
  const design_assets_types_1 = require("@workday/design-assets-types");
26
- const Icon_1 = require("./Icon");
26
+ const Svg_1 = require("./Svg");
27
27
  const common_1 = require("@workday/canvas-kit-react/common");
28
+ const canvas_kit_styling_1 = require("@workday/canvas-kit-styling");
29
+ const canvas_tokens_web_1 = require("@workday/canvas-tokens-web");
30
+ /**
31
+ * @deprecated `appletIconStyles` will be removed in in a future version as a part of implementation of stencils and new tokens. Consider to use `appletIconStencil` instead.
32
+ */
28
33
  const appletIconStyles = ({ color = tokens_1.BrandingColor.Blueberry, }) => {
29
34
  // Check if valid color
30
35
  if (!Object.keys(tokens_1.BrandingColor)
@@ -61,10 +66,28 @@ const appletIconStyles = ({ color = tokens_1.BrandingColor.Blueberry, }) => {
61
66
  };
62
67
  };
63
68
  exports.appletIconStyles = appletIconStyles;
69
+ exports.appletIconStencil = canvas_kit_styling_1.createStencil({
70
+ extends: Svg_1.svgStencil,
71
+ vars: {
72
+ color200: '',
73
+ color300: '',
74
+ color400: '',
75
+ color500: '',
76
+ },
77
+ base: { name: "ce2e64", styles: "--cnvs-svg-size:5.75rem;& .color-100{fill:var(--cnvs-base-palette-french-vanilla-100);}& .color-200{fill:var(--cnvs-applet-icon-color200, var(--cnvs-base-palette-blueberry-200));}& .color-300{fill:var(--cnvs-applet-icon-color300, var(--cnvs-base-palette-blueberry-300));}& .color-400{fill:var(--cnvs-applet-icon-color400, var(--cnvs-base-palette-blueberry-400));}& .color-400-alpha-20{fill:var(--cnvs-applet-icon-color400, var(--cnvs-base-palette-blueberry-400));}& .color-500{fill:var(--cnvs-applet-icon-color500, var(--cnvs-base-palette-blueberry-400));}" }
78
+ }, "cnvs-applet-icon");
64
79
  exports.AppletIcon = common_1.createComponent('span')({
65
80
  displayName: 'AppletIcon',
66
- Component: ({ size = 92, icon, color, shouldMirror, ...elemProps }, ref, Element) => {
67
- return (React.createElement(Icon_1.Icon, Object.assign({ src: icon, type: design_assets_types_1.CanvasIconTypes.Applet, styles: exports.appletIconStyles({ color }), as: Element, size: size, ref: ref, shouldMirror: shouldMirror }, elemProps)));
81
+ Component: ({ size, icon, color, ...elemProps }, ref, Element) => {
82
+ const colors = color && {
83
+ color200: canvas_tokens_web_1.base[`${color}200`],
84
+ color300: canvas_tokens_web_1.base[`${color}300`],
85
+ color400: canvas_tokens_web_1.base[`${color}400`],
86
+ color500: canvas_tokens_web_1.base[`${color}500`],
87
+ };
88
+ return (React.createElement(Svg_1.Svg, Object.assign({ src: icon, type: design_assets_types_1.CanvasIconTypes.Applet, as: Element, ref: ref }, canvas_kit_styling_1.handleCsProp(elemProps, [
89
+ exports.appletIconStencil({ ...colors, size: size ? canvas_kit_styling_1.px2rem(size) : undefined }),
90
+ ]))));
68
91
  },
69
92
  subComponents: {
70
93
  Colors: tokens_1.BrandingColor,
@@ -1,15 +1,20 @@
1
1
  import { CanvasGraphic } from '@workday/design-assets-types';
2
2
  import { CSSObject } from '@emotion/styled';
3
3
  import { SvgProps } from './Svg';
4
+ /**
5
+ * @deprecated Interface `GraphicStyles` will be removed in a future version. `grow` prop will be moved inside `GraphicProps`.
6
+ */
4
7
  export interface GraphicStyles {
5
8
  /**
6
9
  * The width of the Graphic in `px`. The Graphic's `width` takes precedence over its `height` in order to preserve its proportions.
7
10
  * @default width of graphic
11
+ * @deprecated Use `cs` to set width, `cs={{"& svg": {width: '1rem'}}}`
8
12
  */
9
13
  width?: number | string;
10
14
  /**
11
15
  * The height of the Graphic in `px`. If the Graphic's `height` is set, its `width` will be set to `100%`.
12
16
  * @default height of graphic
17
+ * @deprecated Use `cs` to set height, `cs={{"& svg": {height: '1rem'}}}`
13
18
  */
14
19
  height?: number | string;
15
20
  /**
@@ -18,12 +23,26 @@ export interface GraphicStyles {
18
23
  */
19
24
  grow?: boolean;
20
25
  }
21
- export interface GraphicProps extends GraphicStyles, Pick<SvgProps, 'shouldMirror'> {
26
+ export interface GraphicProps extends GraphicStyles, Pick<SvgProps, 'shouldMirror' | 'cs'> {
22
27
  /**
23
28
  * The graphic to display from `@workday/canvas-graphics-web`.
24
29
  */
25
30
  src: CanvasGraphic;
26
31
  }
32
+ /**
33
+ * @deprecated `graphicStyles` will be removed in in a future version as a part of implementation of stencils and new tokens. Consider to use `graphicStencil` instead.
34
+ */
27
35
  export declare const graphicStyles: ({ width, height, grow }: GraphicStyles) => CSSObject;
36
+ export declare const graphicStencil: import("@workday/canvas-kit-styling").Stencil<{
37
+ grow: {
38
+ true: {
39
+ width: string;
40
+ '& svg': {
41
+ width: string;
42
+ height: string;
43
+ };
44
+ };
45
+ };
46
+ }, {}, never, never>;
28
47
  export declare const Graphic: import("@workday/canvas-kit-react/common").ElementComponent<"span", GraphicProps>;
29
48
  //# sourceMappingURL=Graphic.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Graphic.d.ts","sourceRoot":"","sources":["../../../../icon/lib/Graphic.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,aAAa,EAAkB,MAAM,8BAA8B,CAAC;AAC5E,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAM,QAAQ,EAAC,MAAM,OAAO,CAAC;AAGpC,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,YAAa,SAAQ,aAAa,EAAE,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC;IACjF;;OAEG;IACH,GAAG,EAAE,aAAa,CAAC;CACpB;AAED,eAAO,MAAM,aAAa,4BAA2B,aAAa,KAAG,SA4BpE,CAAC;AAEF,eAAO,MAAM,OAAO,mFAmBlB,CAAC"}
1
+ {"version":3,"file":"Graphic.d.ts","sourceRoot":"","sources":["../../../../icon/lib/Graphic.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,aAAa,EAAkB,MAAM,8BAA8B,CAAC;AAC5E,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAM,QAAQ,EAAC,MAAM,OAAO,CAAC;AAIpC;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,YAAa,SAAQ,aAAa,EAAE,IAAI,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IACxF;;OAEG;IACH,GAAG,EAAE,aAAa,CAAC;CACpB;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,4BAA2B,aAAa,KAAG,SA4BpE,CAAC;AAOF,eAAO,MAAM,cAAc;;;;;;;;;;oBAkBzB,CAAC;AAEH,eAAO,MAAM,OAAO,mFAkBlB,CAAC"}
@@ -19,11 +19,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
19
19
  return result;
20
20
  };
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.Graphic = exports.graphicStyles = void 0;
22
+ exports.Graphic = exports.graphicStencil = exports.graphicStyles = void 0;
23
23
  const React = __importStar(require("react"));
24
24
  const design_assets_types_1 = require("@workday/design-assets-types");
25
25
  const Svg_1 = require("./Svg");
26
26
  const common_1 = require("@workday/canvas-kit-react/common");
27
+ const canvas_kit_styling_1 = require("@workday/canvas-kit-styling");
28
+ /**
29
+ * @deprecated `graphicStyles` will be removed in in a future version as a part of implementation of stencils and new tokens. Consider to use `graphicStencil` instead.
30
+ */
27
31
  const graphicStyles = ({ width, height, grow }) => {
28
32
  if (grow) {
29
33
  return {
@@ -53,9 +57,27 @@ const graphicStyles = ({ width, height, grow }) => {
53
57
  return {};
54
58
  };
55
59
  exports.graphicStyles = graphicStyles;
60
+ /**
61
+ * @deprecated Part of supporting deprecated `height` and `width` props
62
+ */
63
+ const graphicVars = canvas_kit_styling_1.createVars({ id: "cnvs-graphic", args: ["height", "width"] });
64
+ exports.graphicStencil = canvas_kit_styling_1.createStencil({
65
+ base: { name: "a19511", styles: "& svg{width:var(--cnvs-graphic-width, 100%);height:var(--cnvs-graphic-height, 100%);}" },
66
+ modifiers: {
67
+ grow: {
68
+ true: { name: "f2369d", styles: "width:100%;& svg{width:100%;height:100%;}" }
69
+ }
70
+ }
71
+ }, "cnvs-graphic");
56
72
  exports.Graphic = common_1.createComponent('span')({
57
73
  displayName: 'Graphic',
58
- Component: ({ grow = false, src, width, height, shouldMirror, ...elemProps }, ref, Element) => {
59
- return (React.createElement(Svg_1.Svg, Object.assign({ src: src, styles: exports.graphicStyles({ width, height, grow }), type: design_assets_types_1.CanvasIconTypes.Graphic, as: Element, ref: ref, shouldMirror: shouldMirror }, elemProps)));
74
+ Component: ({ grow, width, height, ...elemProps }, ref, Element) => {
75
+ return (React.createElement(Svg_1.Svg, Object.assign({ type: design_assets_types_1.CanvasIconTypes.Graphic, as: Element, ref: ref }, canvas_kit_styling_1.handleCsProp(elemProps, [
76
+ exports.graphicStencil({ grow }),
77
+ {
78
+ [graphicVars.height]: typeof height === 'number' ? canvas_kit_styling_1.px2rem(height) : height,
79
+ [graphicVars.width]: typeof width === 'number' ? canvas_kit_styling_1.px2rem(width) : width,
80
+ },
81
+ ]))));
60
82
  },
61
83
  });
@@ -1,9 +1,7 @@
1
- import { CSSObject } from '@emotion/styled';
2
1
  import { CanvasIcon, CanvasIconTypes } from '@workday/design-assets-types';
3
2
  import { BoxProps } from '@workday/canvas-kit-react/layout';
4
3
  export interface SvgProps extends BoxProps {
5
4
  src: CanvasIcon;
6
- styles?: CSSObject;
7
5
  type: CanvasIconTypes;
8
6
  /**
9
7
  * If set to `true`, transform the SVG's x-axis to mirror the graphic
@@ -11,5 +9,17 @@ export interface SvgProps extends BoxProps {
11
9
  */
12
10
  shouldMirror?: boolean;
13
11
  }
12
+ export declare const svgStencil: import("@workday/canvas-kit-styling").Stencil<{
13
+ shouldMirror: {
14
+ true: {
15
+ transform: "scaleX(-1)";
16
+ };
17
+ };
18
+ }, {
19
+ /** set width and height of svg element */
20
+ size: string;
21
+ }, never, never>;
22
+ /** @deprecated */
23
+ export declare const transformColorNameToToken: (color?: string | undefined) => string | undefined;
14
24
  export declare const Svg: import("@workday/canvas-kit-react/common").ElementComponent<"span", SvgProps>;
15
25
  //# sourceMappingURL=Svg.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Svg.d.ts","sourceRoot":"","sources":["../../../../icon/lib/Svg.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAC,UAAU,EAAE,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAGzE,OAAO,EAAM,QAAQ,EAAC,MAAM,kCAAkC,CAAC;AAE/D,MAAM,WAAW,QAAS,SAAQ,QAAQ;IACxC,GAAG,EAAE,UAAU,CAAC;IAChB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,IAAI,EAAE,eAAe,CAAC;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAeD,eAAO,MAAM,GAAG,+EAmBd,CAAC"}
1
+ {"version":3,"file":"Svg.d.ts","sourceRoot":"","sources":["../../../../icon/lib/Svg.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,UAAU,EAAE,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAGzE,OAAO,EAAC,QAAQ,EAAc,MAAM,kCAAkC,CAAC;AAIvE,MAAM,WAAW,QAAS,SAAQ,QAAQ;IACxC,GAAG,EAAE,UAAU,CAAC;IAChB,IAAI,EAAE,eAAe,CAAC;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,UAAU;;;;;;;IAEnB,0CAA0C;;gBAmB5C,CAAC;AAEH,kBAAkB;AAClB,eAAO,MAAM,yBAAyB,oDAKrC,CAAC;AAEF,eAAO,MAAM,GAAG,+EAkBd,CAAC"}
@@ -19,21 +19,36 @@ var __importStar = (this && this.__importStar) || function (mod) {
19
19
  return result;
20
20
  };
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.Svg = void 0;
22
+ exports.Svg = exports.transformColorNameToToken = exports.svgStencil = void 0;
23
23
  const React = __importStar(require("react"));
24
24
  const utils_1 = require("./utils");
25
25
  const common_1 = require("@workday/canvas-kit-react/common");
26
26
  const layout_1 = require("@workday/canvas-kit-react/layout");
27
- const StyledIconSpan = common_1.styled(layout_1.Box.as('span'))({
28
- display: 'inline-block',
29
- '> svg': { display: 'block' },
30
- }, ({ shouldMirror, styles }) => ({
31
- ...styles,
32
- transform: shouldMirror ? 'scaleX(-1)' : undefined,
33
- }));
27
+ const canvas_kit_styling_1 = require("@workday/canvas-kit-styling");
28
+ const canvas_tokens_web_1 = require("@workday/canvas-tokens-web");
29
+ exports.svgStencil = canvas_kit_styling_1.createStencil({
30
+ vars: {
31
+ /** set width and height of svg element */
32
+ size: '',
33
+ },
34
+ base: { name: "1ea8e4", styles: "box-sizing:border-box;display:inline-block;> svg{display:block;width:var(--cnvs-svg-size);height:var(--cnvs-svg-size);}" },
35
+ modifiers: {
36
+ shouldMirror: {
37
+ true: { name: "4302e3", styles: "transform:scaleX(-1);" }
38
+ }
39
+ }
40
+ }, "cnvs-svg");
41
+ /** @deprecated */
42
+ const transformColorNameToToken = (color) => {
43
+ if (color && color in canvas_tokens_web_1.base) {
44
+ return canvas_tokens_web_1.base[color];
45
+ }
46
+ return color;
47
+ };
48
+ exports.transformColorNameToToken = transformColorNameToToken;
34
49
  exports.Svg = common_1.createComponent('span')({
35
50
  displayName: 'Svg',
36
- Component: ({ src, type, ...elemProps }, ref, Element) => {
51
+ Component: ({ shouldMirror, src, type, ...elemProps }, ref, Element) => {
37
52
  try {
38
53
  utils_1.validateIconType(src, type);
39
54
  }
@@ -41,6 +56,6 @@ exports.Svg = common_1.createComponent('span')({
41
56
  console.error(e);
42
57
  return null;
43
58
  }
44
- return (React.createElement(StyledIconSpan, Object.assign({ as: Element, dangerouslySetInnerHTML: { __html: src.svg } }, elemProps, { ref: ref })));
59
+ return (React.createElement(Element, Object.assign({ ref: ref, dangerouslySetInnerHTML: { __html: src.svg } }, layout_1.mergeStyles(elemProps, exports.svgStencil({ shouldMirror })))));
45
60
  },
46
61
  });
@@ -1,46 +1,73 @@
1
1
  import { CanvasSystemIcon } from '@workday/design-assets-types';
2
2
  import { CSSObject } from '@emotion/styled';
3
- import { IconProps } from './Icon';
4
- import { SystemPropValues } from '@workday/canvas-kit-react/layout';
3
+ import { SvgProps } from './Svg';
4
+ /**
5
+ * @deprecated Interface `SystemIconStyles` will be removed in a future version. `accent`, `color`, background props will be moved inside `GraphicProps`.
6
+ */
5
7
  export interface SystemIconStyles {
6
8
  /**
7
9
  * The accent color of the SystemIcon. This overrides `color`.
8
10
  */
9
- accent?: SystemPropValues['color'];
11
+ accent?: string;
10
12
  /**
11
13
  * The accent color of the SystemIcon on hover. This overrides `colorHover`.
14
+ * @deprecated `accentHover` is deprecated and will be removed in a future version. Please use the following instead in your style overrides:
15
+ * ```tsx
16
+ * '&:hover': {
17
+ * [systemIconStencil.vars.accent]: desiredAccentHoverColor
18
+ * }
19
+ * ```
12
20
  */
13
- accentHover?: SystemPropValues['color'];
21
+ accentHover?: string;
14
22
  /**
15
23
  * The background color of the SystemIcon.
16
24
  * @default transparent
17
25
  */
18
- background?: SystemPropValues['color'];
26
+ background?: string;
19
27
  /**
20
28
  * The background color of the SystemIcon on hover.
21
29
  * @default transparent
30
+ * @deprecated `backgroundHover` is deprecated and will be removed in a future version. Please use the following instead in your style overrides:
31
+ * ```tsx
32
+ * '&:hover': {
33
+ * [systemIconStencil.vars.background]: desiredBackgroundHoverColor
34
+ * }
35
+ * ```
22
36
  */
23
- backgroundHover?: SystemPropValues['color'];
37
+ backgroundHover?: string;
24
38
  /**
25
- * The color of the SystemIcon. This defines `accent` and `fill`. `color` may be overriden by `accent` and `fill`.
26
- * @default iconColors.standard
39
+ * The color of the SystemIcon. This defines `accent` and `fill`. `color` may be overwritten by `accent` and `fill`.
40
+ * @default base.licorice200
27
41
  */
28
- color?: SystemPropValues['color'];
42
+ color?: string;
29
43
  /**
30
- * The hover color of the SystemIcon. This defines `accentHover` and `fillHover`. `colorHover` may be overriden by `accentHover` and `fillHover`.
31
- * @default iconColors.hover
44
+ * The hover color of the SystemIcon. This defines `accentHover` and `fillHover`. `colorHover` may be overwritten by `accentHover` and `fillHover`.
45
+ * @default base.licorice200
46
+ * @deprecated `colorHover` is deprecated and will be removed in a future version. Please use the following instead in your style overrides:
47
+ * ```tsx
48
+ * '&:hover': {
49
+ * [systemIconStencil.vars.color]: desiredColorHoverColor
50
+ * }
51
+ * ```
32
52
  */
33
- colorHover?: SystemPropValues['color'];
53
+ colorHover?: string;
34
54
  /**
35
55
  * The fill color of the SystemIcon. This overrides `color`.
56
+ * @deprecated `fill` is deprecated and will be removed in a future version. Please use `color` and specify `accent` color if you want `accent` to be different from `color`.
36
57
  */
37
- fill?: SystemPropValues['color'];
58
+ fill?: string;
38
59
  /**
39
60
  * The fill color of the SystemIcon on hover. This overrides `colorHover`.
61
+ * @deprecated `fillHover` is deprecated and will be removed in a future version. Please use the following instead in your style overrides:
62
+ * ```tsx
63
+ * '&:hover': {
64
+ * [systemIconStencil.vars.fill]: desiredFillHoverColor
65
+ * }
66
+ * ```
40
67
  */
41
- fillHover?: SystemPropValues['color'];
68
+ fillHover?: string;
42
69
  }
43
- export interface SystemIconProps extends SystemIconStyles, Omit<IconProps, 'src' | 'fill' | 'type'> {
70
+ export interface SystemIconProps extends SystemIconStyles, Omit<SvgProps, 'src' | 'type' | 'fill' | 'background' | 'color'> {
44
71
  /**
45
72
  * The icon to display from `@workday/canvas-system-icons-web`.
46
73
  */
@@ -48,8 +75,44 @@ export interface SystemIconProps extends SystemIconStyles, Omit<IconProps, 'src'
48
75
  /**
49
76
  * The size of the SystemIcon in `px`.
50
77
  */
51
- size?: number | string | undefined;
78
+ size?: number | string;
52
79
  }
80
+ /**
81
+ * @deprecated This style utility function is deprecated and will be removed in a future version. We'll track usage over time to prevent unnecessary burden on upgrading. Most of the time, this function is used in conjunction with styling `SystemIcon`. There are a few ways to override the colors used in `SystemIcon`.
82
+ * - Pass props directly to the `SystemIcon` component: `<SystemIcon color={color} {...etc} />
83
+ * - Style overrides using the `systemIconStencil`:
84
+ * ```tsx
85
+ * // styling container
86
+ *
87
+ * ```
88
+ */
53
89
  export declare const systemIconStyles: ({ accent, accentHover, background, backgroundHover, color, colorHover, fill, fillHover, }: SystemIconStyles) => CSSObject;
90
+ export declare const systemIconStencil: import("@workday/canvas-kit-styling").Stencil<import("@workday/canvas-kit-styling").StencilModifierConfig<{
91
+ /**
92
+ * This will set the icon's color (both `.wd-icon-fill` and `.wd-icon-accent` SVG layers). Most
93
+ * of the time, this is the only color you need to change. Icons also have an accent layer. If you
94
+ * wish to change the accent layer independently, also set the `accentColor` variable
95
+ */
96
+ color: string;
97
+ accentColor: string;
98
+ backgroundColor: string;
99
+ }, never>, {
100
+ /**
101
+ * This will set the icon's color (both `.wd-icon-fill` and `.wd-icon-accent` SVG layers). Most
102
+ * of the time, this is the only color you need to change. Icons also have an accent layer. If you
103
+ * wish to change the accent layer independently, also set the `accentColor` variable
104
+ */
105
+ color: string;
106
+ accentColor: string;
107
+ backgroundColor: string;
108
+ }, import("@workday/canvas-kit-styling").Stencil<{
109
+ shouldMirror: {
110
+ true: {
111
+ transform: "scaleX(-1)";
112
+ };
113
+ };
114
+ }, {
115
+ size: string;
116
+ }, never, never>, never>;
54
117
  export declare const SystemIcon: import("@workday/canvas-kit-react/common").ElementComponent<"span", SystemIconProps>;
55
118
  //# sourceMappingURL=SystemIcon.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SystemIcon.d.ts","sourceRoot":"","sources":["../../../../icon/lib/SystemIcon.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAC,gBAAgB,EAAkB,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAO,SAAS,EAAC,MAAM,QAAQ,CAAC;AAEvC,OAAO,EAAC,gBAAgB,EAAC,MAAM,kCAAkC,CAAC;AAElE,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACnC;;OAEG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACxC;;;OAGG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACvC;;;OAGG;IACH,eAAe,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC5C;;;OAGG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAClC;;;OAGG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACvC;;OAEG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACjC;;OAEG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;CACvC;AAED,MAAM,WAAW,eACf,SAAQ,gBAAgB,EACtB,IAAI,CAAC,SAAS,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;IAC1C;;OAEG;IACH,IAAI,EAAE,gBAAgB,CAAC;IACvB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACpC;AAED,eAAO,MAAM,gBAAgB,8FAS1B,gBAAgB,KAAG,SAmBpB,CAAC;AAEH,eAAO,MAAM,UAAU,sFA4CrB,CAAC"}
1
+ {"version":3,"file":"SystemIcon.d.ts","sourceRoot":"","sources":["../../../../icon/lib/SystemIcon.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAC,gBAAgB,EAAkB,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAI1C,OAAO,EAAM,QAAQ,EAAwC,MAAM,OAAO,CAAC;AAE3E;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;;;;;OASG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eACf,SAAQ,gBAAgB,EACtB,IAAI,CAAC,QAAQ,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,OAAO,CAAC;IAClE;;OAEG;IACH,IAAI,EAAE,gBAAgB,CAAC;IACvB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,8FAS1B,gBAAgB,KAAG,SAmBpB,CAAC;AAiBH,eAAO,MAAM,iBAAiB;IAG1B;;;;OAIG;;;;;IAJH;;;;OAIG;;;;;;;;;;;;wBAmCL,CAAC;AAEH,eAAO,MAAM,UAAU,sFA0CrB,CAAC"}