@workday/canvas-kit-labs-react 16.2.0-0648-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/ai-ingress-button/lib/AIIngressButton.js +5 -5
- 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/commonjs/kbd/lib/KBD.js +6 -6
- package/dist/commonjs/kbd/lib/KBDItem.js +6 -6
- package/dist/commonjs/selection-group/lib/SelectionGroupIcon.js +1 -1
- package/dist/commonjs/selection-group/lib/SelectionGroupItem.js +4 -4
- package/dist/commonjs/selection-group/lib/SelectionGroupList.js +6 -6
- package/dist/commonjs/version/lib/version.js +1 -1
- 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/ai-ingress-button/lib/AIIngressButton.js +5 -5
- 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/dist/es6/kbd/lib/KBD.js +6 -6
- package/dist/es6/kbd/lib/KBDItem.js +6 -6
- package/dist/es6/selection-group/lib/SelectionGroupIcon.js +1 -1
- package/dist/es6/selection-group/lib/SelectionGroupItem.js +4 -4
- package/dist/es6/selection-group/lib/SelectionGroupList.js +6 -6
- package/dist/es6/version/lib/version.js +1 -1
- 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
|
+
});
|
|
@@ -26,20 +26,20 @@ const glowHappyHour = canvas_tokens_web_1.base.legacy.orange400; //'#FD7E00';
|
|
|
26
26
|
const glowThumbtack = canvas_tokens_web_1.base.legacy.coral500; //'#FC5B05';
|
|
27
27
|
exports.AIIngressButtonStencil = (0, canvas_kit_styling_1.createStencil)({
|
|
28
28
|
extends: button_1.buttonStencil,
|
|
29
|
-
base: { name: "
|
|
29
|
+
base: { name: "1xs6ft", styles: "box-sizing:border-box;--background-button-a19f67:var(--cnvs-sys-color-accent-ai, var(--cnvs-sys-color-bg-ai-stronger, oklch(0.2452 0.0752 254.55 / 1)));border-radius:var(--cnvs-sys-shape-full, var(--cnvs-sys-shape-round, 65rem));height:calc(var(--cnvs-sys-size-md, var(--cnvs-sys-space-x10, 2.5rem)) + var(--cnvs-base-size-50, 0.25rem));width:calc(var(--cnvs-sys-size-md, var(--cnvs-sys-space-x10, 2.5rem)) + var(--cnvs-base-size-50, 0.25rem));transition:box-shadow 300ms ease-out, background 300ms ease-out;.wd-icon-ai-ingress-button{.wd-icon-fill{transition:fill 300ms ease-out;}> linearGradient > stop{transition:300ms ease-out;stop-color:var(--cnvs-sys-color-fg-inverse);}}&:is(:hover, .hover):not(:disabled, .disabled){.wd-icon-ai-ingress-button{linearGradient > stop:first-child{stop-color:var(--cnvs-base-palette-red-200, oklch(0.8339 0.092 28.19 / 1));}linearGradient > stop:nth-child(2){stop-color:var(--cnvs-base-palette-orange-200, oklch(0.8606 0.1002 65.34 / 1));}linearGradient > stop:nth-child(3){stop-color:var(--cnvs-base-palette-orange-200, oklch(0.8606 0.1002 65.34 / 1));}linearGradient > stop:nth-child(4){stop-color:var(--cnvs-base-palette-amber-200, oklch(0.9191 0.1547 99.7 / 1));}linearGradient > stop:nth-child(5){stop-color:var(--cnvs-base-palette-amber-300, oklch(0.8432 0.1713 85.24 / 1));}}}&:disabled, &:disabled:active, &.disabled{opacity:var(--cnvs-sys-opacity-disabled);}&:is(:focus-visible, .focus):not(:disabled, .disabled){box-shadow:0 0 0 0px var(--cnvs-sys-color-border-inverse-default, var(--cnvs-base-palette-neutral-0)), 0 0 0 2px var(--cnvs-brand-common-focus-outline, rgba(8,117,225,1));}" },
|
|
30
30
|
modifiers: {
|
|
31
31
|
variant: {
|
|
32
|
-
inverse: { name: "
|
|
32
|
+
inverse: { name: "1i4f5c", styles: "--background-button-a19f67:var(--cnvs-sys-color-bg-default);.wd-icon-ai-ingress-button{.wd-icon-fill{transition:fill 300ms ease-out;}> linearGradient > stop{transition:300ms ease-out;stop-color:var(--cnvs-sys-color-fg-ai);}}&:is(:hover, .hover):not(:disabled, .disabled){.wd-icon-ai-ingress-button{linearGradient > stop:first-child{stop-color:var(--cnvs-base-palette-red-200, oklch(0.8339 0.092 28.19 / 1));}linearGradient > stop:nth-child(2){stop-color:var(--cnvs-base-palette-orange-200, oklch(0.8606 0.1002 65.34 / 1));}linearGradient > stop:nth-child(3){stop-color:var(--cnvs-base-palette-orange-200, oklch(0.8606 0.1002 65.34 / 1));}linearGradient > stop:nth-child(4){stop-color:var(--cnvs-base-palette-amber-200, oklch(0.9191 0.1547 99.7 / 1));}linearGradient > stop:nth-child(5){stop-color:var(--cnvs-base-palette-amber-300, oklch(0.8432 0.1713 85.24 / 1));}}}&:is(:focus-visible, .focus):not(:disabled, .disabled){box-shadow:0 0 0 0px var(--cnvs-sys-color-border-inverse-default, var(--cnvs-base-palette-neutral-0)), 0 0 0 2px var(--cnvs-sys-color-fg-inverse);border:2px solid var(--cnvs-sys-color-accent-ai, var(--cnvs-sys-color-bg-ai-stronger, oklch(0.2452 0.0752 254.55 / 1))) ;}" }
|
|
33
33
|
},
|
|
34
34
|
toggled: {
|
|
35
|
-
true: { name: "
|
|
36
|
-
false: { name: "
|
|
35
|
+
true: { name: "s9s7", styles: "--background-button-a19f67:var(--cnvs-sys-color-bg-default);transition:box-shadow 300ms ease-out, background 300ms ease-out;box-shadow:0px 0px 4.9px 0px var(--cnvs-base-palette-magenta-200, oklch(0.887 0.1029 327.44 / 1)), 0px 0px 0.98px 0px var(--cnvs-base-palette-amber-100, oklch(0.9567 0.0948 100.22 / 1)), 0px 0px 1.96px 0px var(--cnvs-base-palette-amber-300, oklch(0.8432 0.1713 85.24 / 1)), 0px 0px 2.94px 0px var(--cnvs-base-palette-amber-300, oklch(0.8432 0.1713 85.24 / 1)), 0px 0px 4.9px 0px var(--cnvs-base-palette-orange-400, oklch(0.7261 0.1852 52.58 / 1)), 0px 0px 7.36px 0px var(--cnvs-base-palette-coral-500, oklch(0.6779 0.2096 40.36 / 1)), 0px 0px 9.81px 0px var(--cnvs-base-palette-magenta-200, oklch(0.887 0.1029 327.44 / 1)), 0px 0px 12.26px 0px rgba(255, 194, 253, 0.50);.wd-icon-ai-ingress-button{.wd-icon-fill{transition:fill 300ms ease-out;}> linearGradient > stop{transition:300ms ease-out;stop-color:var(--cnvs-sys-color-fg-ai);}}> linearGradient > stop{transition:300ms ease-out;stop-color:var(--cnvs-sys-color-fg-ai);}&:is(:focus-visible, .focus):not(:disabled, .disabled){box-shadow:0 0 0 2px var(--cnvs-sys-color-border-inverse-default, var(--cnvs-base-palette-neutral-0)), 0 0 0 4px var(--cnvs-brand-common-focus-outline, rgba(8,117,225,1));border:1px solid var(--cnvs-sys-color-border-strong, var(--cnvs-sys-color-border-container, oklch(0.2442 0.0693 257.66 / 0.21))) ;}" },
|
|
36
|
+
false: { name: "2d3v5r", styles: "transition:box-shadow 300ms ease-out, background 300ms ease-out;" }
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
compound: [
|
|
40
40
|
{
|
|
41
41
|
modifiers: { toggled: true, variant: 'inverse' },
|
|
42
|
-
styles: { name: "
|
|
42
|
+
styles: { name: "2sn4rk", styles: "--background-button-a19f67:var(--cnvs-sys-color-accent-ai, var(--cnvs-sys-color-bg-ai-stronger, oklch(0.2452 0.0752 254.55 / 1)));.wd-icon-ai-ingress-button{.wd-icon-fill{transition:fill 300ms ease-out;}> linearGradient > stop{transition:300ms ease-out;stop-color:var(--cnvs-sys-color-fg-inverse);}}&:is(:focus-visible, .focus):not(:disabled, .disabled){box-shadow:0 0 0 0px var(--cnvs-sys-color-border-inverse-default, var(--cnvs-base-palette-neutral-0)), 0 0 0 2px var(--cnvs-sys-color-fg-inverse);border:none;}" }
|
|
43
43
|
}
|
|
44
44
|
]
|
|
45
45
|
}, "a-i-ingress-button-5576f1");
|
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);
|
|
@@ -9,16 +9,16 @@ const canvas_tokens_web_1 = require("@workday/canvas-tokens-web");
|
|
|
9
9
|
const KBDItem_1 = require("./KBDItem");
|
|
10
10
|
const useKBDModel_1 = require("./useKBDModel");
|
|
11
11
|
exports.kbdStencil = (0, canvas_kit_styling_1.createStencil)({
|
|
12
|
-
base: { name: "
|
|
12
|
+
base: { name: "43kp2b", styles: "box-sizing:border-box;display:inline-flex;align-items:center;gap:var(--cnvs-sys-gap-xs, var(--cnvs-sys-space-x1, 0.25rem));" },
|
|
13
13
|
modifiers: {
|
|
14
14
|
variant: {
|
|
15
|
-
plain: { name: "
|
|
16
|
-
default: { name: "
|
|
15
|
+
plain: { name: "3x75b3", styles: "color:var(--cnvs-sys-color-fg-muted-default);" },
|
|
16
|
+
default: { name: "2i1v99", styles: "color:var(--cnvs-sys-color-fg-muted-strong);" }
|
|
17
17
|
},
|
|
18
18
|
size: {
|
|
19
|
-
large: { name: "
|
|
20
|
-
medium: { name: "
|
|
21
|
-
small: { name: "
|
|
19
|
+
large: { name: "2ngwuf", styles: "span{font-family:var(--cnvs-sys-font-family-default);font-weight:var(--cnvs-sys-font-weight-normal);line-height:var(--cnvs-sys-line-height-subtext-lg);font-size:var(--cnvs-sys-font-size-subtext-lg);letter-spacing:var(--cnvs-sys-letter-spacing-subtext-lg);}" },
|
|
20
|
+
medium: { name: "rya8x", styles: "span{font-family:var(--cnvs-sys-font-family-default);font-weight:var(--cnvs-sys-font-weight-normal);line-height:var(--cnvs-sys-line-height-subtext-md);font-size:var(--cnvs-sys-font-size-subtext-md);letter-spacing:var(--cnvs-sys-letter-spacing-subtext-md);}" },
|
|
21
|
+
small: { name: "ucsek", styles: "span{font-family:var(--cnvs-sys-font-family-default);font-weight:var(--cnvs-sys-font-weight-normal);line-height:var(--cnvs-sys-line-height-subtext-sm);font-size:var(--cnvs-sys-font-size-subtext-sm);letter-spacing:var(--cnvs-sys-letter-spacing-subtext-sm);}" }
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
}, "kbd-482771");
|
|
@@ -9,11 +9,11 @@ const canvas_tokens_web_1 = require("@workday/canvas-tokens-web");
|
|
|
9
9
|
const useKBDModel_1 = require("./useKBDModel");
|
|
10
10
|
exports.kbdItemStencil = (0, canvas_kit_styling_1.createStencil)({
|
|
11
11
|
extends: common_1.cornerShapeStencil,
|
|
12
|
-
base: { name: "
|
|
12
|
+
base: { name: "28esir", styles: "box-sizing:border-box;--shape-corner-shape-ccab68:var(--cnvs-sys-shape-sm, var(--cnvs-sys-shape-x1, 0.25rem));text-align:center;display:flex;align-items:center;justify-content:center;" },
|
|
13
13
|
modifiers: {
|
|
14
14
|
variant: {
|
|
15
|
-
plain: { name: "
|
|
16
|
-
default: { name: "
|
|
15
|
+
plain: { name: "241q0w", styles: "background-color:var(--cnvs-sys-color-surface-transparent, var(--cnvs-sys-color-bg-transparent-default, oklch(0 0 0 / 0)));border-radius:0;corner-shape:unset;" },
|
|
16
|
+
default: { name: "3528jp", styles: "background-color:var(--cnvs-sys-color-surface-alt-default, oklch(0 0 0 / 0.0392));" }
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
compound: [
|
|
@@ -22,21 +22,21 @@ exports.kbdItemStencil = (0, canvas_kit_styling_1.createStencil)({
|
|
|
22
22
|
size: 'large',
|
|
23
23
|
variant: 'default',
|
|
24
24
|
},
|
|
25
|
-
styles: { name: "
|
|
25
|
+
styles: { name: "aq3un", styles: "min-width:var(--cnvs-sys-size-xs, var(--cnvs-sys-space-x6, 1.5rem));padding:0.125rem var(--cnvs-sys-padding-xxs, var(--cnvs-sys-space-x1, 0.25rem));" }
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
modifiers: {
|
|
29
29
|
size: 'medium',
|
|
30
30
|
variant: 'default',
|
|
31
31
|
},
|
|
32
|
-
styles: { name: "
|
|
32
|
+
styles: { name: "1cp8cq", styles: "min-width:var(--cnvs-sys-size-xxs, var(--cnvs-sys-space-x5, 1.25rem));padding:0.125rem var(--cnvs-sys-padding-xxs, var(--cnvs-sys-space-x1, 0.25rem));" }
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
modifiers: {
|
|
36
36
|
size: 'small',
|
|
37
37
|
variant: 'default',
|
|
38
38
|
},
|
|
39
|
-
styles: { name: "
|
|
39
|
+
styles: { name: "41a7ec", styles: "min-width:var(--cnvs-sys-size-xxxs, var(--cnvs-sys-space-x4, 1rem));padding-inline:0.125rem;" }
|
|
40
40
|
}
|
|
41
41
|
]
|
|
42
42
|
}, "kbd-item-9a5f62");
|
|
@@ -7,7 +7,7 @@ const icon_1 = require("@workday/canvas-kit-react/icon");
|
|
|
7
7
|
const canvas_kit_styling_1 = require("@workday/canvas-kit-styling");
|
|
8
8
|
const canvas_system_icons_web_1 = require("@workday/canvas-system-icons-web");
|
|
9
9
|
exports.selectionGroupIconStencil = (0, canvas_kit_styling_1.createStencil)({
|
|
10
|
-
base: { name: "
|
|
10
|
+
base: { name: "497s0y", styles: "box-sizing:border-box;flex-shrink:0;" }
|
|
11
11
|
}, "selection-group-icon-6bc986");
|
|
12
12
|
/**
|
|
13
13
|
* The icon is always rendered, in both modes and in both selected states, so items never shift
|
|
@@ -15,12 +15,12 @@ exports.selectionGroupItemStencil = (0, canvas_kit_styling_1.createStencil)({
|
|
|
15
15
|
parts: {
|
|
16
16
|
label: 'selection-group-item-label',
|
|
17
17
|
},
|
|
18
|
-
base: { name: "
|
|
18
|
+
base: { name: "2auntm", styles: "box-sizing:border-box;--shape-corner-shape-ccab68:var(--cnvs-sys-shape-lg, 0.75rem);font-family:var(--cnvs-sys-font-family-default, \"Roboto\");font-weight:var(--cnvs-sys-font-weight-normal, 400);line-height:var(--cnvs-sys-line-height-subtext-lg, 1.25rem);font-size:var(--cnvs-sys-font-size-subtext-lg, 0.875rem);letter-spacing:var(--cnvs-sys-letter-spacing-subtext-lg, 0.015rem);display:inline-flex;align-items:center;gap:var(--cnvs-base-size-75, 0.375rem);border:0.0625rem solid var(--cnvs-sys-color-border-default);padding:var(--cnvs-sys-padding-xs, var(--cnvs-sys-space-x2, 0.5rem)) var(--cnvs-sys-padding-sm, var(--cnvs-sys-space-x3, 0.75rem));background-color:var(--cnvs-sys-color-surface-default, var(--cnvs-sys-color-bg-default, oklch(1 0 0 / 1)));color:var(--cnvs-sys-color-fg-strong);cursor:pointer;text-align:start;transition:background-color 80ms ease, color 80ms ease, border-color 80ms ease;--color-system-icon-c9acc3:currentColor;--accentColor-system-icon-c9acc3:currentColor;[data-part=\"selection-group-item-label\"]{white-space:nowrap;}&:not([aria-checked=\"true\"]):is(:hover, .hover){background-color:var(--cnvs-sys-color-surface-overlay-hover-default, oklch(0.3343 0.0951 253.3 / 0.05));}&:not([aria-checked=\"true\"]):is(:active, .active){background-color:var(--cnvs-sys-color-surface-overlay-pressed-default, oklch(0.3337 0.0688 250.79 / 0.09));}&:is(:focus-visible, .focus){box-shadow:0 0 0 1px var(--cnvs-sys-color-border-inverse-default, var(--cnvs-base-palette-neutral-0)), 0 0 0 3px var(--cnvs-brand-common-focus-outline, rgba(8,117,225,1));}&:is(:disabled, .disabled){cursor:default;opacity:var(--cnvs-sys-opacity-disabled);&:is(:hover, .hover){background-color:var(--cnvs-sys-color-surface-default, var(--cnvs-sys-color-bg-default, oklch(1 0 0 / 1)));}}&[aria-checked=\"true\"]{background-color:var(--cnvs-sys-color-brand-surface-selected, oklch(0.6152 0.2108 256.1 / 0.11));border:0.0625rem solid transparent;color:var(--cnvs-sys-color-brand-fg-selected, var(--cnvs-brand-primary-dark, oklch(0.4658 0.1562 255.5 / 1)));&:is(:hover, .hover){background-color:var(--cnvs-sys-color-brand-surface-selected, oklch(0.6152 0.2108 256.1 / 0.11));}&:is(:active, .active){background-color:var(--cnvs-sys-color-brand-surface-selected, oklch(0.6152 0.2108 256.1 / 0.11));}&:is(:disabled, .disabled){background-color:var(--cnvs-sys-color-brand-surface-selected, oklch(0.6152 0.2108 256.1 / 0.11));color:var(--cnvs-sys-color-brand-fg-selected, var(--cnvs-brand-primary-dark, oklch(0.4658 0.1562 255.5 / 1)));}}" },
|
|
19
19
|
modifiers: {
|
|
20
20
|
width: {
|
|
21
|
-
content: { name: "
|
|
22
|
-
equal: { name: "
|
|
23
|
-
column: { name: "
|
|
21
|
+
content: { name: "3r20nx", styles: "width:fit-content;" },
|
|
22
|
+
equal: { name: "y2v8k", styles: "width:100%;" },
|
|
23
|
+
column: { name: "3lj57s", styles: "width:100%;" }
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}, "selection-group-item-15e2bc");
|
|
@@ -9,18 +9,18 @@ const canvas_tokens_web_1 = require("@workday/canvas-tokens-web");
|
|
|
9
9
|
const useSelectionGroupModel_1 = require("./hooks/useSelectionGroupModel");
|
|
10
10
|
exports.selectionGroupListStencil = (0, canvas_kit_styling_1.createStencil)({
|
|
11
11
|
extends: common_1.cornerShapeStencil,
|
|
12
|
-
base: { name: "
|
|
12
|
+
base: { name: "1fzd68", styles: "box-sizing:border-box;--shape-corner-shape-ccab68:var(--cnvs-sys-shape-lg, 0.75rem);display:flex;flex-wrap:wrap;gap:var(--cnvs-sys-gap-xs, var(--cnvs-sys-space-x1, 0.25rem));width:fit-content;border:0.125rem solid transparent;padding:var(--cnvs-sys-padding-xxs, var(--cnvs-sys-space-x1, 0.25rem));transition:100ms border-color;" },
|
|
13
13
|
modifiers: {
|
|
14
14
|
width: {
|
|
15
|
-
content: { name: "
|
|
15
|
+
content: { name: "3twysa", styles: "" },
|
|
16
16
|
// `1fr` auto columns inside a `fit-content` grid all resolve to the widest item's
|
|
17
17
|
// max-content width, which sizes every item to the longest label without measuring the DOM.
|
|
18
|
-
equal: { name: "
|
|
19
|
-
column: { name: "
|
|
18
|
+
equal: { name: "39aeb7", styles: "display:grid;grid-auto-flow:column;grid-auto-columns:1fr;" },
|
|
19
|
+
column: { name: "skjsk", styles: "flex-direction:column;flex-wrap:nowrap;width:100%;" }
|
|
20
20
|
},
|
|
21
21
|
error: {
|
|
22
|
-
error: { name: "
|
|
23
|
-
caution: { name: "
|
|
22
|
+
error: { name: "1fm3hb", styles: "border-color:var(--cnvs-sys-color-brand-border-critical, oklch(0.6495 0.2369 30.04 / 1));" },
|
|
23
|
+
caution: { name: "2frcnm", styles: "border-color:var(--cnvs-sys-color-brand-border-caution, var(--cnvs-brand-alert-dark, oklch(0.6601 0.1537 60.7 / 1)));" }
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}, "selection-group-list-25bb89");
|
|
@@ -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
|
+
});
|