@workday/canvas-kit-react 7.0.0-alpha.100-next.25 → 7.0.0-alpha.103-next.28

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.
package/button/index.ts CHANGED
@@ -10,4 +10,5 @@ export {ToolbarIconButton, ToolbarIconButtonProps} from './lib/ToolbarIconButton
10
10
  export {ToolbarDropdownButton, ToolbarDropdownButtonProps} from './lib/ToolbarDropdownButton';
11
11
  export {Hyperlink, HyperlinkProps} from './lib/Hyperlink';
12
12
  export {BaseButton, ButtonContainerProps} from './lib/BaseButton';
13
+ export {ExternalHyperlink, ExternalHyperlinkProps} from './lib/ExternalHyperlink';
13
14
  export * from './lib/types';
@@ -0,0 +1,59 @@
1
+ import React from 'react';
2
+ import {styled, createComponent, StyledType} from '@workday/canvas-kit-react/common';
3
+ import {extLinkIcon} from '@workday/canvas-system-icons-web';
4
+ import {SystemIcon, systemIconStyles} from '@workday/canvas-kit-react/icon';
5
+ import {Hyperlink, HyperlinkProps} from './Hyperlink';
6
+
7
+ export interface ExternalHyperlinkProps extends HyperlinkProps {
8
+ /**
9
+ * Informs a screen reader user the link will open in a new window. It is read after the link text.
10
+ * This value will need to be translated.
11
+ * @default 'Opens link in new window'
12
+ */
13
+ iconLabel?: string;
14
+ }
15
+
16
+ const iconStyles = {
17
+ ...systemIconStyles({fill: 'currentColor', fillHover: 'currentColor'}),
18
+ };
19
+
20
+ const Anchor = styled(Hyperlink)<ExternalHyperlinkProps & StyledType>({
21
+ ...iconStyles,
22
+ display: 'inline-flex',
23
+ flexDirection: 'row',
24
+ alignItems: 'center',
25
+ });
26
+
27
+ const iconSize = '1em';
28
+ const minIconSize = '16px';
29
+
30
+ const StyledSystemIcon = styled(SystemIcon)<StyledType>({
31
+ ...iconStyles,
32
+ width: `calc(${iconSize} - 1px)`,
33
+ minWidth: `calc(${minIconSize} - 1px)`,
34
+ marginLeft: '2px',
35
+ });
36
+
37
+ export const ExternalHyperlink = createComponent('a')({
38
+ displayName: 'ExternalHyperlink',
39
+ Component: (
40
+ {
41
+ children,
42
+ variant,
43
+ iconLabel = 'Opens link in new window',
44
+ ...elemProps
45
+ }: ExternalHyperlinkProps,
46
+ ref
47
+ ) => (
48
+ <Anchor ref={ref} target="_blank" rel="noreferrer" variant={variant} {...elemProps}>
49
+ <span>{children}</span>
50
+ <StyledSystemIcon
51
+ icon={extLinkIcon}
52
+ role="img"
53
+ aria-label={iconLabel}
54
+ size={iconSize}
55
+ styles={{['& svg']: {minWidth: minIconSize, minHeight: minIconSize}}}
56
+ />
57
+ </Anchor>
58
+ ),
59
+ });
@@ -7,5 +7,6 @@ export { ToolbarIconButton, ToolbarIconButtonProps } from './lib/ToolbarIconButt
7
7
  export { ToolbarDropdownButton, ToolbarDropdownButtonProps } from './lib/ToolbarDropdownButton';
8
8
  export { Hyperlink, HyperlinkProps } from './lib/Hyperlink';
9
9
  export { BaseButton, ButtonContainerProps } from './lib/BaseButton';
