@workday/canvas-kit-preview-react 14.0.0-alpha.1127-next.0 → 14.0.0-alpha.1129-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/divider/lib/Divider.js +1 -1
- package/dist/commonjs/information-highlight/lib/InformationHighlight.js +7 -7
- package/dist/commonjs/information-highlight/lib/parts/Body.js +1 -1
- package/dist/commonjs/information-highlight/lib/parts/Heading.js +1 -1
- package/dist/commonjs/information-highlight/lib/parts/Link.js +1 -1
- package/dist/commonjs/loading-sparkles/lib/LoadingSparkles.js +2 -2
- package/dist/commonjs/multi-select/lib/MultiSelectInput.d.ts +57 -3
- package/dist/commonjs/multi-select/lib/MultiSelectInput.d.ts.map +1 -1
- package/dist/commonjs/multi-select/lib/MultiSelectInput.js +17 -8
- 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/segmented-control/lib/SegmentedControlItem.js +16 -16
- package/dist/commonjs/segmented-control/lib/SegmentedControlList.js +4 -4
- 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 +13 -13
- package/dist/commonjs/status-indicator/lib/StatusIndicatorLabel.js +1 -1
- package/dist/es6/divider/lib/Divider.js +1 -1
- package/dist/es6/information-highlight/lib/InformationHighlight.js +7 -7
- package/dist/es6/information-highlight/lib/parts/Body.js +1 -1
- package/dist/es6/information-highlight/lib/parts/Heading.js +1 -1
- package/dist/es6/information-highlight/lib/parts/Link.js +1 -1
- package/dist/es6/loading-sparkles/lib/LoadingSparkles.js +2 -2
- package/dist/es6/multi-select/lib/MultiSelectInput.d.ts +57 -3
- package/dist/es6/multi-select/lib/MultiSelectInput.d.ts.map +1 -1
- package/dist/es6/multi-select/lib/MultiSelectInput.js +19 -10
- 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/segmented-control/lib/SegmentedControlItem.js +16 -16
- package/dist/es6/segmented-control/lib/SegmentedControlList.js +4 -4
- 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 +13 -13
- package/dist/es6/status-indicator/lib/StatusIndicatorLabel.js +1 -1
- package/multi-select/lib/MultiSelectInput.tsx +60 -12
- package/package.json +4 -4
|
@@ -11,55 +11,55 @@ import { useSegmentedControlModel } from './hooks/useSegmentedControlModel';
|
|
|
11
11
|
import { useSegmentedControlItem } from './hooks/useSegmentedControlItem';
|
|
12
12
|
export const segmentedControlItemStencil = createStencil({
|
|
13
13
|
extends: buttonStencil,
|
|
14
|
-
base: { name: "
|
|
14
|
+
base: { name: "tc0w3p", 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);text-align:start;padding-inline:var(--cnvs-sys-space-zero);gap:var(--cnvs-sys-space-x1);--borderRadius-button-65cb05:var(--cnvs-sys-shape-x1);--label-button-65cb05:var(--cnvs-sys-color-fg-muted-strong);--color-system-icon-99ce3e:var(--cnvs-sys-color-fg-muted-strong);&:hover, &.hover{--background-button-65cb05:var(--cnvs-sys-color-bg-alt-strong);--label-button-65cb05:var(--cnvs-sys-color-fg-muted-strong);--color-system-icon-99ce3e:var(--cnvs-sys-color-fg-muted-strong);}&:active, &.active{--background-button-65cb05:var(--cnvs-sys-color-bg-alt-strong);--label-button-65cb05:var(--cnvs-sys-color-fg-muted-strong);--color-system-icon-99ce3e:var(--cnvs-sys-color-fg-muted-strong);}&:focus-visible, &.focus{--label-button-65cb05:var(--cnvs-sys-color-fg-muted-strong);--color-system-icon-99ce3e:var(--cnvs-sys-color-fg-muted-strong);}&:disabled, &.disabled{--background-button-65cb05:var(--cnvs-sys-color-bg-alt-soft);}&[aria-pressed='true']{--background-button-65cb05:var(--cnvs-sys-color-bg-default);--border-button-65cb05:var(--cnvs-sys-color-border-input-default);--color-system-icon-99ce3e:var(--cnvs-sys-color-fg-strong);--label-button-65cb05:var(--cnvs-sys-color-fg-strong);&:hover, &.hover{--color-system-icon-99ce3e:var(--cnvs-sys-color-fg-strong);--label-button-65cb05:var(--cnvs-sys-color-fg-strong);}&:disabled, &.disabled{--border-button-65cb05:var(--cnvs-sys-color-border-input-default);--label-button-65cb05:var(--cnvs-sys-color-fg-strong);--color-system-icon-99ce3e:var(--cnvs-sys-color-fg-strong);}}:dir(rtl){svg{transform:scaleX(-1);}}" },
|
|
15
15
|
modifiers: {
|
|
16
16
|
size: {
|
|
17
|
-
large: { name: "
|
|
18
|
-
medium: { name: "
|
|
19
|
-
small: { name: "
|
|
17
|
+
large: { name: "tc0w3q", styles: "height:var(--cnvs-sys-space-x10);gap:var(--cnvs-sys-space-x2);" },
|
|
18
|
+
medium: { name: "tc0w3r", styles: "height:var(--cnvs-sys-space-x8);" },
|
|
19
|
+
small: { name: "tc0w3s", styles: "font-family:var(--cnvs-sys-font-family-default);font-weight:var(--cnvs-sys-font-weight-bold);line-height:var(--cnvs-sys-line-height-subtext-medium);font-size:var(--cnvs-sys-font-size-subtext-medium);letter-spacing:var(--cnvs-base-letter-spacing-100);height:var(--cnvs-sys-space-x6);" }
|
|
20
20
|
},
|
|
21
21
|
variant: {
|
|
22
|
-
iconOnly: { name: "
|
|
23
|
-
textOnly: { name: "
|
|
24
|
-
iconWithText: { name: "
|
|
22
|
+
iconOnly: { name: "tc0w3t", styles: "" },
|
|
23
|
+
textOnly: { name: "tc0w3u", styles: "" },
|
|
24
|
+
iconWithText: { name: "tc0w3v", styles: "" }
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
compound: [
|
|
28
28
|
{
|
|
29
29
|
modifiers: { size: 'large', variant: 'iconOnly' },
|
|
30
|
-
styles: { name: "
|
|
30
|
+
styles: { name: "tc0w3w", styles: "min-width:var(--cnvs-sys-space-x10);" }
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
modifiers: { size: 'large', variant: 'iconWithText' },
|
|
34
|
-
styles: { name: "
|
|
34
|
+
styles: { name: "tc0w3x", styles: "padding-inline:1.25rem var(--cnvs-sys-space-x6);" }
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
modifiers: { size: 'large', variant: 'textOnly' },
|
|
38
|
-
styles: { name: "
|
|
38
|
+
styles: { name: "tc0w3y", styles: "padding-inline:var(--cnvs-sys-space-x6);" }
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
modifiers: { size: 'medium', variant: 'iconOnly' },
|
|
42
|
-
styles: { name: "
|
|
42
|
+
styles: { name: "tc0w3z", styles: "min-width:var(--cnvs-sys-space-x8);" }
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
modifiers: { size: 'medium', variant: 'iconWithText' },
|
|
46
|
-
styles: { name: "
|
|
46
|
+
styles: { name: "tc0w40", styles: "padding-inline:var(--cnvs-sys-space-x4) 1.25rem;" }
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
modifiers: { size: 'medium', variant: 'textOnly' },
|
|
50
|
-
styles: { name: "
|
|
50
|
+
styles: { name: "tc0w41", styles: "padding-inline:1.25rem;" }
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
modifiers: { size: 'small', variant: 'iconOnly' },
|
|
54
|
-
styles: { name: "
|
|
54
|
+
styles: { name: "tc0w42", styles: "min-width:var(--cnvs-sys-space-x6);" }
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
modifiers: { size: 'small', variant: 'iconWithText' },
|
|
58
|
-
styles: { name: "
|
|
58
|
+
styles: { name: "tc0w43", styles: "padding-inline:var(--cnvs-sys-space-x2) var(--cnvs-sys-space-x3);" }
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
modifiers: { size: 'small', variant: 'textOnly' },
|
|
62
|
-
styles: { name: "
|
|
62
|
+
styles: { name: "tc0w44", styles: "padding-inline:var(--cnvs-sys-space-x3);" }
|
|
63
63
|
}
|
|
64
64
|
]
|
|
65
65
|
}, "segmented-control-item-bc271f");
|
|
@@ -8,14 +8,14 @@ export const segmentedControlListStencil = createStencil({
|
|
|
8
8
|
vars: {
|
|
9
9
|
items: '',
|
|
10
10
|
},
|
|
11
|
-
base: { name: "
|
|
11
|
+
base: { name: "tc0w30", styles: "box-sizing:border-box;display:inline-grid;background-color:var(--cnvs-sys-color-bg-alt-soft);border:0.0625rem solid var(--cnvs-sys-color-border-input-default);border-radius:var(--cnvs-sys-shape-x2);padding:0.1875rem;grid-gap:var(--cnvs-sys-space-x2);" },
|
|
12
12
|
modifiers: {
|
|
13
13
|
disabled: {
|
|
14
|
-
true: { name: "
|
|
14
|
+
true: { name: "tc0w31", styles: "opacity:var(--cnvs-sys-opacity-disabled);" }
|
|
15
15
|
},
|
|
16
16
|
orientation: {
|
|
17
|
-
vertical: { name: "
|
|
18
|
-
horizontal: { name: "
|
|
17
|
+
vertical: { name: "tc0w32", styles: "grid-template-rows:repeat(var(--items-segmented-control-list-0a747c), 1fr);" },
|
|
18
|
+
horizontal: { name: "tc0w33", styles: "grid-template-columns:repeat(var(--items-segmented-control-list-0a747c), 1fr);" }
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
}, "segmented-control-list-0a747c");
|
|
@@ -10,19 +10,19 @@ export const panelStencil = createStencil({
|
|
|
10
10
|
expandedWidth: '',
|
|
11
11
|
collapsedWidth: '',
|
|
12
12
|
},
|
|
13
|
-
base: { name: "
|
|
13
|
+
base: { name: "tc0w4g", 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;" },
|
|
14
14
|
modifiers: {
|
|
15
15
|
variant: {
|
|
16
|
-
alternate: { name: "
|
|
17
|
-
standard: { name: "
|
|
16
|
+
alternate: { name: "tc0w4h", styles: "background-color:var(--cnvs-sys-color-bg-default);box-shadow:var(--cnvs-sys-depth-5);" },
|
|
17
|
+
standard: { name: "tc0w4i", styles: "background-color:var(--cnvs-sys-color-bg-alt-softer);" }
|
|
18
18
|
},
|
|
19
19
|
expanded: {
|
|
20
|
-
true: { name: "
|
|
21
|
-
false: { name: "
|
|
20
|
+
true: { name: "tc0w4j", styles: "width:var(--expandedWidth-panel-bd9477);max-width:var(--expandedWidth-panel-bd9477);" },
|
|
21
|
+
false: { name: "tc0w4k", styles: "width:var(--collapsedWidth-panel-bd9477);max-width:var(--collapsedWidth-panel-bd9477);" }
|
|
22
22
|
},
|
|
23
23
|
touched: {
|
|
24
|
-
true: { name: "
|
|
25
|
-
false: { name: "
|
|
24
|
+
true: { name: "tc0w4l", styles: "" },
|
|
25
|
+
false: { name: "tc0w4m", styles: "animation:none;" }
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
}, "panel-bd9477");
|
|
@@ -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: "tc0w45", 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: "tc0w46", styles: "margin:0;transform:scaleX(1);:dir(rtl){transform:scaleX(-1);}" },
|
|
15
|
+
collapsed: { name: "tc0w47", styles: "margin:auto;inset-inline-start:0;inset-inline-end:0;transform:scaleX(1);:dir(rtl){transform:scaleX(-1);}" },
|
|
16
|
+
expanded: { name: "tc0w48", styles: "margin:0;transform:scaleX(-1);:dir(rtl){transform:scaleX(1);}" },
|
|
17
|
+
expanding: { name: "tc0w49", 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: "tc0w4a", styles: "" },
|
|
21
|
+
right: { name: "tc0w4b", styles: "" }
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
compound: [
|
|
25
25
|
{
|
|
26
26
|
modifiers: { state: 'collapsed', origin: 'right' },
|
|
27
|
-
styles: { name: "
|
|
27
|
+
styles: { name: "tc0w4c", styles: "transform:scaleX(-1);" }
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
modifiers: { state: 'collapsing', origin: 'right' },
|
|
31
|
-
styles: { name: "
|
|
31
|
+
styles: { name: "tc0w4d", 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: "tc0w4e", 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: "tc0w4f", styles: "transform:scaleX(1);inset-inline-start:var(--cnvs-sys-space-x4);" }
|
|
40
40
|
}
|
|
41
41
|
]
|
|
42
42
|
}, "side-panel-toggle-button-da8098");
|
|
@@ -7,31 +7,31 @@ import { systemIconStencil } from '@workday/canvas-kit-react/icon';
|
|
|
7
7
|
import { StatusIndicatorIcon } from './StatusIndicatorIcon';
|
|
8
8
|
import { StatusIndicatorLabel } from './StatusIndicatorLabel';
|
|
9
9
|
const statusIndicatorStencil = createStencil({
|
|
10
|
-
base: { name: "
|
|
10
|
+
base: { name: "tc0w54", styles: "box-sizing:border-box;display:inline-flex;gap:var(--cnvs-sys-space-x1);max-width:12.5rem;align-items:center;border-radius:var(--cnvs-sys-shape-half);height:1.25rem;padding:var(--cnvs-sys-space-zero) var(--cnvs-sys-space-x1);outline:0.0625rem solid transparent;" },
|
|
11
11
|
modifiers: {
|
|
12
12
|
gray: {
|
|
13
|
-
high: { name: "
|
|
14
|
-
low: { name: "
|
|
13
|
+
high: { name: "tc0w55", styles: "color:var(--cnvs-sys-color-static-white);--color-system-icon-99ce3e:var(--cnvs-sys-color-static-white);background:var(--cnvs-sys-color-static-gray-default);" },
|
|
14
|
+
low: { name: "tc0w56", styles: "color:var(--cnvs-sys-color-static-gray-strong);--color-system-icon-99ce3e:var(--cnvs-sys-color-static-gray-strong);background:var(--cnvs-sys-color-static-gray-soft);" }
|
|
15
15
|
},
|
|
16
16
|
orange: {
|
|
17
|
-
high: { name: "
|
|
18
|
-
low: { name: "
|
|
17
|
+
high: { name: "tc0w57", styles: "color:var(--cnvs-sys-color-static-gray-stronger);--color-system-icon-99ce3e:var(--cnvs-sys-color-static-gray-stronger);background:var(--cnvs-sys-color-static-orange-default);" },
|
|
18
|
+
low: { name: "tc0w58", styles: "color:var(--cnvs-sys-color-static-gold-stronger);--color-system-icon-99ce3e:var(--cnvs-sys-color-static-gold-stronger);background:var(--cnvs-sys-color-static-orange-soft);" }
|
|
19
19
|
},
|
|
20
20
|
blue: {
|
|
21
|
-
high: { name: "
|
|
22
|
-
low: { name: "
|
|
21
|
+
high: { name: "tc0w59", styles: "color:var(--cnvs-sys-color-static-white);--color-system-icon-99ce3e:var(--cnvs-sys-color-static-white);background:var(--cnvs-sys-color-static-blue-default);" },
|
|
22
|
+
low: { name: "tc0w5a", styles: "color:var(--cnvs-sys-color-static-blue-strong);--color-system-icon-99ce3e:var(--cnvs-sys-color-static-blue-strong);background:var(--cnvs-sys-color-static-blue-soft);" }
|
|
23
23
|
},
|
|
24
24
|
green: {
|
|
25
|
-
high: { name: "
|
|
26
|
-
low: { name: "
|
|
25
|
+
high: { name: "tc0w5b", styles: "color:var(--cnvs-sys-color-static-white);--color-system-icon-99ce3e:var(--cnvs-sys-color-static-white);background:var(--cnvs-sys-color-static-green-strong);" },
|
|
26
|
+
low: { name: "tc0w5c", styles: "color:var(--cnvs-sys-color-static-green-strong);--color-system-icon-99ce3e:var(--cnvs-sys-color-static-green-strong);background:var(--cnvs-sys-color-static-green-soft);" }
|
|
27
27
|
},
|
|
28
28
|
red: {
|
|
29
|
-
high: { name: "
|
|
30
|
-
low: { name: "
|
|
29
|
+
high: { name: "tc0w5d", styles: "color:var(--cnvs-sys-color-static-white);--color-system-icon-99ce3e:var(--cnvs-sys-color-static-white);background:var(--cnvs-sys-color-static-red-default);" },
|
|
30
|
+
low: { name: "tc0w5e", styles: "color:var(--cnvs-sys-color-static-red-strong);--color-system-icon-99ce3e:var(--cnvs-sys-color-static-red-strong);background:var(--cnvs-sys-color-static-red-soft);" }
|
|
31
31
|
},
|
|
32
32
|
transparent: {
|
|
33
|
-
high: { name: "
|
|
34
|
-
low: { name: "
|
|
33
|
+
high: { name: "tc0w5f", styles: "color:var(--cnvs-sys-color-static-white);--color-system-icon-99ce3e:var(--cnvs-sys-color-static-white);background:var(--cnvs-sys-color-bg-translucent);" },
|
|
34
|
+
low: { name: "tc0w5g", styles: "color:var(--cnvs-sys-color-static-white);--color-system-icon-99ce3e:var(--cnvs-sys-color-static-white);background:var(--cnvs-sys-color-bg-translucent);" }
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
}, "status-indicator-1a565e");
|
|
@@ -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: "tc0w53", 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,15 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import {system} from '@workday/canvas-tokens-web';
|
|
3
|
+
import {brand, system} from '@workday/canvas-tokens-web';
|
|
4
4
|
import {caretDownSmallIcon, searchIcon} from '@workday/canvas-system-icons-web';
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
|
+
ErrorType,
|
|
7
8
|
composeHooks,
|
|
8
9
|
createElemPropsHook,
|
|
9
10
|
createSubcomponent,
|
|
10
11
|
} from '@workday/canvas-kit-react/common';
|
|
11
|
-
import {createStencil, CSProps, handleCsProp} from '@workday/canvas-kit-styling';
|
|
12
|
-
import {InputGroup, TextInput} from '@workday/canvas-kit-react/text-input';
|
|
12
|
+
import {createStencil, CSProps, handleCsProp, px2rem, calc} from '@workday/canvas-kit-styling';
|
|
13
|
+
import {InputGroup, TextInput, textInputStencil} from '@workday/canvas-kit-react/text-input';
|
|
13
14
|
import {SystemIcon} from '@workday/canvas-kit-react/icon';
|
|
14
15
|
import {getCursor} from '@workday/canvas-kit-react/collection';
|
|
15
16
|
import {useComboboxInput, useComboboxInputConstrained} from '@workday/canvas-kit-react/combobox';
|
|
@@ -18,7 +19,8 @@ import {useMultiSelectModel} from './useMultiSelectModel';
|
|
|
18
19
|
import {MultiSelectedItemProps} from './MultiSelectedItem';
|
|
19
20
|
import {MultiSelectedList} from './MultiSelectedList';
|
|
20
21
|
|
|
21
|
-
export const
|
|
22
|
+
export const multiSelectInputStencil = createStencil({
|
|
23
|
+
//@ts-ignore Types don't like defining a variable in `base` and using a variable in a nested selector. One or the other is fine, but not both.
|
|
22
24
|
base: {
|
|
23
25
|
border: `1px solid ${system.color.border.input.default}`,
|
|
24
26
|
display: 'flex',
|
|
@@ -29,12 +31,13 @@ export const multiSelectStencil = createStencil({
|
|
|
29
31
|
minHeight: system.space.x10,
|
|
30
32
|
transition: '0.2s box-shadow, 0.2s border-color',
|
|
31
33
|
margin: 0, // Fix Safari
|
|
34
|
+
[textInputStencil.vars.width]: '100%',
|
|
32
35
|
|
|
33
36
|
'&:hover, &.hover': {
|
|
34
37
|
borderColor: system.color.border.input.strong,
|
|
35
38
|
},
|
|
36
39
|
|
|
37
|
-
'&:focus-
|
|
40
|
+
'&:has(:focus-visible:not([disabled])), &.focus': {
|
|
38
41
|
borderColor: system.color.border.primary.default,
|
|
39
42
|
boxShadow: `inset 0 0 0 1px ${system.color.border.primary.default}`,
|
|
40
43
|
},
|
|
@@ -45,6 +48,12 @@ export const multiSelectStencil = createStencil({
|
|
|
45
48
|
backgroundColor: system.color.bg.transparent,
|
|
46
49
|
borderRadius: system.shape.x1,
|
|
47
50
|
|
|
51
|
+
// collapse the height of the input by the border width so that an empty multi-select
|
|
52
|
+
// is the same height as a `TextInput`
|
|
53
|
+
'&:where([data-part="user-input"], [data-part="form-input"])': {
|
|
54
|
+
height: calc.subtract(system.space.x10, px2rem(2)),
|
|
55
|
+
},
|
|
56
|
+
|
|
48
57
|
// Remove the focus ring - it is handled at the container level
|
|
49
58
|
border: 'none !important',
|
|
50
59
|
boxShadow: 'none !important',
|
|
@@ -88,8 +97,43 @@ export const multiSelectStencil = createStencil({
|
|
|
88
97
|
flexWrap: 'wrap',
|
|
89
98
|
},
|
|
90
99
|
},
|
|
100
|
+
modifiers: {
|
|
101
|
+
error: {
|
|
102
|
+
error: {
|
|
103
|
+
borderColor: brand.error.base,
|
|
104
|
+
boxShadow: `inset 0 0 0 ${px2rem(1)} ${brand.error.base}`,
|
|
105
|
+
'&:has(:hover, :disabled, :focus-visible), &:is(.hover, .disabled, .focus)': {
|
|
106
|
+
borderColor: brand.error.base,
|
|
107
|
+
},
|
|
108
|
+
'&:has(:focus-visible:not([disabled])), &.focus': {
|
|
109
|
+
boxShadow: `inset 0 0 0 ${px2rem(1)} ${brand.error.base}, 0 0 0 2px ${
|
|
110
|
+
system.color.border.inverse
|
|
111
|
+
}, 0 0 0 4px ${brand.common.focusOutline}`,
|
|
112
|
+
outlineOffset: px2rem(2),
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
alert: {
|
|
116
|
+
borderColor: brand.alert.darkest,
|
|
117
|
+
boxShadow: `inset 0 0 0 ${px2rem(2)} ${brand.alert.base}`,
|
|
118
|
+
'&:has(:hover, .hover, :disabled, .disabled, :focus-visible:not([disabled])), .focus:not(:has([disabled]))':
|
|
119
|
+
{
|
|
120
|
+
borderColor: brand.alert.darkest,
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
'&:has(:focus-visible, .focus):not(:has([disabled]))': {
|
|
124
|
+
boxShadow: `inset 0 0 0 ${px2rem(2)} ${brand.alert.base},
|
|
125
|
+
0 0 0 2px ${system.color.border.inverse},
|
|
126
|
+
0 0 0 4px ${brand.common.focusOutline}`,
|
|
127
|
+
},
|
|
128
|
+
outlineOffset: px2rem(2),
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
},
|
|
91
132
|
});
|
|
92
133
|
|
|
134
|
+
/** @deprecated use `multiSelectInputStencil` instead. This will be removed in a future version. */
|
|
135
|
+
export const multiSelectStencil = multiSelectInputStencil;
|
|
136
|
+
|
|
93
137
|
export const useMultiSelectInput = composeHooks(
|
|
94
138
|
createElemPropsHook(useMultiSelectModel)((model, ref) => {
|
|
95
139
|
return {
|
|
@@ -128,7 +172,9 @@ export interface MultiSelectInputProps
|
|
|
128
172
|
React.InputHTMLAttributes<HTMLInputElement>,
|
|
129
173
|
'disabled' | 'className' | 'style' | 'aria-labelledby'
|
|
130
174
|
>,
|
|
131
|
-
Pick<MultiSelectedItemProps, 'removeLabel'> {
|
|
175
|
+
Pick<MultiSelectedItemProps, 'removeLabel'> {
|
|
176
|
+
error?: ErrorType;
|
|
177
|
+
}
|
|
132
178
|
|
|
133
179
|
export const MultiSelectInput = createSubcomponent(TextInput)({
|
|
134
180
|
modelHook: useMultiSelectModel,
|
|
@@ -139,17 +185,17 @@ export const MultiSelectInput = createSubcomponent(TextInput)({
|
|
|
139
185
|
className,
|
|
140
186
|
cs,
|
|
141
187
|
style,
|
|
188
|
+
error,
|
|
142
189
|
'aria-labelledby': ariaLabelledBy,
|
|
143
190
|
removeLabel,
|
|
144
191
|
disabled,
|
|
145
192
|
formInputProps,
|
|
146
193
|
...elemProps
|
|
147
194
|
},
|
|
148
|
-
Element
|
|
149
|
-
model
|
|
195
|
+
Element
|
|
150
196
|
) => {
|
|
151
197
|
return (
|
|
152
|
-
<div {...handleCsProp({className, cs, style},
|
|
198
|
+
<div {...handleCsProp({className, cs, style}, multiSelectInputStencil({error}))}>
|
|
153
199
|
<InputGroup>
|
|
154
200
|
<InputGroup.Input data-part="form-input" {...formInputProps} />
|
|
155
201
|
<InputGroup.Input
|
|
@@ -158,6 +204,7 @@ export const MultiSelectInput = createSubcomponent(TextInput)({
|
|
|
158
204
|
aria-labelledby={ariaLabelledBy}
|
|
159
205
|
readOnly
|
|
160
206
|
disabled={disabled}
|
|
207
|
+
error={error}
|
|
161
208
|
{...elemProps}
|
|
162
209
|
/>
|
|
163
210
|
<InputGroup.InnerEnd pointerEvents="none">
|
|
@@ -184,13 +231,13 @@ export const MultiSelectSearchInput = createSubcomponent(TextInput)({
|
|
|
184
231
|
formInputProps,
|
|
185
232
|
ref,
|
|
186
233
|
disabled,
|
|
234
|
+
error,
|
|
187
235
|
...elemProps
|
|
188
236
|
},
|
|
189
|
-
Element
|
|
190
|
-
model
|
|
237
|
+
Element
|
|
191
238
|
) => {
|
|
192
239
|
return (
|
|
193
|
-
<div {...handleCsProp({className, cs, style},
|
|
240
|
+
<div {...handleCsProp({className, cs, style}, multiSelectInputStencil({}))}>
|
|
194
241
|
<InputGroup>
|
|
195
242
|
<InputGroup.InnerStart pointerEvents="none" width={system.space.x8}>
|
|
196
243
|
<SystemIcon icon={searchIcon} size={system.space.x4} />
|
|
@@ -205,6 +252,7 @@ export const MultiSelectSearchInput = createSubcomponent(TextInput)({
|
|
|
205
252
|
as={Element}
|
|
206
253
|
aria-labelledby={ariaLabelledBy}
|
|
207
254
|
disabled={disabled}
|
|
255
|
+
error={error}
|
|
208
256
|
{...elemProps}
|
|
209
257
|
/>
|
|
210
258
|
<InputGroup.InnerEnd width={system.space.x4}>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-preview-react",
|
|
3
|
-
"version": "14.0.0-alpha.
|
|
3
|
+
"version": "14.0.0-alpha.1129-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",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@emotion/react": "^11.7.1",
|
|
48
48
|
"@emotion/styled": "^11.6.0",
|
|
49
|
-
"@workday/canvas-kit-react": "^14.0.0-alpha.
|
|
50
|
-
"@workday/canvas-kit-styling": "^14.0.0-alpha.
|
|
49
|
+
"@workday/canvas-kit-react": "^14.0.0-alpha.1129-next.0",
|
|
50
|
+
"@workday/canvas-kit-styling": "^14.0.0-alpha.1129-next.0",
|
|
51
51
|
"@workday/canvas-system-icons-web": "^3.0.0",
|
|
52
52
|
"@workday/canvas-tokens-web": "^2.1.1",
|
|
53
53
|
"@workday/design-assets-types": "^0.2.8"
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"react-hook-form": "7.36.1",
|
|
59
59
|
"yup": "^0.32.11"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "27f7b4b0b968875921295a1640e043018e8a0716"
|
|
62
62
|
}
|