@workday/canvas-kit-preview-react 11.0.0-alpha.774-next.0 → 11.0.0-alpha.775-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/dist/commonjs/status-indicator/index.d.ts +1 -2
- package/dist/commonjs/status-indicator/index.d.ts.map +1 -1
- package/dist/commonjs/status-indicator/index.js +3 -12
- package/dist/commonjs/status-indicator/lib/StatusIndicator.d.ts +14 -10
- package/dist/commonjs/status-indicator/lib/StatusIndicator.d.ts.map +1 -1
- package/dist/commonjs/status-indicator/lib/StatusIndicator.js +19 -23
- package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.d.ts +0 -82
- package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.d.ts.map +1 -1
- package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.js +2 -83
- package/dist/commonjs/status-indicator/lib/StatusIndicatorLabel.d.ts.map +1 -1
- package/dist/commonjs/status-indicator/lib/StatusIndicatorLabel.js +7 -2
- package/dist/es6/status-indicator/index.d.ts +1 -2
- package/dist/es6/status-indicator/index.d.ts.map +1 -1
- package/dist/es6/status-indicator/index.js +1 -2
- package/dist/es6/status-indicator/lib/StatusIndicator.d.ts +14 -10
- package/dist/es6/status-indicator/lib/StatusIndicator.d.ts.map +1 -1
- package/dist/es6/status-indicator/lib/StatusIndicator.js +20 -24
- package/dist/es6/status-indicator/lib/StatusIndicatorIcon.d.ts +0 -82
- package/dist/es6/status-indicator/lib/StatusIndicatorIcon.d.ts.map +1 -1
- package/dist/es6/status-indicator/lib/StatusIndicatorIcon.js +2 -83
- package/dist/es6/status-indicator/lib/StatusIndicatorLabel.d.ts.map +1 -1
- package/dist/es6/status-indicator/lib/StatusIndicatorLabel.js +8 -3
- package/package.json +4 -4
- package/status-indicator/index.ts +1 -2
- package/status-indicator/lib/StatusIndicator.tsx +65 -58
- package/status-indicator/lib/StatusIndicatorIcon.tsx +2 -86
- package/status-indicator/lib/StatusIndicatorLabel.tsx +14 -10
- package/dist/commonjs/status-indicator/lib/hooks/index.d.ts +0 -2
- package/dist/commonjs/status-indicator/lib/hooks/index.d.ts.map +0 -1
- package/dist/commonjs/status-indicator/lib/hooks/index.js +0 -13
- package/dist/commonjs/status-indicator/lib/hooks/useStatusIndicatorModel.d.ts +0 -75
- package/dist/commonjs/status-indicator/lib/hooks/useStatusIndicatorModel.d.ts.map +0 -1
- package/dist/commonjs/status-indicator/lib/hooks/useStatusIndicatorModel.js +0 -25
- package/dist/es6/status-indicator/lib/hooks/index.d.ts +0 -2
- package/dist/es6/status-indicator/lib/hooks/index.d.ts.map +0 -1
- package/dist/es6/status-indicator/lib/hooks/index.js +0 -1
- package/dist/es6/status-indicator/lib/hooks/useStatusIndicatorModel.d.ts +0 -75
- package/dist/es6/status-indicator/lib/hooks/useStatusIndicatorModel.d.ts.map +0 -1
- package/dist/es6/status-indicator/lib/hooks/useStatusIndicatorModel.js +0 -22
- package/status-indicator/lib/hooks/index.ts +0 -1
- package/status-indicator/lib/hooks/useStatusIndicatorModel.tsx +0 -29
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../status-indicator/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../status-indicator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAE,oBAAoB,EAAE,sBAAsB,EAAC,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
exports.StatusIndicator = void 0;
|
|
4
|
+
var StatusIndicator_1 = require("./lib/StatusIndicator");
|
|
5
|
+
Object.defineProperty(exports, "StatusIndicator", { enumerable: true, get: function () { return StatusIndicator_1.StatusIndicator; } });
|
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ExtractProps } from '@workday/canvas-kit-react/common';
|
|
3
3
|
import { Flex } from '@workday/canvas-kit-react/layout';
|
|
4
|
+
export declare type StatusIndicatorVariant = 'gray' | 'orange' | 'blue' | 'green' | 'red' | 'transparent';
|
|
4
5
|
export interface StatusIndicatorProps extends ExtractProps<typeof Flex, never> {
|
|
6
|
+
/**
|
|
7
|
+
* Defines the emphasis of the `StatusIndicator`.
|
|
8
|
+
* `high` emphasis will create more contrast between the background and text colors.
|
|
9
|
+
* `low` emphasis will create less contrast between the background and text colors.
|
|
10
|
+
* @default 'low'
|
|
11
|
+
*/
|
|
12
|
+
emphasis?: 'high' | 'low';
|
|
13
|
+
/**
|
|
14
|
+
* Defines the color of the `StatusIndicator`.
|
|
15
|
+
* @default 'gray'
|
|
16
|
+
*/
|
|
17
|
+
variant?: StatusIndicatorVariant;
|
|
5
18
|
/**
|
|
6
19
|
* Children of the `StatusIndicator`. Can contain a `StatusIndicator.Label` and optionally a `StatusIndicator.Icon`.
|
|
7
20
|
*/
|
|
@@ -17,16 +30,7 @@ export interface StatusIndicatorProps extends ExtractProps<typeof Flex, never> {
|
|
|
17
30
|
* </StatusIndicator>
|
|
18
31
|
* ```
|
|
19
32
|
*/
|
|
20
|
-
export declare const StatusIndicator: import("@workday/canvas-kit-react/common").
|
|
21
|
-
emphasis: import("./hooks").StatusIndicatorEmphasis;
|
|
22
|
-
variant: import("./hooks").StatusIndicatorVariant;
|
|
23
|
-
}> & {} & {}, {
|
|
24
|
-
state: {
|
|
25
|
-
emphasis: import("./hooks").StatusIndicatorEmphasis;
|
|
26
|
-
variant: import("./hooks").StatusIndicatorVariant;
|
|
27
|
-
};
|
|
28
|
-
events: {};
|
|
29
|
-
}> & {
|
|
33
|
+
export declare const StatusIndicator: import("@workday/canvas-kit-react/common").ElementComponent<"div", StatusIndicatorProps> & {
|
|
30
34
|
/**
|
|
31
35
|
* `StatusIndicator.Label` renders {@link Text} under the hood. It will apply an ellipsis if its
|
|
32
36
|
* contents exceed the component's maximum width.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusIndicator.d.ts","sourceRoot":"","sources":["../../../../status-indicator/lib/StatusIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,YAAY,EAAkB,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"StatusIndicator.d.ts","sourceRoot":"","sources":["../../../../status-indicator/lib/StatusIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,YAAY,EAAkB,MAAM,kCAAkC,CAAC;AAG/E,OAAO,EAAC,IAAI,EAAc,MAAM,kCAAkC,CAAC;AAKnE,oBAAY,sBAAsB,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,aAAa,CAAC;AAElG,MAAM,WAAW,oBAAqB,SAAQ,YAAY,CAAC,OAAO,IAAI,EAAE,KAAK,CAAC;IAC5E;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,sBAAsB,CAAC;IACjC;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAwFD;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe;IAGxB;;;;;;;OAOG;;IAEH;;;;;;;OAOG;;CAcL,CAAC"}
|
|
@@ -6,43 +6,39 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.StatusIndicator = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const common_1 = require("@workday/canvas-kit-react/common");
|
|
9
|
+
const canvas_kit_styling_1 = require("@workday/canvas-kit-styling");
|
|
10
|
+
const canvas_tokens_web_1 = require("@workday/canvas-tokens-web");
|
|
9
11
|
const layout_1 = require("@workday/canvas-kit-react/layout");
|
|
10
12
|
const icon_1 = require("@workday/canvas-kit-react/icon");
|
|
11
13
|
const StatusIndicatorIcon_1 = require("./StatusIndicatorIcon");
|
|
12
14
|
const StatusIndicatorLabel_1 = require("./StatusIndicatorLabel");
|
|
13
|
-
const hooks_1 = require("./hooks");
|
|
14
|
-
const canvas_kit_styling_1 = require("@workday/canvas-kit-styling");
|
|
15
|
-
const canvas_tokens_web_1 = require("@workday/canvas-tokens-web");
|
|
16
15
|
const statusIndicatorStencil = canvas_kit_styling_1.createStencil({
|
|
17
|
-
base: { name: "
|
|
16
|
+
base: { name: "f088dd", styles: "box-sizing:border-box;display:inline-flex;gap:var(--cnvs-sys-space-x1);max-width:12.5rem;align-items:center;border-radius:var(--cnvs-sys-shape-half);height:1.25rem;padding:var(--cnvs-sys-space-zero) var(--cnvs-sys-space-x1)};" },
|
|
18
17
|
modifiers: {
|
|
19
18
|
gray: {
|
|
20
|
-
high: { name: "
|
|
21
|
-
low: { name: "
|
|
19
|
+
high: { name: "bbe564", styles: "color:var(--cnvs-sys-color-static-white);--cnvs-preview-system-icon-color:var(--cnvs-sys-color-static-white);background:var(--cnvs-sys-color-static-gray-default);" },
|
|
20
|
+
low: { name: "ff8112", styles: "color:var(--cnvs-sys-color-static-gray-strong);--cnvs-preview-system-icon-color:var(--cnvs-sys-color-static-gray-strong);background:var(--cnvs-sys-color-static-gray-soft);" }
|
|
22
21
|
},
|
|
23
22
|
orange: {
|
|
24
|
-
high: { name: "
|
|
25
|
-
low: { name: "
|
|
23
|
+
high: { name: "ccfc55", styles: "color:var(--cnvs-sys-color-static-gray-stronger);--cnvs-preview-system-icon-color:var(--cnvs-sys-color-static-gray-stronger);background:var(--cnvs-sys-color-static-orange-default);" },
|
|
24
|
+
low: { name: "346026", styles: "color:var(--cnvs-sys-color-static-gold-stronger);--cnvs-preview-system-icon-color:var(--cnvs-sys-color-static-gold-stronger);background:var(--cnvs-sys-color-static-orange-soft);" }
|
|
26
25
|
},
|
|
27
26
|
blue: {
|
|
28
|
-
high: { name: "
|
|
29
|
-
low: { name: "
|
|
27
|
+
high: { name: "9682a7", styles: "color:var(--cnvs-sys-color-static-white);--cnvs-preview-system-icon-color:var(--cnvs-sys-color-static-white);background:var(--cnvs-sys-color-static-blue-default);" },
|
|
28
|
+
low: { name: "77ced2", styles: "color:var(--cnvs-sys-color-static-blue-strong);--cnvs-preview-system-icon-color:var(--cnvs-sys-color-static-blue-strong);background:var(--cnvs-sys-color-static-blue-soft);" }
|
|
30
29
|
},
|
|
31
30
|
green: {
|
|
32
|
-
high: { name: "
|
|
33
|
-
low: { name: "
|
|
31
|
+
high: { name: "41233c", styles: "color:var(--cnvs-sys-color-static-white);--cnvs-preview-system-icon-color:var(--cnvs-sys-color-static-white);background:var(--cnvs-sys-color-static-green-strong);" },
|
|
32
|
+
low: { name: "b6b0e1", styles: "color:var(--cnvs-sys-color-static-green-strong);--cnvs-preview-system-icon-color:var(--cnvs-sys-color-static-green-strong);background:var(--cnvs-sys-color-static-green-soft);" }
|
|
34
33
|
},
|
|
35
34
|
red: {
|
|
36
|
-
high: { name: "
|
|
37
|
-
low: { name: "
|
|
35
|
+
high: { name: "a1e4f5", styles: "color:var(--cnvs-sys-color-static-white);--cnvs-preview-system-icon-color:var(--cnvs-sys-color-static-white);background:var(--cnvs-sys-color-static-red-default);" },
|
|
36
|
+
low: { name: "640784", styles: "color:var(--cnvs-sys-color-static-red-strong);--cnvs-preview-system-icon-color:var(--cnvs-sys-color-static-red-strong);background:var(--cnvs-sys-color-static-red-soft);" }
|
|
38
37
|
},
|
|
39
38
|
transparent: {
|
|
40
|
-
high: { name: "
|
|
41
|
-
low: { name: "
|
|
39
|
+
high: { name: "91853f", styles: "color:var(--cnvs-sys-color-static-white);--cnvs-preview-system-icon-color:var(--cnvs-sys-color-static-white);background:var(--cnvs-sys-color-bg-translucent);" },
|
|
40
|
+
low: { name: "cee730", styles: "color:var(--cnvs-sys-color-static-white);--cnvs-preview-system-icon-color:var(--cnvs-sys-color-static-white);background:var(--cnvs-sys-color-bg-translucent);" }
|
|
42
41
|
}
|
|
43
|
-
},
|
|
44
|
-
defaultModifiers: {
|
|
45
|
-
gray: 'low',
|
|
46
42
|
}
|
|
47
43
|
}, "cnvs-preview-status-indicator");
|
|
48
44
|
/**
|
|
@@ -55,9 +51,8 @@ const statusIndicatorStencil = canvas_kit_styling_1.createStencil({
|
|
|
55
51
|
* </StatusIndicator>
|
|
56
52
|
* ```
|
|
57
53
|
*/
|
|
58
|
-
exports.StatusIndicator = common_1.
|
|
54
|
+
exports.StatusIndicator = common_1.createComponent('div')({
|
|
59
55
|
displayName: 'StatusIndicator',
|
|
60
|
-
modelHook: hooks_1.useStatusIndicatorModel,
|
|
61
56
|
subComponents: {
|
|
62
57
|
/**
|
|
63
58
|
* `StatusIndicator.Label` renders {@link Text} under the hood. It will apply an ellipsis if its
|
|
@@ -78,6 +73,7 @@ exports.StatusIndicator = common_1.createContainer('div')({
|
|
|
78
73
|
*/
|
|
79
74
|
Icon: StatusIndicatorIcon_1.StatusIndicatorIcon,
|
|
80
75
|
},
|
|
81
|
-
|
|
82
|
-
|
|
76
|
+
Component: ({ emphasis = 'low', variant = 'gray', children, ...elemProps }, ref, Element) => {
|
|
77
|
+
return (react_1.default.createElement(Element, Object.assign({ ref: ref }, layout_1.mergeStyles(elemProps, statusIndicatorStencil({ [variant]: emphasis }))), children));
|
|
78
|
+
},
|
|
83
79
|
});
|
|
@@ -1,87 +1,5 @@
|
|
|
1
1
|
import { SystemIconProps } from '@workday/canvas-kit-react/icon';
|
|
2
2
|
export interface StatusIndicatorIconProps extends SystemIconProps {
|
|
3
3
|
}
|
|
4
|
-
/**
|
|
5
|
-
* ### ⚠️ We've deprecated `statusIndicatorColors` for StatusIndicator because it's now directly handeled by Style Utility. ⚠️
|
|
6
|
-
* Please consider using [`StatusIndicator`](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator--basic) instead.
|
|
7
|
-
* @deprecated
|
|
8
|
-
*/
|
|
9
|
-
export declare const statusIndicatorColors: {
|
|
10
|
-
gray: {
|
|
11
|
-
high: {
|
|
12
|
-
text: string;
|
|
13
|
-
background: string;
|
|
14
|
-
};
|
|
15
|
-
low: {
|
|
16
|
-
text: string;
|
|
17
|
-
background: string;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
orange: {
|
|
21
|
-
high: {
|
|
22
|
-
text: string;
|
|
23
|
-
background: string;
|
|
24
|
-
};
|
|
25
|
-
low: {
|
|
26
|
-
text: string;
|
|
27
|
-
background: string;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
blue: {
|
|
31
|
-
high: {
|
|
32
|
-
text: string;
|
|
33
|
-
background: string;
|
|
34
|
-
};
|
|
35
|
-
low: {
|
|
36
|
-
text: string;
|
|
37
|
-
background: string;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
green: {
|
|
41
|
-
high: {
|
|
42
|
-
text: string;
|
|
43
|
-
background: string;
|
|
44
|
-
};
|
|
45
|
-
low: {
|
|
46
|
-
text: string;
|
|
47
|
-
background: string;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
red: {
|
|
51
|
-
high: {
|
|
52
|
-
text: string;
|
|
53
|
-
background: string;
|
|
54
|
-
};
|
|
55
|
-
low: {
|
|
56
|
-
text: string;
|
|
57
|
-
background: string;
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
transparent: {
|
|
61
|
-
high: {
|
|
62
|
-
text: string;
|
|
63
|
-
background: string;
|
|
64
|
-
};
|
|
65
|
-
low: {
|
|
66
|
-
text: string;
|
|
67
|
-
background: string;
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* ### ⚠️ We've deprecated `useStatusIndicatorIcon` for StatusIndicatorIcon because it's now directly handeled by Style Utility. ⚠️
|
|
73
|
-
* Please consider using [`StatusIndicatorIcon`](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator--icon) instead.
|
|
74
|
-
* @deprecated
|
|
75
|
-
*/
|
|
76
|
-
export declare const useStatusIndicatorIcon: import("@workday/canvas-kit-react/common").BehaviorHook<{
|
|
77
|
-
state: {
|
|
78
|
-
emphasis: import("./hooks").StatusIndicatorEmphasis;
|
|
79
|
-
variant: import("./hooks").StatusIndicatorVariant;
|
|
80
|
-
};
|
|
81
|
-
events: {};
|
|
82
|
-
}, {
|
|
83
|
-
color: string;
|
|
84
|
-
colorHover: string;
|
|
85
|
-
}>;
|
|
86
4
|
export declare const StatusIndicatorIcon: import("@workday/canvas-kit-react/common").ElementComponent<"span", SystemIconProps>;
|
|
87
5
|
//# sourceMappingURL=StatusIndicatorIcon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusIndicatorIcon.d.ts","sourceRoot":"","sources":["../../../../status-indicator/lib/StatusIndicatorIcon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StatusIndicatorIcon.d.ts","sourceRoot":"","sources":["../../../../status-indicator/lib/StatusIndicatorIcon.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAa,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAE3E,MAAM,WAAW,wBAAyB,SAAQ,eAAe;CAAG;AAEpE,eAAO,MAAM,mBAAmB,sFAK9B,CAAC"}
|
|
@@ -3,94 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.StatusIndicatorIcon =
|
|
6
|
+
exports.StatusIndicatorIcon = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const common_1 = require("@workday/canvas-kit-react/common");
|
|
9
|
-
const tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
10
9
|
const icon_1 = require("@workday/canvas-kit-react/icon");
|
|
11
|
-
const hooks_1 = require("./hooks");
|
|
12
|
-
/**
|
|
13
|
-
* ### ⚠️ We've deprecated `statusIndicatorColors` for StatusIndicator because it's now directly handeled by Style Utility. ⚠️
|
|
14
|
-
* Please consider using [`StatusIndicator`](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator--basic) instead.
|
|
15
|
-
* @deprecated
|
|
16
|
-
*/
|
|
17
|
-
exports.statusIndicatorColors = {
|
|
18
|
-
gray: {
|
|
19
|
-
high: {
|
|
20
|
-
text: tokens_1.colors.frenchVanilla100,
|
|
21
|
-
background: tokens_1.colors.licorice300,
|
|
22
|
-
},
|
|
23
|
-
low: {
|
|
24
|
-
text: tokens_1.colors.licorice400,
|
|
25
|
-
background: tokens_1.colors.soap300,
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
orange: {
|
|
29
|
-
high: {
|
|
30
|
-
text: tokens_1.colors.licorice500,
|
|
31
|
-
background: tokens_1.colors.cantaloupe400,
|
|
32
|
-
},
|
|
33
|
-
low: {
|
|
34
|
-
text: tokens_1.colors.toastedMarshmallow600,
|
|
35
|
-
background: tokens_1.colors.cantaloupe100,
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
blue: {
|
|
39
|
-
high: {
|
|
40
|
-
text: tokens_1.colors.frenchVanilla100,
|
|
41
|
-
background: tokens_1.colors.blueberry400,
|
|
42
|
-
},
|
|
43
|
-
low: {
|
|
44
|
-
text: tokens_1.colors.blueberry500,
|
|
45
|
-
background: tokens_1.colors.blueberry100,
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
green: {
|
|
49
|
-
high: {
|
|
50
|
-
text: tokens_1.colors.frenchVanilla100,
|
|
51
|
-
background: tokens_1.colors.greenApple600,
|
|
52
|
-
},
|
|
53
|
-
low: {
|
|
54
|
-
text: tokens_1.colors.greenApple600,
|
|
55
|
-
background: tokens_1.colors.greenApple100,
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
red: {
|
|
59
|
-
high: {
|
|
60
|
-
text: tokens_1.colors.frenchVanilla100,
|
|
61
|
-
background: tokens_1.colors.cinnamon500,
|
|
62
|
-
},
|
|
63
|
-
low: {
|
|
64
|
-
text: tokens_1.colors.cinnamon600,
|
|
65
|
-
background: tokens_1.colors.cinnamon100,
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
transparent: {
|
|
69
|
-
high: {
|
|
70
|
-
text: tokens_1.colors.frenchVanilla100,
|
|
71
|
-
background: tokens_1.colors.blackPepper600,
|
|
72
|
-
},
|
|
73
|
-
low: {
|
|
74
|
-
text: tokens_1.colors.frenchVanilla100,
|
|
75
|
-
background: tokens_1.colors.blackPepper600,
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
};
|
|
79
|
-
/**
|
|
80
|
-
* ### ⚠️ We've deprecated `useStatusIndicatorIcon` for StatusIndicatorIcon because it's now directly handeled by Style Utility. ⚠️
|
|
81
|
-
* Please consider using [`StatusIndicatorIcon`](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator--icon) instead.
|
|
82
|
-
* @deprecated
|
|
83
|
-
*/
|
|
84
|
-
exports.useStatusIndicatorIcon = common_1.createElemPropsHook(hooks_1.useStatusIndicatorModel)(({ state }) => {
|
|
85
|
-
const colors = exports.statusIndicatorColors[state.variant][state.emphasis];
|
|
86
|
-
return {
|
|
87
|
-
color: colors.text,
|
|
88
|
-
colorHover: colors.text,
|
|
89
|
-
};
|
|
90
|
-
});
|
|
91
10
|
exports.StatusIndicatorIcon = common_1.createComponent('span')({
|
|
92
11
|
displayName: 'StatusIndicatorIcon',
|
|
93
12
|
Component: (elemProps, ref, Element) => {
|
|
94
|
-
return react_1.default.createElement(icon_1.SystemIcon, Object.assign({ as: Element, size: 20, role: "img" }, elemProps));
|
|
13
|
+
return react_1.default.createElement(icon_1.SystemIcon, Object.assign({ as: Element, ref: ref, size: 20, role: "img" }, elemProps));
|
|
95
14
|
},
|
|
96
15
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusIndicatorLabel.d.ts","sourceRoot":"","sources":["../../../../status-indicator/lib/StatusIndicatorLabel.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"StatusIndicatorLabel.d.ts","sourceRoot":"","sources":["../../../../status-indicator/lib/StatusIndicatorLabel.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAC,SAAS,EAAc,MAAM,gCAAgC,CAAC;AAKtE,MAAM,WAAW,yBAA0B,SAAQ,SAAS;CAAG;AAe/D,eAAO,MAAM,oBAAoB,gGAS/B,CAAC"}
|
|
@@ -6,13 +6,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.StatusIndicatorLabel = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const common_1 = require("@workday/canvas-kit-react/common");
|
|
9
|
+
const text_1 = require("@workday/canvas-kit-react/text");
|
|
9
10
|
const canvas_kit_styling_1 = require("@workday/canvas-kit-styling");
|
|
10
11
|
const layout_1 = require("@workday/canvas-kit-react/layout");
|
|
11
12
|
const canvas_tokens_web_1 = require("@workday/canvas-tokens-web");
|
|
12
|
-
const
|
|
13
|
+
const statusIndicatorLabelStencil = canvas_kit_styling_1.createStencil({
|
|
14
|
+
extends: text_1.textStencil,
|
|
15
|
+
base: { name: "bcf5be", styles: "box-sizing:border-box;font-weight:var(--cnvs-sys-font-weight-bold);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-transform:capitalize;color:inherit;" },
|
|
16
|
+
defaultModifiers: { typeLevel: 'subtext.large' }
|
|
17
|
+
}, "cnvs-preview-status-indicator-label");
|
|
13
18
|
exports.StatusIndicatorLabel = common_1.createComponent('span')({
|
|
14
19
|
displayName: 'StatusIndicator.Label',
|
|
15
20
|
Component: ({ children, ...elemProps }, ref, Element) => {
|
|
16
|
-
return (react_1.default.createElement(Element, Object.assign({ ref: ref }, layout_1.mergeStyles(elemProps,
|
|
21
|
+
return (react_1.default.createElement(Element, Object.assign({ ref: ref }, layout_1.mergeStyles(elemProps, statusIndicatorLabelStencil())), children));
|
|
17
22
|
},
|
|
18
23
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../status-indicator/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../status-indicator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAE,oBAAoB,EAAE,sBAAsB,EAAC,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export * from './lib/hooks/useStatusIndicatorModel';
|
|
1
|
+
export { StatusIndicator } from './lib/StatusIndicator';
|
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ExtractProps } from '@workday/canvas-kit-react/common';
|
|
3
3
|
import { Flex } from '@workday/canvas-kit-react/layout';
|
|
4
|
+
export declare type StatusIndicatorVariant = 'gray' | 'orange' | 'blue' | 'green' | 'red' | 'transparent';
|
|
4
5
|
export interface StatusIndicatorProps extends ExtractProps<typeof Flex, never> {
|
|
6
|
+
/**
|
|
7
|
+
* Defines the emphasis of the `StatusIndicator`.
|
|
8
|
+
* `high` emphasis will create more contrast between the background and text colors.
|
|
9
|
+
* `low` emphasis will create less contrast between the background and text colors.
|
|
10
|
+
* @default 'low'
|
|
11
|
+
*/
|
|
12
|
+
emphasis?: 'high' | 'low';
|
|
13
|
+
/**
|
|
14
|
+
* Defines the color of the `StatusIndicator`.
|
|
15
|
+
* @default 'gray'
|
|
16
|
+
*/
|
|
17
|
+
variant?: StatusIndicatorVariant;
|
|
5
18
|
/**
|
|
6
19
|
* Children of the `StatusIndicator`. Can contain a `StatusIndicator.Label` and optionally a `StatusIndicator.Icon`.
|
|
7
20
|
*/
|
|
@@ -17,16 +30,7 @@ export interface StatusIndicatorProps extends ExtractProps<typeof Flex, never> {
|
|
|
17
30
|
* </StatusIndicator>
|
|
18
31
|
* ```
|
|
19
32
|
*/
|
|
20
|
-
export declare const StatusIndicator: import("@workday/canvas-kit-react/common").
|
|
21
|
-
emphasis: import("./hooks").StatusIndicatorEmphasis;
|
|
22
|
-
variant: import("./hooks").StatusIndicatorVariant;
|
|
23
|
-
}> & {} & {}, {
|
|
24
|
-
state: {
|
|
25
|
-
emphasis: import("./hooks").StatusIndicatorEmphasis;
|
|
26
|
-
variant: import("./hooks").StatusIndicatorVariant;
|
|
27
|
-
};
|
|
28
|
-
events: {};
|
|
29
|
-
}> & {
|
|
33
|
+
export declare const StatusIndicator: import("@workday/canvas-kit-react/common").ElementComponent<"div", StatusIndicatorProps> & {
|
|
30
34
|
/**
|
|
31
35
|
* `StatusIndicator.Label` renders {@link Text} under the hood. It will apply an ellipsis if its
|
|
32
36
|
* contents exceed the component's maximum width.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusIndicator.d.ts","sourceRoot":"","sources":["../../../../status-indicator/lib/StatusIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,YAAY,EAAkB,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"StatusIndicator.d.ts","sourceRoot":"","sources":["../../../../status-indicator/lib/StatusIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,YAAY,EAAkB,MAAM,kCAAkC,CAAC;AAG/E,OAAO,EAAC,IAAI,EAAc,MAAM,kCAAkC,CAAC;AAKnE,oBAAY,sBAAsB,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,aAAa,CAAC;AAElG,MAAM,WAAW,oBAAqB,SAAQ,YAAY,CAAC,OAAO,IAAI,EAAE,KAAK,CAAC;IAC5E;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,sBAAsB,CAAC;IACjC;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAwFD;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe;IAGxB;;;;;;;OAOG;;IAEH;;;;;;;OAOG;;CAcL,CAAC"}
|
|
@@ -1,42 +1,38 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { createComponent } from '@workday/canvas-kit-react/common';
|
|
3
|
+
import { createStencil, px2rem } from '@workday/canvas-kit-styling';
|
|
4
|
+
import { system } from '@workday/canvas-tokens-web';
|
|
3
5
|
import { mergeStyles } from '@workday/canvas-kit-react/layout';
|
|
4
6
|
import { systemIconStencil } from '@workday/canvas-kit-react/icon';
|
|
5
7
|
import { StatusIndicatorIcon } from './StatusIndicatorIcon';
|
|
6
8
|
import { StatusIndicatorLabel } from './StatusIndicatorLabel';
|
|
7
|
-
import { useStatusIndicatorModel } from './hooks';
|
|
8
|
-
import { createStencil, px2rem } from '@workday/canvas-kit-styling';
|
|
9
|
-
import { base, system } from '@workday/canvas-tokens-web';
|
|
10
9
|
const statusIndicatorStencil = createStencil({
|
|
11
|
-
base: { name: "
|
|
10
|
+
base: { name: "f088dd", styles: "box-sizing:border-box;display:inline-flex;gap:var(--cnvs-sys-space-x1);max-width:12.5rem;align-items:center;border-radius:var(--cnvs-sys-shape-half);height:1.25rem;padding:var(--cnvs-sys-space-zero) var(--cnvs-sys-space-x1)};" },
|
|
12
11
|
modifiers: {
|
|
13
12
|
gray: {
|
|
14
|
-
high: { name: "
|
|
15
|
-
low: { name: "
|
|
13
|
+
high: { name: "bbe564", styles: "color:var(--cnvs-sys-color-static-white);--cnvs-preview-system-icon-color:var(--cnvs-sys-color-static-white);background:var(--cnvs-sys-color-static-gray-default);" },
|
|
14
|
+
low: { name: "ff8112", styles: "color:var(--cnvs-sys-color-static-gray-strong);--cnvs-preview-system-icon-color:var(--cnvs-sys-color-static-gray-strong);background:var(--cnvs-sys-color-static-gray-soft);" }
|
|
16
15
|
},
|
|
17
16
|
orange: {
|
|
18
|
-
high: { name: "
|
|
19
|
-
low: { name: "
|
|
17
|
+
high: { name: "ccfc55", styles: "color:var(--cnvs-sys-color-static-gray-stronger);--cnvs-preview-system-icon-color:var(--cnvs-sys-color-static-gray-stronger);background:var(--cnvs-sys-color-static-orange-default);" },
|
|
18
|
+
low: { name: "346026", styles: "color:var(--cnvs-sys-color-static-gold-stronger);--cnvs-preview-system-icon-color:var(--cnvs-sys-color-static-gold-stronger);background:var(--cnvs-sys-color-static-orange-soft);" }
|
|
20
19
|
},
|
|
21
20
|
blue: {
|
|
22
|
-
high: { name: "
|
|
23
|
-
low: { name: "
|
|
21
|
+
high: { name: "9682a7", styles: "color:var(--cnvs-sys-color-static-white);--cnvs-preview-system-icon-color:var(--cnvs-sys-color-static-white);background:var(--cnvs-sys-color-static-blue-default);" },
|
|
22
|
+
low: { name: "77ced2", styles: "color:var(--cnvs-sys-color-static-blue-strong);--cnvs-preview-system-icon-color:var(--cnvs-sys-color-static-blue-strong);background:var(--cnvs-sys-color-static-blue-soft);" }
|
|
24
23
|
},
|
|
25
24
|
green: {
|
|
26
|
-
high: { name: "
|
|
27
|
-
low: { name: "
|
|
25
|
+
high: { name: "41233c", styles: "color:var(--cnvs-sys-color-static-white);--cnvs-preview-system-icon-color:var(--cnvs-sys-color-static-white);background:var(--cnvs-sys-color-static-green-strong);" },
|
|
26
|
+
low: { name: "b6b0e1", styles: "color:var(--cnvs-sys-color-static-green-strong);--cnvs-preview-system-icon-color:var(--cnvs-sys-color-static-green-strong);background:var(--cnvs-sys-color-static-green-soft);" }
|
|
28
27
|
},
|
|
29
28
|
red: {
|
|
30
|
-
high: { name: "
|
|
31
|
-
low: { name: "
|
|
29
|
+
high: { name: "a1e4f5", styles: "color:var(--cnvs-sys-color-static-white);--cnvs-preview-system-icon-color:var(--cnvs-sys-color-static-white);background:var(--cnvs-sys-color-static-red-default);" },
|
|
30
|
+
low: { name: "640784", styles: "color:var(--cnvs-sys-color-static-red-strong);--cnvs-preview-system-icon-color:var(--cnvs-sys-color-static-red-strong);background:var(--cnvs-sys-color-static-red-soft);" }
|
|
32
31
|
},
|
|
33
32
|
transparent: {
|
|
34
|
-
high: { name: "
|
|
35
|
-
low: { name: "
|
|
33
|
+
high: { name: "91853f", styles: "color:var(--cnvs-sys-color-static-white);--cnvs-preview-system-icon-color:var(--cnvs-sys-color-static-white);background:var(--cnvs-sys-color-bg-translucent);" },
|
|
34
|
+
low: { name: "cee730", styles: "color:var(--cnvs-sys-color-static-white);--cnvs-preview-system-icon-color:var(--cnvs-sys-color-static-white);background:var(--cnvs-sys-color-bg-translucent);" }
|
|
36
35
|
}
|
|
37
|
-
},
|
|
38
|
-
defaultModifiers: {
|
|
39
|
-
gray: 'low',
|
|
40
36
|
}
|
|
41
37
|
}, "cnvs-preview-status-indicator");
|
|
42
38
|
/**
|
|
@@ -49,9 +45,8 @@ const statusIndicatorStencil = createStencil({
|
|
|
49
45
|
* </StatusIndicator>
|
|
50
46
|
* ```
|
|
51
47
|
*/
|
|
52
|
-
export const StatusIndicator =
|
|
48
|
+
export const StatusIndicator = createComponent('div')({
|
|
53
49
|
displayName: 'StatusIndicator',
|
|
54
|
-
modelHook: useStatusIndicatorModel,
|
|
55
50
|
subComponents: {
|
|
56
51
|
/**
|
|
57
52
|
* `StatusIndicator.Label` renders {@link Text} under the hood. It will apply an ellipsis if its
|
|
@@ -72,6 +67,7 @@ export const StatusIndicator = createContainer('div')({
|
|
|
72
67
|
*/
|
|
73
68
|
Icon: StatusIndicatorIcon,
|
|
74
69
|
},
|
|
75
|
-
|
|
76
|
-
|
|
70
|
+
Component: ({ emphasis = 'low', variant = 'gray', children, ...elemProps }, ref, Element) => {
|
|
71
|
+
return (React.createElement(Element, Object.assign({ ref: ref }, mergeStyles(elemProps, statusIndicatorStencil({ [variant]: emphasis }))), children));
|
|
72
|
+
},
|
|
77
73
|
});
|
|
@@ -1,87 +1,5 @@
|
|
|
1
1
|
import { SystemIconProps } from '@workday/canvas-kit-react/icon';
|
|
2
2
|
export interface StatusIndicatorIconProps extends SystemIconProps {
|
|
3
3
|
}
|
|
4
|
-
/**
|
|
5
|
-
* ### ⚠️ We've deprecated `statusIndicatorColors` for StatusIndicator because it's now directly handeled by Style Utility. ⚠️
|
|
6
|
-
* Please consider using [`StatusIndicator`](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator--basic) instead.
|
|
7
|
-
* @deprecated
|
|
8
|
-
*/
|
|
9
|
-
export declare const statusIndicatorColors: {
|
|
10
|
-
gray: {
|
|
11
|
-
high: {
|
|
12
|
-
text: string;
|
|
13
|
-
background: string;
|
|
14
|
-
};
|
|
15
|
-
low: {
|
|
16
|
-
text: string;
|
|
17
|
-
background: string;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
orange: {
|
|
21
|
-
high: {
|
|
22
|
-
text: string;
|
|
23
|
-
background: string;
|
|
24
|
-
};
|
|
25
|
-
low: {
|
|
26
|
-
text: string;
|
|
27
|
-
background: string;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
blue: {
|
|
31
|
-
high: {
|
|
32
|
-
text: string;
|
|
33
|
-
background: string;
|
|
34
|
-
};
|
|
35
|
-
low: {
|
|
36
|
-
text: string;
|
|
37
|
-
background: string;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
green: {
|
|
41
|
-
high: {
|
|
42
|
-
text: string;
|
|
43
|
-
background: string;
|
|
44
|
-
};
|
|
45
|
-
low: {
|
|
46
|
-
text: string;
|
|
47
|
-
background: string;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
red: {
|
|
51
|
-
high: {
|
|
52
|
-
text: string;
|
|
53
|
-
background: string;
|
|
54
|
-
};
|
|
55
|
-
low: {
|
|
56
|
-
text: string;
|
|
57
|
-
background: string;
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
transparent: {
|
|
61
|
-
high: {
|
|
62
|
-
text: string;
|
|
63
|
-
background: string;
|
|
64
|
-
};
|
|
65
|
-
low: {
|
|
66
|
-
text: string;
|
|
67
|
-
background: string;
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* ### ⚠️ We've deprecated `useStatusIndicatorIcon` for StatusIndicatorIcon because it's now directly handeled by Style Utility. ⚠️
|
|
73
|
-
* Please consider using [`StatusIndicatorIcon`](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator--icon) instead.
|
|
74
|
-
* @deprecated
|
|
75
|
-
*/
|
|
76
|
-
export declare const useStatusIndicatorIcon: import("@workday/canvas-kit-react/common").BehaviorHook<{
|
|
77
|
-
state: {
|
|
78
|
-
emphasis: import("./hooks").StatusIndicatorEmphasis;
|
|
79
|
-
variant: import("./hooks").StatusIndicatorVariant;
|
|
80
|
-
};
|
|
81
|
-
events: {};
|
|
82
|
-
}, {
|
|
83
|
-
color: string;
|
|
84
|
-
colorHover: string;
|
|
85
|
-
}>;
|
|
86
4
|
export declare const StatusIndicatorIcon: import("@workday/canvas-kit-react/common").ElementComponent<"span", SystemIconProps>;
|
|
87
5
|
//# sourceMappingURL=StatusIndicatorIcon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusIndicatorIcon.d.ts","sourceRoot":"","sources":["../../../../status-indicator/lib/StatusIndicatorIcon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StatusIndicatorIcon.d.ts","sourceRoot":"","sources":["../../../../status-indicator/lib/StatusIndicatorIcon.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAa,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAE3E,MAAM,WAAW,wBAAyB,SAAQ,eAAe;CAAG;AAEpE,eAAO,MAAM,mBAAmB,sFAK9B,CAAC"}
|