10
+ export { ExternalHyperlink, ExternalHyperlinkProps } from './lib/ExternalHyperlink';
10
11
  export * from './lib/types';
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAC,eAAe,EAAE,oBAAoB,EAAC,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAC,cAAc,EAAE,mBAAmB,EAAC,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAC,YAAY,EAAE,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AACnE,OAAO,EACL,gBAAgB,IAAI,iBAAiB,EACrC,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,iBAAiB,EAAE,sBAAsB,EAAC,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAC,qBAAqB,EAAE,0BAA0B,EAAC,MAAM,6BAA6B,CAAC;AAC9F,OAAO,EAAC,SAAS,EAAE,cAAc,EAAC,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAC,UAAU,EAAE,oBAAoB,EAAC,MAAM,kBAAkB,CAAC;AAClE,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAC,eAAe,EAAE,oBAAoB,EAAC,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAC,cAAc,EAAE,mBAAmB,EAAC,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAC,YAAY,EAAE,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AACnE,OAAO,EACL,gBAAgB,IAAI,iBAAiB,EACrC,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,iBAAiB,EAAE,sBAAsB,EAAC,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAC,qBAAqB,EAAE,0BAA0B,EAAC,MAAM,6BAA6B,CAAC;AAC9F,OAAO,EAAC,SAAS,EAAE,cAAc,EAAC,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAC,UAAU,EAAE,oBAAoB,EAAC,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAC,iBAAiB,EAAE,sBAAsB,EAAC,MAAM,yBAAyB,CAAC;AAClF,cAAc,aAAa,CAAC"}
@@ -10,7 +10,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.BaseButton = exports.Hyperlink = exports.ToolbarDropdownButton = exports.ToolbarIconButton = exports.deprecated_Button = exports.DeleteButton = exports.TertiaryButton = exports.SecondaryButton = exports.PrimaryButton = void 0;
13
+ exports.ExternalHyperlink = exports.BaseButton = exports.Hyperlink = exports.ToolbarDropdownButton = exports.ToolbarIconButton = exports.deprecated_Button = exports.DeleteButton = exports.TertiaryButton = exports.SecondaryButton = exports.PrimaryButton = void 0;
14
14
  var PrimaryButton_1 = require("./lib/PrimaryButton");
15
15
  Object.defineProperty(exports, "PrimaryButton", { enumerable: true, get: function () { return PrimaryButton_1.PrimaryButton; } });
16
16
  var SecondaryButton_1 = require("./lib/SecondaryButton");
@@ -29,4 +29,6 @@ var Hyperlink_1 = require("./lib/Hyperlink");
29
29
  Object.defineProperty(exports, "Hyperlink", { enumerable: true, get: function () { return Hyperlink_1.Hyperlink; } });
30
30
  var BaseButton_1 = require("./lib/BaseButton");
31
31
  Object.defineProperty(exports, "BaseButton", { enumerable: true, get: function () { return BaseButton_1.BaseButton; } });
32
+ var ExternalHyperlink_1 = require("./lib/ExternalHyperlink");
33
+ Object.defineProperty(exports, "ExternalHyperlink", { enumerable: true, get: function () { return ExternalHyperlink_1.ExternalHyperlink; } });
32
34
  __exportStar(require("./lib/types"), exports);
