@workday/canvas-kit-preview-react 8.0.0-alpha.234-next.5 → 8.0.0-alpha.236-next.7
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/menu/lib/Menu.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/Menu.js +0 -2
- 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/menu/lib/Menu.d.ts.map +1 -1
- package/dist/es6/menu/lib/Menu.js +0 -2
- 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/menu/lib/Menu.tsx +0 -2
- 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
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import {createComponent} from '@workday/canvas-kit-react/common';
|
|
4
|
+
import {Text, TextProps} from '@workday/canvas-kit-react/text';
|
|
5
|
+
|
|
6
|
+
export interface StatusIndicatorLabelProps extends TextProps {}
|
|
7
|
+
|
|
8
|
+
export const StatusIndicatorLabel = createComponent('span')({
|
|
9
|
+
displayName: 'StatusIndicator.Label',
|
|
10
|
+
Component: ({children, ...elemProps}: StatusIndicatorLabelProps, ref, Element) => {
|
|
11
|
+
return (
|
|
12
|
+
<Text
|
|
13
|
+
whiteSpace="nowrap"
|
|
14
|
+
overflow="hidden"
|
|
15
|
+
textOverflow="ellipsis"
|
|
16
|
+
typeLevel="subtext.large"
|
|
17
|
+
fontWeight="bold"
|
|
18
|
+
textTransform="capitalize"
|
|
19
|
+
ref={ref}
|
|
20
|
+
color="inherit"
|
|
21
|
+
as={Element}
|
|
22
|
+
{...elemProps}
|
|
23
|
+
>
|
|
24
|
+
{children}
|
|
25
|
+
</Text>
|
|
26
|
+
);
|
|
27
|
+
},
|
|
28
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useStatusIndicatorModel';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {createModelHook} from '@workday/canvas-kit-react/common';
|
|
2
|
+
|
|
3
|
+
export type StatusIndicatorVariant = 'gray' | 'orange' | 'blue' | 'green' | 'red' | 'transparent';
|
|
4
|
+
|
|
5
|
+
export type StatusIndicatorEmphasis = 'high' | 'low';
|
|
6
|
+
|
|
7
|
+
export const useStatusIndicatorModel = createModelHook({
|
|
8
|
+
defaultConfig: {
|
|
9
|
+
/**
|
|
10
|
+
* Defines the emphasis of the `StatusIndicator`.
|
|
11
|
+
* `high` emphasis will create more contrast between the background and text colors.
|
|
12
|
+
* `low` emphasis will create less contrast between the background and text colors.
|
|
13
|
+
* @default 'low'
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
emphasis: 'low' as StatusIndicatorEmphasis,
|
|
17
|
+
/**
|
|
18
|
+
* Defines the color of the `StatusIndicator`.
|
|
19
|
+
* @default 'gray'
|
|
20
|
+
*/
|
|
21
|
+
variant: 'gray' as StatusIndicatorVariant,
|
|
22
|
+
},
|
|
23
|
+
})(config => {
|
|
24
|
+
const state = {
|
|
25
|
+
...config,
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
return {state, events: {}};
|
|
29
|
+
});
|