@workday/canvas-kit-react 6.0.0-beta.0-next.11 → 6.0.0-beta.0-next.16

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 (130) hide show
  1. package/button/README.md +19 -2
  2. package/button/lib/IconButton.tsx +7 -1
  3. package/button/lib/PrimaryButton.tsx +18 -2
  4. package/button/lib/SecondaryButton.tsx +18 -2
  5. package/button/lib/TertiaryButton.tsx +18 -2
  6. package/button/lib/ToolbarDropdownButton.tsx +11 -2
  7. package/button/lib/ToolbarIconButton.tsx +2 -1
  8. package/button/lib/parts/ButtonLabelIcon.tsx +13 -2
  9. package/dist/commonjs/button/lib/IconButton.d.ts +5 -0
  10. package/dist/commonjs/button/lib/IconButton.d.ts.map +1 -1
  11. package/dist/commonjs/button/lib/IconButton.js +2 -2
  12. package/dist/commonjs/button/lib/PrimaryButton.d.ts +5 -0
  13. package/dist/commonjs/button/lib/PrimaryButton.d.ts.map +1 -1
  14. package/dist/commonjs/button/lib/PrimaryButton.js +3 -3
  15. package/dist/commonjs/button/lib/SecondaryButton.d.ts +5 -0
  16. package/dist/commonjs/button/lib/SecondaryButton.d.ts.map +1 -1
  17. package/dist/commonjs/button/lib/SecondaryButton.js +3 -3
  18. package/dist/commonjs/button/lib/TertiaryButton.d.ts +5 -0
  19. package/dist/commonjs/button/lib/TertiaryButton.d.ts.map +1 -1
  20. package/dist/commonjs/button/lib/TertiaryButton.js +3 -3
  21. package/dist/commonjs/button/lib/ToolbarDropdownButton.d.ts.map +1 -1
  22. package/dist/commonjs/button/lib/ToolbarDropdownButton.js +3 -3
  23. package/dist/commonjs/button/lib/ToolbarIconButton.d.ts.map +1 -1
  24. package/dist/commonjs/button/lib/ToolbarIconButton.js +2 -2
  25. package/dist/commonjs/button/lib/parts/ButtonLabelIcon.d.ts +6 -1
  26. package/dist/commonjs/button/lib/parts/ButtonLabelIcon.d.ts.map +1 -1
  27. package/dist/commonjs/button/lib/parts/ButtonLabelIcon.js +2 -2
  28. package/dist/commonjs/icon/lib/AccentIcon.d.ts.map +1 -1
  29. package/dist/commonjs/icon/lib/AccentIcon.js +2 -2
  30. package/dist/commonjs/icon/lib/AppletIcon.d.ts +1 -1
  31. package/dist/commonjs/icon/lib/AppletIcon.d.ts.map +1 -1
  32. package/dist/commonjs/icon/lib/AppletIcon.js +2 -2
  33. package/dist/commonjs/icon/lib/Graphic.d.ts +1 -1
  34. package/dist/commonjs/icon/lib/Graphic.d.ts.map +1 -1
  35. package/dist/commonjs/icon/lib/Graphic.js +2 -2
  36. package/dist/commonjs/icon/lib/Icon.d.ts.map +1 -1
  37. package/dist/commonjs/icon/lib/Icon.js +2 -2
  38. package/dist/commonjs/icon/lib/Svg.d.ts +5 -0
  39. package/dist/commonjs/icon/lib/Svg.d.ts.map +1 -1
  40. package/dist/commonjs/icon/lib/Svg.js +2 -1
  41. package/dist/commonjs/icon/lib/SystemIcon.d.ts.map +1 -1
  42. package/dist/commonjs/icon/lib/SystemIcon.js +2 -2
  43. package/dist/commonjs/icon/lib/SystemIconCircle.d.ts +1 -1
  44. package/dist/commonjs/icon/lib/SystemIconCircle.d.ts.map +1 -1
  45. package/dist/commonjs/icon/lib/SystemIconCircle.js +2 -2
  46. package/dist/commonjs/pagination/lib/Pagination/Pagination.d.ts +1 -1
  47. package/dist/commonjs/tooltip/lib/OverflowTooltip.d.ts.map +1 -1
  48. package/dist/commonjs/tooltip/lib/OverflowTooltip.js +11 -9
  49. package/dist/commonjs/tooltip/lib/TooltipContainer.d.ts.map +1 -1
  50. package/dist/commonjs/tooltip/lib/TooltipContainer.js +18 -1
  51. package/dist/commonjs/tooltip/lib/useTooltip.d.ts +4 -4
  52. package/dist/commonjs/tooltip/lib/useTooltip.d.ts.map +1 -1
  53. package/dist/es6/button/lib/IconButton.d.ts +5 -0
  54. package/dist/es6/button/lib/IconButton.d.ts.map +1 -1
  55. package/dist/es6/button/lib/IconButton.js +2 -2
  56. package/dist/es6/button/lib/PrimaryButton.d.ts +5 -0
  57. package/dist/es6/button/lib/PrimaryButton.d.ts.map +1 -1
  58. package/dist/es6/button/lib/PrimaryButton.js +3 -3
  59. package/dist/es6/button/lib/SecondaryButton.d.ts +5 -0
  60. package/dist/es6/button/lib/SecondaryButton.d.ts.map +1 -1
  61. package/dist/es6/button/lib/SecondaryButton.js +3 -3
  62. package/dist/es6/button/lib/TertiaryButton.d.ts +5 -0
  63. package/dist/es6/button/lib/TertiaryButton.d.ts.map +1 -1
  64. package/dist/es6/button/lib/TertiaryButton.js +3 -3
  65. package/dist/es6/button/lib/ToolbarDropdownButton.d.ts.map +1 -1
  66. package/dist/es6/button/lib/ToolbarDropdownButton.js +3 -3
  67. package/dist/es6/button/lib/ToolbarIconButton.d.ts.map +1 -1
  68. package/dist/es6/button/lib/ToolbarIconButton.js +2 -2
  69. package/dist/es6/button/lib/parts/ButtonLabelIcon.d.ts +6 -1
  70. package/dist/es6/button/lib/parts/ButtonLabelIcon.d.ts.map +1 -1
  71. package/dist/es6/button/lib/parts/ButtonLabelIcon.js +2 -2
  72. package/dist/es6/icon/lib/AccentIcon.d.ts.map +1 -1
  73. package/dist/es6/icon/lib/AccentIcon.js +2 -2
  74. package/dist/es6/icon/lib/AppletIcon.d.ts +1 -1
  75. package/dist/es6/icon/lib/AppletIcon.d.ts.map +1 -1
  76. package/dist/es6/icon/lib/AppletIcon.js +2 -2
  77. package/dist/es6/icon/lib/Graphic.d.ts +1 -1
  78. package/dist/es6/icon/lib/Graphic.d.ts.map +1 -1
  79. package/dist/es6/icon/lib/Graphic.js +2 -2
  80. package/dist/es6/icon/lib/Icon.d.ts.map +1 -1
  81. package/dist/es6/icon/lib/Icon.js +2 -2
  82. package/dist/es6/icon/lib/Svg.d.ts +5 -0
  83. package/dist/es6/icon/lib/Svg.d.ts.map +1 -1
  84. package/dist/es6/icon/lib/Svg.js +2 -1
  85. package/dist/es6/icon/lib/SystemIcon.d.ts.map +1 -1
  86. package/dist/es6/icon/lib/SystemIcon.js +2 -2
  87. package/dist/es6/icon/lib/SystemIconCircle.d.ts +1 -1
  88. package/dist/es6/icon/lib/SystemIconCircle.d.ts.map +1 -1
  89. package/dist/es6/icon/lib/SystemIconCircle.js +2 -2
  90. package/dist/es6/pagination/lib/Pagination/Pagination.d.ts +1 -1
  91. package/dist/es6/tooltip/lib/OverflowTooltip.d.ts.map +1 -1
  92. package/dist/es6/tooltip/lib/OverflowTooltip.js +11 -6
  93. package/dist/es6/tooltip/lib/TooltipContainer.d.ts.map +1 -1
  94. package/dist/es6/tooltip/lib/TooltipContainer.js +18 -1
  95. package/dist/es6/tooltip/lib/useTooltip.d.ts +4 -4
  96. package/dist/es6/tooltip/lib/useTooltip.d.ts.map +1 -1
  97. package/icon/README.md +60 -0
  98. package/icon/lib/AccentIcon.tsx +10 -1
  99. package/icon/lib/AppletIcon.tsx +5 -2
  100. package/icon/lib/Graphic.tsx +3 -2
  101. package/icon/lib/Icon.tsx +11 -2
  102. package/icon/lib/Svg.tsx +7 -1
  103. package/icon/lib/SystemIcon.tsx +2 -0
  104. package/icon/lib/SystemIconCircle.tsx +3 -1
  105. package/package.json +5 -5
  106. package/tooltip/lib/OverflowTooltip.tsx +20 -15
  107. package/tooltip/lib/TooltipContainer.tsx +23 -0
  108. package/tooltip/lib/useTooltip.tsx +5 -5
  109. package/ts3.5/dist/commonjs/button/lib/IconButton.d.ts +5 -0
  110. package/ts3.5/dist/commonjs/button/lib/PrimaryButton.d.ts +5 -0
  111. package/ts3.5/dist/commonjs/button/lib/SecondaryButton.d.ts +5 -0
  112. package/ts3.5/dist/commonjs/button/lib/TertiaryButton.d.ts +5 -0
  113. package/ts3.5/dist/commonjs/button/lib/parts/ButtonLabelIcon.d.ts +6 -1
  114. package/ts3.5/dist/commonjs/icon/lib/AppletIcon.d.ts +1 -1
  115. package/ts3.5/dist/commonjs/icon/lib/Graphic.d.ts +1 -1
  116. package/ts3.5/dist/commonjs/icon/lib/Svg.d.ts +5 -0
  117. package/ts3.5/dist/commonjs/icon/lib/SystemIconCircle.d.ts +1 -1
  118. package/ts3.5/dist/commonjs/pagination/lib/Pagination/Pagination.d.ts +1 -1
  119. package/ts3.5/dist/commonjs/tooltip/lib/useTooltip.d.ts +4 -4
  120. package/ts3.5/dist/es6/button/lib/IconButton.d.ts +5 -0
  121. package/ts3.5/dist/es6/button/lib/PrimaryButton.d.ts +5 -0
  122. package/ts3.5/dist/es6/button/lib/SecondaryButton.d.ts +5 -0
  123. package/ts3.5/dist/es6/button/lib/TertiaryButton.d.ts +5 -0
  124. package/ts3.5/dist/es6/button/lib/parts/ButtonLabelIcon.d.ts +6 -1
  125. package/ts3.5/dist/es6/icon/lib/AppletIcon.d.ts +1 -1
  126. package/ts3.5/dist/es6/icon/lib/Graphic.d.ts +1 -1
  127. package/ts3.5/dist/es6/icon/lib/Svg.d.ts +5 -0
  128. package/ts3.5/dist/es6/icon/lib/SystemIconCircle.d.ts +1 -1
  129. package/ts3.5/dist/es6/pagination/lib/Pagination/Pagination.d.ts +1 -1
  130. package/ts3.5/dist/es6/tooltip/lib/useTooltip.d.ts +4 -4