@@ -0,0 +1,11 @@
1
+ import { HyperlinkProps } from './Hyperlink';
2
+ export interface ExternalHyperlinkProps extends HyperlinkProps {
3
+ /**
4
+ * Informs a screen reader user the link will open in a new window. It is read after the link text.
5
+ * This value will need to be translated.
6
+ * @default 'Opens link in new window'
7
+ */
8
+ iconLabel?: string;
9
+ }
10
+ export declare const ExternalHyperlink: import("../../common").ElementComponent<"a", ExternalHyperlinkProps>;
11
+ //# sourceMappingURL=ExternalHyperlink.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExternalHyperlink.d.ts","sourceRoot":"","sources":["../../../../button/lib/ExternalHyperlink.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAY,cAAc,EAAC,MAAM,aAAa,CAAC;AAEtD,MAAM,WAAW,sBAAuB,SAAQ,cAAc;IAC5D;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAuBD,eAAO,MAAM,iBAAiB,sEAsB5B,CAAC"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
24
+ var __importDefault = (this && this.__importDefault) || function (mod) {
25
+ return (mod && mod.__esModule) ? mod : { "default": mod };
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ exports.ExternalHyperlink = void 0;
29
+ var react_1 = __importDefault(require("react"));
30
+ var common_1 = require("@workday/canvas-kit-react/common");
31
+ var canvas_system_icons_web_1 = require("@workday/canvas-system-icons-web");
32
+ var icon_1 = require("@workday/canvas-kit-react/icon");
33
+ var Hyperlink_1 = require("./Hyperlink");
34
+ var iconStyles = __assign({}, icon_1.systemIconStyles({ fill: 'currentColor', fillHover: 'currentColor' }));
35
+ var Anchor = common_1.styled(Hyperlink_1.Hyperlink)(__assign(__assign({}, iconStyles), { display: 'inline-flex', flexDirection: 'row', alignItems: 'center' }));
36
+ var iconSize = '1em';
37
+ var minIconSize = '16px';
38
+ var StyledSystemIcon = common_1.styled(icon_1.SystemIcon)(__assign(__assign({}, iconStyles), { width: "calc(" + iconSize + " - 1px)", minWidth: "calc(" + minIconSize + " - 1px)", marginLeft: '2px' }));
39
+ exports.ExternalHyperlink = common_1.createComponent('a')({
40
+ displayName: 'ExternalHyperlink',
41
+ Component: function (_a, ref) {
42
+ var _b;
43
+ var children = _a.children, variant = _a.variant, _c = _a.iconLabel, iconLabel = _c === void 0 ? 'Opens link in new window' : _c, elemProps = __rest(_a, ["children", "variant", "iconLabel"]);
44
+ return (react_1.default.createElement(Anchor, __assign({ ref: ref, target: "_blank", rel: "noreferrer", variant: variant }, elemProps),
45
+ react_1.default.createElement("span", null, children),
46
+ react_1.default.createElement(StyledSystemIcon, { icon: canvas_system_icons_web_1.extLinkIcon, role: "img", "aria-label": iconLabel, size: iconSize, styles: (_b = {}, _b['& svg'] = { minWidth: minIconSize, minHeight: minIconSize }, _b) })));
47
+ },
48
+ });
@@ -2,7 +2,7 @@ import { CanvasIcon, CanvasIconTypes } from '@workday/design-assets-types';
2
2
  import { SvgProps } from './Svg';
3
3
  export interface IconProps extends SvgProps {
4
4
  src: CanvasIcon;
5
- size?: number;
5
+ size?: number | string;
6
6
  type: CanvasIconTypes.Accent | CanvasIconTypes.Applet | CanvasIconTypes.System;
7
7
  }
8
8
  export declare const Icon: import("../../common").ElementComponent<"span", IconProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../icon/lib/Icon.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAC,UAAU,EAAE,eAAe,EAAC,MAAM,8BAA8B,CAAC;AACzE,OAAY,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AAGpC,MAAM,WAAW,SAAU,SAAQ,QAAQ;IACzC,GAAG,EAAE,UAAU,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,eAAe,CAAC,MAAM,GAAG,eAAe,CAAC,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC;CAChF;AAED,eAAO,MAAM,IAAI,4DAwBf,CAAC;AAEH,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../icon/lib/Icon.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAC,UAAU,EAAE,eAAe,EAAC,MAAM,8BAA8B,CAAC;AACzE,OAAY,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AAGpC,MAAM,WAAW,SAAU,SAAQ,QAAQ;IACzC,GAAG,EAAE,UAAU,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,IAAI,EAAE,eAAe,CAAC,MAAM,GAAG,eAAe,CAAC,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC;CAChF;AAED,eAAO,MAAM,IAAI,4DAyBf,CAAC;AAEH,eAAe,IAAI,CAAC"}
@@ -51,13 +51,11 @@ var common_1 = require("@workday/canvas-kit-react/common");
51
51
  exports.Icon = common_1.createComponent('span')({
52
52
  displayName: 'Icon',
53
53
  Component: function (_a, ref, Element) {
54
+ var _b;
54
55
  var src = _a.src, size = _a.size, styles = _a.styles, type = _a.type, shouldMirror = _a.shouldMirror, elemProps = __rest(_a, ["src", "size", "styles", "type", "shouldMirror"]);
55
56
  var iconStyles = __assign({}, styles);
56
57
  if (size) {
57
- iconStyles['& svg'] = {
58
- width: size,
59
- height: size,
60
- };
58
+ iconStyles['& svg'] = __assign(__assign({}, ((_b = iconStyles['& svg']) !== null && _b !== void 0 ? _b : {})), { width: size, height: size });
61
59
  }
62
60
  return (React.createElement(Svg_1.default, __assign({ src: src, type: type, shouldMirror: shouldMirror, as: Element }, elemProps, { ref: ref, styles: iconStyles })));
63
61
  },
@@ -47,7 +47,7 @@ export interface SystemIconProps extends SystemIconStyles, Omit<IconProps, 'src'
47
47
  /**
48
48
  * The size of the SystemIcon in `px`.
49
49
  */
50
- size?: number | undefined;
50
+ size?: number | string | undefined;
51
51
  className?: string;
52
52
  }
53
53
  export declare const systemIconStyles: ({ accent, accentHover, background, backgroundHover, color, colorHover, fill, fillHover, }: SystemIconStyles) => CSSObject;
@@ -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,OAAa,EAAC,SAAS,EAAC,MAAM,QAAQ,CAAC;AAGvC,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eACf,SAAQ,gBAAgB,EACtB,IAAI,CAAC,SAAS,EAAE,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,YAAY,CAAC;IAC1D;;OAEG;IACH,IAAI,EAAE,gBAAgB,CAAC;IACvB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,gBAAgB,8FAS1B,gBAAgB,KAAG,SAmBpB,CAAC;AAEH,QAAA,MAAM,UAAU,kEA4Cd,CAAC;AAEH,eAAe,UAAU,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;AAC1C,OAAa,EAAC,SAAS,EAAC,MAAM,QAAQ,CAAC;AAGvC,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eACf,SAAQ,gBAAgB,EACtB,IAAI,CAAC,SAAS,EAAE,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,YAAY,CAAC;IAC1D;;OAEG;IACH,IAAI,EAAE,gBAAgB,CAAC;IACvB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,gBAAgB,8FAS1B,gBAAgB,KAAG,SAmBpB,CAAC;AAEH,QAAA,MAAM,UAAU,kEA4Cd,CAAC;AAEH,eAAe,UAAU,CAAC"}
@@ -7,5 +7,6 @@ export { ToolbarIconButton, ToolbarIconButtonProps } from './lib/ToolbarIconButt
7
7
  export { ToolbarDropdownButton, ToolbarDropdownButtonProps } from './lib/ToolbarDropdownButton';
8
8
  export { Hyperlink, HyperlinkProps } from './lib/Hyperlink';
9
9
  export { BaseButton, ButtonContainerProps } from './lib/BaseButton';
10
+ export { ExternalHyperlink, ExternalHyperlinkProps } from './lib/ExternalHyperlink';
10
11
  export * from './lib/types';
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAC,eAAe,EAAE,oBAAoB,EAAC,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAC,cAAc,EAAE,mBAAmB,EAAC,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAC,YAAY,EAAE,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AACnE,OAAO,EACL,gBAAgB,IAAI,iBAAiB,EACrC,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,iBAAiB,EAAE,sBAAsB,EAAC,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAC,qBAAqB,EAAE,0BAA0B,EAAC,MAAM,6BAA6B,CAAC;AAC9F,OAAO,EAAC,SAAS,EAAE,cAAc,EAAC,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAC,UAAU,EAAE,oBAAoB,EAAC,MAAM,kBAAkB,CAAC;AAClE,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAC,eAAe,EAAE,oBAAoB,EAAC,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAC,cAAc,EAAE,mBAAmB,EAAC,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAC,YAAY,EAAE,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AACnE,OAAO,EACL,gBAAgB,IAAI,iBAAiB,EACrC,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,iBAAiB,EAAE,sBAAsB,EAAC,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAC,qBAAqB,EAAE,0BAA0B,EAAC,MAAM,6BAA6B,CAAC;AAC9F,OAAO,EAAC,SAAS,EAAE,cAAc,EAAC,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAC,UAAU,EAAE,oBAAoB,EAAC,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAC,iBAAiB,EAAE,sBAAsB,EAAC,MAAM,yBAAyB,CAAC;AAClF,cAAc,aAAa,CAAC"}
@@ -7,4 +7,5 @@ export { ToolbarIconButton } from './lib/ToolbarIconButton';
7
7
  export { ToolbarDropdownButton } from './lib/ToolbarDropdownButton';
8
8
  export { Hyperlink } from './lib/Hyperlink';
9
9
  export { BaseButton } from './lib/BaseButton';
10
+ export { ExternalHyperlink } from './lib/ExternalHyperlink';
10
11
  export * from './lib/types';
@@ -0,0 +1,11 @@
1
+ import { HyperlinkProps } from './Hyperlink';
2
+ export interface ExternalHyperlinkProps extends HyperlinkProps {
3
+ /**
4
+ * Informs a screen reader user the link will open in a new window. It is read after the link text.
5
+ * This value will need to be translated.
6
+ * @default 'Opens link in new window'
7
+ */
8
+ iconLabel?: string;
9
+ }
10
+ export declare const ExternalHyperlink: import("../../common").ElementComponent<"a", ExternalHyperlinkProps>;
11
+ //# sourceMappingURL=ExternalHyperlink.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExternalHyperlink.d.ts","sourceRoot":"","sources":["../../../../button/lib/ExternalHyperlink.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAY,cAAc,EAAC,MAAM,aAAa,CAAC;AAEtD,MAAM,WAAW,sBAAuB,SAAQ,cAAc;IAC5D;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAuBD,eAAO,MAAM,iBAAiB,sEAsB5B,CAAC"}
@@ -0,0 +1,42 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import React from 'react';
24
+ import { styled, createComponent } from '@workday/canvas-kit-react/common';
25
+ import { extLinkIcon } from '@workday/canvas-system-icons-web';
26
+ import { SystemIcon, systemIconStyles } from '@workday/canvas-kit-react/icon';
27
+ import { Hyperlink } from './Hyperlink';
28
+ var iconStyles = __assign({}, systemIconStyles({ fill: 'currentColor', fillHover: 'currentColor' }));
29
+ var Anchor = styled(Hyperlink)(__assign(__assign({}, iconStyles), { display: 'inline-flex', flexDirection: 'row', alignItems: 'center' }));
30
+ var iconSize = '1em';
31
+ var minIconSize = '16px';
32
+ var StyledSystemIcon = styled(SystemIcon)(__assign(__assign({}, iconStyles), { width: "calc(" + iconSize + " - 1px)", minWidth: "calc(" + minIconSize + " - 1px)", marginLeft: '2px' }));
33
+ export var ExternalHyperlink = createComponent('a')({
34
+ displayName: 'ExternalHyperlink',
35
+ Component: function (_a, ref) {
36
+ var _b;
37
+ var children = _a.children, variant = _a.variant, _c = _a.iconLabel, iconLabel = _c === void 0 ? 'Opens link in new window' : _c, elemProps = __rest(_a, ["children", "variant", "iconLabel"]);
38
+ return (React.createElement(Anchor, __assign({ ref: ref, target: "_blank", rel: "noreferrer", variant: variant }, elemProps),
39
+ React.createElement("span", null, children),
40
+ React.createElement(StyledSystemIcon, { icon: extLinkIcon, role: "img", "aria-label": iconLabel, size: iconSize, styles: (_b = {}, _b['& svg'] = { minWidth: minIconSize, minHeight: minIconSize }, _b) })));
41
+ },
42
+ });
@@ -2,7 +2,7 @@ import { CanvasIcon, CanvasIconTypes } from '@workday/design-assets-types';
2
2
  import { SvgProps } from './Svg';
3
3
  export interface IconProps extends SvgProps {
4
4
  src: CanvasIcon;
5
- size?: number;
5
+ size?: number | string;
6
6
  type: CanvasIconTypes.Accent | CanvasIconTypes.Applet | CanvasIconTypes.System;
7
7
  }
8
8
  export declare const Icon: import("../../common").ElementComponent<"span", IconProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../icon/lib/Icon.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAC,UAAU,EAAE,eAAe,EAAC,MAAM,8BAA8B,CAAC;AACzE,OAAY,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AAGpC,MAAM,WAAW,SAAU,SAAQ,QAAQ;IACzC,GAAG,EAAE,UAAU,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,eAAe,CAAC,MAAM,GAAG,eAAe,CAAC,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC;CAChF;AAED,eAAO,MAAM,IAAI,4DAwBf,CAAC;AAEH,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../icon/lib/Icon.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAC,UAAU,EAAE,eAAe,EAAC,MAAM,8BAA8B,CAAC;AACzE,OAAY,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AAGpC,MAAM,WAAW,SAAU,SAAQ,QAAQ;IACzC,GAAG,EAAE,UAAU,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,IAAI,EAAE,eAAe,CAAC,MAAM,GAAG,eAAe,CAAC,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC;CAChF;AAED,eAAO,MAAM,IAAI,4DAyBf,CAAC;AAEH,eAAe,IAAI,CAAC"}
@@ -26,13 +26,11 @@ import { createComponent } from '@workday/canvas-kit-react/common';
26
26
  export var Icon = createComponent('span')({
27
27
  displayName: 'Icon',
28
28
  Component: function (_a, ref, Element) {
29
+ var _b;
29
30
  var src = _a.src, size = _a.size, styles = _a.styles, type = _a.type, shouldMirror = _a.shouldMirror, elemProps = __rest(_a, ["src", "size", "styles", "type", "shouldMirror"]);
30
31
  var iconStyles = __assign({}, styles);
31
32
  if (size) {
32
- iconStyles['& svg'] = {
33
- width: size,
34
- height: size,
35
- };
33
+ iconStyles['& svg'] = __assign(__assign({}, ((_b = iconStyles['& svg']) !== null && _b !== void 0 ? _b : {})), { width: size, height: size });
36
34
  }
37
35
  return (React.createElement(Svg, __assign({ src: src, type: type, shouldMirror: shouldMirror, as: Element }, elemProps, { ref: ref, styles: iconStyles })));
38
36
  },
@@ -47,7 +47,7 @@ export interface SystemIconProps extends SystemIconStyles, Omit<IconProps, 'src'
47
47
  /**
48
48
  * The size of the SystemIcon in `px`.
49
49
  */
50
- size?: number | undefined;
50
+ size?: number | string | undefined;
51
51
  className?: string;
52
52
  }
53
53
  export declare const systemIconStyles: ({ accent, accentHover, background, backgroundHover, color, colorHover, fill, fillHover, }: SystemIconStyles) => CSSObject;
@@ -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,OAAa,EAAC,SAAS,EAAC,MAAM,QAAQ,CAAC;AAGvC,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eACf,SAAQ,gBAAgB,EACtB,IAAI,CAAC,SAAS,EAAE,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,YAAY,CAAC;IAC1D;;OAEG;IACH,IAAI,EAAE,gBAAgB,CAAC;IACvB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,gBAAgB,8FAS1B,gBAAgB,KAAG,SAmBpB,CAAC;AAEH,QAAA,MAAM,UAAU,kEA4Cd,CAAC;AAEH,eAAe,UAAU,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;AAC1C,OAAa,EAAC,SAAS,EAAC,MAAM,QAAQ,CAAC;AAGvC,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eACf,SAAQ,gBAAgB,EACtB,IAAI,CAAC,SAAS,EAAE,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,YAAY,CAAC;IAC1D;;OAEG;IACH,IAAI,EAAE,gBAAgB,CAAC;IACvB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,gBAAgB,8FAS1B,gBAAgB,KAAG,SAmBpB,CAAC;AAEH,QAAA,MAAM,UAAU,kEA4Cd,CAAC;AAEH,eAAe,UAAU,CAAC"}
package/icon/lib/Icon.tsx CHANGED
@@ -6,7 +6,7 @@ import {createComponent} from '@workday/canvas-kit-react/common';
6
6
 
7
7
  export interface IconProps extends SvgProps {
8
8
  src: CanvasIcon;
9
- size?: number;
9
+ size?: number | string;
10
10
  type: CanvasIconTypes.Accent | CanvasIconTypes.Applet | CanvasIconTypes.System;
11
11
  }
12
12
 
@@ -17,6 +17,7 @@ export const Icon = createComponent('span')({
17
17
 
18
18
  if (size) {
19
19
  iconStyles['& svg'] = {
20
+ ...((iconStyles['& svg'] as CSSObject) ?? {}),
20
21
  width: size,
21
22
  height: size,
22
23
  };
@@ -54,7 +54,7 @@ export interface SystemIconProps
54
54
  /**
55
55
  * The size of the SystemIcon in `px`.
56
56
  */
57
- size?: number | undefined;
57
+ size?: number | string | undefined;
58
58
  className?: string; //investigate more
59
59
  }
60
60
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-react",
3
- "version": "7.0.0-alpha.100-next.25+911bfad3",
3
+ "version": "7.0.0-alpha.103-next.28+a55aeef9",
4
4
  "description": "The parent module that contains all Workday Canvas Kit React components",
5
5
  "author": "Workday, Inc. (https://www.workday.com)",
6
6
  "license": "Apache-2.0",
@@ -48,9 +48,9 @@
48
48
  "@emotion/styled": "^11.6.0",
49
49
  "@popperjs/core": "^2.5.4",
50
50
  "@workday/canvas-colors-web": "^2.0.0",
51
- "@workday/canvas-kit-labs-react": "^7.0.0-alpha.100-next.25+911bfad3",
52
- "@workday/canvas-kit-popup-stack": "^7.0.0-alpha.100-next.25+911bfad3",
53
- "@workday/canvas-kit-preview-react": "^7.0.0-alpha.100-next.25+911bfad3",
51
+ "@workday/canvas-kit-labs-react": "^7.0.0-alpha.103-next.28+a55aeef9",
52
+ "@workday/canvas-kit-popup-stack": "^7.0.0-alpha.103-next.28+a55aeef9",
53
+ "@workday/canvas-kit-preview-react": "^7.0.0-alpha.103-next.28+a55aeef9",
54
54
  "@workday/canvas-system-icons-web": "^3.0.0",
55
55
  "@workday/design-assets-types": "^0.2.4",
56
56
  "chroma-js": "^2.1.0",
@@ -69,5 +69,5 @@
69
69
  "@workday/canvas-accent-icons-web": "^3.0.0",
70
70
  "@workday/canvas-applet-icons-web": "^2.0.0"
71
71
  },
72
- "gitHead": "911bfad34147c054ac08fd77845d0a0339fd3f95"
72
+ "gitHead": "a55aeef97c5138c9b1144584287afa8cac6fe17f"
73
73
  }