@workday/canvas-kit-preview-react 15.0.0-alpha.0045-next.0 → 15.0.0-alpha.0056-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/avatar/lib/Avatar.js +13 -13
- package/dist/commonjs/avatar/lib/AvatarImage.js +1 -1
- package/dist/commonjs/avatar/lib/AvatarName.js +1 -1
- package/dist/commonjs/avatar/lib/BaseAvatar.js +12 -12
- package/dist/commonjs/color-picker/lib/ColorPicker.js +1 -1
- package/dist/commonjs/color-picker/lib/parts/ColorReset.js +1 -1
- package/dist/commonjs/color-picker/lib/parts/SwatchBook.js +1 -1
- package/dist/commonjs/divider/lib/Divider.js +1 -1
- package/dist/commonjs/index.d.ts +0 -1
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +0 -1
- package/dist/commonjs/loading-sparkles/lib/LoadingSparkles.js +2 -2
- package/dist/commonjs/multi-select/lib/MultiSelectInput.js +3 -3
- package/dist/commonjs/pill/lib/Pill.js +3 -3
- package/dist/commonjs/pill/lib/PillAvatar.js +1 -1
- package/dist/commonjs/pill/lib/PillCount.js +1 -1
- package/dist/commonjs/pill/lib/PillIcon.js +1 -1
- package/dist/commonjs/pill/lib/PillIconButton.js +1 -1
- package/dist/commonjs/pill/lib/PillLabel.js +1 -1
- package/dist/commonjs/radio/lib/RadioGroup.js +3 -3
- package/dist/commonjs/radio/lib/RadioLabel.js +1 -1
- package/dist/commonjs/radio/lib/RadioText.js +4 -4
- package/dist/commonjs/radio/lib/StyledRadioButton.js +5 -5
- package/dist/commonjs/side-panel/lib/SidePanel.js +7 -7
- package/dist/commonjs/side-panel/lib/SidePanelToggleButton.js +11 -11
- package/dist/commonjs/status-indicator/lib/StatusIndicator.js +15 -15
- package/dist/commonjs/status-indicator/lib/StatusIndicatorLabel.js +1 -1
- package/dist/commonjs/version/lib/version.js +1 -1
- package/dist/es6/avatar/lib/Avatar.js +13 -13
- package/dist/es6/avatar/lib/AvatarImage.js +1 -1
- package/dist/es6/avatar/lib/AvatarName.js +1 -1
- package/dist/es6/avatar/lib/BaseAvatar.js +12 -12
- package/dist/es6/color-picker/lib/ColorPicker.js +1 -1
- package/dist/es6/color-picker/lib/parts/ColorReset.js +1 -1
- package/dist/es6/color-picker/lib/parts/SwatchBook.js +1 -1
- package/dist/es6/divider/lib/Divider.js +1 -1
- package/dist/es6/index.d.ts +0 -1
- package/dist/es6/index.d.ts.map +1 -1
- package/dist/es6/index.js +0 -1
- package/dist/es6/loading-sparkles/lib/LoadingSparkles.js +2 -2
- package/dist/es6/multi-select/lib/MultiSelectInput.js +3 -3
- package/dist/es6/pill/lib/Pill.js +3 -3
- package/dist/es6/pill/lib/PillAvatar.js +1 -1
- package/dist/es6/pill/lib/PillCount.js +1 -1
- package/dist/es6/pill/lib/PillIcon.js +1 -1
- package/dist/es6/pill/lib/PillIconButton.js +1 -1
- package/dist/es6/pill/lib/PillLabel.js +1 -1
- package/dist/es6/radio/lib/RadioGroup.js +3 -3
- package/dist/es6/radio/lib/RadioLabel.js +1 -1
- package/dist/es6/radio/lib/RadioText.js +4 -4
- package/dist/es6/radio/lib/StyledRadioButton.js +5 -5
- package/dist/es6/side-panel/lib/SidePanel.js +7 -7
- package/dist/es6/side-panel/lib/SidePanelToggleButton.js +11 -11
- package/dist/es6/status-indicator/lib/StatusIndicator.js +15 -15
- package/dist/es6/status-indicator/lib/StatusIndicatorLabel.js +1 -1
- package/dist/es6/version/lib/version.js +1 -1
- package/index.ts +0 -1
- package/package.json +4 -4
- package/dist/commonjs/information-highlight/index.d.ts +0 -6
- package/dist/commonjs/information-highlight/index.d.ts.map +0 -1
- package/dist/commonjs/information-highlight/index.js +0 -21
- package/dist/commonjs/information-highlight/lib/InformationHighlight.d.ts +0 -76
- package/dist/commonjs/information-highlight/lib/InformationHighlight.d.ts.map +0 -1
- package/dist/commonjs/information-highlight/lib/InformationHighlight.js +0 -42
- package/dist/commonjs/information-highlight/lib/hooks/useInformationHighlightModel.d.ts +0 -23
- package/dist/commonjs/information-highlight/lib/hooks/useInformationHighlightModel.d.ts.map +0 -1
- package/dist/commonjs/information-highlight/lib/hooks/useInformationHighlightModel.js +0 -18
- package/dist/commonjs/information-highlight/lib/parts/Body.d.ts +0 -2
- package/dist/commonjs/information-highlight/lib/parts/Body.d.ts.map +0 -1
- package/dist/commonjs/information-highlight/lib/parts/Body.js +0 -17
- package/dist/commonjs/information-highlight/lib/parts/Heading.d.ts +0 -6
- package/dist/commonjs/information-highlight/lib/parts/Heading.d.ts.map +0 -1
- package/dist/commonjs/information-highlight/lib/parts/Heading.js +0 -17
- package/dist/commonjs/information-highlight/lib/parts/Icon.d.ts +0 -12
- package/dist/commonjs/information-highlight/lib/parts/Icon.d.ts.map +0 -1
- package/dist/commonjs/information-highlight/lib/parts/Icon.js +0 -19
- package/dist/commonjs/information-highlight/lib/parts/Link.d.ts +0 -2
- package/dist/commonjs/information-highlight/lib/parts/Link.d.ts.map +0 -1
- package/dist/commonjs/information-highlight/lib/parts/Link.js +0 -17
- package/dist/es6/information-highlight/index.d.ts +0 -6
- package/dist/es6/information-highlight/index.d.ts.map +0 -1
- package/dist/es6/information-highlight/index.js +0 -5
- package/dist/es6/information-highlight/lib/InformationHighlight.d.ts +0 -76
- package/dist/es6/information-highlight/lib/InformationHighlight.d.ts.map +0 -1
- package/dist/es6/information-highlight/lib/InformationHighlight.js +0 -39
- package/dist/es6/information-highlight/lib/hooks/useInformationHighlightModel.d.ts +0 -23
- package/dist/es6/information-highlight/lib/hooks/useInformationHighlightModel.d.ts.map +0 -1
- package/dist/es6/information-highlight/lib/hooks/useInformationHighlightModel.js +0 -15
- package/dist/es6/information-highlight/lib/parts/Body.d.ts +0 -2
- package/dist/es6/information-highlight/lib/parts/Body.d.ts.map +0 -1
- package/dist/es6/information-highlight/lib/parts/Body.js +0 -14
- package/dist/es6/information-highlight/lib/parts/Heading.d.ts +0 -6
- package/dist/es6/information-highlight/lib/parts/Heading.d.ts.map +0 -1
- package/dist/es6/information-highlight/lib/parts/Heading.js +0 -14
- package/dist/es6/information-highlight/lib/parts/Icon.d.ts +0 -12
- package/dist/es6/information-highlight/lib/parts/Icon.d.ts.map +0 -1
- package/dist/es6/information-highlight/lib/parts/Icon.js +0 -16
- package/dist/es6/information-highlight/lib/parts/Link.d.ts +0 -2
- package/dist/es6/information-highlight/lib/parts/Link.d.ts.map +0 -1
- package/dist/es6/information-highlight/lib/parts/Link.js +0 -14
- package/information-highlight/index.ts +0 -5
- package/information-highlight/lib/InformationHighlight.tsx +0 -107
- package/information-highlight/lib/hooks/useInformationHighlightModel.ts +0 -16
- package/information-highlight/lib/parts/Body.tsx +0 -28
- package/information-highlight/lib/parts/Heading.tsx +0 -34
- package/information-highlight/lib/parts/Icon.tsx +0 -29
- package/information-highlight/lib/parts/Link.tsx +0 -29
- package/information-highlight/package.json +0 -6
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export declare const useInformationHighlightModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
2
|
-
variant: "caution" | "informational" | "critical";
|
|
3
|
-
emphasis: "high" | "low";
|
|
4
|
-
}> & {} & {}) | undefined) => {
|
|
5
|
-
state: {
|
|
6
|
-
variant: "caution" | "informational" | "critical";
|
|
7
|
-
emphasis: "high" | "low";
|
|
8
|
-
};
|
|
9
|
-
events: {};
|
|
10
|
-
}) & import("@workday/canvas-kit-react/common").ModelExtras<{
|
|
11
|
-
variant: "caution" | "informational" | "critical";
|
|
12
|
-
emphasis: "high" | "low";
|
|
13
|
-
}, {}, {
|
|
14
|
-
variant: "caution" | "informational" | "critical";
|
|
15
|
-
emphasis: "high" | "low";
|
|
16
|
-
}, {}, {
|
|
17
|
-
state: {
|
|
18
|
-
variant: "caution" | "informational" | "critical";
|
|
19
|
-
emphasis: "high" | "low";
|
|
20
|
-
};
|
|
21
|
-
events: {};
|
|
22
|
-
}>;
|
|
23
|
-
//# sourceMappingURL=useInformationHighlightModel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useInformationHighlightModel.d.ts","sourceRoot":"","sources":["../../../../../information-highlight/lib/hooks/useInformationHighlightModel.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;EAavC,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { createModelHook } from '@workday/canvas-kit-react/common';
|
|
2
|
-
export const useInformationHighlightModel = createModelHook({
|
|
3
|
-
defaultConfig: {
|
|
4
|
-
variant: 'informational',
|
|
5
|
-
emphasis: 'low',
|
|
6
|
-
},
|
|
7
|
-
})(config => {
|
|
8
|
-
return {
|
|
9
|
-
state: {
|
|
10
|
-
variant: config.variant,
|
|
11
|
-
emphasis: config.emphasis,
|
|
12
|
-
},
|
|
13
|
-
events: {},
|
|
14
|
-
};
|
|
15
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Body.d.ts","sourceRoot":"","sources":["../../../../../information-highlight/lib/parts/Body.tsx"],"names":[],"mappings":"AAgBA,eAAO,MAAM,IAAI,wHAWf,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createComponent } from '@workday/canvas-kit-react/common';
|
|
3
|
-
import { createStencil, handleCsProp } from '@workday/canvas-kit-styling';
|
|
4
|
-
import { system } from '@workday/canvas-tokens-web';
|
|
5
|
-
import { Text } from '@workday/canvas-kit-react/text';
|
|
6
|
-
const informationHighlightBodyStencil = createStencil({
|
|
7
|
-
base: { name: "3c2hi5", styles: "box-sizing:border-box;font-family:var(--cnvs-sys-font-family-default);font-weight:var(--cnvs-sys-font-weight-normal);line-height:var(--cnvs-sys-line-height-subtext-large);font-size:var(--cnvs-sys-font-size-subtext-large);letter-spacing:var(--cnvs-base-letter-spacing-150);color:var(--cnvs-sys-color-text-strong);grid-column:2;margin-block-end:var(--cnvs-sys-space-x2);" }
|
|
8
|
-
}, "information-highlight-body-0931ed");
|
|
9
|
-
export const Body = createComponent('div')({
|
|
10
|
-
displayName: 'Body',
|
|
11
|
-
Component: ({ ...elemProps }, ref, Element) => {
|
|
12
|
-
return (_jsx(Text, { as: Element, ref: ref, ...handleCsProp(elemProps, informationHighlightBodyStencil()) }));
|
|
13
|
-
},
|
|
14
|
-
});
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ExtractProps } from '@workday/canvas-kit-react/common';
|
|
2
|
-
import { Heading } from '@workday/canvas-kit-react/text';
|
|
3
|
-
export interface InformationHighlightHeadingProps extends Partial<ExtractProps<typeof Heading, never>> {
|
|
4
|
-
}
|
|
5
|
-
export declare const InformationHighlightHeading: import("@workday/canvas-kit-react/common").ElementComponent<"h3", InformationHighlightHeadingProps>;
|
|
6
|
-
//# sourceMappingURL=Heading.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.d.ts","sourceRoot":"","sources":["../../../../../information-highlight/lib/parts/Heading.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkB,YAAY,EAAC,MAAM,kCAAkC,CAAC;AAG/E,OAAO,EAAC,OAAO,EAAC,MAAM,gCAAgC,CAAC;AAevD,MAAM,WAAW,gCACf,SAAQ,OAAO,CAAC,YAAY,CAAC,OAAO,OAAO,EAAE,KAAK,CAAC,CAAC;CAAG;AAEzD,eAAO,MAAM,2BAA2B,qGAYtC,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createComponent } from '@workday/canvas-kit-react/common';
|
|
3
|
-
import { createStencil, handleCsProp } from '@workday/canvas-kit-styling';
|
|
4
|
-
import { system } from '@workday/canvas-tokens-web';
|
|
5
|
-
import { Heading } from '@workday/canvas-kit-react/text';
|
|
6
|
-
const informationHighlightHeadingStencil = createStencil({
|
|
7
|
-
base: { name: "ss96r", styles: "box-sizing:border-box;font-family:var(--cnvs-sys-font-family-default);font-weight:var(--cnvs-sys-font-weight-bold);line-height:var(--cnvs-sys-line-height-body-small);font-size:var(--cnvs-sys-font-size-body-small);letter-spacing:var(--cnvs-base-letter-spacing-200);color:var(--cnvs-sys-color-text-strong);grid-column:2;margin-top:var(--cnvs-sys-space-zero);margin-bottom:var(--cnvs-sys-space-zero);" }
|
|
8
|
-
}, "information-highlight-heading-1080eb");
|
|
9
|
-
export const InformationHighlightHeading = createComponent('h3')({
|
|
10
|
-
displayName: 'Heading',
|
|
11
|
-
Component: ({ size = 'small', ...elemProps }, ref, Element) => {
|
|
12
|
-
return (_jsx(Heading, { as: Element, ref: ref, size: size, ...handleCsProp(elemProps, informationHighlightHeadingStencil()) }));
|
|
13
|
-
},
|
|
14
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { SystemIcon } from '@workday/canvas-kit-react/icon';
|
|
2
|
-
import { ExtractProps } from '@workday/canvas-kit-react/common';
|
|
3
|
-
export interface IconProps extends Partial<ExtractProps<typeof SystemIcon, never>> {
|
|
4
|
-
}
|
|
5
|
-
export declare const Icon: import("@workday/canvas-kit-react/common").ElementComponentM<"span", IconProps, {
|
|
6
|
-
state: {
|
|
7
|
-
variant: "caution" | "informational" | "critical";
|
|
8
|
-
emphasis: "high" | "low";
|
|
9
|
-
};
|
|
10
|
-
events: {};
|
|
11
|
-
}>;
|
|
12
|
-
//# sourceMappingURL=Icon.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../../information-highlight/lib/parts/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAqB,YAAY,EAAC,MAAM,kCAAkC,CAAC;AAQlF,MAAM,WAAW,SAAU,SAAQ,OAAO,CAAC,YAAY,CAAC,OAAO,UAAU,EAAE,KAAK,CAAC,CAAC;CAAG;AAOrF,eAAO,MAAM,IAAI;;;;;;EAYf,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { SystemIcon } from '@workday/canvas-kit-react/icon';
|
|
3
|
-
import { createSubcomponent } from '@workday/canvas-kit-react/common';
|
|
4
|
-
import { infoIcon, exclamationCircleIcon, exclamationTriangleIcon, } from '@workday/canvas-system-icons-web';
|
|
5
|
-
import { useInformationHighlightModel } from '../hooks/useInformationHighlightModel';
|
|
6
|
-
const defaultIcons = {
|
|
7
|
-
informational: infoIcon,
|
|
8
|
-
caution: exclamationTriangleIcon,
|
|
9
|
-
critical: exclamationCircleIcon,
|
|
10
|
-
};
|
|
11
|
-
export const Icon = createSubcomponent('span')({
|
|
12
|
-
displayName: 'Icon',
|
|
13
|
-
modelHook: useInformationHighlightModel,
|
|
14
|
-
})(({ icon, ...props }, Element, model) => {
|
|
15
|
-
return (_jsx(SystemIcon, { as: Element, icon: icon ? icon : defaultIcons[model.state.variant], "data-part": "information-highlight-icon", ...props }));
|
|
16
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../../../information-highlight/lib/parts/Link.tsx"],"names":[],"mappings":"AAiBA,eAAO,MAAM,IAAI,6HAWf,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Hyperlink } from '@workday/canvas-kit-react/button';
|
|
3
|
-
import { createComponent } from '@workday/canvas-kit-react/common';
|
|
4
|
-
import { createStencil, handleCsProp } from '@workday/canvas-kit-styling';
|
|
5
|
-
import { system } from '@workday/canvas-tokens-web';
|
|
6
|
-
const informationHighlightLinkStencil = createStencil({
|
|
7
|
-
base: { name: "4b8mbc", styles: "box-sizing:border-box;font-family:var(--cnvs-sys-font-family-default);font-weight:var(--cnvs-sys-font-weight-bold);line-height:var(--cnvs-sys-line-height-subtext-large);font-size:var(--cnvs-sys-font-size-subtext-large);letter-spacing:var(--cnvs-base-letter-spacing-150);grid-column:2;justify-self:start;color:var(--cnvs-sys-color-text-strong);" }
|
|
8
|
-
}, "information-highlight-link-aef704");
|
|
9
|
-
export const Link = createComponent('a')({
|
|
10
|
-
displayName: 'Link',
|
|
11
|
-
Component: ({ ...elemProps }, ref, Element) => {
|
|
12
|
-
return (_jsx(Hyperlink, { as: Element, ref: ref, ...handleCsProp(elemProps, informationHighlightLinkStencil()) }));
|
|
13
|
-
},
|
|
14
|
-
});
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import {createContainer} from '@workday/canvas-kit-react/common';
|
|
2
|
-
import {createStencil, handleCsProp, CSProps, px2rem} from '@workday/canvas-kit-styling';
|
|
3
|
-
import {system} from '@workday/canvas-tokens-web';
|
|
4
|
-
|
|
5
|
-
import {InformationHighlightHeading} from './parts/Heading';
|
|
6
|
-
import {Body} from './parts/Body';
|
|
7
|
-
import {Icon} from './parts/Icon';
|
|
8
|
-
import {Link} from './parts/Link';
|
|
9
|
-
import {useInformationHighlightModel} from './hooks/useInformationHighlightModel';
|
|
10
|
-
import {systemIconStencil} from '@workday/canvas-kit-react/icon';
|
|
11
|
-
|
|
12
|
-
interface InformationHighlightProps extends CSProps {}
|
|
13
|
-
|
|
14
|
-
export const informationHighlightStencil = createStencil({
|
|
15
|
-
base: {
|
|
16
|
-
display: 'grid',
|
|
17
|
-
gridTemplateColumns: 'min-content',
|
|
18
|
-
columnGap: system.space.x4,
|
|
19
|
-
rowGap: system.space.x2,
|
|
20
|
-
padding: system.space.x4,
|
|
21
|
-
borderRadius: system.shape.x1,
|
|
22
|
-
outline: `${px2rem(1)} solid transparent`,
|
|
23
|
-
borderInlineStart: `${system.space.x1} solid transparent`,
|
|
24
|
-
},
|
|
25
|
-
modifiers: {
|
|
26
|
-
informational: {
|
|
27
|
-
low: {
|
|
28
|
-
borderInlineStartColor: system.color.border.info.default,
|
|
29
|
-
backgroundColor: system.color.bg.alt.soft,
|
|
30
|
-
'& [data-part="information-highlight-icon"]': {
|
|
31
|
-
[systemIconStencil.vars.accentColor]: system.color.icon.info.default,
|
|
32
|
-
[systemIconStencil.vars.color]: system.color.icon.info.default,
|
|
33
|
-
[systemIconStencil.vars.backgroundColor]: 'transparent',
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
high: {
|
|
37
|
-
borderInlineStartColor: system.color.border.info.default,
|
|
38
|
-
backgroundColor: system.color.bg.info.softest,
|
|
39
|
-
'& [data-part="information-highlight-icon"]': {
|
|
40
|
-
[systemIconStencil.vars.accentColor]: system.color.icon.inverse,
|
|
41
|
-
[systemIconStencil.vars.color]: system.color.icon.info.default,
|
|
42
|
-
[systemIconStencil.vars.backgroundColor]: system.color.icon.info.default,
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
caution: {
|
|
47
|
-
low: {
|
|
48
|
-
borderInlineStartColor: system.color.border.caution.default,
|
|
49
|
-
backgroundColor: system.color.bg.alt.soft,
|
|
50
|
-
'& [data-part="information-highlight-icon"]': {
|
|
51
|
-
[systemIconStencil.vars.accentColor]: system.color.icon.strong,
|
|
52
|
-
[systemIconStencil.vars.color]: system.color.icon.strong,
|
|
53
|
-
[systemIconStencil.vars.backgroundColor]: 'transparent',
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
high: {
|
|
57
|
-
borderInlineStartColor: system.color.border.caution.default,
|
|
58
|
-
backgroundColor: system.color.bg.caution.softest,
|
|
59
|
-
'& [data-part="information-highlight-icon"]': {
|
|
60
|
-
[systemIconStencil.vars.accentColor]: system.color.icon.inverse,
|
|
61
|
-
[systemIconStencil.vars.color]: system.color.icon.caution.softer,
|
|
62
|
-
[systemIconStencil.vars.backgroundColor]: system.color.icon.caution.softer,
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
critical: {
|
|
67
|
-
low: {
|
|
68
|
-
borderInlineStartColor: system.color.border.critical.default,
|
|
69
|
-
backgroundColor: system.color.bg.alt.soft,
|
|
70
|
-
'& [data-part="information-highlight-icon"]': {
|
|
71
|
-
[systemIconStencil.vars.accentColor]: system.color.icon.critical.default,
|
|
72
|
-
[systemIconStencil.vars.color]: system.color.icon.critical.default,
|
|
73
|
-
[systemIconStencil.vars.backgroundColor]: 'transparent',
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
high: {
|
|
77
|
-
borderInlineStartColor: system.color.border.critical.default,
|
|
78
|
-
backgroundColor: system.color.bg.critical.softest,
|
|
79
|
-
'& [data-part="information-highlight-icon"]': {
|
|
80
|
-
[systemIconStencil.vars.accentColor]: system.color.icon.inverse,
|
|
81
|
-
[systemIconStencil.vars.color]: system.color.icon.critical.default,
|
|
82
|
-
[systemIconStencil.vars.backgroundColor]: system.color.icon.critical.default,
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
export const InformationHighlight = createContainer('section')({
|
|
90
|
-
displayName: 'InformationHighlight',
|
|
91
|
-
modelHook: useInformationHighlightModel,
|
|
92
|
-
subComponents: {
|
|
93
|
-
Icon: Icon,
|
|
94
|
-
Heading: InformationHighlightHeading,
|
|
95
|
-
Body: Body,
|
|
96
|
-
Link: Link,
|
|
97
|
-
},
|
|
98
|
-
})(({...elemProps}: InformationHighlightProps, Element, model) => {
|
|
99
|
-
return (
|
|
100
|
-
<Element
|
|
101
|
-
{...handleCsProp(
|
|
102
|
-
elemProps,
|
|
103
|
-
informationHighlightStencil({[model.state.variant]: model.state.emphasis})
|
|
104
|
-
)}
|
|
105
|
-
/>
|
|
106
|
-
);
|
|
107
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import {createModelHook} from '@workday/canvas-kit-react/common';
|
|
2
|
-
|
|
3
|
-
export const useInformationHighlightModel = createModelHook({
|
|
4
|
-
defaultConfig: {
|
|
5
|
-
variant: 'informational' as 'informational' | 'caution' | 'critical',
|
|
6
|
-
emphasis: 'low' as 'low' | 'high',
|
|
7
|
-
},
|
|
8
|
-
})(config => {
|
|
9
|
-
return {
|
|
10
|
-
state: {
|
|
11
|
-
variant: config.variant,
|
|
12
|
-
emphasis: config.emphasis,
|
|
13
|
-
},
|
|
14
|
-
events: {},
|
|
15
|
-
};
|
|
16
|
-
});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import {createComponent, ExtractProps} from '@workday/canvas-kit-react/common';
|
|
2
|
-
import {createStencil, handleCsProp} from '@workday/canvas-kit-styling';
|
|
3
|
-
import {system} from '@workday/canvas-tokens-web';
|
|
4
|
-
import {Text} from '@workday/canvas-kit-react/text';
|
|
5
|
-
|
|
6
|
-
const informationHighlightBodyStencil = createStencil({
|
|
7
|
-
base: () => {
|
|
8
|
-
return {
|
|
9
|
-
...system.type.subtext.large,
|
|
10
|
-
color: system.color.text.strong,
|
|
11
|
-
gridColumn: '2',
|
|
12
|
-
marginBlockEnd: system.space.x2,
|
|
13
|
-
};
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
export const Body = createComponent('div')({
|
|
18
|
-
displayName: 'Body',
|
|
19
|
-
Component: ({...elemProps}: ExtractProps<typeof Text, never>, ref, Element) => {
|
|
20
|
-
return (
|
|
21
|
-
<Text
|
|
22
|
-
as={Element}
|
|
23
|
-
ref={ref}
|
|
24
|
-
{...handleCsProp(elemProps, informationHighlightBodyStencil())}
|
|
25
|
-
/>
|
|
26
|
-
);
|
|
27
|
-
},
|
|
28
|
-
});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import {createComponent, ExtractProps} from '@workday/canvas-kit-react/common';
|
|
2
|
-
import {createStencil, handleCsProp} from '@workday/canvas-kit-styling';
|
|
3
|
-
import {system} from '@workday/canvas-tokens-web';
|
|
4
|
-
import {Heading} from '@workday/canvas-kit-react/text';
|
|
5
|
-
|
|
6
|
-
const informationHighlightHeadingStencil = createStencil({
|
|
7
|
-
base: () => {
|
|
8
|
-
return {
|
|
9
|
-
...system.type.body.small,
|
|
10
|
-
color: system.color.text.strong,
|
|
11
|
-
gridColumn: '2',
|
|
12
|
-
fontWeight: system.fontWeight.bold,
|
|
13
|
-
marginTop: system.space.zero,
|
|
14
|
-
marginBottom: system.space.zero,
|
|
15
|
-
};
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
export interface InformationHighlightHeadingProps
|
|
20
|
-
extends Partial<ExtractProps<typeof Heading, never>> {}
|
|
21
|
-
|
|
22
|
-
export const InformationHighlightHeading = createComponent('h3')({
|
|
23
|
-
displayName: 'Heading',
|
|
24
|
-
Component: ({size = 'small', ...elemProps}: InformationHighlightHeadingProps, ref, Element) => {
|
|
25
|
-
return (
|
|
26
|
-
<Heading
|
|
27
|
-
as={Element}
|
|
28
|
-
ref={ref}
|
|
29
|
-
size={size}
|
|
30
|
-
{...handleCsProp(elemProps, informationHighlightHeadingStencil())}
|
|
31
|
-
/>
|
|
32
|
-
);
|
|
33
|
-
},
|
|
34
|
-
});
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {SystemIcon} from '@workday/canvas-kit-react/icon';
|
|
2
|
-
import {createSubcomponent, ExtractProps} from '@workday/canvas-kit-react/common';
|
|
3
|
-
import {
|
|
4
|
-
infoIcon,
|
|
5
|
-
exclamationCircleIcon,
|
|
6
|
-
exclamationTriangleIcon,
|
|
7
|
-
} from '@workday/canvas-system-icons-web';
|
|
8
|
-
import {useInformationHighlightModel} from '../hooks/useInformationHighlightModel';
|
|
9
|
-
|
|
10
|
-
export interface IconProps extends Partial<ExtractProps<typeof SystemIcon, never>> {}
|
|
11
|
-
const defaultIcons = {
|
|
12
|
-
informational: infoIcon,
|
|
13
|
-
caution: exclamationTriangleIcon,
|
|
14
|
-
critical: exclamationCircleIcon,
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export const Icon = createSubcomponent('span')({
|
|
18
|
-
displayName: 'Icon',
|
|
19
|
-
modelHook: useInformationHighlightModel,
|
|
20
|
-
})(({icon, ...props}: IconProps, Element, model) => {
|
|
21
|
-
return (
|
|
22
|
-
<SystemIcon
|
|
23
|
-
as={Element}
|
|
24
|
-
icon={icon ? icon : defaultIcons[model.state.variant]}
|
|
25
|
-
data-part="information-highlight-icon"
|
|
26
|
-
{...props}
|
|
27
|
-
/>
|
|
28
|
-
);
|
|
29
|
-
});
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {Hyperlink} from '@workday/canvas-kit-react/button';
|
|
2
|
-
import {createComponent, ExtractProps} from '@workday/canvas-kit-react/common';
|
|
3
|
-
import {createStencil, handleCsProp} from '@workday/canvas-kit-styling';
|
|
4
|
-
import {system} from '@workday/canvas-tokens-web';
|
|
5
|
-
|
|
6
|
-
const informationHighlightLinkStencil = createStencil({
|
|
7
|
-
base: () => {
|
|
8
|
-
return {
|
|
9
|
-
...system.type.subtext.large,
|
|
10
|
-
gridColumn: '2',
|
|
11
|
-
justifySelf: 'start',
|
|
12
|
-
color: system.color.text.strong,
|
|
13
|
-
fontWeight: system.fontWeight.bold,
|
|
14
|
-
};
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
export const Link = createComponent('a')({
|
|
19
|
-
displayName: 'Link',
|
|
20
|
-
Component: ({...elemProps}: ExtractProps<typeof Hyperlink, never>, ref, Element) => {
|
|
21
|
-
return (
|
|
22
|
-
<Hyperlink
|
|
23
|
-
as={Element}
|
|
24
|
-
ref={ref}
|
|
25
|
-
{...handleCsProp(elemProps, informationHighlightLinkStencil())}
|
|
26
|
-
/>
|
|
27
|
-
);
|
|
28
|
-
},
|
|
29
|
-
});
|