@workday/canvas-kit-preview-react 15.0.0-alpha.0076-next.0 → 15.0.0-alpha.0090-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/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 +1 -1
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +1 -1
- package/dist/commonjs/loading-sparkles/lib/LoadingSparkles.js +2 -2
- package/dist/commonjs/multi-select/lib/MultiSelectInput.js +3 -3
- 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/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 +1 -1
- package/dist/es6/index.d.ts.map +1 -1
- package/dist/es6/index.js +1 -1
- package/dist/es6/loading-sparkles/lib/LoadingSparkles.js +2 -2
- package/dist/es6/multi-select/lib/MultiSelectInput.js +3 -3
- 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 +1 -1
- package/package.json +4 -4
- package/avatar/index.ts +0 -5
- package/avatar/lib/Avatar.tsx +0 -156
- package/avatar/lib/AvatarImage.tsx +0 -20
- package/avatar/lib/AvatarName.tsx +0 -32
- package/avatar/lib/BaseAvatar.tsx +0 -127
- package/avatar/lib/getInitialsFromName.ts +0 -11
- package/avatar/package.json +0 -6
- package/dist/commonjs/avatar/index.d.ts +0 -6
- package/dist/commonjs/avatar/index.d.ts.map +0 -1
- package/dist/commonjs/avatar/index.js +0 -21
- package/dist/commonjs/avatar/lib/Avatar.d.ts +0 -281
- package/dist/commonjs/avatar/lib/Avatar.d.ts.map +0 -1
- package/dist/commonjs/avatar/lib/Avatar.js +0 -53
- package/dist/commonjs/avatar/lib/AvatarImage.d.ts +0 -6
- package/dist/commonjs/avatar/lib/AvatarImage.d.ts.map +0 -1
- package/dist/commonjs/avatar/lib/AvatarImage.js +0 -15
- package/dist/commonjs/avatar/lib/AvatarName.d.ts +0 -14
- package/dist/commonjs/avatar/lib/AvatarName.d.ts.map +0 -1
- package/dist/commonjs/avatar/lib/AvatarName.js +0 -16
- package/dist/commonjs/avatar/lib/BaseAvatar.d.ts +0 -148
- package/dist/commonjs/avatar/lib/BaseAvatar.d.ts.map +0 -1
- package/dist/commonjs/avatar/lib/BaseAvatar.js +0 -47
- package/dist/commonjs/avatar/lib/getInitialsFromName.d.ts +0 -2
- package/dist/commonjs/avatar/lib/getInitialsFromName.d.ts.map +0 -1
- package/dist/commonjs/avatar/lib/getInitialsFromName.js +0 -13
- package/dist/es6/avatar/index.d.ts +0 -6
- package/dist/es6/avatar/index.d.ts.map +0 -1
- package/dist/es6/avatar/index.js +0 -5
- package/dist/es6/avatar/lib/Avatar.d.ts +0 -281
- package/dist/es6/avatar/lib/Avatar.d.ts.map +0 -1
- package/dist/es6/avatar/lib/Avatar.js +0 -47
- package/dist/es6/avatar/lib/AvatarImage.d.ts +0 -6
- package/dist/es6/avatar/lib/AvatarImage.d.ts.map +0 -1
- package/dist/es6/avatar/lib/AvatarImage.js +0 -12
- package/dist/es6/avatar/lib/AvatarName.d.ts +0 -14
- package/dist/es6/avatar/lib/AvatarName.d.ts.map +0 -1
- package/dist/es6/avatar/lib/AvatarName.js +0 -13
- package/dist/es6/avatar/lib/BaseAvatar.d.ts +0 -148
- package/dist/es6/avatar/lib/BaseAvatar.d.ts.map +0 -1
- package/dist/es6/avatar/lib/BaseAvatar.js +0 -44
- package/dist/es6/avatar/lib/getInitialsFromName.d.ts +0 -2
- package/dist/es6/avatar/lib/getInitialsFromName.d.ts.map +0 -1
- package/dist/es6/avatar/lib/getInitialsFromName.js +0 -9
|
@@ -8,10 +8,10 @@ import { RadioLabelContext } from './RadioLabel';
|
|
|
8
8
|
const radioWidth = 18;
|
|
9
9
|
const radioHeight = 18;
|
|
10
10
|
const radioInputStencil = createStencil({
|
|
11
|
-
base: { name: "
|
|
11
|
+
base: { name: "3fuvb2", styles: "box-sizing:border-box;cursor:pointer;height:1.125rem;width:1.125rem;border-radius:var(--cnvs-sys-shape-round);position:absolute;margin:var(--cnvs-sys-space-zero);&:focus-visible, &.focus, &:active{outline:transparent;}&:disabled, &.disabled{cursor:auto;+ .cnvs-radio-check{border-color:var(--cnvs-sys-color-border-input-disabled);background-color:var(--cnvs-sys-color-bg-alt-softer);}&:hover + .cnvs-radio-check, &.hover + .cnvs-radio-check{border-color:var(--cnvs-sys-color-border-input-disabled);}&:checked + .cnvs-radio-check, &.checked + .cnvs-radio-check{background-color:var(--cnvs-brand-primary-accent);border:0.3125rem solid var(--cnvs-brand-primary-base);}}+ .cnvs-radio-check{display:flex;flex-direction:column;align-items:center;background-color:var(--cnvs-sys-color-bg-default);border-radius:var(--cnvs-sys-shape-round);box-sizing:border-box;border:0.0625rem solid var(--cnvs-sys-color-border-input-default);height:1.125rem;width:1.125rem;justify-content:center;pointer-events:none;position:absolute;transition:border 200ms ease, background 200ms;opacity:var(--cnvs-sys-opacity-full);}&:hover + .cnvs-radio-check, &.hover + .cnvs-radio-check{border-color:var(--cnvs-sys-color-border-input-strong);}&:focus-visible + .cnvs-radio-check, &.focus + .cnvs-radio-check{border-color:var(--cnvs-sys-color-border-primary-default);box-shadow:0 0 0 0px var(--cnvs-sys-color-border-inverse), 0 0 0 1px var(--cnvs-brand-common-focus-outline);}&:focus-visible:hover + .cnvs-radio-check, &.focus:hover + .cnvs-radio-check{outline:transparent;}&:checked + .cnvs-radio-check, &.checked + .cnvs-radio-check{background-color:var(--cnvs-brand-primary-accent);border:0.3125rem solid var(--cnvs-brand-primary-base);}&:focus-visible:checked + .cnvs-radio-check, &:focus-visible:hover:checked + .cnvs-radio-check, &.focus:checked + .cnvs-radio-check, &.focus:hover:checked + .cnvs-radio-check{outline:transparent;box-shadow:0 0 0 2px var(--cnvs-sys-color-border-inverse), 0 0 0 4px var(--cnvs-brand-common-focus-outline);}" },
|
|
12
12
|
modifiers: {
|
|
13
13
|
variant: {
|
|
14
|
-
inverse: { name: "
|
|
14
|
+
inverse: { name: "2otgm6", styles: "+ .cnvs-radio-check{background-color:var(--cnvs-sys-color-bg-alt-softer);border-color:var(--cnvs-sys-color-border-input-inverse);}&:disabled, &.disabled{opacity:var(--cnvs-sys-opacity-disabled);+ .cnvs-radio-check{background-color:var(--cnvs-sys-color-bg-alt-softer);border-color:var(--cnvs-sys-color-border-input-disabled);opacity:var(--cnvs-sys-opacity-disabled);}&:checked + .cnvs-radio-check, &.checked + .cnvs-radio-check{background-color:var(--cnvs-brand-primary-base);border-color:var(--cnvs-sys-color-border-inverse);}}&:hover + .cnvs-radio-check, &.hover + .cnvs-radio-check{border-color:var(--cnvs-sys-color-border-input-inverse);}&:focus-visible + .cnvs-radio-check, &.focus + .cnvs-radio-check{border-color:var(--cnvs-sys-color-border-input-inverse);}&:checked + .cnvs-radio-check, &.checked + .cnvs-radio-check{background-color:var(--cnvs-brand-primary-base);border-color:var(--cnvs-sys-color-border-inverse);}&:focus-visible + .cnvs-radio-check, &:focus-visible:hover + .cnvs-radio-check, &.focus + .cnvs-radio-check, &.focus:hover + .cnvs-radio-check{box-shadow:0 0 0 0px var(--cnvs-sys-color-border-contrast-default), 0 0 0 2px var(--cnvs-sys-color-border-inverse);}&:focus-visible:checked + .cnvs-radio-check, &:focus-visible:hover:checked + .cnvs-radio-check, &.focus:checked + .cnvs-radio-check, &.focus:hover:checked + .cnvs-radio-check{box-shadow:0 0 0 2px var(--cnvs-sys-color-border-contrast-default), 0 0 0 4px var(--cnvs-sys-color-border-inverse);}" }
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
}, "radio-input-f05aaa");
|
|
@@ -22,13 +22,13 @@ const StyledRadioInput = createComponent('input')({
|
|
|
22
22
|
},
|
|
23
23
|
});
|
|
24
24
|
const radioInputWrapperStyles = createStencil({
|
|
25
|
-
base: { name: "
|
|
25
|
+
base: { name: "3ey4fy", styles: "box-sizing:border-box;height:1.125rem;width:1.125rem;flex:0 0 auto;::before{content:'';position:absolute;border-radius:var(--cnvs-sys-shape-round);height:1.125rem;transition:box-shadow 150ms ease-out;width:1.125rem;pointer-events:none;opacity:var(--cnvs-sys-opacity-full);}&:hover:before, &.hover:before{box-shadow:0 0 0 calc(var(--cnvs-sys-space-x2) - 0.0625rem) var(--cnvs-sys-color-bg-alt-soft);}" },
|
|
26
26
|
modifiers: {
|
|
27
27
|
variant: {
|
|
28
|
-
inverse: { name: "
|
|
28
|
+
inverse: { name: "2go38h", styles: "::before{opacity:var(--cnvs-sys-opacity-disabled);}" }
|
|
29
29
|
},
|
|
30
30
|
disabled: {
|
|
31
|
-
true: { name: "
|
|
31
|
+
true: { name: "37krpb", styles: "&:hover:before, &.hover:before{box-shadow:none;cursor:auto;}" }
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
}, "radio-input-wrapper-styles-fce2c4");
|
|
@@ -13,19 +13,19 @@ export const panelStencil = createStencil({
|
|
|
13
13
|
expandedWidth: '',
|
|
14
14
|
collapsedWidth: '',
|
|
15
15
|
},
|
|
16
|
-
base: { name: "
|
|
16
|
+
base: { name: "w7ev1", styles: "box-sizing:border-box;overflow:hidden;position:relative;height:100%;outline:0.0625rem solid transparent;transition:width ease-out 200ms, max-width ease-out 200ms;" },
|
|
17
17
|
modifiers: {
|
|
18
18
|
variant: {
|
|
19
|
-
alternate: { name: "
|
|
20
|
-
standard: { name: "
|
|
19
|
+
alternate: { name: "1ftemd", styles: "background-color:var(--cnvs-sys-color-bg-default);box-shadow:var(--cnvs-sys-depth-5);" },
|
|
20
|
+
standard: { name: "f88ry", styles: "background-color:var(--cnvs-sys-color-bg-alt-softer);" }
|
|
21
21
|
},
|
|
22
22
|
expanded: {
|
|
23
|
-
true: { name: "
|
|
24
|
-
false: { name: "
|
|
23
|
+
true: { name: "1p4yuw", styles: "width:var(--expandedWidth-panel-8771e1);max-width:var(--expandedWidth-panel-8771e1);" },
|
|
24
|
+
false: { name: "47ex3p", styles: "width:var(--collapsedWidth-panel-8771e1);max-width:var(--collapsedWidth-panel-8771e1);" }
|
|
25
25
|
},
|
|
26
26
|
touched: {
|
|
27
|
-
true: { name: "
|
|
28
|
-
false: { name: "
|
|
27
|
+
true: { name: "28iybc", styles: "" },
|
|
28
|
+
false: { name: "259wbt", styles: "animation:none;" }
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
}, "panel-8771e1");
|
|
@@ -8,35 +8,35 @@ import { SidePanelContext } from './hooks';
|
|
|
8
8
|
import { createStencil, handleCsProp } from '@workday/canvas-kit-styling';
|
|
9
9
|
import { system } from '@workday/canvas-tokens-web';
|
|
10
10
|
export const sidePanelToggleButtonStencil = createStencil({
|
|
11
|
-
base: { name: "
|
|
11
|
+
base: { name: "2bpfjr", styles: "box-sizing:border-box;position:absolute;top:var(--cnvs-sys-space-x6);width:var(--cnvs-sys-space-x8);inset-inline-end:var(--cnvs-sys-space-x4);" },
|
|
12
12
|
modifiers: {
|
|
13
13
|
state: {
|
|
14
|
-
collapsing: { name: "
|
|
15
|
-
collapsed: { name: "
|
|
16
|
-
expanded: { name: "
|
|
17
|
-
expanding: { name: "
|
|
14
|
+
collapsing: { name: "lui40", styles: "margin:0;transform:scaleX(1);:dir(rtl){transform:scaleX(-1);}" },
|
|
15
|
+
collapsed: { name: "44bri4", styles: "margin:auto;inset-inline-start:0;inset-inline-end:0;transform:scaleX(1);:dir(rtl){transform:scaleX(-1);}" },
|
|
16
|
+
expanded: { name: "3k2le7", styles: "margin:0;transform:scaleX(-1);:dir(rtl){transform:scaleX(1);}" },
|
|
17
|
+
expanding: { name: "444hz9", styles: "margin:0;transform:scaleX(-1);:dir(rtl){transform:scaleX(1);}" }
|
|
18
18
|
},
|
|
19
19
|
origin: {
|
|
20
|
-
left: { name: "
|
|
21
|
-
right: { name: "
|
|
20
|
+
left: { name: "3ok9rw", styles: "" },
|
|
21
|
+
right: { name: "35xukm", styles: "" }
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
compound: [
|
|
25
25
|
{
|
|
26
26
|
modifiers: { state: 'collapsed', origin: 'right' },
|
|
27
|
-
styles: { name: "
|
|
27
|
+
styles: { name: "15hqst", styles: "transform:scaleX(-1);" }
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
modifiers: { state: 'collapsing', origin: 'right' },
|
|
31
|
-
styles: { name: "
|
|
31
|
+
styles: { name: "2c29c5", styles: "transform:scaleX(-1);inset-inline-start:var(--cnvs-sys-space-x4);" }
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
modifiers: { state: 'expanded', origin: 'right' },
|
|
35
|
-
styles: { name: "
|
|
35
|
+
styles: { name: "1xxsq6", styles: "transform:scaleX(1);inset-inline-start:var(--cnvs-sys-space-x4);" }
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
modifiers: { state: 'expanding', origin: 'right' },
|
|
39
|
-
styles: { name: "
|
|
39
|
+
styles: { name: "iw8u1", styles: "transform:scaleX(1);inset-inline-start:var(--cnvs-sys-space-x4);" }
|
|
40
40
|
}
|
|
41
41
|
]
|
|
42
42
|
}, "side-panel-toggle-button-da8098");
|
|
@@ -15,7 +15,7 @@ const deprecatedVariantsMap = {
|
|
|
15
15
|
gray: 'neutral',
|
|
16
16
|
};
|
|
17
17
|
const statusIndicatorStencil = createStencil({
|
|
18
|
-
base: { name: "
|
|
18
|
+
base: { name: "32i3y3", 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-round);height:1.25rem;padding:var(--cnvs-sys-space-zero) var(--cnvs-sys-space-x2);outline:0.0625rem solid transparent;--color-system-icon-3a4847:currentColor;" },
|
|
19
19
|
modifiers: {
|
|
20
20
|
/**
|
|
21
21
|
* Defines the color of the `StatusIndicator`.
|
|
@@ -30,13 +30,13 @@ const statusIndicatorStencil = createStencil({
|
|
|
30
30
|
* @default 'neutral'
|
|
31
31
|
*/
|
|
32
32
|
variant: {
|
|
33
|
-
info: { name: "
|
|
34
|
-
positive: { name: "
|
|
35
|
-
caution: { name: "
|
|
36
|
-
critical: { name: "
|
|
37
|
-
neutral: { name: "
|
|
38
|
-
ai: { name: "
|
|
39
|
-
transparent: { name: "
|
|
33
|
+
info: { name: "3n5sqm", styles: "color:var(--cnvs-sys-color-fg-info-strong);background-color:var(--cnvs-sys-color-bg-info-softer);" },
|
|
34
|
+
positive: { name: "3kq4rd", styles: "color:var(--cnvs-sys-color-fg-positive-strong);background-color:var(--cnvs-sys-color-fg-positive-softer);" },
|
|
35
|
+
caution: { name: "1yy7ri", styles: "color:var(--cnvs-sys-color-fg-caution-soft);background-color:var(--cnvs-sys-color-bg-caution-softer);" },
|
|
36
|
+
critical: { name: "w851x", styles: "color:var(--cnvs-sys-color-fg-critical-strong);background-color:var(--cnvs-sys-color-bg-critical-softer);" },
|
|
37
|
+
neutral: { name: "2h5x5n", styles: "color:var(--cnvs-sys-color-fg-muted-strong);background-color:var(--cnvs-sys-color-bg-alt-default);" },
|
|
38
|
+
ai: { name: "3hvi23", styles: "color:var(--cnvs-sys-color-fg-ai);background-color:var(--cnvs-sys-color-bg-ai-default);" },
|
|
39
|
+
transparent: { name: "1physt", styles: "color:var(--cnvs-sys-color-fg-inverse);background-color:var(--cnvs-sys-color-bg-translucent);" }
|
|
40
40
|
},
|
|
41
41
|
/**
|
|
42
42
|
* Defines the emphasis of the `StatusIndicator`. `low` should be used in almost all cases.
|
|
@@ -49,8 +49,8 @@ const statusIndicatorStencil = createStencil({
|
|
|
49
49
|
*
|
|
50
50
|
*/
|
|
51
51
|
emphasis: {
|
|
52
|
-
low: { name: "
|
|
53
|
-
high: { name: "
|
|
52
|
+
low: { name: "26rocs", styles: "" },
|
|
53
|
+
high: { name: "utbnf", styles: "" }
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
56
|
compound: [
|
|
@@ -59,35 +59,35 @@ const statusIndicatorStencil = createStencil({
|
|
|
59
59
|
variant: 'info',
|
|
60
60
|
emphasis: 'high',
|
|
61
61
|
},
|
|
62
|
-
styles: { name: "
|
|
62
|
+
styles: { name: "1e69q2", styles: "background-color:var(--cnvs-sys-color-bg-info-default);color:var(--cnvs-sys-color-fg-inverse);" }
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
modifiers: {
|
|
66
66
|
variant: 'positive',
|
|
67
67
|
emphasis: 'high',
|
|
68
68
|
},
|
|
69
|
-
styles: { name: "
|
|
69
|
+
styles: { name: "2bg87y", styles: "background-color:var(--cnvs-sys-color-bg-positive-default);color:var(--cnvs-sys-color-fg-inverse);" }
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
modifiers: {
|
|
73
73
|
variant: 'caution',
|
|
74
74
|
emphasis: 'high',
|
|
75
75
|
},
|
|
76
|
-
styles: { name: "
|
|
76
|
+
styles: { name: "297k8f", styles: "background-color:var(--cnvs-sys-color-bg-caution-default);color:var(--cnvs-sys-color-fg-caution-strong);" }
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
modifiers: {
|
|
80
80
|
variant: 'critical',
|
|
81
81
|
emphasis: 'high',
|
|
82
82
|
},
|
|
83
|
-
styles: { name: "
|
|
83
|
+
styles: { name: "2fu3xc", styles: "background-color:var(--cnvs-sys-color-bg-critical-default);color:var(--cnvs-sys-color-fg-inverse);" }
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
modifiers: {
|
|
87
87
|
variant: 'neutral',
|
|
88
88
|
emphasis: 'high',
|
|
89
89
|
},
|
|
90
|
-
styles: { name: "
|
|
90
|
+
styles: { name: "qtqhu", styles: "background-color:var(--cnvs-sys-color-bg-muted-default);color:var(--cnvs-sys-color-fg-inverse);" }
|
|
91
91
|
}
|
|
92
92
|
],
|
|
93
93
|
defaultModifiers: {
|
|
@@ -6,7 +6,7 @@ import { mergeStyles } from '@workday/canvas-kit-react/layout';
|
|
|
6
6
|
import { system } from '@workday/canvas-tokens-web';
|
|
7
7
|
const statusIndicatorLabelStencil = createStencil({
|
|
8
8
|
extends: textStencil,
|
|
9
|
-
base: { name: "
|
|
9
|
+
base: { name: "47mz1u", 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;" },
|
|
10
10
|
defaultModifiers: { typeLevel: 'subtext.large' }
|
|
11
11
|
}, "status-indicator-label-63258e");
|
|
12
12
|
export const StatusIndicatorLabel = createComponent('span')({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '14.2.
|
|
1
|
+
export const version = '14.2.4';
|
package/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-preview-react",
|
|
3
|
-
"version": "15.0.0-alpha.
|
|
3
|
+
"version": "15.0.0-alpha.0090-next.0",
|
|
4
4
|
"description": "Canvas Kit Preview is made up of components that have the full design and a11y review, are part of the DS ecosystem and are approved for use in product. The API's could be subject to change, but not without strong communication and migration strategies.",
|
|
5
5
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@emotion/react": "^11.7.1",
|
|
50
50
|
"@emotion/styled": "^11.6.0",
|
|
51
|
-
"@workday/canvas-kit-react": "^15.0.0-alpha.
|
|
52
|
-
"@workday/canvas-kit-styling": "^15.0.0-alpha.
|
|
51
|
+
"@workday/canvas-kit-react": "^15.0.0-alpha.0090-next.0",
|
|
52
|
+
"@workday/canvas-kit-styling": "^15.0.0-alpha.0090-next.0",
|
|
53
53
|
"@workday/canvas-system-icons-web": "^3.0.36",
|
|
54
54
|
"@workday/canvas-tokens-web": "4.0.0-alpha.3",
|
|
55
55
|
"@workday/design-assets-types": "^0.2.10"
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"react-hook-form": "7.36.1",
|
|
61
61
|
"yup": "^0.32.11"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "54d08f77d0527af840c9f102ce9a8f44942a5e9d"
|
|
64
64
|
}
|
package/avatar/index.ts
DELETED
package/avatar/lib/Avatar.tsx
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import {createComponent} from '@workday/canvas-kit-react/common';
|
|
4
|
-
import {Property} from 'csstype';
|
|
5
|
-
import {createStencil, handleCsProp} from '@workday/canvas-kit-styling';
|
|
6
|
-
import {system} from '@workday/canvas-tokens-web';
|
|
7
|
-
|
|
8
|
-
import {BaseAvatarProps, BaseAvatar, baseAvatarStencil} from './BaseAvatar';
|
|
9
|
-
import {AvatarNameProps} from './AvatarName';
|
|
10
|
-
|
|
11
|
-
export interface AvatarProps extends BaseAvatarProps, AvatarNameProps {
|
|
12
|
-
/**
|
|
13
|
-
* The URL of the user's photo. For best fit, use square images.
|
|
14
|
-
*/
|
|
15
|
-
url?: string;
|
|
16
|
-
/**
|
|
17
|
-
* An objectFit property that can customize how to resize your image to fit its container.
|
|
18
|
-
* @default "contain"
|
|
19
|
-
*/
|
|
20
|
-
objectFit?: Property.ObjectFit;
|
|
21
|
-
/**
|
|
22
|
-
* If true, the Avatar won't forward the `name` prop to the `alt` attribute of the image. This is useful when the Avatar is purely decorative and is rendered next to a name or text.
|
|
23
|
-
*/
|
|
24
|
-
isDecorative?: boolean;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export const avatarStencil = createStencil({
|
|
28
|
-
extends: baseAvatarStencil,
|
|
29
|
-
parts: {
|
|
30
|
-
avatarImage: 'avatar-image',
|
|
31
|
-
avatarName: 'avatar-name',
|
|
32
|
-
},
|
|
33
|
-
base: {},
|
|
34
|
-
modifiers: {
|
|
35
|
-
imageLoaded: {
|
|
36
|
-
false: ({avatarImagePart}) => ({
|
|
37
|
-
[avatarImagePart]: {
|
|
38
|
-
display: 'none',
|
|
39
|
-
},
|
|
40
|
-
}),
|
|
41
|
-
true: {
|
|
42
|
-
backgroundColor: system.color.bg.default,
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
objectFit: {
|
|
46
|
-
contain: ({avatarImagePart}) => ({
|
|
47
|
-
[avatarImagePart]: {
|
|
48
|
-
objectFit: 'contain',
|
|
49
|
-
},
|
|
50
|
-
}),
|
|
51
|
-
cover: ({avatarImagePart}) => ({
|
|
52
|
-
[avatarImagePart]: {
|
|
53
|
-
objectFit: 'cover',
|
|
54
|
-
},
|
|
55
|
-
}),
|
|
56
|
-
fill: ({avatarImagePart}) => ({
|
|
57
|
-
[avatarImagePart]: {
|
|
58
|
-
objectFit: 'fill',
|
|
59
|
-
},
|
|
60
|
-
}),
|
|
61
|
-
none: ({avatarImagePart}) => ({
|
|
62
|
-
[avatarImagePart]: {
|
|
63
|
-
objectFit: 'none',
|
|
64
|
-
},
|
|
65
|
-
}),
|
|
66
|
-
['scale-down']: ({avatarImagePart}) => ({
|
|
67
|
-
[avatarImagePart]: {
|
|
68
|
-
objectFit: 'scale-down',
|
|
69
|
-
},
|
|
70
|
-
}),
|
|
71
|
-
initial: ({avatarImagePart}) => ({
|
|
72
|
-
[avatarImagePart]: {
|
|
73
|
-
objectFit: 'initial',
|
|
74
|
-
},
|
|
75
|
-
}),
|
|
76
|
-
|
|
77
|
-
inherit: ({avatarImagePart}) => ({
|
|
78
|
-
[avatarImagePart]: {
|
|
79
|
-
objectFit: 'inherit',
|
|
80
|
-
},
|
|
81
|
-
}),
|
|
82
|
-
unset: ({avatarImagePart}) => ({
|
|
83
|
-
[avatarImagePart]: {
|
|
84
|
-
objectFit: 'unset',
|
|
85
|
-
},
|
|
86
|
-
}),
|
|
87
|
-
['-moz-initial']: ({avatarImagePart}) => ({
|
|
88
|
-
[avatarImagePart]: {
|
|
89
|
-
objectFit: '-moz-initial',
|
|
90
|
-
},
|
|
91
|
-
}),
|
|
92
|
-
['revert']: ({avatarImagePart}) => ({
|
|
93
|
-
[avatarImagePart]: {
|
|
94
|
-
objectFit: 'revert',
|
|
95
|
-
},
|
|
96
|
-
}),
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* JSDoc for Avatar. Will be part of the Component API docs
|
|
103
|
-
*/
|
|
104
|
-
export const Avatar = createComponent('div')({
|
|
105
|
-
displayName: 'Avatar',
|
|
106
|
-
|
|
107
|
-
Component: (
|
|
108
|
-
{
|
|
109
|
-
url,
|
|
110
|
-
name,
|
|
111
|
-
variant,
|
|
112
|
-
objectFit = 'contain',
|
|
113
|
-
preferredInitials,
|
|
114
|
-
isDecorative,
|
|
115
|
-
size,
|
|
116
|
-
...elemProps
|
|
117
|
-
}: AvatarProps,
|
|
118
|
-
ref,
|
|
119
|
-
Element
|
|
120
|
-
) => {
|
|
121
|
-
const [imageLoaded, setImageLoaded] = React.useState(false);
|
|
122
|
-
|
|
123
|
-
const handleImageLoad = () => {
|
|
124
|
-
if (!imageLoaded) {
|
|
125
|
-
setImageLoaded(true);
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
return (
|
|
130
|
-
<BaseAvatar
|
|
131
|
-
as={Element}
|
|
132
|
-
ref={ref}
|
|
133
|
-
{...handleCsProp(elemProps, avatarStencil({variant, size, imageLoaded, objectFit}))}
|
|
134
|
-
>
|
|
135
|
-
{url && (
|
|
136
|
-
<>
|
|
137
|
-
<BaseAvatar.Image
|
|
138
|
-
onLoad={handleImageLoad}
|
|
139
|
-
src={url}
|
|
140
|
-
alt={isDecorative ? undefined : name}
|
|
141
|
-
aria-hidden={isDecorative}
|
|
142
|
-
{...avatarStencil.parts.avatarImage}
|
|
143
|
-
/>
|
|
144
|
-
</>
|
|
145
|
-
)}
|
|
146
|
-
{name && (!url || !imageLoaded) && (
|
|
147
|
-
<BaseAvatar.Name
|
|
148
|
-
name={name}
|
|
149
|
-
preferredInitials={preferredInitials}
|
|
150
|
-
{...avatarStencil.parts.avatarName}
|
|
151
|
-
/>
|
|
152
|
-
)}
|
|
153
|
-
</BaseAvatar>
|
|
154
|
-
);
|
|
155
|
-
},
|
|
156
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import {createComponent} from '@workday/canvas-kit-react/common';
|
|
2
|
-
|
|
3
|
-
import {handleCsProp, createStencil, CSProps} from '@workday/canvas-kit-styling';
|
|
4
|
-
|
|
5
|
-
export interface AvatarImageProps extends CSProps {}
|
|
6
|
-
|
|
7
|
-
export const avatarImageStencil = createStencil({
|
|
8
|
-
base: {
|
|
9
|
-
height: '100%',
|
|
10
|
-
width: '100%',
|
|
11
|
-
objectFit: 'cover',
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
export const AvatarImage = createComponent('img')({
|
|
16
|
-
displayName: 'AvatarImage',
|
|
17
|
-
Component: ({...elemProps}: AvatarImageProps, ref, Element) => {
|
|
18
|
-
return <Element ref={ref} {...handleCsProp(elemProps, avatarImageStencil())} />;
|
|
19
|
-
},
|
|
20
|
-
});
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {createComponent} from '@workday/canvas-kit-react/common';
|
|
2
|
-
import {CSProps, handleCsProp, createStencil} from '@workday/canvas-kit-styling';
|
|
3
|
-
import {getInitialsFromName} from './getInitialsFromName';
|
|
4
|
-
|
|
5
|
-
export interface AvatarNameProps extends CSProps {
|
|
6
|
-
/**
|
|
7
|
-
* The alt text of the Avatar image. This prop is also used for the initials. The first letter of the first name and the first letter of the second name are chosen for the initials.
|
|
8
|
-
*/
|
|
9
|
-
name: string;
|
|
10
|
-
/**
|
|
11
|
-
* If you want full control over the initials, use `preferredInitials` instead.
|
|
12
|
-
*/
|
|
13
|
-
preferredInitials?: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export const avatarNameStencil = createStencil({
|
|
17
|
-
base: {
|
|
18
|
-
textTransform: 'uppercase',
|
|
19
|
-
cursor: 'default',
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
export const AvatarName = createComponent('span')({
|
|
24
|
-
displayName: 'AvatarName',
|
|
25
|
-
Component: ({name, preferredInitials, ...elemProps}: AvatarNameProps, ref, Element) => {
|
|
26
|
-
return (
|
|
27
|
-
<Element ref={ref} {...handleCsProp(elemProps, avatarNameStencil())}>
|
|
28
|
-
{preferredInitials || getInitialsFromName(name)}
|
|
29
|
-
</Element>
|
|
30
|
-
);
|
|
31
|
-
},
|
|
32
|
-
});
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import {createComponent} from '@workday/canvas-kit-react/common';
|
|
4
|
-
|
|
5
|
-
import {AvatarImage} from './AvatarImage';
|
|
6
|
-
import {AvatarName} from './AvatarName';
|
|
7
|
-
import {createStencil, cssVar, calc, handleCsProp, CSProps} from '@workday/canvas-kit-styling';
|
|
8
|
-
import {system, base} from '@workday/canvas-tokens-web';
|
|
9
|
-
|
|
10
|
-
export interface BaseAvatarProps extends CSProps {
|
|
11
|
-
/**
|
|
12
|
-
* Children of the BaseAvatar.
|
|
13
|
-
*/
|
|
14
|
-
children?: React.ReactNode;
|
|
15
|
-
/**
|
|
16
|
-
* The variant of the Avatar.
|
|
17
|
-
* @default "blue"
|
|
18
|
-
*/
|
|
19
|
-
variant?: 'blue' | 'amber' | 'teal' | 'purple';
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* The size of the Avatar.
|
|
23
|
-
* `extraExtraSmall` is 24px x 24px
|
|
24
|
-
* `extraSmall` is 32px x 32px
|
|
25
|
-
* `small` is 40px x 40px
|
|
26
|
-
* `medium` is 48px x 48px
|
|
27
|
-
* `large` is 72px x 72px
|
|
28
|
-
* `extraLarge` is 96px x 96px
|
|
29
|
-
* `extraExtraLarge` is 120px x 120px
|
|
30
|
-
* @default "medium"
|
|
31
|
-
*/
|
|
32
|
-
size?:
|
|
33
|
-
| 'extraExtraSmall'
|
|
34
|
-
| 'extraSmall'
|
|
35
|
-
| 'small'
|
|
36
|
-
| 'medium'
|
|
37
|
-
| 'large'
|
|
38
|
-
| 'extraLarge'
|
|
39
|
-
| 'extraExtraLarge'
|
|
40
|
-
| (string & {});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export const baseAvatarStencil = createStencil({
|
|
44
|
-
vars: {
|
|
45
|
-
backgroundColor: '',
|
|
46
|
-
color: '',
|
|
47
|
-
size: '',
|
|
48
|
-
},
|
|
49
|
-
base: ({backgroundColor, color, size}) => ({
|
|
50
|
-
borderRadius: system.shape.round,
|
|
51
|
-
width: cssVar(size, calc.add(system.space.x10, system.space.x2)),
|
|
52
|
-
height: cssVar(size, calc.add(system.space.x10, system.space.x2)),
|
|
53
|
-
backgroundColor: cssVar(backgroundColor, base.blue300),
|
|
54
|
-
color: cssVar(color, base.blue800),
|
|
55
|
-
display: 'flex',
|
|
56
|
-
alignItems: 'center',
|
|
57
|
-
justifyContent: 'center',
|
|
58
|
-
overflow: 'hidden',
|
|
59
|
-
border: 'none',
|
|
60
|
-
...system.type.body.medium,
|
|
61
|
-
}),
|
|
62
|
-
modifiers: {
|
|
63
|
-
variant: {
|
|
64
|
-
blue: ({backgroundColor, color}) => ({
|
|
65
|
-
backgroundColor: cssVar(backgroundColor, base.blue300),
|
|
66
|
-
color: cssVar(color, base.blue800),
|
|
67
|
-
}),
|
|
68
|
-
amber: ({backgroundColor, color}) => ({
|
|
69
|
-
backgroundColor: cssVar(backgroundColor, base.amber200),
|
|
70
|
-
color: cssVar(color, base.amber700),
|
|
71
|
-
}),
|
|
72
|
-
|
|
73
|
-
teal: ({backgroundColor, color}) => ({
|
|
74
|
-
backgroundColor: cssVar(backgroundColor, base.teal300),
|
|
75
|
-
color: cssVar(color, base.teal800),
|
|
76
|
-
}),
|
|
77
|
-
purple: ({backgroundColor, color}) => ({
|
|
78
|
-
backgroundColor: cssVar(backgroundColor, base.purple300),
|
|
79
|
-
color: cssVar(color, base.purple800),
|
|
80
|
-
}),
|
|
81
|
-
},
|
|
82
|
-
size: {
|
|
83
|
-
extraExtraSmall: ({size}) => ({
|
|
84
|
-
[size]: system.space.x6,
|
|
85
|
-
...system.type.subtext.small,
|
|
86
|
-
}),
|
|
87
|
-
extraSmall: ({size}) => ({
|
|
88
|
-
[size]: system.space.x8,
|
|
89
|
-
...system.type.subtext.medium,
|
|
90
|
-
}),
|
|
91
|
-
small: ({size}) => ({
|
|
92
|
-
[size]: system.space.x10,
|
|
93
|
-
...system.type.body.small,
|
|
94
|
-
}),
|
|
95
|
-
medium: ({size}) => ({
|
|
96
|
-
[size]: calc.add(system.space.x10, system.space.x2),
|
|
97
|
-
...system.type.body.medium,
|
|
98
|
-
}),
|
|
99
|
-
large: ({size}) => ({
|
|
100
|
-
[size]: calc.add(system.space.x16, system.space.x2),
|
|
101
|
-
...system.type.heading.medium,
|
|
102
|
-
}),
|
|
103
|
-
extraLarge: ({size}) => ({
|
|
104
|
-
[size]: calc.add(system.space.x20, system.space.x4),
|
|
105
|
-
...system.type.title.small,
|
|
106
|
-
}),
|
|
107
|
-
extraExtraLarge: ({size}) => ({
|
|
108
|
-
[size]: calc.multiply(system.space.x10, 3),
|
|
109
|
-
...system.type.title.medium,
|
|
110
|
-
}),
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* JSDoc for Avatar. Will be part of the Component API docs
|
|
117
|
-
*/
|
|
118
|
-
export const BaseAvatar = createComponent('div')({
|
|
119
|
-
displayName: 'BaseAvatar',
|
|
120
|
-
subComponents: {
|
|
121
|
-
Image: AvatarImage,
|
|
122
|
-
Name: AvatarName,
|
|
123
|
-
},
|
|
124
|
-
Component: ({variant, size, ...elemProps}: BaseAvatarProps, ref, Element) => {
|
|
125
|
-
return <Element ref={ref} {...handleCsProp(elemProps, baseAvatarStencil({variant, size}))} />;
|
|
126
|
-
},
|
|
127
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export const getInitialsFromName = (name: string) => {
|
|
2
|
-
// Trim and split by one or more whitespace characters
|
|
3
|
-
const nameParts = name.trim().split(/\s+/).filter(Boolean);
|
|
4
|
-
|
|
5
|
-
const first = nameParts[0];
|
|
6
|
-
const firstInitial = first?.[0] || '';
|
|
7
|
-
const last = nameParts.length > 1 ? nameParts[nameParts.length - 1] : undefined;
|
|
8
|
-
const lastInitial = last?.[0] || '';
|
|
9
|
-
|
|
10
|
-
return `${firstInitial}${lastInitial}`;
|
|
11
|
-
};
|
package/avatar/package.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../avatar/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./lib/Avatar"), exports);
|
|
18
|
-
__exportStar(require("./lib/AvatarImage"), exports);
|
|
19
|
-
__exportStar(require("./lib/AvatarName"), exports);
|
|
20
|
-
__exportStar(require("./lib/BaseAvatar"), exports);
|
|
21
|
-
__exportStar(require("./lib/getInitialsFromName"), exports);
|