@workday/canvas-kit-labs-react 16.2.0-0652-next.0 → 16.2.0-0654-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.
- package/accessory/index.ts +6 -0
- package/accessory/lib/Accessory.tsx +156 -0
- package/accessory/lib/AccessoryCalendar.tsx +114 -0
- package/accessory/lib/AccessoryFavicon.tsx +156 -0
- package/accessory/lib/AccessoryFile.tsx +140 -0
- package/accessory/lib/AccessoryIcon.tsx +213 -0
- package/accessory/lib/AccessoryMedia.tsx +142 -0
- package/accessory/package.json +6 -0
- package/dist/commonjs/accessory/index.d.ts +7 -0
- package/dist/commonjs/accessory/index.d.ts.map +1 -0
- package/dist/commonjs/accessory/index.js +22 -0
- package/dist/commonjs/accessory/lib/Accessory.d.ts +157 -0
- package/dist/commonjs/accessory/lib/Accessory.d.ts.map +1 -0
- package/dist/commonjs/accessory/lib/Accessory.js +51 -0
- package/dist/commonjs/accessory/lib/AccessoryCalendar.d.ts +80 -0
- package/dist/commonjs/accessory/lib/AccessoryCalendar.d.ts.map +1 -0
- package/dist/commonjs/accessory/lib/AccessoryCalendar.js +48 -0
- package/dist/commonjs/accessory/lib/AccessoryFavicon.d.ts +75 -0
- package/dist/commonjs/accessory/lib/AccessoryFavicon.d.ts.map +1 -0
- package/dist/commonjs/accessory/lib/AccessoryFavicon.js +74 -0
- package/dist/commonjs/accessory/lib/AccessoryFile.d.ts +65 -0
- package/dist/commonjs/accessory/lib/AccessoryFile.d.ts.map +1 -0
- package/dist/commonjs/accessory/lib/AccessoryFile.js +58 -0
- package/dist/commonjs/accessory/lib/AccessoryIcon.d.ts +119 -0
- package/dist/commonjs/accessory/lib/AccessoryIcon.d.ts.map +1 -0
- package/dist/commonjs/accessory/lib/AccessoryIcon.js +61 -0
- package/dist/commonjs/accessory/lib/AccessoryMedia.d.ts +72 -0
- package/dist/commonjs/accessory/lib/AccessoryMedia.d.ts.map +1 -0
- package/dist/commonjs/accessory/lib/AccessoryMedia.js +59 -0
- package/dist/commonjs/index.d.ts +1 -0
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +1 -0
- package/dist/es6/accessory/index.d.ts +7 -0
- package/dist/es6/accessory/index.d.ts.map +1 -0
- package/dist/es6/accessory/index.js +6 -0
- package/dist/es6/accessory/lib/Accessory.d.ts +157 -0
- package/dist/es6/accessory/lib/Accessory.d.ts.map +1 -0
- package/dist/es6/accessory/lib/Accessory.js +48 -0
- package/dist/es6/accessory/lib/AccessoryCalendar.d.ts +80 -0
- package/dist/es6/accessory/lib/AccessoryCalendar.d.ts.map +1 -0
- package/dist/es6/accessory/lib/AccessoryCalendar.js +45 -0
- package/dist/es6/accessory/lib/AccessoryFavicon.d.ts +75 -0
- package/dist/es6/accessory/lib/AccessoryFavicon.d.ts.map +1 -0
- package/dist/es6/accessory/lib/AccessoryFavicon.js +71 -0
- package/dist/es6/accessory/lib/AccessoryFile.d.ts +65 -0
- package/dist/es6/accessory/lib/AccessoryFile.d.ts.map +1 -0
- package/dist/es6/accessory/lib/AccessoryFile.js +55 -0
- package/dist/es6/accessory/lib/AccessoryIcon.d.ts +119 -0
- package/dist/es6/accessory/lib/AccessoryIcon.d.ts.map +1 -0
- package/dist/es6/accessory/lib/AccessoryIcon.js +58 -0
- package/dist/es6/accessory/lib/AccessoryMedia.d.ts +72 -0
- package/dist/es6/accessory/lib/AccessoryMedia.d.ts.map +1 -0
- package/dist/es6/accessory/lib/AccessoryMedia.js +53 -0
- package/dist/es6/index.d.ts +1 -0
- package/dist/es6/index.d.ts.map +1 -1
- package/dist/es6/index.js +1 -0
- package/index.ts +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { SystemIconProps } from '@workday/canvas-kit-react/icon';
|
|
2
|
+
import { AccessoryProps } from './Accessory';
|
|
3
|
+
export interface AccessoryMediaProps extends AccessoryProps {
|
|
4
|
+
/**
|
|
5
|
+
* The URL of the image.
|
|
6
|
+
*/
|
|
7
|
+
src: string;
|
|
8
|
+
/**
|
|
9
|
+
* How the image is resized to fit the tile.
|
|
10
|
+
* @default 'cover'
|
|
11
|
+
*/
|
|
12
|
+
objectFit?: 'contain' | 'cover';
|
|
13
|
+
/**
|
|
14
|
+
* The icon to display from `@workday/canvas-system-icons-web`, centered over the image. When
|
|
15
|
+
* set, a scrim is painted under the icon for contrast. Uses `color` from `Accessory` for the
|
|
16
|
+
* glyph (`base.legacy.neutral0` by default).
|
|
17
|
+
*/
|
|
18
|
+
icon?: SystemIconProps['icon'];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Image treatment for `AccessoryMedia`. The image part stays hidden until `imageLoaded`. The scrim
|
|
22
|
+
* part sits under an optional icon. `background` overrides the tile fill.
|
|
23
|
+
*/
|
|
24
|
+
export declare const accessoryMediaStencil: import("@workday/canvas-kit-styling").Stencil<{
|
|
25
|
+
imageLoaded: {
|
|
26
|
+
false: ({ imagePart }: {
|
|
27
|
+
background: `--${string}`;
|
|
28
|
+
} & import("@workday/canvas-kit-styling").StencilVarsParts<{
|
|
29
|
+
readonly image: "accessory-media-image";
|
|
30
|
+
readonly scrim: "accessory-media-scrim";
|
|
31
|
+
}>) => {
|
|
32
|
+
"[data-part=\"accessory-media-image\"]": {
|
|
33
|
+
display: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
true: {};
|
|
37
|
+
};
|
|
38
|
+
objectFit: {
|
|
39
|
+
cover: ({ imagePart }: {
|
|
40
|
+
background: `--${string}`;
|
|
41
|
+
} & import("@workday/canvas-kit-styling").StencilVarsParts<{
|
|
42
|
+
readonly image: "accessory-media-image";
|
|
43
|
+
readonly scrim: "accessory-media-scrim";
|
|
44
|
+
}>) => {
|
|
45
|
+
"[data-part=\"accessory-media-image\"]": {
|
|
46
|
+
objectFit: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
contain: ({ imagePart }: {
|
|
50
|
+
background: `--${string}`;
|
|
51
|
+
} & import("@workday/canvas-kit-styling").StencilVarsParts<{
|
|
52
|
+
readonly image: "accessory-media-image";
|
|
53
|
+
readonly scrim: "accessory-media-scrim";
|
|
54
|
+
}>) => {
|
|
55
|
+
"[data-part=\"accessory-media-image\"]": {
|
|
56
|
+
objectFit: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
}, {
|
|
61
|
+
readonly image: "accessory-media-image";
|
|
62
|
+
readonly scrim: "accessory-media-scrim";
|
|
63
|
+
}, {
|
|
64
|
+
background: string;
|
|
65
|
+
}, never, never>;
|
|
66
|
+
/**
|
|
67
|
+
* `AccessoryMedia` fills an accessory tile with an image. Pass `icon` to center a decorative icon
|
|
68
|
+
* on a contrast scrim. The image stays hidden until it loads; a failed load keeps the tile
|
|
69
|
+
* background. Always decorative.
|
|
70
|
+
*/
|
|
71
|
+
export declare const AccessoryMedia: import("@workday/canvas-kit-react/common").ElementComponent<"span", AccessoryMediaProps>;
|
|
72
|
+
//# sourceMappingURL=AccessoryMedia.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccessoryMedia.d.ts","sourceRoot":"","sources":["../../../../accessory/lib/AccessoryMedia.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAa,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAI3E,OAAO,EAAY,cAAc,EAAmB,MAAM,aAAa,CAAC;AAExE,MAAM,WAAW,mBAAoB,SAAQ,cAAc;IACzD;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAChC;;;;OAIG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;CAChC;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAmDhC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,cAAc,0FAoDzB,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AccessoryMedia = exports.accessoryMediaStencil = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const common_1 = require("@workday/canvas-kit-react/common");
|
|
10
|
+
const icon_1 = require("@workday/canvas-kit-react/icon");
|
|
11
|
+
const canvas_kit_styling_1 = require("@workday/canvas-kit-styling");
|
|
12
|
+
const canvas_tokens_web_1 = require("@workday/canvas-tokens-web");
|
|
13
|
+
const Accessory_1 = require("./Accessory");
|
|
14
|
+
/**
|
|
15
|
+
* Image treatment for `AccessoryMedia`. The image part stays hidden until `imageLoaded`. The scrim
|
|
16
|
+
* part sits under an optional icon. `background` overrides the tile fill.
|
|
17
|
+
*/
|
|
18
|
+
exports.accessoryMediaStencil = (0, canvas_kit_styling_1.createStencil)({
|
|
19
|
+
vars: {
|
|
20
|
+
background: '',
|
|
21
|
+
},
|
|
22
|
+
parts: {
|
|
23
|
+
image: 'accessory-media-image',
|
|
24
|
+
scrim: 'accessory-media-scrim',
|
|
25
|
+
},
|
|
26
|
+
base: { name: "3wew7z", styles: "box-sizing:border-box;background-color:var(--background-accessory-media-9cf347, var(--cnvs-sys-color-surface-alt-default, var(--cnvs-sys-color-bg-alt-soft, oklch(0.3343 0.0951 253.3 / 0.05))));[data-part=\"accessory-media-image\"]{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;overflow:hidden;border-radius:var(--shape-corner-shape-ccab68);corner-shape:superellipse(1.1);}[data-part=\"accessory-media-scrim\"]{position:absolute;inset:0;background-color:var(--cnvs-sys-color-surface-overlay-scrim, oklch(0.0847 0 0 / 0.36));border-radius:var(--shape-corner-shape-ccab68);corner-shape:superellipse(1.1);pointer-events:none;}" },
|
|
27
|
+
modifiers: {
|
|
28
|
+
imageLoaded: {
|
|
29
|
+
false: { name: "ruy4j", styles: "[data-part=\"accessory-media-image\"]{display:none;}" },
|
|
30
|
+
true: { name: "2yeyuo", styles: "" }
|
|
31
|
+
},
|
|
32
|
+
objectFit: {
|
|
33
|
+
cover: { name: "2tjew2", styles: "[data-part=\"accessory-media-image\"]{object-fit:cover;}" },
|
|
34
|
+
contain: { name: "1hjptw", styles: "[data-part=\"accessory-media-image\"]{object-fit:contain;}" }
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}, "accessory-media-9cf347");
|
|
38
|
+
/**
|
|
39
|
+
* `AccessoryMedia` fills an accessory tile with an image. Pass `icon` to center a decorative icon
|
|
40
|
+
* on a contrast scrim. The image stays hidden until it loads; a failed load keeps the tile
|
|
41
|
+
* background. Always decorative.
|
|
42
|
+
*/
|
|
43
|
+
exports.AccessoryMedia = (0, common_1.createComponent)('span')({
|
|
44
|
+
displayName: 'AccessoryMedia',
|
|
45
|
+
Component: ({ src, size = 'extraLarge', objectFit = 'cover', icon, color = canvas_tokens_web_1.base.legacy.neutral0, background, ...elemProps }, ref, Element) => {
|
|
46
|
+
// Track the loaded URL so a `src` change hides the image again without a mount effect that
|
|
47
|
+
// can race a synchronous `onLoad` (cached images and data URLs).
|
|
48
|
+
const [loadedSrc, setLoadedSrc] = react_1.default.useState(null);
|
|
49
|
+
const imageRef = react_1.default.useRef(null);
|
|
50
|
+
const imageLoaded = loadedSrc === src;
|
|
51
|
+
react_1.default.useEffect(() => {
|
|
52
|
+
const image = imageRef.current;
|
|
53
|
+
if ((image === null || image === void 0 ? void 0 : image.complete) && image.naturalWidth > 0) {
|
|
54
|
+
setLoadedSrc(src);
|
|
55
|
+
}
|
|
56
|
+
}, [src]);
|
|
57
|
+
return ((0, jsx_runtime_1.jsxs)(Accessory_1.Accessory, { as: Element, ref: ref, color: icon ? color : undefined, size: size, ...(0, canvas_kit_styling_1.handleCsProp)(elemProps, (0, exports.accessoryMediaStencil)({ background, imageLoaded, objectFit })), children: [(0, jsx_runtime_1.jsx)("img", { ref: imageRef, alt: "", onLoad: () => setLoadedSrc(src), src: src, ...exports.accessoryMediaStencil.parts.image }), icon && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { ...exports.accessoryMediaStencil.parts.scrim }), (0, jsx_runtime_1.jsx)(icon_1.SystemIcon, { icon: icon, ...Accessory_1.accessoryStencil.parts.icon })] }))] }));
|
|
58
|
+
},
|
|
59
|
+
});
|
package/dist/commonjs/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,OAAO,CAAC;AACtB,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,OAAO,CAAC;AACtB,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC"}
|
package/dist/commonjs/index.js
CHANGED
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./accessory"), exports);
|
|
17
18
|
__exportStar(require("./ai-ingress-button"), exports);
|
|
18
19
|
__exportStar(require("./kbd"), exports);
|
|
19
20
|
__exportStar(require("./selection-group"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './lib/Accessory';
|
|
2
|
+
export * from './lib/AccessoryCalendar';
|
|
3
|
+
export * from './lib/AccessoryFavicon';
|
|
4
|
+
export * from './lib/AccessoryFile';
|
|
5
|
+
export * from './lib/AccessoryIcon';
|
|
6
|
+
export * from './lib/AccessoryMedia';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../accessory/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { CSProps } from '@workday/canvas-kit-styling';
|
|
2
|
+
/**
|
|
3
|
+
* The size of an `Accessory` tile.
|
|
4
|
+
*
|
|
5
|
+
* * `extraSmall` — 16px tile, 16px icon
|
|
6
|
+
* * `small` — 20px tile, 18px icon
|
|
7
|
+
* * `medium` — 24px tile, 16px icon
|
|
8
|
+
* * `large` — 32px tile, 18px icon
|
|
9
|
+
* * `extraLarge` — 40px tile, 20px icon
|
|
10
|
+
*/
|
|
11
|
+
export type AccessorySize = 'extraSmall' | 'small' | 'medium' | 'large' | 'extraLarge';
|
|
12
|
+
export interface AccessoryProps extends CSProps {
|
|
13
|
+
/**
|
|
14
|
+
* The size of the tile. Icon glyph size follows the tile through the icon `data-part`: 16px,
|
|
15
|
+
* 18px, 16px, 18px, and 20px from `extraSmall` to `extraLarge`.
|
|
16
|
+
*
|
|
17
|
+
* * `extraSmall` — 16px
|
|
18
|
+
* * `small` — 20px
|
|
19
|
+
* * `medium` — 24px
|
|
20
|
+
* * `large` — 32px
|
|
21
|
+
* * `extraLarge` — 40px
|
|
22
|
+
*
|
|
23
|
+
* @default 'extraLarge'
|
|
24
|
+
*/
|
|
25
|
+
size?: AccessorySize;
|
|
26
|
+
/**
|
|
27
|
+
* The color of the icon. When set, this overrides the icon color from `variant` on
|
|
28
|
+
* `AccessoryIcon`. Inherited by the icon `data-part` via a CSS variable.
|
|
29
|
+
*/
|
|
30
|
+
color?: string;
|
|
31
|
+
/**
|
|
32
|
+
* The background color of the icon tile. When set, this overrides the fill from `variant` and is
|
|
33
|
+
* painted at every size, including `small` and `extraSmall`. Inherited by the icon `data-part`
|
|
34
|
+
* via a CSS variable.
|
|
35
|
+
*/
|
|
36
|
+
background?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Tile shell for accessory visuals. Owns size, corner radius, icon glyph size, and optional icon
|
|
40
|
+
* color / fill overrides through the icon `data-part`. Prefer `AccessoryIcon`, `AccessoryFile`, or
|
|
41
|
+
* `AccessoryMedia`, which render this shell.
|
|
42
|
+
*/
|
|
43
|
+
export declare const accessoryStencil: import("@workday/canvas-kit-styling").Stencil<{
|
|
44
|
+
size: {
|
|
45
|
+
extraSmall: ({ iconPart, tileBackground }: {
|
|
46
|
+
shape: `--${string}`;
|
|
47
|
+
iconColor: `--${string}`;
|
|
48
|
+
tileBackground: `--${string}`;
|
|
49
|
+
} & import("@workday/canvas-kit-styling").StencilVarsParts<{
|
|
50
|
+
readonly icon: "accessory-icon";
|
|
51
|
+
}>) => {
|
|
52
|
+
[x: string]: "var(--cnvs-sys-size-xxxs, var(--cnvs-sys-space-x4, 1rem))" | "var(--cnvs-sys-shape-sm, var(--cnvs-sys-shape-x1, 0.25rem))" | {
|
|
53
|
+
[x: string]: number | "var(--cnvs-base-size-200, 1rem)" | `var(--${string}, transparent)`;
|
|
54
|
+
backgroundColor: `var(--${string}, transparent)`;
|
|
55
|
+
borderWidth: number;
|
|
56
|
+
};
|
|
57
|
+
width: "var(--cnvs-sys-size-xxxs, var(--cnvs-sys-space-x4, 1rem))";
|
|
58
|
+
height: "var(--cnvs-sys-size-xxxs, var(--cnvs-sys-space-x4, 1rem))";
|
|
59
|
+
"[data-part=\"accessory-icon\"]": {
|
|
60
|
+
[x: string]: number | "var(--cnvs-base-size-200, 1rem)" | `var(--${string}, transparent)`;
|
|
61
|
+
backgroundColor: `var(--${string}, transparent)`;
|
|
62
|
+
borderWidth: number;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
small: ({ iconPart, tileBackground }: {
|
|
66
|
+
shape: `--${string}`;
|
|
67
|
+
iconColor: `--${string}`;
|
|
68
|
+
tileBackground: `--${string}`;
|
|
69
|
+
} & import("@workday/canvas-kit-styling").StencilVarsParts<{
|
|
70
|
+
readonly icon: "accessory-icon";
|
|
71
|
+
}>) => {
|
|
72
|
+
[x: string]: "var(--cnvs-sys-shape-sm, var(--cnvs-sys-shape-x1, 0.25rem))" | "var(--cnvs-sys-size-xxs, var(--cnvs-sys-space-x5, 1.25rem))" | {
|
|
73
|
+
[x: string]: number | "var(--cnvs-base-size-225, 1.125rem)" | `var(--${string}, transparent)`;
|
|
74
|
+
backgroundColor: `var(--${string}, transparent)`;
|
|
75
|
+
borderWidth: number;
|
|
76
|
+
};
|
|
77
|
+
width: "var(--cnvs-sys-size-xxs, var(--cnvs-sys-space-x5, 1.25rem))";
|
|
78
|
+
height: "var(--cnvs-sys-size-xxs, var(--cnvs-sys-space-x5, 1.25rem))";
|
|
79
|
+
"[data-part=\"accessory-icon\"]": {
|
|
80
|
+
[x: string]: number | "var(--cnvs-base-size-225, 1.125rem)" | `var(--${string}, transparent)`;
|
|
81
|
+
backgroundColor: `var(--${string}, transparent)`;
|
|
82
|
+
borderWidth: number;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
medium: ({ iconPart }: {
|
|
86
|
+
shape: `--${string}`;
|
|
87
|
+
iconColor: `--${string}`;
|
|
88
|
+
tileBackground: `--${string}`;
|
|
89
|
+
} & import("@workday/canvas-kit-styling").StencilVarsParts<{
|
|
90
|
+
readonly icon: "accessory-icon";
|
|
91
|
+
}>) => {
|
|
92
|
+
[x: string]: "var(--cnvs-sys-size-xs, var(--cnvs-sys-space-x6, 1.5rem))" | "var(--cnvs-sys-shape-md, var(--cnvs-sys-shape-x2, 0.5rem))" | {
|
|
93
|
+
[x: string]: "var(--cnvs-component-system-icon-size-xs, var(--cnvs-sys-space-x4, 1rem))";
|
|
94
|
+
};
|
|
95
|
+
width: "var(--cnvs-sys-size-xs, var(--cnvs-sys-space-x6, 1.5rem))";
|
|
96
|
+
height: "var(--cnvs-sys-size-xs, var(--cnvs-sys-space-x6, 1.5rem))";
|
|
97
|
+
"[data-part=\"accessory-icon\"]": {
|
|
98
|
+
[x: string]: "var(--cnvs-component-system-icon-size-xs, var(--cnvs-sys-space-x4, 1rem))";
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
large: ({ iconPart }: {
|
|
102
|
+
shape: `--${string}`;
|
|
103
|
+
iconColor: `--${string}`;
|
|
104
|
+
tileBackground: `--${string}`;
|
|
105
|
+
} & import("@workday/canvas-kit-styling").StencilVarsParts<{
|
|
106
|
+
readonly icon: "accessory-icon";
|
|
107
|
+
}>) => {
|
|
108
|
+
[x: string]: "var(--cnvs-base-size-125, 0.625rem)" | "var(--cnvs-sys-size-sm, var(--cnvs-sys-space-x8, 2rem))" | {
|
|
109
|
+
[x: string]: "var(--cnvs-component-system-icon-size-sm, 1.125rem)";
|
|
110
|
+
};
|
|
111
|
+
width: "var(--cnvs-sys-size-sm, var(--cnvs-sys-space-x8, 2rem))";
|
|
112
|
+
height: "var(--cnvs-sys-size-sm, var(--cnvs-sys-space-x8, 2rem))";
|
|
113
|
+
"[data-part=\"accessory-icon\"]": {
|
|
114
|
+
[x: string]: "var(--cnvs-component-system-icon-size-sm, 1.125rem)";
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
extraLarge: ({ iconPart }: {
|
|
118
|
+
shape: `--${string}`;
|
|
119
|
+
iconColor: `--${string}`;
|
|
120
|
+
tileBackground: `--${string}`;
|
|
121
|
+
} & import("@workday/canvas-kit-styling").StencilVarsParts<{
|
|
122
|
+
readonly icon: "accessory-icon";
|
|
123
|
+
}>) => {
|
|
124
|
+
[x: string]: "var(--cnvs-sys-size-md, var(--cnvs-sys-space-x10, 2.5rem))" | "var(--cnvs-sys-shape-lg, 0.75rem)" | {
|
|
125
|
+
[x: string]: "var(--cnvs-component-system-icon-size-md, var(--cnvs-sys-space-x5, 1.25rem))";
|
|
126
|
+
};
|
|
127
|
+
width: "var(--cnvs-sys-size-md, var(--cnvs-sys-space-x10, 2.5rem))";
|
|
128
|
+
height: "var(--cnvs-sys-size-md, var(--cnvs-sys-space-x10, 2.5rem))";
|
|
129
|
+
"[data-part=\"accessory-icon\"]": {
|
|
130
|
+
[x: string]: "var(--cnvs-component-system-icon-size-md, var(--cnvs-sys-space-x5, 1.25rem))";
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
}, {
|
|
135
|
+
readonly icon: "accessory-icon";
|
|
136
|
+
}, {
|
|
137
|
+
iconColor: string;
|
|
138
|
+
tileBackground: string;
|
|
139
|
+
}, import("@workday/canvas-kit-styling").Stencil<import("@workday/canvas-kit-styling").StencilModifierConfig<{}, {
|
|
140
|
+
shape: string;
|
|
141
|
+
}, never>, {}, {
|
|
142
|
+
shape: string;
|
|
143
|
+
}, never, never>, never>;
|
|
144
|
+
/**
|
|
145
|
+
* `Accessory` is the small rounded visual that sits beside text, most often the leading element in
|
|
146
|
+
* a list item or other row. It owns the tile size and corner radius so a system icon, file type,
|
|
147
|
+
* image, site favicon, calendar date, or custom content stays one consistent shape.
|
|
148
|
+
* `AccessoryIcon`, `AccessoryFile`, `AccessoryMedia`, `AccessoryFavicon`, and `AccessoryCalendar`
|
|
149
|
+
* render this shell. Accessories are
|
|
150
|
+
* decorative and always hidden from assistive technology.
|
|
151
|
+
*
|
|
152
|
+
* ```tsx
|
|
153
|
+
* <AccessoryIcon icon={activityIcon} />
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
export declare const Accessory: import("@workday/canvas-kit-react/common").ElementComponent<"span", AccessoryProps>;
|
|
157
|
+
//# sourceMappingURL=Accessory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Accessory.d.ts","sourceRoot":"","sources":["../../../../accessory/lib/Accessory.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAC,OAAO,EAAsC,MAAM,6BAA6B,CAAC;AAGzF;;;;;;;;GAQG;AACH,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,YAAY,CAAC;AAEvF,MAAM,WAAW,cAAe,SAAQ,OAAO;IAC7C;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA2E3B,CAAC;AAEH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,SAAS,qFAkBpB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cornerShapeStencil, createComponent } from '@workday/canvas-kit-react/common';
|
|
3
|
+
import { systemIconStencil } from '@workday/canvas-kit-react/icon';
|
|
4
|
+
import { createStencil, cssVar, handleCsProp } from '@workday/canvas-kit-styling';
|
|
5
|
+
import { base, component, system } from '@workday/canvas-tokens-web';
|
|
6
|
+
/**
|
|
7
|
+
* Tile shell for accessory visuals. Owns size, corner radius, icon glyph size, and optional icon
|
|
8
|
+
* color / fill overrides through the icon `data-part`. Prefer `AccessoryIcon`, `AccessoryFile`, or
|
|
9
|
+
* `AccessoryMedia`, which render this shell.
|
|
10
|
+
*/
|
|
11
|
+
export const accessoryStencil = createStencil({
|
|
12
|
+
extends: cornerShapeStencil,
|
|
13
|
+
vars: {
|
|
14
|
+
iconColor: '',
|
|
15
|
+
tileBackground: '',
|
|
16
|
+
},
|
|
17
|
+
parts: {
|
|
18
|
+
icon: 'accessory-icon',
|
|
19
|
+
},
|
|
20
|
+
base: { name: "3hvhdg", styles: "box-sizing:border-box;display:inline-flex;position:relative;align-items:center;justify-content:center;flex-shrink:0;vertical-align:middle;[data-part=\"accessory-icon\"]{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;border-radius:var(--shape-corner-shape-ccab68);corner-shape:superellipse(1.1);--color-system-icon-c9acc3:var(--iconColor-accessory-05fc46);}" },
|
|
21
|
+
modifiers: {
|
|
22
|
+
size: {
|
|
23
|
+
extraSmall: { name: "x75h2", styles: "width:var(--cnvs-sys-size-xxxs, var(--cnvs-sys-space-x4, 1rem));height:var(--cnvs-sys-size-xxxs, var(--cnvs-sys-space-x4, 1rem));--shape-corner-shape-ccab68:var(--cnvs-sys-shape-sm, var(--cnvs-sys-shape-x1, 0.25rem));[data-part=\"accessory-icon\"]{--size-svg-bca693:var(--cnvs-base-size-200, 1rem);background-color:var(--tileBackground-accessory-05fc46, transparent);border-width:0;}" },
|
|
24
|
+
small: { name: "r0g8q", styles: "width:var(--cnvs-sys-size-xxs, var(--cnvs-sys-space-x5, 1.25rem));height:var(--cnvs-sys-size-xxs, var(--cnvs-sys-space-x5, 1.25rem));--shape-corner-shape-ccab68:var(--cnvs-sys-shape-sm, var(--cnvs-sys-shape-x1, 0.25rem));[data-part=\"accessory-icon\"]{--size-svg-bca693:var(--cnvs-base-size-225, 1.125rem);background-color:var(--tileBackground-accessory-05fc46, transparent);border-width:0;}" },
|
|
25
|
+
medium: { name: "poysy", styles: "width:var(--cnvs-sys-size-xs, var(--cnvs-sys-space-x6, 1.5rem));height:var(--cnvs-sys-size-xs, var(--cnvs-sys-space-x6, 1.5rem));--shape-corner-shape-ccab68:var(--cnvs-sys-shape-md, var(--cnvs-sys-shape-x2, 0.5rem));[data-part=\"accessory-icon\"]{--size-svg-bca693:var(--cnvs-component-system-icon-size-xs, var(--cnvs-sys-space-x4, 1rem));}" },
|
|
26
|
+
large: { name: "49ozl6", styles: "width:var(--cnvs-sys-size-sm, var(--cnvs-sys-space-x8, 2rem));height:var(--cnvs-sys-size-sm, var(--cnvs-sys-space-x8, 2rem));--shape-corner-shape-ccab68:var(--cnvs-base-size-125, 0.625rem);[data-part=\"accessory-icon\"]{--size-svg-bca693:var(--cnvs-component-system-icon-size-sm, 1.125rem);}" },
|
|
27
|
+
extraLarge: { name: "4ds3t1", styles: "width:var(--cnvs-sys-size-md, var(--cnvs-sys-space-x10, 2.5rem));height:var(--cnvs-sys-size-md, var(--cnvs-sys-space-x10, 2.5rem));--shape-corner-shape-ccab68:var(--cnvs-sys-shape-lg, 0.75rem);[data-part=\"accessory-icon\"]{--size-svg-bca693:var(--cnvs-component-system-icon-size-md, var(--cnvs-sys-space-x5, 1.25rem));}" }
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}, "accessory-05fc46");
|
|
31
|
+
/**
|
|
32
|
+
* `Accessory` is the small rounded visual that sits beside text, most often the leading element in
|
|
33
|
+
* a list item or other row. It owns the tile size and corner radius so a system icon, file type,
|
|
34
|
+
* image, site favicon, calendar date, or custom content stays one consistent shape.
|
|
35
|
+
* `AccessoryIcon`, `AccessoryFile`, `AccessoryMedia`, `AccessoryFavicon`, and `AccessoryCalendar`
|
|
36
|
+
* render this shell. Accessories are
|
|
37
|
+
* decorative and always hidden from assistive technology.
|
|
38
|
+
*
|
|
39
|
+
* ```tsx
|
|
40
|
+
* <AccessoryIcon icon={activityIcon} />
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export const Accessory = createComponent('span')({
|
|
44
|
+
displayName: 'Accessory',
|
|
45
|
+
Component: ({ size = 'extraLarge', color, background, ...elemProps }, ref, Element) => {
|
|
46
|
+
return (_jsx(Element, { ref: ref, ...handleCsProp(elemProps, accessoryStencil({ size, iconColor: color, tileBackground: background })), "aria-hidden": true }));
|
|
47
|
+
},
|
|
48
|
+
});
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { AccessoryProps } from './Accessory';
|
|
2
|
+
export interface AccessoryCalendarProps extends AccessoryProps {
|
|
3
|
+
/**
|
|
4
|
+
* The month label, such as `Apr`.
|
|
5
|
+
*/
|
|
6
|
+
month: string;
|
|
7
|
+
/**
|
|
8
|
+
* The day of the month, such as `30`.
|
|
9
|
+
*/
|
|
10
|
+
date: number | string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Calendar treatment for `AccessoryCalendar`. The month uses a critical color. The day uses the
|
|
14
|
+
* default foreground color. `size` scales both. `color` overrides the month. `background`
|
|
15
|
+
* overrides the tile fill.
|
|
16
|
+
*/
|
|
17
|
+
export declare const accessoryCalendarStencil: import("@workday/canvas-kit-styling").Stencil<{
|
|
18
|
+
/**
|
|
19
|
+
* The icon part's font size matches the tile so month (`0.25em`) and day (`0.4em`) stay in
|
|
20
|
+
* proportion. At `extraLarge` that is 10px and 16px (`subtext.sm` and `body.sm`). Type tokens
|
|
21
|
+
* do not go below 10px, so smaller tiles keep the ratio instead of a fixed type level.
|
|
22
|
+
*/
|
|
23
|
+
size: {
|
|
24
|
+
extraSmall: ({ iconPart }: {} & import("@workday/canvas-kit-styling").StencilVarsParts<{
|
|
25
|
+
readonly icon: "accessory-icon";
|
|
26
|
+
readonly month: "accessory-calendar-month";
|
|
27
|
+
readonly date: "accessory-calendar-date";
|
|
28
|
+
}>) => {
|
|
29
|
+
"[data-part=\"accessory-icon\"]": {
|
|
30
|
+
fontSize: "var(--cnvs-sys-font-size-body-sm, var(--cnvs-sys-font-size-body-small, 1rem))";
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
small: ({ iconPart }: {} & import("@workday/canvas-kit-styling").StencilVarsParts<{
|
|
34
|
+
readonly icon: "accessory-icon";
|
|
35
|
+
readonly month: "accessory-calendar-month";
|
|
36
|
+
readonly date: "accessory-calendar-date";
|
|
37
|
+
}>) => {
|
|
38
|
+
"[data-part=\"accessory-icon\"]": {
|
|
39
|
+
fontSize: "var(--cnvs-sys-font-size-body-lg, var(--cnvs-sys-font-size-body-large, 1.25rem))";
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
medium: ({ iconPart }: {} & import("@workday/canvas-kit-styling").StencilVarsParts<{
|
|
43
|
+
readonly icon: "accessory-icon";
|
|
44
|
+
readonly month: "accessory-calendar-month";
|
|
45
|
+
readonly date: "accessory-calendar-date";
|
|
46
|
+
}>) => {
|
|
47
|
+
"[data-part=\"accessory-icon\"]": {
|
|
48
|
+
fontSize: "var(--cnvs-sys-font-size-heading-sm, var(--cnvs-sys-font-size-heading-small, 1.5rem))";
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
large: ({ iconPart }: {} & import("@workday/canvas-kit-styling").StencilVarsParts<{
|
|
52
|
+
readonly icon: "accessory-icon";
|
|
53
|
+
readonly month: "accessory-calendar-month";
|
|
54
|
+
readonly date: "accessory-calendar-date";
|
|
55
|
+
}>) => {
|
|
56
|
+
"[data-part=\"accessory-icon\"]": {
|
|
57
|
+
fontSize: "var(--cnvs-sys-font-size-heading-lg, var(--cnvs-sys-font-size-heading-large, 2rem))";
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
extraLarge: ({ iconPart }: {} & import("@workday/canvas-kit-styling").StencilVarsParts<{
|
|
61
|
+
readonly icon: "accessory-icon";
|
|
62
|
+
readonly month: "accessory-calendar-month";
|
|
63
|
+
readonly date: "accessory-calendar-date";
|
|
64
|
+
}>) => {
|
|
65
|
+
"[data-part=\"accessory-icon\"]": {
|
|
66
|
+
fontSize: "var(--cnvs-sys-font-size-title-sm, var(--cnvs-sys-font-size-title-small, 2.5rem))";
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
}, {
|
|
71
|
+
readonly icon: "accessory-icon";
|
|
72
|
+
readonly month: "accessory-calendar-month";
|
|
73
|
+
readonly date: "accessory-calendar-date";
|
|
74
|
+
}, {}, never, never>;
|
|
75
|
+
/**
|
|
76
|
+
* `AccessoryCalendar` renders a month and day in an accessory tile. The month is critical and the
|
|
77
|
+
* day is the default foreground color. Both scale with `size`. Always decorative.
|
|
78
|
+
*/
|
|
79
|
+
export declare const AccessoryCalendar: import("@workday/canvas-kit-react/common").ElementComponent<"span", AccessoryCalendarProps>;
|
|
80
|
+
//# sourceMappingURL=AccessoryCalendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccessoryCalendar.d.ts","sourceRoot":"","sources":["../../../../accessory/lib/AccessoryCalendar.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAY,cAAc,EAAmB,MAAM,aAAa,CAAC;AAExE,MAAM,WAAW,sBAAuB,SAAQ,cAAc;IAC5D;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAED;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;IAoCjC;;;;OAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAsBL,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,iBAAiB,6FAuB5B,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { createComponent } from '@workday/canvas-kit-react/common';
|
|
3
|
+
import { createStencil, cssVar, handleCsProp, px2rem } from '@workday/canvas-kit-styling';
|
|
4
|
+
import { system } from '@workday/canvas-tokens-web';
|
|
5
|
+
import { Accessory, accessoryStencil } from './Accessory';
|
|
6
|
+
/**
|
|
7
|
+
* Calendar treatment for `AccessoryCalendar`. The month uses a critical color. The day uses the
|
|
8
|
+
* default foreground color. `size` scales both. `color` overrides the month. `background`
|
|
9
|
+
* overrides the tile fill.
|
|
10
|
+
*/
|
|
11
|
+
export const accessoryCalendarStencil = createStencil({
|
|
12
|
+
parts: {
|
|
13
|
+
icon: 'accessory-icon',
|
|
14
|
+
month: 'accessory-calendar-month',
|
|
15
|
+
date: 'accessory-calendar-date',
|
|
16
|
+
},
|
|
17
|
+
base: { name: "4cbo76", styles: "box-sizing:border-box;[data-part=\"accessory-icon\"]{flex-direction:column;gap:0.075em;overflow:hidden;background-color:var(--tileBackground-accessory-05fc46, var(--cnvs-sys-color-surface-default, var(--cnvs-sys-color-bg-default, oklch(1 0 0 / 1))));border-width:0.0625rem;border-style:solid;border-color:var(--cnvs-sys-color-border-default, var(--cnvs-sys-color-border-divider, oklch(0.3057 0.079 256.22 / 0.13)));}[data-part=\"accessory-calendar-month\"]{color:var(--iconColor-accessory-05fc46, var(--cnvs-sys-color-fg-danger-default, var(--cnvs-sys-color-fg-critical-default, oklch(0.5342 0.2172 29.53 / 1))));font-size:0.25em;font-weight:var(--cnvs-sys-font-weight-medium);line-height:1;white-space:nowrap;}[data-part=\"accessory-calendar-date\"]{color:var(--cnvs-sys-color-fg-default);font-size:0.4em;font-weight:var(--cnvs-sys-font-weight-normal);line-height:1;white-space:nowrap;}" },
|
|
18
|
+
modifiers: {
|
|
19
|
+
/**
|
|
20
|
+
* The icon part's font size matches the tile so month (`0.25em`) and day (`0.4em`) stay in
|
|
21
|
+
* proportion. At `extraLarge` that is 10px and 16px (`subtext.sm` and `body.sm`). Type tokens
|
|
22
|
+
* do not go below 10px, so smaller tiles keep the ratio instead of a fixed type level.
|
|
23
|
+
*/
|
|
24
|
+
size: {
|
|
25
|
+
extraSmall: { name: "1u9oxy", styles: "[data-part=\"accessory-icon\"]{font-size:var(--cnvs-sys-font-size-body-sm, var(--cnvs-sys-font-size-body-small, 1rem));}" },
|
|
26
|
+
small: { name: "2wxatz", styles: "[data-part=\"accessory-icon\"]{font-size:var(--cnvs-sys-font-size-body-lg, var(--cnvs-sys-font-size-body-large, 1.25rem));}" },
|
|
27
|
+
medium: { name: "3x84p0", styles: "[data-part=\"accessory-icon\"]{font-size:var(--cnvs-sys-font-size-heading-sm, var(--cnvs-sys-font-size-heading-small, 1.5rem));}" },
|
|
28
|
+
large: { name: "3ewik8", styles: "[data-part=\"accessory-icon\"]{font-size:var(--cnvs-sys-font-size-heading-lg, var(--cnvs-sys-font-size-heading-large, 2rem));}" },
|
|
29
|
+
extraLarge: { name: "3ochpw", styles: "[data-part=\"accessory-icon\"]{font-size:var(--cnvs-sys-font-size-title-sm, var(--cnvs-sys-font-size-title-small, 2.5rem));}" }
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
defaultModifiers: {
|
|
33
|
+
size: 'extraLarge',
|
|
34
|
+
}
|
|
35
|
+
}, "accessory-calendar-63f1cc");
|
|
36
|
+
/**
|
|
37
|
+
* `AccessoryCalendar` renders a month and day in an accessory tile. The month is critical and the
|
|
38
|
+
* day is the default foreground color. Both scale with `size`. Always decorative.
|
|
39
|
+
*/
|
|
40
|
+
export const AccessoryCalendar = createComponent('span')({
|
|
41
|
+
displayName: 'AccessoryCalendar',
|
|
42
|
+
Component: ({ month, date, size = 'extraLarge', color, background, ...elemProps }, ref, Element) => {
|
|
43
|
+
return (_jsx(Accessory, { as: Element, ref: ref, background: background, color: color, size: size, ...handleCsProp(elemProps, accessoryCalendarStencil({ size })), children: _jsxs("span", { ...accessoryStencil.parts.icon, children: [_jsx("span", { ...accessoryCalendarStencil.parts.month, children: month }), _jsx("span", { ...accessoryCalendarStencil.parts.date, children: date })] }) }));
|
|
44
|
+
},
|
|
45
|
+
});
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { AccessoryProps } from './Accessory';
|
|
2
|
+
export interface AccessoryFaviconProps extends AccessoryProps {
|
|
3
|
+
/**
|
|
4
|
+
* The site URL or bare domain, such as `https://design.workday.com` or `workday.com`. The hostname is
|
|
5
|
+
* used to resolve the favicon.
|
|
6
|
+
*/
|
|
7
|
+
url: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Favicon treatment for `AccessoryFavicon`. At `large` and `extraLarge` the mark is inset in an
|
|
11
|
+
* outlined tile. At `medium` and smaller the mark fills the tile and the frame is removed.
|
|
12
|
+
* `background` overrides the tile fill.
|
|
13
|
+
*/
|
|
14
|
+
export declare const accessoryFaviconStencil: import("@workday/canvas-kit-styling").Stencil<{
|
|
15
|
+
size: {
|
|
16
|
+
extraSmall: ({ iconPart, imagePart }: {} & import("@workday/canvas-kit-styling").StencilVarsParts<{
|
|
17
|
+
readonly icon: "accessory-icon";
|
|
18
|
+
readonly image: "accessory-favicon-image";
|
|
19
|
+
}>) => {
|
|
20
|
+
"[data-part=\"accessory-icon\"]": {
|
|
21
|
+
backgroundColor: `var(--${string}, transparent)`;
|
|
22
|
+
borderWidth: number;
|
|
23
|
+
};
|
|
24
|
+
"[data-part=\"accessory-favicon-image\"]": {
|
|
25
|
+
width: string;
|
|
26
|
+
height: string;
|
|
27
|
+
borderRadius: number;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
small: ({ iconPart, imagePart }: {} & import("@workday/canvas-kit-styling").StencilVarsParts<{
|
|
31
|
+
readonly icon: "accessory-icon";
|
|
32
|
+
readonly image: "accessory-favicon-image";
|
|
33
|
+
}>) => {
|
|
34
|
+
"[data-part=\"accessory-icon\"]": {
|
|
35
|
+
backgroundColor: `var(--${string}, transparent)`;
|
|
36
|
+
borderWidth: number;
|
|
37
|
+
};
|
|
38
|
+
"[data-part=\"accessory-favicon-image\"]": {
|
|
39
|
+
width: string;
|
|
40
|
+
height: string;
|
|
41
|
+
borderRadius: number;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
medium: ({ iconPart, imagePart }: {} & import("@workday/canvas-kit-styling").StencilVarsParts<{
|
|
45
|
+
readonly icon: "accessory-icon";
|
|
46
|
+
readonly image: "accessory-favicon-image";
|
|
47
|
+
}>) => {
|
|
48
|
+
"[data-part=\"accessory-icon\"]": {
|
|
49
|
+
backgroundColor: `var(--${string}, transparent)`;
|
|
50
|
+
borderWidth: number;
|
|
51
|
+
};
|
|
52
|
+
"[data-part=\"accessory-favicon-image\"]": {
|
|
53
|
+
width: string;
|
|
54
|
+
height: string;
|
|
55
|
+
borderRadius: number;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
large: {};
|
|
59
|
+
extraLarge: {};
|
|
60
|
+
};
|
|
61
|
+
}, {
|
|
62
|
+
readonly icon: "accessory-icon";
|
|
63
|
+
readonly image: "accessory-favicon-image";
|
|
64
|
+
}, {}, never, never>;
|
|
65
|
+
/**
|
|
66
|
+
* `AccessoryFavicon` renders a site favicon in an accessory tile. Pass a site URL or domain as
|
|
67
|
+
* `url`. The mark is inset in an outlined frame at `large` and `extraLarge`, and fills the tile at
|
|
68
|
+
* smaller sizes. Always decorative.
|
|
69
|
+
*
|
|
70
|
+
* The image is requested from the user's browser at `https://www.google.com/s2/favicons`. Google
|
|
71
|
+
* receives the hostname and the user's IP address. `referrerPolicy="no-referrer"` keeps the app
|
|
72
|
+
* origin off that request. It does not proxy the request.
|
|
73
|
+
*/
|
|
74
|
+
export declare const AccessoryFavicon: import("@workday/canvas-kit-react/common").ElementComponent<"span", AccessoryFaviconProps>;
|
|
75
|
+
//# sourceMappingURL=AccessoryFavicon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccessoryFavicon.d.ts","sourceRoot":"","sources":["../../../../accessory/lib/AccessoryFavicon.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAY,cAAc,EAAkC,MAAM,aAAa,CAAC;AA+BvF,MAAM,WAAW,qBAAsB,SAAQ,cAAc;IAC3D;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;GAIG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAkElC,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,4FA8B3B,CAAC"}
|