package/button/README.md CHANGED
@@ -43,7 +43,7 @@ line-height, etc.).
43
43
 
44
44
  ---
45
45
 
46
- ### `as: React.ElementType`
46
+ #### `as: React.ElementType`
47
47
 
48
48
  > The alternative container type for the button. If `as="a"` is provided, We use Emotion's special
49
49
  > `as` prop to render an `a` tag instead of a `button`.
@@ -69,6 +69,7 @@ Default: `undefined`
69
69
  import * as React from 'react';
70
70
  import {ToolbarIconButton} from '@workday/canvas-kit-react/button';
71
71
  import {activityStreamIcon} from '@workday/canvas-system-icons-web';
72
+
72
73
  <ToolbarIconButton icon={activityStreamIcon} aria-label="Activity Stream" />;
73
74
  ```
74
75
 
@@ -114,12 +115,20 @@ Default: `undefined`
114
115
 
115
116
  ---
116
117
 
117
- ### `icon: CanvasSystemIcon`
118
+ #### `icon: CanvasSystemIcon`
118
119
 
119
120
  > The icon of the button. Optional because ToolbarIconButton can also wrap a SystemIcon component.
120
121
 
121
122
  ---
122
123
 
124
+ #### `shouldMirrorIcon: boolean`
125
+
126
+ > If set to `true`, transform the SVG's x-axis to mirror the graphic
127
+
128
+ Default: `false`
129
+
130
+ ---
131
+
123
132
  # ToolbarDropdownButton
124
133
 
125
134
  > Button containing an icon or custom element. Icon may be a component from
@@ -165,6 +174,14 @@ import {activityStreamIcon} from '@workday/canvas-system-icons-web';
165
174
 
166
175
  ---
167
176
 
177
+ #### `shouldMirrorIcon: boolean`
178
+
179
+ > If set to `true`, transform the SVG's x-axis to mirror the graphic
180
+
181
+ Default: `false`
182
+
183
+ ---
184
+
168
185
  ### Deprecated Buttons
169
186
 
170
187
  > We have rolled out our next iteration of our buttons and will be deprecating the old style (orange
@@ -43,6 +43,11 @@ export interface IconButtonProps extends Themeable {
43
43
  * The icon of the IconButton.
44
44
  */
45
45
  icon?: CanvasSystemIcon;
46
+ /**
47
+ * If set to `true`, transform the icon's x-axis to mirror the graphic
48
+ * @default false
49
+ */
50
+ shouldMirrorIcon?: boolean;
46
51
  /**
47
52
  * The function called when the IconButton toggled state changes.
48
53
  */
@@ -62,6 +67,7 @@ export const IconButton = createComponent('button')({
62
67
  size = 'medium',
63
68
  onToggleChange,
64
69
  icon,
70
+ shouldMirrorIcon = false,
65
71
  toggled,
66
72
  children,
67
73
  ...elemProps
@@ -108,7 +114,7 @@ export const IconButton = createComponent('button')({
108
114
  aria-pressed={toggled}
109
115
  {...elemProps}
110
116
  >
111
- {icon ? <SystemIcon icon={icon} /> : children}
117
+ {icon ? <SystemIcon icon={icon} shouldMirror={shouldMirrorIcon} /> : children}
112
118
  </ButtonContainer>
113
119
  );
114
120
  },
@@ -32,6 +32,11 @@ export interface PrimaryButtonProps extends Themeable, GrowthBehavior {
32
32
  * @default 'left'
33
33
  */
34
34
  iconPosition?: 'left' | 'right';
35
+ /**
36
+ * If set to `true`, transform the icon's x-axis to mirror the graphic
37
+ * @default false
38
+ */
39
+ shouldMirrorIcon?: boolean;
35
40
  children?: React.ReactNode;
36
41
  }
37
42
 
@@ -46,6 +51,7 @@ export const PrimaryButton = createComponent('button')({
46
51
  iconPosition = 'left',
47
52
  dataLabel,
48
53
  icon,
54
+ shouldMirrorIcon = false,
49
55
  children,
50
56
  ...elemProps
51
57
  }: PrimaryButtonProps,
@@ -60,12 +66,22 @@ export const PrimaryButton = createComponent('button')({
60
66
  {...elemProps}
61
67
  >
62
68
  {icon && size !== 'small' && iconPosition === 'left' && (
63
- <ButtonLabelIcon size={size} iconPosition={iconPosition} icon={icon} />
69
+ <ButtonLabelIcon
70
+ size={size}
71
+ iconPosition={iconPosition}
72
+ icon={icon}
73
+ shouldMirrorIcon={shouldMirrorIcon}
74
+ />
64
75
  )}
65
76
  <ButtonLabel>{children}</ButtonLabel>
66
77
  {dataLabel && size !== 'small' && <ButtonLabelData>{dataLabel}</ButtonLabelData>}
67
78
  {icon && size !== 'small' && iconPosition === 'right' && (
68
- <ButtonLabelIcon size={size} iconPosition={iconPosition} icon={icon} />
79
+ <ButtonLabelIcon
80
+ size={size}
81
+ iconPosition={iconPosition}
82
+ icon={icon}
83
+ shouldMirrorIcon={shouldMirrorIcon}
84
+ />
69
85
  )}
70
86
  </ButtonContainer>
71
87
  ),
@@ -39,6 +39,11 @@ export interface SecondaryButtonProps extends Themeable, GrowthBehavior {
39
39
  * @default 'left'
40
40
  */
41
41
  iconPosition?: 'left' | 'right';
42
+ /**
43
+ * If set to `true`, transform the icon's x-axis to mirror the graphic
44
+ * @default false
45
+ */
46
+ shouldMirrorIcon?: boolean;
42
47
  children?: React.ReactNode;
43
48
  }
44
49
 
@@ -54,6 +59,7 @@ export const SecondaryButton = createComponent('button')({
54
59
  variant,
55
60
  dataLabel,
56
61
  icon,
62
+ shouldMirrorIcon = false,
57
63
  children,
58
64
  ...elemProps
59
65
  }: SecondaryButtonProps,
@@ -68,12 +74,22 @@ export const SecondaryButton = createComponent('button')({
68
74
  {...elemProps}
69
75
  >
70
76
  {icon && size !== 'small' && iconPosition === 'left' && (
71
- <ButtonLabelIcon size={size} iconPosition={iconPosition} icon={icon} />
77
+ <ButtonLabelIcon
78
+ size={size}
79
+ iconPosition={iconPosition}
80
+ icon={icon}
81
+ shouldMirrorIcon={shouldMirrorIcon}
82
+ />
72
83
  )}
73
84
  <ButtonLabel>{children}</ButtonLabel>
74
85
  {dataLabel && size !== 'small' && <ButtonLabelData>{dataLabel}</ButtonLabelData>}
75
86
  {icon && size !== 'small' && iconPosition === 'right' && (
76
- <ButtonLabelIcon size={size} iconPosition={iconPosition} icon={icon} />
87
+ <ButtonLabelIcon
88
+ size={size}
89
+ iconPosition={iconPosition}
90
+ icon={icon}
91
+ shouldMirrorIcon={shouldMirrorIcon}
92
+ />
77
93
  )}
78
94
  </ButtonContainer>
79
95
  ),
@@ -35,6 +35,11 @@ export interface TertiaryButtonProps extends Themeable {
35
35
  /**
36
36
  * The capitalization of the text in the button.
37
37
  */
38
+ /**
39
+ * If set to `true`, transform the icon's x-axis to mirror the graphic
40
+ * @default false
41
+ */
42
+ shouldMirrorIcon?: boolean;
38
43
  allCaps?: boolean;
39
44
  children?: React.ReactNode;
40
45
  }
@@ -143,6 +148,7 @@ export const TertiaryButton = createComponent('button')({
143
148
  variant,
144
149
  children,
145
150
  icon,
151
+ shouldMirrorIcon = false,
146
152
  allCaps,
147
153
  ...elemProps
148
154
  }: TertiaryButtonProps,
@@ -173,11 +179,21 @@ export const TertiaryButton = createComponent('button')({
173
179
  {...elemProps}
174
180
  >
175
181
  {icon && iconPosition === 'left' && (
176
- <ButtonLabelIcon size={size} iconPosition={iconPosition} icon={icon} />
182
+ <ButtonLabelIcon
183
+ size={size}
184
+ iconPosition={iconPosition}
185
+ icon={icon}
186
+ shouldMirrorIcon={shouldMirrorIcon}
187
+ />
177
188
  )}
178
189
  <ButtonLabel className="wdc-text-button-label">{children}</ButtonLabel>
179
190
  {icon && iconPosition === 'right' && (
180
- <ButtonLabelIcon size={size} iconPosition={iconPosition} icon={icon} />
191
+ <ButtonLabelIcon
192
+ size={size}
193
+ iconPosition={iconPosition}
194
+ icon={icon}
195
+ shouldMirrorIcon={shouldMirrorIcon}
196
+ />
181
197
  )}
182
198
  </ButtonContainer>
183
199
  );
@@ -48,6 +48,7 @@ export const ToolbarDropdownButton = createComponent('button')({
48
48
  // eslint-disable-next-line react-hooks/rules-of-hooks
49
49
  theme = useTheme(),
50
50
  icon,
51
+ shouldMirrorIcon = false,
51
52
  children,
52
53
  ...elemProps
53
54
  }: ToolbarDropdownButtonProps,
@@ -63,11 +64,19 @@ export const ToolbarDropdownButton = createComponent('button')({
63
64
  {...elemProps}
64
65
  >
65
66
  {icon ? (
66
- <SystemIcon className={'wdc-toolbar-dropdown-btn-custom-icon'} icon={icon} />
67
+ <SystemIcon
68
+ className={'wdc-toolbar-dropdown-btn-custom-icon'}
69
+ icon={icon}
70
+ shouldMirror={shouldMirrorIcon}
71
+ />
67
72
  ) : (
68
73
  children
69
74
  )}
70
- <SystemIcon className={'wdc-toolbar-dropdown-btn-arrow'} icon={chevronDownSmallIcon} />
75
+ <SystemIcon
76
+ className={'wdc-toolbar-dropdown-btn-arrow'}
77
+ icon={chevronDownSmallIcon}
78
+ shouldMirror={shouldMirrorIcon}
79
+ />
71
80
  </ButtonContainer>
72
81
  );
73
82
  },
@@ -39,6 +39,7 @@ export const ToolbarIconButton = createComponent('button')({
39
39
  theme = useTheme(),
40
40
  onToggleChange,
41
41
  icon,
42
+ shouldMirrorIcon = false,
42
43
  toggled,
43
44
  children,
44
45
  ...elemProps
@@ -70,7 +71,7 @@ export const ToolbarIconButton = createComponent('button')({
70
71
  aria-pressed={toggled}
71
72
  {...elemProps}
72
73
  >
73
- {icon ? <SystemIcon icon={icon} /> : children}
74
+ {icon ? <SystemIcon icon={icon} shouldMirror={shouldMirrorIcon} /> : children}
74
75
  </ButtonContainer>
75
76
  );
76
77
  },
@@ -21,6 +21,11 @@ export interface ButtonLabelIconProps {
21
21
  * @default 'left'
22
22
  */
23
23
  iconPosition?: 'left' | 'right';
24
+ /**
25
+ * If set to `true`, transform the icon's x-axis to mirror the graphic
26
+ * @default false
27
+ */
28
+ shouldMirrorIcon?: boolean;
24
29
  }
25
30
 
26
31
  const ICON_SIZE = 24;
@@ -42,7 +47,13 @@ const ButtonLabelIconStyled = styled('span', {
42
47
  })
43
48
  );
44
49
 
45
- export const ButtonLabelIcon = ({icon, size, iconPosition, ...elemProps}: ButtonLabelIconProps) => {
50
+ export const ButtonLabelIcon = ({
51
+ icon,
52
+ size,
53
+ iconPosition,
54
+ shouldMirrorIcon = false,
55
+ ...elemProps
56
+ }: ButtonLabelIconProps) => {
46
57
  /* istanbul ignore next line for coverage */
47
58
  if (icon === undefined) {
48
59
  return null;
@@ -52,7 +63,7 @@ export const ButtonLabelIcon = ({icon, size, iconPosition, ...elemProps}: Button
52
63
 
53
64
  return (
54
65
  <ButtonLabelIconStyled iconPosition={iconPosition} size={size} {...elemProps}>
55
- <SystemIcon size={iconSize} icon={icon} />
66
+ <SystemIcon size={iconSize} icon={icon} shouldMirror={shouldMirrorIcon} />
56
67
  </ButtonLabelIconStyled>
57
68
  );
58
69
  };
@@ -25,6 +25,11 @@ export interface IconButtonProps extends Themeable {
25
25
  * The icon of the IconButton.
26
26
  */
27
27
  icon?: CanvasSystemIcon;
28
+ /**
29
+ * If set to `true`, transform the icon's x-axis to mirror the graphic
30
+ * @default false
31
+ */
32
+ shouldMirrorIcon?: boolean;
28
33
  /**
29
34
  * The function called when the IconButton toggled state changes.
30
35
  */
@@ -1 +1 @@
1
- {"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAGL,SAAS,EAGV,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAI9D,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,OAAO,CAAC,EACJ,QAAQ,GACR,cAAc,GACd,OAAO,GACP,QAAQ,GACR,cAAc,GACd,SAAS,GACT,eAAe,CAAC;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,KAAK,IAAI,CAAC;IACxD,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;IACnC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,UAAU,oEA6DrB,CAAC"}
1
+ {"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAGL,SAAS,EAGV,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAI9D,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,OAAO,CAAC,EACJ,QAAQ,GACR,cAAc,GACd,OAAO,GACP,QAAQ,GACR,cAAc,GACd,SAAS,GACT,eAAe,CAAC;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,KAAK,IAAI,CAAC;IACxD,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;IACnC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,UAAU,oEA8DrB,CAAC"}
@@ -44,7 +44,7 @@ exports.IconButton = common_1.createComponent('button')({
44
44
  _c = _a.theme,
45
45
  // TODO: Fix useTheme and make it a real hook
46
46
  // eslint-disable-next-line react-hooks/rules-of-hooks
47
- theme = _c === void 0 ? common_1.useTheme() : _c, _d = _a.variant, variant = _d === void 0 ? 'circle' : _d, _e = _a.size, size = _e === void 0 ? 'medium' : _e, onToggleChange = _a.onToggleChange, icon = _a.icon, toggled = _a.toggled, children = _a.children, elemProps = __rest(_a, ["theme", "variant", "size", "onToggleChange", "icon", "toggled", "children"]);
47
+ theme = _c === void 0 ? common_1.useTheme() : _c, _d = _a.variant, variant = _d === void 0 ? 'circle' : _d, _e = _a.size, size = _e === void 0 ? 'medium' : _e, onToggleChange = _a.onToggleChange, icon = _a.icon, _f = _a.shouldMirrorIcon, shouldMirrorIcon = _f === void 0 ? false : _f, toggled = _a.toggled, children = _a.children, elemProps = __rest(_a, ["theme", "variant", "size", "onToggleChange", "icon", "shouldMirrorIcon", "toggled", "children"]);
48
48
  var isInitialMount = React.useRef(true);
49
49
  // Only call onToggleChange on update - not on first mount
50
50
  React.useEffect(function () {
@@ -63,7 +63,7 @@ exports.IconButton = common_1.createComponent('button')({
63
63
  width: size === 'small' ? '20px' : undefined,
64
64
  height: size === 'small' ? '20px' : undefined,
65
65
  }, _b));
66
- return (React.createElement(parts_1.ButtonContainer, __assign({ ref: ref, as: Element, colors: getIconButtonColors(variant, theme, toggled), size: size, fillIcon: toggled, extraStyles: containerStyles, "aria-pressed": toggled }, elemProps), icon ? React.createElement(icon_1.SystemIcon, { icon: icon }) : children));
66
+ return (React.createElement(parts_1.ButtonContainer, __assign({ ref: ref, as: Element, colors: getIconButtonColors(variant, theme, toggled), size: size, fillIcon: toggled, extraStyles: containerStyles, "aria-pressed": toggled }, elemProps), icon ? React.createElement(icon_1.SystemIcon, { icon: icon, shouldMirror: shouldMirrorIcon }) : children));
67
67
  },
68
68
  });
69
69
  var getIconButtonBorderRadius = function (variant) {
@@ -23,6 +23,11 @@ export interface PrimaryButtonProps extends Themeable, GrowthBehavior {
23
23
  * @default 'left'
24
24
  */
25
25
  iconPosition?: 'left' | 'right';
26
+ /**
27
+ * If set to `true`, transform the icon's x-axis to mirror the graphic
28
+ * @default false
29
+ */
30
+ shouldMirrorIcon?: boolean;
26
31
  children?: React.ReactNode;
27
32
  }
28
33
  export declare const PrimaryButton: import("../../common").ElementComponent<"button", PrimaryButtonProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"PrimaryButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/PrimaryButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,cAAc,EAEd,SAAS,EACT,kBAAkB,EAEnB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AAGrC,MAAM,WAAW,kBAAmB,SAAQ,SAAS,EAAE,cAAc;IACnE;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,aAAa,uEAkCxB,CAAC;AAEH,eAAO,MAAM,sBAAsB,4FAsBjC,CAAC"}
1
+ {"version":3,"file":"PrimaryButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/PrimaryButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,cAAc,EAEd,SAAS,EACT,kBAAkB,EAEnB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AAGrC,MAAM,WAAW,kBAAmB,SAAQ,SAAS,EAAE,cAAc;IACnE;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,aAAa,uEA6CxB,CAAC;AAEH,eAAO,MAAM,sBAAsB,4FAsBjC,CAAC"}
@@ -41,12 +41,12 @@ exports.PrimaryButton = common_1.createComponent('button')({
41
41
  _b = _a.theme,
42
42
  // TODO: Fix useTheme and make it a real hook
43
43
  // eslint-disable-next-line react-hooks/rules-of-hooks
44
- theme = _b === void 0 ? common_1.useTheme() : _b, _c = _a.size, size = _c === void 0 ? 'medium' : _c, _d = _a.iconPosition, iconPosition = _d === void 0 ? 'left' : _d, dataLabel = _a.dataLabel, icon = _a.icon, children = _a.children, elemProps = __rest(_a, ["theme", "size", "iconPosition", "dataLabel", "icon", "children"]);
44
+ theme = _b === void 0 ? common_1.useTheme() : _b, _c = _a.size, size = _c === void 0 ? 'medium' : _c, _d = _a.iconPosition, iconPosition = _d === void 0 ? 'left' : _d, dataLabel = _a.dataLabel, icon = _a.icon, _e = _a.shouldMirrorIcon, shouldMirrorIcon = _e === void 0 ? false : _e, children = _a.children, elemProps = __rest(_a, ["theme", "size", "iconPosition", "dataLabel", "icon", "shouldMirrorIcon", "children"]);
45
45
  return (React.createElement(parts_1.ButtonContainer, __assign({ ref: ref, as: Element, colors: exports.getPrimaryButtonColors(theme), size: size }, elemProps),
46
- icon && size !== 'small' && iconPosition === 'left' && (React.createElement(parts_1.ButtonLabelIcon, { size: size, iconPosition: iconPosition, icon: icon })),
46
+ icon && size !== 'small' && iconPosition === 'left' && (React.createElement(parts_1.ButtonLabelIcon, { size: size, iconPosition: iconPosition, icon: icon, shouldMirrorIcon: shouldMirrorIcon })),
47
47
  React.createElement(parts_1.ButtonLabel, null, children),
48
48
  dataLabel && size !== 'small' && React.createElement(parts_1.ButtonLabelData, null, dataLabel),
49
- icon && size !== 'small' && iconPosition === 'right' && (React.createElement(parts_1.ButtonLabelIcon, { size: size, iconPosition: iconPosition, icon: icon }))));
49
+ icon && size !== 'small' && iconPosition === 'right' && (React.createElement(parts_1.ButtonLabelIcon, { size: size, iconPosition: iconPosition, icon: icon, shouldMirrorIcon: shouldMirrorIcon }))));
50
50
  },
51
51
  });
52
52
  exports.getPrimaryButtonColors = function (_a) {
@@ -28,6 +28,11 @@ export interface SecondaryButtonProps extends Themeable, GrowthBehavior {
28
28
  * @default 'left'
29
29
  */
30
30
  iconPosition?: 'left' | 'right';
31
+ /**
32
+ * If set to `true`, transform the icon's x-axis to mirror the graphic
33
+ * @default false
34
+ */
35
+ shouldMirrorIcon?: boolean;
31
36
  children?: React.ReactNode;
32
37
  }
33
38
  export declare const SecondaryButton: import("../../common").ElementComponent<"button", SecondaryButtonProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"SecondaryButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/SecondaryButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EACL,cAAc,EAEd,SAAS,EACT,kBAAkB,EAGnB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AAGrC,MAAM,WAAW,oBAAqB,SAAQ,SAAS,EAAE,cAAc;IACrE;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAChC;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,eAAe,yEAmC1B,CAAC;AAEH,eAAO,MAAM,wBAAwB,6EA8FpC,CAAC"}
1
+ {"version":3,"file":"SecondaryButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/SecondaryButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EACL,cAAc,EAEd,SAAS,EACT,kBAAkB,EAGnB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AAGrC,MAAM,WAAW,oBAAqB,SAAQ,SAAS,EAAE,cAAc;IACrE;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAChC;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,eAAe,yEA8C1B,CAAC;AAEH,eAAO,MAAM,wBAAwB,6EA8FpC,CAAC"}
@@ -42,12 +42,12 @@ exports.SecondaryButton = common_1.createComponent('button')({
42
42
  _b = _a.theme,
43
43
  // TODO: Fix useTheme and make it a real hook
44
44
  // eslint-disable-next-line react-hooks/rules-of-hooks
45
- theme = _b === void 0 ? common_1.useTheme() : _b, _c = _a.size, size = _c === void 0 ? 'medium' : _c, _d = _a.iconPosition, iconPosition = _d === void 0 ? 'left' : _d, variant = _a.variant, dataLabel = _a.dataLabel, icon = _a.icon, children = _a.children, elemProps = __rest(_a, ["theme", "size", "iconPosition", "variant", "dataLabel", "icon", "children"]);
45
+ theme = _b === void 0 ? common_1.useTheme() : _b, _c = _a.size, size = _c === void 0 ? 'medium' : _c, _d = _a.iconPosition, iconPosition = _d === void 0 ? 'left' : _d, variant = _a.variant, dataLabel = _a.dataLabel, icon = _a.icon, _e = _a.shouldMirrorIcon, shouldMirrorIcon = _e === void 0 ? false : _e, children = _a.children, elemProps = __rest(_a, ["theme", "size", "iconPosition", "variant", "dataLabel", "icon", "shouldMirrorIcon", "children"]);
46
46
  return (React.createElement(parts_1.ButtonContainer, __assign({ ref: ref, as: Element, colors: exports.getSecondaryButtonColors(variant, theme), size: size }, elemProps),
47
- icon && size !== 'small' && iconPosition === 'left' && (React.createElement(parts_1.ButtonLabelIcon, { size: size, iconPosition: iconPosition, icon: icon })),
47
+ icon && size !== 'small' && iconPosition === 'left' && (React.createElement(parts_1.ButtonLabelIcon, { size: size, iconPosition: iconPosition, icon: icon, shouldMirrorIcon: shouldMirrorIcon })),
48
48
  React.createElement(parts_1.ButtonLabel, null, children),
49
49
  dataLabel && size !== 'small' && React.createElement(parts_1.ButtonLabelData, null, dataLabel),
50
- icon && size !== 'small' && iconPosition === 'right' && (React.createElement(parts_1.ButtonLabelIcon, { size: size, iconPosition: iconPosition, icon: icon }))));
50
+ icon && size !== 'small' && iconPosition === 'right' && (React.createElement(parts_1.ButtonLabelIcon, { size: size, iconPosition: iconPosition, icon: icon, shouldMirrorIcon: shouldMirrorIcon }))));
51
51
  },
52
52
  });
53
53
  exports.getSecondaryButtonColors = function (variant, theme) {
@@ -24,6 +24,11 @@ export interface TertiaryButtonProps extends Themeable {
24
24
  /**
25
25
  * The capitalization of the text in the button.
26
26
  */
27
+ /**
28
+ * If set to `true`, transform the icon's x-axis to mirror the graphic
29
+ * @default false
30
+ */
31
+ shouldMirrorIcon?: boolean;
27
32
  allCaps?: boolean;
28
33
  children?: React.ReactNode;
29
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TertiaryButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/TertiaryButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAGL,SAAS,EAGV,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAI9D,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAChC;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC1B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC;;OAEG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AA8FD,eAAO,MAAM,cAAc,wEAmDzB,CAAC"}
1
+ {"version":3,"file":"TertiaryButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/TertiaryButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAGL,SAAS,EAGV,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAI9D,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAChC;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC1B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC;;OAEG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;OAEG;IACH;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AA8FD,eAAO,MAAM,cAAc,wEA8DzB,CAAC"}
@@ -122,13 +122,13 @@ exports.TertiaryButton = common_1.createComponent('button')({
122
122
  _b = _a.theme,
123
123
  // TODO: Fix useTheme and make it a real hook
124
124
  // eslint-disable-next-line react-hooks/rules-of-hooks
125
- theme = _b === void 0 ? common_1.useTheme() : _b, _c = _a.size, size = _c === void 0 ? 'medium' : _c, _d = _a.iconPosition, iconPosition = _d === void 0 ? 'left' : _d, variant = _a.variant, children = _a.children, icon = _a.icon, allCaps = _a.allCaps, elemProps = __rest(_a, ["theme", "size", "iconPosition", "variant", "children", "icon", "allCaps"]);
125
+ theme = _b === void 0 ? common_1.useTheme() : _b, _c = _a.size, size = _c === void 0 ? 'medium' : _c, _d = _a.iconPosition, iconPosition = _d === void 0 ? 'left' : _d, variant = _a.variant, children = _a.children, icon = _a.icon, _e = _a.shouldMirrorIcon, shouldMirrorIcon = _e === void 0 ? false : _e, allCaps = _a.allCaps, elemProps = __rest(_a, ["theme", "size", "iconPosition", "variant", "children", "icon", "shouldMirrorIcon", "allCaps"]);
126
126
  // Note: We don't use ButtonLabel because the label styles differ from other button types
127
127
  var allContainerStyles = allCaps
128
128
  ? __assign(__assign({}, containerStyles), { textTransform: 'uppercase', fontWeight: tokens_1.type.properties.fontWeights.bold, fontSize: size === 'medium' ? tokens_1.type.properties.fontSizes[16] : undefined, letterSpacing: '.5px' }) : __assign(__assign({}, containerStyles), { fontSize: size === 'medium' ? tokens_1.type.properties.fontSizes[14] : undefined });
129
129
  return (React.createElement(parts_1.ButtonContainer, __assign({ ref: ref, as: Element, colors: getTertiaryButtonColors(variant, theme), size: size, extraStyles: allContainerStyles }, elemProps),
130
- icon && iconPosition === 'left' && (React.createElement(parts_1.ButtonLabelIcon, { size: size, iconPosition: iconPosition, icon: icon })),
130
+ icon && iconPosition === 'left' && (React.createElement(parts_1.ButtonLabelIcon, { size: size, iconPosition: iconPosition, icon: icon, shouldMirrorIcon: shouldMirrorIcon })),
131
131
  React.createElement(parts_1.ButtonLabel, { className: "wdc-text-button-label" }, children),
132
- icon && iconPosition === 'right' && (React.createElement(parts_1.ButtonLabelIcon, { size: size, iconPosition: iconPosition, icon: icon }))));
132
+ icon && iconPosition === 'right' && (React.createElement(parts_1.ButtonLabelIcon, { size: size, iconPosition: iconPosition, icon: icon, shouldMirrorIcon: shouldMirrorIcon }))));
133
133
  },
134
134
  });
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarDropdownButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/ToolbarDropdownButton.tsx"],"names":[],"mappings":"AAGA,OAAO,EAGL,SAAS,EAGV,MAAM,kCAAkC,CAAC;AAK1C,OAAO,EAAC,sBAAsB,EAAC,MAAM,qBAAqB,CAAC;AAE3D,MAAM,WAAW,0BACf,SAAQ,IAAI,CAAC,sBAAsB,EAAE,SAAS,GAAG,gBAAgB,CAAC,EAChE,SAAS;CAAG;AAwBhB,eAAO,MAAM,qBAAqB,+EA+BhC,CAAC"}
1
+ {"version":3,"file":"ToolbarDropdownButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/ToolbarDropdownButton.tsx"],"names":[],"mappings":"AAGA,OAAO,EAGL,SAAS,EAGV,MAAM,kCAAkC,CAAC;AAK1C,OAAO,EAAC,sBAAsB,EAAC,MAAM,qBAAqB,CAAC;AAE3D,MAAM,WAAW,0BACf,SAAQ,IAAI,CAAC,sBAAsB,EAAE,SAAS,GAAG,gBAAgB,CAAC,EAChE,SAAS;CAAG;AAwBhB,eAAO,MAAM,qBAAqB,+EAwChC,CAAC"}
@@ -59,10 +59,10 @@ exports.ToolbarDropdownButton = common_1.createComponent('button')({
59
59
  _b = _a.theme,
60
60
  // TODO: Fix useTheme and make it a real hook
61
61
  // eslint-disable-next-line react-hooks/rules-of-hooks
62
- theme = _b === void 0 ? common_1.useTheme() : _b, icon = _a.icon, children = _a.children, elemProps = __rest(_a, ["theme", "icon", "children"]);
62
+ theme = _b === void 0 ? common_1.useTheme() : _b, icon = _a.icon, _c = _a.shouldMirrorIcon, shouldMirrorIcon = _c === void 0 ? false : _c, children = _a.children, elemProps = __rest(_a, ["theme", "icon", "shouldMirrorIcon", "children"]);
63
63
  return (core_1.jsx(parts_1.ButtonContainer, __assign({ ref: ref, as: Element, colors: getToolbarDropdownButtonColors(theme), extraStyles: containerStyles }, elemProps),
64
- icon ? (core_1.jsx(icon_1.SystemIcon, { className: 'wdc-toolbar-dropdown-btn-custom-icon', icon: icon })) : (children),
65
- core_1.jsx(icon_1.SystemIcon, { className: 'wdc-toolbar-dropdown-btn-arrow', icon: canvas_system_icons_web_1.chevronDownSmallIcon })));
64
+ icon ? (core_1.jsx(icon_1.SystemIcon, { className: 'wdc-toolbar-dropdown-btn-custom-icon', icon: icon, shouldMirror: shouldMirrorIcon })) : (children),
65
+ core_1.jsx(icon_1.SystemIcon, { className: 'wdc-toolbar-dropdown-btn-arrow', icon: canvas_system_icons_web_1.chevronDownSmallIcon, shouldMirror: shouldMirrorIcon })));
66
66
  },
67
67
  });
68
68
  var getToolbarDropdownButtonColors = function (theme) {
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarIconButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/ToolbarIconButton.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,SAAS,EAGV,MAAM,kCAAkC,CAAC;AAI1C,OAAO,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAE7C,MAAM,WAAW,sBACf,SAAQ,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC,EAC/C,SAAS;CAAG;AAgBhB,eAAO,MAAM,iBAAiB,2EA4C5B,CAAC"}
1
+ {"version":3,"file":"ToolbarIconButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/ToolbarIconButton.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,SAAS,EAGV,MAAM,kCAAkC,CAAC;AAI1C,OAAO,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAE7C,MAAM,WAAW,sBACf,SAAQ,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC,EAC/C,SAAS;CAAG;AAgBhB,eAAO,MAAM,iBAAiB,2EA6C5B,CAAC"}
@@ -58,7 +58,7 @@ exports.ToolbarIconButton = common_1.createComponent('button')({
58
58
  _b = _a.theme,
59
59
  // TODO: Fix useTheme and make it a real hook
60
60
  // eslint-disable-next-line react-hooks/rules-of-hooks
61
- theme = _b === void 0 ? common_1.useTheme() : _b, onToggleChange = _a.onToggleChange, icon = _a.icon, toggled = _a.toggled, children = _a.children, elemProps = __rest(_a, ["theme", "onToggleChange", "icon", "toggled", "children"]);
61
+ theme = _b === void 0 ? common_1.useTheme() : _b, onToggleChange = _a.onToggleChange, icon = _a.icon, _c = _a.shouldMirrorIcon, shouldMirrorIcon = _c === void 0 ? false : _c, toggled = _a.toggled, children = _a.children, elemProps = __rest(_a, ["theme", "onToggleChange", "icon", "shouldMirrorIcon", "toggled", "children"]);
62
62
  var isInitialMount = React.useRef(true);
63
63
  // Only call onToggleChange on update - not on first mount
64
64
  React.useEffect(function () {
@@ -71,7 +71,7 @@ exports.ToolbarIconButton = common_1.createComponent('button')({
71
71
  }
72
72
  }
73
73
  }, [toggled, onToggleChange]);
74
- return (React.createElement(parts_1.ButtonContainer, __assign({ ref: ref, as: Element, colors: getToolbarIconButtonColors(theme, toggled), size: 'small', fillIcon: toggled, extraStyles: containerStyles, "aria-pressed": toggled }, elemProps), icon ? React.createElement(icon_1.SystemIcon, { icon: icon }) : children));
74
+ return (React.createElement(parts_1.ButtonContainer, __assign({ ref: ref, as: Element, colors: getToolbarIconButtonColors(theme, toggled), size: 'small', fillIcon: toggled, extraStyles: containerStyles, "aria-pressed": toggled }, elemProps), icon ? React.createElement(icon_1.SystemIcon, { icon: icon, shouldMirror: shouldMirrorIcon }) : children));
75
75
  },
76
76
  });
77
77
  var getToolbarIconButtonColors = function (theme, toggled) {
@@ -15,6 +15,11 @@ export interface ButtonLabelIconProps {
15
15
  * @default 'left'
16
16
  */
17
17
  iconPosition?: 'left' | 'right';
18
+ /**
19
+ * If set to `true`, transform the icon's x-axis to mirror the graphic
20
+ * @default false
21
+ */
22
+ shouldMirrorIcon?: boolean;
18
23
  }
19
- export declare const ButtonLabelIcon: ({ icon, size, iconPosition, ...elemProps }: ButtonLabelIconProps) => JSX.Element | null;
24
+ export declare const ButtonLabelIcon: ({ icon, size, iconPosition, shouldMirrorIcon, ...elemProps }: ButtonLabelIconProps) => JSX.Element | null;
20
25
  //# sourceMappingURL=ButtonLabelIcon.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonLabelIcon.d.ts","sourceRoot":"","sources":["../../../../../button/lib/parts/ButtonLabelIcon.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAM9D,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC;;;OAGG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACjC;AAqBD,eAAO,MAAM,eAAe,0FAa3B,CAAC"}
1
+ {"version":3,"file":"ButtonLabelIcon.d.ts","sourceRoot":"","sources":["../../../../../button/lib/parts/ButtonLabelIcon.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAM9D,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC;;;OAGG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAqBD,eAAO,MAAM,eAAe,4GAmB3B,CAAC"}
@@ -57,12 +57,12 @@ var ButtonLabelIconStyled = common_1.styled('span', {
57
57
  });
58
58
  });
59
59
  exports.ButtonLabelIcon = function (_a) {
60
- var icon = _a.icon, size = _a.size, iconPosition = _a.iconPosition, elemProps = __rest(_a, ["icon", "size", "iconPosition"]);
60
+ var icon = _a.icon, size = _a.size, iconPosition = _a.iconPosition, _b = _a.shouldMirrorIcon, shouldMirrorIcon = _b === void 0 ? false : _b, elemProps = __rest(_a, ["icon", "size", "iconPosition", "shouldMirrorIcon"]);
61
61
  /* istanbul ignore next line for coverage */
62
62
  if (icon === undefined) {
63
63
  return null;
64
64
  }
65
65
  var iconSize = size === 'small' ? SMALL_ICON_SIZE : undefined;
66
66
  return (React.createElement(ButtonLabelIconStyled, __assign({ iconPosition: iconPosition, size: size }, elemProps),
67
- React.createElement(icon_1.SystemIcon, { size: iconSize, icon: icon })));
67
+ React.createElement(icon_1.SystemIcon, { size: iconSize, icon: icon, shouldMirror: shouldMirrorIcon })));
68
68
  };
@@ -1 +1 @@
1
- {"version":3,"file":"AccentIcon.d.ts","sourceRoot":"","sources":["../../../../icon/lib/AccentIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,gBAAgB,EAAkB,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AACxC,OAAa,EAAC,SAAS,EAAC,MAAM,QAAQ,CAAC;AAEvC,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;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,0DAU3B,CAAC;AAEH,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,KAAK,CAAC,SAAS,CAAC,eAAe,CAAC;IACtE,MAAM;CAcP"}
1
+ {"version":3,"file":"AccentIcon.d.ts","sourceRoot":"","sources":["../../../../icon/lib/AccentIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,gBAAgB,EAAkB,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AACxC,OAAa,EAAC,SAAS,EAAC,MAAM,QAAQ,CAAC;AAEvC,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;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,0DAU3B,CAAC;AAEH,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,KAAK,CAAC,SAAS,CAAC,eAAe,CAAC;IACtE,MAAM;CAuBP"}
@@ -66,8 +66,8 @@ var AccentIcon = /** @class */ (function (_super) {
66
66
  return _super !== null && _super.apply(this, arguments) || this;
67
67
  }
68
68
  AccentIcon.prototype.render = function () {
69
- var _a = this.props, _b = _a.transparent, transparent = _b === void 0 ? false : _b, _c = _a.size, size = _c === void 0 ? 56 : _c, icon = _a.icon, color = _a.color, iconRef = _a.iconRef, elemProps = __rest(_a, ["transparent", "size", "icon", "color", "iconRef"]);
70
- return (React.createElement(Icon_1.default, __assign({ src: icon, type: design_assets_types_1.CanvasIconTypes.Accent, styles: exports.accentIconStyles({ color: color, transparent: transparent }), size: size, iconRef: iconRef }, elemProps)));
69
+ var _a = this.props, _b = _a.transparent, transparent = _b === void 0 ? false : _b, _c = _a.size, size = _c === void 0 ? 56 : _c, icon = _a.icon, color = _a.color, iconRef = _a.iconRef, shouldMirror = _a.shouldMirror, elemProps = __rest(_a, ["transparent", "size", "icon", "color", "iconRef", "shouldMirror"]);
70
+ return (React.createElement(Icon_1.default, __assign({ src: icon, type: design_assets_types_1.CanvasIconTypes.Accent, styles: exports.accentIconStyles({ color: color, transparent: transparent }), size: size, iconRef: iconRef, shouldMirror: shouldMirror }, elemProps)));
71
71
  };
72
72
  return AccentIcon;
73
73
  }(React.Component));
@@ -11,7 +11,7 @@ export interface AppletIconStyles {
11
11
  color?: BrandingColor;
12
12
  }
13
13
  export declare const appletIconStyles: ({ color, }: AppletIconStyles) => CSSObject;
14
- export interface AppletIconProps extends AppletIconStyles, Pick<IconProps, 'iconRef'> {
14
+ export interface AppletIconProps extends AppletIconStyles, Pick<IconProps, 'iconRef' | 'shouldMirror'> {
15
15
  /**
16
16
  * The icon to display from `@workday/canvas-applet-icons-web`.
17
17
  */
@@ -1 +1 @@
1
- {"version":3,"file":"AppletIcon.d.ts","sourceRoot":"","sources":["../../../../icon/lib/AppletIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAS,aAAa,EAAc,MAAM,kCAAkC,CAAC;AACpF,OAAO,EAAC,gBAAgB,EAAkB,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AACxC,OAAa,EAAC,SAAS,EAAC,MAAM,QAAQ,CAAC;AAEvC,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,eAAO,MAAM,gBAAgB,6CAwC5B,CAAC;AAEF,MAAM,WAAW,eAAgB,SAAQ,gBAAgB,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC;IACnF;;OAEG;IACH,IAAI,EAAE,gBAAgB,CAAC;IACvB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,KAAK,CAAC,SAAS,CAAC,eAAe,CAAC;IACtE,OAAc,MAAM,uBAAiB;IAE9B,MAAM;CAcd"}
1
+ {"version":3,"file":"AppletIcon.d.ts","sourceRoot":"","sources":["../../../../icon/lib/AppletIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAS,aAAa,EAAc,MAAM,kCAAkC,CAAC;AACpF,OAAO,EAAC,gBAAgB,EAAkB,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AACxC,OAAa,EAAC,SAAS,EAAC,MAAM,QAAQ,CAAC;AAEvC,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,eAAO,MAAM,gBAAgB,6CAwC5B,CAAC;AAEF,MAAM,WAAW,eACf,SAAQ,gBAAgB,EACtB,IAAI,CAAC,SAAS,EAAE,SAAS,GAAG,cAAc,CAAC;IAC7C;;OAEG;IACH,IAAI,EAAE,gBAAgB,CAAC;IACvB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,KAAK,CAAC,SAAS,CAAC,eAAe,CAAC;IACtE,OAAc,MAAM,uBAAiB;IAE9B,MAAM;CAed"}
@@ -91,8 +91,8 @@ var AppletIcon = /** @class */ (function (_super) {
91
91
  return _super !== null && _super.apply(this, arguments) || this;
92
92
  }
93
93
  AppletIcon.prototype.render = function () {
94
- var _a = this.props, _b = _a.size, size = _b === void 0 ? 92 : _b, icon = _a.icon, color = _a.color, iconRef = _a.iconRef, elemProps = __rest(_a, ["size", "icon", "color", "iconRef"]);
95
- return (React.createElement(Icon_1.default, __assign({ src: icon, type: design_assets_types_1.CanvasIconTypes.Applet, styles: exports.appletIconStyles({ color: color }), size: size, iconRef: iconRef }, elemProps)));
94
+ var _a = this.props, _b = _a.size, size = _b === void 0 ? 92 : _b, icon = _a.icon, color = _a.color, iconRef = _a.iconRef, shouldMirror = _a.shouldMirror, elemProps = __rest(_a, ["size", "icon", "color", "iconRef", "shouldMirror"]);
95
+ return (React.createElement(Icon_1.default, __assign({ src: icon, type: design_assets_types_1.CanvasIconTypes.Applet, styles: exports.appletIconStyles({ color: color }), size: size, iconRef: iconRef, shouldMirror: shouldMirror }, elemProps)));
96
96
  };
97
97
  AppletIcon.Colors = tokens_1.BrandingColor;
98
98
  return AppletIcon;
@@ -19,7 +19,7 @@ export interface GraphicStyles {
19
19
  */
20
20
  grow?: boolean;
21
21
  }
22
- export interface GraphicProps extends GraphicStyles, Pick<SvgProps, 'iconRef'> {
22
+ export interface GraphicProps extends GraphicStyles, Pick<SvgProps, 'iconRef' | 'shouldMirror'> {
23
23
  /**
24
24
  * The graphic to display from `@workday/canvas-graphics-web`.
25
25
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Graphic.d.ts","sourceRoot":"","sources":["../../../../icon/lib/Graphic.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,aAAa,EAAkB,MAAM,8BAA8B,CAAC;AAC5E,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AACxC,OAAY,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AAEpC,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,SAAS,CAAC;IAC5E;;OAEG;IACH,GAAG,EAAE,aAAa,CAAC;CACpB;AAED,eAAO,MAAM,aAAa,uDA4BzB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC;IAChE,MAAM;CAaP"}
1
+ {"version":3,"file":"Graphic.d.ts","sourceRoot":"","sources":["../../../../icon/lib/Graphic.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,aAAa,EAAkB,MAAM,8BAA8B,CAAC;AAC5E,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AACxC,OAAY,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AAEpC,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,SAAS,GAAG,cAAc,CAAC;IAC7F;;OAEG;IACH,GAAG,EAAE,aAAa,CAAC;CACpB;AAED,eAAO,MAAM,aAAa,uDA4BzB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC;IAChE,MAAM;CAcP"}
@@ -83,8 +83,8 @@ var Graphic = /** @class */ (function (_super) {
83
83
  return _super !== null && _super.apply(this, arguments) || this;
84
84
  }
85
85
  Graphic.prototype.render = function () {
86
- var _a = this.props, _b = _a.grow, grow = _b === void 0 ? false : _b, src = _a.src, width = _a.width, height = _a.height, iconRef = _a.iconRef, elemProps = __rest(_a, ["grow", "src", "width", "height", "iconRef"]);
87
- return (React.createElement(Svg_1.default, __assign({ src: src, styles: exports.graphicStyles({ width: width, height: height, grow: grow }), type: design_assets_types_1.CanvasIconTypes.Graphic, iconRef: iconRef }, elemProps)));
86
+ var _a = this.props, _b = _a.grow, grow = _b === void 0 ? false : _b, src = _a.src, width = _a.width, height = _a.height, iconRef = _a.iconRef, shouldMirror = _a.shouldMirror, elemProps = __rest(_a, ["grow", "src", "width", "height", "iconRef", "shouldMirror"]);
87
+ return (React.createElement(Svg_1.default, __assign({ src: src, styles: exports.graphicStyles({ width: width, height: height, grow: grow }), type: design_assets_types_1.CanvasIconTypes.Graphic, iconRef: iconRef, shouldMirror: shouldMirror }, elemProps)));
88
88
  };
89
89
  return Graphic;
90
90
  }(React.Component));