@workday/canvas-kit-preview-react 8.0.0-alpha.234-next.5 → 8.0.0-alpha.235-next.6
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/index.d.ts +1 -0
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +1 -0
- package/dist/commonjs/status-indicator/index.d.ts +2 -0
- package/dist/commonjs/status-indicator/index.d.ts.map +1 -0
- package/dist/commonjs/status-indicator/index.js +13 -0
- package/dist/commonjs/status-indicator/lib/StatusIndicator.d.ts +50 -0
- package/dist/commonjs/status-indicator/lib/StatusIndicator.d.ts.map +1 -0
- package/dist/commonjs/status-indicator/lib/StatusIndicator.js +55 -0
- package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.d.ts +73 -0
- package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.d.ts.map +1 -0
- package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.js +98 -0
- package/dist/commonjs/status-indicator/lib/StatusIndicatorLabel.d.ts +5 -0
- package/dist/commonjs/status-indicator/lib/StatusIndicatorLabel.d.ts.map +1 -0
- package/dist/commonjs/status-indicator/lib/StatusIndicatorLabel.js +38 -0
- package/dist/commonjs/status-indicator/lib/hooks/index.d.ts +2 -0
- package/dist/commonjs/status-indicator/lib/hooks/index.d.ts.map +1 -0
- package/dist/commonjs/status-indicator/lib/hooks/index.js +13 -0
- package/dist/commonjs/status-indicator/lib/hooks/useStatusIndicatorModel.d.ts +75 -0
- package/dist/commonjs/status-indicator/lib/hooks/useStatusIndicatorModel.d.ts.map +1 -0
- package/dist/commonjs/status-indicator/lib/hooks/useStatusIndicatorModel.js +34 -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/dist/es6/status-indicator/index.d.ts +2 -0
- package/dist/es6/status-indicator/index.d.ts.map +1 -0
- package/dist/es6/status-indicator/index.js +1 -0
- package/dist/es6/status-indicator/lib/StatusIndicator.d.ts +50 -0
- package/dist/es6/status-indicator/lib/StatusIndicator.d.ts.map +1 -0
- package/dist/es6/status-indicator/lib/StatusIndicator.js +49 -0
- package/dist/es6/status-indicator/lib/StatusIndicatorIcon.d.ts +73 -0
- package/dist/es6/status-indicator/lib/StatusIndicatorIcon.d.ts.map +1 -0
- package/dist/es6/status-indicator/lib/StatusIndicatorIcon.js +92 -0
- package/dist/es6/status-indicator/lib/StatusIndicatorLabel.d.ts +5 -0
- package/dist/es6/status-indicator/lib/StatusIndicatorLabel.d.ts.map +1 -0
- package/dist/es6/status-indicator/lib/StatusIndicatorLabel.js +32 -0
- package/dist/es6/status-indicator/lib/hooks/index.d.ts +2 -0
- package/dist/es6/status-indicator/lib/hooks/index.d.ts.map +1 -0
- package/dist/es6/status-indicator/lib/hooks/index.js +1 -0
- package/dist/es6/status-indicator/lib/hooks/useStatusIndicatorModel.d.ts +75 -0
- package/dist/es6/status-indicator/lib/hooks/useStatusIndicatorModel.d.ts.map +1 -0
- package/dist/es6/status-indicator/lib/hooks/useStatusIndicatorModel.js +31 -0
- package/index.ts +1 -0
- package/package.json +4 -4
- package/status-indicator/LICENSE +52 -0
- package/status-indicator/README.md +12 -0
- package/status-indicator/index.ts +1 -0
- package/status-indicator/lib/StatusIndicator.tsx +49 -0
- package/status-indicator/lib/StatusIndicatorIcon.tsx +88 -0
- package/status-indicator/lib/StatusIndicatorLabel.tsx +28 -0
- package/status-indicator/lib/hooks/index.ts +1 -0
- package/status-indicator/lib/hooks/useStatusIndicatorModel.tsx +29 -0
- package/status-indicator/package.json +6 -0
package/dist/commonjs/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
|
package/dist/commonjs/index.js
CHANGED
|
@@ -16,5 +16,6 @@ __exportStar(require("./menu"), exports);
|
|
|
16
16
|
__exportStar(require("./pill"), exports);
|
|
17
17
|
__exportStar(require("./select"), exports);
|
|
18
18
|
__exportStar(require("./side-panel"), exports);
|
|
19
|
+
__exportStar(require("./status-indicator"), exports);
|
|
19
20
|
__exportStar(require("./text-area"), exports);
|
|
20
21
|
__exportStar(require("./text-input"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../status-indicator/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./lib/StatusIndicator"), exports);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ExtractProps } from '@workday/canvas-kit-react/common';
|
|
3
|
+
import { HStack } from '@workday/canvas-kit-react/layout';
|
|
4
|
+
export interface StatusIndicatorProps extends Partial<ExtractProps<typeof HStack, never>> {
|
|
5
|
+
/**
|
|
6
|
+
* Children of the `StatusIndicator`. Can contain a `StatusIndicator.Label` and optionally a `StatusIndicator.Icon`.
|
|
7
|
+
*/
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare const useStatusIndicator: <P extends {}, R>(model: {
|
|
11
|
+
state: {
|
|
12
|
+
emphasis: import("./hooks").StatusIndicatorEmphasis;
|
|
13
|
+
variant: import("./hooks").StatusIndicatorVariant;
|
|
14
|
+
};
|
|
15
|
+
events: {};
|
|
16
|
+
}, elemProps?: P | undefined, ref?: ((instance: R | null) => void) | React.RefObject<R> | null | undefined) => {
|
|
17
|
+
opacity: string | undefined;
|
|
18
|
+
color: string;
|
|
19
|
+
background: string;
|
|
20
|
+
} & P & (R extends HTMLOrSVGElement ? {
|
|
21
|
+
ref: React.Ref<R>;
|
|
22
|
+
} : {});
|
|
23
|
+
export declare const StatusIndicator: import("@workday/canvas-kit-react/common").ElementComponentM<"div", StatusIndicatorProps & Partial<{
|
|
24
|
+
emphasis: import("./hooks").StatusIndicatorEmphasis;
|
|
25
|
+
variant: import("./hooks").StatusIndicatorVariant;
|
|
26
|
+
}> & {} & {}, {
|
|
27
|
+
state: {
|
|
28
|
+
emphasis: import("./hooks").StatusIndicatorEmphasis;
|
|
29
|
+
variant: import("./hooks").StatusIndicatorVariant;
|
|
30
|
+
};
|
|
31
|
+
events: {};
|
|
32
|
+
}> & {
|
|
33
|
+
Context: React.Context<{
|
|
34
|
+
state: {
|
|
35
|
+
emphasis: import("./hooks").StatusIndicatorEmphasis;
|
|
36
|
+
variant: import("./hooks").StatusIndicatorVariant;
|
|
37
|
+
};
|
|
38
|
+
events: {};
|
|
39
|
+
}>;
|
|
40
|
+
} & {
|
|
41
|
+
Icon: import("@workday/canvas-kit-react/common").ElementComponentM<"span", import("./StatusIndicatorIcon").StatusIndicatorIconProps, {
|
|
42
|
+
state: {
|
|
43
|
+
emphasis: import("./hooks").StatusIndicatorEmphasis;
|
|
44
|
+
variant: import("./hooks").StatusIndicatorVariant;
|
|
45
|
+
};
|
|
46
|
+
events: {};
|
|
47
|
+
}>;
|
|
48
|
+
Label: import("@workday/canvas-kit-react/common").ElementComponent<"span", import("./StatusIndicatorLabel").StatusIndicatorLabelProps>;
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=StatusIndicator.d.ts.map
|
|
@@ -0,0 +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,EAAuC,MAAM,kCAAkC,CAAC;AACpG,OAAO,EAAC,MAAM,EAAC,MAAM,kCAAkC,CAAC;AAKxD,MAAM,WAAW,oBAAqB,SAAQ,OAAO,CAAC,YAAY,CAAC,OAAO,MAAM,EAAE,KAAK,CAAC,CAAC;IACvF;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,kBAAkB;;;;;;;;;;;;OAO7B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;CAwB1B,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.StatusIndicator = exports.useStatusIndicator = void 0;
|
|
29
|
+
var react_1 = __importDefault(require("react"));
|
|
30
|
+
var common_1 = require("@workday/canvas-kit-react/common");
|
|
31
|
+
var layout_1 = require("@workday/canvas-kit-react/layout");
|
|
32
|
+
var StatusIndicatorIcon_1 = require("./StatusIndicatorIcon");
|
|
33
|
+
var StatusIndicatorLabel_1 = require("./StatusIndicatorLabel");
|
|
34
|
+
var hooks_1 = require("./hooks");
|
|
35
|
+
exports.useStatusIndicator = common_1.createElemPropsHook(hooks_1.useStatusIndicatorModel)(function (_a) {
|
|
36
|
+
var state = _a.state;
|
|
37
|
+
var colors = StatusIndicatorIcon_1.statusIndicatorColors[state.variant][state.emphasis];
|
|
38
|
+
return {
|
|
39
|
+
opacity: state.variant === 'transparent' ? '0.85' : undefined,
|
|
40
|
+
color: colors.text,
|
|
41
|
+
background: colors.background,
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
exports.StatusIndicator = common_1.createContainer('div')({
|
|
45
|
+
displayName: 'StatusIndicator',
|
|
46
|
+
modelHook: hooks_1.useStatusIndicatorModel,
|
|
47
|
+
elemPropsHook: exports.useStatusIndicator,
|
|
48
|
+
subComponents: {
|
|
49
|
+
Icon: StatusIndicatorIcon_1.StatusIndicatorIcon,
|
|
50
|
+
Label: StatusIndicatorLabel_1.StatusIndicatorLabel,
|
|
51
|
+
},
|
|
52
|
+
})(function (_a, Element, model) {
|
|
53
|
+
var children = _a.children, elemProps = __rest(_a, ["children"]);
|
|
54
|
+
return (react_1.default.createElement(layout_1.HStack, __assign({ spacing: 4, as: Element, maxWidth: 200, paddingX: "xxxs", display: "inline-flex", alignItems: "center", height: 20, borderRadius: "s" }, elemProps), children));
|
|
55
|
+
});
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { SystemIconProps } from '@workday/canvas-kit-react/icon';
|
|
2
|
+
export interface StatusIndicatorIconProps extends SystemIconProps {
|
|
3
|
+
}
|
|
4
|
+
export declare const statusIndicatorColors: {
|
|
5
|
+
gray: {
|
|
6
|
+
high: {
|
|
7
|
+
text: string;
|
|
8
|
+
background: string;
|
|
9
|
+
};
|
|
10
|
+
low: {
|
|
11
|
+
text: string;
|
|
12
|
+
background: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
orange: {
|
|
16
|
+
high: {
|
|
17
|
+
text: string;
|
|
18
|
+
background: string;
|
|
19
|
+
};
|
|
20
|
+
low: {
|
|
21
|
+
text: string;
|
|
22
|
+
background: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
blue: {
|
|
26
|
+
high: {
|
|
27
|
+
text: string;
|
|
28
|
+
background: string;
|
|
29
|
+
};
|
|
30
|
+
low: {
|
|
31
|
+
text: string;
|
|
32
|
+
background: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
green: {
|
|
36
|
+
high: {
|
|
37
|
+
text: string;
|
|
38
|
+
background: string;
|
|
39
|
+
};
|
|
40
|
+
low: {
|
|
41
|
+
text: string;
|
|
42
|
+
background: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
red: {
|
|
46
|
+
high: {
|
|
47
|
+
text: string;
|
|
48
|
+
background: string;
|
|
49
|
+
};
|
|
50
|
+
low: {
|
|
51
|
+
text: string;
|
|
52
|
+
background: string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
transparent: {
|
|
56
|
+
high: {
|
|
57
|
+
text: string;
|
|
58
|
+
background: string;
|
|
59
|
+
};
|
|
60
|
+
low: {
|
|
61
|
+
text: string;
|
|
62
|
+
background: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
export declare const StatusIndicatorIcon: import("@workday/canvas-kit-react/common").ElementComponentM<"span", StatusIndicatorIconProps, {
|
|
67
|
+
state: {
|
|
68
|
+
emphasis: import("./hooks").StatusIndicatorEmphasis;
|
|
69
|
+
variant: import("./hooks").StatusIndicatorVariant;
|
|
70
|
+
};
|
|
71
|
+
events: {};
|
|
72
|
+
}>;
|
|
73
|
+
//# sourceMappingURL=StatusIndicatorIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusIndicatorIcon.d.ts","sourceRoot":"","sources":["../../../../status-indicator/lib/StatusIndicatorIcon.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAG3E,MAAM,WAAW,wBAAyB,SAAQ,eAAe;CAAG;AAIpE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6DjC,CAAC;AAUF,eAAO,MAAM,mBAAmB;;;;;;EAK9B,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.StatusIndicatorIcon = exports.statusIndicatorColors = void 0;
|
|
18
|
+
var react_1 = __importDefault(require("react"));
|
|
19
|
+
var common_1 = require("@workday/canvas-kit-react/common");
|
|
20
|
+
var icon_1 = require("@workday/canvas-kit-react/icon");
|
|
21
|
+
var hooks_1 = require("./hooks");
|
|
22
|
+
var tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
23
|
+
exports.statusIndicatorColors = {
|
|
24
|
+
gray: {
|
|
25
|
+
high: {
|
|
26
|
+
text: tokens_1.colors.frenchVanilla100,
|
|
27
|
+
background: tokens_1.colors.licorice300,
|
|
28
|
+
},
|
|
29
|
+
low: {
|
|
30
|
+
text: tokens_1.colors.licorice400,
|
|
31
|
+
background: tokens_1.colors.soap300,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
orange: {
|
|
35
|
+
high: {
|
|
36
|
+
text: tokens_1.colors.licorice500,
|
|
37
|
+
background: tokens_1.colors.cantaloupe400,
|
|
38
|
+
},
|
|
39
|
+
low: {
|
|
40
|
+
text: tokens_1.colors.toastedMarshmallow600,
|
|
41
|
+
background: tokens_1.colors.cantaloupe100,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
blue: {
|
|
45
|
+
high: {
|
|
46
|
+
text: tokens_1.colors.frenchVanilla100,
|
|
47
|
+
background: tokens_1.colors.blueberry400,
|
|
48
|
+
},
|
|
49
|
+
low: {
|
|
50
|
+
text: tokens_1.colors.blueberry500,
|
|
51
|
+
background: tokens_1.colors.blueberry100,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
green: {
|
|
55
|
+
high: {
|
|
56
|
+
text: tokens_1.colors.frenchVanilla100,
|
|
57
|
+
background: tokens_1.colors.greenApple600,
|
|
58
|
+
},
|
|
59
|
+
low: {
|
|
60
|
+
text: tokens_1.colors.greenApple600,
|
|
61
|
+
background: tokens_1.colors.greenApple100,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
red: {
|
|
65
|
+
high: {
|
|
66
|
+
text: tokens_1.colors.frenchVanilla100,
|
|
67
|
+
background: tokens_1.colors.cinnamon500,
|
|
68
|
+
},
|
|
69
|
+
low: {
|
|
70
|
+
text: tokens_1.colors.cinnamon600,
|
|
71
|
+
background: tokens_1.colors.cinnamon100,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
transparent: {
|
|
75
|
+
high: {
|
|
76
|
+
text: tokens_1.colors.frenchVanilla100,
|
|
77
|
+
background: tokens_1.colors.blackPepper600,
|
|
78
|
+
},
|
|
79
|
+
low: {
|
|
80
|
+
text: tokens_1.colors.frenchVanilla100,
|
|
81
|
+
background: tokens_1.colors.blackPepper600,
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
var useStatusIndicatorIcon = common_1.createElemPropsHook(hooks_1.useStatusIndicatorModel)(function (_a) {
|
|
86
|
+
var state = _a.state;
|
|
87
|
+
var colors = exports.statusIndicatorColors[state.variant][state.emphasis];
|
|
88
|
+
return {
|
|
89
|
+
color: colors.text,
|
|
90
|
+
colorHover: colors.background,
|
|
91
|
+
};
|
|
92
|
+
});
|
|
93
|
+
exports.StatusIndicatorIcon = common_1.createSubcomponent('span')({
|
|
94
|
+
modelHook: hooks_1.useStatusIndicatorModel,
|
|
95
|
+
elemPropsHook: useStatusIndicatorIcon,
|
|
96
|
+
})(function (elemProps, Element, model) {
|
|
97
|
+
return react_1.default.createElement(icon_1.SystemIcon, __assign({ as: Element, size: 20, role: "img" }, elemProps));
|
|
98
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { TextProps } from '@workday/canvas-kit-react/text';
|
|
2
|
+
export interface StatusIndicatorLabelProps extends TextProps {
|
|
3
|
+
}
|
|
4
|
+
export declare const StatusIndicatorLabel: import("@workday/canvas-kit-react/common").ElementComponent<"span", StatusIndicatorLabelProps>;
|
|
5
|
+
//# sourceMappingURL=StatusIndicatorLabel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusIndicatorLabel.d.ts","sourceRoot":"","sources":["../../../../status-indicator/lib/StatusIndicatorLabel.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAO,SAAS,EAAC,MAAM,gCAAgC,CAAC;AAE/D,MAAM,WAAW,yBAA0B,SAAQ,SAAS;CAAG;AAE/D,eAAO,MAAM,oBAAoB,gGAoB/B,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.StatusIndicatorLabel = void 0;
|
|
29
|
+
var react_1 = __importDefault(require("react"));
|
|
30
|
+
var common_1 = require("@workday/canvas-kit-react/common");
|
|
31
|
+
var text_1 = require("@workday/canvas-kit-react/text");
|
|
32
|
+
exports.StatusIndicatorLabel = common_1.createComponent('span')({
|
|
33
|
+
displayName: 'StatusIndicator.Label',
|
|
34
|
+
Component: function (_a, ref, Element) {
|
|
35
|
+
var children = _a.children, elemProps = __rest(_a, ["children"]);
|
|
36
|
+
return (react_1.default.createElement(text_1.Text, __assign({ whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", typeLevel: "subtext.large", fontWeight: "bold", textTransform: "capitalize", ref: ref, color: "inherit", as: Element }, elemProps), children));
|
|
37
|
+
},
|
|
38
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../status-indicator/lib/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./useStatusIndicatorModel"), exports);
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export declare type StatusIndicatorVariant = 'gray' | 'orange' | 'blue' | 'green' | 'red' | 'transparent';
|
|
2
|
+
export declare type StatusIndicatorEmphasis = 'high' | 'low';
|
|
3
|
+
export declare const useStatusIndicatorModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
4
|
+
/**
|
|
5
|
+
* Defines the emphasis of the `StatusIndicator`.
|
|
6
|
+
* `high` emphasis will create more contrast between the background and text colors.
|
|
7
|
+
* `low` emphasis will create less contrast between the background and text colors.
|
|
8
|
+
* @default 'low'
|
|
9
|
+
*/
|
|
10
|
+
emphasis: StatusIndicatorEmphasis;
|
|
11
|
+
/**
|
|
12
|
+
* Defines the color of the `StatusIndicator`.
|
|
13
|
+
* @default 'gray'
|
|
14
|
+
*/
|
|
15
|
+
variant: StatusIndicatorVariant;
|
|
16
|
+
}> & {} & {}) | undefined) => {
|
|
17
|
+
state: {
|
|
18
|
+
/**
|
|
19
|
+
* Defines the emphasis of the `StatusIndicator`.
|
|
20
|
+
* `high` emphasis will create more contrast between the background and text colors.
|
|
21
|
+
* `low` emphasis will create less contrast between the background and text colors.
|
|
22
|
+
* @default 'low'
|
|
23
|
+
*/
|
|
24
|
+
emphasis: StatusIndicatorEmphasis;
|
|
25
|
+
/**
|
|
26
|
+
* Defines the color of the `StatusIndicator`.
|
|
27
|
+
* @default 'gray'
|
|
28
|
+
*/
|
|
29
|
+
variant: StatusIndicatorVariant;
|
|
30
|
+
};
|
|
31
|
+
events: {};
|
|
32
|
+
}) & import("@workday/canvas-kit-react/common").ModelExtras<{
|
|
33
|
+
/**
|
|
34
|
+
* Defines the emphasis of the `StatusIndicator`.
|
|
35
|
+
* `high` emphasis will create more contrast between the background and text colors.
|
|
36
|
+
* `low` emphasis will create less contrast between the background and text colors.
|
|
37
|
+
* @default 'low'
|
|
38
|
+
*/
|
|
39
|
+
emphasis: StatusIndicatorEmphasis;
|
|
40
|
+
/**
|
|
41
|
+
* Defines the color of the `StatusIndicator`.
|
|
42
|
+
* @default 'gray'
|
|
43
|
+
*/
|
|
44
|
+
variant: StatusIndicatorVariant;
|
|
45
|
+
}, {}, {
|
|
46
|
+
/**
|
|
47
|
+
* Defines the emphasis of the `StatusIndicator`.
|
|
48
|
+
* `high` emphasis will create more contrast between the background and text colors.
|
|
49
|
+
* `low` emphasis will create less contrast between the background and text colors.
|
|
50
|
+
* @default 'low'
|
|
51
|
+
*/
|
|
52
|
+
emphasis: StatusIndicatorEmphasis;
|
|
53
|
+
/**
|
|
54
|
+
* Defines the color of the `StatusIndicator`.
|
|
55
|
+
* @default 'gray'
|
|
56
|
+
*/
|
|
57
|
+
variant: StatusIndicatorVariant;
|
|
58
|
+
}, {}, {
|
|
59
|
+
state: {
|
|
60
|
+
/**
|
|
61
|
+
* Defines the emphasis of the `StatusIndicator`.
|
|
62
|
+
* `high` emphasis will create more contrast between the background and text colors.
|
|
63
|
+
* `low` emphasis will create less contrast between the background and text colors.
|
|
64
|
+
* @default 'low'
|
|
65
|
+
*/
|
|
66
|
+
emphasis: StatusIndicatorEmphasis;
|
|
67
|
+
/**
|
|
68
|
+
* Defines the color of the `StatusIndicator`.
|
|
69
|
+
* @default 'gray'
|
|
70
|
+
*/
|
|
71
|
+
variant: StatusIndicatorVariant;
|
|
72
|
+
};
|
|
73
|
+
events: {};
|
|
74
|
+
}>;
|
|
75
|
+
//# sourceMappingURL=useStatusIndicatorModel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStatusIndicatorModel.d.ts","sourceRoot":"","sources":["../../../../../status-indicator/lib/hooks/useStatusIndicatorModel.tsx"],"names":[],"mappings":"AAEA,oBAAY,sBAAsB,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,aAAa,CAAC;AAElG,oBAAY,uBAAuB,GAAG,MAAM,GAAG,KAAK,CAAC;AAErD,eAAO,MAAM,uBAAuB;IAEhC;;;;;OAKG;;IAGH;;;OAGG;;;;QAXH;;;;;WAKG;;QAGH;;;WAGG;;;;;IAXH;;;;;OAKG;;IAGH;;;OAGG;;;IAXH;;;;;OAKG;;IAGH;;;OAGG;;;;QAXH;;;;;WAKG;;QAGH;;;WAGG;;;;EASL,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.useStatusIndicatorModel = void 0;
|
|
15
|
+
var common_1 = require("@workday/canvas-kit-react/common");
|
|
16
|
+
exports.useStatusIndicatorModel = common_1.createModelHook({
|
|
17
|
+
defaultConfig: {
|
|
18
|
+
/**
|
|
19
|
+
* Defines the emphasis of the `StatusIndicator`.
|
|
20
|
+
* `high` emphasis will create more contrast between the background and text colors.
|
|
21
|
+
* `low` emphasis will create less contrast between the background and text colors.
|
|
22
|
+
* @default 'low'
|
|
23
|
+
*/
|
|
24
|
+
emphasis: 'low',
|
|
25
|
+
/**
|
|
26
|
+
* Defines the color of the `StatusIndicator`.
|
|
27
|
+
* @default 'gray'
|
|
28
|
+
*/
|
|
29
|
+
variant: 'gray',
|
|
30
|
+
},
|
|
31
|
+
})(function (config) {
|
|
32
|
+
var state = __assign({}, config);
|
|
33
|
+
return { state: state, events: {} };
|
|
34
|
+
});
|
package/dist/es6/index.d.ts
CHANGED
package/dist/es6/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
|
package/dist/es6/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../status-indicator/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './lib/StatusIndicator';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ExtractProps } from '@workday/canvas-kit-react/common';
|
|
3
|
+
import { HStack } from '@workday/canvas-kit-react/layout';
|
|
4
|
+
export interface StatusIndicatorProps extends Partial<ExtractProps<typeof HStack, never>> {
|
|
5
|
+
/**
|
|
6
|
+
* Children of the `StatusIndicator`. Can contain a `StatusIndicator.Label` and optionally a `StatusIndicator.Icon`.
|
|
7
|
+
*/
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare const useStatusIndicator: <P extends {}, R>(model: {
|
|
11
|
+
state: {
|
|
12
|
+
emphasis: import("./hooks").StatusIndicatorEmphasis;
|
|
13
|
+
variant: import("./hooks").StatusIndicatorVariant;
|
|
14
|
+
};
|
|
15
|
+
events: {};
|
|
16
|
+
}, elemProps?: P | undefined, ref?: ((instance: R | null) => void) | React.RefObject<R> | null | undefined) => {
|
|
17
|
+
opacity: string | undefined;
|
|
18
|
+
color: string;
|
|
19
|
+
background: string;
|
|
20
|
+
} & P & (R extends HTMLOrSVGElement ? {
|
|
21
|
+
ref: React.Ref<R>;
|
|
22
|
+
} : {});
|
|
23
|
+
export declare const StatusIndicator: import("@workday/canvas-kit-react/common").ElementComponentM<"div", StatusIndicatorProps & Partial<{
|
|
24
|
+
emphasis: import("./hooks").StatusIndicatorEmphasis;
|
|
25
|
+
variant: import("./hooks").StatusIndicatorVariant;
|
|
26
|
+
}> & {} & {}, {
|
|
27
|
+
state: {
|
|
28
|
+
emphasis: import("./hooks").StatusIndicatorEmphasis;
|
|
29
|
+
variant: import("./hooks").StatusIndicatorVariant;
|
|
30
|
+
};
|
|
31
|
+
events: {};
|
|
32
|
+
}> & {
|
|
33
|
+
Context: React.Context<{
|
|
34
|
+
state: {
|
|
35
|
+
emphasis: import("./hooks").StatusIndicatorEmphasis;
|
|
36
|
+
variant: import("./hooks").StatusIndicatorVariant;
|
|
37
|
+
};
|
|
38
|
+
events: {};
|
|
39
|
+
}>;
|
|
40
|
+
} & {
|
|
41
|
+
Icon: import("@workday/canvas-kit-react/common").ElementComponentM<"span", import("./StatusIndicatorIcon").StatusIndicatorIconProps, {
|
|
42
|
+
state: {
|
|
43
|
+
emphasis: import("./hooks").StatusIndicatorEmphasis;
|
|
44
|
+
variant: import("./hooks").StatusIndicatorVariant;
|
|
45
|
+
};
|
|
46
|
+
events: {};
|
|
47
|
+
}>;
|
|
48
|
+
Label: import("@workday/canvas-kit-react/common").ElementComponent<"span", import("./StatusIndicatorLabel").StatusIndicatorLabelProps>;
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=StatusIndicator.d.ts.map
|
|
@@ -0,0 +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,EAAuC,MAAM,kCAAkC,CAAC;AACpG,OAAO,EAAC,MAAM,EAAC,MAAM,kCAAkC,CAAC;AAKxD,MAAM,WAAW,oBAAqB,SAAQ,OAAO,CAAC,YAAY,CAAC,OAAO,MAAM,EAAE,KAAK,CAAC,CAAC;IACvF;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,kBAAkB;;;;;;;;;;;;OAO7B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;CAwB1B,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import React from 'react';
|
|
24
|
+
import { createContainer, createElemPropsHook } from '@workday/canvas-kit-react/common';
|
|
25
|
+
import { HStack } from '@workday/canvas-kit-react/layout';
|
|
26
|
+
import { StatusIndicatorIcon, statusIndicatorColors } from './StatusIndicatorIcon';
|
|
27
|
+
import { StatusIndicatorLabel } from './StatusIndicatorLabel';
|
|
28
|
+
import { useStatusIndicatorModel } from './hooks';
|
|
29
|
+
export var useStatusIndicator = createElemPropsHook(useStatusIndicatorModel)(function (_a) {
|
|
30
|
+
var state = _a.state;
|
|
31
|
+
var colors = statusIndicatorColors[state.variant][state.emphasis];
|
|
32
|
+
return {
|
|
33
|
+
opacity: state.variant === 'transparent' ? '0.85' : undefined,
|
|
34
|
+
color: colors.text,
|
|
35
|
+
background: colors.background,
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
export var StatusIndicator = createContainer('div')({
|
|
39
|
+
displayName: 'StatusIndicator',
|
|
40
|
+
modelHook: useStatusIndicatorModel,
|
|
41
|
+
elemPropsHook: useStatusIndicator,
|
|
42
|
+
subComponents: {
|
|
43
|
+
Icon: StatusIndicatorIcon,
|
|
44
|
+
Label: StatusIndicatorLabel,
|
|
45
|
+
},
|
|
46
|
+
})(function (_a, Element, model) {
|
|
47
|
+
var children = _a.children, elemProps = __rest(_a, ["children"]);
|
|
48
|
+
return (React.createElement(HStack, __assign({ spacing: 4, as: Element, maxWidth: 200, paddingX: "xxxs", display: "inline-flex", alignItems: "center", height: 20, borderRadius: "s" }, elemProps), children));
|
|
49
|
+
});
|